aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-06-06 05:07:09 -0400
committerDave Airlie <airlied@redhat.com>2014-06-06 05:07:09 -0400
commitecb889e6205171ecbf80b15d903549aa6b15d23b (patch)
tree64380a55d07a0e4c6dae660fa918e2f78e797949 /drivers/gpu/drm/i915/intel_display.c
parentc7560f1281640b1232d1c3cb242aabf5bd83a857 (diff)
parent15d24aa5602fb87c7b1358cfabcfeb9b26db290f (diff)
Merge tag 'drm-intel-fixes-2014-06-06' of git://anongit.freedesktop.org/drm-intel into drm-next
> Bunch of stuff for 3.16 still: > - Mipi dsi panel support for byt. Finally! From Shobhit&others. I've > squeezed this in since it's a regression compared to vbios and we've > been ridiculed about it a bit too often ... > - connection_mutex deadlock fix in get_connector (only affects i915). > - Core patches from Matt's primary plane from Matt Roper, I've pushed the > i915 stuff to 3.17. > - vlv power well sequencing fixes from Jesse. > - Fix for cursor size changes from Chris. > - agpbusy fixes from Ville. > - A few smaller things. > * tag 'drm-intel-fixes-2014-06-06' of git://anongit.freedesktop.org/drm-intel: (32 commits) drm/i915: BDW: Adding missing cursor offsets. drm: Fix getconnector connection_mutex locking drm/i915/bdw: Only use 2g GGTT for 32b platforms drm/i915: Nuke pipe A quirk on i830M drm/i915: fix display power sw state reporting drm/i915: Always apply cursor width changes drm/i915: tell the user if both KMS and UMS are disabled drm/plane-helper: Add drm_plane_helper_check_update() (v3) drm: Check CRTC compatibility in setplane drm/i915: use VBT to determine whether to enumerate the VGA port drm/i915: Don't WARN about ring idle bit on gen2 drm/i915: Silence the WARN if the user tries to GTT mmap an incoherent object drm/i915: Move the C3 LP write bit setup to gen3_init_clock_gating() for KMS drm/i915: Enable interrupt-based AGPBUSY# enable on 85x drm/i915: Flip the sense of AGPBUSY_DIS bit drm/i915: Set AGPBUSY# bit in init_clock_gating drm/i915/vlv: add pll assertion when disabling DPIO common well drm/i915/vlv: move DPIO common reset de-assert into __vlv_set_power_well drm/i915/vlv: re-order power wells so DPIO common comes after TX drm/i915/vlv: move CRI refclk enable into __vlv_set_power_well ...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c145
1 files changed, 67 insertions, 78 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 7a4c7c98378a..efd3cf50cb0f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1484,14 +1484,6 @@ static void intel_reset_dpio(struct drm_device *dev)
1484 if (!IS_VALLEYVIEW(dev)) 1484 if (!IS_VALLEYVIEW(dev))
1485 return; 1485 return;
1486 1486
1487 /*
1488 * Enable the CRI clock source so we can get at the display and the
1489 * reference clock for VGA hotplug / manual detection.
1490 */
1491 I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) |
1492 DPLL_REFA_CLK_ENABLE_VLV |
1493 DPLL_INTEGRATED_CRI_CLK_VLV);
1494
1495 if (IS_CHERRYVIEW(dev)) { 1487 if (IS_CHERRYVIEW(dev)) {
1496 enum dpio_phy phy; 1488 enum dpio_phy phy;
1497 u32 val; 1489 u32 val;
@@ -1516,17 +1508,23 @@ static void intel_reset_dpio(struct drm_device *dev)
1516 1508
1517 } else { 1509 } else {
1518 /* 1510 /*
1519 * From VLV2A0_DP_eDP_DPIO_driver_vbios_notes_10.docx - 1511 * If DPIO has already been reset, e.g. by BIOS, just skip all
1520 * 6. De-assert cmn_reset/side_reset. Same as VLV X0. 1512 * this.
1521 * a. GUnit 0x2110 bit[0] set to 1 (def 0)
1522 * b. The other bits such as sfr settings / modesel may all
1523 * be set to 0.
1524 *
1525 * This should only be done on init and resume from S3 with
1526 * both PLLs disabled, or we risk losing DPIO and PLL
1527 * synchronization.
1528 */ 1513 */
1529 I915_WRITE(DPIO_CTL, I915_READ(DPIO_CTL) | DPIO_CMNRST); 1514 if (I915_READ(DPIO_CTL) & DPIO_CMNRST)
1515 return;
1516
1517 /*
1518 * From VLV2A0_DP_eDP_HDMI_DPIO_driver_vbios_notes_11.docx:
1519 * Need to assert and de-assert PHY SB reset by gating the
1520 * common lane power, then un-gating it.
1521 * Simply ungating isn't enough to reset the PHY enough to get
1522 * ports and lanes running.
1523 */
1524 __vlv_set_power_well(dev_priv, PUNIT_POWER_WELL_DPIO_CMN_BC,
1525 false);
1526 __vlv_set_power_well(dev_priv, PUNIT_POWER_WELL_DPIO_CMN_BC,
1527 true);
1530 } 1528 }
1531} 1529}
1532 1530
@@ -7868,29 +7866,33 @@ static void i845_update_cursor(struct drm_crtc *crtc, u32 base)
7868 struct drm_device *dev = crtc->dev; 7866 struct drm_device *dev = crtc->dev;
7869 struct drm_i915_private *dev_priv = dev->dev_private; 7867 struct drm_i915_private *dev_priv = dev->dev_private;
7870 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 7868 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
7871 bool visible = base != 0; 7869 uint32_t cntl;
7872 u32 cntl;
7873 7870
7874 if (intel_crtc->cursor_visible == visible) 7871 if (base != intel_crtc->cursor_base) {
7875 return;
7876
7877 cntl = I915_READ(_CURACNTR);
7878 if (visible) {
7879 /* On these chipsets we can only modify the base whilst 7872 /* On these chipsets we can only modify the base whilst
7880 * the cursor is disabled. 7873 * the cursor is disabled.
7881 */ 7874 */
7875 if (intel_crtc->cursor_cntl) {
7876 I915_WRITE(_CURACNTR, 0);
7877 POSTING_READ(_CURACNTR);
7878 intel_crtc->cursor_cntl = 0;
7879 }
7880
7882 I915_WRITE(_CURABASE, base); 7881 I915_WRITE(_CURABASE, base);
7882 POSTING_READ(_CURABASE);
7883 }
7883 7884
7884 cntl &= ~(CURSOR_FORMAT_MASK); 7885 /* XXX width must be 64, stride 256 => 0x00 << 28 */
7885 /* XXX width must be 64, stride 256 => 0x00 << 28 */ 7886 cntl = 0;
7886 cntl |= CURSOR_ENABLE | 7887 if (base)
7888 cntl = (CURSOR_ENABLE |
7887 CURSOR_GAMMA_ENABLE | 7889 CURSOR_GAMMA_ENABLE |
7888 CURSOR_FORMAT_ARGB; 7890 CURSOR_FORMAT_ARGB);
7889 } else 7891 if (intel_crtc->cursor_cntl != cntl) {
7890 cntl &= ~(CURSOR_ENABLE | CURSOR_GAMMA_ENABLE); 7892 I915_WRITE(_CURACNTR, cntl);
7891 I915_WRITE(_CURACNTR, cntl); 7893 POSTING_READ(_CURACNTR);
7892 7894 intel_crtc->cursor_cntl = cntl;
7893 intel_crtc->cursor_visible = visible; 7895 }
7894} 7896}
7895 7897
7896static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base) 7898static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
@@ -7899,16 +7901,12 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
7899 struct drm_i915_private *dev_priv = dev->dev_private; 7901 struct drm_i915_private *dev_priv = dev->dev_private;
7900 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 7902 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
7901 int pipe = intel_crtc->pipe; 7903 int pipe = intel_crtc->pipe;
7902 bool visible = base != 0; 7904 uint32_t cntl;
7903
7904 if (intel_crtc->cursor_visible != visible) {
7905 int16_t width = intel_crtc->cursor_width;
7906 uint32_t cntl = I915_READ(CURCNTR(pipe));
7907 if (base) {
7908 cntl &= ~(CURSOR_MODE | MCURSOR_PIPE_SELECT);
7909 cntl |= MCURSOR_GAMMA_ENABLE;
7910 7905
7911 switch (width) { 7906 cntl = 0;
7907 if (base) {
7908 cntl = MCURSOR_GAMMA_ENABLE;
7909 switch (intel_crtc->cursor_width) {
7912 case 64: 7910 case 64:
7913 cntl |= CURSOR_MODE_64_ARGB_AX; 7911 cntl |= CURSOR_MODE_64_ARGB_AX;
7914 break; 7912 break;
@@ -7921,18 +7919,16 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
7921 default: 7919 default:
7922 WARN_ON(1); 7920 WARN_ON(1);
7923 return; 7921 return;
7924 }
7925 cntl |= pipe << 28; /* Connect to correct pipe */
7926 } else {
7927 cntl &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE);
7928 cntl |= CURSOR_MODE_DISABLE;
7929 } 7922 }
7923 cntl |= pipe << 28; /* Connect to correct pipe */
7924 }
7925 if (intel_crtc->cursor_cntl != cntl) {
7930 I915_WRITE(CURCNTR(pipe), cntl); 7926 I915_WRITE(CURCNTR(pipe), cntl);
7931 7927 POSTING_READ(CURCNTR(pipe));
7932 intel_crtc->cursor_visible = visible; 7928 intel_crtc->cursor_cntl = cntl;
7933 } 7929 }
7930
7934 /* and commit changes on next vblank */ 7931 /* and commit changes on next vblank */
7935 POSTING_READ(CURCNTR(pipe));
7936 I915_WRITE(CURBASE(pipe), base); 7932 I915_WRITE(CURBASE(pipe), base);
7937 POSTING_READ(CURBASE(pipe)); 7933 POSTING_READ(CURBASE(pipe));
7938} 7934}
@@ -7943,15 +7939,12 @@ static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
7943 struct drm_i915_private *dev_priv = dev->dev_private; 7939 struct drm_i915_private *dev_priv = dev->dev_private;
7944 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 7940 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
7945 int pipe = intel_crtc->pipe; 7941 int pipe = intel_crtc->pipe;
7946 bool visible = base != 0; 7942 uint32_t cntl;
7947 7943
7948 if (intel_crtc->cursor_visible != visible) { 7944 cntl = 0;
7949 int16_t width = intel_crtc->cursor_width; 7945 if (base) {
7950 uint32_t cntl = I915_READ(CURCNTR(pipe)); 7946 cntl = MCURSOR_GAMMA_ENABLE;
7951 if (base) { 7947 switch (intel_crtc->cursor_width) {
7952 cntl &= ~CURSOR_MODE;
7953 cntl |= MCURSOR_GAMMA_ENABLE;
7954 switch (width) {
7955 case 64: 7948 case 64:
7956 cntl |= CURSOR_MODE_64_ARGB_AX; 7949 cntl |= CURSOR_MODE_64_ARGB_AX;
7957 break; 7950 break;
@@ -7964,21 +7957,18 @@ static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
7964 default: 7957 default:
7965 WARN_ON(1); 7958 WARN_ON(1);
7966 return; 7959 return;
7967 }
7968 } else {
7969 cntl &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE);
7970 cntl |= CURSOR_MODE_DISABLE;
7971 } 7960 }
7972 if (IS_HASWELL(dev) || IS_BROADWELL(dev)) { 7961 }
7973 cntl |= CURSOR_PIPE_CSC_ENABLE; 7962 if (IS_HASWELL(dev) || IS_BROADWELL(dev))
7974 cntl &= ~CURSOR_TRICKLE_FEED_DISABLE; 7963 cntl |= CURSOR_PIPE_CSC_ENABLE;
7975 }
7976 I915_WRITE(CURCNTR(pipe), cntl);
7977 7964
7978 intel_crtc->cursor_visible = visible; 7965 if (intel_crtc->cursor_cntl != cntl) {
7966 I915_WRITE(CURCNTR(pipe), cntl);
7967 POSTING_READ(CURCNTR(pipe));
7968 intel_crtc->cursor_cntl = cntl;
7979 } 7969 }
7970
7980 /* and commit changes on next vblank */ 7971 /* and commit changes on next vblank */
7981 POSTING_READ(CURCNTR(pipe));
7982 I915_WRITE(CURBASE(pipe), base); 7972 I915_WRITE(CURBASE(pipe), base);
7983 POSTING_READ(CURBASE(pipe)); 7973 POSTING_READ(CURBASE(pipe));
7984} 7974}
@@ -7994,7 +7984,6 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
7994 int x = intel_crtc->cursor_x; 7984 int x = intel_crtc->cursor_x;
7995 int y = intel_crtc->cursor_y; 7985 int y = intel_crtc->cursor_y;
7996 u32 base = 0, pos = 0; 7986 u32 base = 0, pos = 0;
7997 bool visible;
7998 7987
7999 if (on) 7988 if (on)
8000 base = intel_crtc->cursor_addr; 7989 base = intel_crtc->cursor_addr;
@@ -8023,8 +8012,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
8023 } 8012 }
8024 pos |= y << CURSOR_Y_SHIFT; 8013 pos |= y << CURSOR_Y_SHIFT;
8025 8014
8026 visible = base != 0; 8015 if (base == 0 && intel_crtc->cursor_base == 0)
8027 if (!visible && !intel_crtc->cursor_visible)
8028 return; 8016 return;
8029 8017
8030 I915_WRITE(CURPOS(pipe), pos); 8018 I915_WRITE(CURPOS(pipe), pos);
@@ -8035,6 +8023,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
8035 i845_update_cursor(crtc, base); 8023 i845_update_cursor(crtc, base);
8036 else 8024 else
8037 i9xx_update_cursor(crtc, base); 8025 i9xx_update_cursor(crtc, base);
8026 intel_crtc->cursor_base = base;
8038} 8027}
8039 8028
8040static int intel_crtc_cursor_set(struct drm_crtc *crtc, 8029static int intel_crtc_cursor_set(struct drm_crtc *crtc,
@@ -10990,6 +10979,9 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
10990 intel_crtc->plane = !pipe; 10979 intel_crtc->plane = !pipe;
10991 } 10980 }
10992 10981
10982 intel_crtc->cursor_base = ~0;
10983 intel_crtc->cursor_cntl = ~0;
10984
10993 init_waitqueue_head(&intel_crtc->vbl_wait); 10985 init_waitqueue_head(&intel_crtc->vbl_wait);
10994 10986
10995 BUG_ON(pipe >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) || 10987 BUG_ON(pipe >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
@@ -11103,7 +11095,7 @@ static void intel_setup_outputs(struct drm_device *dev)
11103 11095
11104 intel_lvds_init(dev); 11096 intel_lvds_init(dev);
11105 11097
11106 if (!IS_ULT(dev) && !IS_CHERRYVIEW(dev)) 11098 if (!IS_ULT(dev) && !IS_CHERRYVIEW(dev) && dev_priv->vbt.int_crt_support)
11107 intel_crt_init(dev); 11099 intel_crt_init(dev);
11108 11100
11109 if (HAS_DDI(dev)) { 11101 if (HAS_DDI(dev)) {
@@ -11618,9 +11610,6 @@ static struct intel_quirk intel_quirks[] = {
11618 /* ThinkPad T60 needs pipe A force quirk (bug #16494) */ 11610 /* ThinkPad T60 needs pipe A force quirk (bug #16494) */
11619 { 0x2782, 0x17aa, 0x201a, quirk_pipea_force }, 11611 { 0x2782, 0x17aa, 0x201a, quirk_pipea_force },
11620 11612
11621 /* 830 needs to leave pipe A & dpll A up */
11622 { 0x3577, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },
11623
11624 /* Lenovo U160 cannot use SSC on LVDS */ 11613 /* Lenovo U160 cannot use SSC on LVDS */
11625 { 0x0046, 0x17aa, 0x3920, quirk_ssc_force_disable }, 11614 { 0x0046, 0x17aa, 0x3920, quirk_ssc_force_disable },
11626 11615