aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c3
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_drv.c6
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.c24
3 files changed, 24 insertions, 9 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
index bfeb4b1f2acf..21e9b7f8dad0 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
@@ -246,7 +246,8 @@ int vmw_cmdbuf_res_remove(struct vmw_cmdbuf_res_manager *man,
246 struct drm_hash_item *hash; 246 struct drm_hash_item *hash;
247 int ret; 247 int ret;
248 248
249 ret = drm_ht_find_item(&man->resources, user_key, &hash); 249 ret = drm_ht_find_item(&man->resources, user_key | (res_type << 24),
250 &hash);
250 if (likely(ret != 0)) 251 if (likely(ret != 0))
251 return -EINVAL; 252 return -EINVAL;
252 253
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 7197af157313..25f3c250fd98 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -688,7 +688,11 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
688 goto out_err0; 688 goto out_err0;
689 } 689 }
690 690
691 if (unlikely(dev_priv->prim_bb_mem < dev_priv->vram_size)) 691 /*
692 * Limit back buffer size to VRAM size. Remove this once
693 * screen targets are implemented.
694 */
695 if (dev_priv->prim_bb_mem > dev_priv->vram_size)
692 dev_priv->prim_bb_mem = dev_priv->vram_size; 696 dev_priv->prim_bb_mem = dev_priv->vram_size;
693 697
694 mutex_unlock(&dev_priv->hw_mutex); 698 mutex_unlock(&dev_priv->hw_mutex);
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;
253out: 253out:
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