aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_panel.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-11-19 18:22:35 -0500
committerDave Airlie <airlied@redhat.com>2012-11-19 18:22:35 -0500
commit9fabd4eedeb904173d05cb1ced3c3e6b9d2e8137 (patch)
treeff5ebc768e1c83446db6b899016e5560b41d36ca /drivers/gpu/drm/i915/intel_panel.c
parent6380813c6e316455b944ba5f7b1515c98b837850 (diff)
parent6b8294a4d392c2c9f8867e8505511f3fc9419ba7 (diff)
Merge branch 'for-airlied' of git://people.freedesktop.org/~danvet/drm-intel into drm-next
Daniel writes: Highlights of this -next round: - ivb fdi B/C fixes - hsw sprite/plane offset fixes from Damien - unified dp/hdmi encoder for hsw, finally external dp support on hsw (Paulo) - kill-agp and some other prep work in the gtt code from Ben - some fb handling fixes from Ville - massive pile of patches to align hsw VGA with the spec and make it actually work (Paulo) - pile of workarounds from Jesse, mostly for vlv, but also some other related platforms - start of a dev_priv reorg, that thing grew out of bounds and chaotic - small bits&pieces all over the place, down to better error handling for load-detect on gen2 (Chris, Jani, Mika, Zhenyu, ...) On top of the previous pile (just copypasta): - tons of hsw dp prep patches form Paulo - round scheduled work items and timers to nearest second (Chris) - some hw workarounds (Jesse&Damien) - vlv dp support and related fixups (Vijay et al.) - basic haswell dp support, not yet wired up for external ports (Paulo) - edp support (Paulo) - tons of refactorings to prepare for the above (Paulo) - panel rework, unifiying code between lvds and edp panels (Jani) - panel fitter scaling modes (Jani + Yuly Novikov) - panel power improvements, should now work without the BIOS setting it up - extracting some dp helpers from radeon/i915 and move them to drm_dp_helper.c - randome pile of workarounds (Damien, Ben, ...) - some cleanups for the register restore code for suspend/resume - secure batchbuffer support, should enable tear-free blits on gen6+ Chris) - random smaller fixlets and cleanups. * 'for-airlied' of git://people.freedesktop.org/~danvet/drm-intel: (231 commits) drm/i915: Restore physical HWS_PGA after resume drm/i915: Report amount of usable graphics memory in MiB drm/i915/i2c: Track users of GMBUS force-bit drm/i915: Allocate the proper size for contexts. drm/i915: Update load-detect failure paths for modeset-rework drm/i915: Clear unused fields of mode for framebuffer creation drm/i915: Always calculate 8xx WM values based on a 32-bpp framebuffer drm/i915: Fix sparse warnings in from AGP kill code drm/i915: Missed lock change with rps lock drm/i915: Move the remaining gtt code drm/i915: flush system agent TLBs on SNB drm/i915: Kill off now unused gen6+ AGP code drm/i915: Calculate correct stolen size for GEN7+ drm/i915: Stop using AGP layer for GEN6+ drm/i915: drop the double-OP_STOREDW usage in blt_ring_flush drm/i915: don't rewrite the GTT on resume v4 drm/i915: protect RPS/RC6 related accesses (including PCU) with a new mutex drm/i915: put ring frequency and turbo setup into a work queue v5 drm/i915: don't block resume on fb console resume v2 drm/i915: extract l3_parity substruct from dev_priv ...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_panel.c')
-rw-r--r--drivers/gpu/drm/i915/intel_panel.c52
1 files changed, 31 insertions, 21 deletions
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index e2aacd329545..41d463573baa 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -138,24 +138,24 @@ static u32 i915_read_blc_pwm_ctl(struct drm_i915_private *dev_priv)
138 138
139 if (HAS_PCH_SPLIT(dev_priv->dev)) { 139 if (HAS_PCH_SPLIT(dev_priv->dev)) {
140 val = I915_READ(BLC_PWM_PCH_CTL2); 140 val = I915_READ(BLC_PWM_PCH_CTL2);
141 if (dev_priv->saveBLC_PWM_CTL2 == 0) { 141 if (dev_priv->regfile.saveBLC_PWM_CTL2 == 0) {
142 dev_priv->saveBLC_PWM_CTL2 = val; 142 dev_priv->regfile.saveBLC_PWM_CTL2 = val;
143 } else if (val == 0) { 143 } else if (val == 0) {
144 I915_WRITE(BLC_PWM_PCH_CTL2, 144 I915_WRITE(BLC_PWM_PCH_CTL2,
145 dev_priv->saveBLC_PWM_CTL2); 145 dev_priv->regfile.saveBLC_PWM_CTL2);
146 val = dev_priv->saveBLC_PWM_CTL2; 146 val = dev_priv->regfile.saveBLC_PWM_CTL2;
147 } 147 }
148 } else { 148 } else {
149 val = I915_READ(BLC_PWM_CTL); 149 val = I915_READ(BLC_PWM_CTL);
150 if (dev_priv->saveBLC_PWM_CTL == 0) { 150 if (dev_priv->regfile.saveBLC_PWM_CTL == 0) {
151 dev_priv->saveBLC_PWM_CTL = val; 151 dev_priv->regfile.saveBLC_PWM_CTL = val;
152 dev_priv->saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2); 152 dev_priv->regfile.saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2);
153 } else if (val == 0) { 153 } else if (val == 0) {
154 I915_WRITE(BLC_PWM_CTL, 154 I915_WRITE(BLC_PWM_CTL,
155 dev_priv->saveBLC_PWM_CTL); 155 dev_priv->regfile.saveBLC_PWM_CTL);
156 I915_WRITE(BLC_PWM_CTL2, 156 I915_WRITE(BLC_PWM_CTL2,
157 dev_priv->saveBLC_PWM_CTL2); 157 dev_priv->regfile.saveBLC_PWM_CTL2);
158 val = dev_priv->saveBLC_PWM_CTL; 158 val = dev_priv->regfile.saveBLC_PWM_CTL;
159 } 159 }
160 } 160 }
161 161
@@ -416,21 +416,14 @@ static const struct backlight_ops intel_panel_bl_ops = {
416 .get_brightness = intel_panel_get_brightness, 416 .get_brightness = intel_panel_get_brightness,
417}; 417};
418 418
419int intel_panel_setup_backlight(struct drm_device *dev) 419int intel_panel_setup_backlight(struct drm_connector *connector)
420{ 420{
421 struct drm_device *dev = connector->dev;
421 struct drm_i915_private *dev_priv = dev->dev_private; 422 struct drm_i915_private *dev_priv = dev->dev_private;
422 struct backlight_properties props; 423 struct backlight_properties props;
423 struct drm_connector *connector;
424 424
425 intel_panel_init_backlight(dev); 425 intel_panel_init_backlight(dev);
426 426
427 if (dev_priv->int_lvds_connector)
428 connector = dev_priv->int_lvds_connector;
429 else if (dev_priv->int_edp_connector)
430 connector = dev_priv->int_edp_connector;
431 else
432 return -ENODEV;
433
434 memset(&props, 0, sizeof(props)); 427 memset(&props, 0, sizeof(props));
435 props.type = BACKLIGHT_RAW; 428 props.type = BACKLIGHT_RAW;
436 props.max_brightness = _intel_panel_get_max_backlight(dev); 429 props.max_brightness = _intel_panel_get_max_backlight(dev);
@@ -460,9 +453,9 @@ void intel_panel_destroy_backlight(struct drm_device *dev)
460 backlight_device_unregister(dev_priv->backlight); 453 backlight_device_unregister(dev_priv->backlight);
461} 454}
462#else 455#else
463int intel_panel_setup_backlight(struct drm_device *dev) 456int intel_panel_setup_backlight(struct drm_connector *connector)
464{ 457{
465 intel_panel_init_backlight(dev); 458 intel_panel_init_backlight(connector->dev);
466 return 0; 459 return 0;
467} 460}
468 461
@@ -471,3 +464,20 @@ void intel_panel_destroy_backlight(struct drm_device *dev)
471 return; 464 return;
472} 465}
473#endif 466#endif
467
468int intel_panel_init(struct intel_panel *panel,
469 struct drm_display_mode *fixed_mode)
470{
471 panel->fixed_mode = fixed_mode;
472
473 return 0;
474}
475
476void intel_panel_fini(struct intel_panel *panel)
477{
478 struct intel_connector *intel_connector =
479 container_of(panel, struct intel_connector, panel);
480
481 if (panel->fixed_mode)
482 drm_mode_destroy(intel_connector->base.dev, panel->fixed_mode);
483}