Skip to contentSkip to conversation

drm/i915: optimize vblank waits in set_base_atomic

PATCH In review Daniel Vetter 3 participants 3 messages Jun 2, 2013 – Jun 3, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: optimize vblank waits in set_base_atomic

We only need to do them if the pipe is actually running and if the framebuffers have changed. Removes two "wait for vblank timed out" messages when doing a suspend/resume cycle on my i855gm.

---
 drivers/gpu/drm/i915/intel_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +2 -1
index 0b27c57..0669729 100644
@@ -2203,7 +2203,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 	crtc->y = y;
 
 	if (old_fb) {
-		intel_wait_for_vblank(dev, intel_crtc->pipe);
+		if (to_intel_crtc(crtc)->active && old_fb != fb)
+			intel_wait_for_vblank(dev, intel_crtc->pipe);
 		intel_unpin_fb_obj(to_intel_framebuffer(old_fb)->obj);
 	}
 
Signature · 1 line
1.7.11.7
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Daniel Vetter

We only need to do them if the pipe is actually running and if the framebuffers have changed. Removes two "wait for vblank timed out" messages when doing a suspend/resume cycle on my i855gm.

Comments inline.

Quoted 9 lines
---
 drivers/gpu/drm/i915/intel_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 0b27c57..0669729 100644

drivers/gpu/drm/i915/intel_display.c intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, · line 2206

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -2203,7 +2203,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 	crtc->y = y;
 
 	if (old_fb) {
-		intel_wait_for_vblank(dev, intel_crtc->pipe);
+		if (to_intel_crtc(crtc)->active && old_fb != fb)
                if (intel_crtc->active && old_fb != fb)

drivers/gpu/drm/i915/intel_display.c intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, · line 2208

Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
+			intel_wait_for_vblank(dev, intel_crtc->pipe);
 		intel_unpin_fb_obj(to_intel_framebuffer(old_fb)->obj);

-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#2 lore raw
Quoted 21 lines · Chris Wilson
Quoted 5 lines · Daniel Vetter

We only need to do them if the pipe is actually running and if the framebuffers have changed. Removes two "wait for vblank timed out" messages when doing a suspend/resume cycle on my i855gm.

Comments inline.

Quoted 11 lines
---
 drivers/gpu/drm/i915/intel_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 0b27c57..0669729 100644
@@ -2203,7 +2203,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 	crtc->y = y;
 
Quoted 4 lines

drivers/gpu/drm/i915/intel_display.c intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, · line 2206

Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
 	if (old_fb) {
-		intel_wait_for_vblank(dev, intel_crtc->pipe);
+		if (to_intel_crtc(crtc)->active && old_fb != fb)
                if (intel_crtc->active && old_fb != fb)

Oops, missed that one. Queued for -next, thanks for the review. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch