答复: [PATCH] Wait pending flip before setting new frontbuffer when resize screen

Qu, Jim Jim.Qu at amd.com
Fri Aug 18 05:47:39 UTC 2017


Hi:

Please ignore this patch. the extant patch could fix the problem.

https://cgit.freedesktop.org/xorg/driver/xf86-video-amdgpu/commit/?id=af7221e1c4d2dbdfd488eb0976a835584ea8441c

Thanks
JimQu

________________________________________
发件人: Jim Qu <Jim.Qu at amd.com>
发送时间: 2017年8月18日 11:10
收件人: amd-gfx at lists.freedesktop.org
抄送: Qu, Jim
主题: [PATCH] Wait pending flip before setting new frontbuffer when resize screen

the patch fixs the display can not light up after hotplug with DRI3
enabled, the drmmode_crtc->flip_pending records old fb address which
will be freed during setting new frontbuffer,meanwhile, the allocator
set the same address as freed fb to output_ids[] in drmmode_set_mode_
major(). In the next drmHandleEvent(), driver will update the content
of drmmode_crtc->flip_pending indexed, that says, output_ids[0] is
changed. therefore, drmModeSetCrtc() will be failed duo to unknown
connector id.

with the patch, in drmmode_flip_handler(), the drmmode_crtc->flip_pending
will be cleared.

Change-Id: I4f6b411129547d30cf109ba7f564815f759f9380
Signed-off-by: Jim Qu <Jim.Qu at amd.com>
---
 src/drmmode_display.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 552bff8..15aad0b 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2142,6 +2142,20 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
        xf86DrvMsg(scrn->scrnIndex, X_INFO, " => pitch %d bytes\n", pitch);
        scrn->displayWidth = pitch / cpp;

+       for (i = 0; i < xf86_config->num_crtc; i++) {
+               xf86CrtcPtr crtc = xf86_config->crtc[i];
+               AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
+               drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+               drmmode_ptr drmmode = drmmode_crtc->drmmode;
+
+               if (!crtc->enabled)
+                       continue;
+
+               /* Wait for any pending flip to finish */
+               while (drmmode_crtc->flip_pending && drmHandleEvent(pAMDGPUEnt->fd,
+                       &drmmode->event_context) > 0);
+       }
+
        if (info->use_glamor ||
            (info->front_buffer->flags & AMDGPU_BO_FLAGS_GBM)) {
                screen->ModifyPixmapHeader(ppix,
--
1.9.1



More information about the amd-gfx mailing list