summaryrefslogtreecommitdiff
path: root/linux-core/intel_display.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-06-02 14:04:41 +1000
committerDave Airlie <airlied@redhat.com>2008-06-02 14:04:41 +1000
commit4e7b24639808e5e1e2c05143028db1a3bc2812e9 (patch)
treeba16702759e87caa1119a46a1e18d27048c9667d /linux-core/intel_display.c
parenteba6cdc936cb33d929997ccb9bade6f75bb40670 (diff)
drm: add functions to get/set gamma ramps
Diffstat (limited to 'linux-core/intel_display.c')
-rw-r--r--linux-core/intel_display.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/linux-core/intel_display.c b/linux-core/intel_display.c
index e23b3973..ba9441d6 100644
--- a/linux-core/intel_display.c
+++ b/linux-core/intel_display.c
@@ -1056,7 +1056,7 @@ static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
}
/** Sets the color ramps on behalf of RandR */
-static void intel_crtc_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
+void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
u16 blue, int regno)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
@@ -1066,6 +1066,24 @@ static void intel_crtc_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
intel_crtc->lut_b[regno] = blue >> 8;
}
+static void intel_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
+ u16 *blue, uint32_t size)
+{
+ struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+ int i;
+
+ if (size != 256)
+ return;
+
+ for (i = 0; i < 256; i++) {
+ intel_crtc->lut_r[i] = red[i] >> 8;
+ intel_crtc->lut_g[i] = green[i] >> 8;
+ intel_crtc->lut_b[i] = blue[i] >> 8;
+ }
+
+ intel_crtc_load_lut(crtc);
+}
+
/**
* Get a pipe with a simple mode set on it for doing load-based monitor
* detection.
@@ -1343,6 +1361,7 @@ void intel_crtc_init(struct drm_device *dev, int pipe)
drm_crtc_init(dev, &intel_crtc->base, &intel_crtc_funcs);
+ drm_mode_crtc_set_gamma_size(&intel_crtc->base, 256);
intel_crtc->pipe = pipe;
for (i = 0; i < 256; i++) {
intel_crtc->lut_r[i] = i;