diff --git a/media_common/agnostic/common/vp/hal/vp_common_defs.h b/media_common/agnostic/common/vp/hal/vp_common_defs.h index 33db1bd3fb0..5ed83dce766 100644 --- a/media_common/agnostic/common/vp/hal/vp_common_defs.h +++ b/media_common/agnostic/common/vp/hal/vp_common_defs.h @@ -186,6 +186,7 @@ enum VpKernelID kernelL0FcCommon, kernelL0FcFP, + kernelL0Fc444PL3Input, baseKernelMaxNumID }; diff --git a/media_softlet/agnostic/Xe_R/Xe2_HPG/vp/kernel/igvpfc_444PL3_input_xe2.cpp b/media_softlet/agnostic/Xe_R/Xe2_HPG/vp/kernel/igvpfc_444PL3_input_xe2.cpp new file mode 100644 index 00000000000..ebe6914d9fd --- /dev/null +++ b/media_softlet/agnostic/Xe_R/Xe2_HPG/vp/kernel/igvpfc_444PL3_input_xe2.cpp @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2024, Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * 'Software'), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +//////////////////////////////////////////////////////////////////////////////// +// !!! WARNING - AUTO GENERATED FILE. DO NOT EDIT DIRECTLY. !!! +// Generated by KernelBinToSource.exe tool +//////////////////////////////////////////////////////////////////////////////// + +#if !defined(MEDIA_BIN_DLL) +#include "vp_platform_interface.h" +#include "vp_render_common.h" +#endif +#include "igvpfc_444PL3_input_xe2.h" + +#if defined(MEDIA_BIN_SUPPORT) && !defined(MEDIA_BIN_DLL) + +unsigned int IGVPFC_444PL3_INPUT_GENERATION_XE2_SIZE = 0; +unsigned int *IGVPFC_444PL3_INPUT_GENERATION_XE2 = nullptr; +static bool getIGVPFC_444PL3_INPUT_XE2 = LoadMediaBin(IGVPFC_444PL3_INPUT_GENERATION_XE2_NAME, &IGVPFC_444PL3_INPUT_GENERATION_XE2_SIZE, &IGVPFC_444PL3_INPUT_GENERATION_XE2); + +#endif // defined(MEDIA_BIN_SUPPORT) && !defined(MEDIA_BIN_DLL) + +#if !defined(MEDIA_BIN_DLL) +void AddVpNativeKernelEntryToListFc_444pl3_inputXe2(vp::VpPlatformInterface &vpPlatformInterface) +{ + vp::KRN_ARG IMAGEREAD_CURBE[] = + { + {FC_444PL3_INPUT_IMAGEREAD_INPUTINDEX, 0, 0, 16, vp::ARG_KIND_GENERAL, false, vp::AddressingModeStateful}, + {FC_444PL3_INPUT_IMAGEREAD_OUTPUTINDEX, 16, 0, 16, vp::ARG_KIND_GENERAL, false, vp::AddressingModeStateful}, + {FC_444PL3_INPUT_IMAGEREAD_PLANEINDEX, 32, 0, 4, vp::ARG_KIND_GENERAL, false, vp::AddressingModeStateful}, + {FC_444PL3_INPUT_IMAGEREAD_ENQUEUED_LOCAL_SIZE, 36, 0, 12, vp::ARG_KIND_GENERAL, false, vp::AddressingModeStateful}, + {FC_444PL3_INPUT_IMAGEREAD_GLOBAL_ID_OFFSET, 0, 0, 12, vp::ARG_KIND_INLINE}, + {FC_444PL3_INPUT_IMAGEREAD_LOCAL_SIZE, 12, 0, 12, vp::ARG_KIND_INLINE}, + }; + + vp::KRN_EXECUTE_ENV IMAGEREAD_PARAM = + { + 0, //barrier_count + true, //disable_mid_thread_preemption + 128, //grf_count + false, //has_global_atomics + true, //has_no_stateless_write + 32, //inline_data_payload_size + 192, //offset_to_skip_per_thread_data_load + 32, //simd_size + true, //subgroup_independent_forward_progress + 8, //eu_thread_count + false, //has_fence_for_image_access + false, //has_sample + true, //has_4gb_buffers + { 0, 0, 0 }, //work_group_walk_order_dimensions + 0, //private_size + 0 //slm_size + }; + + vp::KRN_BTI IMAGEREAD_BTI[] = + { + {FC_444PL3_INPUT_IMAGEREAD_INPUTPLANE0, 0}, + {FC_444PL3_INPUT_IMAGEREAD_INPUTPLANE1, 1}, + {FC_444PL3_INPUT_IMAGEREAD_INPUTPLANE2, 2}, + {FC_444PL3_INPUT_IMAGEREAD_OUTPUTPLANE, 3}, + }; + + vpPlatformInterface.InitVpDelayedNativeAdvKernel((uint32_t *)((uint8_t *)IGVPFC_444PL3_INPUT_GENERATION_XE2 + 0), 3648, IMAGEREAD_CURBE, 6, 48, IMAGEREAD_PARAM, IMAGEREAD_BTI, 4, "ImageRead_fc_444PL3_input"); + +} +#endif + +#if !defined(MEDIA_BIN_SUPPORT) || defined(MEDIA_BIN_DLL) +DEFINE_SHARED_ARRAY_SIZE_UINT32(IGVPFC_444PL3_INPUT_GENERATION_XE2_SIZE, 3648); +extern const unsigned int IGVPFC_444PL3_INPUT_GENERATION_XE2[] = +{ + 0x80100061, 0x7f054220, 0x00000000, 0x00000000, 0x80000065, 0x7f258220, 0x02000004, 0xffffffc0, + 0x80000065, 0x7f058110, 0x01000024, 0x00ff00ff, 0x80001a40, 0x7f258220, 0x02007f24, 0x00000040, + 0x80001940, 0x7f258220, 0x02007f24, 0x00000000, 0x8000195b, 0x7f048220, 0x01017f24, 0x00c07f04, + 0x800c0061, 0x04050220, 0x00100104, 0x00000000, 0x80012031, 0x01140000, 0xfa007f8f, 0xf6780003, + 0x8000c131, 0x030c0800, 0xfa007f8f, 0xf6740003, 0x00000060, 0x00000000, 0x00000000, 0x00000000, + 0x00000060, 0x00000000, 0x00000000, 0x00000000, 0x00000060, 0x00000000, 0x00000000, 0x00000000, + 0x3c8ca101, 0x00100000, 0x8000a065, 0x7f058220, 0x02000004, 0xffffffc0, 0x80001940, 0x7f058220, + 0x02007f04, 0x00000000, 0x80032231, 0x050c0000, 0xfa007f8f, 0xf6740003, 0x2c240061, 0x00100057, + 0x80000966, 0x80018220, 0x02008000, 0x400004c0, 0x80d72270, 0x00018660, 0x15000584, 0x00030003, + 0x80000065, 0x04858660, 0x05000504, 0x00030003, 0x80001c41, 0x20010660, 0x01000594, 0x00005714, + 0xec848161, 0x00123303, 0x80d41b70, 0x00018660, 0x15000484, 0x00000000, 0xac840053, 0x574f0503, + 0x80000065, 0x04958660, 0x05000514, 0x00030003, 0x00154052, 0x07040660, 0x010e0304, 0x04040104, + 0xec840061, 0x00103301, 0x80d40070, 0x00018660, 0x15000484, 0x00010001, 0xec840061, 0x00123301, + 0x80d41d70, 0x00018660, 0x15000494, 0x00000000, 0xec840061, 0x00153301, 0x80d40070, 0x00018660, + 0x15000484, 0x00020002, 0x80000061, 0x01350220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, + 0x15000494, 0x00010001, 0x80000065, 0x04a58660, 0x05000524, 0x00030003, 0xec840061, 0x001a3301, + 0x80d41a70, 0x00018660, 0x150004a4, 0x00000000, 0x80000061, 0x01550220, 0x00003300, 0x00000000, + 0x80d40070, 0x00018660, 0x15000484, 0x00030003, 0x80000061, 0x01650220, 0x00003300, 0x00000000, + 0x80d40070, 0x00018660, 0x15000494, 0x00020002, 0x80000061, 0x01750220, 0x00003300, 0x00000000, + 0x80d40070, 0x00018660, 0x150004a4, 0x00010001, 0x80000065, 0x04b58660, 0x05000534, 0x00030003, + 0x80000061, 0x01850220, 0x00003300, 0x00000000, 0x80d41a70, 0x00018660, 0x150004b4, 0x00000000, + 0x80000061, 0x01950220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, 0x15000494, 0x00030003, + 0x80000061, 0x01a50220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, 0x150004a4, 0x00020002, + 0x80000061, 0x01b50220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, 0x150004b4, 0x00010001, + 0x80000065, 0x04c58660, 0x05000544, 0x00030003, 0x80000061, 0x01c50220, 0x00003300, 0x00000000, + 0x80d41a70, 0x00018660, 0x150004c4, 0x00000000, 0x80000065, 0x0b058660, 0x05000554, 0x00030003, + 0x80000061, 0x01d50220, 0x00003300, 0x00000000, 0x80d41a70, 0x00018660, 0x15000b04, 0x00000000, + 0x80000065, 0x0b158660, 0x05000564, 0x00030003, 0x80000061, 0x01e50220, 0x00003300, 0x00000000, + 0x80d41a70, 0x00018660, 0x15000b14, 0x00000000, 0x80000065, 0x0b258660, 0x05000574, 0x00030003, + 0x80000041, 0x20010660, 0x010005a4, 0x00005764, 0x80000061, 0x01f50220, 0x00003300, 0x00000000, + 0x80d41b70, 0x00018660, 0x15000b24, 0x00000000, 0xac840053, 0x57f70506, 0x80940070, 0x00018660, + 0x15000584, 0x00000000, 0x00141a52, 0x09040660, 0x010e0604, 0x04140204, 0xec840061, 0x00103302, + 0x80d40070, 0x00018660, 0x150004a4, 0x00030003, 0xec840061, 0x00123302, 0x80d40070, 0x00018660, + 0x150004b4, 0x00020002, 0x0017a331, 0x14440000, 0x20000714, 0x01680914, 0xec840061, 0x00153302, + 0x80d40070, 0x00018660, 0x150004c4, 0x00010001, 0x80000061, 0x02350220, 0x00003300, 0x00000000, + 0x80d40070, 0x00018660, 0x15000b04, 0x00010001, 0x0014c431, 0x20440000, 0x20020714, 0x01680914, + 0xec840061, 0x001a3302, 0x80d40070, 0x00018660, 0x15000b14, 0x00010001, 0x80000061, 0x02550220, + 0x00003300, 0x00000000, 0x80d40070, 0x00018660, 0x15000b24, 0x00010001, 0x80000061, 0x02650220, + 0x00003300, 0x00000000, 0x80d40070, 0x00018660, 0x150004b4, 0x00030003, 0x0014c531, 0x28440000, + 0x20040714, 0x01680914, 0x80000061, 0x02750220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, + 0x150004c4, 0x00020002, 0x80000061, 0x02850220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, + 0x15000b04, 0x00020002, 0x80000061, 0x02950220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, + 0x15000b14, 0x00020002, 0x80000061, 0x02a50220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, + 0x15000b24, 0x00020002, 0x80000061, 0x02b50220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, + 0x150004c4, 0x00030003, 0x80000061, 0x02c50220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, + 0x15000b04, 0x00030003, 0x80000061, 0x02d50220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, + 0x15000b14, 0x00030003, 0x80000061, 0x02e50220, 0x00003300, 0x00000000, 0x80d40070, 0x00018660, + 0x15000b24, 0x00030003, 0x80540070, 0x00018660, 0x15000584, 0x00010001, 0x80140070, 0x00018660, + 0x15000584, 0x00020002, 0x00148365, 0x05058660, 0x06101404, 0x807fffff, 0x80000061, 0x02f50220, + 0x00003300, 0x00000000, 0x00d41a70, 0x55050660, 0x16100504, 0x00101404, 0x28200061, 0x0010070c, + 0x3c8c1101, 0x00100000, 0x0014a565, 0x07058660, 0x06101604, 0x807fffff, 0xec840061, 0x00103303, + 0x00d41a70, 0x58050660, 0x16100704, 0x00101604, 0x28200061, 0x0010090e, 0x3c8c1101, 0x00100000, + 0x00148465, 0x09058660, 0x06102004, 0x807fffff, 0xec840061, 0x00103304, 0x00d41a70, 0x5a050660, + 0x16100904, 0x00102004, 0x00140065, 0x1c058660, 0x06101804, 0x807fffff, 0xec840061, 0x0010330b, + 0x00d41a70, 0x60050660, 0x16101c04, 0x00101804, 0x00140065, 0x1e058660, 0x06102204, 0x807fffff, + 0xec840061, 0x00103310, 0x00d41a70, 0x07050660, 0x16101e04, 0x00102204, 0x00140065, 0x11058660, + 0x06101404, 0x80000000, 0x00148565, 0x30058660, 0x06102804, 0x807fffff, 0x00140065, 0x37058660, + 0x06102004, 0x80000000, 0xec840061, 0x00103303, 0x00141c6b, 0x5c040228, 0xd28a5504, 0x14051104, + 0x00d41c70, 0x09050660, 0x16103004, 0x00102804, 0x00140065, 0x35058660, 0x06101604, 0x80000000, + 0x00141d6b, 0x05040228, 0xd28a5a04, 0x20053704, 0x00140065, 0x32058660, 0x06101a04, 0x807fffff, + 0x00140065, 0x43058660, 0x06102804, 0x80000000, 0x04941e62, 0x20018aa0, 0x0a105c04, 0x00000000, + 0x00140065, 0x3d058660, 0x06101804, 0x80000000, 0x00141d6b, 0x5e040228, 0xd28a5804, 0x16053504, + 0x04941d62, 0x22018aa0, 0x0a100504, 0x00000000, 0xec840061, 0x00103304, 0x00141c6b, 0x12040228, + 0xd28a0904, 0x28054304, 0x00d41170, 0x10050660, 0x16103204, 0x00101a04, 0x00140065, 0x41058660, + 0x06102204, 0x80000000, 0x00141e6b, 0x62040228, 0xd28a6004, 0x18053d04, 0x04541e62, 0x20010aa0, + 0x0a105e04, 0x00102000, 0x00140065, 0x39058660, 0x06102404, 0x807fffff, 0x04941d62, 0x1e058aa0, + 0x0a101204, 0x00000000, 0x00140065, 0x47058660, 0x06101a04, 0x80000000, 0x00141c6b, 0x05040228, + 0xd28a0704, 0x22054104, 0x04141c62, 0x20010aa0, 0x0a106204, 0x00102000, 0xfc841161, 0x00110332, + 0xec840061, 0x0010330b, 0x00d41d70, 0x1c050660, 0x16103904, 0x00102404, 0x00141d6b, 0x30040228, + 0xd28a1004, 0x1a054704, 0x04541d62, 0x22010aa0, 0x0a100504, 0x00102200, 0x00140065, 0x3f058660, + 0x06102604, 0x807fffff, 0x00140065, 0x3b058660, 0x06102a04, 0x807fffff, 0x00140065, 0x49058660, + 0x06102404, 0x80000000, 0x04941c62, 0x20010aa0, 0x0a103004, 0x00102000, 0xec840061, 0x00103303, + 0x00940970, 0x07050660, 0x16103f04, 0x00102604, 0x00d41c70, 0x36050660, 0x16103b04, 0x00102a04, + 0x00141c6b, 0x34040228, 0xd28a1c04, 0x24054904, 0xfc840061, 0x00160132, 0xfc840061, 0x00100133, + 0x04141b62, 0x22010aa0, 0x0a103404, 0x00102200, 0x04d40062, 0x09058aa0, 0x0a102000, 0x00000000, + 0x04940062, 0x04058aa0, 0x0a102000, 0x00000000, 0x80001161, 0x33010220, 0x00000154, 0x00000000, + 0xfc840061, 0x001f0132, 0x00140065, 0x51058660, 0x06102a04, 0x80000000, 0x0014196b, 0x14040228, + 0xd28a3604, 0x2a055104, 0x04d40062, 0x12058aa0, 0x0a102000, 0x00000000, 0x04940062, 0x10058aa0, + 0x0a102000, 0x00000000, 0x04541962, 0x20010aa0, 0x0a101404, 0x00101e04, 0x00140065, 0x53058660, + 0x06102604, 0x80000000, 0xfc841161, 0x00110331, 0x00140065, 0x45058660, 0x06102c04, 0x807fffff, + 0xfc840061, 0x00110133, 0x00141c6b, 0x16040228, 0xd28a0704, 0x26055304, 0x00140065, 0x4b058660, + 0x06102e04, 0x807fffff, 0x00941c70, 0x18050660, 0x16104504, 0x00102c04, 0x04541b62, 0x22010aa0, + 0x0a101604, 0x00102200, 0xfc841161, 0x00140132, 0x00140065, 0x4d058660, 0x06102c04, 0x80000000, + 0x00541c70, 0x1a050660, 0x16104b04, 0x00102e04, 0x04d40062, 0x30050aa0, 0x0a102200, 0x00100904, + 0x00140065, 0x4f058660, 0x06102e04, 0x80000000, 0x00141b6b, 0x1c040228, 0xd28a1804, 0x2c054d04, + 0xfc841161, 0x00110333, 0x04940062, 0x32050aa0, 0x0a102200, 0x00100404, 0xfc841161, 0x00130131, + 0x00141c6b, 0x16040228, 0xd28a1a04, 0x2e054f04, 0x04141c62, 0x20010aa0, 0x0a101c04, 0x00102000, + 0xfc841161, 0x00180130, 0x04d41a62, 0x1e050aa0, 0x0a101604, 0x00102000, 0xfc841161, 0x00190133, + 0x80000061, 0x32010220, 0x00000174, 0x00000000, 0x04540062, 0x06050aa0, 0x0a102200, 0x00101204, + 0x04140062, 0x14050aa0, 0x0a102200, 0x00101004, 0xfc841161, 0x001e0131, 0xfc840061, 0x001c0130, + 0x04d40062, 0x22010aa0, 0x0a101e04, 0x00103004, 0x04940062, 0x20010aa0, 0x0a101e04, 0x00103204, + 0xfc841161, 0x00170133, 0x04540062, 0x04050aa0, 0x0a101e04, 0x00100604, 0xfc841161, 0x00110232, + 0x14140062, 0x22018aa0, 0x0a102200, 0x3f800000, 0xfc841161, 0x001b0131, 0xfc840061, 0x001d0130, + 0x14d40062, 0x20018aa0, 0x0a102000, 0x3f800000, 0x14940062, 0x08058aa0, 0x0a100404, 0x3f800000, + 0x80001161, 0x33010220, 0x000001f4, 0x00000000, 0x04540062, 0x0a058aa0, 0x0a102200, 0x00000000, + 0xfc841161, 0x00100232, 0x04140062, 0x10058aa0, 0x0a102200, 0x00000000, 0xfc841161, 0x00160231, + 0xfc840061, 0x00190230, 0x04d40062, 0x12058aa0, 0x0a102200, 0x00000000, 0x04940062, 0x22018aa0, + 0x0a102200, 0x00000000, 0x04540062, 0x06050aa0, 0x0a101e04, 0x00101404, 0xfc841161, 0x00140233, + 0x04140062, 0x16050aa0, 0x0a102000, 0x00100a04, 0x80001161, 0x32010220, 0x00000254, 0x00000000, + 0xfc840061, 0x001c0231, 0x80000061, 0x30010220, 0x00000274, 0x00000000, 0x04d40062, 0x03050aa0, + 0x0a102000, 0x00101004, 0x04940062, 0x18050aa0, 0x0a102000, 0x00101204, 0x04540062, 0x1a050aa0, + 0x0a102000, 0x00102200, 0x14140062, 0x22018aa0, 0x0a100604, 0x3f800000, 0xfc841161, 0x00130233, + 0xfc840061, 0x001f0232, 0xfc840061, 0x00170231, 0xfc840061, 0x001e0230, 0x04d40062, 0x20010aa0, + 0x0a100804, 0x00101604, 0x04940062, 0x14050aa0, 0x0a100804, 0x00100304, 0x04540062, 0x0a050aa0, + 0x0a100804, 0x00101804, 0x04140062, 0x10050aa0, 0x0a100804, 0x00101a04, 0xfc841161, 0x00180233, + 0xfc840061, 0x001b0232, 0xfc840061, 0x001d0231, 0x80000061, 0x30010220, 0x000002f4, 0x00000000, + 0x04d40062, 0x1c050aa0, 0x0a102200, 0x00102000, 0x04940062, 0x1e050aa0, 0x0a102200, 0x00101404, + 0x04540062, 0x20050aa0, 0x0a102200, 0x00100a04, 0x04140062, 0x22050aa0, 0x0a102200, 0x00101004, + 0x00162631, 0x00000000, 0xda0c0ca7, 0x043c1c44, 0x28100061, 0x0010577f, 0x80022031, 0x00000004, + 0x30207f0c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 +}; +#endif // !defined(MEDIA_BIN_SUPPORT) || defined(MEDIA_BIN_DLL) \ No newline at end of file diff --git a/media_softlet/agnostic/Xe_R/Xe2_HPG/vp/kernel/igvpfc_444PL3_input_xe2.h b/media_softlet/agnostic/Xe_R/Xe2_HPG/vp/kernel/igvpfc_444PL3_input_xe2.h new file mode 100644 index 00000000000..9da73ee0664 --- /dev/null +++ b/media_softlet/agnostic/Xe_R/Xe2_HPG/vp/kernel/igvpfc_444PL3_input_xe2.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2024, Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * 'Software'), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +//////////////////////////////////////////////////////////////////////////////// +// !!! WARNING - AUTO GENERATED FILE. DO NOT EDIT DIRECTLY. !!! +// Generated by KernelBinToSource.exe tool +//////////////////////////////////////////////////////////////////////////////// + +#ifndef __IGVPFC_444PL3_INPUT_XE2_H__ +#define __IGVPFC_444PL3_INPUT_XE2_H__ + +#include "media_bin_mgr.h" +DECLARE_SHARED_ARRAY_SIZE_UINT32(IGVPFC_444PL3_INPUT_GENERATION_XE2_SIZE); +DECLARE_SHARED_ARRAY_UINT32(IGVPFC_444PL3_INPUT_GENERATION_XE2); + +#if defined(MEDIA_BIN_SUPPORT) + +#define IGVPFC_444PL3_INPUT_GENERATION_XE2_NAME "IGVPFC_444PL3_INPUT_XE2" + +#if defined(MEDIA_BIN_DLL) +static bool registerIGVPFC_444PL3_INPUT_XE2 = RegisterMediaBin(IGVPFC_444PL3_INPUT_GENERATION_XE2_NAME, IGVPFC_444PL3_INPUT_GENERATION_XE2_SIZE, IGVPFC_444PL3_INPUT_GENERATION_XE2); + +#endif // defined(MEDIA_BIN_DLL) + +#endif // defined(MEDIA_BIN_SUPPORT) + +#if !defined(MEDIA_BIN_DLL) +#include "igvpfc_444PL3_input_args.h" +// Following functions are always needed in media driver dll no matter media_bin_supported or not +extern void AddVpNativeKernelEntryToListFc_444pl3_inputXe2(vp::VpPlatformInterface &vpPlatformInterface); +#endif // !defined(MEDIA_BIN_DLL) + +#endif // __IGVPFC_444PL3_INPUT_XE2_H__ diff --git a/media_softlet/agnostic/Xe_R/Xe2_HPG/vp/kernel/media_srcs.cmake b/media_softlet/agnostic/Xe_R/Xe2_HPG/vp/kernel/media_srcs.cmake index a3241f41d79..7c270ecd17a 100644 --- a/media_softlet/agnostic/Xe_R/Xe2_HPG/vp/kernel/media_srcs.cmake +++ b/media_softlet/agnostic/Xe_R/Xe2_HPG/vp/kernel/media_srcs.cmake @@ -26,6 +26,7 @@ set(TMP_SOURCES_ ${CMAKE_CURRENT_LIST_DIR}/igvpkrn_l0_xe2_hpg.c ${CMAKE_CURRENT_LIST_DIR}/igvpfc_common_xe2.cpp ${CMAKE_CURRENT_LIST_DIR}/igvpfc_fp_xe2.cpp + ${CMAKE_CURRENT_LIST_DIR}/igvpfc_444PL3_input_xe2.cpp ) @@ -34,6 +35,7 @@ set(TMP_HEADERS_ ${CMAKE_CURRENT_LIST_DIR}/igvpkrn_l0_xe2_hpg.h ${CMAKE_CURRENT_LIST_DIR}/igvpfc_common_xe2.h ${CMAKE_CURRENT_LIST_DIR}/igvpfc_fp_xe2.h + ${CMAKE_CURRENT_LIST_DIR}/igvpfc_444PL3_input_xe2.h ) set(SOFTLET_VP_SOURCES_ diff --git a/media_softlet/agnostic/common/renderhal/renderhal.cpp b/media_softlet/agnostic/common/renderhal/renderhal.cpp index fe34cd66518..0bc813056d7 100644 --- a/media_softlet/agnostic/common/renderhal/renderhal.cpp +++ b/media_softlet/agnostic/common/renderhal/renderhal.cpp @@ -4294,6 +4294,9 @@ MOS_STATUS RenderHal_GetPlaneDefinitionForCommonMessage( case Format_P216: case Format_R5G6B5: case Format_R8G8B8: + case Format_RGBP: + case Format_BGRP: + case Format_444P: //already handled rightly in normal non-adv GetPlaneDefinition break; case Format_NV12: diff --git a/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.cpp b/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.cpp index 34df9deb1c1..8a3d0400379 100644 --- a/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.cpp +++ b/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.cpp @@ -251,6 +251,13 @@ VpResourceManager::~VpResourceManager() m_allocator.DestroyVpSurface(m_cmfcCoeff); m_allocator.DestroyVpSurface(m_decompressionSyncSurface); + for (int i = 0; i < 8; ++i) + { + if (m_fcIntermediaSurfaceInput[i]) + { + m_allocator.DestroyVpSurface(m_fcIntermediaSurfaceInput[i]); + } + } m_allocator.CleanRecycler(); } @@ -1081,7 +1088,50 @@ MOS_STATUS VpResourceManager::AssignFcResources(VP_EXECUTE_CAPS &caps, std::vect MOS_MMC_DISABLED, allocated)); surfSetting.surfGroup.insert(std::make_pair(SurfaceTypeDecompressionSync, m_decompressionSyncSurface)); + + // Allocate L0 fc inter media Surface Input + for (uint32_t i = 0; i < inputSurfaces.size(); ++i) + { + if (inputSurfaces[i]->osSurface->Format == Format_RGBP || + inputSurfaces[i]->osSurface->Format == Format_BGRP) + { + VP_PUBLIC_CHK_STATUS_RETURN(m_allocator.ReAllocateSurface( + m_fcIntermediaSurfaceInput[i], + "fcIntermediaSurfaceInput", + Format_A8R8G8B8, + MOS_GFXRES_2D, + MOS_TILE_Y, + inputSurfaces[i]->osSurface->dwWidth, + inputSurfaces[i]->osSurface->dwHeight, + false, + MOS_MMC_DISABLED, + allocated, + false, + IsDeferredResourceDestroyNeeded(), + MOS_HW_RESOURCE_USAGE_VP_INTERNAL_READ_WRITE_RENDER)); + m_fcIntermediaSurfaceInput[i]->osSurface->Format = Format_A8R8G8B8; + } + else if (inputSurfaces[i]->osSurface->Format == Format_444P) + { + VP_PUBLIC_CHK_STATUS_RETURN(m_allocator.ReAllocateSurface( + m_fcIntermediaSurfaceInput[i], + "fcIntermediaSurfaceInput", + Format_AYUV, + MOS_GFXRES_2D, + MOS_TILE_Y, + inputSurfaces[i]->osSurface->dwWidth, + inputSurfaces[i]->osSurface->dwHeight, + false, + MOS_MMC_DISABLED, + allocated, + false, + IsDeferredResourceDestroyNeeded(), + MOS_HW_RESOURCE_USAGE_VP_INTERNAL_READ_WRITE_RENDER)); + m_fcIntermediaSurfaceInput[i]->osSurface->Format = Format_AYUV; + } + surfSetting.surfGroup.insert(std::make_pair((SurfaceType)(SurfaceTypeFcIntermediaInput + i), m_fcIntermediaSurfaceInput[i])); + } return MOS_STATUS_SUCCESS; } diff --git a/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.h b/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.h index b3358e1c574..903f4e24bed 100644 --- a/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.h +++ b/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.h @@ -552,6 +552,7 @@ class VpResourceManager // Fc Resource VP_SURFACE *m_cmfcCoeff = nullptr; + VP_SURFACE *m_fcIntermediaSurfaceInput[8] = {}; //for decompreesion sync on interlace input of FC VP_SURFACE *m_decompressionSyncSurface = nullptr; // Hdr Resource diff --git a/media_softlet/agnostic/common/vp/hal/feature_manager/surface_type.h b/media_softlet/agnostic/common/vp/hal/feature_manager/surface_type.h index 854ffe04cf2..6ba6b08cd69 100644 --- a/media_softlet/agnostic/common/vp/hal/feature_manager/surface_type.h +++ b/media_softlet/agnostic/common/vp/hal/feature_manager/surface_type.h @@ -92,6 +92,7 @@ enum SurfaceType SurfaceTypeFcTarget1 = 0x2300, SurfaceTypeFcCscCoeff = 0x2400, SurfaceTypeDecompressionSync = 0x2500, + SurfaceTypeFcIntermediaInput = 0x2510, // 3DLut Kernel SurfaceType3DLut2D = 0x2600, diff --git a/media_softlet/agnostic/common/vp/hal/feature_manager/vp_kernelset.cpp b/media_softlet/agnostic/common/vp/hal/feature_manager/vp_kernelset.cpp index 453689abd05..ab109afe6bd 100644 --- a/media_softlet/agnostic/common/vp/hal/feature_manager/vp_kernelset.cpp +++ b/media_softlet/agnostic/common/vp/hal/feature_manager/vp_kernelset.cpp @@ -129,6 +129,7 @@ MOS_STATUS VpKernelSet::CreateSingleKernelObject( break; case kernelL0FcCommon: case kernelL0FcFP: + case kernelL0Fc444PL3Input: kernel = (VpRenderKernelObj *)MOS_New(VpRenderL0FcKernel, m_hwInterface, kernelId, kernelIndex, m_allocator); VP_RENDER_CHK_NULL_RETURN(kernel); break; diff --git a/media_softlet/agnostic/common/vp/hal/features/kernel_args/igvpfc_444PL3_input_args.h b/media_softlet/agnostic/common/vp/hal/features/kernel_args/igvpfc_444PL3_input_args.h new file mode 100644 index 00000000000..66865246cd8 --- /dev/null +++ b/media_softlet/agnostic/common/vp/hal/features/kernel_args/igvpfc_444PL3_input_args.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2024, Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * 'Software'), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +//////////////////////////////////////////////////////////////////////////////// +// !!! WARNING - AUTO GENERATED FILE. DO NOT EDIT DIRECTLY. !!! +// Generated by KernelBinToSource.exe tool +//////////////////////////////////////////////////////////////////////////////// + +#ifndef __IGVPFC_444PL3_INPUT_ENUM_H__ +#define __IGVPFC_444PL3_INPUT_ENUM_H__ + +enum ARGS_FC_444PL3_INPUT_IMAGEREAD +{ + FC_444PL3_INPUT_IMAGEREAD_INPUTPLANE0, + FC_444PL3_INPUT_IMAGEREAD_INPUTPLANE1, + FC_444PL3_INPUT_IMAGEREAD_INPUTPLANE2, + FC_444PL3_INPUT_IMAGEREAD_OUTPUTPLANE, + FC_444PL3_INPUT_IMAGEREAD_INPUTINDEX, + FC_444PL3_INPUT_IMAGEREAD_OUTPUTINDEX, + FC_444PL3_INPUT_IMAGEREAD_PLANEINDEX, + FC_444PL3_INPUT_IMAGEREAD_ENQUEUED_LOCAL_SIZE, + FC_444PL3_INPUT_IMAGEREAD_GLOBAL_ID_OFFSET, + FC_444PL3_INPUT_IMAGEREAD_LOCAL_SIZE, + FC_444PL3_INPUT_IMAGEREAD_MAX +}; + +#endif // __IGVPFC_444PL3_INPUT_ENUM_H__ diff --git a/media_softlet/agnostic/common/vp/hal/features/kernel_args/media_srcs.cmake b/media_softlet/agnostic/common/vp/hal/features/kernel_args/media_srcs.cmake index 476fd7711c2..d14203fc53e 100644 --- a/media_softlet/agnostic/common/vp/hal/features/kernel_args/media_srcs.cmake +++ b/media_softlet/agnostic/common/vp/hal/features/kernel_args/media_srcs.cmake @@ -26,6 +26,7 @@ set(TMP_HEADERS_ ${CMAKE_CURRENT_LIST_DIR}/igvp3dlut_args.h ${CMAKE_CURRENT_LIST_DIR}/igvpfc_common_args.h ${CMAKE_CURRENT_LIST_DIR}/igvpfc_fp_args.h + ${CMAKE_CURRENT_LIST_DIR}/igvpfc_444PL3_input_args.h ) set(SOFTLET_VP_SOURCES_ diff --git a/media_softlet/agnostic/common/vp/hal/features/vp_l0_fc_filter.cpp b/media_softlet/agnostic/common/vp/hal/features/vp_l0_fc_filter.cpp index b40b4946349..f09fa4c6e77 100644 --- a/media_softlet/agnostic/common/vp/hal/features/vp_l0_fc_filter.cpp +++ b/media_softlet/agnostic/common/vp/hal/features/vp_l0_fc_filter.cpp @@ -28,6 +28,7 @@ #include "vp_render_cmd_packet.h" #include "igvpfc_common_args.h" #include "igvpfc_fp_args.h" +#include "igvpfc_444PL3_input_args.h" #include namespace vp @@ -71,6 +72,11 @@ MOS_STATUS VpL0FcFilter::Destroy() KRN_ARG &krnArg = handle.second; MOS_FreeMemAndSetNull(krnArg.pData); } + for (auto &handle : m_fc444PL3InputKrnArgs) + { + KRN_ARG &krnArg = handle.second; + MOS_FreeMemAndSetNull(krnArg.pData); + } return MOS_STATUS_SUCCESS; } @@ -115,6 +121,15 @@ MOS_STATUS VpL0FcFilter::InitKrnParams(L0_FC_KERNEL_PARAMS &krnParams, SwFilterP ReportDiffLog(compParam); L0_FC_KERNEL_PARAM param = {}; + for (uint32_t i = 0; i < compParam.layerNumber; ++i) + { + if (compParam.inputLayersParam[i].needIntermediaSurface) + { + VP_RENDER_CHK_STATUS_RETURN(GenerateFc444PL3InputParam(compParam.inputLayersParam[i], compParam.layerNumber, param, i)); + krnParams.push_back(param); + } + } + if (FastExpressConditionMeet(compParam)) { VP_RENDER_CHK_STATUS_RETURN(GenerateFcFastExpressKrnParam(compParam, param)); @@ -130,6 +145,151 @@ MOS_STATUS VpL0FcFilter::InitKrnParams(L0_FC_KERNEL_PARAMS &krnParams, SwFilterP return MOS_STATUS_SUCCESS; } +MOS_STATUS VpL0FcFilter::GenerateFc444PL3InputParam(L0_FC_LAYER_PARAM &layer, uint32_t layerNumber, L0_FC_KERNEL_PARAM ¶m, uint32_t layerIndex) +{ + VP_FUNC_CALL(); + VP_PUBLIC_CHK_NULL_RETURN(m_pvpMhwInterface); + VP_PUBLIC_CHK_NULL_RETURN(m_pvpMhwInterface->m_vpPlatformInterface); + param = {}; + uint32_t localSize[3] = {128, 2, 1}; // localWidth, localHeight, localDepth + uint32_t threadWidth = layer.surf->osSurface->dwWidth / localSize[0] + (layer.surf->osSurface->dwWidth % localSize[0] != 0); + uint32_t threadHeight = layer.surf->osSurface->dwHeight / localSize[1] +(layer.surf->osSurface->dwHeight % localSize[1] != 0); + KERNEL_ARGS krnArgs = {}; + KERNEL_ARG_INDEX_SURFACE_MAP krnStatefulSurfaces = {}; + uint32_t inputChannelIndices[4] = {}; + uint32_t outputChannelIndices[4] = {}; + uint32_t planeChannelIndics = 0; + std::string krnName = "ImageRead_fc_444PL3_input"; + + auto handle = m_pvpMhwInterface->m_vpPlatformInterface->GetKernelPool().find(krnName); + VP_PUBLIC_CHK_NOT_FOUND_RETURN(handle, &m_pvpMhwInterface->m_vpPlatformInterface->GetKernelPool()); + KERNEL_BTIS kernelBtis = handle->second.GetKernelBtis(); + KERNEL_ARGS kernelArgs = handle->second.GetKernelArgs(); + + VP_PUBLIC_CHK_STATUS_RETURN(ConvertInputChannelIndicesToKrnParam(layer.surf->osSurface->Format, inputChannelIndices)); + VP_PUBLIC_CHK_STATUS_RETURN(ConvertOuputChannelIndicesToKrnParam(layer.interMediaOverwriteSurface, outputChannelIndices)); + for (auto const &kernelArg : kernelArgs) + { + uint32_t uIndex = kernelArg.uIndex; + auto argHandle = m_fc444PL3InputKrnArgs.find(uIndex); + if (argHandle == m_fc444PL3InputKrnArgs.end()) + { + KRN_ARG krnArg = {}; + argHandle = m_fc444PL3InputKrnArgs.insert(std::make_pair(uIndex, krnArg)).first; + VP_PUBLIC_CHK_NOT_FOUND_RETURN(argHandle, &m_fc444PL3InputKrnArgs); + } + KRN_ARG &krnArg = argHandle->second; + bool bInit = true; + krnArg.uIndex = uIndex; + krnArg.eArgKind = kernelArg.eArgKind; + if (krnArg.pData == nullptr) + { + if (kernelArg.uSize > 0) + { + krnArg.uSize = kernelArg.uSize; + krnArg.pData = MOS_AllocAndZeroMemory(kernelArg.uSize); + } + } + else + { + VP_PUBLIC_CHK_VALUE_RETURN(krnArg.uSize, kernelArg.uSize); + MOS_ZeroMemory(krnArg.pData, krnArg.uSize); + } + + VP_PUBLIC_CHK_STATUS_RETURN(SetupSingleFc444PL3InputKrnArg(localSize, krnArg, bInit, inputChannelIndices, outputChannelIndices, planeChannelIndics)); + + if (bInit) + { + krnArgs.push_back(krnArg); + } + } + + for (auto const &kernelBti : kernelBtis) + { + uint32_t uIndex = kernelBti.first; + SURFACE_PARAMS surfaceParam = {}; + bool bInit = true; + + VP_PUBLIC_CHK_STATUS_RETURN(SetupSingleFc444PL3InputBti(uIndex, surfaceParam, layerIndex, bInit)); + + if (bInit) + { + krnStatefulSurfaces.insert(std::make_pair(uIndex, surfaceParam)); + } + } + + param.kernelArgs = krnArgs; + param.kernelName = krnName; + param.kernelId = kernelL0Fc444PL3Input; + param.threadWidth = threadWidth; + param.threadHeight = threadHeight; + param.localWidth = localSize[0]; + param.localHeight = localSize[1]; + param.kernelStatefulSurfaces = krnStatefulSurfaces; + + return MOS_STATUS_SUCCESS; +} + +MOS_STATUS VpL0FcFilter::SetupSingleFc444PL3InputKrnArg(uint32_t localSize[3], KRN_ARG &krnArg, bool &bInit, uint32_t inputChannelIndices[4], uint32_t outputChannelIndices[4], uint32_t planeChannelIndices) +{ + switch (krnArg.uIndex) + { + case FC_444PL3_INPUT_IMAGEREAD_INPUTINDEX: + VP_PUBLIC_CHK_NULL_RETURN(krnArg.pData); + static_cast(krnArg.pData)[0] = inputChannelIndices[0]; + static_cast(krnArg.pData)[1] = inputChannelIndices[1]; + static_cast(krnArg.pData)[2] = inputChannelIndices[2]; + static_cast(krnArg.pData)[3] = inputChannelIndices[3]; + break; + case FC_444PL3_INPUT_IMAGEREAD_OUTPUTINDEX: + // use input instead + static_cast(krnArg.pData)[0] = outputChannelIndices[0]; + static_cast(krnArg.pData)[1] = outputChannelIndices[1]; + static_cast(krnArg.pData)[2] = outputChannelIndices[2]; + static_cast(krnArg.pData)[3] = outputChannelIndices[3]; + break; + case FC_444PL3_INPUT_IMAGEREAD_PLANEINDEX: + VP_PUBLIC_CHK_NULL_RETURN(krnArg.pData); + *(uint32_t *)krnArg.pData = planeChannelIndices; + break; + case FC_444PL3_INPUT_IMAGEREAD_ENQUEUED_LOCAL_SIZE: + case FC_444PL3_INPUT_IMAGEREAD_LOCAL_SIZE: + VP_PUBLIC_CHK_NULL_RETURN(krnArg.pData); + static_cast(krnArg.pData)[0] = localSize[0]; + static_cast(krnArg.pData)[1] = localSize[1]; + static_cast(krnArg.pData)[2] = localSize[2]; + break; + default: + bInit = false; + break; + } + + return MOS_STATUS_SUCCESS; +} + +MOS_STATUS VpL0FcFilter::SetupSingleFc444PL3InputBti(uint32_t uIndex, SURFACE_PARAMS &surfaceParam, uint32_t layerIndex, bool &bInit) +{ + switch (uIndex) + { + case FC_444PL3_INPUT_IMAGEREAD_INPUTPLANE0: + surfaceParam.surfType = SurfaceType(SurfaceTypeFcInputLayer0 + layerIndex); + break; + case FC_444PL3_INPUT_IMAGEREAD_INPUTPLANE1: + case FC_444PL3_INPUT_IMAGEREAD_INPUTPLANE2: + surfaceParam.surfType = SurfaceTypeInvalid; + break; + case FC_444PL3_INPUT_IMAGEREAD_OUTPUTPLANE: + surfaceParam.surfType = SurfaceType(SurfaceTypeFcIntermediaInput + layerIndex); + surfaceParam.isOutput = true; + break; + default: + bInit = false; + break; + } + + return MOS_STATUS_SUCCESS; +} + MOS_STATUS VpL0FcFilter::GenerateFcCommonKrnParam(L0_FC_COMP_PARAM &compParam, L0_FC_KERNEL_PARAM ¶m) { VP_FUNC_CALL(); @@ -328,7 +488,8 @@ MOS_STATUS VpL0FcFilter::SetupSingleFcCommonBti(uint32_t uIndex, const L0_FC_COM case FC_COMMON_FASTCOMP_INPUT0PL0: if (compParam.layerNumber > 0) { - surfaceParam.surfType = SurfaceTypeFcInputLayer0; + surfaceParam.surfType = compParam.inputLayersParam[0].needIntermediaSurface ? + SurfaceTypeFcIntermediaInput : SurfaceTypeFcInputLayer0; if (compParam.inputLayersParam[0].diParams.enabled && compParam.inputLayersParam[0].diParams.params.DIMode == DI_MODE_BOB) { @@ -343,7 +504,7 @@ MOS_STATUS VpL0FcFilter::SetupSingleFcCommonBti(uint32_t uIndex, const L0_FC_COM case FC_COMMON_FASTCOMP_INPUT1PL0: if (compParam.layerNumber > 1) { - surfaceParam.surfType = SurfaceType(SurfaceTypeFcInputLayer0 + 1); + surfaceParam.surfType = compParam.inputLayersParam[1].needIntermediaSurface ? SurfaceType(SurfaceTypeFcIntermediaInput + 1) : SurfaceType(SurfaceTypeFcInputLayer0 + 1); if (compParam.inputLayersParam[1].diParams.enabled && compParam.inputLayersParam[1].diParams.params.DIMode == DI_MODE_BOB) { @@ -358,7 +519,7 @@ MOS_STATUS VpL0FcFilter::SetupSingleFcCommonBti(uint32_t uIndex, const L0_FC_COM case FC_COMMON_FASTCOMP_INPUT2PL0: if (compParam.layerNumber > 2) { - surfaceParam.surfType = SurfaceType(SurfaceTypeFcInputLayer0 + 2); + surfaceParam.surfType = compParam.inputLayersParam[2].needIntermediaSurface ? SurfaceType(SurfaceTypeFcIntermediaInput + 2) : SurfaceType(SurfaceTypeFcInputLayer0 + 2); if (compParam.inputLayersParam[2].diParams.enabled && compParam.inputLayersParam[2].diParams.params.DIMode == DI_MODE_BOB) { @@ -373,7 +534,7 @@ MOS_STATUS VpL0FcFilter::SetupSingleFcCommonBti(uint32_t uIndex, const L0_FC_COM case FC_COMMON_FASTCOMP_INPUT3PL0: if (compParam.layerNumber > 3) { - surfaceParam.surfType = SurfaceType(SurfaceTypeFcInputLayer0 + 3); + surfaceParam.surfType = compParam.inputLayersParam[3].needIntermediaSurface ? SurfaceType(SurfaceTypeFcIntermediaInput + 3) : SurfaceType(SurfaceTypeFcInputLayer0 + 3); if (compParam.inputLayersParam[3].diParams.enabled && compParam.inputLayersParam[3].diParams.params.DIMode == DI_MODE_BOB) { @@ -388,7 +549,7 @@ MOS_STATUS VpL0FcFilter::SetupSingleFcCommonBti(uint32_t uIndex, const L0_FC_COM case FC_COMMON_FASTCOMP_INPUT4PL0: if (compParam.layerNumber > 4) { - surfaceParam.surfType = SurfaceType(SurfaceTypeFcInputLayer0 + 4); + surfaceParam.surfType = compParam.inputLayersParam[4].needIntermediaSurface ? SurfaceType(SurfaceTypeFcIntermediaInput + 4) : SurfaceType(SurfaceTypeFcInputLayer0 + 4); if (compParam.inputLayersParam[4].diParams.enabled && compParam.inputLayersParam[4].diParams.params.DIMode == DI_MODE_BOB) { @@ -403,7 +564,7 @@ MOS_STATUS VpL0FcFilter::SetupSingleFcCommonBti(uint32_t uIndex, const L0_FC_COM case FC_COMMON_FASTCOMP_INPUT5PL0: if (compParam.layerNumber > 5) { - surfaceParam.surfType = SurfaceType(SurfaceTypeFcInputLayer0 + 5); + surfaceParam.surfType = compParam.inputLayersParam[5].needIntermediaSurface ? SurfaceType(SurfaceTypeFcIntermediaInput + 5) : SurfaceType(SurfaceTypeFcInputLayer0 + 5); if (compParam.inputLayersParam[5].diParams.enabled && compParam.inputLayersParam[5].diParams.params.DIMode == DI_MODE_BOB) { @@ -418,7 +579,7 @@ MOS_STATUS VpL0FcFilter::SetupSingleFcCommonBti(uint32_t uIndex, const L0_FC_COM case FC_COMMON_FASTCOMP_INPUT6PL0: if (compParam.layerNumber > 6) { - surfaceParam.surfType = SurfaceType(SurfaceTypeFcInputLayer0 + 6); + surfaceParam.surfType = compParam.inputLayersParam[6].needIntermediaSurface ? SurfaceType(SurfaceTypeFcIntermediaInput + 6) : SurfaceType(SurfaceTypeFcInputLayer0 + 6); if (compParam.inputLayersParam[6].diParams.enabled && compParam.inputLayersParam[6].diParams.params.DIMode == DI_MODE_BOB) { @@ -433,7 +594,7 @@ MOS_STATUS VpL0FcFilter::SetupSingleFcCommonBti(uint32_t uIndex, const L0_FC_COM case FC_COMMON_FASTCOMP_INPUT7PL0: if (compParam.layerNumber > 7) { - surfaceParam.surfType = SurfaceType(SurfaceTypeFcInputLayer0 + 7); + surfaceParam.surfType = compParam.inputLayersParam[7].needIntermediaSurface ? SurfaceType(SurfaceTypeFcIntermediaInput + 7) : SurfaceType(SurfaceTypeFcInputLayer0 + 7); if (compParam.inputLayersParam[7].diParams.enabled && compParam.inputLayersParam[7].diParams.params.DIMode == DI_MODE_BOB) { @@ -535,6 +696,18 @@ MOS_STATUS VpL0FcFilter::InitLayer(SwFilterPipe& executingPipe, bool isInputPipe layer.layerID = index; layer.layerIDOrigin = index; + if (layer.surf->osSurface->Format == Format_RGBP || + layer.surf->osSurface->Format == Format_BGRP) + { + layer.needIntermediaSurface = true; + layer.interMediaOverwriteSurface = Format_A8R8G8B8; + } + else if (layer.surf->osSurface->Format == Format_444P) + { + layer.needIntermediaSurface = true; + layer.interMediaOverwriteSurface = Format_AYUV; + } + SwFilterScaling *scaling = dynamic_cast(executingPipe.GetSwFilter(isInputPipe, index, FeatureType::FeatureTypeScaling)); layer.scalingMode = scaling ? scaling->GetSwFilterParams().scalingMode : defaultScalingMode; @@ -760,14 +933,14 @@ MOS_STATUS VpL0FcFilter::GenerateInputImageParam(L0_FC_LAYER_PARAM &layer, VPHAL VP_FUNC_CALL(); VP_PUBLIC_CHK_NULL_RETURN(layer.surf); VP_PUBLIC_CHK_NULL_RETURN(layer.surf->osSurface); - + MOS_FORMAT surfOverwriteFormat = layer.needIntermediaSurface ? layer.interMediaOverwriteSurface : layer.surf->osSurface->Format; uint32_t inputWidth = MOS_MIN(static_cast(layer.surf->osSurface->dwWidth), static_cast(layer.surf->rcSrc.right)); uint32_t inputHeight = MOS_MIN(static_cast(layer.surf->osSurface->dwHeight), static_cast(layer.surf->rcSrc.bottom)); VP_PUBLIC_CHK_STATUS_RETURN(ConvertCscToKrnParam(layer.surf->ColorSpace, mainCSpace, imageParam.csc)); - VP_PUBLIC_CHK_STATUS_RETURN(ConvertInputChannelIndicesToKrnParam(layer.surf->osSurface->Format, imageParam.inputChannelIndices)); + VP_PUBLIC_CHK_STATUS_RETURN(ConvertInputChannelIndicesToKrnParam(surfOverwriteFormat, imageParam.inputChannelIndices)); VP_PUBLIC_CHK_STATUS_RETURN(ConvertScalingRotToKrnParam(layer.surf->rcSrc, layer.surf->rcDst, layer.scalingMode, inputWidth, inputHeight, layer.rotation, imageParam.scale, imageParam.controlSetting.samplerType, imageParam.coordShift)); - VP_PUBLIC_CHK_STATUS_RETURN(ConvertChromaUpsampleToKrnParam(layer.surf->osSurface->Format, layer.surf->ChromaSiting, layer.scalingMode, inputWidth, inputHeight, imageParam.coordShift.chromaShiftX, imageParam.coordShift.chromaShiftY, imageParam.controlSetting.isChromaShift)); - VP_PUBLIC_CHK_STATUS_RETURN(ConvertPlaneNumToKrnParam(layer.surf->osSurface->Format, true, imageParam.inputPlaneNum)); + VP_PUBLIC_CHK_STATUS_RETURN(ConvertChromaUpsampleToKrnParam(surfOverwriteFormat, layer.surf->ChromaSiting, layer.scalingMode, inputWidth, inputHeight, imageParam.coordShift.chromaShiftX, imageParam.coordShift.chromaShiftY, imageParam.controlSetting.isChromaShift)); + VP_PUBLIC_CHK_STATUS_RETURN(ConvertPlaneNumToKrnParam(surfOverwriteFormat, true, imageParam.inputPlaneNum)); VP_PUBLIC_CHK_STATUS_RETURN(ConvertBlendingToKrnParam(layer.blendingParams, imageParam.controlSetting.ignoreSrcPixelAlpha, imageParam.controlSetting.ignoreDstPixelAlpha, imageParam.constAlphs)); if (layer.lumaKey.enabled) @@ -1034,6 +1207,8 @@ MOS_STATUS VpL0FcFilter::ConvertInputChannelIndicesToKrnParam(MOS_FORMAT format, case Format_A16R16G16B16F: case Format_R5G6B5: case Format_R8G8B8: + case Format_RGBP: + case Format_444P: inputChannelIndices[0] = 0; inputChannelIndices[1] = 1; inputChannelIndices[2] = 2; @@ -1105,6 +1280,12 @@ MOS_STATUS VpL0FcFilter::ConvertInputChannelIndicesToKrnParam(MOS_FORMAT format, inputChannelIndices[2] = 0; inputChannelIndices[3] = 3; break; + case Format_BGRP: + inputChannelIndices[0] = 2; + inputChannelIndices[1] = 1; + inputChannelIndices[2] = 0; + inputChannelIndices[3] = 3; + break; default: VP_PUBLIC_CHK_STATUS_RETURN(MOS_STATUS_UNIMPLEMENTED); } @@ -1636,7 +1817,7 @@ MOS_STATUS VpL0FcFilter::SetupSingleFcFastExpressBti(uint32_t uIndex, const L0_F switch (uIndex) { case FC_FP_FASTEXPRESS_INPUTPL0: - surfaceParam.surfType = SurfaceTypeFcInputLayer0; + surfaceParam.surfType = compParam.inputLayersParam[0].needIntermediaSurface ? SurfaceTypeFcIntermediaInput : SurfaceTypeFcInputLayer0; if (compParam.inputLayersParam[0].diParams.enabled && compParam.inputLayersParam[0].diParams.params.DIMode == DI_MODE_BOB) { @@ -1708,6 +1889,7 @@ MOS_STATUS VpL0FcFilter::GenerateFastExpressInputOutputParam(L0_FC_COMP_PARAM &c VP_FUNC_CALL(); L0_FC_LAYER_PARAM &inputLayer = compParam.inputLayersParam[0]; L0_FC_LAYER_PARAM &outputLayer = compParam.outputLayerParam; + MOS_FORMAT surfOverwriteFormat = inputLayer.needIntermediaSurface ? inputLayer.interMediaOverwriteSurface : inputLayer.surf->osSurface->Format; VP_PUBLIC_CHK_NULL_RETURN(inputLayer.surf); VP_PUBLIC_CHK_NULL_RETURN(inputLayer.surf->osSurface); VP_PUBLIC_CHK_NULL_RETURN(outputLayer.surf); @@ -1716,10 +1898,10 @@ MOS_STATUS VpL0FcFilter::GenerateFastExpressInputOutputParam(L0_FC_COMP_PARAM &c uint32_t inputWidth = MOS_MIN(static_cast(inputLayer.surf->osSurface->dwWidth), static_cast(inputLayer.surf->rcSrc.right)); uint32_t inputHeight = MOS_MIN(static_cast(inputLayer.surf->osSurface->dwHeight), static_cast(inputLayer.surf->rcSrc.bottom)); VP_PUBLIC_CHK_STATUS_RETURN(ConvertCscToKrnParam(inputLayer.surf->ColorSpace, compParam.mainCSpace, imageParam.csc)); - VP_PUBLIC_CHK_STATUS_RETURN(ConvertInputChannelIndicesToKrnParam(inputLayer.surf->osSurface->Format, imageParam.inputChannelIndices)); + VP_PUBLIC_CHK_STATUS_RETURN(ConvertInputChannelIndicesToKrnParam(surfOverwriteFormat, imageParam.inputChannelIndices)); VP_PUBLIC_CHK_STATUS_RETURN(ConvertScalingRotToKrnParam(inputLayer.surf->rcSrc, inputLayer.surf->rcDst, inputLayer.scalingMode, inputWidth, inputHeight, inputLayer.rotation, imageParam.scaleParam, imageParam.controlSetting.samplerType, imageParam.coordShift)); - VP_PUBLIC_CHK_STATUS_RETURN(ConvertChromaUpsampleToKrnParam(inputLayer.surf->osSurface->Format, inputLayer.surf->ChromaSiting, inputLayer.scalingMode, inputWidth, inputHeight, imageParam.coordShift.chromaShiftX, imageParam.coordShift.chromaShiftY, imageParam.controlSetting.isChromaShift)); - VP_PUBLIC_CHK_STATUS_RETURN(ConvertPlaneNumToKrnParam(inputLayer.surf->osSurface->Format, true, imageParam.inputPlaneNum)); + VP_PUBLIC_CHK_STATUS_RETURN(ConvertChromaUpsampleToKrnParam(surfOverwriteFormat, inputLayer.surf->ChromaSiting, inputLayer.scalingMode, inputWidth, inputHeight, imageParam.coordShift.chromaShiftX, imageParam.coordShift.chromaShiftY, imageParam.controlSetting.isChromaShift)); + VP_PUBLIC_CHK_STATUS_RETURN(ConvertPlaneNumToKrnParam(surfOverwriteFormat, true, imageParam.inputPlaneNum)); VP_PUBLIC_CHK_STATUS_RETURN(ConvertAlignedTrgRectToKrnParam(inputLayer.surf, outputLayer.surf, compParam.enableColorFill, targetParam)); VP_PUBLIC_CHK_STATUS_RETURN(ConvertPlaneNumToKrnParam(outputLayer.surf->osSurface->Format, false, targetParam.planeNumber)); diff --git a/media_softlet/agnostic/common/vp/hal/features/vp_l0_fc_filter.h b/media_softlet/agnostic/common/vp/hal/features/vp_l0_fc_filter.h index fb26373b4c1..ebb322ce47a 100644 --- a/media_softlet/agnostic/common/vp/hal/features/vp_l0_fc_filter.h +++ b/media_softlet/agnostic/common/vp/hal/features/vp_l0_fc_filter.h @@ -56,6 +56,8 @@ struct L0_FC_LAYER_PARAM VPHAL_BLENDING_PARAMS blendingParams = {}; VPHAL_PROCAMP_PARAMS procampParams = {}; L0_FC_DI_PARAMS diParams = {}; + bool needIntermediaSurface = false; + MOS_FORMAT interMediaOverwriteSurface = Format_Any; }; struct L0_FC_COMP_PARAM @@ -224,6 +226,10 @@ class VpL0FcFilter : public VpFilter MOS_STATUS SetupSingleFcCommonKrnArg(uint32_t layerNum, std::vector &imageParams, L0_FC_KRN_TARGET_PARAM &targetParam, uint32_t localSize[3], KRN_ARG &krnArg, bool &bInit); MOS_STATUS SetupSingleFcCommonBti(uint32_t uIndex, const L0_FC_COMP_PARAM &compParam, SURFACE_PARAMS &surfaceParam, bool &bInit); + MOS_STATUS GenerateFc444PL3InputParam(L0_FC_LAYER_PARAM &layer, uint32_t layerNumber, L0_FC_KERNEL_PARAM ¶m, uint32_t layerIndex); + MOS_STATUS SetupSingleFc444PL3InputKrnArg(uint32_t localSize[3], KRN_ARG &krnArg, bool &bInit, uint32_t inputChannelIndices[4], uint32_t outputChannelIndices[4], uint32_t planeChannelIndices); + MOS_STATUS SetupSingleFc444PL3InputBti(uint32_t uIndex, SURFACE_PARAMS &surfaceParam, uint32_t layerIndex, bool &bInit); + MOS_STATUS GetDefaultScalingMode(VPHAL_SCALING_MODE &defaultScalingMode, SwFilterPipe &executedPipe); MOS_STATUS GetChromaSitingFactor(MOS_FORMAT format, uint8_t &hitSecPlaneFactorX, uint8_t &hitSecPlaneFactorY); MOS_STATUS GetBitNumber(MOS_FORMAT format, uint8_t *pOriginBitNumber, uint8_t *pStoredBitNumber, uint8_t *pAlphaBitNumber); @@ -267,6 +273,7 @@ class VpL0FcFilter : public VpFilter //to avoid duplicate allocate and free KERNEL_INDEX_ARG_MAP m_fcCommonKrnArgs; KERNEL_INDEX_ARG_MAP m_fcFastExpressKrnArgs; + KERNEL_INDEX_ARG_MAP m_fc444PL3InputKrnArgs; MEDIA_CLASS_DEFINE_END(vp__VpL0FcFilter) }; diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_render_l0_fc_kernel.cpp b/media_softlet/agnostic/common/vp/hal/packet/vp_render_l0_fc_kernel.cpp index d538e953e8b..9c632159c80 100644 --- a/media_softlet/agnostic/common/vp/hal/packet/vp_render_l0_fc_kernel.cpp +++ b/media_softlet/agnostic/common/vp/hal/packet/vp_render_l0_fc_kernel.cpp @@ -42,6 +42,9 @@ VpRenderL0FcKernel::VpRenderL0FcKernel(PVP_MHWINTERFACE hwInterface, VpKernelID case kernelL0FcFP: m_kernelName = "FastExpress_fc_fp"; break; + case kernelL0Fc444PL3Input: + m_kernelName = "ImageRead_fc_444PL3_input"; + break; default: m_kernelName.assign(""); VP_RENDER_ASSERTMESSAGE("Kernel ID cannot map to Kernel Name"); @@ -317,10 +320,14 @@ MOS_STATUS VpRenderL0FcKernel::SetupSurfaceState() .DwordValue; pRenderSurfaceParams->Component = COMPONENT_VPCommon; - kernelSurfaceParam.surfaceOverwriteParams.updatedSurfaceParams = true; - kernelSurfaceParam.surfaceOverwriteParams.format = surf->second->osSurface->Format; - kernelSurfaceParam.surfaceOverwriteParams.width = MOS_MIN(static_cast(surf->second->osSurface->dwWidth), static_cast(surf->second->rcSrc.right)); - kernelSurfaceParam.surfaceOverwriteParams.height = MOS_MIN(static_cast(surf->second->osSurface->dwHeight), static_cast(surf->second->rcSrc.bottom)); + if (m_kernelId == kernelL0FcCommon || + m_kernelId == kernelL0FcFP) + { + kernelSurfaceParam.surfaceOverwriteParams.updatedSurfaceParams = true; + kernelSurfaceParam.surfaceOverwriteParams.format = surf->second->osSurface->Format; + kernelSurfaceParam.surfaceOverwriteParams.width = MOS_MIN(static_cast(surf->second->osSurface->dwWidth), static_cast(surf->second->rcSrc.right)); + kernelSurfaceParam.surfaceOverwriteParams.height = MOS_MIN(static_cast(surf->second->osSurface->dwHeight), static_cast(surf->second->rcSrc.bottom)); + } if (surfHandle->second.needVerticalStirde) { diff --git a/media_softlet/media_interface/media_interfaces_lnl/media_interfaces_lnl.cpp b/media_softlet/media_interface/media_interfaces_lnl/media_interfaces_lnl.cpp index b4f8a4c6d7c..1f0fcda0369 100644 --- a/media_softlet/media_interface/media_interfaces_lnl/media_interfaces_lnl.cpp +++ b/media_softlet/media_interface/media_interfaces_lnl/media_interfaces_lnl.cpp @@ -53,6 +53,7 @@ #include "igvpkrn_l0_xe2_hpg.h" #include "igvpfc_common_xe2.h" #include "igvpfc_fp_xe2.h" +#include "igvpfc_444PL3_input_xe2.h" #endif using namespace mhw::vdbox::avp::xe2_lpm_base; @@ -151,6 +152,7 @@ void VphalInterfacesXe2_Lpm::InitPlatformKernelBinary( vpPlatformInterface->AddVpNativeAdvKernelEntryToList(IGVP3DLUT_GENERATION_XE2_HPG, IGVP3DLUT_GENERATION_XE2_HPG_SIZE, "hdr_3dlut_l0"); AddVpNativeKernelEntryToListFc_commonXe2(*vpPlatformInterface); AddVpNativeKernelEntryToListFc_fpXe2(*vpPlatformInterface); + AddVpNativeKernelEntryToListFc_444pl3_inputXe2(*vpPlatformInterface); #endif }