aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h3
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c32
-rw-r--r--drivers/gpu/drm/i915/intel_display.c26
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c3
-rw-r--r--include/drm/i915_pciids.h4
5 files changed, 46 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ec82f6bff122..108e1ec2fa4b 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1954,6 +1954,9 @@ struct drm_i915_cmd_table {
1954#define IS_ULT(dev) (IS_HSW_ULT(dev) || IS_BDW_ULT(dev)) 1954#define IS_ULT(dev) (IS_HSW_ULT(dev) || IS_BDW_ULT(dev))
1955#define IS_HSW_GT3(dev) (IS_HASWELL(dev) && \ 1955#define IS_HSW_GT3(dev) (IS_HASWELL(dev) && \
1956 ((dev)->pdev->device & 0x00F0) == 0x0020) 1956 ((dev)->pdev->device & 0x00F0) == 0x0020)
1957/* ULX machines are also considered ULT. */
1958#define IS_HSW_ULX(dev) ((dev)->pdev->device == 0x0A0E || \
1959 (dev)->pdev->device == 0x0A1E)
1957#define IS_PRELIMINARY_HW(intel_info) ((intel_info)->is_preliminary) 1960#define IS_PRELIMINARY_HW(intel_info) ((intel_info)->is_preliminary)
1958 1961
1959/* 1962/*
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 62a5c3627b90..154b0f8bb88d 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -34,25 +34,35 @@ static void gen8_setup_private_ppat(struct drm_i915_private *dev_priv);
34 34
35bool intel_enable_ppgtt(struct drm_device *dev, bool full) 35bool intel_enable_ppgtt(struct drm_device *dev, bool full)
36{ 36{
37 if (i915.enable_ppgtt == 0 || !HAS_ALIASING_PPGTT(dev)) 37 if (i915.enable_ppgtt == 0)
38 return false; 38 return false;
39 39
40 if (i915.enable_ppgtt == 1 && full) 40 if (i915.enable_ppgtt == 1 && full)
41 return false; 41 return false;
42 42
43 return true;
44}
45
46static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
47{
48 if (enable_ppgtt == 0 || !HAS_ALIASING_PPGTT(dev))
49 return 0;
50
51 if (enable_ppgtt == 1)
52 return 1;
53
54 if (enable_ppgtt == 2 && HAS_PPGTT(dev))
55 return 2;
56
43#ifdef CONFIG_INTEL_IOMMU 57#ifdef CONFIG_INTEL_IOMMU
44 /* Disable ppgtt on SNB if VT-d is on. */ 58 /* Disable ppgtt on SNB if VT-d is on. */
45 if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped) { 59 if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped) {
46 DRM_INFO("Disabling PPGTT because VT-d is on\n"); 60 DRM_INFO("Disabling PPGTT because VT-d is on\n");
47 return false; 61 return 0;
48 } 62 }
49#endif 63#endif
50 64
51 /* Full ppgtt disabled by default for now due to issues. */ 65 return HAS_ALIASING_PPGTT(dev) ? 1 : 0;
52 if (full)
53 return HAS_PPGTT(dev) && (i915.enable_ppgtt == 2);
54 else
55 return HAS_ALIASING_PPGTT(dev);
56} 66}
57 67
58#define GEN6_PPGTT_PD_ENTRIES 512 68#define GEN6_PPGTT_PD_ENTRIES 512
@@ -2031,6 +2041,14 @@ int i915_gem_gtt_init(struct drm_device *dev)
2031 gtt->base.total >> 20); 2041 gtt->base.total >> 20);
2032 DRM_DEBUG_DRIVER("GMADR size = %ldM\n", gtt->mappable_end >> 20); 2042 DRM_DEBUG_DRIVER("GMADR size = %ldM\n", gtt->mappable_end >> 20);
2033 DRM_DEBUG_DRIVER("GTT stolen size = %zdM\n", gtt->stolen_size >> 20); 2043 DRM_DEBUG_DRIVER("GTT stolen size = %zdM\n", gtt->stolen_size >> 20);
2044 /*
2045 * i915.enable_ppgtt is read-only, so do an early pass to validate the
2046 * user's requested state against the hardware/driver capabilities. We
2047 * do this now so that we can print out any log messages once rather
2048 * than every time we check intel_enable_ppgtt().
2049 */
2050 i915.enable_ppgtt = sanitize_enable_ppgtt(dev, i915.enable_ppgtt);
2051 DRM_DEBUG_DRIVER("ppgtt mode: %i\n", i915.enable_ppgtt);
2034 2052
2035 return 0; 2053 return 0;
2036} 2054}
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 69bcc42a0e44..48aa516a1ac0 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11395,15 +11395,6 @@ void intel_modeset_init(struct drm_device *dev)
11395 } 11395 }
11396} 11396}
11397 11397
11398static void
11399intel_connector_break_all_links(struct intel_connector *connector)
11400{
11401 connector->base.dpms = DRM_MODE_DPMS_OFF;
11402 connector->base.encoder = NULL;
11403 connector->encoder->connectors_active = false;
11404 connector->encoder->base.crtc = NULL;
11405}
11406
11407static void intel_enable_pipe_a(struct drm_device *dev) 11398static void intel_enable_pipe_a(struct drm_device *dev)
11408{ 11399{
11409 struct intel_connector *connector; 11400 struct intel_connector *connector;
@@ -11485,8 +11476,17 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
11485 if (connector->encoder->base.crtc != &crtc->base) 11476 if (connector->encoder->base.crtc != &crtc->base)
11486 continue; 11477 continue;
11487 11478
11488 intel_connector_break_all_links(connector); 11479 connector->base.dpms = DRM_MODE_DPMS_OFF;
11480 connector->base.encoder = NULL;
11489 } 11481 }
11482 /* multiple connectors may have the same encoder:
11483 * handle them and break crtc link separately */
11484 list_for_each_entry(connector, &dev->mode_config.connector_list,
11485 base.head)
11486 if (connector->encoder->base.crtc == &crtc->base) {
11487 connector->encoder->base.crtc = NULL;
11488 connector->encoder->connectors_active = false;
11489 }
11490 11490
11491 WARN_ON(crtc->active); 11491 WARN_ON(crtc->active);
11492 crtc->base.enabled = false; 11492 crtc->base.enabled = false;
@@ -11568,6 +11568,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
11568 drm_get_encoder_name(&encoder->base)); 11568 drm_get_encoder_name(&encoder->base));
11569 encoder->disable(encoder); 11569 encoder->disable(encoder);
11570 } 11570 }
11571 encoder->base.crtc = NULL;
11572 encoder->connectors_active = false;
11571 11573
11572 /* Inconsistent output/port/pipe state happens presumably due to 11574 /* Inconsistent output/port/pipe state happens presumably due to
11573 * a bug in one of the get_hw_state functions. Or someplace else 11575 * a bug in one of the get_hw_state functions. Or someplace else
@@ -11578,8 +11580,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
11578 base.head) { 11580 base.head) {
11579 if (connector->encoder != encoder) 11581 if (connector->encoder != encoder)
11580 continue; 11582 continue;
11581 11583 connector->base.dpms = DRM_MODE_DPMS_OFF;
11582 intel_connector_break_all_links(connector); 11584 connector->base.encoder = NULL;
11583 } 11585 }
11584 } 11586 }
11585 /* Enabled encoders without active connectors will be fixed in 11587 /* Enabled encoders without active connectors will be fixed in
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index dfa85289f28f..5ca68aa9f237 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -105,7 +105,8 @@ intel_dp_max_link_bw(struct intel_dp *intel_dp)
105 case DP_LINK_BW_2_7: 105 case DP_LINK_BW_2_7:
106 break; 106 break;
107 case DP_LINK_BW_5_4: /* 1.2 capable displays may advertise higher bw */ 107 case DP_LINK_BW_5_4: /* 1.2 capable displays may advertise higher bw */
108 if ((IS_HASWELL(dev) || INTEL_INFO(dev)->gen >= 8) && 108 if (((IS_HASWELL(dev) && !IS_HSW_ULX(dev)) ||
109 INTEL_INFO(dev)->gen >= 8) &&
109 intel_dp->dpcd[DP_DPCD_REV] >= 0x12) 110 intel_dp->dpcd[DP_DPCD_REV] >= 0x12)
110 max_link_bw = DP_LINK_BW_5_4; 111 max_link_bw = DP_LINK_BW_5_4;
111 else 112 else
diff --git a/include/drm/i915_pciids.h b/include/drm/i915_pciids.h
index 940ece4934ba..012d58fa8ff0 100644
--- a/include/drm/i915_pciids.h
+++ b/include/drm/i915_pciids.h
@@ -191,8 +191,8 @@
191 INTEL_VGA_DEVICE(0x0A06, info), /* ULT GT1 mobile */ \ 191 INTEL_VGA_DEVICE(0x0A06, info), /* ULT GT1 mobile */ \
192 INTEL_VGA_DEVICE(0x0A16, info), /* ULT GT2 mobile */ \ 192 INTEL_VGA_DEVICE(0x0A16, info), /* ULT GT2 mobile */ \
193 INTEL_VGA_DEVICE(0x0A26, info), /* ULT GT3 mobile */ \ 193 INTEL_VGA_DEVICE(0x0A26, info), /* ULT GT3 mobile */ \
194 INTEL_VGA_DEVICE(0x0A0E, info), /* ULT GT1 reserved */ \ 194 INTEL_VGA_DEVICE(0x0A0E, info), /* ULX GT1 mobile */ \
195 INTEL_VGA_DEVICE(0x0A1E, info), /* ULT GT2 reserved */ \ 195 INTEL_VGA_DEVICE(0x0A1E, info), /* ULX GT2 mobile */ \
196 INTEL_VGA_DEVICE(0x0A2E, info), /* ULT GT3 reserved */ \ 196 INTEL_VGA_DEVICE(0x0A2E, info), /* ULT GT3 reserved */ \
197 INTEL_VGA_DEVICE(0x0D06, info), /* CRW GT1 mobile */ \ 197 INTEL_VGA_DEVICE(0x0D06, info), /* CRW GT1 mobile */ \
198 INTEL_VGA_DEVICE(0x0D16, info), /* CRW GT2 mobile */ \ 198 INTEL_VGA_DEVICE(0x0D16, info), /* CRW GT2 mobile */ \