From: Thomas Hellstrom <thellstrom@vmware.com>
To: airlied@gmail.com, dri-devel@lists.freedesktop.org
Subject: [PATCH 02/10] vmwgfx: Add support for depth 8
Date: Wed, 31 Aug 2011 09:42:47 +0200 [thread overview]
Message-ID: <1314776575-9197-1-git-send-email-thellstrom@vmware.com> (raw)
From: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
---
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +++
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 11 +++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index dfe32e6..7539b56 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -567,6 +567,9 @@ static int vmw_kms_new_framebuffer_surface(struct vmw_private *dev_priv,
case 15:
format = SVGA3D_A1R5G5B5;
break;
+ case 8:
+ format = SVGA3D_LUMINANCE8;
+ break;
default:
DRM_ERROR("Invalid color depth: %d\n", mode_cmd->depth);
return -EINVAL;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
index 7b8115a..c6d09a6 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
@@ -83,6 +83,15 @@ static void vmw_ldu_crtc_gamma_set(struct drm_crtc *crtc,
u16 *r, u16 *g, u16 *b,
uint32_t start, uint32_t size)
{
+ struct vmw_private *dev_priv = vmw_priv(crtc->dev);
+ int i;
+
+ for (i = 0; i < size; i++) {
+ DRM_DEBUG("%d r/g/b = 0x%04x / 0x%04x / 0x%04x\n", i, r[i], g[i], b[i]);
+ vmw_write(dev_priv, SVGA_PALETTE_BASE + i * 3 + 0, r[i] >> 8);
+ vmw_write(dev_priv, SVGA_PALETTE_BASE + i * 3 + 1, g[i] >> 8);
+ vmw_write(dev_priv, SVGA_PALETTE_BASE + i * 3 + 2, b[i] >> 8);
+ }
}
static void vmw_ldu_crtc_destroy(struct drm_crtc *crtc)
@@ -547,6 +556,8 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
drm_crtc_init(dev, crtc, &vmw_legacy_crtc_funcs);
+ drm_mode_crtc_set_gamma_size(crtc, 256);
+
drm_connector_attach_property(connector,
dev->mode_config.dirty_info_property,
1);
--
1.7.4.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2011-08-31 7:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-31 7:42 Thomas Hellstrom [this message]
2011-08-31 7:42 ` [PATCH 03/10] vmwgfx: Don't write to read-only registers Thomas Hellstrom
2011-08-31 7:42 ` [PATCH 04/10] vmwgfx: Fix 'bbp' typo Thomas Hellstrom
2011-08-31 7:42 ` [PATCH 05/10] vmwgfx: Print error diagnostics if depth doesn't match the host expectation Thomas Hellstrom
2011-08-31 7:42 ` [PATCH 06/10] vmwgfx: Update register definitions for HWV8 and print out new capabilities Thomas Hellstrom
2011-09-01 18:02 ` Konrad Rzeszutek Wilk
2011-09-01 19:36 ` Thomas Hellstrom
2011-08-31 7:42 ` [PATCH 07/10] vmwgfx: Switch to VGA when we drop master and vmwgfx fbdev is not active Thomas Hellstrom
2011-08-31 7:42 ` [PATCH 08/10] vmwgfx: Restrict number of GMR pages to device limit Thomas Hellstrom
2011-08-31 7:42 ` [PATCH 09/10] vmwgfx: Fix potential execbuf deadlocks Thomas Hellstrom
2011-08-31 7:42 ` [PATCH 10/10] vmwgfx: Implement GMR2 Thomas Hellstrom
2011-09-01 19:00 ` Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314776575-9197-1-git-send-email-thellstrom@vmware.com \
--to=thellstrom@vmware.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox