<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 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" 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> Wednesday, April 24, 2019 6:32 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> [PATCH xf86-video-ati] Retry get_fb_ptr in get_fb</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">From: Michel Dänzer <michel.daenzer@amd.com><br>
<br>
If get_fb_ptr returns NULL, try again after pixmap_get_handle, it should<br>
work then.<br>
<br>
Fixes spurious Present page flipping failures using "normal" pixmaps<br>
which aren't shared with direct rendering clients, e.g. with a<br>
compositor using the RENDER extension.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/110417">https://bugs.freedesktop.org/110417</a><br>
(Ported from amdgpu commit bf61e6d7ac1a5754b1026d7f80acf25ef622c491)<br>
<br>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com><br>
---<br>
 src/radeon.h | 31 ++++++++++++++++---------------<br>
 1 file changed, 16 insertions(+), 15 deletions(-)<br>
<br>
diff --git a/src/radeon.h b/src/radeon.h<br>
index 74454c307..008a59f3a 100644<br>
--- a/src/radeon.h<br>
+++ b/src/radeon.h<br>
@@ -877,21 +877,22 @@ static inline struct drmmode_fb*<br>
 radeon_pixmap_get_fb(PixmapPtr pix)<br>
 {<br>
     struct drmmode_fb **fb_ptr = radeon_pixmap_get_fb_ptr(pix);<br>
-<br>
-    if (!fb_ptr)<br>
-       return NULL;<br>
-<br>
-    if (!*fb_ptr) {<br>
-       uint32_t handle;<br>
-<br>
-       if (radeon_get_pixmap_handle(pix, &handle)) {<br>
-           ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);<br>
-           RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);<br>
-<br>
-           *fb_ptr = radeon_fb_create(scrn, pRADEONEnt->fd, pix->drawable.width,<br>
-                                      pix->drawable.height, pix->devKind,<br>
-                                      handle);<br>
-       }<br>
+    uint32_t handle;<br>
+<br>
+    if (fb_ptr && *fb_ptr)<br>
+       return *fb_ptr;<br>
+       <br>
+    if (radeon_get_pixmap_handle(pix, &handle)) {<br>
+       ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);<br>
+       RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);<br>
+<br>
+       if (!fb_ptr)<br>
+           fb_ptr = radeon_pixmap_get_fb_ptr(pix);<br>
+<br>
+       *fb_ptr = radeon_fb_create(scrn, pRADEONEnt->fd,<br>
+                                  pix->drawable.width,<br>
+                                  pix->drawable.height, pix->devKind,<br>
+                                  handle);<br>
     }<br>
 <br>
     return *fb_ptr;<br>
-- <br>
2.20.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></div>
</span></font></div>
</body>
</html>