mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-24 01:24:31 +00:00
PRIME: Don't advertise offload capabilities when acceleration is disabled
Xorg tends to crash if the user tries to actually use the offload capabilities with acceleration disabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57200 (ported from radeon commit c74de9fec13fac2c836bb2a07ae6f90e1d61e667) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Michel Dänzer
parent
560b7fe6dc
commit
83a47c0ebe
@@ -668,14 +668,18 @@ static void AMDGPUSetupCapabilities(ScrnInfoPtr pScrn)
|
||||
pScrn->capabilities = 0;
|
||||
ret = drmGetCap(pAMDGPUEnt->fd, DRM_CAP_PRIME, &value);
|
||||
if (ret == 0) {
|
||||
if (value & DRM_PRIME_CAP_EXPORT)
|
||||
pScrn->capabilities |=
|
||||
RR_Capability_SourceOutput |
|
||||
RR_Capability_SinkOffload;
|
||||
if (value & DRM_PRIME_CAP_IMPORT)
|
||||
pScrn->capabilities |=
|
||||
RR_Capability_SourceOffload |
|
||||
RR_Capability_SinkOutput;
|
||||
AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
|
||||
|
||||
if (value & DRM_PRIME_CAP_EXPORT) {
|
||||
pScrn->capabilities |= RR_Capability_SourceOutput;
|
||||
if (info->use_glamor && info->dri2.available)
|
||||
pScrn->capabilities |= RR_Capability_SinkOffload;
|
||||
}
|
||||
if (value & DRM_PRIME_CAP_IMPORT) {
|
||||
pScrn->capabilities |= RR_Capability_SinkOutput;
|
||||
if (info->use_glamor && info->dri2.available)
|
||||
pScrn->capabilities |= RR_Capability_SourceOffload;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user