aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-12-10 00:44:11 -0500
committerDave Airlie <airlied@redhat.com>2009-12-10 00:44:19 -0500
commit0b5e8db639de032bd4febbb0a5b1cd2c19bac26d (patch)
treeeddc436f8cbf85cea5205f7dc118bf0068c2d127
parent7b0a9e8302522d5f7bb7fab6b8a3c8ce8181609c (diff)
parent4f8d619cc3ab805aa1726c1dfe196a0705b955bd (diff)
Merge remote branch 'anholt/drm-intel-next' into drm-linus
Pull more Intel changes in, especially one to init the GTT properly
-rw-r--r--drivers/char/agp/intel-agp.c7
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c5
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h2
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c1
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c1
-rw-r--r--drivers/gpu/drm/i915/i915_suspend.c7
-rw-r--r--drivers/gpu/drm/i915/intel_display.c35
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h1
8 files changed, 32 insertions, 27 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 37678550b3eb..30c36ac2cd00 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -178,6 +178,7 @@ static struct _intel_private {
178 * popup and for the GTT. 178 * popup and for the GTT.
179 */ 179 */
180 int gtt_entries; /* i830+ */ 180 int gtt_entries; /* i830+ */
181 int gtt_total_size;
181 union { 182 union {
182 void __iomem *i9xx_flush_page; 183 void __iomem *i9xx_flush_page;
183 void *i8xx_flush_page; 184 void *i8xx_flush_page;
@@ -1153,7 +1154,7 @@ static int intel_i915_configure(void)
1153 readl(intel_private.registers+I810_PGETBL_CTL); /* PCI Posting. */ 1154 readl(intel_private.registers+I810_PGETBL_CTL); /* PCI Posting. */
1154 1155
1155 if (agp_bridge->driver->needs_scratch_page) { 1156 if (agp_bridge->driver->needs_scratch_page) {
1156 for (i = intel_private.gtt_entries; i < current_size->num_entries; i++) { 1157 for (i = intel_private.gtt_entries; i < intel_private.gtt_total_size; i++) {
1157 writel(agp_bridge->scratch_page, intel_private.gtt+i); 1158 writel(agp_bridge->scratch_page, intel_private.gtt+i);
1158 } 1159 }
1159 readl(intel_private.gtt+i-1); /* PCI Posting. */ 1160 readl(intel_private.gtt+i-1); /* PCI Posting. */
@@ -1308,6 +1309,8 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
1308 if (!intel_private.gtt) 1309 if (!intel_private.gtt)
1309 return -ENOMEM; 1310 return -ENOMEM;
1310 1311
1312 intel_private.gtt_total_size = gtt_map_size / 4;
1313
1311 temp &= 0xfff80000; 1314 temp &= 0xfff80000;
1312 1315
1313 intel_private.registers = ioremap(temp, 128 * 4096); 1316 intel_private.registers = ioremap(temp, 128 * 4096);
@@ -1395,6 +1398,8 @@ static int intel_i965_create_gatt_table(struct agp_bridge_data *bridge)
1395 if (!intel_private.gtt) 1398 if (!intel_private.gtt)
1396 return -ENOMEM; 1399 return -ENOMEM;
1397 1400
1401 intel_private.gtt_total_size = gtt_size / 4;
1402
1398 intel_private.registers = ioremap(temp, 128 * 4096); 1403 intel_private.registers = ioremap(temp, 128 * 4096);
1399 if (!intel_private.registers) { 1404 if (!intel_private.registers) {
1400 iounmap(intel_private.gtt); 1405 iounmap(intel_private.gtt);
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index eeed4e34c757..18476bf0b580 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -97,13 +97,14 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
97 { 97 {
98 struct drm_gem_object *obj = obj_priv->obj; 98 struct drm_gem_object *obj = obj_priv->obj;
99 99
100 seq_printf(m, " %p: %s %8zd %08x %08x %d %s", 100 seq_printf(m, " %p: %s %8zd %08x %08x %d%s%s",
101 obj, 101 obj,
102 get_pin_flag(obj_priv), 102 get_pin_flag(obj_priv),
103 obj->size, 103 obj->size,
104 obj->read_domains, obj->write_domain, 104 obj->read_domains, obj->write_domain,
105 obj_priv->last_rendering_seqno, 105 obj_priv->last_rendering_seqno,
106 obj_priv->dirty ? "dirty" : ""); 106 obj_priv->dirty ? " dirty" : "",
107 obj_priv->madv == I915_MADV_DONTNEED ? " purgeable" : "");
107 108
108 if (obj->name) 109 if (obj->name)
109 seq_printf(m, " (name: %d)", obj->name); 110 seq_printf(m, " (name: %d)", obj->name);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index df5b943fccda..fbecac72f5bb 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -383,8 +383,6 @@ typedef struct drm_i915_private {
383 u32 saveFDI_RXA_IMR; 383 u32 saveFDI_RXA_IMR;
384 u32 saveFDI_RXB_IMR; 384 u32 saveFDI_RXB_IMR;
385 u32 saveCACHE_MODE_0; 385 u32 saveCACHE_MODE_0;
386 u32 saveD_STATE;
387 u32 saveDSPCLK_GATE_D;
388 u32 saveMI_ARB_STATE; 386 u32 saveMI_ARB_STATE;
389 u32 saveSWF0[16]; 387 u32 saveSWF0[16];
390 u32 saveSWF1[16]; 388 u32 saveSWF1[16];
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 5b46623d62d4..917b8377ae28 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1288,6 +1288,7 @@ i915_gem_create_mmap_offset(struct drm_gem_object *obj)
1288 list->hash.key = list->file_offset_node->start; 1288 list->hash.key = list->file_offset_node->start;
1289 if (drm_ht_insert_item(&mm->offset_hash, &list->hash)) { 1289 if (drm_ht_insert_item(&mm->offset_hash, &list->hash)) {
1290 DRM_ERROR("failed to add to map hash\n"); 1290 DRM_ERROR("failed to add to map hash\n");
1291 ret = -ENOMEM;
1291 goto out_free_mm; 1292 goto out_free_mm;
1292 } 1293 }
1293 1294
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index ae17c4b45b31..85f4c5de97e2 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -546,7 +546,6 @@ static void i915_handle_error(struct drm_device *dev, bool wedged)
546 /* 546 /*
547 * Wakeup waiting processes so they don't hang 547 * Wakeup waiting processes so they don't hang
548 */ 548 */
549 printk("i915: Waking up sleeping processes\n");
550 DRM_WAKEUP(&dev_priv->irq_queue); 549 DRM_WAKEUP(&dev_priv->irq_queue);
551 } 550 }
552 551
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index ab35e81b7cbf..d5ebb00a9d49 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -756,10 +756,6 @@ int i915_save_state(struct drm_device *dev)
756 dev_priv->saveIMR = I915_READ(IMR); 756 dev_priv->saveIMR = I915_READ(IMR);
757 } 757 }
758 758
759 /* Clock gating state */
760 dev_priv->saveD_STATE = I915_READ(D_STATE);
761 dev_priv->saveDSPCLK_GATE_D = I915_READ(DSPCLK_GATE_D); /* Not sure about this */
762
763 /* Cache mode state */ 759 /* Cache mode state */
764 dev_priv->saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0); 760 dev_priv->saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0);
765 761
@@ -834,8 +830,7 @@ int i915_restore_state(struct drm_device *dev)
834 } 830 }
835 831
836 /* Clock gating state */ 832 /* Clock gating state */
837 I915_WRITE (D_STATE, dev_priv->saveD_STATE); 833 intel_init_clock_gating(dev);
838 I915_WRITE (DSPCLK_GATE_D, dev_priv->saveDSPCLK_GATE_D);
839 834
840 /* Cache mode state */ 835 /* Cache mode state */
841 I915_WRITE (CACHE_MODE_0, dev_priv->saveCACHE_MODE_0 | 0xffff0000); 836 I915_WRITE (CACHE_MODE_0, dev_priv->saveCACHE_MODE_0 | 0xffff0000);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5146b8094ae0..52cd9b006da2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4584,28 +4584,33 @@ void intel_init_clock_gating(struct drm_device *dev)
4584 struct drm_i915_gem_object *obj_priv; 4584 struct drm_i915_gem_object *obj_priv;
4585 int ret; 4585 int ret;
4586 4586
4587 pwrctx = drm_gem_object_alloc(dev, 4096); 4587 if (dev_priv->pwrctx) {
4588 if (!pwrctx) { 4588 obj_priv = dev_priv->pwrctx->driver_private;
4589 DRM_DEBUG("failed to alloc power context, RC6 disabled\n"); 4589 } else {
4590 goto out; 4590 pwrctx = drm_gem_object_alloc(dev, 4096);
4591 } 4591 if (!pwrctx) {
4592 DRM_DEBUG("failed to alloc power context, "
4593 "RC6 disabled\n");
4594 goto out;
4595 }
4592 4596
4593 ret = i915_gem_object_pin(pwrctx, 4096); 4597 ret = i915_gem_object_pin(pwrctx, 4096);
4594 if (ret) { 4598 if (ret) {
4595 DRM_ERROR("failed to pin power context: %d\n", ret); 4599 DRM_ERROR("failed to pin power context: %d\n",
4596 drm_gem_object_unreference(pwrctx); 4600 ret);
4597 goto out; 4601 drm_gem_object_unreference(pwrctx);
4598 } 4602 goto out;
4603 }
4599 4604
4600 i915_gem_object_set_to_gtt_domain(pwrctx, 1); 4605 i915_gem_object_set_to_gtt_domain(pwrctx, 1);
4601 4606
4602 obj_priv = pwrctx->driver_private; 4607 dev_priv->pwrctx = pwrctx;
4608 obj_priv = pwrctx->driver_private;
4609 }
4603 4610
4604 I915_WRITE(PWRCTXA, obj_priv->gtt_offset | PWRCTX_EN); 4611 I915_WRITE(PWRCTXA, obj_priv->gtt_offset | PWRCTX_EN);
4605 I915_WRITE(MCHBAR_RENDER_STANDBY, 4612 I915_WRITE(MCHBAR_RENDER_STANDBY,
4606 I915_READ(MCHBAR_RENDER_STANDBY) & ~RCX_SW_EXIT); 4613 I915_READ(MCHBAR_RENDER_STANDBY) & ~RCX_SW_EXIT);
4607
4608 dev_priv->pwrctx = pwrctx;
4609 } 4614 }
4610 4615
4611out: 4616out:
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 9ffa31e13eb3..a51573da1ff6 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -208,6 +208,7 @@ extern void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
208 u16 blue, int regno); 208 u16 blue, int regno);
209extern void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, 209extern void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
210 u16 *blue, int regno); 210 u16 *blue, int regno);
211extern void intel_init_clock_gating(struct drm_device *dev);
211 212
212extern int intel_framebuffer_create(struct drm_device *dev, 213extern int intel_framebuffer_create(struct drm_device *dev,
213 struct drm_mode_fb_cmd *mode_cmd, 214 struct drm_mode_fb_cmd *mode_cmd,