Commit 04c8b0bf authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/i915: Use intel_plane_state in prepare and cleanup plane_fb

We need to look at the hw fb in the plane split, so replace all the places
that use drm_plane_state with intel_plane_state.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191004113514.17064-6-maarten.lankhorst@linux.intel.comReviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
[mlankhorst: Fix line wraps (Matt Roper)]
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
parent af9fbfa6
...@@ -14358,12 +14358,14 @@ static void fb_obj_bump_render_priority(struct drm_i915_gem_object *obj) ...@@ -14358,12 +14358,14 @@ static void fb_obj_bump_render_priority(struct drm_i915_gem_object *obj)
*/ */
int int
intel_prepare_plane_fb(struct drm_plane *plane, intel_prepare_plane_fb(struct drm_plane *plane,
struct drm_plane_state *new_state) struct drm_plane_state *_new_plane_state)
{ {
struct intel_plane_state *new_plane_state =
to_intel_plane_state(_new_plane_state);
struct intel_atomic_state *intel_state = struct intel_atomic_state *intel_state =
to_intel_atomic_state(new_state->state); to_intel_atomic_state(new_plane_state->base.state);
struct drm_i915_private *dev_priv = to_i915(plane->dev); struct drm_i915_private *dev_priv = to_i915(plane->dev);
struct drm_framebuffer *fb = new_state->fb; struct drm_framebuffer *fb = new_plane_state->base.fb;
struct drm_i915_gem_object *obj = intel_fb_obj(fb); struct drm_i915_gem_object *obj = intel_fb_obj(fb);
struct drm_i915_gem_object *old_obj = intel_fb_obj(plane->state->fb); struct drm_i915_gem_object *old_obj = intel_fb_obj(plane->state->fb);
int ret; int ret;
...@@ -14394,9 +14396,9 @@ intel_prepare_plane_fb(struct drm_plane *plane, ...@@ -14394,9 +14396,9 @@ intel_prepare_plane_fb(struct drm_plane *plane,
} }
} }
if (new_state->fence) { /* explicit fencing */ if (new_plane_state->base.fence) { /* explicit fencing */
ret = i915_sw_fence_await_dma_fence(&intel_state->commit_ready, ret = i915_sw_fence_await_dma_fence(&intel_state->commit_ready,
new_state->fence, new_plane_state->base.fence,
I915_FENCE_TIMEOUT, I915_FENCE_TIMEOUT,
GFP_KERNEL); GFP_KERNEL);
if (ret < 0) if (ret < 0)
...@@ -14410,7 +14412,7 @@ intel_prepare_plane_fb(struct drm_plane *plane, ...@@ -14410,7 +14412,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
if (ret) if (ret)
return ret; return ret;
ret = intel_plane_pin_fb(to_intel_plane_state(new_state)); ret = intel_plane_pin_fb(new_plane_state);
i915_gem_object_unpin_pages(obj); i915_gem_object_unpin_pages(obj);
if (ret) if (ret)
...@@ -14419,7 +14421,7 @@ intel_prepare_plane_fb(struct drm_plane *plane, ...@@ -14419,7 +14421,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
fb_obj_bump_render_priority(obj); fb_obj_bump_render_priority(obj);
intel_frontbuffer_flush(obj->frontbuffer, ORIGIN_DIRTYFB); intel_frontbuffer_flush(obj->frontbuffer, ORIGIN_DIRTYFB);
if (!new_state->fence) { /* implicit fencing */ if (!new_plane_state->base.fence) { /* implicit fencing */
struct dma_fence *fence; struct dma_fence *fence;
ret = i915_sw_fence_await_reservation(&intel_state->commit_ready, ret = i915_sw_fence_await_reservation(&intel_state->commit_ready,
...@@ -14431,11 +14433,13 @@ intel_prepare_plane_fb(struct drm_plane *plane, ...@@ -14431,11 +14433,13 @@ intel_prepare_plane_fb(struct drm_plane *plane,
fence = dma_resv_get_excl_rcu(obj->base.resv); fence = dma_resv_get_excl_rcu(obj->base.resv);
if (fence) { if (fence) {
add_rps_boost_after_vblank(new_state->crtc, fence); add_rps_boost_after_vblank(new_plane_state->base.crtc,
fence);
dma_fence_put(fence); dma_fence_put(fence);
} }
} else { } else {
add_rps_boost_after_vblank(new_state->crtc, new_state->fence); add_rps_boost_after_vblank(new_plane_state->base.crtc,
new_plane_state->base.fence);
} }
/* /*
...@@ -14463,10 +14467,12 @@ intel_prepare_plane_fb(struct drm_plane *plane, ...@@ -14463,10 +14467,12 @@ intel_prepare_plane_fb(struct drm_plane *plane,
*/ */
void void
intel_cleanup_plane_fb(struct drm_plane *plane, intel_cleanup_plane_fb(struct drm_plane *plane,
struct drm_plane_state *old_state) struct drm_plane_state *_old_plane_state)
{ {
struct intel_plane_state *old_plane_state =
to_intel_plane_state(_old_plane_state);
struct intel_atomic_state *intel_state = struct intel_atomic_state *intel_state =
to_intel_atomic_state(old_state->state); to_intel_atomic_state(old_plane_state->base.state);
struct drm_i915_private *dev_priv = to_i915(plane->dev); struct drm_i915_private *dev_priv = to_i915(plane->dev);
if (intel_state->rps_interactive) { if (intel_state->rps_interactive) {
...@@ -14475,7 +14481,7 @@ intel_cleanup_plane_fb(struct drm_plane *plane, ...@@ -14475,7 +14481,7 @@ intel_cleanup_plane_fb(struct drm_plane *plane,
} }
/* Should only be called after a successful intel_prepare_plane_fb()! */ /* Should only be called after a successful intel_prepare_plane_fb()! */
intel_plane_unpin_fb(to_intel_plane_state(old_state)); intel_plane_unpin_fb(old_plane_state);
} }
int int
......
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