Commit bc2d6508 authored by Thomas Hellstrom's avatar Thomas Hellstrom

drm/vmwgfx: Replace vram_size with prim_bb_mem for calculation of max resolution

In the future, Scanout buffers need not be backed by VRAM and
the two definitions will differ.
Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
Reviewed-by: default avatarZack Rusin <zackr@vmware.com>
parent cfe4d53e
...@@ -628,6 +628,8 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) ...@@ -628,6 +628,8 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
if (unlikely(ret != 0)) if (unlikely(ret != 0))
goto out_err0; goto out_err0;
dev_priv->prim_bb_mem = dev_priv->vram_size;
mutex_unlock(&dev_priv->hw_mutex); mutex_unlock(&dev_priv->hw_mutex);
vmw_print_capabilities(dev_priv->capabilities); vmw_print_capabilities(dev_priv->capabilities);
...@@ -640,6 +642,8 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) ...@@ -640,6 +642,8 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
DRM_INFO("Max dedicated hypervisor surface memory is %u kiB\n", DRM_INFO("Max dedicated hypervisor surface memory is %u kiB\n",
(unsigned)dev_priv->memory_size / 1024); (unsigned)dev_priv->memory_size / 1024);
} }
DRM_INFO("Maximum display memory size is %u kiB\n",
dev_priv->prim_bb_mem / 1024);
DRM_INFO("VRAM at 0x%08x size is %u kiB\n", DRM_INFO("VRAM at 0x%08x size is %u kiB\n",
dev_priv->vram_start, dev_priv->vram_size / 1024); dev_priv->vram_start, dev_priv->vram_size / 1024);
DRM_INFO("MMIO at 0x%08x size is %u kiB\n", DRM_INFO("MMIO at 0x%08x size is %u kiB\n",
......
...@@ -281,6 +281,7 @@ struct vmw_private { ...@@ -281,6 +281,7 @@ struct vmw_private {
unsigned int io_start; unsigned int io_start;
uint32_t vram_start; uint32_t vram_start;
uint32_t vram_size; uint32_t vram_size;
uint32_t prim_bb_mem;
uint32_t mmio_start; uint32_t mmio_start;
uint32_t mmio_size; uint32_t mmio_size;
uint32_t fb_max_width; uint32_t fb_max_width;
......
...@@ -53,7 +53,7 @@ int vmw_getparam_ioctl(struct drm_device *dev, void *data, ...@@ -53,7 +53,7 @@ int vmw_getparam_ioctl(struct drm_device *dev, void *data,
param->value = dev_priv->fifo.capabilities; param->value = dev_priv->fifo.capabilities;
break; break;
case DRM_VMW_PARAM_MAX_FB_SIZE: case DRM_VMW_PARAM_MAX_FB_SIZE:
param->value = dev_priv->vram_size; param->value = dev_priv->prim_bb_mem;
break; break;
case DRM_VMW_PARAM_FIFO_HW_VERSION: case DRM_VMW_PARAM_FIFO_HW_VERSION:
{ {
......
...@@ -1645,7 +1645,7 @@ bool vmw_kms_validate_mode_vram(struct vmw_private *dev_priv, ...@@ -1645,7 +1645,7 @@ bool vmw_kms_validate_mode_vram(struct vmw_private *dev_priv,
uint32_t pitch, uint32_t pitch,
uint32_t height) uint32_t height)
{ {
return ((u64) pitch * (u64) height) < (u64) dev_priv->vram_size; return ((u64) pitch * (u64) height) < (u64) dev_priv->prim_bb_mem;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment