intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Use the correct size of the GTT for placing the per-process entries
@ 2012-08-24  8:12 Chris Wilson
  2012-08-24  9:08 ` Daniel Vetter
  2012-08-24 17:34 ` Ben Widawsky
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2012-08-24  8:12 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, Ben Widawsky, Matthew Garret

The current layout is to place the per-process tables at the end of the
GTT. However, this is currently using a hardcoded maximum size for the GTT
and not taking in account limitations imposed by the BIOS. Use the value
for the total number of entries allocated in the table as provided by
the configuration registers.

Reported-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ben Widawsky <ben@bwidawsk.net>
Cc: Matthew Garret <mjg@redhat.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 528fd43..4c03544 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -72,7 +72,7 @@ int i915_gem_init_aliasing_ppgtt(struct drm_device *dev)
 	/* ppgtt PDEs reside in the global gtt pagetable, which has 512*1024
 	 * entries. For aliasing ppgtt support we just steal them at the end for
 	 * now. */
-	first_pd_entry_in_global_pt = 512*1024 - I915_PPGTT_PD_ENTRIES;
+	first_pd_entry_in_global_pt = dev_priv->mm.gtt->gtt_total_entries - I915_PPGTT_PD_ENTRIES;
 
 	ppgtt = kzalloc(sizeof(*ppgtt), GFP_KERNEL);
 	if (!ppgtt)
-- 
1.7.10.4

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

* Re: [PATCH] drm/i915: Use the correct size of the GTT for placing the per-process entries
  2012-08-24  8:12 [PATCH] drm/i915: Use the correct size of the GTT for placing the per-process entries Chris Wilson
@ 2012-08-24  9:08 ` Daniel Vetter
  2012-08-24 17:34 ` Ben Widawsky
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2012-08-24  9:08 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, intel-gfx, Ben Widawsky, Matthew Garret

On Fri, Aug 24, 2012 at 09:12:22AM +0100, Chris Wilson wrote:
> The current layout is to place the per-process tables at the end of the
> GTT. However, this is currently using a hardcoded maximum size for the GTT
> and not taking in account limitations imposed by the BIOS. Use the value
> for the total number of entries allocated in the table as provided by
> the configuration registers.
> 
> Reported-by: Matthew Garrett <mjg@redhat.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ben Widawsky <ben@bwidawsk.net>
> Cc: Matthew Garret <mjg@redhat.com>
Picked up for -fixes, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

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

* Re: [PATCH] drm/i915: Use the correct size of the GTT for placing the per-process entries
  2012-08-24  8:12 [PATCH] drm/i915: Use the correct size of the GTT for placing the per-process entries Chris Wilson
  2012-08-24  9:08 ` Daniel Vetter
@ 2012-08-24 17:34 ` Ben Widawsky
  2012-08-24 17:40   ` Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Ben Widawsky @ 2012-08-24 17:34 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, intel-gfx, Matthew Garret

On 2012-08-24 01:12, Chris Wilson wrote:
> The current layout is to place the per-process tables at the end of 
> the
> GTT. However, this is currently using a hardcoded maximum size for 
> the GTT
> and not taking in account limitations imposed by the BIOS. Use the 
> value
> for the total number of entries allocated in the table as provided by
> the configuration registers.
>
> Reported-by: Matthew Garrett <mjg@redhat.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ben Widawsky <ben@bwidawsk.net>
> Cc: Matthew Garret <mjg@redhat.com>

details... Can someone remind me why we didn't put it at the bottom?
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>

> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c
> b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 528fd43..4c03544 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -72,7 +72,7 @@ int i915_gem_init_aliasing_ppgtt(struct drm_device 
> *dev)
>  	/* ppgtt PDEs reside in the global gtt pagetable, which has 
> 512*1024
>  	 * entries. For aliasing ppgtt support we just steal them at the 
> end for
>  	 * now. */
> -	first_pd_entry_in_global_pt = 512*1024 - I915_PPGTT_PD_ENTRIES;
> +	first_pd_entry_in_global_pt = dev_priv->mm.gtt->gtt_total_entries -
> I915_PPGTT_PD_ENTRIES;
>
>  	ppgtt = kzalloc(sizeof(*ppgtt), GFP_KERNEL);
>  	if (!ppgtt)

-- 
Ben Widawsky, Intel Open Source Technology Center

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

* Re: [PATCH] drm/i915: Use the correct size of the GTT for placing the per-process entries
  2012-08-24 17:34 ` Ben Widawsky
@ 2012-08-24 17:40   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2012-08-24 17:40 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: Daniel Vetter, intel-gfx, Matthew Garret

On Fri, Aug 24, 2012 at 10:34:13AM -0700, Ben Widawsky wrote:
> On 2012-08-24 01:12, Chris Wilson wrote:
> >The current layout is to place the per-process tables at the end
> >of the
> >GTT. However, this is currently using a hardcoded maximum size for
> >the GTT
> >and not taking in account limitations imposed by the BIOS. Use the
> >value
> >for the total number of entries allocated in the table as provided by
> >the configuration registers.
> >
> >Reported-by: Matthew Garrett <mjg@redhat.com>
> >Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> >Cc: Ben Widawsky <ben@bwidawsk.net>
> >Cc: Matthew Garret <mjg@redhat.com>
> 
> details... Can someone remind me why we didn't put it at the bottom?
> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>

Becaus the bottom is mappable, which is a contended resources (compared to
the entire gtt). Or so was my thinking at least.
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

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

end of thread, other threads:[~2012-08-24 17:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-24  8:12 [PATCH] drm/i915: Use the correct size of the GTT for placing the per-process entries Chris Wilson
2012-08-24  9:08 ` Daniel Vetter
2012-08-24 17:34 ` Ben Widawsky
2012-08-24 17:40   ` 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).