summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2014-08-06 11:08:00 +0900
committerMichel Dänzer <michel@daenzer.net>2014-10-23 10:05:15 +0900
commitc74de9fec13fac2c836bb2a07ae6f90e1d61e667 (patch)
treee85cd1db0dbcf6874a02e7db16f8e7d63af46748
parent636a6382f80412ae4e28abe0cd9f98f84cd52291 (diff)
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 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/radeon_kms.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 46669883..b6d11e88 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -778,10 +778,16 @@ static void RADEONSetupCapabilities(ScrnInfoPtr pScrn)
pScrn->capabilities = 0;
ret = drmGetCap(info->dri2.drm_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;
+ if (value & DRM_PRIME_CAP_EXPORT) {
+ pScrn->capabilities |= RR_Capability_SourceOutput;
+ if (!info->r600_shadow_fb && info->dri2.available)
+ pScrn->capabilities |= RR_Capability_SinkOffload;
+ }
+ if (value & DRM_PRIME_CAP_IMPORT) {
+ pScrn->capabilities |= RR_Capability_SinkOutput;
+ if (!info->r600_shadow_fb && info->dri2.available)
+ pScrn->capabilities |= RR_Capability_SourceOffload;
+ }
}
#endif
}