diff options
author | Sinclair Yeh <syeh@vmware.com> | 2017-03-27 20:12:27 +0200 |
---|---|---|
committer | Sinclair Yeh <syeh@vmware.com> | 2017-04-01 00:21:20 +0200 |
commit | 28c954299cd2b5cb5411816c9eeaf3f51ed4638e (patch) | |
tree | 8d6afa1906526ea636035af1bbbc7f177cb02a1a /drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | |
parent | drm/vmwgfx: Support topology greater than texture size (diff) | |
download | linux-28c954299cd2b5cb5411816c9eeaf3f51ed4638e.tar.xz linux-28c954299cd2b5cb5411816c9eeaf3f51ed4638e.zip |
drm/vmwgfx: Properly check display/scanout surface size
The scanout surface size is the smaller of max texture size and
max STDU size.
Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index 4fc46b23ba8b..e872ffe5f0db 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -1601,7 +1601,21 @@ int vmw_kms_stdu_init_display(struct vmw_private *dev_priv) dev_priv->active_display_unit = vmw_du_screen_target; - if (!(dev_priv->capabilities & SVGA_CAP_3D)) { + if (dev_priv->capabilities & SVGA_CAP_3D) { + /* + * For 3D VMs, display (scanout) buffer size is the smaller of + * max texture and max STDU + */ + uint32_t max_width, max_height; + + max_width = min(dev_priv->texture_max_width, + dev_priv->stdu_max_width); + max_height = min(dev_priv->texture_max_height, + dev_priv->stdu_max_height); + + dev->mode_config.max_width = max_width; + dev->mode_config.max_height = max_height; + } else { /* * Given various display aspect ratios, there's no way to * estimate these using prim_bb_mem. So just set these to |