Commit bf61e6d7 authored by Michel Dänzer's avatar Michel Dänzer Committed by Michel Dänzer

Retry get_fb_ptr in get_fb

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/110417Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent bd4ffd4e
Pipeline #32907 passed with stages
in 1 minute and 11 seconds
......@@ -143,21 +143,22 @@ static inline struct drmmode_fb*
amdgpu_pixmap_get_fb(PixmapPtr pix)
{
struct drmmode_fb **fb_ptr = amdgpu_pixmap_get_fb_ptr(pix);
uint32_t handle;
if (!fb_ptr)
return NULL;
if (!*fb_ptr) {
uint32_t handle;
if (fb_ptr && *fb_ptr)
return *fb_ptr;
if (amdgpu_pixmap_get_handle(pix, &handle)) {
ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
if (amdgpu_pixmap_get_handle(pix, &handle)) {
ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
if (!fb_ptr)
fb_ptr = amdgpu_pixmap_get_fb_ptr(pix);
*fb_ptr = amdgpu_fb_create(scrn, pAMDGPUEnt->fd, pix->drawable.width,
pix->drawable.height, pix->devKind,
handle);
}
*fb_ptr = amdgpu_fb_create(scrn, pAMDGPUEnt->fd,
pix->drawable.width,
pix->drawable.height, pix->devKind,
handle);
}
return *fb_ptr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment