[PATCH xf86-video-ati] Add radeon_dirty_src_drawable helper

Deucher, Alexander Alexander.Deucher at amd.com
Fri Dec 1 15:22:06 UTC 2017


________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Michel Dänzer <michel at daenzer.net>
Sent: Friday, December 1, 2017 9:56 AM
To: amd-gfx at lists.freedesktop.org
Subject: [PATCH xf86-video-ati] Add radeon_dirty_src_drawable helper

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>

Acked-by: Alex Deucher <alexander.deucher 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

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20171201/103946ea/attachment.html>


More information about the amd-gfx mailing list