Debian Codegraph @

media_driver/media_interface/media_interfaces_m11_icllp/media_interfaces_g11_icllp.cpp

raw
1 /*
2 * Copyright (c) 2017-2020, 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_interfaces_g11_icllp.cpp
24 //! \brief Helps with ICLLP factory creation.
25 //!
26
27 #include "media_interfaces_g11_icllp.h"
28 #include "codechal_encoder_base.h"
29 #if defined(ENABLE_KERNELS) && !defined(_FULL_OPEN_SOURCE)
30 #include "igcodeckrn_g11.h"
31 #endif
32
33 extern template class MediaFactory<uint32_t, MhwInterfaces>;
34 extern template class MediaFactory<uint32_t, MmdDevice>;
35 extern template class MediaFactory<uint32_t, CodechalDevice>;
36
37 extern template class MediaFactory<uint32_t, CMHalDevice>;
38
39 extern template class MediaFactory<uint32_t, VphalDevice>;
40 extern template class MediaFactory<uint32_t, RenderHalDevice>;
41 extern template class MediaFactory<uint32_t, Nv12ToP010Device>;
42 extern template class MediaFactory<uint32_t, DecodeHistogramDevice>;
43
44 static bool icllpRegisteredVphal =
45 MediaFactory<uint32_t, VphalDevice>::
46 Register<VphalInterfacesG11Icllp>((uint32_t)IGFX_ICELAKE_LP);
47
48 MOS_STATUS VphalInterfacesG11Icllp::Initialize(
49 PMOS_INTERFACE osInterface,
50 bool bInitVphalState,
51 MOS_STATUS *eStatus,
52 bool clearViewMode)
53 {
54 m_vpBase = MOS_New(
55 VphalState,
56 osInterface,
57 eStatus);
58
59 return *eStatus;
60 }
61
62 static bool icllpRegisteredMhw =
63 MediaFactory<uint32_t, MhwInterfaces>::
64 Register<MhwInterfacesG11Icllp>((uint32_t)IGFX_ICELAKE_LP);
65
66 #define PLATFORM_INTEL_ICLLP 13
67 #define GENX_ICLLP 10
68
69 MOS_STATUS MhwInterfacesG11Icllp::Initialize(
70 CreateParams params,
71 PMOS_INTERFACE osInterface)
72 {
73 if (osInterface == nullptr)
74 {
75 MHW_ASSERTMESSAGE("The OS interface is not valid!");
76 return MOS_STATUS_INVALID_PARAMETER;
77 }
78
79 auto gtSystemInfo = osInterface->pfnGetGtSystemInfo(osInterface);
80 if (gtSystemInfo == nullptr)
81 {
82 MHW_ASSERTMESSAGE("The OS interface is not valid!");
83 return MOS_STATUS_INVALID_PARAMETER;
84 }
85
86 if ((params.m_isCp == false) && (params.Flags.m_value == 0))
87 {
88 MHW_ASSERTMESSAGE("No MHW interfaces were requested for creation.");
89 return MOS_STATUS_INVALID_PARAMETER;
90 }
91
92 // MHW_CP and MHW_MI must always be created
93 MOS_STATUS status = MOS_STATUS_SUCCESS;
94 m_cpInterface = osInterface->pfnCreateMhwCpInterface(osInterface);
95 if(m_cpInterface == nullptr)
96 {
97 MOS_OS_ASSERTMESSAGE("new osInterface failed");
98 status = MOS_STATUS_NULL_POINTER;
99 goto finish;
100 }
101 m_miInterface = MOS_New(Mi, m_cpInterface, osInterface);
102 if (m_miInterface == nullptr)
103 {
104 MOS_OS_ASSERTMESSAGE("new MI interface failed");
105 status = MOS_STATUS_NULL_POINTER;
106 goto finish;
107 }
108
109 if (params.Flags.m_render)
110 {
111 m_renderInterface =
112 MOS_New(Render, m_miInterface, osInterface, gtSystemInfo, params.m_heapMode);
113 if (m_renderInterface == nullptr || m_renderInterface->m_stateHeapInterface == nullptr)
114 {
115 MOS_OS_ASSERTMESSAGE("new m_renderInterface failed");
116 status = MOS_STATUS_NULL_POINTER;
117 goto finish;
118 }
119 }
120 if (params.Flags.m_stateHeap)
121 {
122 m_stateHeapInterface =
123 MOS_New(StateHeap, osInterface, params.m_heapMode);
124 if (m_stateHeapInterface == nullptr)
125 {
126 MOS_OS_ASSERTMESSAGE("new m_stateHeapInterface failed");
127 status = MOS_STATUS_NULL_POINTER;
128 goto finish;
129 }
130 }
131 if (params.Flags.m_sfc)
132 {
133 m_sfcInterface = MOS_New(Sfc, osInterface);
134 if (m_sfcInterface == nullptr)
135 {
136 MOS_OS_ASSERTMESSAGE("new m_sfcInterface failed");
137 status = MOS_STATUS_NULL_POINTER;
138 goto finish;
139 }
140 }
141 if (params.Flags.m_vebox)
142 {
143 m_veboxInterface = MOS_New(Vebox, osInterface);
144 if (m_veboxInterface == nullptr)
145 {
146 MOS_OS_ASSERTMESSAGE("new m_veboxInterface failed");
147 status = MOS_STATUS_NULL_POINTER;
148 goto finish;
149 }
150 }
151
152 if (params.Flags.m_vdboxAll || params.Flags.m_mfx)
153 {
154 m_mfxInterface =
155 MOS_New(Mfx, osInterface, m_miInterface, m_cpInterface, params.m_isDecode);
156 if (m_mfxInterface == nullptr)
157 {
158 MOS_OS_ASSERTMESSAGE("new m_mfxInterface failed");
159 status = MOS_STATUS_NULL_POINTER;
160 goto finish;
161 }
162 }
163 if (params.Flags.m_vdboxAll || params.Flags.m_hcp)
164 {
165 m_hcpInterface =
166 MOS_New(Hcp, osInterface, m_miInterface, m_cpInterface, params.m_isDecode);
167 if (m_hcpInterface == nullptr)
168 {
169 MOS_OS_ASSERTMESSAGE("new m_hcpInterface failed");
170 status = MOS_STATUS_NULL_POINTER;
171 goto finish;
172 }
173 }
174 if (params.Flags.m_vdboxAll || params.Flags.m_huc)
175 {
176 m_hucInterface = MOS_New(Huc, osInterface, m_miInterface, m_cpInterface);
177 if (m_hucInterface == nullptr)
178 {
179 MOS_OS_ASSERTMESSAGE("new m_hucInterface failed");
180 status = MOS_STATUS_NULL_POINTER;
181 goto finish;
182 }
183 }
184 if (params.Flags.m_vdboxAll || params.Flags.m_vdenc)
185 {
186 m_vdencInterface = MOS_New(Vdenc, osInterface);
187 if (m_vdencInterface == nullptr)
188 {
189 MOS_OS_ASSERTMESSAGE("new m_vdencInterface failed");
190 status = MOS_STATUS_NULL_POINTER;
191 goto finish;
192 }
193 }
194
195 finish:
196 if (status != MOS_STATUS_SUCCESS)
197 {
198 Destroy();
199 }
200 return status;
201 }
202
203 static bool icllpRegisteredMmd =
204 MediaFactory<uint32_t, MmdDevice>::
205 Register<MmdDeviceG11Icllp>((uint32_t)IGFX_ICELAKE_LP);
206
207 MOS_STATUS MmdDeviceG11Icllp::Initialize(
208 PMOS_INTERFACE osInterface,
209 MhwInterfaces *mhwInterfaces)
210 {
211 #define MMD_FAILURE() \
212 { \
213 if (device != nullptr) \
214 { \
215 MOS_Delete(device); \
216 } \
217 return MOS_STATUS_NO_SPACE; \
218 }
219 MHW_FUNCTION_ENTER;
220
221 MhwMiInterface *miInterface = nullptr;
222 MhwRenderInterface *renderInterface = nullptr;
223 Mmd *device = nullptr;
224
225 if (mhwInterfaces->m_miInterface == nullptr)
226 {
227 MMD_FAILURE();
228 }
229 miInterface = mhwInterfaces->m_miInterface;
230
231 if (mhwInterfaces->m_renderInterface == nullptr)
232 {
233 MMD_FAILURE();
234 }
235 renderInterface = mhwInterfaces->m_renderInterface;
236
237 device = MOS_New(Mmd);
238
239 if (device == nullptr)
240 {
241 MMD_FAILURE();
242 }
243
244 if (device->Initialize(
245 osInterface,
246 mhwInterfaces->m_cpInterface,
247 miInterface,
248 renderInterface) != MOS_STATUS_SUCCESS)
249 {
250 MMD_FAILURE();
251 }
252
253 m_mmdDevice = device;
254
255 return MOS_STATUS_SUCCESS;
256 }
257
258 static bool icllpRegisteredNv12ToP010 =
259 MediaFactory<uint32_t, Nv12ToP010Device>::
260 Register<Nv12ToP010DeviceG11Icllp>((uint32_t)IGFX_ICELAKE_LP);
261
262 MOS_STATUS Nv12ToP010DeviceG11Icllp::Initialize(
263 PMOS_INTERFACE osInterface)
264 {
265 CODECHAL_PUBLIC_ASSERTMESSAGE("Not support Nv12 to P010 interfaces.")
266
267 return MOS_STATUS_INVALID_PARAMETER;
268 }
269
270 static bool icllpRegisteredCodecHal =
271 MediaFactory<uint32_t, CodechalDevice>::
272 Register<CodechalInterfacesG11Icllp>((uint32_t)IGFX_ICELAKE_LP);
273
274 MOS_STATUS CodechalInterfacesG11Icllp::Initialize(
275 void *standardInfo,
276 void *settings,
277 MhwInterfaces *mhwInterfaces,
278 PMOS_INTERFACE osInterface)
279 {
280 if (standardInfo == nullptr ||
281 mhwInterfaces == nullptr ||
282 osInterface == nullptr)
283 {
284 CODECHAL_PUBLIC_ASSERTMESSAGE("CodecHal device is not valid!");
285 return MOS_STATUS_INVALID_PARAMETER;
286 }
287 PCODECHAL_STANDARD_INFO info = ((PCODECHAL_STANDARD_INFO)standardInfo);
288 CODECHAL_FUNCTION CodecFunction = info->CodecFunction;
289
290 CodechalHwInterface *hwInterface = MOS_New(Hw, osInterface, CodecFunction, mhwInterfaces);
291
292 if (hwInterface == nullptr)
293 {
294 CODECHAL_PUBLIC_ASSERTMESSAGE("hwInterface is not valid!");
295 return MOS_STATUS_NO_SPACE;
296 }
297 hwInterface->m_slicePowerGate = true;
298
299 #if USE_CODECHAL_DEBUG_TOOL
300 CodechalDebugInterface *debugInterface = MOS_New(CodechalDebugInterface);
301 if (debugInterface == nullptr)
302 {
303 MOS_Delete(hwInterface);
304 mhwInterfaces->SetDestroyState(true);
305 CODECHAL_PUBLIC_ASSERTMESSAGE("debugInterface is not valid!");
306 return MOS_STATUS_NO_SPACE;
307 }
308 if (debugInterface->Initialize(hwInterface, CodecFunction) != MOS_STATUS_SUCCESS)
309 {
310 MOS_Delete(hwInterface);
311 mhwInterfaces->SetDestroyState(true);
312 MOS_Delete(debugInterface);
313 CODECHAL_PUBLIC_ASSERTMESSAGE("Debug interface creation failed!");
314 return MOS_STATUS_INVALID_PARAMETER;
315 }
316 #else
317 CodechalDebugInterface *debugInterface = nullptr;
318 #endif // USE_CODECHAL_DEBUG_TOOL
319
320 if (CodecHalIsDecode(CodecFunction))
321 {
322 #ifdef _MPEG2_DECODE_SUPPORTED
323 if (info->Mode == CODECHAL_DECODE_MODE_MPEG2IDCT ||
324 info->Mode == CODECHAL_DECODE_MODE_MPEG2VLD)
325 {
326 m_codechalDevice = MOS_New(Decode::Mpeg2, hwInterface, debugInterface, info);
327 }
328 else
329 #endif
330 #ifdef _VC1_DECODE_SUPPORTED
331 if (info->Mode == CODECHAL_DECODE_MODE_VC1IT ||
332 info->Mode == CODECHAL_DECODE_MODE_VC1VLD)
333 {
334 m_codechalDevice = MOS_New(Decode::Vc1, hwInterface, debugInterface, info);
335 }
336 else
337 #endif
338 #ifdef _AVC_DECODE_SUPPORTED
339 if (info->Mode == CODECHAL_DECODE_MODE_AVCVLD)
340 {
341 m_codechalDevice = MOS_New(Decode::Avc, hwInterface, debugInterface, info);
342
343 if (m_codechalDevice == nullptr)
344 {
345 CODECHAL_PUBLIC_ASSERTMESSAGE("Failed to create decode device!");
346 return MOS_STATUS_NO_SPACE;
347 }
348 #ifdef _DECODE_PROCESSING_SUPPORTED
349 if (settings != nullptr && ((CodechalSetting *)settings)->downsamplingHinted)
350 {
351 CodechalDecode *decoder = dynamic_cast<CodechalDecode *>(m_codechalDevice);
352 if (decoder == nullptr)
353 {
354 CODECHAL_PUBLIC_ASSERTMESSAGE("Failed to create decode device!");
355 return MOS_STATUS_NO_SPACE;
356 }
357 FieldScalingInterface *fieldScalingInterface =
358 MOS_New(Decode::FieldScaling, hwInterface);
359 if (fieldScalingInterface == nullptr)
360 {
361 CODECHAL_PUBLIC_ASSERTMESSAGE("Failed to create field scaling interface!");
362 return MOS_STATUS_NO_SPACE;
363 }
364 decoder->m_fieldScalingInterface = fieldScalingInterface;
365 }
366 #endif
367 }
368 else
369 #endif
370 #ifdef _JPEG_DECODE_SUPPORTED
371 if (info->Mode == CODECHAL_DECODE_MODE_JPEG)
372 {
373 m_codechalDevice = MOS_New(Decode::Jpeg, hwInterface, debugInterface, info);
374 }
375 else
376 #endif
377 #ifdef _VP8_DECODE_SUPPORTED
378 if (info->Mode == CODECHAL_DECODE_MODE_VP8VLD)
379 {
380 m_codechalDevice = MOS_New(Decode::Vp8, hwInterface, debugInterface, info);
381 }
382 else
383 #endif
384 #ifdef _HEVC_DECODE_SUPPORTED
385 if (info->Mode == CODECHAL_DECODE_MODE_HEVCVLD)
386 {
387 m_codechalDevice = MOS_New(Decode::Hevc, hwInterface, debugInterface, info);
388 }
389 else
390 #endif
391 #ifdef _VP9_DECODE_SUPPORTED
392 if (info->Mode == CODECHAL_DECODE_MODE_VP9VLD)
393 {
394 m_codechalDevice = MOS_New(Decode::Vp9, hwInterface, debugInterface, info);
395 }
396 else
397 #endif
398 {
399 CODECHAL_PUBLIC_ASSERTMESSAGE("Decode mode requested invalid!");
400 return MOS_STATUS_INVALID_PARAMETER;
401 }
402
403 if (m_codechalDevice == nullptr)
404 {
405 MOS_Delete(hwInterface);
406 mhwInterfaces->SetDestroyState(true);
407 #if USE_CODECHAL_DEBUG_TOOL
408 MOS_Delete(debugInterface);
409 #endif
410 CODECHAL_PUBLIC_ASSERTMESSAGE("Decoder device creation failed!");
411 return MOS_STATUS_NO_SPACE;
412 }
413 }
414 else if (CodecHalIsEncode(CodecFunction))
415 {
416 CodechalEncoderState *encoder = nullptr;
417
418 #if defined (_AVC_ENCODE_VME_SUPPORTED) || defined (_AVC_ENCODE_VDENC_SUPPORTED)
419 if (info->Mode == CODECHAL_ENCODE_MODE_AVC)
420 {
421 if (CodecHalUsesVdencEngine(info->CodecFunction))
422 {
423 #ifdef _AVC_ENCODE_VDENC_SUPPORTED
424 encoder = MOS_New(Encode::AvcVdenc, hwInterface, debugInterface, info);
425 #endif
426 }
427 else
428 {
429 #ifdef _AVC_ENCODE_VME_SUPPORTED
430 encoder = MOS_New(Encode::AvcEnc, hwInterface, debugInterface, info);
431 #endif
432 }
433 if (encoder == nullptr)
434 {
435 CODECHAL_PUBLIC_ASSERTMESSAGE("Encode state creation failed!");
436 return MOS_STATUS_INVALID_PARAMETER;
437 }
438 else
439 {
440 m_codechalDevice = encoder;
441 }
442 }
443 else
444 #endif
445 #ifdef _VP9_ENCODE_VDENC_SUPPORTED
446 if (info->Mode == CODECHAL_ENCODE_MODE_VP9)
447 {
448 encoder = MOS_New(Encode::Vp9, hwInterface, debugInterface, info);
449 if (encoder == nullptr)
450 {
451 CODECHAL_PUBLIC_ASSERTMESSAGE("Encode state creation failed!");
452 return MOS_STATUS_INVALID_PARAMETER;
453 }
454 else
455 {
456 m_codechalDevice = encoder;
457 }
458
459 }
460 else
461 #endif
462 #ifdef _JPEG_ENCODE_SUPPORTED
463 if (info->Mode == CODECHAL_ENCODE_MODE_JPEG)
464 {
465 encoder = MOS_New(Encode::Jpeg, hwInterface, debugInterface, info);
466 if (encoder == nullptr)
467 {
468 CODECHAL_PUBLIC_ASSERTMESSAGE("Encode state creation failed!");
469 return MOS_STATUS_INVALID_PARAMETER;
470 }
471 else
472 {
473 m_codechalDevice = encoder;
474 }
475 encoder->m_vdboxOneDefaultUsed = true;
476 }
477 else
478 #endif
479 #ifdef _MPEG2_ENCODE_VME_SUPPORTED
480 if (info->Mode == CODECHAL_ENCODE_MODE_MPEG2)
481 {
482 // Setup encode interface functions
483 encoder = MOS_New(Encode::Mpeg2, hwInterface, debugInterface, info);
484 if (encoder == nullptr)
485 {
486 CODECHAL_PUBLIC_ASSERTMESSAGE("Encode allocation failed!");
487 return MOS_STATUS_INVALID_PARAMETER;
488 }
489 else
490 {
491 m_codechalDevice = encoder;
492 }
493
494 encoder->m_kernelBase = (uint8_t*)IGCODECKRN_G11;
495 }
496 else
497 #endif
498 #if defined (_HEVC_ENCODE_VME_SUPPORTED) || defined (_HEVC_ENCODE_VDENC_SUPPORTED)
499 if (info->Mode == CODECHAL_ENCODE_MODE_HEVC)
500 {
501 if (CodecHalUsesVdencEngine(info->CodecFunction))
502 {
503 #ifdef _HEVC_ENCODE_VDENC_SUPPORTED
504 encoder = MOS_New(Encode::HevcVdenc, hwInterface, debugInterface, info);
505 #endif
506 }
507 else
508 {
509 #ifdef _HEVC_ENCODE_VME_SUPPORTED
510 encoder = MOS_New(Encode::HevcEnc, hwInterface, debugInterface, info);
511 #endif
512 }
513
514 if (encoder == nullptr)
515 {
516 CODECHAL_PUBLIC_ASSERTMESSAGE("Encode state creation failed!");
517 return MOS_STATUS_INVALID_PARAMETER;
518 }
519 else
520 {
521 m_codechalDevice = encoder;
522 }
523
524 #if defined(ENABLE_KERNELS) && !defined(_FULL_OPEN_SOURCE)
525 encoder->m_kernelBase = (uint8_t*)IGCODECKRN_G11;
526 #endif
527 }
528 else
529 #endif
530 #ifdef _VP8_ENCODE_SUPPORTED
531 if (info->Mode == CODECHAL_ENCODE_MODE_VP8)
532 {
533 encoder = MOS_New(Encode::Vp8, hwInterface, debugInterface, info);
534 if (encoder == nullptr)
535 {
536 CODECHAL_PUBLIC_ASSERTMESSAGE("VP8 Encode allocation failed!");
537 return MOS_STATUS_INVALID_PARAMETER;
538 }
539 else
540 {
541 m_codechalDevice = encoder;
542 }
543 }
544 else
545 #endif
546 {
547 CODECHAL_PUBLIC_ASSERTMESSAGE("Unsupported encode function requested.");
548 return MOS_STATUS_INVALID_PARAMETER;
549 }
550
551 #if defined(ENABLE_KERNELS)
552
553 #if defined(_FULL_OPEN_SOURCE)
554 if (info->Mode == CODECHAL_ENCODE_MODE_AVC)
555 #else
556 if (info->Mode != CODECHAL_ENCODE_MODE_JPEG)
557 #endif
558 {
559 // Create CSC and Downscaling interface
560 if ((encoder->m_cscDsState = MOS_New(Encode::CscDs, encoder)) == nullptr)
561 {
562 return MOS_STATUS_INVALID_PARAMETER;
563 }
564 }
565 #endif
566 }
567 else
568 {
569 CODECHAL_PUBLIC_ASSERTMESSAGE("Unsupported codec function requested.");
570 return MOS_STATUS_INVALID_PARAMETER;
571 }
572
573 return MOS_STATUS_SUCCESS;
574 }
575
576 #if !__BSD__
577 static bool icllpRegisteredCMHal =
578 MediaFactory<uint32_t, CMHalDevice>::
579 Register<CMHalInterfacesG11Icllp>((uint32_t)IGFX_ICELAKE_LP);
580
581 MOS_STATUS CMHalInterfacesG11Icllp::Initialize(CM_HAL_STATE *pCmState)
582 {
583 if (pCmState == nullptr)
584 {
585 MHW_ASSERTMESSAGE("pCmState is nullptr.")
586 return MOS_STATUS_INVALID_PARAMETER;
587 }
588
589 m_cmhalDevice = MOS_New(CMHal, pCmState);
590 if (m_cmhalDevice == nullptr)
591 {
592 MHW_ASSERTMESSAGE("Create CM Hal interfaces failed.")
593 return MOS_STATUS_NO_SPACE;
594 }
595
596 m_cmhalDevice->SetGenPlatformInfo(PLATFORM_INTEL_ICLLP, PLATFORM_INTEL_GT2, "ICLLP");
597 uint32_t cisaID = GENX_ICLLP;
598 m_cmhalDevice->AddSupportedCisaIDs(&cisaID);
599 m_cmhalDevice->SetOverridePowerOptionPerGpuContext(true);
600 m_cmhalDevice->SetRequestShutdownSubslicesForVmeUsage(true);
601 m_cmhalDevice->SetDecompressFlag(true);
602 return MOS_STATUS_SUCCESS;
603 }
604 #endif
605
606 static bool icllpRegisteredRenderHal =
607 MediaFactory<uint32_t, RenderHalDevice>::
608 Register<RenderHalInterfacesG11Icllp>((uint32_t)IGFX_ICELAKE_LP);
609
610 MOS_STATUS RenderHalInterfacesG11Icllp::Initialize()
611 {
612 m_renderhalDevice = MOS_New(XRenderHal);
613 if (m_renderhalDevice == nullptr)
614 {
615 MHW_ASSERTMESSAGE("Create Render Hal interfaces failed.")
616 return MOS_STATUS_NO_SPACE;
617 }
618 return MOS_STATUS_SUCCESS;
619 }
620
621 static bool icllpRegisteredDecodeHistogram =
622 MediaFactory<uint32_t, DecodeHistogramDevice>::
623 Register<DecodeHistogramDeviceG11Icllp>((uint32_t)IGFX_ICELAKE_LP);
624
625 MOS_STATUS DecodeHistogramDeviceG11Icllp::Initialize(
626 CodechalHwInterface *hwInterface,
627 PMOS_INTERFACE osInterface)
628 {
629 m_decodeHistogramDevice = MOS_New(DecodeHistogramVebox, hwInterface, osInterface);
630
631 if (m_decodeHistogramDevice == nullptr)
632 {
633 MHW_ASSERTMESSAGE("Create vebox decode histogram interfaces failed.")
634 return MOS_STATUS_NO_SPACE;
635 }
636
637 return MOS_STATUS_SUCCESS;
638 }
639
640 #define IP_VERSION_M11_0 0x1100
641 static bool iclRegisteredHwInfo =
642 MediaFactory<uint32_t, MediaInterfacesHwInfoDevice>::Register<MediaInterfacesHwInfoDeviceG11Icllp>((uint32_t)IGFX_ICELAKE_LP);
643
644 MOS_STATUS MediaInterfacesHwInfoDeviceG11Icllp::Initialize(PLATFORM platform)
645 {
646 m_hwInfo.SetDeviceInfo(IP_VERSION_M11_0, platform.usRevId);
647 return MOS_STATUS_SUCCESS;
648 }
649