drm/i915: Handle error paths during watermark sanitization properly (v3)
authorMatt Roper <matthew.d.roper@intel.com>
Tue, 12 Jan 2016 15:13:37 +0000 (07:13 -0800)
committerMatt Roper <matthew.d.roper@intel.com>
Tue, 12 Jan 2016 18:11:16 +0000 (10:11 -0800)
commit0cd1262de7b7509bbbcd650a9918e8895dee6d73
tree880ad8a08c2a2e8255d577e7161932664ac733a9
parentceccad59100e2b8fa6b2ba38351ba5e730324f0f
drm/i915: Handle error paths during watermark sanitization properly (v3)

sanitize_watermarks() does not properly handle errors returned by
drm_atomic_helper_duplicate_state().  Make failures drop locks before
returning.  We also change the lock of connection_mutex to a
drm_modeset_lock_all_ctx() to make sure any EDEADLK's are handled
earlier.

v2: Change call to lock connetion_mutex with a call to
    drm_modeset_lock_all_ctx().  This ensures that any lock contention
    is handled earlier and drm_atomic_helper_duplicate_state() won't
    return EDEADLK. (Maarten)

v3: Drop locks properly in more error paths. (Maarten)

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1452611617-32144-1-git-send-email-matthew.d.roper@intel.com
drivers/gpu/drm/i915/intel_display.c