aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_crtc.c
diff options
context:
space:
mode:
authorJames Simmons <jsimmons@infradead.org>2010-08-03 01:33:19 +0100
committerDave Airlie <airlied@redhat.com>2010-08-10 10:47:00 +1000
commit7203425a943eb3e189ba6b512827e0deb5f23872 (patch)
treee0fdc7ed583f6990bbffde67f4f45b1f11b5a39e /drivers/gpu/drm/nouveau/nv50_crtc.c
parent38fcbb674d7cc37b38473a89e8045ee80364e4f9 (diff)
downloadkernel_samsung_smdk4412-7203425a943eb3e189ba6b512827e0deb5f23872.zip
kernel_samsung_smdk4412-7203425a943eb3e189ba6b512827e0deb5f23872.tar.gz
kernel_samsung_smdk4412-7203425a943eb3e189ba6b512827e0deb5f23872.tar.bz2
drm: expand gamma_set
Expand the crtc_gamma_set function to accept a starting offset. The reason for this is to eventually use this function for setcolreg from drm_fb_helper.c. The fbdev colormap function can start at any offset in the color map. Signed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_crtc.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_crtc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_crtc.c b/drivers/gpu/drm/nouveau/nv50_crtc.c
index dbd9a63..bfd4ca2 100644
--- a/drivers/gpu/drm/nouveau/nv50_crtc.c
+++ b/drivers/gpu/drm/nouveau/nv50_crtc.c
@@ -398,15 +398,12 @@ nv50_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
static void
nv50_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
- uint32_t size)
+ uint32_t start, uint32_t size)
{
+ int end = (start + size > 256) ? 256 : start + size, i;
struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
- int i;
-
- if (size != 256)
- return;
- for (i = 0; i < 256; i++) {
+ for (i = start; i < end; i++) {
nv_crtc->lut.r[i] = r[i];
nv_crtc->lut.g[i] = g[i];
nv_crtc->lut.b[i] = b[i];