[PATCH xf86-video-amdgpu 4/6] Create amdgpu_master_screen helper

Michel Dänzer michel at daenzer.net
Tue Aug 29 08:30:47 UTC 2017


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

Preparatory, no functional change intended yet.

(Ported from radeon commit 7f0cd68d1b0c132e32ae736371bce3e12ed33c7a)

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

diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index 75c2a2653..8b378b18a 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -171,6 +171,15 @@ typedef enum {
 #define amdgpu_is_gpu_screen(screen) (screen)->isGPU
 #define amdgpu_is_gpu_scrn(scrn) (scrn)->is_gpu
 
+static inline ScreenPtr
+amdgpu_master_screen(ScreenPtr screen)
+{
+	if (screen->current_master)
+		return screen->current_master;
+
+	return screen;
+}
+
 static inline ScreenPtr
 amdgpu_dirty_master(PixmapDirtyUpdatePtr dirty)
 {
@@ -180,10 +189,7 @@ amdgpu_dirty_master(PixmapDirtyUpdatePtr dirty)
 	ScreenPtr screen = dirty->src->drawable.pScreen;
 #endif
 
-	if (screen->current_master)
-		return screen->current_master;
-
-	return screen;
+	return amdgpu_master_screen(screen);
 }
 
 static inline Bool
-- 
2.14.1



More information about the amd-gfx mailing list