[PATCH xf86-video-amdgpu 2/2] Bail if there's a problem with ShadowFB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michel Dänzer <michel.daenzer@xxxxxxx>

If we hit a problem while setting up ShadowFB, just carrying on trying
to set up HW acceleration instead is unlikely to work.

(Ported from radeon commit 7d435354099119234d443b07e2df1c7b9f97cf3c)

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

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index e3d7d71cf..3598dd23f 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1174,11 +1174,11 @@ static Bool AMDGPUPreInitAccel_KMS(ScrnInfoPtr pScrn)
 			   "GPU acceleration disabled, using ShadowFB\n");
 	}
 
-	info->dri2.available = FALSE;
-	info->shadow_fb = TRUE;
 	if (!xf86LoadSubModule(pScrn, "shadow"))
-		info->shadow_fb = FALSE;
+		return FALSE;
 
+	info->dri2.available = FALSE;
+	info->shadow_fb = TRUE;
 	return TRUE;
 }
 
@@ -1727,7 +1727,7 @@ Bool AMDGPUScreenInit_KMS(ScreenPtr pScreen, int argc, char **argv)
 		if (info->fb_shadow == NULL) {
 			xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 				   "Failed to allocate shadow framebuffer\n");
-			info->shadow_fb = FALSE;
+			return FALSE;
 		} else {
 			if (!fbScreenInit(pScreen, info->fb_shadow,
 					  pScrn->virtualX, pScrn->virtualY,
-- 
2.14.2



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux