Commit 83a47c0e authored by Michel Dänzer's avatar Michel Dänzer Committed by Michel Dänzer

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: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 560b7fe6
......@@ -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
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment