aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_crt.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-02 04:21:50 -0400
committerDave Airlie <airlied@redhat.com>2012-05-02 04:22:29 -0400
commit5bc69bf9aeb73547cad8e1ce683a103fe9728282 (patch)
treed3ef275532fc4391cb645f8b4d45d39d7fbb73f4 /drivers/gpu/drm/i915/intel_crt.c
parentc6543a6e64ad8e456674a1c4a01dd024e38b665f (diff)
parenta85d4bcb8a0cd5b3c754f98ff91ef2b9b3a73bc5 (diff)
Merge tag 'drm-intel-next-2012-04-23' of git://people.freedesktop.org/~danvet/drm-intel into drm-core-next
Daniel Vetter writes: A new drm-intel-next pull. Highlights: - More gmbus patches from Daniel Kurtz, I think gmbus is now ready, all known issues fixed. - Fencing cleanup and pipelined fencing removal from Chris. - rc6 residency interface from Ben, useful for powertop. - Cleanups and code reorg around the ringbuffer code (Ben&me). - Use hw semaphores in the pageflip code from Ben. - More vlv stuff from Jesse, unfortunately his vlv cpu is doa, so less merged than I've hoped for - we still have the unused function warning :( - More hsw patches from Eugeni, again, not yet enabled fully. - intel_pm.c refactoring from Eugeni. - Ironlake sprite support from Chris. - And various smaller improvements/fixes all over the place. Note that this pull request also contains a backmerge of -rc3 to sort out a few things in -next. I've also had to frob the shortlog a bit to exclude anything that -rc3 brings in with this pull. Regression wise we have a few strange bugs going on, but for all of them closer inspection revealed that they've been pre-existing, just now slightly more likely to be hit. And for most of them we have a patch already. Otherwise QA has not reported any regressions, and I'm also not aware of anything bad happening in 3.4. * tag 'drm-intel-next-2012-04-23' of git://people.freedesktop.org/~danvet/drm-intel: (420 commits) drm/i915: rc6 residency (fix the fix) drm/i915/tv: fix open-coded ARRAY_SIZE. drm/i915: invalidate render cache on gen2 drm/i915: Silence the change of LVDS sync polarity drm/i915: add generic power management initialization drm/i915: move clock gating functionality into intel_pm module drm/i915: move emon functionality into intel_pm module drm/i915: move drps, rps and rc6-related functions to intel_pm drm/i915: fix line breaks in intel_pm drm/i915: move watermarks settings into intel_pm module drm/i915: move fbc-related functionality into intel_pm module drm/i915: Refactor get_fence() to use the common fence writing routine drm/i915: Refactor fence clearing to use the common fence writing routine drm/i915: Refactor put_fence() to use the common fence writing routine drm/i915: Prepare to consolidate fence writing drm/i915: Remove the unsightly "optimisation" from flush_fence() drm/i915: Simplify fence finding drm/i915: Discard the unused obj->last_fenced_ring drm/i915: Remove unused ring->setup_seqno drm/i915: Remove fence pipelining ...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_crt.c')
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c54
1 files changed, 43 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 70b0f1abf149..0976137ab79a 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -55,18 +55,36 @@ static struct intel_crt *intel_attached_crt(struct drm_connector *connector)
55 struct intel_crt, base); 55 struct intel_crt, base);
56} 56}
57 57
58static void intel_crt_dpms(struct drm_encoder *encoder, int mode) 58static void pch_crt_dpms(struct drm_encoder *encoder, int mode)
59{ 59{
60 struct drm_device *dev = encoder->dev; 60 struct drm_device *dev = encoder->dev;
61 struct drm_i915_private *dev_priv = dev->dev_private; 61 struct drm_i915_private *dev_priv = dev->dev_private;
62 u32 temp, reg; 62 u32 temp;
63 63
64 if (HAS_PCH_SPLIT(dev)) 64 temp = I915_READ(PCH_ADPA);
65 reg = PCH_ADPA; 65 temp &= ~ADPA_DAC_ENABLE;
66 else 66
67 reg = ADPA; 67 switch (mode) {
68 case DRM_MODE_DPMS_ON:
69 temp |= ADPA_DAC_ENABLE;
70 break;
71 case DRM_MODE_DPMS_STANDBY:
72 case DRM_MODE_DPMS_SUSPEND:
73 case DRM_MODE_DPMS_OFF:
74 /* Just leave port enable cleared */
75 break;
76 }
77
78 I915_WRITE(PCH_ADPA, temp);
79}
68 80
69 temp = I915_READ(reg); 81static void gmch_crt_dpms(struct drm_encoder *encoder, int mode)
82{
83 struct drm_device *dev = encoder->dev;
84 struct drm_i915_private *dev_priv = dev->dev_private;
85 u32 temp;
86
87 temp = I915_READ(ADPA);
70 temp &= ~(ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE); 88 temp &= ~(ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE);
71 temp &= ~ADPA_DAC_ENABLE; 89 temp &= ~ADPA_DAC_ENABLE;
72 90
@@ -85,7 +103,7 @@ static void intel_crt_dpms(struct drm_encoder *encoder, int mode)
85 break; 103 break;
86 } 104 }
87 105
88 I915_WRITE(reg, temp); 106 I915_WRITE(ADPA, temp);
89} 107}
90 108
91static int intel_crt_mode_valid(struct drm_connector *connector, 109static int intel_crt_mode_valid(struct drm_connector *connector,
@@ -516,12 +534,20 @@ static void intel_crt_reset(struct drm_connector *connector)
516 * Routines for controlling stuff on the analog port 534 * Routines for controlling stuff on the analog port
517 */ 535 */
518 536
519static const struct drm_encoder_helper_funcs intel_crt_helper_funcs = { 537static const struct drm_encoder_helper_funcs pch_encoder_funcs = {
520 .dpms = intel_crt_dpms, 538 .mode_fixup = intel_crt_mode_fixup,
539 .prepare = intel_encoder_prepare,
540 .commit = intel_encoder_commit,
541 .mode_set = intel_crt_mode_set,
542 .dpms = pch_crt_dpms,
543};
544
545static const struct drm_encoder_helper_funcs gmch_encoder_funcs = {
521 .mode_fixup = intel_crt_mode_fixup, 546 .mode_fixup = intel_crt_mode_fixup,
522 .prepare = intel_encoder_prepare, 547 .prepare = intel_encoder_prepare,
523 .commit = intel_encoder_commit, 548 .commit = intel_encoder_commit,
524 .mode_set = intel_crt_mode_set, 549 .mode_set = intel_crt_mode_set,
550 .dpms = gmch_crt_dpms,
525}; 551};
526 552
527static const struct drm_connector_funcs intel_crt_connector_funcs = { 553static const struct drm_connector_funcs intel_crt_connector_funcs = {
@@ -567,6 +593,7 @@ void intel_crt_init(struct drm_device *dev)
567 struct intel_crt *crt; 593 struct intel_crt *crt;
568 struct intel_connector *intel_connector; 594 struct intel_connector *intel_connector;
569 struct drm_i915_private *dev_priv = dev->dev_private; 595 struct drm_i915_private *dev_priv = dev->dev_private;
596 const struct drm_encoder_helper_funcs *encoder_helper_funcs;
570 597
571 /* Skip machines without VGA that falsely report hotplug events */ 598 /* Skip machines without VGA that falsely report hotplug events */
572 if (dmi_check_system(intel_no_crt)) 599 if (dmi_check_system(intel_no_crt))
@@ -602,7 +629,12 @@ void intel_crt_init(struct drm_device *dev)
602 connector->interlace_allowed = 1; 629 connector->interlace_allowed = 1;
603 connector->doublescan_allowed = 0; 630 connector->doublescan_allowed = 0;
604 631
605 drm_encoder_helper_add(&crt->base.base, &intel_crt_helper_funcs); 632 if (HAS_PCH_SPLIT(dev))
633 encoder_helper_funcs = &pch_encoder_funcs;
634 else
635 encoder_helper_funcs = &gmch_encoder_funcs;
636
637 drm_encoder_helper_add(&crt->base.base, encoder_helper_funcs);
606 drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); 638 drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
607 639
608 drm_sysfs_connector_add(connector); 640 drm_sysfs_connector_add(connector);