Skip to content

Commit

Permalink
drm/i915: Add rudimentary plane state verification
Browse files Browse the repository at this point in the history
Check that the planes are in the state we expect them to be. For
now we can only check whether each plane is correctly enabled or
disabled. In the future we may want to expand the plane state
readout to support a more thorough verification.

v2: Verify all planes part of the state as long as at least
    one crtc is doing a modeset (Daniel)
v3: Fix typoes (James)

Cc: James Ausmus <james.ausmus@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: James Ausmus <james.ausmus@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171117191917.11506-11-ville.syrjala@linux.intel.com
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
  • Loading branch information
Ville Syrjälä committed Nov 21, 2017
1 parent 2924b8c commit cff109f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -11600,6 +11600,18 @@ verify_crtc_state(struct drm_crtc *crtc,
}
}

static void
intel_verify_planes(struct intel_atomic_state *state)
{
struct intel_plane *plane;
const struct intel_plane_state *plane_state;
int i;

for_each_new_intel_plane_in_state(state, plane,
plane_state, i)
assert_plane(plane, plane_state->base.visible);
}

static void
verify_single_dpll_state(struct drm_i915_private *dev_priv,
struct intel_shared_dpll *pll,
Expand Down Expand Up @@ -12393,6 +12405,9 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
intel_modeset_verify_crtc(crtc, state, old_crtc_state, new_crtc_state);
}

if (intel_state->modeset)
intel_verify_planes(intel_state);

if (intel_state->modeset && intel_can_enable_sagv(state))
intel_enable_sagv(dev_priv);

Expand Down

0 comments on commit cff109f

Please sign in to comment.