[PATCH xf86-video-amdgpu 1/3] Don't advertise any PRIME offloading capabilities without acceleration

Michel Dänzer michel at daenzer.net
Mon Feb 15 09:46:23 UTC 2016


From: Michel Dänzer <michel.daenzer at amd.com>

Acceleration is required even for display offloading. Trying to enable
display offloading without acceleration resulted in a crash.

(ported from radeon commit b19417e2fddf4df725951aea5ad5e9558338f59e)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/amdgpu_kms.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index b9e4eb7..c466362 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -678,25 +678,23 @@ static Bool amdgpu_get_tile_config(ScrnInfoPtr pScrn)
 static void AMDGPUSetupCapabilities(ScrnInfoPtr pScrn)
 {
 #ifdef AMDGPU_PIXMAP_SHARING
+	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
 	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
 	uint64_t value;
 	int ret;
 
 	pScrn->capabilities = 0;
+
+	/* PRIME offloading requires acceleration */
+	if (!info->use_glamor)
+		return;
+
 	ret = drmGetCap(pAMDGPUEnt->fd, DRM_CAP_PRIME, &value);
 	if (ret == 0) {
-		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;
-		}
+		if (value & DRM_PRIME_CAP_EXPORT)
+			pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SinkOffload;
+		if (value & DRM_PRIME_CAP_IMPORT)
+			pScrn->capabilities |= RR_Capability_SinkOutput | RR_Capability_SourceOffload;
 	}
 #endif
 }
-- 
2.7.0



More information about the xorg-driver-ati mailing list