diff options
-rw-r--r-- | drivers/gpu/drm/gma500/mdfld_intel_display.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/oaktrail_crtc.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/oaktrail_hdmi.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/psb_drv.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/psb_intel_display.c | 70 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/psb_intel_drv.h | 1 |
6 files changed, 6 insertions, 73 deletions
diff --git a/drivers/gpu/drm/gma500/mdfld_intel_display.c b/drivers/gpu/drm/gma500/mdfld_intel_display.c index da83fddbc9a8..2862cdb8920a 100644 --- a/drivers/gpu/drm/gma500/mdfld_intel_display.c +++ b/drivers/gpu/drm/gma500/mdfld_intel_display.c | |||
@@ -436,7 +436,7 @@ static void mdfld_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
436 | } | 436 | } |
437 | } | 437 | } |
438 | 438 | ||
439 | psb_intel_crtc_load_lut(crtc); | 439 | gma_crtc_load_lut(crtc); |
440 | 440 | ||
441 | /* Give the overlay scaler a chance to enable | 441 | /* Give the overlay scaler a chance to enable |
442 | if it's on this pipe */ | 442 | if it's on this pipe */ |
diff --git a/drivers/gpu/drm/gma500/oaktrail_crtc.c b/drivers/gpu/drm/gma500/oaktrail_crtc.c index 8af461f3a72d..5cd007e82e59 100644 --- a/drivers/gpu/drm/gma500/oaktrail_crtc.c +++ b/drivers/gpu/drm/gma500/oaktrail_crtc.c | |||
@@ -212,7 +212,7 @@ static void oaktrail_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
212 | REG_WRITE(map->base, REG_READ(map->base)); | 212 | REG_WRITE(map->base, REG_READ(map->base)); |
213 | } | 213 | } |
214 | 214 | ||
215 | psb_intel_crtc_load_lut(crtc); | 215 | gma_crtc_load_lut(crtc); |
216 | 216 | ||
217 | /* Give the overlay scaler a chance to enable | 217 | /* Give the overlay scaler a chance to enable |
218 | if it's on this pipe */ | 218 | if it's on this pipe */ |
diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c index d9013f70b019..7d9a5ee52814 100644 --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c | |||
@@ -464,7 +464,7 @@ void oaktrail_crtc_hdmi_dpms(struct drm_crtc *crtc, int mode) | |||
464 | REG_READ(DSPBSURF); | 464 | REG_READ(DSPBSURF); |
465 | } | 465 | } |
466 | 466 | ||
467 | psb_intel_crtc_load_lut(crtc); | 467 | gma_crtc_load_lut(crtc); |
468 | } | 468 | } |
469 | 469 | ||
470 | /* DSPARB */ | 470 | /* DSPARB */ |
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index bddea5807442..b4d13261f762 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c | |||
@@ -459,7 +459,7 @@ static int psb_gamma_ioctl(struct drm_device *dev, void *data, | |||
459 | for (i = 0; i < 256; i++) | 459 | for (i = 0; i < 256; i++) |
460 | psb_intel_crtc->lut_adj[i] = lut_arg->lut[i]; | 460 | psb_intel_crtc->lut_adj[i] = lut_arg->lut[i]; |
461 | 461 | ||
462 | psb_intel_crtc_load_lut(crtc); | 462 | gma_crtc_load_lut(crtc); |
463 | 463 | ||
464 | return 0; | 464 | return 0; |
465 | } | 465 | } |
diff --git a/drivers/gpu/drm/gma500/psb_intel_display.c b/drivers/gpu/drm/gma500/psb_intel_display.c index ca041c6aba4a..940c6f2fb8ee 100644 --- a/drivers/gpu/drm/gma500/psb_intel_display.c +++ b/drivers/gpu/drm/gma500/psb_intel_display.c | |||
@@ -135,7 +135,7 @@ static void psb_intel_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
135 | REG_WRITE(map->base, REG_READ(map->base)); | 135 | REG_WRITE(map->base, REG_READ(map->base)); |
136 | } | 136 | } |
137 | 137 | ||
138 | psb_intel_crtc_load_lut(crtc); | 138 | gma_crtc_load_lut(crtc); |
139 | 139 | ||
140 | /* Give the overlay scaler a chance to enable | 140 | /* Give the overlay scaler a chance to enable |
141 | * if it's on this pipe */ | 141 | * if it's on this pipe */ |
@@ -431,54 +431,6 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc, | |||
431 | return 0; | 431 | return 0; |
432 | } | 432 | } |
433 | 433 | ||
434 | /** Loads the palette/gamma unit for the CRTC with the prepared values */ | ||
435 | void psb_intel_crtc_load_lut(struct drm_crtc *crtc) | ||
436 | { | ||
437 | struct drm_device *dev = crtc->dev; | ||
438 | struct drm_psb_private *dev_priv = dev->dev_private; | ||
439 | struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc); | ||
440 | const struct psb_offset *map = &dev_priv->regmap[psb_intel_crtc->pipe]; | ||
441 | int palreg = map->palette; | ||
442 | int i; | ||
443 | |||
444 | /* The clocks have to be on to load the palette. */ | ||
445 | if (!crtc->enabled) | ||
446 | return; | ||
447 | |||
448 | switch (psb_intel_crtc->pipe) { | ||
449 | case 0: | ||
450 | case 1: | ||
451 | break; | ||
452 | default: | ||
453 | dev_err(dev->dev, "Illegal Pipe Number.\n"); | ||
454 | return; | ||
455 | } | ||
456 | |||
457 | if (gma_power_begin(dev, false)) { | ||
458 | for (i = 0; i < 256; i++) { | ||
459 | REG_WRITE(palreg + 4 * i, | ||
460 | ((psb_intel_crtc->lut_r[i] + | ||
461 | psb_intel_crtc->lut_adj[i]) << 16) | | ||
462 | ((psb_intel_crtc->lut_g[i] + | ||
463 | psb_intel_crtc->lut_adj[i]) << 8) | | ||
464 | (psb_intel_crtc->lut_b[i] + | ||
465 | psb_intel_crtc->lut_adj[i])); | ||
466 | } | ||
467 | gma_power_end(dev); | ||
468 | } else { | ||
469 | for (i = 0; i < 256; i++) { | ||
470 | dev_priv->regs.pipe[0].palette[i] = | ||
471 | ((psb_intel_crtc->lut_r[i] + | ||
472 | psb_intel_crtc->lut_adj[i]) << 16) | | ||
473 | ((psb_intel_crtc->lut_g[i] + | ||
474 | psb_intel_crtc->lut_adj[i]) << 8) | | ||
475 | (psb_intel_crtc->lut_b[i] + | ||
476 | psb_intel_crtc->lut_adj[i]); | ||
477 | } | ||
478 | |||
479 | } | ||
480 | } | ||
481 | |||
482 | /** | 434 | /** |
483 | * Save HW states of giving crtc | 435 | * Save HW states of giving crtc |
484 | */ | 436 | */ |
@@ -737,24 +689,6 @@ static int psb_intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) | |||
737 | return 0; | 689 | return 0; |
738 | } | 690 | } |
739 | 691 | ||
740 | static void psb_intel_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, | ||
741 | u16 *green, u16 *blue, uint32_t type, uint32_t size) | ||
742 | { | ||
743 | struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc); | ||
744 | int i; | ||
745 | |||
746 | if (size != 256) | ||
747 | return; | ||
748 | |||
749 | for (i = 0; i < 256; i++) { | ||
750 | psb_intel_crtc->lut_r[i] = red[i] >> 8; | ||
751 | psb_intel_crtc->lut_g[i] = green[i] >> 8; | ||
752 | psb_intel_crtc->lut_b[i] = blue[i] >> 8; | ||
753 | } | ||
754 | |||
755 | psb_intel_crtc_load_lut(crtc); | ||
756 | } | ||
757 | |||
758 | static int psb_crtc_set_config(struct drm_mode_set *set) | 692 | static int psb_crtc_set_config(struct drm_mode_set *set) |
759 | { | 693 | { |
760 | int ret; | 694 | int ret; |
@@ -930,7 +864,7 @@ const struct drm_crtc_funcs psb_intel_crtc_funcs = { | |||
930 | .restore = psb_intel_crtc_restore, | 864 | .restore = psb_intel_crtc_restore, |
931 | .cursor_set = psb_intel_crtc_cursor_set, | 865 | .cursor_set = psb_intel_crtc_cursor_set, |
932 | .cursor_move = psb_intel_crtc_cursor_move, | 866 | .cursor_move = psb_intel_crtc_cursor_move, |
933 | .gamma_set = psb_intel_crtc_gamma_set, | 867 | .gamma_set = gma_crtc_gamma_set, |
934 | .set_config = psb_crtc_set_config, | 868 | .set_config = psb_crtc_set_config, |
935 | .destroy = psb_intel_crtc_destroy, | 869 | .destroy = psb_intel_crtc_destroy, |
936 | }; | 870 | }; |
diff --git a/drivers/gpu/drm/gma500/psb_intel_drv.h b/drivers/gpu/drm/gma500/psb_intel_drv.h index 596850210a51..c8cd9bee7a89 100644 --- a/drivers/gpu/drm/gma500/psb_intel_drv.h +++ b/drivers/gpu/drm/gma500/psb_intel_drv.h | |||
@@ -226,7 +226,6 @@ extern void oaktrail_dsi_init(struct drm_device *dev, | |||
226 | extern void mid_dsi_init(struct drm_device *dev, | 226 | extern void mid_dsi_init(struct drm_device *dev, |
227 | struct psb_intel_mode_device *mode_dev, int dsi_num); | 227 | struct psb_intel_mode_device *mode_dev, int dsi_num); |
228 | 228 | ||
229 | extern void psb_intel_crtc_load_lut(struct drm_crtc *crtc); | ||
230 | extern void psb_intel_encoder_prepare(struct drm_encoder *encoder); | 229 | extern void psb_intel_encoder_prepare(struct drm_encoder *encoder); |
231 | extern void psb_intel_encoder_commit(struct drm_encoder *encoder); | 230 | extern void psb_intel_encoder_commit(struct drm_encoder *encoder); |
232 | extern void psb_intel_encoder_destroy(struct drm_encoder *encoder); | 231 | extern void psb_intel_encoder_destroy(struct drm_encoder *encoder); |