summaryrefslogtreecommitdiff
path: root/vmwgfx_kms.c
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2011-01-05 18:54:45 +0100
committerMichel Dänzer <daenzer@vmware.com>2011-01-11 13:22:41 +0100
commit11a0c16d67c9a4d4f082efba03a4baf8497f6dba (patch)
tree2bc91a18e94cf687642d31a1ce91ca8f8b438522 /vmwgfx_kms.c
parent0105a58adf85848e063db67a53cf16642b1fa8e2 (diff)
vmwgfx: Print error diagnostics if depth doesn't match the host expectation.
Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'vmwgfx_kms.c')
-rw-r--r--vmwgfx_kms.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/vmwgfx_kms.c b/vmwgfx_kms.c
index 3e59f80..2793734 100644
--- a/vmwgfx_kms.c
+++ b/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)