All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers
@ 2011-10-22  8:29 Thomas Hellstrom
  2011-10-22  8:29 ` [PATCH 2/2] vmwgfx: Don't pass unused arguments to do_dirty functions Thomas Hellstrom
  2011-10-24 21:25 ` [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Hellstrom @ 2011-10-22  8:29 UTC (permalink / raw)
  To: airlied; +Cc: Thomas Hellstrom, dri-devel

From: Jakob Bornecrantz <jakob@vmware.com>

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
---
 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 39b99db..00ec619 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,
 				  struct vmw_private *dev_priv,
 				  struct vmw_framebuffer *framebuffer)
 {
+	int depth = framebuffer->base.depth;
 	size_t fifo_size;
 	int ret;
 
@@ -687,6 +688,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)) {
@@ -697,7 +705,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;
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-24 22:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-22  8:29 [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers Thomas Hellstrom
2011-10-22  8:29 ` [PATCH 2/2] vmwgfx: Don't pass unused arguments to do_dirty functions Thomas Hellstrom
2011-10-24 21:25 ` [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers Konrad Rzeszutek Wilk
2011-10-24 22:01   ` Jakob Bornecrantz
2011-10-24 22:20     ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.