From bb2e2ee4e130b15a2ec6bf973ef8770662ee69b2 Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Mon, 13 May 2024 15:16:22 +0000 Subject: [PATCH] feature: Change doorbell handle from uint64_t to extendable struct Related-To: NEO-11386 Signed-off-by: Bartosz Dunajski --- .../api/driver_experimental/public/zex_common.h | 14 ++++++++++++++ .../api/driver_experimental/public/zex_context.cpp | 4 ++-- .../api/driver_experimental/public/zex_context.h | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/level_zero/api/driver_experimental/public/zex_common.h b/level_zero/api/driver_experimental/public/zex_common.h index 269996fb97..bb0c713613 100644 --- a/level_zero/api/driver_experimental/public/zex_common.h +++ b/level_zero/api/driver_experimental/public/zex_common.h @@ -112,7 +112,21 @@ typedef struct _ze_intel_media_communication_desc_t { uint32_t controlBatchBufferSize; ///< [in] control batch buffer size } ze_intel_media_communication_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_intel_media_doorbell_handle_desc_t +typedef struct _ze_intel_media_doorbell_handle_desc_t ze_intel_media_doorbell_handle_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief ze_intel_media_doorbell_handle_desc_t +/// @details Handle of the doorbell. This structure is passed as argument of zeIntelMediaCommunicationCreate and zeIntelMediaCommunicationDestroy +typedef struct _ze_intel_media_doorbell_handle_desc_t { + ze_structure_type_t stype; ///< [in] type of this structure + void *pNext; ///< [in][optional] must be null or a pointer to an extension-specific, this will be used to extend this in future + uint64_t doorbell; ///< [in,out] handle of the doorbell +} ze_intel_media_doorbell_handle_desc_t; + #define ZE_STRUCTURE_TYPE_INTEL_MEDIA_COMMUNICATION_DESC (ze_structure_type_t)0x00020021 +#define ZE_STRUCTURE_TYPE_INTEL_MEDIA_DOORBELL_HANDLE_DESC (ze_structure_type_t)0x00020022 #if defined(__cplusplus) } // extern "C" diff --git a/level_zero/api/driver_experimental/public/zex_context.cpp b/level_zero/api/driver_experimental/public/zex_context.cpp index bb173cad16..6991369c81 100644 --- a/level_zero/api/driver_experimental/public/zex_context.cpp +++ b/level_zero/api/driver_experimental/public/zex_context.cpp @@ -8,11 +8,11 @@ #include "level_zero/api/driver_experimental/public/zex_context.h" namespace L0 { -ZE_APIEXPORT ze_result_t ZE_APICALL zeIntelMediaCommunicationCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_intel_media_communication_desc_t *desc, uint64_t *doorbellHandle) { +ZE_APIEXPORT ze_result_t ZE_APICALL zeIntelMediaCommunicationCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_intel_media_communication_desc_t *desc, ze_intel_media_doorbell_handle_desc_t *phDoorbell) { return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } -ZE_APIEXPORT ze_result_t ZE_APICALL zeIntelMediaCommunicationDestroy(ze_context_handle_t hContext, ze_device_handle_t hDevice, uint64_t doorbellHandle) { +ZE_APIEXPORT ze_result_t ZE_APICALL zeIntelMediaCommunicationDestroy(ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_intel_media_doorbell_handle_desc_t *phDoorbell) { return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/level_zero/api/driver_experimental/public/zex_context.h b/level_zero/api/driver_experimental/public/zex_context.h index c3a1fc8bca..f4b57f9943 100644 --- a/level_zero/api/driver_experimental/public/zex_context.h +++ b/level_zero/api/driver_experimental/public/zex_context.h @@ -11,7 +11,7 @@ namespace L0 { -ZE_APIEXPORT ze_result_t ZE_APICALL zeIntelMediaCommunicationCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_intel_media_communication_desc_t *desc, uint64_t *doorbellHandle); +ZE_APIEXPORT ze_result_t ZE_APICALL zeIntelMediaCommunicationCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_intel_media_communication_desc_t *desc, ze_intel_media_doorbell_handle_desc_t *phDoorbell); -ZE_APIEXPORT ze_result_t ZE_APICALL zeIntelMediaCommunicationDestroy(ze_context_handle_t hContext, ze_device_handle_t hDevice, uint64_t doorbellHandle); +ZE_APIEXPORT ze_result_t ZE_APICALL zeIntelMediaCommunicationDestroy(ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_intel_media_doorbell_handle_desc_t *phDoorbell); } // namespace L0