summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-08-29 17:05:19 +0900
committerMichel Dänzer <michel@daenzer.net>2017-08-30 17:10:03 +0900
commit19672625df0531c12acc05999ea09ea763e5db59 (patch)
tree0516526eabb475133725b23c65b1dc0b9bd4f349
parent6b376c8d73b20c92755527edb0527a233886e4eb (diff)
Create amdgpu_master_screen helper
Preparatory, no functional change intended yet. (Ported from radeon commit 7f0cd68d1b0c132e32ae736371bce3e12ed33c7a) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/amdgpu_drv.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index 75c2a26..8b378b1 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -172,6 +172,15 @@ typedef enum {
#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)
{
#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
@@ -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