mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
intel: Pass virtual memory address space ID while creating context
In future patches, we will be creating a separate companion RCS engine and each engine is created with it's own address space, and we really don't want. CCS and RCS engine writes should be visible to each other in order to get the wait/signal mechanism working. v2: - Move drm_i915_gem_context_create_ext_setparam out of if block (Lionel) Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
This commit is contained in:
parent
b73960fc40
commit
a5e4be45c0
7 changed files with 20 additions and 2 deletions
|
|
@ -191,7 +191,7 @@ iris_create_engines_context(struct iris_context *ice)
|
|||
|
||||
uint32_t engines_ctx;
|
||||
if (!intel_gem_create_context_engines(fd, flags, engines_info, num_batches,
|
||||
engine_classes, &engines_ctx)) {
|
||||
engine_classes, 0, &engines_ctx)) {
|
||||
free(engines_info);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ i915_gem_create_context_engines(int fd,
|
|||
enum intel_gem_create_context_flags flags,
|
||||
const struct intel_query_engine_info *info,
|
||||
int num_engines, enum intel_engine_class *engine_classes,
|
||||
uint32_t vm_id,
|
||||
uint32_t *context_id)
|
||||
{
|
||||
assert(info != NULL);
|
||||
|
|
@ -137,6 +138,12 @@ i915_gem_create_context_engines(int fd,
|
|||
struct drm_i915_gem_context_create_ext create = {
|
||||
.flags = I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS,
|
||||
};
|
||||
struct drm_i915_gem_context_create_ext_setparam vm_param = {
|
||||
.param = {
|
||||
.param = I915_CONTEXT_PARAM_VM,
|
||||
.value = vm_id,
|
||||
},
|
||||
};
|
||||
|
||||
intel_i915_gem_add_ext(&create.extensions,
|
||||
I915_CONTEXT_CREATE_EXT_SETPARAM,
|
||||
|
|
@ -145,6 +152,12 @@ i915_gem_create_context_engines(int fd,
|
|||
I915_CONTEXT_CREATE_EXT_SETPARAM,
|
||||
&recoverable_param.base);
|
||||
|
||||
if (vm_id != 0) {
|
||||
intel_i915_gem_add_ext(&create.extensions,
|
||||
I915_CONTEXT_CREATE_EXT_SETPARAM,
|
||||
&vm_param.base);
|
||||
}
|
||||
|
||||
if (flags & INTEL_GEM_CREATE_CONTEXT_EXT_PROTECTED_FLAG) {
|
||||
intel_i915_gem_add_ext(&create.extensions,
|
||||
I915_CONTEXT_CREATE_EXT_SETPARAM,
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ bool i915_gem_create_context_engines(int fd,
|
|||
enum intel_gem_create_context_flags flags,
|
||||
const struct intel_query_engine_info *info,
|
||||
int num_engines, enum intel_engine_class *engine_classes,
|
||||
uint32_t vm_id,
|
||||
uint32_t *context_id);
|
||||
bool i915_gem_set_context_param(int fd, uint32_t context, uint32_t param,
|
||||
uint64_t value);
|
||||
|
|
|
|||
|
|
@ -79,10 +79,11 @@ intel_gem_create_context_engines(int fd,
|
|||
enum intel_gem_create_context_flags flags,
|
||||
const struct intel_query_engine_info *info,
|
||||
int num_engines, enum intel_engine_class *engine_classes,
|
||||
uint32_t vm_id,
|
||||
uint32_t *context_id)
|
||||
{
|
||||
return i915_gem_create_context_engines(fd, flags, info, num_engines,
|
||||
engine_classes, context_id);
|
||||
engine_classes, vm_id, context_id);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ intel_gem_create_context_engines(int fd,
|
|||
enum intel_gem_create_context_flags flags,
|
||||
const struct intel_query_engine_info *info,
|
||||
int num_engines, enum intel_engine_class *engine_classes,
|
||||
uint32_t vm_id,
|
||||
uint32_t *context_id);
|
||||
bool
|
||||
intel_gem_set_context_param(int fd, uint32_t context, uint32_t param,
|
||||
|
|
|
|||
|
|
@ -232,6 +232,7 @@ anv_i915_device_setup_context(struct anv_device *device,
|
|||
if (!intel_gem_create_context_engines(device->fd, 0 /* flags */,
|
||||
physical_device->engine_info,
|
||||
engine_count, engine_classes,
|
||||
0 /* vm_id */,
|
||||
(uint32_t *)&device->context_id))
|
||||
result = vk_errorf(device, VK_ERROR_INITIALIZATION_FAILED,
|
||||
"kernel context creation failed");
|
||||
|
|
|
|||
|
|
@ -2629,6 +2629,7 @@ anv_device_setup_context(struct anv_device *device,
|
|||
if (!intel_gem_create_context_engines(device->fd, 0 /* flags */,
|
||||
physical_device->engine_info,
|
||||
engine_count, engine_classes,
|
||||
0 /* vm_id */,
|
||||
(uint32_t *)&device->context_id))
|
||||
result = vk_errorf(device, VK_ERROR_INITIALIZATION_FAILED,
|
||||
"kernel context creation failed");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue