[Intel-gfx] [PATCH 05/10] drm/i915/gtt: Generalize alloc_pd
Chris Wilson
chris at chris-wilson.co.uk
Fri Jun 14 17:17:04 UTC 2019
Quoting Mika Kuoppala (2019-06-14 17:43:45)
> Allocate all page directory variants with alloc_pd. As
> the lvl3 and lvl4 variants differ in manipulation, we
> need to check for existence of backing phys page before accessing
> it.
>
> v2: use err in returns
>
> Signed-off-by: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_gtt.c | 88 ++++++++++++-----------------
> 1 file changed, 36 insertions(+), 52 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 25805971f771..de264b3a0105 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -719,10 +719,17 @@ static struct i915_page_directory *alloc_pd(struct i915_address_space *vm)
> return pd;
> }
>
> +static inline bool pd_has_phys_page(const struct i915_page_directory * const pd)
> +{
> + return pd->base.page;
Ok. I have no better magic.
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris
More information about the Intel-gfx
mailing list