diff options
author | James Simmons <jsimmons@infradead.org> | 2010-08-02 20:33:19 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-08-09 20:47:00 -0400 |
commit | 7203425a943eb3e189ba6b512827e0deb5f23872 (patch) | |
tree | e0fdc7ed583f6990bbffde67f4f45b1f11b5a39e /drivers/gpu/drm/nouveau | |
parent | 38fcbb674d7cc37b38473a89e8045ee80364e4f9 (diff) |
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')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv04_crtc.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_crtc.c | 9 |
2 files changed, 7 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nv04_crtc.c b/drivers/gpu/drm/nouveau/nv04_crtc.c index 96f46c421fa5..497df8765f28 100644 --- a/drivers/gpu/drm/nouveau/nv04_crtc.c +++ b/drivers/gpu/drm/nouveau/nv04_crtc.c | |||
@@ -742,15 +742,13 @@ nv_crtc_gamma_load(struct drm_crtc *crtc) | |||
742 | } | 742 | } |
743 | 743 | ||
744 | static void | 744 | static void |
745 | nv_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, uint32_t size) | 745 | nv_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, uint32_t start, |
746 | uint32_t size) | ||
746 | { | 747 | { |
748 | int end = (start + size > 256) ? 256 : start + size, i; | ||
747 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); | 749 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); |
748 | int i; | ||
749 | |||
750 | if (size != 256) | ||
751 | return; | ||
752 | 750 | ||
753 | for (i = 0; i < 256; i++) { | 751 | for (i = start; i < end; i++) { |
754 | nv_crtc->lut.r[i] = r[i]; | 752 | nv_crtc->lut.r[i] = r[i]; |
755 | nv_crtc->lut.g[i] = g[i]; | 753 | nv_crtc->lut.g[i] = g[i]; |
756 | nv_crtc->lut.b[i] = b[i]; | 754 | nv_crtc->lut.b[i] = b[i]; |
diff --git a/drivers/gpu/drm/nouveau/nv50_crtc.c b/drivers/gpu/drm/nouveau/nv50_crtc.c index dbd9a63bc7f2..bfd4ca2fe7ef 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) | |||
398 | 398 | ||
399 | static void | 399 | static void |
400 | nv50_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, | 400 | nv50_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, |
401 | uint32_t size) | 401 | uint32_t start, uint32_t size) |
402 | { | 402 | { |
403 | int end = (start + size > 256) ? 256 : start + size, i; | ||
403 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); | 404 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); |
404 | int i; | ||
405 | |||
406 | if (size != 256) | ||
407 | return; | ||
408 | 405 | ||
409 | for (i = 0; i < 256; i++) { | 406 | for (i = start; i < end; i++) { |
410 | nv_crtc->lut.r[i] = r[i]; | 407 | nv_crtc->lut.r[i] = r[i]; |
411 | nv_crtc->lut.g[i] = g[i]; | 408 | nv_crtc->lut.g[i] = g[i]; |
412 | nv_crtc->lut.b[i] = b[i]; | 409 | nv_crtc->lut.b[i] = b[i]; |