xref: /aosp_15_r20/external/intel-media-driver/media_driver/agnostic/gen12/hw/mhw_sfc_hwcmd_g12_X.cpp (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2015-2019, 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   mhw_sfc_hwcmd_g12_X.cpp
24 //! \brief  Auto-generated definitions for MHW commands and states.
25 //!
26 
27 #include "mhw_sfc_hwcmd_g12_X.h"
28 #include "mos_utilities.h"
29 
SFC_AVS_STATE_CMD()30 mhw_sfc_g12_X::SFC_AVS_STATE_CMD::SFC_AVS_STATE_CMD()
31 {
32     DW0.Value                                        = 0;
33     DW0.DwordLength                                  = GetOpLength(dwSize);
34     DW0.Subopcodeb                                   = SUBOPCODEB_SFCAVSSTATE;
35     DW0.Subopcodea                                   = SUBOPCODEA_COMMON;
36     DW0.MediaCommandOpcode                           = 0;
37     DW0.Pipeline                                     = PIPELINE_MEDIA;
38     DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
39 
40     DW1.Value                                        = 0;
41     DW1.SharpnessLevel                               = SHARPNESS_LEVEL_UNNAMED0;
42 
43     DW2.Value                                        = 0;
44 
45     DW3.Value                                        = 0;
46     DW3.InputVerticalSitingSpecifiesTheVerticalSitingOfTheInput = INPUT_VERTICAL_SITING_SPECIFIES_THE_VERTICAL_SITING_OF_THE_INPUT_0;
47     DW3.InputHorizontalSitingValueSpecifiesTheHorizontalSitingOfTheInput = INPUT_HORIZONTAL_SITING_VALUE_SPECIFIES_THE_HORIZONTAL_SITING_OF_THE_INPUT_0_FRACTIONININTEGER;
48 
49 }
50 
SFC_IEF_STATE_CMD()51 mhw_sfc_g12_X::SFC_IEF_STATE_CMD::SFC_IEF_STATE_CMD()
52 {
53     DW0.Value                                        = 0;
54     DW0.DwordLength                                  = GetOpLength(dwSize);
55     DW0.Subopcodeb                                   = SUBOPCODEB_SFCIEFSTATE;
56     DW0.Subopcodea                                   = SUBOPCODEA_COMMON;
57     DW0.MediaCommandOpcode                           = MEDIA_COMMAND_OPCODE_MEDIAMFXVEBOXSFCMODE;
58     DW0.Pipeline                                     = PIPELINE_MEDIA;
59     DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
60 
61     DW1.Value                                        = 0;
62     DW1.GainFactor                                   = GAIN_FACTOR_UNNAMED_4_4;
63     DW1.WeakEdgeThreshold                            = WEAK_EDGE_THRESHOLD_UNNAMED1;
64     DW1.StrongEdgeThreshold                          = STRONG_EDGE_THRESHOLD_UNNAMED8;
65     DW1.R3XCoefficient                               = R3X_COEFFICIENT_UNNAMED5;
66     DW1.R3CCoefficient                               = R3C_COEFFICIENT_UNNAMED5;
67 
68     DW2.Value                                        = 0;
69     DW2.GlobalNoiseEstimation                        = GLOBAL_NOISE_ESTIMATION_UNNAMED255;
70     DW2.NonEdgeWeight                                = NON_EDGE_WEIGHT_UNNAMED1;
71     DW2.RegularWeight                                = REGULAR_WEIGHT_UNNAMED2;
72     DW2.StrongEdgeWeight                             = STRONG_EDGE_WEIGHT_UNNAMED7;
73     DW2.R5XCoefficient                               = R5X_COEFFICIENT_UNNAMED7;
74     DW2.R5CxCoefficient                              = R5CX_COEFFICIENT_UNNAMED7;
75     DW2.R5CCoefficient                               = R5C_COEFFICIENT_UNNAMED7;
76 
77     DW3.Value                                        = 0;
78     DW3.SatMax                                       = SAT_MAX_UNNAMED31;
79     DW3.HueMax                                       = HUE_MAX_UNNAMED1_4;
80 
81     DW4.Value                                        = 0;
82     DW4.DiamondMargin                                = DIAMOND_MARGIN_UNNAMED_4;
83     DW4.UMid                                         = U_MID_UNNAMED110;
84     DW4.VMid                                         = V_MID_UNNAMED15_4;
85 
86     DW5.Value                                        = 0;
87     DW5.DiamondDv                                    = DIAMOND_DV_UNNAMED0;
88     DW5.DiamondTh                                    = DIAMOND_TH_UNNAMED35;
89     DW5.HsMargin                                     = HS_MARGIN_UNNAMED3;
90     DW5.DiamondDu                                    = DIAMOND_DU_UNNAMED0;
91     DW5.SkinDetailFactor                             = SKIN_DETAIL_FACTOR_DETAILREVEALED;
92 
93     DW6.Value                                        = 0;
94     DW6.YPoint1                                      = Y_POINT_1_UNNAMED_46;
95     DW6.YPoint2                                      = Y_POINT_2_UNNAMED_47;
96     DW6.YPoint3                                      = Y_POINT_3_UNNAMED25_4;
97     DW6.YPoint4                                      = Y_POINT_4_UNNAMED255;
98 
99     DW7.Value                                        = 0;
100 
101     DW8.Value                                        = 0;
102     DW8.P0L                                          = P0L_UNNAMED_46;
103     DW8.P1L                                          = P1L_UNNAMED216;
104 
105     DW9.Value                                        = 0;
106     DW9.P2L                                          = P2L_UNNAMED236;
107     DW9.P3L                                          = P3L_UNNAMED236;
108     DW9.B0L                                          = B0L_UNNAMED133;
109     DW9.B1L                                          = B1L_UNNAMED130;
110 
111     DW10.Value                                       = 0;
112     DW10.B2L                                         = B2L_UNNAMED130;
113     DW10.B3L                                         = B3L_UNNAMED130;
114 
115     DW11.Value                                       = 0;
116 
117     DW12.Value                                       = 0;
118     DW12.P0U                                         = P0U_UNNAMED_46;
119     DW12.P1U                                         = P1U_UNNAMED66;
120 
121     DW13.Value                                       = 0;
122     DW13.P2U                                         = P2U_UNNAMED150;
123     DW13.P3U                                         = P3U_UNNAMED236;
124     DW13.B0U                                         = B0U_UNNAMED1_43;
125     DW13.B1U                                         = B1U_UNNAMED163;
126 
127     DW14.Value                                       = 0;
128     DW14.B2U                                         = B2U_UNNAMED200;
129     DW14.B3U                                         = B3U_UNNAMED1_40;
130 
131     DW15.Value                                       = 0;
132 
133     DW16.Value                                       = 0;
134     DW16.C0                                          = C0_UNNAMED102_4;
135     DW16.C1                                          = C1_UNNAMED0;
136 
137     DW17.Value                                       = 0;
138     DW17.C2                                          = C2_UNNAMED0;
139     DW17.C3                                          = C3_UNNAMED0;
140 
141     DW18.Value                                       = 0;
142     DW18.C4                                          = C4_UNNAMED102_4;
143     DW18.C5                                          = C5_UNNAMED0;
144 
145     DW19.Value                                       = 0;
146     DW19.C6                                          = C6_UNNAMED0;
147     DW19.C7                                          = C7_UNNAMED0;
148 
149     DW20.Value                                       = 0;
150     DW20.C8                                          = C8_UNNAMED102_4;
151 
152     DW21.Value                                       = 0;
153     DW21.OffsetIn1                                   = OFFSET_IN_1_UNNAMED0;
154     DW21.OffsetOut1                                  = OFFSET_OUT_1_UNNAMED0;
155 
156     DW22.Value                                       = 0;
157     DW22.OffsetIn2                                   = OFFSET_IN_2_UNNAMED0;
158     DW22.OffsetOut2                                  = OFFSET_OUT_2_UNNAMED0;
159 
160     DW23.Value                                       = 0;
161     DW23.OffsetIn3                                   = OFFSET_IN_3_UNNAMED0;
162     DW23.OffsetOut3                                  = OFFSET_OUT_3_UNNAMED0;
163 
164 }
165 
SFC_FRAME_START_CMD()166 mhw_sfc_g12_X::SFC_FRAME_START_CMD::SFC_FRAME_START_CMD()
167 {
168     DW0.Value                                        = 0;
169     DW0.DwordLength                                  = GetOpLength(dwSize);
170     DW0.Subopcodeb                                   = SUBOPCODEB_SFCFRAMESTART;
171     DW0.Subopcodea                                   = SUBOPCODEA_COMMON;
172     DW0.MediaCommandOpcode                           = MEDIA_COMMAND_OPCODE_MEDIAMFXVEBOXSFCMODE;
173     DW0.Pipeline                                     = PIPELINE_MEDIA;
174     DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
175 
176     DW1.Value                                        = 0;
177 
178 }
179 
SFC_LOCK_CMD()180 mhw_sfc_g12_X::SFC_LOCK_CMD::SFC_LOCK_CMD()
181 {
182     DW0.Value                                        = 0;
183     DW0.DwordLength                                  = GetOpLength(dwSize);
184     DW0.Subopcodeb                                   = SUBOPCODEB_SFCLOCK;
185     DW0.Subopcodea                                   = SUBOPCODEA_COMMON;
186     DW0.MediaCommandOpcode                           = MEDIA_COMMAND_OPCODE_MEDIAMFXVEBOXSFCMODE;
187     DW0.Pipeline                                     = PIPELINE_MEDIA;
188     DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
189 
190     DW1.Value                                        = 0;
191 
192 }
193 
SFC_STATE_CMD()194 mhw_sfc_g12_X::SFC_STATE_CMD::SFC_STATE_CMD()
195 {
196     DW0.Value                                        = 0;
197     DW0.DwordLength                                  = GetOpLength(dwSize);
198     DW0.Subopcodeb                                   = SUBOPCODEB_SFCSTATE;
199     DW0.Subopcodea                                   = SUBOPCODEA_COMMON;
200     DW0.MediaCommandOpcode                           = 0;
201     DW0.Pipeline                                     = PIPELINE_MEDIA;
202     DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
203 
204     DW1.Value                                        = 0;
205     DW1.SfcPipeMode                                  = SFC_PIPE_MODE_UNNAMED0;
206     DW1.SfcInputChromaSubSampling                    = SFC_INPUT_CHROMA_SUB_SAMPLING_400;
207     DW1.VdVeInputOrderingMode                        = VDVE_INPUT_ORDERING_MODE_UNNAMED0;
208 
209     DW2.Value                                        = 0;
210 
211     DW3.Value                                        = 0;
212     DW3.OutputSurfaceFormatType                      = OUTPUT_SURFACE_FORMAT_TYPE_AYUV;
213     DW3.RgbaChannelSwapEnable                        = RGBA_CHANNEL_SWAP_ENABLE_UNNAMED0;
214     DW3.OutputChromaDownsamplingCoSitingPositionVerticalDirection = OUTPUT_CHROMA_DOWNSAMPLING_CO_SITING_POSITION_VERTICAL_DIRECTION_08_LEFTFULLPIXEL;
215     DW3.OutputChromaDownsamplingCoSitingPositionHorizontalDirection = OUTPUT_CHROMA_DOWNSAMPLING_CO_SITING_POSITION_HORIZONTAL_DIRECTION_08_LEFTFULLPIXEL;
216     DW3.InputColorSpace0Yuv1Rgb                      = INPUT_COLOR_SPACE_0_YUV1_RGB_YUVCOLORSPACE;
217 
218     DW4.Value                                        = 0;
219     DW4.IefEnable                                    = IEF_ENABLE_DISABLE;
220     DW4.Ief4SmoothEnable                             = IEF4SMOOTH_ENABLE_UNNAMED0;
221     DW4.AvsFilterMode                                = AVS_FILTER_MODE_5X5POLY_PHASEFILTERBILINEAR_ADAPTIVE;
222     DW4.AdaptiveFilterForAllChannels                 = ADAPTIVE_FILTER_FOR_ALL_CHANNELS_DISABLEADAPTIVEFILTERONUVRBCHANNELS;
223     DW4.AvsScalingEnable                             = AVS_SCALING_ENABLE_DISABLE;
224     DW4.BypassYAdaptiveFiltering                     = BYPASS_Y_ADAPTIVE_FILTERING_ENABLEYADAPTIVEFILTERING;
225     DW4.BypassXAdaptiveFiltering                     = BYPASS_X_ADAPTIVE_FILTERING_ENABLEXADAPTIVEFILTERING;
226     DW4.RotationMode                                 = ROTATION_MODE_0_DEGREES;
227     DW4.Bitdepth                                     = BITDEPTH_10BITFORMAT;
228 
229     DW5.Value                                        = 0;
230 
231     DW6.Value                                        = 0;
232 
233     DW7.Value                                        = 0;
234 
235     DW8.Value                                        = 0;
236 
237     DW9.Value                                        = 0;
238 
239     DW10.Value                                       = 0;
240 
241     DW11.Value                                       = 0;
242 
243     DW12.Value                                       = 0;
244 
245     DW13.Value                                       = 0;
246 
247     DW14.Value                                       = 0;
248     DW14.ScalingFactorHeight                         = SCALING_FACTOR_HEIGHT_UNNAMED0;
249 
250     DW15.Value                                       = 0;
251     DW15.ScalingFactorWidth                          = SCALING_FACTOR_WIDTH_UNNAMED0;
252 
253     DW16.Value                                       = 0;
254 
255     DW17.Value                                       = 0;
256 
257     DW18.Value                                       = 0;
258 
259     DW19.Value                                       = 0;
260     DW19.OutputFrameSurfaceBaseAddressMemoryCompressionMode = OUTPUT_FRAME_SURFACE_BASE_ADDRESS_MEMORY_COMPRESSION_MODE_VERTICALCOMPRESSION;
261     DW19.OutputFrameSurfaceBaseAddressRowStoreScratchBufferCacheSelect = OUTPUT_FRAME_SURFACE_BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_DISABLE;
262     DW19.OutputSurfaceTiledMode                      = OUTPUT_SURFACE_TILED_MODE_TRMODENONE;
263 
264     DW20.Value                                       = 0;
265 
266     DW21.Value                                       = 0;
267 
268     DW22.Value                                       = 0;
269     DW22.AvsLineBufferBaseAddressMemoryCompressionEnable = AVS_LINE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_ENABLE_DISABLE;
270     DW22.AvsLineBufferBaseAddressMemoryCompressionMode = AVS_LINE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_MODE_HORIZONTALCOMPRESSIONMODE;
271     DW22.AvsLineBufferBaseAddressRowStoreScratchBufferCacheSelect = AVS_LINE_BUFFER_BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_LLC;
272     DW22.AvsLineBufferTiledMode                      = AVS_LINE_BUFFER_TILED_MODE_TRMODENONE;
273 
274     DW23.Value                                       = 0;
275 
276     DW24.Value                                       = 0;
277 
278     DW25.Value                                       = 0;
279     DW25.IefLineBufferBaseAddressMemoryCompressionEnable = IEF_LINE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_ENABLE_DISABLE;
280     DW25.IefLineBufferBaseAddressMemoryCompressionMode = IEF_LINE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_MODE_UNNAMED0;
281     DW25.IefLineBufferBaseAddressRowStoreScratchBufferCacheSelect = IEF_LINE_BUFFER_BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_LLC;
282     DW25.IefLineBufferTiledMode                      = IEF_LINE_BUFFER_TILED_MODE_TRMODENONE;
283 
284     DW26.Value                                       = 0;
285 
286     DW27.Value                                       = 0;
287 
288     DW28.Value                                       = 0;
289     DW28.SfdLineBufferBaseAddressMemoryCompressionEnable = SFD_LINE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_ENABLE_DISABLE;
290     DW28.SfdLineBufferBaseAddressMemoryCompressionMode = SFD_LINE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_MODE_UNNAMED0;
291     DW28.SfdLineBufferBaseAddressRowStoreScratchBufferCacheSelect = SFD_LINE_BUFFER_BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_LLC;
292     DW28.SfdLineBufferTiledMode                      = SFD_LINE_BUFFER_TILED_MODE_TRMODENONE;
293 
294     DW29.Value                                       = 0;
295     DW29.OutputSurfaceTileWalk                       = OUTPUT_SURFACE_TILE_WALK_TILEWALKXMAJOR;
296     DW29.OutputSurfaceTiled                          = OUTPUT_SURFACE_TILED_FALSE;
297 
298     DW30.Value                                       = 0;
299 
300     DW31.Value                                       = 0;
301 
302     DW32.Value                                       = 0;
303 
304     DW33.Value                                       = 0;
305 
306     DW34.Value                                       = 0;
307 
308     DW35.Value                                       = 0;
309 
310     DW36.Value                                       = 0;
311 
312     DW37.Value                                       = 0;
313 
314     DW38.Value                                       = 0;
315 
316     DW39.Value                                       = 0;
317 
318     DW40.Value                                       = 0;
319     DW40.AvsLineTileBufferBaseAddressMemoryCompressionEnable = AVS_LINE_TILE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_ENABLE_DISABLE;
320     DW40.AvsLineTileBufferBaseAddressMemoryCompressionMode = AVS_LINE_TILE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_MODE_UNNAMED0;
321     DW40.AvsLineTileBufferBaseAddressRowStoreScratchBufferCacheSelect = AVS_LINE_TILE_BUFFER_BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_LLC;
322     DW40.AvsLineTileBufferTiledMode                  = AVS_LINE_TILE_BUFFER_TILED_MODE_TRMODENONE;
323 
324     DW41.Value                                       = 0;
325 
326     DW42.Value                                       = 0;
327 
328     DW43.Value                                       = 0;
329     DW43.IefLineTileBufferBaseAddressMemoryCompressionEnable = IEF_LINE_TILE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_ENABLE_DISABLE;
330     DW43.IefLineTileBufferBaseAddressMemoryCompressionMode = IEF_LINE_TILE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_MODE_UNNAMED0;
331     DW43.IefLineTileBufferBaseAddressRowStoreScratchBufferCacheSelect = IEF_LINE_TILE_BUFFER_BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_LLC;
332     DW43.IefLineTileBufferTiledMode                  = IEF_LINE_TILE_BUFFER_TILED_MODE_TRMODENONE;
333 
334     DW44.Value                                       = 0;
335 
336     DW45.Value                                       = 0;
337 
338     DW46.Value                                       = 0;
339     DW46.SfdLineTileBufferBaseAddressMemoryCompressionEnable = SFD_LINE_TILE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_ENABLE_DISABLE;
340     DW46.SfdLineTileBufferBaseAddressMemoryCompressionMode = SFD_LINE_TILE_BUFFER_BASE_ADDRESS_MEMORY_COMPRESSION_MODE_UNNAMED0;
341     DW46.SfdLineTileBufferBaseAddressRowStoreScratchBufferCacheSelect = SFD_LINE_TILE_BUFFER_BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_LLC;
342     DW46.SfdLineTileBufferTiledMode                  = SFD_LINE_TILE_BUFFER_TILED_MODE_TRMODENONE;
343 
344     DW47.Value                                       = 0;
345     DW48.Value                                       = 0;
346     DW49.Value                                       = 0;
347 }
348 
SFC_AVS_LUMA_Coeff_Table_CMD()349 mhw_sfc_g12_X::SFC_AVS_LUMA_Coeff_Table_CMD::SFC_AVS_LUMA_Coeff_Table_CMD()
350 {
351     DW0.Value                                        = 0;
352     DW0.DwordLength                                  = GetOpLength(dwSize);
353     DW0.Subopcodeb                                   = SUBOPCODEB_SFCAVSLUMACOEFFTABLE;
354     DW0.Subopcodea                                   = SUBOPCODEA_COMMON;
355     DW0.MediaCommandOpcode                           = MEDIA_COMMAND_OPCODE_MEDIAMFXVEBOXSFCMODE;
356     DW0.Pipeline                                     = PIPELINE_MEDIA;
357     DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
358 
359     DW1.Value                                        = 0;
360 
361     DW2.Value                                        = 0;
362 
363     DW3.Value                                        = 0;
364 
365     DW4.Value                                        = 0;
366 
367     MOS_ZeroMemory(&FilterCoefficients, sizeof(FilterCoefficients));
368 }
369 
SFC_AVS_CHROMA_Coeff_Table_CMD()370 mhw_sfc_g12_X::SFC_AVS_CHROMA_Coeff_Table_CMD::SFC_AVS_CHROMA_Coeff_Table_CMD()
371 {
372     DW0.Value                                        = 0;
373     DW0.DwordLength                                  = GetOpLength(dwSize);
374     DW0.Subopcodeb                                   = SUBOPCODEB_SFCAVSCHROMACOEFFTABLE;
375     DW0.Subopcodea                                   = SUBOPCODEA_COMMON;
376     DW0.MediaCommandOpcode                           = MEDIA_COMMAND_OPCODE_MEDIAMFXVEBOXSFCMODE;
377     DW0.Pipeline                                     = PIPELINE_MEDIA;
378     DW0.CommandType                                  = COMMAND_TYPE_PARALLELVIDEOPIPE;
379 
380     DW1.Value                                        = 0;
381 
382     DW2.Value                                        = 0;
383 
384     MOS_ZeroMemory(&FilterCoefficients, sizeof(FilterCoefficients));
385 }
386 
387