diff options
| author | Rob Clark <robdclark@gmail.com> | 2014-12-18 16:01:48 -0500 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-12-18 16:22:53 -0500 |
| commit | ccfc08655d5fd5076828f45fb09194c070f2f63a (patch) | |
| tree | 4c0517f82389396a148013197afe624218c65f68 | |
| parent | ac9c925616028f1f03f631f229bca49b3a92ce9a (diff) | |
drm: tweak getconnector locking
We need to hold connection_mutex as we read the properties. Easiest
thing is just widen the scope where connection_mutex is held.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
| -rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 303c9918a2d5..2031ead208b1 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
| @@ -2031,6 +2031,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, | |||
| 2031 | DRM_DEBUG_KMS("[CONNECTOR:%d:?]\n", out_resp->connector_id); | 2031 | DRM_DEBUG_KMS("[CONNECTOR:%d:?]\n", out_resp->connector_id); |
| 2032 | 2032 | ||
| 2033 | mutex_lock(&dev->mode_config.mutex); | 2033 | mutex_lock(&dev->mode_config.mutex); |
| 2034 | drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); | ||
| 2034 | 2035 | ||
| 2035 | connector = drm_connector_find(dev, out_resp->connector_id); | 2036 | connector = drm_connector_find(dev, out_resp->connector_id); |
| 2036 | if (!connector) { | 2037 | if (!connector) { |
| @@ -2062,14 +2063,11 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, | |||
| 2062 | out_resp->mm_height = connector->display_info.height_mm; | 2063 | out_resp->mm_height = connector->display_info.height_mm; |
| 2063 | out_resp->subpixel = connector->display_info.subpixel_order; | 2064 | out_resp->subpixel = connector->display_info.subpixel_order; |
| 2064 | out_resp->connection = connector->status; | 2065 | out_resp->connection = connector->status; |
| 2065 | drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); | ||
| 2066 | |||
| 2067 | encoder = drm_connector_get_encoder(connector); | 2066 | encoder = drm_connector_get_encoder(connector); |
| 2068 | if (encoder) | 2067 | if (encoder) |
| 2069 | out_resp->encoder_id = encoder->base.id; | 2068 | out_resp->encoder_id = encoder->base.id; |
| 2070 | else | 2069 | else |
| 2071 | out_resp->encoder_id = 0; | 2070 | out_resp->encoder_id = 0; |
| 2072 | drm_modeset_unlock(&dev->mode_config.connection_mutex); | ||
| 2073 | 2071 | ||
| 2074 | /* | 2072 | /* |
| 2075 | * This ioctl is called twice, once to determine how much space is | 2073 | * This ioctl is called twice, once to determine how much space is |
| @@ -2135,6 +2133,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, | |||
| 2135 | out_resp->count_encoders = encoders_count; | 2133 | out_resp->count_encoders = encoders_count; |
| 2136 | 2134 | ||
| 2137 | out: | 2135 | out: |
| 2136 | drm_modeset_unlock(&dev->mode_config.connection_mutex); | ||
| 2138 | mutex_unlock(&dev->mode_config.mutex); | 2137 | mutex_unlock(&dev->mode_config.mutex); |
| 2139 | 2138 | ||
| 2140 | return ret; | 2139 | return ret; |
