Skip to content

Commit e876062

Browse files
authored
Merge branch 'master' into master
2 parents c95e85f + 09f7a58 commit e876062

File tree

53 files changed

+1081
-431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1081
-431
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
cmake_minimum_required(VERSION 3.5)
2222
project(IntelMediaDriver)
23-
set(MEDIA_VERSION "24.4.2${MEDIA_VERSION_EXTRA}" CACHE STRING "" FORCE)
23+
set(MEDIA_VERSION "24.4.3${MEDIA_VERSION_EXTRA}" CACHE STRING "" FORCE)
2424

2525

2626

cmrtlib/linux/hardware/cm_device_os.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,18 +483,20 @@ CmDevice_RT::CmDevice_RT(
483483
m_deviceInUmd(nullptr),
484484
m_cmCreated(true),
485485
m_vaDisplay(vaDisplay),
486+
m_drmIndex(0),
487+
m_fvaCmExtSendReqMsg(nullptr),
486488
#ifdef ANDROID
487489
m_display(nullptr),
488490
#endif
489-
m_drmIndex(0),
490-
m_fvaCmExtSendReqMsg(nullptr),
491491
m_gtpinEnabled(false),
492492
m_gtpinBufferUP0(nullptr),
493493
m_gtpinBufferUP1(nullptr),
494494
m_gtpinBufferUP2(nullptr),
495495
m_createOption(createOption),
496-
m_driverStoreEnabled(0),
497-
m_driFileDescriptor(0)
496+
#if !defined(ANDROID)
497+
m_driFileDescriptor(0),
498+
#endif
499+
m_driverStoreEnabled(0)
498500
{
499501

500502
// New Surface Manager

media_common/agnostic/common/vp/hal/vp_common_defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ enum VpKernelIDNext
197197
{
198198
vpKernelIDNextBase = 0x200,
199199
kernelHdr3DLutCalc = vpKernelIDNextBase,
200-
kernelHdr3DLutCalcL0,
200+
kernelHdr3DLutCalcOcl,
201201
kernelHVSCalc,
202202
vpKernelIDNextMax
203203
};

media_driver/agnostic/common/codec/hal/codechal_encode_avc_base.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3270,6 +3270,11 @@ MOS_STATUS CodechalEncodeAvcBase::SetSliceStructs()
32703270
{
32713271
for (uint8_t i = 0; i < (slcParams->num_ref_idx_l0_active_minus1 + 1); i++)
32723272
{
3273+
if (slcParams->RefPicList[0][i].FrameIdx >= CODEC_AVC_MAX_NUM_REF_FRAME)
3274+
{
3275+
CODECHAL_ENCODE_ASSERTMESSAGE("Invalid slice parameters.");
3276+
return MOS_STATUS_INVALID_PARAMETER;
3277+
}
32733278
slcParams->PicOrder[0][i].Picture.FrameIdx =
32743279
m_picIdx[slcParams->RefPicList[0][i].FrameIdx].ucPicIdx;
32753280
slcParams->PicOrder[0][i].Picture.PicFlags =
@@ -3280,6 +3285,11 @@ MOS_STATUS CodechalEncodeAvcBase::SetSliceStructs()
32803285
{
32813286
for (uint8_t i = 0; i < (slcParams->num_ref_idx_l1_active_minus1 + 1); i++)
32823287
{
3288+
if (slcParams->RefPicList[1][i].FrameIdx >= CODEC_AVC_MAX_NUM_REF_FRAME)
3289+
{
3290+
CODECHAL_ENCODE_ASSERTMESSAGE("Invalid slice parameters.");
3291+
return MOS_STATUS_INVALID_PARAMETER;
3292+
}
32833293
slcParams->PicOrder[1][i].Picture.FrameIdx =
32843294
m_picIdx[slcParams->RefPicList[1][i].FrameIdx].ucPicIdx;
32853295
slcParams->PicOrder[1][i].Picture.PicFlags =

media_driver/agnostic/common/codec/hal/codechal_vdenc_avc.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4319,11 +4319,6 @@ MOS_STATUS CodechalVdencAvcState::SetSliceStructs()
43194319
const uint8_t hwInvalidFrameId = CODEC_AVC_MAX_NUM_REF_FRAME - 1;
43204320
bool isActiveRef[hwInvalidFrameId] = {};
43214321
uint8_t swapIndex = CODEC_AVC_NUM_UNCOMPRESSED_SURFACE;
4322-
if (slcParams->num_ref_idx_l0_active_minus1 >= CODEC_MAX_NUM_REF_FIELD || slcParams->num_ref_idx_l1_active_minus1 >= CODEC_MAX_NUM_REF_FIELD)
4323-
{
4324-
CODECHAL_ENCODE_ASSERTMESSAGE("Invalid slice parameters.");
4325-
return MOS_STATUS_INVALID_PARAMETER;
4326-
}
43274322

43284323
for (uint32_t sliceCount = 0; sliceCount < m_numSlices; sliceCount++)
43294324
{
@@ -5649,6 +5644,12 @@ MOS_STATUS CodechalVdencAvcState::InitializePicture(const EncoderParams &params)
56495644
// Picture and slice header packing flag from DDI caps
56505645
m_acceleratorHeaderPackingCaps = params.bAcceleratorHeaderPackingCaps;
56515646

5647+
if (m_avcSliceParams->num_ref_idx_l0_active_minus1 >= CODEC_MAX_NUM_REF_FIELD || m_avcSliceParams->num_ref_idx_l1_active_minus1 >= CODEC_MAX_NUM_REF_FIELD)
5648+
{
5649+
CODECHAL_ENCODE_ASSERTMESSAGE("Invalid slice parameters.");
5650+
return MOS_STATUS_INVALID_PARAMETER;
5651+
}
5652+
56525653
CODECHAL_ENCODE_CHK_NULL_RETURN(m_avcIQMatrixParams);
56535654

56545655
// so far this only applies to AVC

media_driver/agnostic/common/hw/vdbox/mhw_vdbox_avp_interface.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Intel Corporation
2+
* Copyright (c) 2020-2024, Intel Corporation
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -93,6 +93,7 @@ struct MhwVdboxAvpPicStateParams
9393
uint8_t m_refOrderHints[7];
9494
uint8_t m_savedRefOrderHints[7][7];
9595
uint8_t m_refMaskMfProj;
96+
uint8_t m_validRefPicIdx;
9697
};
9798

9899
struct MhwVdboxAvpPakInsertObjParams

media_driver/agnostic/gen12/codec/hal/codechal_decode_avc_g12.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,10 @@ MOS_STATUS CodechalDecodeAvcG12::DecodeStateLevel()
308308
CODECHAL_DECODE_CHK_STATUS_RETURN(m_osInterface->pfnGetCommandBuffer(m_osInterface, &cmdBuffer, 0));
309309

310310
auto mmioRegisters = m_hwInterface->GetMfxInterface()->GetMmioRegisters(m_vdboxIndex);
311-
HalOcaInterface::On1stLevelBBStart(cmdBuffer, *m_osInterface->pOsContext, m_osInterface->CurrentGpuContextHandle, *m_miInterface, *mmioRegisters);
312311

312+
HalOcaInterface::On1stLevelBBStart(cmdBuffer, *m_osInterface->pOsContext, m_osInterface->CurrentGpuContextHandle, *m_miInterface, *mmioRegisters);
313+
HalOcaInterface::OnDispatch(cmdBuffer, *m_osInterface, *m_miInterface, *m_miInterface->GetMmioRegisters());
314+
313315
MHW_MI_FORCE_WAKEUP_PARAMS forceWakeupParams;
314316
MOS_ZeroMemory(&forceWakeupParams, sizeof(MHW_MI_FORCE_WAKEUP_PARAMS));
315317
forceWakeupParams.bMFXPowerWellControl = true;

media_driver/agnostic/gen12/codec/hal/codechal_decode_hevc_g12.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,11 +1637,14 @@ MOS_STATUS CodechalDecodeHevcG12::SendPictureLongFormat()
16371637
}
16381638

16391639
HalOcaInterface::On1stLevelBBStart(scdryCmdBuffer, *m_osInterface->pOsContext, m_osInterface->CurrentGpuContextHandle, *m_miInterface, *mmioRegisters);
1640+
HalOcaInterface::OnDispatch(scdryCmdBuffer, *m_osInterface, *m_miInterface, *m_miInterface->GetMmioRegisters());
16401641
}
16411642
else
16421643
{
16431644
HalOcaInterface::On1stLevelBBStart(primCmdBuffer, *m_osInterface->pOsContext, m_osInterface->CurrentGpuContextHandle, *m_miInterface, *mmioRegisters);
1645+
HalOcaInterface::OnDispatch(primCmdBuffer, *m_osInterface, *m_miInterface, *m_miInterface->GetMmioRegisters());
16441646
}
1647+
16451648

16461649
CODECHAL_DECODE_CHK_STATUS_RETURN(InitPicLongFormatMhwParams());
16471650

media_driver/agnostic/gen12/hw/vdbox/mhw_vdbox_avp_g12_X.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2023, Intel Corporation
2+
* Copyright (c) 2020-2024, Intel Corporation
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -1675,9 +1675,20 @@ MOS_STATUS MhwVdboxAvpInterfaceG12::AddAvpDecodePicStateCmd(
16751675
memset(refScaleFactor, 0, sizeof(refScaleFactor));
16761676
memset(refFrameRes, 0, sizeof(refFrameRes));
16771677

1678-
for (auto i = 0; i < 7; i++)//i=0 corresponds to LAST_FRAME
1678+
for (auto i = 0; i < av1NumInterRefFrames; i++) //i=0 corresponds to LAST_FRAME
16791679
{
1680-
refPicIndex = refFrameList[picParams->m_refFrameIdx[i]].FrameIdx;
1680+
refPicIndex = 0xFF;
1681+
if (picParams->m_refFrameIdx[i] < av1TotalRefsPerFrame &&
1682+
refFrameList[picParams->m_refFrameIdx[i]].FrameIdx < CODECHAL_MAX_DPB_NUM_AV1)
1683+
{
1684+
refPicIndex = refFrameList[picParams->m_refFrameIdx[i]].FrameIdx;
1685+
}
1686+
else
1687+
{
1688+
refPicIndex = params->m_validRefPicIdx;
1689+
}
1690+
MHW_ASSERT(refPicIndex < CODECHAL_MAX_DPB_NUM_AV1);
1691+
16811692
refFrameWidth[i] = params->m_refList[refPicIndex]->m_frameWidth;
16821693
refFrameHeight[i] = params->m_refList[refPicIndex]->m_frameHeight;
16831694

media_driver/linux/Xe_M/ddi/media_libva_caps_dg2.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class MediaLibvaCapsDG2 : public MediaLibvaCapsG12
5656
{VP9, Vdenc, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10BPP |
5757
VA_RT_FORMAT_YUV444 | VA_RT_FORMAT_YUV444_10 | VA_RT_FORMAT_RGB32 |
5858
VA_RT_FORMAT_RGB32_10BPP},
59-
{AV1, Vdenc, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10BPP}
59+
{AV1, Vdenc, VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10BPP |
60+
VA_RT_FORMAT_RGB32 | VA_RT_FORMAT_RGB32_10BPP}
6061
};
6162
m_encodeFormatTable = (struct EncodeFormatTable*)(&encodeFormatTableDG2[0]);
6263
m_encodeFormatCount = sizeof(encodeFormatTableDG2)/sizeof(struct EncodeFormatTable);

media_driver/linux/common/codec/ddi/media_ddi_encode_av1.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ VAStatus DdiEncodeAV1::ParseSeqParams(void *ptr)
453453
#else
454454
av1SeqParams->SeqFlags.fields.HierarchicalFlag = seqParams->reserved8b;
455455
#endif
456+
av1SeqParams->SeqFlags.fields.DisplayFormatSwizzle = NeedDisplayFormatSwizzle(m_encodeCtx->RTtbl.pCurrentRT);
456457

457458
return VA_STATUS_SUCCESS;
458459
}

media_driver/linux/common/codec/ddi/media_ddi_encode_av1.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,25 @@ class DdiEncodeAV1 : public DdiEncodeBase
309309

310310
VAStatus CheckTile(const VAEncPictureParameterBufferAV1 *picParams);
311311

312+
//!
313+
//! \brief Check whether swizzle needed
314+
//!
315+
//! \param [in] rawSurface
316+
//! Pointer of Raw Surface
317+
//!
318+
//! \return bool, true if need, otherwise false
319+
//!
320+
inline bool NeedDisplayFormatSwizzle(DDI_MEDIA_SURFACE *rawSurface)
321+
{
322+
if (Media_Format_A8R8G8B8 == rawSurface->format ||
323+
Media_Format_X8R8G8B8 == rawSurface->format ||
324+
Media_Format_B10G10R10A2 == rawSurface->format)
325+
{
326+
return true;
327+
}
328+
329+
return false;
330+
}
312331
uint32_t savedTargetBit[ENCODE_AV1_MAX_NUM_TEMPORAL_LAYERS] = { 0 };
313332
uint32_t savedFrameRate[ENCODE_AV1_MAX_NUM_TEMPORAL_LAYERS] = { 0 };
314333
uint32_t savedMaxBitRate[ENCODE_AV1_MAX_NUM_TEMPORAL_LAYERS] = { 0 };

media_driver/linux/common/ddi/media_libva.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <va/va_backend_prot.h>
4444
#endif
4545
#ifdef ANDROID
46+
#include <va/va_android.h>
4647
#if VA_MAJOR_VERSION < 1
4748
#include "va_internal_android.h"
4849
#endif

media_driver/media_softlet/agnostic/gen12/codec/hal/dec/av1/features/decode_av1_reference_frames_g12.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019-2021, Intel Corporation
2+
* Copyright (c) 2019-2024, Intel Corporation
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -100,12 +100,18 @@ namespace decode
100100
else
101101
{
102102
PCODEC_PICTURE refFrameList = &(picParams.m_refFrameMap[0]);
103-
uint8_t refPicIndex = picParams.m_refFrameIdx[i];
104-
if (refPicIndex >= av1TotalRefsPerFrame)
103+
uint8_t refPicIndex = picParams.m_refFrameIdx[i];
104+
uint8_t frameIdx = 0xFF;
105+
if (refPicIndex < av1TotalRefsPerFrame &&
106+
refFrameList[refPicIndex].FrameIdx < CODECHAL_MAX_DPB_NUM_AV1)
105107
{
106-
continue;
108+
frameIdx = refFrameList[refPicIndex].FrameIdx;
109+
}
110+
else
111+
{
112+
MOS_STATUS hr = GetValidReferenceIndex(&frameIdx);
107113
}
108-
m_activeReferenceList.push_back(refFrameList[refPicIndex].FrameIdx);
114+
m_activeReferenceList.push_back(frameIdx);
109115
}
110116
}
111117

@@ -116,7 +122,7 @@ namespace decode
116122
{
117123
DECODE_FUNC_CALL();
118124

119-
if (frameIndex > CODECHAL_MAX_DPB_NUM_AV1)
125+
if (frameIndex >= CODECHAL_MAX_DPB_NUM_AV1)
120126
{
121127
DECODE_ASSERTMESSAGE("Invalid reference frame index");
122128
return nullptr;
@@ -177,6 +183,10 @@ namespace decode
177183
for (auto i = 0; i < av1NumInterRefFrames; i++)
178184
{
179185
auto index = m_picParams->m_refFrameIdx[i];
186+
if (index >= av1TotalRefsPerFrame)
187+
{
188+
continue;
189+
}
180190
uint8_t frameIdx = m_picParams->m_refFrameMap[index].FrameIdx;
181191
if (frameIdx >= m_basicFeature->m_maxFrameIndex)
182192
{

media_driver/media_softlet/agnostic/gen12_base/codec/hal/dec/av1/packet/decode_av1_picture_packet_g12_base.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019-2021, Intel Corporation
2+
* Copyright (c) 2019-2024, Intel Corporation
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -1498,6 +1498,8 @@ namespace decode{
14981498
}
14991499
}
15001500

1501+
DECODE_CHK_STATUS(m_av1BasicFeature->m_refFrames.GetValidReferenceIndex(&picStateParams.m_validRefPicIdx));
1502+
15011503
return MOS_STATUS_SUCCESS;
15021504
}
15031505

0 commit comments

Comments
 (0)