aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-05-03 10:47:57 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-05-08 09:10:34 -0400
commitacb87dfb4b847de1de1134e3e767e9a773d6454e (patch)
tree620cbb61ea66e8eb6ffd729fc14d69cb64c43662
parenta928d536c09eb071d114aa94bc60d002e7c8f92b (diff)
drm/i915: Limit calling mark-busy only for potential scanouts
The principle of intel_mark_busy() is that we want to spot the transition of when the display engine is being used in order to bump powersaving modes and increase display clocks. As such it is only important when the display is changing, i.e. when rendering to the scanout or other sprite/plane, and these are characterised by being pinned. v2: Mark the whole device as busy on execbuffer and pageflips as well and rebase against dinq for the minor bug fix to be immediately applicable. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> [danvet: fix compile fail.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_gem_execbuffer.c5
-rw-r--r--drivers/gpu/drm/i915/intel_display.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 206b9bbe6979..21fc11d84712 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -967,11 +967,14 @@ i915_gem_execbuffer_move_to_active(struct list_head *objects,
967 obj->pending_gpu_write = true; 967 obj->pending_gpu_write = true;
968 list_move_tail(&obj->gpu_write_list, 968 list_move_tail(&obj->gpu_write_list,
969 &ring->gpu_write_list); 969 &ring->gpu_write_list);
970 intel_mark_busy(ring->dev, obj); 970 if (obj->pin_count) /* check for potential scanout */
971 intel_mark_busy(ring->dev, obj);
971 } 972 }
972 973
973 trace_i915_gem_object_change_domain(obj, old_read, old_write); 974 trace_i915_gem_object_change_domain(obj, old_read, old_write);
974 } 975 }
976
977 intel_mark_busy(ring->dev, NULL);
975} 978}
976 979
977static void 980static void
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b322bde98675..1cbe2680fdec 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5558,6 +5558,9 @@ void intel_mark_busy(struct drm_device *dev, struct drm_i915_gem_object *obj)
5558 mod_timer(&dev_priv->idle_timer, jiffies + 5558 mod_timer(&dev_priv->idle_timer, jiffies +
5559 msecs_to_jiffies(GPU_IDLE_TIMEOUT)); 5559 msecs_to_jiffies(GPU_IDLE_TIMEOUT));
5560 5560
5561 if (obj == NULL)
5562 return;
5563
5561 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 5564 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
5562 if (!crtc->fb) 5565 if (!crtc->fb)
5563 continue; 5566 continue;
@@ -6007,6 +6010,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
6007 goto cleanup_pending; 6010 goto cleanup_pending;
6008 6011
6009 intel_disable_fbc(dev); 6012 intel_disable_fbc(dev);
6013 intel_mark_busy(dev, obj);
6010 mutex_unlock(&dev->struct_mutex); 6014 mutex_unlock(&dev->struct_mutex);
6011 6015
6012 trace_i915_flip_request(intel_crtc->plane, obj); 6016 trace_i915_flip_request(intel_crtc->plane, obj);