Commit 64fc9944 authored by Jakob Bornecrantz's avatar Jakob Bornecrantz Committed by Dave Airlie

vmwgfx: Emulate depth 32 framebuffers

Signed-off-by: default avatarJakob Bornecrantz <jakob@vmware.com>
Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 19703058
...@@ -679,6 +679,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, ...@@ -679,6 +679,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv,
struct vmw_private *dev_priv, struct vmw_private *dev_priv,
struct vmw_framebuffer *framebuffer) struct vmw_framebuffer *framebuffer)
{ {
int depth = framebuffer->base.depth;
size_t fifo_size; size_t fifo_size;
int ret; int ret;
...@@ -687,6 +688,13 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, ...@@ -687,6 +688,13 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv,
SVGAFifoCmdDefineGMRFB body; SVGAFifoCmdDefineGMRFB body;
} *cmd; } *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); fifo_size = sizeof(*cmd);
cmd = kmalloc(fifo_size, GFP_KERNEL); cmd = kmalloc(fifo_size, GFP_KERNEL);
if (unlikely(cmd == NULL)) { if (unlikely(cmd == NULL)) {
...@@ -697,7 +705,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, ...@@ -697,7 +705,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv,
memset(cmd, 0, fifo_size); memset(cmd, 0, fifo_size);
cmd->header = SVGA_CMD_DEFINE_GMRFB; cmd->header = SVGA_CMD_DEFINE_GMRFB;
cmd->body.format.bitsPerPixel = framebuffer->base.bits_per_pixel; 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.format.reserved = 0;
cmd->body.bytesPerLine = framebuffer->base.pitch; cmd->body.bytesPerLine = framebuffer->base.pitch;
cmd->body.ptr.gmrId = framebuffer->user_handle; cmd->body.ptr.gmrId = framebuffer->user_handle;
......
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