提交 0ffe37de 编写于 作者: L Linus Torvalds

Merge branch 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel

* 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel:
  drm/i915: Hold a reference to the object whilst unbinding the eviction list
  drm/i915,agp/intel: Add second set of PCI-IDs for B43
  drm/i915: Fix Sandybridge fence registers
  drm/i915/crt: Downgrade warnings for hotplug failures
  drm/i915: Ensure that the crtcinfo is populated during mode_fixup()
...@@ -806,6 +806,8 @@ static const struct intel_driver_description { ...@@ -806,6 +806,8 @@ static const struct intel_driver_description {
"G45/G43", NULL, &intel_i965_driver }, "G45/G43", NULL, &intel_i965_driver },
{ PCI_DEVICE_ID_INTEL_B43_HB, PCI_DEVICE_ID_INTEL_B43_IG, { PCI_DEVICE_ID_INTEL_B43_HB, PCI_DEVICE_ID_INTEL_B43_IG,
"B43", NULL, &intel_i965_driver }, "B43", NULL, &intel_i965_driver },
{ PCI_DEVICE_ID_INTEL_B43_1_HB, PCI_DEVICE_ID_INTEL_B43_1_IG,
"B43", NULL, &intel_i965_driver },
{ PCI_DEVICE_ID_INTEL_G41_HB, PCI_DEVICE_ID_INTEL_G41_IG, { PCI_DEVICE_ID_INTEL_G41_HB, PCI_DEVICE_ID_INTEL_G41_IG,
"G41", NULL, &intel_i965_driver }, "G41", NULL, &intel_i965_driver },
{ PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG, { PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG,
......
...@@ -186,6 +186,8 @@ ...@@ -186,6 +186,8 @@
#define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2 #define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2
#define PCI_DEVICE_ID_INTEL_B43_HB 0x2E40 #define PCI_DEVICE_ID_INTEL_B43_HB 0x2E40
#define PCI_DEVICE_ID_INTEL_B43_IG 0x2E42 #define PCI_DEVICE_ID_INTEL_B43_IG 0x2E42
#define PCI_DEVICE_ID_INTEL_B43_1_HB 0x2E90
#define PCI_DEVICE_ID_INTEL_B43_1_IG 0x2E92
#define PCI_DEVICE_ID_INTEL_GM45_HB 0x2A40 #define PCI_DEVICE_ID_INTEL_GM45_HB 0x2A40
#define PCI_DEVICE_ID_INTEL_GM45_IG 0x2A42 #define PCI_DEVICE_ID_INTEL_GM45_IG 0x2A42
#define PCI_DEVICE_ID_INTEL_EAGLELAKE_HB 0x2E00 #define PCI_DEVICE_ID_INTEL_EAGLELAKE_HB 0x2E00
......
...@@ -170,6 +170,7 @@ static const struct pci_device_id pciidlist[] = { /* aka */ ...@@ -170,6 +170,7 @@ static const struct pci_device_id pciidlist[] = { /* aka */
INTEL_VGA_DEVICE(0x2e22, &intel_g45_info), /* G45_G */ INTEL_VGA_DEVICE(0x2e22, &intel_g45_info), /* G45_G */
INTEL_VGA_DEVICE(0x2e32, &intel_g45_info), /* G41_G */ INTEL_VGA_DEVICE(0x2e32, &intel_g45_info), /* G41_G */
INTEL_VGA_DEVICE(0x2e42, &intel_g45_info), /* B43_G */ INTEL_VGA_DEVICE(0x2e42, &intel_g45_info), /* B43_G */
INTEL_VGA_DEVICE(0x2e92, &intel_g45_info), /* B43_G.1 */
INTEL_VGA_DEVICE(0xa001, &intel_pineview_info), INTEL_VGA_DEVICE(0xa001, &intel_pineview_info),
INTEL_VGA_DEVICE(0xa011, &intel_pineview_info), INTEL_VGA_DEVICE(0xa011, &intel_pineview_info),
INTEL_VGA_DEVICE(0x0042, &intel_ironlake_d_info), INTEL_VGA_DEVICE(0x0042, &intel_ironlake_d_info),
......
...@@ -2351,14 +2351,21 @@ i915_gem_object_get_fence_reg(struct drm_gem_object *obj) ...@@ -2351,14 +2351,21 @@ i915_gem_object_get_fence_reg(struct drm_gem_object *obj)
reg->obj = obj; reg->obj = obj;
if (IS_GEN6(dev)) switch (INTEL_INFO(dev)->gen) {
case 6:
sandybridge_write_fence_reg(reg); sandybridge_write_fence_reg(reg);
else if (IS_I965G(dev)) break;
case 5:
case 4:
i965_write_fence_reg(reg); i965_write_fence_reg(reg);
else if (IS_I9XX(dev)) break;
case 3:
i915_write_fence_reg(reg); i915_write_fence_reg(reg);
else break;
case 2:
i830_write_fence_reg(reg); i830_write_fence_reg(reg);
break;
}
trace_i915_gem_object_get_fence(obj, obj_priv->fence_reg, trace_i915_gem_object_get_fence(obj, obj_priv->fence_reg,
obj_priv->tiling_mode); obj_priv->tiling_mode);
...@@ -2381,22 +2388,26 @@ i915_gem_clear_fence_reg(struct drm_gem_object *obj) ...@@ -2381,22 +2388,26 @@ i915_gem_clear_fence_reg(struct drm_gem_object *obj)
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
struct drm_i915_fence_reg *reg = struct drm_i915_fence_reg *reg =
&dev_priv->fence_regs[obj_priv->fence_reg]; &dev_priv->fence_regs[obj_priv->fence_reg];
uint32_t fence_reg;
if (IS_GEN6(dev)) { switch (INTEL_INFO(dev)->gen) {
case 6:
I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 + I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 +
(obj_priv->fence_reg * 8), 0); (obj_priv->fence_reg * 8), 0);
} else if (IS_I965G(dev)) { break;
case 5:
case 4:
I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0); I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0);
} else { break;
uint32_t fence_reg; case 3:
if (obj_priv->fence_reg > 8)
if (obj_priv->fence_reg < 8) fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - 8) * 4;
fence_reg = FENCE_REG_830_0 + obj_priv->fence_reg * 4;
else else
fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - case 2:
8) * 4; fence_reg = FENCE_REG_830_0 + obj_priv->fence_reg * 4;
I915_WRITE(fence_reg, 0); I915_WRITE(fence_reg, 0);
break;
} }
reg->obj = NULL; reg->obj = NULL;
......
...@@ -79,6 +79,7 @@ mark_free(struct drm_i915_gem_object *obj_priv, ...@@ -79,6 +79,7 @@ mark_free(struct drm_i915_gem_object *obj_priv,
struct list_head *unwind) struct list_head *unwind)
{ {
list_add(&obj_priv->evict_list, unwind); list_add(&obj_priv->evict_list, unwind);
drm_gem_object_reference(&obj_priv->base);
return drm_mm_scan_add_block(obj_priv->gtt_space); return drm_mm_scan_add_block(obj_priv->gtt_space);
} }
...@@ -165,6 +166,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen ...@@ -165,6 +166,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen
list_for_each_entry(obj_priv, &unwind_list, evict_list) { list_for_each_entry(obj_priv, &unwind_list, evict_list) {
ret = drm_mm_scan_remove_block(obj_priv->gtt_space); ret = drm_mm_scan_remove_block(obj_priv->gtt_space);
BUG_ON(ret); BUG_ON(ret);
drm_gem_object_unreference(&obj_priv->base);
} }
/* We expect the caller to unpin, evict all and try again, or give up. /* We expect the caller to unpin, evict all and try again, or give up.
...@@ -181,18 +183,21 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen ...@@ -181,18 +183,21 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen
* scanning, therefore store to be evicted objects on a * scanning, therefore store to be evicted objects on a
* temporary list. */ * temporary list. */
list_move(&obj_priv->evict_list, &eviction_list); list_move(&obj_priv->evict_list, &eviction_list);
} } else
drm_gem_object_unreference(&obj_priv->base);
} }
/* Unbinding will emit any required flushes */ /* Unbinding will emit any required flushes */
list_for_each_entry_safe(obj_priv, tmp_obj_priv, list_for_each_entry_safe(obj_priv, tmp_obj_priv,
&eviction_list, evict_list) { &eviction_list, evict_list) {
#if WATCH_LRU #if WATCH_LRU
DRM_INFO("%s: evicting %p\n", __func__, obj); DRM_INFO("%s: evicting %p\n", __func__, &obj_priv->base);
#endif #endif
ret = i915_gem_object_unbind(&obj_priv->base); ret = i915_gem_object_unbind(&obj_priv->base);
if (ret) if (ret)
return ret; return ret;
drm_gem_object_unreference(&obj_priv->base);
} }
/* The just created free hole should be on the top of the free stack /* The just created free hole should be on the top of the free stack
......
...@@ -789,16 +789,25 @@ int i915_save_state(struct drm_device *dev) ...@@ -789,16 +789,25 @@ int i915_save_state(struct drm_device *dev)
dev_priv->saveSWF2[i] = I915_READ(SWF30 + (i << 2)); dev_priv->saveSWF2[i] = I915_READ(SWF30 + (i << 2));
/* Fences */ /* Fences */
if (IS_I965G(dev)) { switch (INTEL_INFO(dev)->gen) {
case 6:
for (i = 0; i < 16; i++)
dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_SANDYBRIDGE_0 + (i * 8));
break;
case 5:
case 4:
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_965_0 + (i * 8)); dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_965_0 + (i * 8));
} else { break;
for (i = 0; i < 8; i++) case 3:
dev_priv->saveFENCE[i] = I915_READ(FENCE_REG_830_0 + (i * 4));
if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev))
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
dev_priv->saveFENCE[i+8] = I915_READ(FENCE_REG_945_8 + (i * 4)); dev_priv->saveFENCE[i+8] = I915_READ(FENCE_REG_945_8 + (i * 4));
case 2:
for (i = 0; i < 8; i++)
dev_priv->saveFENCE[i] = I915_READ(FENCE_REG_830_0 + (i * 4));
break;
} }
return 0; return 0;
...@@ -815,15 +824,24 @@ int i915_restore_state(struct drm_device *dev) ...@@ -815,15 +824,24 @@ int i915_restore_state(struct drm_device *dev)
I915_WRITE(HWS_PGA, dev_priv->saveHWS); I915_WRITE(HWS_PGA, dev_priv->saveHWS);
/* Fences */ /* Fences */
if (IS_I965G(dev)) { switch (INTEL_INFO(dev)->gen) {
case 6:
for (i = 0; i < 16; i++)
I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 + (i * 8), dev_priv->saveFENCE[i]);
break;
case 5:
case 4:
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
I915_WRITE64(FENCE_REG_965_0 + (i * 8), dev_priv->saveFENCE[i]); I915_WRITE64(FENCE_REG_965_0 + (i * 8), dev_priv->saveFENCE[i]);
} else { break;
for (i = 0; i < 8; i++) case 3:
I915_WRITE(FENCE_REG_830_0 + (i * 4), dev_priv->saveFENCE[i]); case 2:
if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev))
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
I915_WRITE(FENCE_REG_945_8 + (i * 4), dev_priv->saveFENCE[i+8]); I915_WRITE(FENCE_REG_945_8 + (i * 4), dev_priv->saveFENCE[i+8]);
for (i = 0; i < 8; i++)
I915_WRITE(FENCE_REG_830_0 + (i * 4), dev_priv->saveFENCE[i]);
break;
} }
i915_restore_display(dev); i915_restore_display(dev);
......
...@@ -188,7 +188,7 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) ...@@ -188,7 +188,7 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
if (wait_for((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0, if (wait_for((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
1000, 1)) 1000, 1))
DRM_ERROR("timed out waiting for FORCE_TRIGGER"); DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER");
if (turn_off_dac) { if (turn_off_dac) {
I915_WRITE(PCH_ADPA, temp); I915_WRITE(PCH_ADPA, temp);
...@@ -245,7 +245,7 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) ...@@ -245,7 +245,7 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector)
if (wait_for((I915_READ(PORT_HOTPLUG_EN) & if (wait_for((I915_READ(PORT_HOTPLUG_EN) &
CRT_HOTPLUG_FORCE_DETECT) == 0, CRT_HOTPLUG_FORCE_DETECT) == 0,
1000, 1)) 1000, 1))
DRM_ERROR("timed out waiting for FORCE_DETECT to go off"); DRM_DEBUG_KMS("timed out waiting for FORCE_DETECT to go off");
} }
stat = I915_READ(PORT_HOTPLUG_STAT); stat = I915_READ(PORT_HOTPLUG_STAT);
......
...@@ -2463,11 +2463,19 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, ...@@ -2463,11 +2463,19 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
if (HAS_PCH_SPLIT(dev)) { if (HAS_PCH_SPLIT(dev)) {
/* FDI link clock is fixed at 2.7G */ /* FDI link clock is fixed at 2.7G */
if (mode->clock * 3 > IRONLAKE_FDI_FREQ * 4) if (mode->clock * 3 > IRONLAKE_FDI_FREQ * 4)
return false; return false;
} }
/* XXX some encoders set the crtcinfo, others don't.
* Obviously we need some form of conflict resolution here...
*/
if (adjusted_mode->crtc_htotal == 0)
drm_mode_set_crtcinfo(adjusted_mode, 0);
return true; return true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册