All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: grab a pages pin count for preallocate stolen
@ 2013-12-17 22:42 Daniel Vetter
  2013-12-18  0:00 ` Ben Widawsky
  2013-12-18 12:05 ` Chris Wilson
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Vetter @ 2013-12-17 22:42 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Ben Widawsky

But only when we indeed set up a gtt mapping. We need this since the
vma also holds a pages_pin_count, on top of the unconditional
pages_pin_count we grab for all stolen objects (to avoid swap-out).

This should avoid a pages_pin_count underrun when cleaning up
framebuffers objects taken over from the BIOS.

Reported-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index d284d892ed94..fed87ec17211 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -420,6 +420,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
 
 	list_add_tail(&obj->global_list, &dev_priv->mm.bound_list);
 	list_add_tail(&vma->mm_list, &ggtt->inactive_list);
+	i915_gem_object_pin_pages(obj);
 
 	return obj;
 
-- 
1.8.4.3

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

* Re: [PATCH] drm/i915: grab a pages pin count for preallocate stolen
  2013-12-17 22:42 [PATCH] drm/i915: grab a pages pin count for preallocate stolen Daniel Vetter
@ 2013-12-18  0:00 ` Ben Widawsky
  2013-12-18  8:03   ` Daniel Vetter
  2013-12-18 12:05 ` Chris Wilson
  1 sibling, 1 reply; 4+ messages in thread
From: Ben Widawsky @ 2013-12-18  0:00 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development

On Tue, Dec 17, 2013 at 11:42:11PM +0100, Daniel Vetter wrote:
> But only when we indeed set up a gtt mapping. We need this since the
> vma also holds a pages_pin_count, on top of the unconditional
> pages_pin_count we grab for all stolen objects (to avoid swap-out).
> 
> This should avoid a pages_pin_count underrun when cleaning up
> framebuffers objects taken over from the BIOS.
> 
> Reported-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> Cc: Ben Widawsky <benjamin.widawsky@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/i915_gem_stolen.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index d284d892ed94..fed87ec17211 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -420,6 +420,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
>  
>  	list_add_tail(&obj->global_list, &dev_priv->mm.bound_list);
>  	list_add_tail(&vma->mm_list, &ggtt->inactive_list);
> +	i915_gem_object_pin_pages(obj);
>  
>  	return obj;
>  
> -- 
> 1.8.4.3
> 

I'm missing why _i915_gem_object_create_stolen() isn't good enough for
pinning the pages.

-- 
Ben Widawsky, Intel Open Source Technology Center

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

* Re: [PATCH] drm/i915: grab a pages pin count for preallocate stolen
  2013-12-18  0:00 ` Ben Widawsky
@ 2013-12-18  8:03   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2013-12-18  8:03 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: Intel Graphics Development

On Wed, Dec 18, 2013 at 1:00 AM, Ben Widawsky
<benjamin.widawsky@intel.com> wrote:
> I'm missing why _i915_gem_object_create_stolen() isn't good enough for
> pinning the pages.

Citing my commit message "... vma also holds a pages_pin_count". Which
is on top of the general pages_pin_count we have for all stolen
objects to avoid them getting swapped out.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH] drm/i915: grab a pages pin count for preallocate stolen
  2013-12-17 22:42 [PATCH] drm/i915: grab a pages pin count for preallocate stolen Daniel Vetter
  2013-12-18  0:00 ` Ben Widawsky
@ 2013-12-18 12:05 ` Chris Wilson
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2013-12-18 12:05 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development, Ben Widawsky

On Tue, Dec 17, 2013 at 11:42:11PM +0100, Daniel Vetter wrote:
> But only when we indeed set up a gtt mapping. We need this since the
> vma also holds a pages_pin_count, on top of the unconditional
> pages_pin_count we grab for all stolen objects (to avoid swap-out).
> 
> This should avoid a pages_pin_count underrun when cleaning up
> framebuffers objects taken over from the BIOS.
> 
> Reported-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> Cc: Ben Widawsky <benjamin.widawsky@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

The bug is older than the introduction of vma.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

end of thread, other threads:[~2013-12-18 12:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-17 22:42 [PATCH] drm/i915: grab a pages pin count for preallocate stolen Daniel Vetter
2013-12-18  0:00 ` Ben Widawsky
2013-12-18  8:03   ` Daniel Vetter
2013-12-18 12:05 ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.