mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Add surfaceId variable to VASurface
Related-To: NEO-6693 Currently if clCreateFromVA and clEnqueueAcquireVA are called from different scopes (i.e. surfaceID passed to clCreate is destroyed when called clEnqueueAcquired) enqueue results in undefined behaviour. This PR fixes that. Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
43b17a69f0
commit
107db3a372
@@ -156,15 +156,15 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh
|
||||
void VASurface::synchronizeObject(UpdateData &updateData) {
|
||||
updateData.synchronizationStatus = SynchronizeStatus::ACQUIRE_SUCCESFUL;
|
||||
if (!interopUserSync) {
|
||||
if (sharingFunctions->syncSurface(*surfaceId) != VA_STATUS_SUCCESS) {
|
||||
if (sharingFunctions->syncSurface(surfaceId) != VA_STATUS_SUCCESS) {
|
||||
updateData.synchronizationStatus = SYNCHRONIZE_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VASurface::getMemObjectInfo(size_t ¶mValueSize, void *¶mValue) {
|
||||
paramValueSize = sizeof(surfaceId);
|
||||
paramValue = &surfaceId;
|
||||
paramValueSize = sizeof(surfaceIdPtr);
|
||||
paramValue = &surfaceIdPtr;
|
||||
}
|
||||
|
||||
bool VASurface::validate(cl_mem_flags flags, cl_uint plane) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -31,10 +31,13 @@ class VASurface : VASharing {
|
||||
protected:
|
||||
VASurface(VASharingFunctions *sharingFunctions, VAImageID imageId,
|
||||
cl_uint plane, VASurfaceID *surfaceId, bool interopUserSync)
|
||||
: VASharing(sharingFunctions, imageId), plane(plane), surfaceId(surfaceId), interopUserSync(interopUserSync){};
|
||||
: VASharing(sharingFunctions, imageId), plane(plane), surfaceId(*surfaceId), interopUserSync(interopUserSync) {
|
||||
surfaceIdPtr = &this->surfaceId;
|
||||
};
|
||||
|
||||
cl_uint plane;
|
||||
VASurfaceID *surfaceId;
|
||||
VASurfaceID surfaceId;
|
||||
VASurfaceID *surfaceIdPtr;
|
||||
bool interopUserSync;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user