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 1954 #define IS_ULT(dev) (IS_HSW_ULT(dev) || IS_BDW_ULT(dev)) 1955 1955 #define IS_HSW_GT3(dev) (IS_HASWELL(dev) && \ 1956 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 1960 #define IS_PRELIMINARY_HW(intel_info) ((intel_info)->is_preliminary) 1958 1961 1959 1962 /*
+25 -7
drivers/gpu/drm/i915/i915_gem_gtt.c
··· 34 34 35 35 bool 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 38 return false; 39 39 40 40 if (i915.enable_ppgtt == 1 && full) 41 41 return false; 42 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 + 43 57 #ifdef CONFIG_INTEL_IOMMU 44 58 /* Disable ppgtt on SNB if VT-d is on. */ 45 59 if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped) { 46 60 DRM_INFO("Disabling PPGTT because VT-d is on\n"); 47 - return false; 61 + return 0; 48 62 } 49 63 #endif 50 64 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); 65 + return HAS_ALIASING_PPGTT(dev) ? 1 : 0; 56 66 } 57 67 58 68 #define GEN6_PPGTT_PD_ENTRIES 512 ··· 2041 2031 gtt->base.total >> 20); 2042 2032 DRM_DEBUG_DRIVER("GMADR size = %ldM\n", gtt->mappable_end >> 20); 2043 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); 2044 2042 2045 2043 return 0; 2046 2044 }
+14 -12
drivers/gpu/drm/i915/intel_display.c
··· 11395 11395 } 11396 11396 } 11397 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 11398 static void intel_enable_pipe_a(struct drm_device *dev) 11408 11399 { 11409 11400 struct intel_connector *connector; ··· 11476 11485 if (connector->encoder->base.crtc != &crtc->base) 11477 11486 continue; 11478 11487 11479 - intel_connector_break_all_links(connector); 11488 + connector->base.dpms = DRM_MODE_DPMS_OFF; 11489 + connector->base.encoder = NULL; 11480 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 + } 11481 11499 11482 11500 WARN_ON(crtc->active); 11483 11501 crtc->base.enabled = false; ··· 11568 11568 drm_get_encoder_name(&encoder->base)); 11569 11569 encoder->disable(encoder); 11570 11570 } 11571 + encoder->base.crtc = NULL; 11572 + encoder->connectors_active = false; 11571 11573 11572 11574 /* Inconsistent output/port/pipe state happens presumably due to 11573 11575 * a bug in one of the get_hw_state functions. Or someplace else ··· 11580 11578 base.head) { 11581 11579 if (connector->encoder != encoder) 11582 11580 continue; 11583 - 11584 - intel_connector_break_all_links(connector); 11581 + connector->base.dpms = DRM_MODE_DPMS_OFF; 11582 + connector->base.encoder = NULL; 11585 11583 } 11586 11584 } 11587 11585 /* Enabled encoders without active connectors will be fixed in
+2 -1
drivers/gpu/drm/i915/intel_dp.c
··· 105 105 case DP_LINK_BW_2_7: 106 106 break; 107 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 110 intel_dp->dpcd[DP_DPCD_REV] >= 0x12) 110 111 max_link_bw = DP_LINK_BW_5_4; 111 112 else
+2 -2
include/drm/i915_pciids.h
··· 191 191 INTEL_VGA_DEVICE(0x0A06, info), /* ULT GT1 mobile */ \ 192 192 INTEL_VGA_DEVICE(0x0A16, info), /* ULT GT2 mobile */ \ 193 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 */ \ 194 + INTEL_VGA_DEVICE(0x0A0E, info), /* ULX GT1 mobile */ \ 195 + INTEL_VGA_DEVICE(0x0A1E, info), /* ULX GT2 mobile */ \ 196 196 INTEL_VGA_DEVICE(0x0A2E, info), /* ULT GT3 reserved */ \ 197 197 INTEL_VGA_DEVICE(0x0D06, info), /* CRW GT1 mobile */ \ 198 198 INTEL_VGA_DEVICE(0x0D16, info), /* CRW GT2 mobile */ \