diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2011-10-22 04:29:33 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-10-23 02:47:53 -0400 |
commit | 64fc99447f5dc6dcb03b4cb4395431f957951e61 (patch) | |
tree | 1387dd6a1691c56e974a9ab2a7a49d1d55d3c9ab /drivers/gpu/drm/vmwgfx | |
parent | 19703058cd2eacd83ed5948fdbbc5e29d94b60b5 (diff) |
vmwgfx: Emulate depth 32 framebuffers
Signed-off-by: Jakob Bornecrantz <jakob@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')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 10 |
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 39b99dbde218..00ec61921f2f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |||
@@ -679,6 +679,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, | |||
679 | struct vmw_private *dev_priv, | 679 | struct vmw_private *dev_priv, |
680 | struct vmw_framebuffer *framebuffer) | 680 | struct vmw_framebuffer *framebuffer) |
681 | { | 681 | { |
682 | int depth = framebuffer->base.depth; | ||
682 | size_t fifo_size; | 683 | size_t fifo_size; |
683 | int ret; | 684 | int ret; |
684 | 685 | ||
@@ -687,6 +688,13 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, | |||
687 | SVGAFifoCmdDefineGMRFB body; | 688 | SVGAFifoCmdDefineGMRFB body; |
688 | } *cmd; | 689 | } *cmd; |
689 | 690 | ||
691 | /* Emulate RGBA support, contrary to svga_reg.h this is not | ||
692 | * supported by hosts. This is only a problem if we are reading | ||
693 | * this value later and expecting what we uploaded back. | ||
694 | */ | ||
695 | if (depth == 32) | ||
696 | depth = 24; | ||
697 | |||
690 | fifo_size = sizeof(*cmd); | 698 | fifo_size = sizeof(*cmd); |
691 | cmd = kmalloc(fifo_size, GFP_KERNEL); | 699 | cmd = kmalloc(fifo_size, GFP_KERNEL); |
692 | if (unlikely(cmd == NULL)) { | 700 | if (unlikely(cmd == NULL)) { |
@@ -697,7 +705,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, | |||
697 | memset(cmd, 0, fifo_size); | 705 | memset(cmd, 0, fifo_size); |
698 | cmd->header = SVGA_CMD_DEFINE_GMRFB; | 706 | cmd->header = SVGA_CMD_DEFINE_GMRFB; |
699 | cmd->body.format.bitsPerPixel = framebuffer->base.bits_per_pixel; | 707 | cmd->body.format.bitsPerPixel = framebuffer->base.bits_per_pixel; |
700 | cmd->body.format.colorDepth = framebuffer->base.depth; | 708 | cmd->body.format.colorDepth = depth; |
701 | cmd->body.format.reserved = 0; | 709 | cmd->body.format.reserved = 0; |
702 | cmd->body.bytesPerLine = framebuffer->base.pitch; | 710 | cmd->body.bytesPerLine = framebuffer->base.pitch; |
703 | cmd->body.ptr.gmrId = framebuffer->user_handle; | 711 | cmd->body.ptr.gmrId = framebuffer->user_handle; |