Remainder of 'Nuke legacy state' patch series.
Subsystems (2)
cover Remainder of 'Nuke legacy state' patch series.
Some patches from that series didn't get applied, so resending it here with some fixes.
First patch moves legacy primary state updates outside of the commit hook, which leaves only stuff related to plane hw updates inside it.
Patch 2 is a fixup required for patch 3, and patch 4 is a minor optimization on top which used to be part of patch 3.
Maarten Lankhorst (4):
drm/i915: Update legacy primary state outside the commit hook, v2. drm/i915: Only commit active planes when updating planes during reset. drm/i915: Only run commit when crtc is active, v2. drm/i915: Only call commit_planes when there are things to commit.
drivers/gpu/drm/i915/intel_display.c | 38 ++++++++++++++++++------------------ drivers/gpu/drm/i915/intel_sprite.c | 3 --- 2 files changed, 19 insertions(+), 22 deletions(-)
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/4 drm/i915: Update legacy primary state outside the commit hook, v2.
This should allow not running plane commit when the crtc is off. While the atomic helpers update those, crtc->x/y is only updated during modesets, and primary plane is updated after this function returns.
Unfortunately non-atomic watermarks and fbc still depend on this state inside i915, so it has to be kept in sync.
Changes since v1:
- Add comment that the legacy state is updated for fbc.
--- drivers/gpu/drm/i915/intel_display.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +12 -7
@@ -12206,6 +12206,18 @@ intel_modeset_update_crtc_state(struct drm_atomic_state *state) crtc->hwmode = crtc->state->adjusted_mode; else crtc->hwmode.crtc_clock = 0; + +/* +* Update legacy state to satisfy fbc code. This can +* be removed when fbc uses the atomic state. +*/ +if (drm_atomic_get_existing_plane_state (state, crtc->primary)) { +struct drm_plane_state *plane_state = crtc->primary->state; + + crtc->primary->fb = plane_state->fb; + crtc->x = plane_state->src_x >>16 ; + crtc->y = plane_state->src_y >>16 ; + } } }
@@ -13442,15 +13454,8 @@ intel_commit_primary_plane(struct drm_plane *plane,struct drm_framebuffer *fb = state->base.fb;struct drm_device *dev = plane->dev;struct drm_i915_private *dev_priv = dev->dev_private; -struct intel_crtc *intel_crtc; -struct drm_rect *src = &state->src; crtc = crtc ? crtc : plane->crtc; - intel_crtc =to_intel_crtc (crtc); - - plane->fb = fb; - crtc->x = src->x1 >>16 ; - crtc->y = src->y1 >>16 ;if (!crtc->state->active)return ;
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 drm/i915: Only commit active planes when updating planes during reset.
In reply to Maarten LankhorstIn the next commit commit_plane will no longer check if the crtc is active. To prevent issues with legacy page flips the check should be performed inside update_primary_planes.
--- drivers/gpu/drm/i915/intel_display.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -2
@@ -3154,10 +3154,9 @@ static void intel_update_primary_planes(struct drm_device *dev)struct intel_plane_state *plane_state;drm_modeset_lock_crtc (crtc, &plane->base); - plane_state =to_intel_plane_state (plane->base.state); -if (plane_state->base.fb) +if (crtc->state->active && plane_state->base.fb) plane->commit_plane (&plane->base, plane_state);drm_modeset_unlock_crtc (crtc);
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/4 drm/i915: Only run commit when crtc is active, v2.
In reply to Maarten LankhorstThe crtc->active guards are no longer needed now that all state updates are outside the commit.
Changes since v1:
- Only check crtc->state->active before calling commit_planes_on_crtc.
--- drivers/gpu/drm/i915/intel_display.c | 15 +++++---------- drivers/gpu/drm/i915/intel_sprite.c | 3 --- 2 files changed, 5 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_display.c +5 -10
@@ -13146,7 +13146,8 @@ static int intel_atomic_commit(struct drm_device *dev,if (!modeset)intel_pre_plane_update (intel_crtc); -drm_atomic_helper_commit_planes_on_crtc (crtc_state); +if (crtc->state->active) +drm_atomic_helper_commit_planes_on_crtc (crtc_state);if (put_domains)modeset_put_power_domains (dev_priv, put_domains);
@@ -13456,9 +13457,6 @@ intel_commit_primary_plane(struct drm_plane *plane, crtc = crtc ? crtc : plane->crtc; -if (!crtc->state->active) -return ; - dev_priv->display.update_primary_plane (crtc, fb, state->src.x1 >>16 , state->src.y1 >>16 );
@@ -13487,8 +13485,7 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,intel_update_watermarks (crtc);/* Perform vblank evasion around commit operation */ -if (crtc->state->active) -intel_pipe_update_start (intel_crtc); +intel_pipe_update_start (intel_crtc);if (modeset)return ;
@@ -13504,8 +13501,7 @@ static void intel_finish_crtc_commit(struct drm_crtc *crtc, {struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -if (crtc->state->active) -intel_pipe_update_end (intel_crtc); +intel_pipe_update_end (intel_crtc); }/**
@@ -13688,8 +13684,7 @@ intel_commit_cursor_plane(struct drm_plane *plane, intel_crtc->cursor_bo = obj; update: -if (crtc->state->active) -intel_crtc_update_cursor (crtc, state->visible); +intel_crtc_update_cursor (crtc, state->visible); } static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,
drivers/gpu/drm/i915/intel_sprite.c +0 -3
@@ -935,9 +935,6 @@ intel_commit_sprite_plane(struct drm_plane *plane, crtc = crtc ? crtc : plane->crtc; -if (!crtc->state->active) -return ; -if (state->visible) { intel_plane->update_plane(plane, crtc, fb, state->dst.x1, state->dst.y1,
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 drm/i915: Only call commit_planes when there are things to commit.
In reply to Maarten LankhorstThe atomic helpers set planes_changed on a crtc_state if there is any plane_state bound to that crtc. If there's none and there is no pipe update required the crtc has nothing to update, so vblank evasion can be skipped.
--- drivers/gpu/drm/i915/intel_display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +2 -1
@@ -13146,7 +13146,8 @@ static int intel_atomic_commit(struct drm_device *dev,if (!modeset)intel_pre_plane_update (intel_crtc); -if (crtc->state->active) +if (crtc->state->active && + (crtc->state->planes_changed || update_pipe))drm_atomic_helper_commit_planes_on_crtc (crtc_state);if (put_domains)
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/4] drm/i915: Only call commit_planes when there are things to commit.
Quoted 15 lines · Maarten Lankhorst
The atomic helpers set
planes_changedon acrtc_stateif there is anyplane_statebound to that crtc. If there's none and there is no pipe update required the crtc has nothing to update, so vblank evasion can be skipped.Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +0
-0
drivers/gpu/drm/i915/intel_display.c static int intel_atomic_commit(struct drm_device *dev, · line 13153
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +2
-1@@ -13146,7 +13146,8 @@ static int intel_atomic_commit(struct drm_device *dev,if (!modeset)intel_pre_plane_update (intel_crtc); -if (crtc->state->active) +if (crtc->state->active && + (crtc->state->planes_changed || update_pipe))drm_atomic_helper_commit_planes_on_crtc (crtc_state);if (put_domains)
Series lgtm
Quoted 7 lines
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/4] drm/i915: Only call commit_planes when there are things to commit.
Quoted 24 lines · Ville Syrjälä
Quoted 23 lines · Maarten Lankhorst
The atomic helpers set
planes_changedon acrtc_stateif there is anyplane_statebound to that crtc. If there's none and there is no pipe update required the crtc has nothing to update, so vblank evasion can be skipped.Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +2
-1@@ -13146,7 +13146,8 @@ static int intel_atomic_commit(struct drm_device *dev,if (!modeset)intel_pre_plane_update (intel_crtc); -if (crtc->state->active) +if (crtc->state->active && + (crtc->state->planes_changed || update_pipe))drm_atomic_helper_commit_planes_on_crtc (crtc_state);
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c static int intel_atomic_commit(struct drm_device *dev, · line 13153
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +0
-0if (put_domains)Series lgtm
Reviewed-by Ville Syrjälä <[email protected]>
All four merged to dinq, thanks.
-Daniel
Quoted 16 lines
Quoted 8 lines
Signature · 7 lines
-- 2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx