<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Michel Dänzer <michel@daenzer.net><br>
<b>Sent:</b> Friday, December 1, 2017 9:56 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> [PATCH xf86-video-ati] Add radeon_dirty_src_drawable helper</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">From: Michel Dänzer <michel.daenzer@amd.com><br>
<br>
Allows tidying up radeon_dirty_src_equals and redisplay_dirty slightly.<br>
<br>
(Cherry picked from amdgpu commit 1d65ac395971571094df21ca0408d5972c6b56ec)<br>
<br>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com></div>
<div class="PlainText"><br>
</div>
<div class="PlainText">Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div class="PlainText"><br>
---<br>
src/radeon.h | 18 +++++++++---------<br>
src/radeon_kms.c | 7 ++-----<br>
2 files changed, 11 insertions(+), 14 deletions(-)<br>
<br>
diff --git a/src/radeon.h b/src/radeon.h<br>
index 3e04101c2..cc5dc09f1 100644<br>
--- a/src/radeon.h<br>
+++ b/src/radeon.h<br>
@@ -191,24 +191,24 @@ radeon_master_screen(ScreenPtr screen)<br>
<br>
static inline ScreenPtr<br>
radeon_dirty_master(PixmapDirtyUpdatePtr dirty)<br>
+{<br>
+ return radeon_master_screen(dirty->slave_dst->drawable.pScreen);<br>
+}<br>
+<br>
+static inline DrawablePtr<br>
+radeon_dirty_src_drawable(PixmapDirtyUpdatePtr dirty)<br>
{<br>
#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC<br>
- ScreenPtr screen = dirty->src->pScreen;<br>
+ return dirty->src;<br>
#else<br>
- ScreenPtr screen = dirty->src->drawable.pScreen;<br>
+ return &dirty->src->drawable;<br>
#endif<br>
-<br>
- return radeon_master_screen(screen);<br>
}<br>
<br>
static inline Bool<br>
radeon_dirty_src_equals(PixmapDirtyUpdatePtr dirty, PixmapPtr pixmap)<br>
{<br>
-#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC<br>
- return dirty->src == &pixmap->drawable;<br>
-#else<br>
- return dirty->src == pixmap;<br>
-#endif<br>
+ return radeon_dirty_src_drawable(dirty) == &pixmap->drawable;<br>
}<br>
<br>
<br>
diff --git a/src/radeon_kms.c b/src/radeon_kms.c<br>
index 5fcd8f0b7..a9300d400 100644<br>
--- a/src/radeon_kms.c<br>
+++ b/src/radeon_kms.c<br>
@@ -570,11 +570,8 @@ dirty_region(PixmapDirtyUpdatePtr dirty)<br>
static void<br>
redisplay_dirty(PixmapDirtyUpdatePtr dirty, RegionPtr region)<br>
{<br>
-#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC<br>
- ScrnInfoPtr src_scrn = xf86ScreenToScrn(dirty->src->pScreen);<br>
-#else<br>
- ScrnInfoPtr src_scrn = xf86ScreenToScrn(dirty->src->drawable.pScreen);<br>
-#endif<br>
+ ScrnInfoPtr src_scrn =<br>
+ xf86ScreenToScrn(radeon_dirty_src_drawable(dirty)->pScreen);<br>
<br>
if (RegionNil(region))<br>
goto out;<br>
-- <br>
2.15.0<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" id="LPlnk977905" previewremoved="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>