xref: /aosp_15_r20/external/intel-media-driver/media_driver/linux/common/vp/ddi/media_libva_vp.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2009-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_vp.h
24 //! \brief    Header for Video Acceleration (LibVA) VP extensions for VPG drivers
25 //!
26 
27 #ifndef _MEDIA_LIBVA_VP_H_
28 #define _MEDIA_LIBVA_VP_H_
29 
30 #include "media_libva_common.h"
31 #include "media_libva_cp_interface.h"
32 #include <va/va.h>
33 #include <va/va_vpp.h>
34 #include <va/va_backend_vpp.h>
35 #include "vphal.h"
36 #include "mos_os.h"
37 #include "ddi_vp_functions.h"
38 
39 //For Gen8, only support max 16k-32
40 #define VP_MAX_PIC_WIDTH_Gen8    16352
41 #define VP_MAX_PIC_HEIGHT_Gen8   16352
42 //For Gen9+ platform, supprot 16k
43 #define VP_MAX_PIC_WIDTH         16384
44 #define VP_MAX_PIC_HEIGHT        16384
45 
46 #define VP_MIN_PIC_WIDTH         16
47 #define VP_MIN_PIC_HEIGHT        16
48 
49 #define NUM_SURFS 1
50 
51 // public APIs
52 
53 VAStatus DdiVp_CreateContext(
54     VADriverContextP    pVaDrvCtx,
55     VAConfigID          vaConfigID,
56     int32_t             iWidth,
57     int32_t             iHeight,
58     int32_t             iFlag,
59     VASurfaceID        *vaSurfIDs,
60     int32_t             iNumSurfs,
61     VAContextID        *pVaCtxID
62 );
63 
64 VAStatus DdiVp_DestroyContext(
65     VADriverContextP    pVaDrvCtx,
66     VAContextID         vaCtxID
67 );
68 
69 VAStatus DdiVp_CreateBuffer(
70     VADriverContextP           ctx,
71     void                       *pDecCtx,
72     VABufferType               type,
73     uint32_t                   size,
74     uint32_t                   num_elements,
75     void                       *pData,
76     VABufferID                 *pBufId
77 );
78 
79 /*
80  * Create a configuration for the VP pipeline
81  * it passes in the attribute list that specifies the attributes it cares
82  * about, with the rest taking default values.
83  */
84 VAStatus DdiVp_CreateConfig(
85     VAProfile               profile,
86     VAEntrypoint            entrypoint,
87     VAConfigAttrib          *attrib_list,
88     int32_t                 num_attribs,
89     VAConfigID              *config_id
90 );
91 
92 VAStatus DdiVp_BeginPicture(
93         VADriverContextP    pVaDrvCtx,
94         VAContextID         vaCtxID,
95         VASurfaceID         vaSurfID
96 );
97 
98 VAStatus DdiVp_EndPicture(
99         VADriverContextP    pVaDrvCtx,
100         VAContextID         vaCtxID
101 );
102 
103 VAStatus DdiVp_RenderPicture(
104     VADriverContextP    pVaDrvCtx,
105     VAContextID         vpCtxID,
106     VABufferID*         buffers,
107     int32_t             num_buffers
108 );
109 
110 VAStatus DdiVp_VideoProcessPipeline(
111     VADriverContextP    pVaDrvCtx,
112     VAContextID         vpCtxID,
113     VASurfaceID         srcSurface,
114     VARectangle         *srcRect,
115     VASurfaceID         dstSurface,
116     VARectangle         *dstRect
117 );
118 
119 VAStatus DdiVp_QueryVideoProcFilterCaps(
120     VADriverContextP    ctx,
121     VAContextID         context,
122     int32_t             type,
123     void                *filter_caps,
124     uint32_t            *num_filter_caps
125 );
126 
127 VAStatus DdiVp_SetProcPipelineParams(
128     VADriverContextP                pVaDrvCtx,
129     PDDI_VP_CONTEXT                 pVpCtx,
130     VAProcPipelineParameterBuffer*  pPipelineParam
131 );
132 
133 PVPHAL_RENDER_PARAMS VpGetRenderParams(PDDI_VP_CONTEXT pVpCtx);
134 
135 PDDI_VP_CONTEXT DdiVp_GetVpContextFromContextID(VADriverContextP ctx, VAContextID vaCtxID);
136 
137 VAStatus DdiVp_SetGpuPriority(
138     PDDI_VP_CONTEXT     pVpCtx,
139     int32_t             priority
140 );
141 #endif //_MEDIA_LIBVA_VP_H_
142 
143