diff options
-rw-r--r-- | drivers/gpu/drm/gma500/cdv_intel_display.c | 70 |
1 files changed, 1 insertions, 69 deletions
diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c index 1160175f16f9..e30761a9bf83 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_display.c +++ b/drivers/gpu/drm/gma500/cdv_intel_display.c | |||
@@ -593,58 +593,6 @@ void cdv_intel_update_watermark(struct drm_device *dev, struct drm_crtc *crtc) | |||
593 | } | 593 | } |
594 | } | 594 | } |
595 | 595 | ||
596 | /** Loads the palette/gamma unit for the CRTC with the prepared values */ | ||
597 | static void cdv_intel_crtc_load_lut(struct drm_crtc *crtc) | ||
598 | { | ||
599 | struct drm_device *dev = crtc->dev; | ||
600 | struct drm_psb_private *dev_priv = dev->dev_private; | ||
601 | struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc); | ||
602 | int palreg = PALETTE_A; | ||
603 | int i; | ||
604 | |||
605 | /* The clocks have to be on to load the palette. */ | ||
606 | if (!crtc->enabled) | ||
607 | return; | ||
608 | |||
609 | switch (psb_intel_crtc->pipe) { | ||
610 | case 0: | ||
611 | break; | ||
612 | case 1: | ||
613 | palreg = PALETTE_B; | ||
614 | break; | ||
615 | case 2: | ||
616 | palreg = PALETTE_C; | ||
617 | break; | ||
618 | default: | ||
619 | dev_err(dev->dev, "Illegal Pipe Number.\n"); | ||
620 | return; | ||
621 | } | ||
622 | |||
623 | if (gma_power_begin(dev, false)) { | ||
624 | for (i = 0; i < 256; i++) { | ||
625 | REG_WRITE(palreg + 4 * i, | ||
626 | ((psb_intel_crtc->lut_r[i] + | ||
627 | psb_intel_crtc->lut_adj[i]) << 16) | | ||
628 | ((psb_intel_crtc->lut_g[i] + | ||
629 | psb_intel_crtc->lut_adj[i]) << 8) | | ||
630 | (psb_intel_crtc->lut_b[i] + | ||
631 | psb_intel_crtc->lut_adj[i])); | ||
632 | } | ||
633 | gma_power_end(dev); | ||
634 | } else { | ||
635 | for (i = 0; i < 256; i++) { | ||
636 | dev_priv->regs.pipe[0].palette[i] = | ||
637 | ((psb_intel_crtc->lut_r[i] + | ||
638 | psb_intel_crtc->lut_adj[i]) << 16) | | ||
639 | ((psb_intel_crtc->lut_g[i] + | ||
640 | psb_intel_crtc->lut_adj[i]) << 8) | | ||
641 | (psb_intel_crtc->lut_b[i] + | ||
642 | psb_intel_crtc->lut_adj[i]); | ||
643 | } | ||
644 | |||
645 | } | ||
646 | } | ||
647 | |||
648 | /** | 596 | /** |
649 | * Return the pipe currently connected to the panel fitter, | 597 | * Return the pipe currently connected to the panel fitter, |
650 | * or -1 if the panel fitter is not present or not in use | 598 | * or -1 if the panel fitter is not present or not in use |
@@ -1213,22 +1161,6 @@ static int cdv_intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) | |||
1213 | return 0; | 1161 | return 0; |
1214 | } | 1162 | } |
1215 | 1163 | ||
1216 | static void cdv_intel_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, | ||
1217 | u16 *green, u16 *blue, uint32_t start, uint32_t size) | ||
1218 | { | ||
1219 | struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc); | ||
1220 | int i; | ||
1221 | int end = (start + size > 256) ? 256 : start + size; | ||
1222 | |||
1223 | for (i = start; i < end; i++) { | ||
1224 | psb_intel_crtc->lut_r[i] = red[i] >> 8; | ||
1225 | psb_intel_crtc->lut_g[i] = green[i] >> 8; | ||
1226 | psb_intel_crtc->lut_b[i] = blue[i] >> 8; | ||
1227 | } | ||
1228 | |||
1229 | cdv_intel_crtc_load_lut(crtc); | ||
1230 | } | ||
1231 | |||
1232 | static int cdv_crtc_set_config(struct drm_mode_set *set) | 1164 | static int cdv_crtc_set_config(struct drm_mode_set *set) |
1233 | { | 1165 | { |
1234 | int ret = 0; | 1166 | int ret = 0; |
@@ -1401,7 +1333,7 @@ const struct drm_crtc_funcs cdv_intel_crtc_funcs = { | |||
1401 | .restore = cdv_intel_crtc_restore, | 1333 | .restore = cdv_intel_crtc_restore, |
1402 | .cursor_set = cdv_intel_crtc_cursor_set, | 1334 | .cursor_set = cdv_intel_crtc_cursor_set, |
1403 | .cursor_move = cdv_intel_crtc_cursor_move, | 1335 | .cursor_move = cdv_intel_crtc_cursor_move, |
1404 | .gamma_set = cdv_intel_crtc_gamma_set, | 1336 | .gamma_set = gma_crtc_gamma_set, |
1405 | .set_config = cdv_crtc_set_config, | 1337 | .set_config = cdv_crtc_set_config, |
1406 | .destroy = gma_crtc_destroy, | 1338 | .destroy = gma_crtc_destroy, |
1407 | }; | 1339 | }; |