[PATCH 6/8] drm/i915: move engine scratch to LMEM

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 25 22:18:24 UTC 2021


Quoting Matthew Auld (2021-01-25 18:14:44)
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_gt.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
> index d8e1ab412634..8ab1b10f1a96 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> @@ -4,6 +4,8 @@
>   */
>  
>  #include "debugfs_gt.h"
> +
> +#include "gem/i915_gem_lmem.h"
>  #include "i915_drv.h"
>  #include "intel_context.h"
>  #include "intel_gt.h"
> @@ -344,9 +346,14 @@ static int intel_gt_init_scratch(struct intel_gt *gt, unsigned int size)
>         struct i915_vma *vma;
>         int ret;
>  
> -       obj = i915_gem_object_create_stolen(i915, size);
> -       if (IS_ERR(obj))
> -               obj = i915_gem_object_create_internal(i915, size);
> +       if (HAS_LMEM(i915)) {
> +               obj = i915_gem_object_create_lmem(i915, size,
> +                                                 I915_BO_ALLOC_VOLATILE);
> +       } else {
> +               obj = i915_gem_object_create_stolen(i915, size);
> +               if (IS_ERR(obj))
> +                       obj = i915_gem_object_create_internal(i915, size);
> +       }

Can we make

obj = i915_gem_object_create_lmem(i915, size, I915_BO_ALLOC_VOLATILE);
if (IS_ERR(obj))
	obj = i915_gem_object_create_stolen(i915, size);
if (IS_ERR(obj))
	obj = i915_gem_object_create_internal(i915, size);

dtrt?
-Chris


More information about the Intel-gfx-trybot mailing list