aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_display.c
diff options
context:
space:
mode:
authorJames Simmons <jsimmons@infradead.org>2010-08-02 20:33:19 -0400
committerDave Airlie <airlied@redhat.com>2010-08-09 20:47:00 -0400
commit7203425a943eb3e189ba6b512827e0deb5f23872 (patch)
treee0fdc7ed583f6990bbffde67f4f45b1f11b5a39e /drivers/gpu/drm/radeon/radeon_display.c
parent38fcbb674d7cc37b38473a89e8045ee80364e4f9 (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/radeon/radeon_display.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_display.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 6130ec9ed502..5764f4d3b4f1 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -161,17 +161,13 @@ void radeon_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
161} 161}
162 162
163static void radeon_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, 163static void radeon_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
164 u16 *blue, uint32_t size) 164 u16 *blue, uint32_t start, uint32_t size)
165{ 165{
166 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); 166 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
167 int i; 167 int end = (start + size > 256) ? 256 : start + size, i;
168
169 if (size != 256) {
170 return;
171 }
172 168
173 /* userspace palettes are always correct as is */ 169 /* userspace palettes are always correct as is */
174 for (i = 0; i < 256; i++) { 170 for (i = start; i < end; i++) {
175 radeon_crtc->lut_r[i] = red[i] >> 6; 171 radeon_crtc->lut_r[i] = red[i] >> 6;
176 radeon_crtc->lut_g[i] = green[i] >> 6; 172 radeon_crtc->lut_g[i] = green[i] >> 6;
177 radeon_crtc->lut_b[i] = blue[i] >> 6; 173 radeon_crtc->lut_b[i] = blue[i] >> 6;