All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH xf86-video-ati] Retry get_fb_ptr in get_fb
@ 2019-04-24 10:32 Michel Dänzer
       [not found] ` <20190424103230.20174-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Michel Dänzer @ 2019-04-24 10:32 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Michel Dänzer <michel.daenzer@amd.com>

If get_fb_ptr returns NULL, try again after pixmap_get_handle, it should
work then.

Fixes spurious Present page flipping failures using "normal" pixmaps
which aren't shared with direct rendering clients, e.g. with a
compositor using the RENDER extension.

Bugzilla: https://bugs.freedesktop.org/110417
(Ported from amdgpu commit bf61e6d7ac1a5754b1026d7f80acf25ef622c491)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/radeon.h | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/radeon.h b/src/radeon.h
index 74454c307..008a59f3a 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -877,21 +877,22 @@ static inline struct drmmode_fb*
 radeon_pixmap_get_fb(PixmapPtr pix)
 {
     struct drmmode_fb **fb_ptr = radeon_pixmap_get_fb_ptr(pix);
-
-    if (!fb_ptr)
-	return NULL;
-
-    if (!*fb_ptr) {
-	uint32_t handle;
-
-	if (radeon_get_pixmap_handle(pix, &handle)) {
-	    ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);
-	    RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
-
-	    *fb_ptr = radeon_fb_create(scrn, pRADEONEnt->fd, pix->drawable.width,
-				       pix->drawable.height, pix->devKind,
-				       handle);
-	}
+    uint32_t handle;
+
+    if (fb_ptr && *fb_ptr)
+	return *fb_ptr;
+	
+    if (radeon_get_pixmap_handle(pix, &handle)) {
+	ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);
+	RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
+
+	if (!fb_ptr)
+	    fb_ptr = radeon_pixmap_get_fb_ptr(pix);
+
+	*fb_ptr = radeon_fb_create(scrn, pRADEONEnt->fd,
+				   pix->drawable.width,
+				   pix->drawable.height, pix->devKind,
+				   handle);
     }
 
     return *fb_ptr;
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH xf86-video-ati] Retry get_fb_ptr in get_fb
       [not found] ` <20190424103230.20174-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2019-04-24 15:26   ` Deucher, Alexander
  0 siblings, 0 replies; 2+ messages in thread
From: Deucher, Alexander @ 2019-04-24 15:26 UTC (permalink / raw)
  To: Michel Dänzer, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 2668 bytes --]

Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Michel Dänzer <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
Sent: Wednesday, April 24, 2019 6:32 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH xf86-video-ati] Retry get_fb_ptr in get_fb

From: Michel Dänzer <michel.daenzer-5C7GfCeVMHo@public.gmane.org>

If get_fb_ptr returns NULL, try again after pixmap_get_handle, it should
work then.

Fixes spurious Present page flipping failures using "normal" pixmaps
which aren't shared with direct rendering clients, e.g. with a
compositor using the RENDER extension.

Bugzilla: https://bugs.freedesktop.org/110417
(Ported from amdgpu commit bf61e6d7ac1a5754b1026d7f80acf25ef622c491)

Signed-off-by: Michel Dänzer <michel.daenzer-5C7GfCeVMHo@public.gmane.org>
---
 src/radeon.h | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/radeon.h b/src/radeon.h
index 74454c307..008a59f3a 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -877,21 +877,22 @@ static inline struct drmmode_fb*
 radeon_pixmap_get_fb(PixmapPtr pix)
 {
     struct drmmode_fb **fb_ptr = radeon_pixmap_get_fb_ptr(pix);
-
-    if (!fb_ptr)
-       return NULL;
-
-    if (!*fb_ptr) {
-       uint32_t handle;
-
-       if (radeon_get_pixmap_handle(pix, &handle)) {
-           ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);
-           RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
-
-           *fb_ptr = radeon_fb_create(scrn, pRADEONEnt->fd, pix->drawable.width,
-                                      pix->drawable.height, pix->devKind,
-                                      handle);
-       }
+    uint32_t handle;
+
+    if (fb_ptr && *fb_ptr)
+       return *fb_ptr;
+
+    if (radeon_get_pixmap_handle(pix, &handle)) {
+       ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);
+       RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn);
+
+       if (!fb_ptr)
+           fb_ptr = radeon_pixmap_get_fb_ptr(pix);
+
+       *fb_ptr = radeon_fb_create(scrn, pRADEONEnt->fd,
+                                  pix->drawable.width,
+                                  pix->drawable.height, pix->devKind,
+                                  handle);
     }

     return *fb_ptr;
--
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 5487 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-24 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 10:32 [PATCH xf86-video-ati] Retry get_fb_ptr in get_fb Michel Dänzer
     [not found] ` <20190424103230.20174-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2019-04-24 15:26   ` Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.