mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 19:32:25 +08:00
Immediate binding flag in BufferObject
Related-To: NEO-5985 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3137e82fca
commit
8a037399d1
@@ -4243,7 +4243,7 @@ TEST(DrmMemoryManager, givenNullBoWhenRegisteringBindExtHandleThenEarlyReturn) {
|
|||||||
gfxAllocation.freeRegisteredBOBindExtHandles(mockDrm.get());
|
gfxAllocation.freeRegisteredBOBindExtHandles(mockDrm.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenAllocationIsRegisteredThenBosAreMarkedForCapture) {
|
TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenAllocationIsRegisteredThenBosAreMarkedForCaptureAndRequireImmediateBinding) {
|
||||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||||
|
|
||||||
@@ -4257,6 +4257,7 @@ TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenAllocationIsRegister
|
|||||||
allocation.registerBOBindExtHandle(&drm);
|
allocation.registerBOBindExtHandle(&drm);
|
||||||
|
|
||||||
EXPECT_TRUE(bo.isMarkedForCapture());
|
EXPECT_TRUE(bo.isMarkedForCapture());
|
||||||
|
EXPECT_TRUE(bo.isImmediateBindingRequired());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenIsaIsRegisteredThenCookieIsAddedToBoHandle) {
|
TEST(DrmAllocationTest, givenResourceRegistrationEnabledWhenIsaIsRegisteredThenCookieIsAddedToBoHandle) {
|
||||||
|
|||||||
@@ -128,6 +128,8 @@ void DrmAllocation::registerBOBindExtHandle(Drm *drm) {
|
|||||||
bo->addBindExtHandle(cookieHandle);
|
bo->addBindExtHandle(cookieHandle);
|
||||||
registeredBoBindHandles.push_back(cookieHandle);
|
registeredBoBindHandles.push_back(cookieHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bo->requireImmediateBinding(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,14 @@ class BufferObject {
|
|||||||
bool isMarkedForCapture() {
|
bool isMarkedForCapture() {
|
||||||
return allowCapture;
|
return allowCapture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isImmediateBindingRequired() {
|
||||||
|
return requiresImmediateBinding;
|
||||||
|
}
|
||||||
|
void requireImmediateBinding(bool required) {
|
||||||
|
requiresImmediateBinding = required;
|
||||||
|
}
|
||||||
|
|
||||||
void setCacheRegion(CacheRegion regionIndex) { cacheRegion = regionIndex; }
|
void setCacheRegion(CacheRegion regionIndex) { cacheRegion = regionIndex; }
|
||||||
CacheRegion peekCacheRegion() const { return cacheRegion; }
|
CacheRegion peekCacheRegion() const { return cacheRegion; }
|
||||||
|
|
||||||
@@ -94,6 +102,7 @@ class BufferObject {
|
|||||||
//Tiling
|
//Tiling
|
||||||
uint32_t tiling_mode;
|
uint32_t tiling_mode;
|
||||||
bool allowCapture = false;
|
bool allowCapture = false;
|
||||||
|
bool requiresImmediateBinding = false;
|
||||||
|
|
||||||
uint32_t getOsContextId(OsContext *osContext);
|
uint32_t getOsContextId(OsContext *osContext);
|
||||||
MOCKABLE_VIRTUAL void fillExecObject(drm_i915_gem_exec_object2 &execObject, OsContext *osContext, uint32_t vmHandleId, uint32_t drmContextId);
|
MOCKABLE_VIRTUAL void fillExecObject(drm_i915_gem_exec_object2 &execObject, OsContext *osContext, uint32_t vmHandleId, uint32_t drmContextId);
|
||||||
|
|||||||
Reference in New Issue
Block a user