summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2011-08-31 07:42:50 +0000
committerDave Airlie <airlied@redhat.com>2011-09-01 09:37:49 +0100
commit0bef23f9180b43e805ce4dabb90b24a0b558721c (patch)
tree6524902551a89a981422e121008ee5f64555266c /drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
parent6558429bc4c7351cc3d80fc9055f1204a9adf060 (diff)
downloadblackbird-op-linux-0bef23f9180b43e805ce4dabb90b24a0b558721c.tar.gz
blackbird-op-linux-0bef23f9180b43e805ce4dabb90b24a0b558721c.zip
vmwgfx: Print error diagnostics if depth doesn't match the host expectation
Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_kms.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index be8163b8f1ae..9ea2f05e72bb 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -990,7 +990,7 @@ out:
return ret;
}
-void vmw_kms_write_svga(struct vmw_private *vmw_priv,
+int vmw_kms_write_svga(struct vmw_private *vmw_priv,
unsigned width, unsigned height, unsigned pitch,
unsigned bpp, unsigned depth)
{
@@ -1001,6 +1001,14 @@ void vmw_kms_write_svga(struct vmw_private *vmw_priv,
vmw_write(vmw_priv, SVGA_REG_WIDTH, width);
vmw_write(vmw_priv, SVGA_REG_HEIGHT, height);
vmw_write(vmw_priv, SVGA_REG_BITS_PER_PIXEL, bpp);
+
+ if (vmw_read(vmw_priv, SVGA_REG_DEPTH) != depth) {
+ DRM_ERROR("Invalid depth %u for %u bpp, host expects %u\n",
+ depth, bpp, vmw_read(vmw_priv, SVGA_REG_DEPTH));
+ return -EINVAL;
+ }
+
+ return 0;
}
int vmw_kms_save_vga(struct vmw_private *vmw_priv)
OpenPOWER on IntegriCloud