mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 22:43:00 +08:00
Revert "Stop using CONTEXT_SET_PARAM"
This reverts commit e9f56e7d96.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a203cd2863
commit
86f8150dc7
@@ -377,6 +377,26 @@ void Drm::setNonPersistentContext(uint32_t drmContextId) {
|
||||
ioctl(DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM, &contextParam);
|
||||
}
|
||||
|
||||
uint32_t Drm::createDrmContext(uint32_t drmVmId, bool isSpecialContextRequested) {
|
||||
drm_i915_gem_context_create_ext gcc = {};
|
||||
|
||||
this->appendDrmContextFlags(gcc, isSpecialContextRequested);
|
||||
|
||||
auto retVal = ioctl(DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT, &gcc);
|
||||
UNRECOVERABLE_IF(retVal != 0);
|
||||
|
||||
if (drmVmId > 0) {
|
||||
drm_i915_gem_context_param param{};
|
||||
param.ctx_id = gcc.ctx_id;
|
||||
param.value = drmVmId;
|
||||
param.param = I915_CONTEXT_PARAM_VM;
|
||||
retVal = ioctl(DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM, ¶m);
|
||||
UNRECOVERABLE_IF(retVal != 0);
|
||||
}
|
||||
|
||||
return gcc.ctx_id;
|
||||
}
|
||||
|
||||
void Drm::destroyDrmContext(uint32_t drmContextId) {
|
||||
drm_i915_gem_context_destroy destroy = {};
|
||||
destroy.ctx_id = drmContextId;
|
||||
|
||||
@@ -117,24 +117,4 @@ int Drm::createDrmVirtualMemory(uint32_t &drmVmId) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint32_t Drm::createDrmContext(uint32_t drmVmId, bool isSpecialContextRequested) {
|
||||
drm_i915_gem_context_create_ext gcc = {};
|
||||
|
||||
this->appendDrmContextFlags(gcc, isSpecialContextRequested);
|
||||
|
||||
auto retVal = ioctl(DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT, &gcc);
|
||||
UNRECOVERABLE_IF(retVal != 0);
|
||||
|
||||
if (drmVmId > 0) {
|
||||
drm_i915_gem_context_param param{};
|
||||
param.ctx_id = gcc.ctx_id;
|
||||
param.value = drmVmId;
|
||||
param.param = I915_CONTEXT_PARAM_VM;
|
||||
retVal = ioctl(DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM, ¶m);
|
||||
UNRECOVERABLE_IF(retVal != 0);
|
||||
}
|
||||
|
||||
return gcc.ctx_id;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -126,24 +126,4 @@ int Drm::createDrmVirtualMemory(uint32_t &drmVmId) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint32_t Drm::createDrmContext(uint32_t drmVmId, bool isSpecialContextRequested) {
|
||||
drm_i915_gem_context_create_ext gcc = {};
|
||||
|
||||
this->appendDrmContextFlags(gcc, isSpecialContextRequested);
|
||||
|
||||
auto retVal = ioctl(DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT, &gcc);
|
||||
UNRECOVERABLE_IF(retVal != 0);
|
||||
|
||||
if (drmVmId > 0) {
|
||||
drm_i915_gem_context_param param{};
|
||||
param.ctx_id = gcc.ctx_id;
|
||||
param.value = drmVmId;
|
||||
param.param = I915_CONTEXT_PARAM_VM;
|
||||
retVal = ioctl(DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM, ¶m);
|
||||
UNRECOVERABLE_IF(retVal != 0);
|
||||
}
|
||||
|
||||
return gcc.ctx_id;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user