OSDN Git Service

drm/i915: Fix modeset locks in sanitize_watermarks()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 22 Jan 2020 20:43:29 +0000 (22:43 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 27 Jan 2020 13:45:21 +0000 (15:45 +0200)
commitd1b2828af0cc414356c18d7814b83ba33b472054
tree12c75e87e71acf25d767115bed2028d8e7309a10
parentcb724911f495b3e8c5c321776b6975689d26579e
drm/i915: Fix modeset locks in sanitize_watermarks()

We've added more internal things that use modeset locks and
thus we need to be prepared for intel_atomic_check() grabbing
more locks than what our initial drm_modeset_lock_all_ctx()
took. So we're missing the backoff handling here.

Also drm_atomic_helper_duplicate_state() works against us
by clearing state->acquire_ctx in anticipation of
drm_atomic_helper_commit_duplicated_state() being used to
commit the state.

We could probably just reset acquire_ctx back, but instead
let's just rewrite the whole thing without using either of
those "helpers". There's also no need to add any connectors
to the state here since we just want the new watermarks
which don't depend on connectors.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200122204329.2477-1-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/display/intel_display.c