[Intel-gfx] [PATCH 1/2] drm/i915: detach/attach get/put pages symmetry

Dave Airlie airlied at gmail.com
Thu Jun 18 10:19:33 CEST 2009


On Thu, Jun 18, 2009 at 6:52 AM, Chris Wilson<chris at chris-wilson.co.uk> wrote:
> After performing an operation over the page list for a buffer retrieved by
> i915_gem_object_get_pages() the pages need to be returned with
> i915_gem_object_put_pages(). This was not being observed for the phys
> objects which were thus leaking references to their backing pages.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> CC: Dave Airlie <airlied at gmail.com>

Oops. thanks.

Acked-by: Dave Airlie <airlied at gmail.com>
> ---
>  drivers/gpu/drm/i915/i915_gem.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index eedac21..a91fa29 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -4708,6 +4708,8 @@ void i915_gem_detach_phys_object(struct drm_device *dev,
>        }
>        drm_clflush_pages(obj_priv->pages, page_count);
>        drm_agp_chipset_flush(dev);
> +
> +       i915_gem_object_put_pages(obj);
>  out:
>        obj_priv->phys_obj->cur_obj = NULL;
>        obj_priv->phys_obj = NULL;
> @@ -4765,6 +4767,8 @@ i915_gem_attach_phys_object(struct drm_device *dev,
>                kunmap_atomic(src, KM_USER0);
>        }
>
> +       i915_gem_object_put_pages(obj);
> +
>        return 0;
>  out:
>        return ret;
> --
> 1.6.3.1
>
>



More information about the Intel-gfx mailing list