Commit acb87dfb authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
[danvet: fix compile fail.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent a928d536
...@@ -967,11 +967,14 @@ i915_gem_execbuffer_move_to_active(struct list_head *objects, ...@@ -967,11 +967,14 @@ i915_gem_execbuffer_move_to_active(struct list_head *objects,
obj->pending_gpu_write = true; obj->pending_gpu_write = true;
list_move_tail(&obj->gpu_write_list, list_move_tail(&obj->gpu_write_list,
&ring->gpu_write_list); &ring->gpu_write_list);
intel_mark_busy(ring->dev, obj); if (obj->pin_count) /* check for potential scanout */
intel_mark_busy(ring->dev, obj);
} }
trace_i915_gem_object_change_domain(obj, old_read, old_write); trace_i915_gem_object_change_domain(obj, old_read, old_write);
} }
intel_mark_busy(ring->dev, NULL);
} }
static void static void
......
...@@ -5558,6 +5558,9 @@ void intel_mark_busy(struct drm_device *dev, struct drm_i915_gem_object *obj) ...@@ -5558,6 +5558,9 @@ void intel_mark_busy(struct drm_device *dev, struct drm_i915_gem_object *obj)
mod_timer(&dev_priv->idle_timer, jiffies + mod_timer(&dev_priv->idle_timer, jiffies +
msecs_to_jiffies(GPU_IDLE_TIMEOUT)); msecs_to_jiffies(GPU_IDLE_TIMEOUT));
if (obj == NULL)
return;
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
if (!crtc->fb) if (!crtc->fb)
continue; continue;
...@@ -6007,6 +6010,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, ...@@ -6007,6 +6010,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
goto cleanup_pending; goto cleanup_pending;
intel_disable_fbc(dev); intel_disable_fbc(dev);
intel_mark_busy(dev, obj);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
trace_i915_flip_request(intel_crtc->plane, obj); trace_i915_flip_request(intel_crtc->plane, obj);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment