Merge tag 'topc/core-stuff-2014-05-05' of git://anongit.freedesktop.org/drm-intel into drm-fixes

Some more i915 fixes. There's still some DP issues we are looking into,
but wanted to get these moving.

* tag 'topc/core-stuff-2014-05-05' of git://anongit.freedesktop.org/drm-intel:
drm/i915: don't try DP_LINK_BW_5_4 on HSW ULX
drm/i915: Sanitize the enable_ppgtt module option once
drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc()

+46 -22
+3
drivers/gpu/drm/i915/i915_drv.h
··· 1954 #define IS_ULT(dev) (IS_HSW_ULT(dev) || IS_BDW_ULT(dev)) 1955 #define IS_HSW_GT3(dev) (IS_HASWELL(dev) && \ 1956 ((dev)->pdev->device & 0x00F0) == 0x0020) 1957 #define IS_PRELIMINARY_HW(intel_info) ((intel_info)->is_preliminary) 1958 1959 /*
··· 1954 #define IS_ULT(dev) (IS_HSW_ULT(dev) || IS_BDW_ULT(dev)) 1955 #define IS_HSW_GT3(dev) (IS_HASWELL(dev) && \ 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) 1960 #define IS_PRELIMINARY_HW(intel_info) ((intel_info)->is_preliminary) 1961 1962 /*
+25 -7
drivers/gpu/drm/i915/i915_gem_gtt.c
··· 34 35 bool intel_enable_ppgtt(struct drm_device *dev, bool full) 36 { 37 - if (i915.enable_ppgtt == 0 || !HAS_ALIASING_PPGTT(dev)) 38 return false; 39 40 if (i915.enable_ppgtt == 1 && full) 41 return false; 42 43 #ifdef CONFIG_INTEL_IOMMU 44 /* Disable ppgtt on SNB if VT-d is on. */ 45 if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped) { 46 DRM_INFO("Disabling PPGTT because VT-d is on\n"); 47 - return false; 48 } 49 #endif 50 51 - /* Full ppgtt disabled by default for now due to issues. */ 52 - if (full) 53 - return HAS_PPGTT(dev) && (i915.enable_ppgtt == 2); 54 - else 55 - return HAS_ALIASING_PPGTT(dev); 56 } 57 58 #define GEN6_PPGTT_PD_ENTRIES 512 ··· 2041 gtt->base.total >> 20); 2042 DRM_DEBUG_DRIVER("GMADR size = %ldM\n", gtt->mappable_end >> 20); 2043 DRM_DEBUG_DRIVER("GTT stolen size = %zdM\n", gtt->stolen_size >> 20); 2044 2045 return 0; 2046 }
··· 34 35 bool intel_enable_ppgtt(struct drm_device *dev, bool full) 36 { 37 + if (i915.enable_ppgtt == 0) 38 return false; 39 40 if (i915.enable_ppgtt == 1 && full) 41 return false; 42 43 + return true; 44 + } 45 + 46 + static 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 + 57 #ifdef CONFIG_INTEL_IOMMU 58 /* Disable ppgtt on SNB if VT-d is on. */ 59 if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped) { 60 DRM_INFO("Disabling PPGTT because VT-d is on\n"); 61 + return 0; 62 } 63 #endif 64 65 + return HAS_ALIASING_PPGTT(dev) ? 1 : 0; 66 } 67 68 #define GEN6_PPGTT_PD_ENTRIES 512 ··· 2031 gtt->base.total >> 20); 2032 DRM_DEBUG_DRIVER("GMADR size = %ldM\n", gtt->mappable_end >> 20); 2033 DRM_DEBUG_DRIVER("GTT stolen size = %zdM\n", gtt->stolen_size >> 20); 2034 + /* 2035 + * i915.enable_ppgtt is read-only, so do an early pass to validate the 2036 + * user's requested state against the hardware/driver capabilities. We 2037 + * do this now so that we can print out any log messages once rather 2038 + * than every time we check intel_enable_ppgtt(). 2039 + */ 2040 + i915.enable_ppgtt = sanitize_enable_ppgtt(dev, i915.enable_ppgtt); 2041 + DRM_DEBUG_DRIVER("ppgtt mode: %i\n", i915.enable_ppgtt); 2042 2043 return 0; 2044 }
+14 -12
drivers/gpu/drm/i915/intel_display.c
··· 11395 } 11396 } 11397 11398 - static void 11399 - intel_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 - 11407 static void intel_enable_pipe_a(struct drm_device *dev) 11408 { 11409 struct intel_connector *connector; ··· 11476 if (connector->encoder->base.crtc != &crtc->base) 11477 continue; 11478 11479 - intel_connector_break_all_links(connector); 11480 } 11481 11482 WARN_ON(crtc->active); 11483 crtc->base.enabled = false; ··· 11568 drm_get_encoder_name(&encoder->base)); 11569 encoder->disable(encoder); 11570 } 11571 11572 /* Inconsistent output/port/pipe state happens presumably due to 11573 * a bug in one of the get_hw_state functions. Or someplace else ··· 11580 base.head) { 11581 if (connector->encoder != encoder) 11582 continue; 11583 - 11584 - intel_connector_break_all_links(connector); 11585 } 11586 } 11587 /* Enabled encoders without active connectors will be fixed in
··· 11395 } 11396 } 11397 11398 static void intel_enable_pipe_a(struct drm_device *dev) 11399 { 11400 struct intel_connector *connector; ··· 11485 if (connector->encoder->base.crtc != &crtc->base) 11486 continue; 11487 11488 + connector->base.dpms = DRM_MODE_DPMS_OFF; 11489 + connector->base.encoder = NULL; 11490 } 11491 + /* multiple connectors may have the same encoder: 11492 + * handle them and break crtc link separately */ 11493 + list_for_each_entry(connector, &dev->mode_config.connector_list, 11494 + base.head) 11495 + if (connector->encoder->base.crtc == &crtc->base) { 11496 + connector->encoder->base.crtc = NULL; 11497 + connector->encoder->connectors_active = false; 11498 + } 11499 11500 WARN_ON(crtc->active); 11501 crtc->base.enabled = false; ··· 11568 drm_get_encoder_name(&encoder->base)); 11569 encoder->disable(encoder); 11570 } 11571 + encoder->base.crtc = NULL; 11572 + encoder->connectors_active = false; 11573 11574 /* Inconsistent output/port/pipe state happens presumably due to 11575 * a bug in one of the get_hw_state functions. Or someplace else ··· 11578 base.head) { 11579 if (connector->encoder != encoder) 11580 continue; 11581 + connector->base.dpms = DRM_MODE_DPMS_OFF; 11582 + connector->base.encoder = NULL; 11583 } 11584 } 11585 /* Enabled encoders without active connectors will be fixed in
+2 -1
drivers/gpu/drm/i915/intel_dp.c
··· 105 case DP_LINK_BW_2_7: 106 break; 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) && 109 intel_dp->dpcd[DP_DPCD_REV] >= 0x12) 110 max_link_bw = DP_LINK_BW_5_4; 111 else
··· 105 case DP_LINK_BW_2_7: 106 break; 107 case DP_LINK_BW_5_4: /* 1.2 capable displays may advertise higher bw */ 108 + if (((IS_HASWELL(dev) && !IS_HSW_ULX(dev)) || 109 + INTEL_INFO(dev)->gen >= 8) && 110 intel_dp->dpcd[DP_DPCD_REV] >= 0x12) 111 max_link_bw = DP_LINK_BW_5_4; 112 else
+2 -2
include/drm/i915_pciids.h
··· 191 INTEL_VGA_DEVICE(0x0A06, info), /* ULT GT1 mobile */ \ 192 INTEL_VGA_DEVICE(0x0A16, info), /* ULT GT2 mobile */ \ 193 INTEL_VGA_DEVICE(0x0A26, info), /* ULT GT3 mobile */ \ 194 - INTEL_VGA_DEVICE(0x0A0E, info), /* ULT GT1 reserved */ \ 195 - INTEL_VGA_DEVICE(0x0A1E, info), /* ULT GT2 reserved */ \ 196 INTEL_VGA_DEVICE(0x0A2E, info), /* ULT GT3 reserved */ \ 197 INTEL_VGA_DEVICE(0x0D06, info), /* CRW GT1 mobile */ \ 198 INTEL_VGA_DEVICE(0x0D16, info), /* CRW GT2 mobile */ \
··· 191 INTEL_VGA_DEVICE(0x0A06, info), /* ULT GT1 mobile */ \ 192 INTEL_VGA_DEVICE(0x0A16, info), /* ULT GT2 mobile */ \ 193 INTEL_VGA_DEVICE(0x0A26, info), /* ULT GT3 mobile */ \ 194 + INTEL_VGA_DEVICE(0x0A0E, info), /* ULX GT1 mobile */ \ 195 + INTEL_VGA_DEVICE(0x0A1E, info), /* ULX GT2 mobile */ \ 196 INTEL_VGA_DEVICE(0x0A2E, info), /* ULT GT3 reserved */ \ 197 INTEL_VGA_DEVICE(0x0D06, info), /* CRW GT1 mobile */ \ 198 INTEL_VGA_DEVICE(0x0D16, info), /* CRW GT2 mobile */ \