diff options
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_kms.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index d2bc2b03d4c6..941a7bc0b791 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |||
@@ -187,7 +187,7 @@ int vmw_du_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, | |||
187 | * can do this since the caller in the drm core doesn't check anything | 187 | * can do this since the caller in the drm core doesn't check anything |
188 | * which is protected by any looks. | 188 | * which is protected by any looks. |
189 | */ | 189 | */ |
190 | drm_modeset_unlock(&crtc->mutex); | 190 | drm_modeset_unlock_crtc(crtc); |
191 | drm_modeset_lock_all(dev_priv->dev); | 191 | drm_modeset_lock_all(dev_priv->dev); |
192 | 192 | ||
193 | /* A lot of the code assumes this */ | 193 | /* A lot of the code assumes this */ |
@@ -252,7 +252,7 @@ int vmw_du_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, | |||
252 | ret = 0; | 252 | ret = 0; |
253 | out: | 253 | out: |
254 | drm_modeset_unlock_all(dev_priv->dev); | 254 | drm_modeset_unlock_all(dev_priv->dev); |
255 | drm_modeset_lock(&crtc->mutex, NULL); | 255 | drm_modeset_lock_crtc(crtc); |
256 | 256 | ||
257 | return ret; | 257 | return ret; |
258 | } | 258 | } |
@@ -273,7 +273,7 @@ int vmw_du_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) | |||
273 | * can do this since the caller in the drm core doesn't check anything | 273 | * can do this since the caller in the drm core doesn't check anything |
274 | * which is protected by any looks. | 274 | * which is protected by any looks. |
275 | */ | 275 | */ |
276 | drm_modeset_unlock(&crtc->mutex); | 276 | drm_modeset_unlock_crtc(crtc); |
277 | drm_modeset_lock_all(dev_priv->dev); | 277 | drm_modeset_lock_all(dev_priv->dev); |
278 | 278 | ||
279 | vmw_cursor_update_position(dev_priv, shown, | 279 | vmw_cursor_update_position(dev_priv, shown, |
@@ -281,7 +281,7 @@ int vmw_du_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) | |||
281 | du->cursor_y + du->hotspot_y); | 281 | du->cursor_y + du->hotspot_y); |
282 | 282 | ||
283 | drm_modeset_unlock_all(dev_priv->dev); | 283 | drm_modeset_unlock_all(dev_priv->dev); |
284 | drm_modeset_lock(&crtc->mutex, NULL); | 284 | drm_modeset_lock_crtc(crtc); |
285 | 285 | ||
286 | return 0; | 286 | return 0; |
287 | } | 287 | } |
@@ -1950,6 +1950,14 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector, | |||
1950 | DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) | 1950 | DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) |
1951 | }; | 1951 | }; |
1952 | int i; | 1952 | int i; |
1953 | u32 assumed_bpp = 2; | ||
1954 | |||
1955 | /* | ||
1956 | * If using screen objects, then assume 32-bpp because that's what the | ||
1957 | * SVGA device is assuming | ||
1958 | */ | ||
1959 | if (dev_priv->sou_priv) | ||
1960 | assumed_bpp = 4; | ||
1953 | 1961 | ||
1954 | /* Add preferred mode */ | 1962 | /* Add preferred mode */ |
1955 | { | 1963 | { |
@@ -1960,8 +1968,9 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector, | |||
1960 | mode->vdisplay = du->pref_height; | 1968 | mode->vdisplay = du->pref_height; |
1961 | vmw_guess_mode_timing(mode); | 1969 | vmw_guess_mode_timing(mode); |
1962 | 1970 | ||
1963 | if (vmw_kms_validate_mode_vram(dev_priv, mode->hdisplay * 2, | 1971 | if (vmw_kms_validate_mode_vram(dev_priv, |
1964 | mode->vdisplay)) { | 1972 | mode->hdisplay * assumed_bpp, |
1973 | mode->vdisplay)) { | ||
1965 | drm_mode_probed_add(connector, mode); | 1974 | drm_mode_probed_add(connector, mode); |
1966 | } else { | 1975 | } else { |
1967 | drm_mode_destroy(dev, mode); | 1976 | drm_mode_destroy(dev, mode); |
@@ -1983,7 +1992,8 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector, | |||
1983 | bmode->vdisplay > max_height) | 1992 | bmode->vdisplay > max_height) |
1984 | continue; | 1993 | continue; |
1985 | 1994 | ||
1986 | if (!vmw_kms_validate_mode_vram(dev_priv, bmode->hdisplay * 2, | 1995 | if (!vmw_kms_validate_mode_vram(dev_priv, |
1996 | bmode->hdisplay * assumed_bpp, | ||
1987 | bmode->vdisplay)) | 1997 | bmode->vdisplay)) |
1988 | continue; | 1998 | continue; |
1989 | 1999 | ||