diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2011-10-19 02:42:03 +0200 |
---|---|---|
committer | Jakob Bornecrantz <jakob@vmware.com> | 2011-10-19 11:43:02 +0200 |
commit | 061807b5050e8ac441bfb53d7d6f6d97ed6cec87 (patch) | |
tree | 1522783e7669646d4cb72b7bb036d8c0fc2d905f /vmwgfx_kms.c | |
parent | adaebc7098cbd7f439931d741b7a2b05eaeef077 (diff) |
vmwgfx: Emulate depth 32 framebuffers
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'vmwgfx_kms.c')
-rw-r--r-- | vmwgfx_kms.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/vmwgfx_kms.c b/vmwgfx_kms.c index db0b78c..a67d754 100644 --- a/vmwgfx_kms.c +++ b/vmwgfx_kms.c @@ -678,6 +678,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, struct vmw_private *dev_priv, struct vmw_framebuffer *framebuffer) { + int depth = framebuffer->base.depth; size_t fifo_size; int ret; @@ -686,6 +687,13 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, SVGAFifoCmdDefineGMRFB body; } *cmd; + /* Emulate RGBA support, contrary to svga_reg.h this is not + * supported by hosts. This is only a problem if we are reading + * this value later and expecting what we uploaded back. + */ + if (depth == 32) + depth = 24; + fifo_size = sizeof(*cmd); cmd = kmalloc(fifo_size, GFP_KERNEL); if (unlikely(cmd == NULL)) { @@ -696,7 +704,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, memset(cmd, 0, fifo_size); cmd->header = SVGA_CMD_DEFINE_GMRFB; cmd->body.format.bitsPerPixel = framebuffer->base.bits_per_pixel; - cmd->body.format.colorDepth = framebuffer->base.depth; + cmd->body.format.colorDepth = depth; cmd->body.format.reserved = 0; cmd->body.bytesPerLine = framebuffer->base.pitch; cmd->body.ptr.gmrId = framebuffer->user_handle; |