drm/i915: allocate cmd ring in lmem
authorMichel Thierry <michel.thierry@intel.com>
Wed, 27 Jan 2021 13:14:17 +0000 (13:14 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 24 Mar 2021 18:30:36 +0000 (19:30 +0100)
Prefer allocating the cmd ring from LMEM on dgfx.

Signed-off-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20210127131417.393872-8-matthew.auld@intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/gt/intel_ring.c

index 29c87b3..aee0a77 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright © 2019 Intel Corporation
  */
 
+#include "gem/i915_gem_lmem.h"
 #include "gem/i915_gem_object.h"
 
 #include "i915_drv.h"
@@ -108,8 +109,8 @@ static struct i915_vma *create_ring_vma(struct i915_ggtt *ggtt, int size)
        struct drm_i915_gem_object *obj;
        struct i915_vma *vma;
 
-       obj = ERR_PTR(-ENODEV);
-       if (i915_ggtt_has_aperture(ggtt))
+       obj = i915_gem_object_create_lmem(i915, size, I915_BO_ALLOC_VOLATILE);
+       if (IS_ERR(obj) && i915_ggtt_has_aperture(ggtt))
                obj = i915_gem_object_create_stolen(i915, size);
        if (IS_ERR(obj))
                obj = i915_gem_object_create_internal(i915, size);