Wait pending flip before setting new frontbuffer when resize screen
PATCH 1/1 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.
--- src/drmmode_display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
src/drmmode_display.c +14 -0
@@ -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,
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1503025848-9197-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org
Hi:
Please ignore this patch. the extant patch could fix the problem.
Thanks
JimQu
________________________________________
发件人: Jim Qu <[email protected]>
发送时间: 2017年8月18日 11:10
收件人: [email protected]
抄送: 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.
--- src/drmmode_display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
src/drmmode_display.c +14 -0
@@ -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
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx