From 909300f6b91a0fc367397d6880759cc91fec4806 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Tue, 1 Dec 2009 14:16:32 +0800 Subject: [PATCH] Wait rendering to fb before modesetting Safely wait rendering to be complete for front buffer before modesetting. Kernel does interruptible wait for this, but signals would abort it which fails the whole modesetting process. Signed-off-by: Zhenyu Wang --- src/drmmode_display.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index a469f6c..707e148 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -313,6 +313,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, int fb_id; drmModeModeInfo kmode; unsigned int pitch = scrn->displayWidth * intel->cpp; + drm_intel_bo *fb_bo; if (drmmode->fb_id == 0) { ret = drmModeAddFB(drmmode->fd, @@ -336,6 +337,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, crtc->y = y; crtc->rotation = rotation; + fb_bo = intel->front_buffer->bo; + output_ids = xcalloc(sizeof(uint32_t), xf86_config->num_output); if (!output_ids) { ret = FALSE; @@ -376,7 +379,11 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, fb_id = drmmode_crtc->rotate_fb_id; x = 0; y = 0; + fb_bo = drmmode_crtc->rotate_bo; } + /* Wait rendering to fb object complete before actual modesetting */ + drm_intel_gem_bo_start_gtt_access(fb_bo, 1); + ret = drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, fb_id, x, y, output_ids, output_count, &kmode); if (ret) -- 1.6.3.3