plane related backports to -fixes
Subsystems (2)
cover plane related backports to -fixes
I'm proposing to backport these to v4.3/-fixes, objections or acks?
BR,
Jani.
References: https://bugs.freedesktop.org/show_bug.cgi?id=91910#c4
Jani Nikula (1):
Revert "drm/i915: Add primary plane to mask if it's visible"
Maarten Lankhorst (1):
drm/i915: Add primary plane to mask if it's visible
Ville Syrjälä (2):
drm/i915: Assign hwmode after encoder state readout drm/i915: Move sprite/cursor plane disable to intel_sanitize_crtc()
drivers/gpu/drm/i915/intel_display.c | 106 +++++++++++++++++------------------ 1 file changed, 53 insertions(+), 53 deletions(-)
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/4 Revert "drm/i915: Add primary plane to mask if it's visible"
This reverts commit 721a09f7393de6c28a07516dccd654c6e995944a.
There is nothing wrong with the commit per se. We had two versions of the commit, one in -next headed for v4.4 and this one for v4.3. Turns out we'll need to backport more fixes from -next, and they conflict with the v4.3 version. It gets messy. It will be easiest to revert this one, and backport all the relevant commits from -next without modifications; they apply cleanly after this revert.
References: https://bugs.freedesktop.org/show_bug.cgi?id=91910#c4
--- drivers/gpu/drm/i915/intel_display.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -5
@@ -15101,12 +15101,9 @@ static void readout_plane_state(struct intel_crtc *crtc, plane_state =to_intel_plane_state (p->base.state); -if (p->base.type ==DRM_PLANE_TYPE_PRIMARY ) { +if (p->base.type ==DRM_PLANE_TYPE_PRIMARY ) plane_state->visible =primary_get_hw_state (crtc); -if (plane_state->visible) - crtc->base.state->plane_mask |= -1 <<drm_plane_index (&p->base); - }else { +else {if (active) p->disable_plane (&p->base, &crtc->base);
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 drm/i915: Assign hwmode after encoder state readout
In reply to Jani NikulaFrom: Ville Syrjälä <[email protected]>
The dotclock is often calculated in encoder .get_config(), so we shouldn't copy the adjusted_mode to hwmode until we have read out the dotclock.
Gets rid of some warnings like these:
[drm:drm_calc_timestamping_constants [drm]] *ERROR* crtc 21: Can't calculate constants, dotclock = 0! [drm:i915_get_vblank_timestamp] crtc 0 is disabled
v2: Steal Maarten's idea to move crtc->mode etc. assignment too
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91428
--- drivers/gpu/drm/i915/intel_display.c | 57 +++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 27 deletions(-)
drivers/gpu/drm/i915/intel_display.c +30 -27
@@ -15132,33 +15132,6 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) crtc->base.state->active = crtc->active; crtc->base.enabled = crtc->active; -memset (&crtc->base.mode,0 ,sizeof (crtc->base.mode)); -if (crtc->base.state->active) { -intel_mode_from_pipe_config (&crtc->base.mode, crtc->config); -intel_mode_from_pipe_config (&crtc->base.state->adjusted_mode, crtc->config); -WARN_ON (drm_atomic_set_mode_for_crtc (crtc->base.state, &crtc->base.mode)); - -/* -* The initial mode needs to be set in order to keep -* the atomic core happy. It wants a valid mode if the -* crtc's enabled, so we do the above call. -* -* At this point some state updated by the connectors -* in their ->detect() callback has not run yet, so -* no recalculation can be done yet. -* -* Even if we could do a recalculation and modeset -* right now it would cause a double modeset if -* fbdev or userspace chooses a different initial mode. -* -* If that happens, someone indicated they wanted a -* mode change, which means it's safe to do a full -* recalculation. -*/ - crtc->base.state->mode.private_flags =I915_MODE_FLAG_INHERITED ; - } - - crtc->base.hwmode = crtc->config->base.adjusted_mode;readout_plane_state (crtc,to_intel_crtc_state (crtc->base.state)); DRM_DEBUG_KMS("[CRTC:%d] hw state readout: %s\n",
@@ -15218,6 +15191,36 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) connector->base.name, connector->base.encoder ? "enabled" : "disabled"); } + +for_each_intel_crtc (dev, crtc) { + crtc->base.hwmode = crtc->config->base.adjusted_mode; + +memset (&crtc->base.mode,0 ,sizeof (crtc->base.mode)); +if (crtc->base.state->active) { +intel_mode_from_pipe_config (&crtc->base.mode, crtc->config); +intel_mode_from_pipe_config (&crtc->base.state->adjusted_mode, crtc->config); +WARN_ON (drm_atomic_set_mode_for_crtc (crtc->base.state, &crtc->base.mode)); + +/* +* The initial mode needs to be set in order to keep +* the atomic core happy. It wants a valid mode if the +* crtc's enabled, so we do the above call. +* +* At this point some state updated by the connectors +* in their ->detect() callback has not run yet, so +* no recalculation can be done yet. +* +* Even if we could do a recalculation and modeset +* right now it would cause a double modeset if +* fbdev or userspace chooses a different initial mode. +* +* If that happens, someone indicated they wanted a +* mode change, which means it's safe to do a full +* recalculation. +*/ + crtc->base.state->mode.private_flags =I915_MODE_FLAG_INHERITED ; + } + } }/* Scan out the current hw modeset state,
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/4 drm/i915: Move sprite/cursor plane disable to intel_sanitize_crtc()
In reply to Jani NikulaFrom: Ville Syrjälä <[email protected]>
Move the sprite/cursor plane disabling to occur in intel_sanitize_crtc() where it belongs instead of doing it in intel_modeset_readout_hw_state().
The plane disabling was first added in 4cf0ebbd4fafbdf8e6431dbb315e5511c3efdc3b drm/i915: Rework plane readout.
I got the idea from some patches from Partik and/or Maarten but those moved also the plane state readout to intel_sanitize_crtc() which isn't quite right in my opinion.
References: https://bugs.freedesktop.org/show_bug.cgi?id=91910
--- drivers/gpu/drm/i915/intel_display.c | 44 ++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 24 deletions(-)
drivers/gpu/drm/i915/intel_display.c +20 -24
@@ -14911,9 +14911,19 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)/* restore vblank interrupts to correct state */ drm_crtc_vblank_reset (&crtc->base);if (crtc->active) { +struct intel_plane *plane; +drm_calc_timestamping_constants (&crtc->base, &crtc->base.hwmode);update_scanline_offset (crtc);drm_crtc_vblank_on (&crtc->base); + +/* Disable everything but the primary plane */ +for_each_intel_plane_on_crtc (dev, crtc, plane) { +if (plane->base.type ==DRM_PLANE_TYPE_PRIMARY ) +continue ; + + plane->disable_plane (&plane->base, &crtc->base); + } }/* We need to sanitize the plane -> pipe mapping first because this will
@@ -15081,35 +15091,21 @@ void i915_redisable_vga(struct drm_device *dev)i915_redisable_vga_power_on (dev); } -static bool primary_get_hw_state (struct intel_crtc *crtc) +static bool primary_get_hw_state (struct intel_plane *plane) { -struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; +struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -return !!(I915_READ (DSPCNTR (crtc->plane)) &DISPLAY_PLANE_ENABLE ); +return I915_READ (DSPCNTR (plane->plane)) &DISPLAY_PLANE_ENABLE ; } -static void readout_plane_state (struct intel_crtc *crtc, -struct intel_crtc_state *crtc_state) +/* FIXME read out full plane state for all planes */ +static void readout_plane_state (struct intel_crtc *crtc) { -struct intel_plane *p; -struct intel_plane_state *plane_state; -bool active = crtc_state->base.active; +struct intel_plane_state *plane_state = +to_intel_plane_state (crtc->base.primary->state); -for_each_intel_plane (crtc->base.dev, p) { -if (crtc->pipe != p->pipe) -continue ; - - plane_state =to_intel_plane_state (p->base.state); - -if (p->base.type ==DRM_PLANE_TYPE_PRIMARY ) - plane_state->visible =primary_get_hw_state (crtc); -else { -if (active) - p->disable_plane (&p->base, &crtc->base); - - plane_state->visible = false; - } - } + plane_state->visible = +primary_get_hw_state (to_intel_plane (crtc->base.primary)); }static void intel_modeset_readout_hw_state (struct drm_device *dev)
@@ -15132,7 +15128,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) crtc->base.state->active = crtc->active; crtc->base.enabled = crtc->active; -readout_plane_state (crtc,to_intel_crtc_state (crtc->base.state)); +readout_plane_state (crtc); DRM_DEBUG_KMS("[CRTC:%d] hw state readout: %s\n", crtc->base.base.id,
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 drm/i915: Add primary plane to mask if it's visible
In reply to Jani NikulaFrom: Maarten Lankhorst <[email protected]>
This fixes the warnings like
"plane A assertion failure, should be disabled but not"
that on the initial modeset during boot. This can happen if the primary plane is enabled by the firmware, but inheriting it fails because the DMAR is active or for other reasons.
Most likely caused by
commit 36750f284b3a4f19b304fda1bb7d6e9e1275ea8d
Author: Maarten Lankhorst <[email protected]> Date: Mon Jun 1 12:49:54 2015 +0200
drm/i915: update plane state during init
This is a new version of
commit 721a09f7393de6c28a07516dccd654c6e995944a
Author: Maarten Lankhorst <[email protected]> Date: Tue Sep 15 14:28:54 2015 +0200
drm/i915: Add primary plane to mask if it's visible
That was reverted.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91429
--- drivers/gpu/drm/i915/intel_display.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +6 -2
@@ -15101,11 +15101,15 @@ static bool primary_get_hw_state(struct intel_plane *plane)/* FIXME read out full plane state for all planes */ static void readout_plane_state (struct intel_crtc *crtc) { +struct drm_plane *primary = crtc->base.primary;struct intel_plane_state *plane_state = -to_intel_plane_state (crtc->base.primary->state); +to_intel_plane_state (primary->state); plane_state->visible = -primary_get_hw_state (to_intel_plane (crtc->base.primary)); +primary_get_hw_state (to_intel_plane (primary)); + +if (plane_state->visible) + crtc->base.state->plane_mask |=1 <<drm_plane_index (primary); }static void intel_modeset_readout_hw_state (struct drm_device *dev)
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Op 14-10-15 om 11:06 schreef Jani Nikula:
Quoted 14 lines
I'm proposing to backport these to v4.3/-fixes, objections or acks?
BR,
Jani.References: https://bugs.freedesktop.org/show_bug.cgi?id=91910#c4
Jani Nikula (1):
Revert "drm/i915: Add primary plane to mask if it's visible"Maarten Lankhorst (1):
drm/i915: Add primary plane to mask if it's visible
Quoted 7 lines
Ville Syrjälä (2):
drm/i915: Assign hwmode after encoder state readout drm/i915: Move sprite/cursor plane disable tointel_sanitize_crtc()drivers/gpu/drm/i915/intel_display.c | 106 +++++++++++++++++------------------ 1 file changed, 53 insertions(+), 53 deletions(-)
Acking all.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 15 lines · Maarten Lankhorst
Op 14-10-15 om 11:06 schreef Jani Nikula:
Quoted 14 lines
I'm proposing to backport these to v4.3/-fixes, objections or acks?
BR,
Jani.References: https://bugs.freedesktop.org/show_bug.cgi?id=91910#c4
Jani Nikula (1):
Revert "drm/i915: Add primary plane to mask if it's visible"Maarten Lankhorst (1):
drm/i915: Add primary plane to mask if it's visible
Quoted 8 lines
Quoted 7 lines
Ville Syrjälä (2):
drm/i915: Assign hwmode after encoder state readout drm/i915: Move sprite/cursor plane disable tointel_sanitize_crtc()drivers/gpu/drm/i915/intel_display.c | 106 +++++++++++++++++------------------ 1 file changed, 53 insertions(+), 53 deletions(-)Acking all.
Thanks, pushed all to drm-intel-fixes.
BR,
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx