diff mbox

[3/3] drm/i915: Don't wait interruptible for possible plane buffer flush

Message ID 20091201061814.GH2564@zhen-devel.sh.intel.com (mailing list archive)
State Rejected
Headers show

Commit Message

Zhenyu Wang Dec. 1, 2009, 6:18 a.m. UTC
None
diff mbox

Patch

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)