intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/10] drm/i915: generalize pte vs. register BAR allocation
@ 2013-04-09  1:43 Ben Widawsky
  2013-04-09  1:43 ` [PATCH 02/10] drm/i915: Call out GEN6 PTE specificity Ben Widawsky
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Ben Widawsky @ 2013-04-09  1:43 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ben Widawsky

All gen6+ parts so far have 1 BAR which holds both the register space
and the GTT PTEs. Up until now, that was a 4MB BAR with half allocated
to each.

I have a strong hunch (wink, nod, wink) that future gens will also keep
a similar 50-50 split though the sizes may change. To help this along
change the code to obey the rule of half the total size instead of a
hard-coded 2MB.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 24a23b3..215d72c 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -738,8 +738,10 @@ static int gen6_gmch_probe(struct drm_device *dev,
 
 	*gtt_total = (gtt_size / sizeof(gtt_pte_t)) << PAGE_SHIFT;
 
-	/* For GEN6+ the PTEs for the ggtt live at 2MB + BAR0 */
-	gtt_bus_addr = pci_resource_start(dev->pdev, 0) + (2<<20);
+	/* For Modern GENs the PTEs and register space are split in the BAR */
+	gtt_bus_addr = pci_resource_start(dev->pdev, 0) +
+		(pci_resource_len(dev->pdev, 0) / 2);
+
 	dev_priv->gtt.gsm = ioremap_wc(gtt_bus_addr, gtt_size);
 	if (!dev_priv->gtt.gsm) {
 		DRM_ERROR("Failed to map the gtt page table\n");
-- 
1.8.2.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-04-09  9:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-09  1:43 [PATCH 01/10] drm/i915: generalize pte vs. register BAR allocation Ben Widawsky
2013-04-09  1:43 ` [PATCH 02/10] drm/i915: Call out GEN6 PTE specificity Ben Widawsky
2013-04-09  1:43 ` [PATCH 03/10] drm/i915: Map registers before GTT init Ben Widawsky
2013-04-09  8:59   ` Daniel Vetter
2013-04-09  1:43 ` [PATCH 04/10] drm/i915: random checkpatch fixes Ben Widawsky
2013-04-09  1:43 ` [PATCH 05/10] drm/i915/ppgtt: Set scratch page "globally" Ben Widawsky
2013-04-09  1:43 ` [PATCH 06/10] drm/i915: Conditionally carve out GGTT PDE Ben Widawsky
2013-04-09  1:43 ` [PATCH 07/10] drm/i915: Rework PPGTT init code Ben Widawsky
2013-04-09  1:43 ` [PATCH 08/10] drm/i915: Abstract PPGTT enabling Ben Widawsky
2013-04-09  1:43 ` [PATCH 09/10] drm/i915: NULL aliasing_ppgtt on cleanup Ben Widawsky
2013-04-09  1:43 ` [PATCH 10/10] drm/i915: Allow PPGTT enable to fail Ben Widawsky
2013-04-09  9:08   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).