mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-04-14 11:04:42 +00:00
amdgpu_probe: fix build w/o XSERVER_PLATFORM_BUS
On NetBSD (and possibly others) we don't have XSERVER_PLATFORM_BUS enabled, due lack of udev & kms. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
b9cfbae613
commit
2aee7058c0
@@ -1774,9 +1774,11 @@ static Bool amdgpu_set_drm_master(ScrnInfoPtr pScrn)
|
||||
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
|
||||
int err;
|
||||
|
||||
#ifdef XSERVER_PLATFORM_BUS
|
||||
if (pAMDGPUEnt->platform_dev &&
|
||||
(pAMDGPUEnt->platform_dev->flags & XF86_PDEV_SERVER_FD))
|
||||
return TRUE;
|
||||
#endif /* XSERVER_PLATFORM_BUS */
|
||||
|
||||
err = drmSetMaster(pAMDGPUEnt->fd);
|
||||
if (err)
|
||||
@@ -1789,9 +1791,11 @@ static void amdgpu_drop_drm_master(ScrnInfoPtr pScrn)
|
||||
{
|
||||
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
|
||||
|
||||
#ifdef XSERVER_PLATFORM_BUS
|
||||
if (pAMDGPUEnt->platform_dev &&
|
||||
(pAMDGPUEnt->platform_dev->flags & XF86_PDEV_SERVER_FD))
|
||||
return;
|
||||
#endif /* XSERVER_PLATFORM_BUS */
|
||||
|
||||
drmDropMaster(pAMDGPUEnt->fd);
|
||||
}
|
||||
|
||||
@@ -129,6 +129,7 @@ static int amdgpu_kernel_open_fd(ScrnInfoPtr pScrn,
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef XSERVER_PLATFORM_BUS
|
||||
if (platform_dev) {
|
||||
fd = xf86_get_platform_device_int_attrib(platform_dev,
|
||||
ODEV_ATTRIB_FD, -1);
|
||||
@@ -142,6 +143,7 @@ static int amdgpu_kernel_open_fd(ScrnInfoPtr pScrn,
|
||||
if (fd != -1)
|
||||
return fd;
|
||||
}
|
||||
#endif /* XSERVER_PLATFORM_BUS */
|
||||
|
||||
if (!amdgpu_kernel_mode_enabled(pScrn))
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user