From: Quanxian Wang Date: Thu, 25 Sep 2014 02:04:11 +0000 (+0200) Subject: compositor-drm: Work around page flip not setting tiling mode on BYT X-Git-Tag: submit/tizen/20151116.055554~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f85d80e892eab8f6cf628c7abe4734ee8cb6ae66;p=platform%2Fupstream%2Fweston.git compositor-drm: Work around page flip not setting tiling mode on BYT The page flip ioctl() doesn't switch the tiling mode on BYT. That causes cause display corruption when doing the renderer switch, since the dumb buffer is untiled and the back buffers used by the GL renderer are use X tiling. Change-Id: I2f03ac44c1aa15e15b5a2a394932e94af2654124 Author: Quanxian Wang Signed-off-by: Manuel Bachmann --- diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 90378e7c..4829ff34 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -167,6 +167,7 @@ struct drm_output { int vblank_pending; int page_flip_pending; int destroy_pending; + int force_modeset; struct gbm_surface *surface; struct gbm_bo *cursor_bo[2]; @@ -614,7 +615,8 @@ drm_output_repaint(struct weston_output *output_base, mode = container_of(output->base.current_mode, struct drm_mode, base); if (!output->current || - output->current->stride != output->next->stride) { + output->current->stride != output->next->stride || + output->force_modeset) { ret = drmModeSetCrtc(compositor->drm.fd, output->crtc_id, output->next->fb_id, 0, 0, &output->connector_id, 1, @@ -624,6 +626,7 @@ drm_output_repaint(struct weston_output *output_base, goto err_pageflip; } output_base->set_dpms(output_base, WESTON_DPMS_ON); + output->force_modeset = 0; } if (drmModePageFlip(compositor->drm.fd, output->crtc_id, @@ -2788,8 +2791,11 @@ switch_to_gl_renderer(struct drm_compositor *c) assert(0); } - wl_list_for_each(output, &c->base.output_list, base.link) + wl_list_for_each(output, &c->base.output_list, base.link) { + /* Workaround page flip not setting the tiling mode on BYT */ + output->force_modeset = 1; drm_output_init_egl(output, c); + } c->use_pixman = 0; }