Skip to content

Commit b50a170

Browse files
committed
Merge tag 'drm-intel-fixes-2015-11-30' of git://anongit.freedesktop.org/drm-intel into drm-fixes
few i915 fixes. * tag 'drm-intel-fixes-2015-11-30' of git://anongit.freedesktop.org/drm-intel: drm/i915: Don't override output type for DDI HDMI drm/i915: Don't compare has_drrs strictly in pipe config drm/i915: Mark uneven memory banks on gen4 desktop as unknown swizzling
2 parents 31ade3b + 2540058 commit b50a170

3 files changed

Lines changed: 29 additions & 11 deletions

File tree

drivers/gpu/drm/i915/i915_gem_fence.c

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -642,11 +642,10 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
642642
}
643643

644644
/* check for L-shaped memory aka modified enhanced addressing */
645-
if (IS_GEN4(dev)) {
646-
uint32_t ddc2 = I915_READ(DCC2);
647-
648-
if (!(ddc2 & DCC2_MODIFIED_ENHANCED_DISABLE))
649-
dev_priv->quirks |= QUIRK_PIN_SWIZZLED_PAGES;
645+
if (IS_GEN4(dev) &&
646+
!(I915_READ(DCC2) & DCC2_MODIFIED_ENHANCED_DISABLE)) {
647+
swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN;
648+
swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
650649
}
651650

652651
if (dcc == 0xffffffff) {
@@ -675,16 +674,35 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
675674
* matching, which was the case for the swizzling required in
676675
* the table above, or from the 1-ch value being less than
677676
* the minimum size of a rank.
677+
*
678+
* Reports indicate that the swizzling actually
679+
* varies depending upon page placement inside the
680+
* channels, i.e. we see swizzled pages where the
681+
* banks of memory are paired and unswizzled on the
682+
* uneven portion, so leave that as unknown.
678683
*/
679-
if (I915_READ16(C0DRB3) != I915_READ16(C1DRB3)) {
680-
swizzle_x = I915_BIT_6_SWIZZLE_NONE;
681-
swizzle_y = I915_BIT_6_SWIZZLE_NONE;
682-
} else {
684+
if (I915_READ16(C0DRB3) == I915_READ16(C1DRB3)) {
683685
swizzle_x = I915_BIT_6_SWIZZLE_9_10;
684686
swizzle_y = I915_BIT_6_SWIZZLE_9;
685687
}
686688
}
687689

690+
if (swizzle_x == I915_BIT_6_SWIZZLE_UNKNOWN ||
691+
swizzle_y == I915_BIT_6_SWIZZLE_UNKNOWN) {
692+
/* Userspace likes to explode if it sees unknown swizzling,
693+
* so lie. We will finish the lie when reporting through
694+
* the get-tiling-ioctl by reporting the physical swizzle
695+
* mode as unknown instead.
696+
*
697+
* As we don't strictly know what the swizzling is, it may be
698+
* bit17 dependent, and so we need to also prevent the pages
699+
* from being moved.
700+
*/
701+
dev_priv->quirks |= QUIRK_PIN_SWIZZLED_PAGES;
702+
swizzle_x = I915_BIT_6_SWIZZLE_NONE;
703+
swizzle_y = I915_BIT_6_SWIZZLE_NONE;
704+
}
705+
688706
dev_priv->mm.bit_6_swizzle_x = swizzle_x;
689707
dev_priv->mm.bit_6_swizzle_y = swizzle_y;
690708
}

drivers/gpu/drm/i915/intel_display.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12460,7 +12460,6 @@ intel_pipe_config_compare(struct drm_device *dev,
1246012460
if (INTEL_INFO(dev)->gen < 8) {
1246112461
PIPE_CONF_CHECK_M_N(dp_m_n);
1246212462

12463-
PIPE_CONF_CHECK_I(has_drrs);
1246412463
if (current_config->has_drrs)
1246512464
PIPE_CONF_CHECK_M_N(dp_m2_n2);
1246612465
} else

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5153,7 +5153,8 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
51535153
enum intel_display_power_domain power_domain;
51545154
enum irqreturn ret = IRQ_NONE;
51555155

5156-
if (intel_dig_port->base.type != INTEL_OUTPUT_EDP)
5156+
if (intel_dig_port->base.type != INTEL_OUTPUT_EDP &&
5157+
intel_dig_port->base.type != INTEL_OUTPUT_HDMI)
51575158
intel_dig_port->base.type = INTEL_OUTPUT_DISPLAYPORT;
51585159

51595160
if (long_hpd && intel_dig_port->base.type == INTEL_OUTPUT_EDP) {

0 commit comments

Comments
 (0)