Module Name: xsrc
Committed By: mrg
Date: Fri Aug 27 01:01:19 UTC 2021
Modified Files:
xsrc/external/mit/xf86-video-amdgpu/dist/src: amdgpu_probe.c
Log Message:
restore the set version call in amdgpu_open_drm_master().
now this works again with reredrum branch.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 \
xsrc/external/mit/xf86-video-amdgpu/dist/src/amdgpu_probe.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xf86-video-amdgpu/dist/src/amdgpu_probe.c
diff -u xsrc/external/mit/xf86-video-amdgpu/dist/src/amdgpu_probe.c:1.1.1.7 xsrc/external/mit/xf86-video-amdgpu/dist/src/amdgpu_probe.c:1.2
--- xsrc/external/mit/xf86-video-amdgpu/dist/src/amdgpu_probe.c:1.1.1.7 Mon Aug 23 21:18:40 2021
+++ xsrc/external/mit/xf86-video-amdgpu/dist/src/amdgpu_probe.c Fri Aug 27 01:01:18 2021
@@ -196,10 +196,29 @@ static Bool amdgpu_open_drm_master(ScrnI
struct xf86_platform_device *platform_dev,
AMDGPUEntPtr pAMDGPUEnt)
{
+ drmSetVersion sv;
+ int err;
+
pAMDGPUEnt->fd = amdgpu_kernel_open_fd(pScrn, pci_dev, platform_dev, pAMDGPUEnt);
if (pAMDGPUEnt->fd == -1)
return FALSE;
+ /* Check that what we opened was a master or a master-capable FD,
+ * by setting the version of the interface we'll use to talk to it.
+ * (see DRIOpenDRMMaster() in DRI1)
+ */
+ sv.drm_di_major = 1;
+ sv.drm_di_minor = 1;
+ sv.drm_dd_major = -1;
+ sv.drm_dd_minor = -1;
+ err = drmSetInterfaceVersion(pAMDGPUEnt->fd, &sv);
+ if (err != 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "[drm] failed to set drm interface version.\n");
+ amdgpu_kernel_close_fd(pAMDGPUEnt);
+ return FALSE;
+ }
+
/* Check that what we opened is a master or a master-capable FD */
if (!local_drmIsMaster(pAMDGPUEnt->fd)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,