Skip to contentSkip to conversation

Improve AMDGPUPreInitAccel_KMS log messages

PATCH In review Michel Dänzer 2 participants 2 messages Jun 8, 2017 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Improve AMDGPUPreInitAccel_KMS log messages

From: Michel Dänzer <[email protected]>

Now it should always be clear in the log file why acceleration isn't enabled.

---
 src/amdgpu_glamor.c |  3 ---
 src/amdgpu_kms.c    | 23 +++++++++++++----------
 2 files changed, 13 insertions(+), 13 deletions(-)
src/amdgpu_glamor.c +0 -3
index 5583cd382..197592aa0 100644
@@ -81,9 +81,6 @@ Bool amdgpu_glamor_pre_init(ScrnInfoPtr scrn)
 	pointer glamor_module;
 	CARD32 version;
 
-	if (!info->dri2.available)
-		return FALSE;
-
 	if (scrn->depth < 24) {
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			   "glamor requires depth >= 24, disabling.\n");
src/amdgpu_kms.c +13 -10
index 69d61943d..784f7388a 100644
@@ -1191,19 +1191,22 @@ static Bool AMDGPUPreInitAccel_KMS(ScrnInfoPtr pScrn)
 
 		if (info->dri2.available)
 			info->gbm = gbm_create_device(pAMDGPUEnt->fd);
-		if (info->gbm == NULL)
-			info->dri2.available = FALSE;
 
-		if (use_glamor &&
-			amdgpu_glamor_pre_init(pScrn))
-			return TRUE;
-
-		if (info->dri2.available)
-			return TRUE;
+		if (info->gbm) {
+			if (!use_glamor ||
+			    amdgpu_glamor_pre_init(pScrn))
+				return TRUE;
+		} else {
+			xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+				   "gbm_create_device returned NULL, using "
+				   "ShadowFB\n");
+		}
+	} else {
+		xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+			   "GPU acceleration disabled, using ShadowFB\n");
 	}
 
-	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-		   "GPU accel disabled or not working, using shadowfb for KMS\n");
+	info->dri2.available = FALSE;
 	info->shadow_fb = TRUE;
 	if (!xf86LoadSubModule(pScrn, "shadow"))
 		info->shadow_fb = FALSE;
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20170608014939.3100-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

Reviewed-by Alex Deucher
#2 lore raw
Quoted 8 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Wednesday, June 07, 2017 9:50 PM
To: [email protected]
Subject: [PATCH xf86-video-amdgpu] Improve AMDGPUPreInitAccel_KMS log messages

Quoted 6 lines

From: Michel Dänzer <[email protected]>

Now it should always be clear in the log file why acceleration isn't enabled.

Quoted 62 lines
---
 src/amdgpu_glamor.c |  3 ---
 src/amdgpu_kms.c    | 23 +++++++++++++----------
 2 files changed, 13 insertions(+), 13 deletions(-)
src/amdgpu_glamor.c +0 -3
index 5583cd382..197592aa0 100644
@@ -81,9 +81,6 @@ Bool amdgpu_glamor_pre_init(ScrnInfoPtr scrn)
 	pointer glamor_module;
 	CARD32 version;
 
-	if (!info->dri2.available)
-		return FALSE;
-
 	if (scrn->depth < 24) {
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			   "glamor requires depth >= 24, disabling.\n");
src/amdgpu_kms.c +13 -10
index 69d61943d..784f7388a 100644
@@ -1191,19 +1191,22 @@ static Bool
 AMDGPUPreInitAccel_KMS(ScrnInfoPtr pScrn)
 
 		if (info->dri2.available)
 			info->gbm = gbm_create_device(pAMDGPUEnt-
 >fd);
-		if (info->gbm == NULL)
-			info->dri2.available = FALSE;
 
-		if (use_glamor &&
-			amdgpu_glamor_pre_init(pScrn))
-			return TRUE;
-
-		if (info->dri2.available)
-			return TRUE;
+		if (info->gbm) {
+			if (!use_glamor ||
+			    amdgpu_glamor_pre_init(pScrn))
+				return TRUE;
+		} else {
+			xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+				   "gbm_create_device returned NULL, using "
+				   "ShadowFB\n");
+		}
+	} else {
+		xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+			   "GPU acceleration disabled, using ShadowFB\n");
 	}
 
-	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-		   "GPU accel disabled or not working, using shadowfb for
 KMS\n");
+	info->dri2.available = FALSE;
src/amdgpu_kms.c +0 -1
 	info->shadow_fb = TRUE;
 	if (!xf86LoadSubModule(pScrn, "shadow"))
 		info->shadow_fb = FALSE;
--

2.11.0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx