[Intel-gfx] [RFC PATCH 124/162] drm/i915/lmem: allocate HWSP in lmem
Matthew Auld
matthew.auld at intel.com
Fri Nov 27 12:06:40 UTC 2020
From: Michel Thierry <michel.thierry at intel.com>
Signed-off-by: Michel Thierry <michel.thierry at intel.com>
Signed-off-by: Matthew Auld <matthew.auld at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Cc: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
---
drivers/gpu/drm/i915/gt/intel_engine_cs.c | 10 +++++++++-
drivers/gpu/drm/i915/gt/intel_timeline.c | 8 +++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index 0ba020346566..9e0394b06f38 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -25,6 +25,7 @@
#include <drm/drm_print.h>
#include "gem/i915_gem_context.h"
+#include "gem/i915_gem_lmem.h"
#include "i915_drv.h"
@@ -657,7 +658,14 @@ static int init_status_page(struct intel_engine_cs *engine)
* in GFP_DMA32 for i965, and no earlier physical address users had
* access to more than 4G.
*/
- obj = i915_gem_object_create_internal(engine->i915, PAGE_SIZE);
+ if (HAS_LMEM(engine->i915)) {
+ obj = i915_gem_object_create_lmem(engine->i915,
+ PAGE_SIZE,
+ I915_BO_ALLOC_CONTIGUOUS |
+ I915_BO_ALLOC_VOLATILE);
+ } else {
+ obj = i915_gem_object_create_internal(engine->i915, PAGE_SIZE);
+ }
if (IS_ERR(obj)) {
drm_err(&engine->i915->drm,
"Failed to allocate status page\n");
diff --git a/drivers/gpu/drm/i915/gt/intel_timeline.c b/drivers/gpu/drm/i915/gt/intel_timeline.c
index 065943781586..589559b526eb 100644
--- a/drivers/gpu/drm/i915/gt/intel_timeline.c
+++ b/drivers/gpu/drm/i915/gt/intel_timeline.c
@@ -6,6 +6,7 @@
#include "i915_drv.h"
+#include "gem/i915_gem_lmem.h"
#include "i915_active.h"
#include "i915_syncmap.h"
#include "intel_gt.h"
@@ -34,7 +35,12 @@ static int __hwsp_alloc(struct intel_gt *gt, struct intel_timeline_hwsp *hwsp)
int type;
int ret;
- obj = i915_gem_object_create_internal(i915, PAGE_SIZE);
+ if (HAS_LMEM(i915))
+ obj = i915_gem_object_create_lmem(i915, PAGE_SIZE,
+ I915_BO_ALLOC_CONTIGUOUS |
+ I915_BO_ALLOC_VOLATILE);
+ else
+ obj = i915_gem_object_create_internal(i915, PAGE_SIZE);
if (IS_ERR(obj))
return PTR_ERR(obj);
--
2.26.2
More information about the Intel-gfx
mailing list