1 /* 2 * Copyright (c) 2017, Intel Corporation 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included 12 * in all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 * OTHER DEALINGS IN THE SOFTWARE. 21 */ 22 //! 23 //! \file media_libva_cm.h 24 //! \brief LibVA CM(C for Metal) extensions interface definition 25 //! 26 27 #ifndef _MEDIA_LIBVA_CM_H_ 28 #define _MEDIA_LIBVA_CM_H_ 29 30 #include "media_libva_common.h" 31 #include <va/va.h> 32 #include <va/va_vpp.h> 33 #include <va/va_backend_vpp.h> 34 35 #include "vphal.h" 36 #include "mos_os.h" 37 38 #define VAExtModuleCMRT 2 39 40 //core structure for CM DDI 41 struct _CM_HAL_STATE; 42 typedef struct _CM_HAL_STATE *PCM_HAL_STATE; 43 typedef struct _CM_CONTEXT 44 { 45 MOS_CONTEXT mosCtx = {}; 46 union 47 { 48 void *cmHal = nullptr; 49 PCM_HAL_STATE cmHalState; 50 }; 51 } CM_CONTEXT, *PCM_CONTEXT; 52 53 #ifdef __cplusplus 54 extern "C" { 55 #endif 56 //Public APIs to access CM acceleration capability in VPG drivers 57 VAStatus DdiDestroyContextCM ( 58 VADriverContextP vaDriverCtx, 59 VAContextID vaCtxID); 60 61 MEDIAAPI_EXPORT VAStatus vaCmExtSendReqMsg( 62 VADisplay dpy, 63 void *moduleType, 64 uint32_t *inputFunId, 65 void *inputData, 66 uint32_t *inputDataLen, 67 uint32_t *outputFunId, 68 void *outputData, 69 uint32_t *outputDataLen); 70 71 uint32_t CmGetFreeCtxIndex ( 72 PDDI_MEDIA_CONTEXT mediaCtx); 73 74 #ifdef __cplusplus 75 } 76 #endif 77 #endif //_MEDIA_LIBVA_CM_H_ 78