[PATCH xf86-video-ati] Add radeon_dirty_src_drawable helper
Michel Dänzer
michel at daenzer.net
Fri Dec 1 14:56:20 UTC 2017
From: Michel Dänzer <michel.daenzer at amd.com>
Allows tidying up radeon_dirty_src_equals and redisplay_dirty slightly.
(Cherry picked from amdgpu commit 1d65ac395971571094df21ca0408d5972c6b56ec)
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
src/radeon.h | 18 +++++++++---------
src/radeon_kms.c | 7 ++-----
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/src/radeon.h b/src/radeon.h
index 3e04101c2..cc5dc09f1 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -191,24 +191,24 @@ radeon_master_screen(ScreenPtr screen)
static inline ScreenPtr
radeon_dirty_master(PixmapDirtyUpdatePtr dirty)
+{
+ return radeon_master_screen(dirty->slave_dst->drawable.pScreen);
+}
+
+static inline DrawablePtr
+radeon_dirty_src_drawable(PixmapDirtyUpdatePtr dirty)
{
#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
- ScreenPtr screen = dirty->src->pScreen;
+ return dirty->src;
#else
- ScreenPtr screen = dirty->src->drawable.pScreen;
+ return &dirty->src->drawable;
#endif
-
- return radeon_master_screen(screen);
}
static inline Bool
radeon_dirty_src_equals(PixmapDirtyUpdatePtr dirty, PixmapPtr pixmap)
{
-#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
- return dirty->src == &pixmap->drawable;
-#else
- return dirty->src == pixmap;
-#endif
+ return radeon_dirty_src_drawable(dirty) == &pixmap->drawable;
}
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 5fcd8f0b7..a9300d400 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -570,11 +570,8 @@ dirty_region(PixmapDirtyUpdatePtr dirty)
static void
redisplay_dirty(PixmapDirtyUpdatePtr dirty, RegionPtr region)
{
-#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
- ScrnInfoPtr src_scrn = xf86ScreenToScrn(dirty->src->pScreen);
-#else
- ScrnInfoPtr src_scrn = xf86ScreenToScrn(dirty->src->drawable.pScreen);
-#endif
+ ScrnInfoPtr src_scrn =
+ xf86ScreenToScrn(radeon_dirty_src_drawable(dirty)->pScreen);
if (RegionNil(region))
goto out;
--
2.15.0
More information about the amd-gfx
mailing list