diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-09-02 05:57:22 -0400 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2014-09-02 05:58:51 -0400 |
commit | bbfb44e8b688e778964275ab0862f67463ba4f84 (patch) | |
tree | 13f4ac4272102efbcdf630ef309943a3c46b0b48 | |
parent | 2a592bec50994597716c633191ed6bf7af14defc (diff) |
drm/i915: Fix lock dropping in intel_tv_detect()
When intel_tv_detect() fails to do load detection it would forget to
drop the locks and clean up the acquire context. Fix it up.
This is a regression from:
commit 208bf9fdcd3575aa4a5d48b3e0295f7cdaf6fc44
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date: Mon Aug 11 13:15:35 2014 +0300
drm/i915: Fix locking for intel_enable_pipe_a()
v2: Make the code more readable (Chris)
v3: Drop WARN_ON(type < 0) (Chris)
Cc: stable@vger.kernel.org
Cc: Tibor Billes <tbilles@gmx.com>
Reported-by: Tibor Billes <tbilles@gmx.com>
Tested-by: Tibor Billes <tbilles@gmx.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_tv.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 32186a656816..c69d3ce1b3d6 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c | |||
@@ -1311,6 +1311,7 @@ intel_tv_detect(struct drm_connector *connector, bool force) | |||
1311 | { | 1311 | { |
1312 | struct drm_display_mode mode; | 1312 | struct drm_display_mode mode; |
1313 | struct intel_tv *intel_tv = intel_attached_tv(connector); | 1313 | struct intel_tv *intel_tv = intel_attached_tv(connector); |
1314 | enum drm_connector_status status; | ||
1314 | int type; | 1315 | int type; |
1315 | 1316 | ||
1316 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s] force=%d\n", | 1317 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s] force=%d\n", |
@@ -1328,16 +1329,19 @@ intel_tv_detect(struct drm_connector *connector, bool force) | |||
1328 | if (intel_get_load_detect_pipe(connector, &mode, &tmp, &ctx)) { | 1329 | if (intel_get_load_detect_pipe(connector, &mode, &tmp, &ctx)) { |
1329 | type = intel_tv_detect_type(intel_tv, connector); | 1330 | type = intel_tv_detect_type(intel_tv, connector); |
1330 | intel_release_load_detect_pipe(connector, &tmp); | 1331 | intel_release_load_detect_pipe(connector, &tmp); |
1332 | status = type < 0 ? | ||
1333 | connector_status_disconnected : | ||
1334 | connector_status_connected; | ||
1331 | } else | 1335 | } else |
1332 | return connector_status_unknown; | 1336 | status = connector_status_unknown; |
1333 | 1337 | ||
1334 | drm_modeset_drop_locks(&ctx); | 1338 | drm_modeset_drop_locks(&ctx); |
1335 | drm_modeset_acquire_fini(&ctx); | 1339 | drm_modeset_acquire_fini(&ctx); |
1336 | } else | 1340 | } else |
1337 | return connector->status; | 1341 | return connector->status; |
1338 | 1342 | ||
1339 | if (type < 0) | 1343 | if (status != connector_status_connected) |
1340 | return connector_status_disconnected; | 1344 | return status; |
1341 | 1345 | ||
1342 | intel_tv->type = type; | 1346 | intel_tv->type = type; |
1343 | intel_tv_find_better_format(connector); | 1347 | intel_tv_find_better_format(connector); |