Skip to content

Commit 5232038

Browse files
authored
Merge branch 'master' into master
2 parents 6239c56 + 9b1f173 commit 5232038

File tree

516 files changed

+107160
-7340
lines changed

Some content is hidden

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

516 files changed

+107160
-7340
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.3${MEDIA_VERSION_EXTRA}" CACHE STRING "" FORCE)
23+
set(MEDIA_VERSION "25.1.0${MEDIA_VERSION_EXTRA}" CACHE STRING "" FORCE)
2424

2525

2626

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Media driver supports below two builds
9898
- **Full Feature Build** is ***default*** driver build, which supports all feature by hardware accelerator and close source shaders(media kernel binaries). Most of OSVs(like RHEL/SUSE/fedora) are using this build.
9999
- **Free Kernel Build**, enables fully open source shaders(media kernels) and hardware features but the features would be limited.
100100
101-
About Ubuntu/Debian OSV, they provide [intel-media-va-driver-non-free](https://packages.ubuntu.com/disco/intel-media-va-driver-non-free) (Full feature build) and [intel-media-va-driver](https://packages.ubuntu.com/disco/intel-media-va-driver) (Free kernel build) two packages. ***Free*** here means open source kernel but not related to fee need to pay. You could refer to [build options](https://github.com/intel/media-driver?tab=readme-ov-file#build-options) for more detail.
101+
About Ubuntu/Debian OSV, they provide [intel-media-va-driver-non-free](https://packages.ubuntu.com/search?keywords=intel-media-driver-non-free&searchon=sourcenames) (Full feature build) and [intel-media-va-driver](https://packages.ubuntu.com/search?keywords=intel-media-driver&searchon=sourcenames) (Free kernel build) two packages. ***Free*** here means open source kernel but not related to fee need to pay. You could refer to [build options](https://github.com/intel/media-driver?tab=readme-ov-file#build-options) for more detail.
102102
103103
If you are looking forward to have a big table to share media component features on these two builds, below tables are good referene for your information.
104104

media_common/agnostic/common/codec/shared/codec_def_encode_av1.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,14 @@ typedef struct _CODEC_AV1_ENCODE_PICTURE_PARAMS
555555
uint8_t value;
556556
} QualityInfoSupportFlags;
557557
uint8_t reserved8b[2];
558-
uint32_t Reserved10[14];
558+
559+
union
560+
{
561+
void *pBlkQualityInfo;
562+
uint32_t Reserved9[2];
563+
};
564+
565+
uint32_t Reserved10[12];
559566
} CODEC_AV1_ENCODE_PICTURE_PARAMS, *PCODEC_AV1_ENCODE_PICTURE_PARAMS;
560567

561568
/*! \brief Slice-level parameters of a compressed picture for AV1 encoding.

media_common/agnostic/common/codec/shared/codec_def_encode_avc.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -728,14 +728,12 @@ typedef struct _CODEC_AVC_ENCODE_PIC_PARAMS
728728
CODEC_PICTURE RefFrameList[CODEC_AVC_MAX_NUM_REF_FRAME];
729729

730730

731-
/*! \brief Defines each entry in the list that specifies the frame resource for reference pictures.
732-
*
733-
* the index of RefFrameListSurface[] corresponds to a FrameIdx, and the stored content is the surface resource associated with that FrameIdx.
734-
* Valid FrameIdx values range from [0..14, 0x7F].
735-
* RefFrameList[] must include all reference pictures in the Decoded Picture Buffer (DPB), ensuring that any picture referenced by the current or future pictures has a valid entry.
736-
*
737-
* Note: This structure is currently applicable only for Vulkan encoding.
738-
*/
731+
/*! \brief Each entry of the list specifies the frame resource of the reference pictures.
732+
*
733+
* The value of FrameIdx is the same as the reference frame index saved in RefList. And valid value range is [0..14, 0x7F].
734+
* RefFrameList[] should include all the reference pictures in DPB, which means either the picture is referred by current picture or future pictures, it should have a valid entry in it.
735+
* currently only for Vulkan encode
736+
*/
739737
MOS_SURFACE RefFrameListSurface[CODEC_AVC_MAX_NUM_REF_FRAME];
740738

741739
/*! \brief Denotes "used for reference" frames as defined in the AVC specification.

media_common/agnostic/common/hw/mhw_mi.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2021, Intel Corporation
2+
* Copyright (c) 2015-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"),
@@ -50,6 +50,10 @@ class MhwCpInterface;
5050
#define MHW_MI_DECODER_AV1_WATCHDOG_THRESHOLD_IN_MS 80
5151
#define MHW_MI_DECODER_16K_WATCHDOG_THRESHOLD_IN_MS 180
5252
#define MHW_MI_DECODER_16Kx16K_WATCHDOG_THRESHOLD_IN_MS 256
53+
#define MHW_MI_DECODER_FHD_WATCHDOG_THRESHOLD_IN_MS_PLUS 30
54+
#define MHW_MI_DECODER_4K_WATCHDOG_THRESHOLD_IN_MS_PLUS 60
55+
#define MHW_MI_DECODER_8K_WATCHDOG_THRESHOLD_IN_MS_PLUS 120
56+
#define MHW_MI_DECODER_16K_WATCHDOG_THRESHOLD_IN_MS_PLUS 200
5357
#define MHW_MI_WATCHDOG_COUNTS_PER_MILLISECOND (19200123 / 1000) // Time stamp counts per millisecond
5458

5559
typedef enum _MHW_COMMON_MI_ADDRESS_SHIFT
@@ -64,9 +68,9 @@ typedef enum _MHW_COMMON_MI_ADDRESS_SHIFT
6468

6569
typedef enum _MHW_MI_SET_PREDICATE_ENABLE
6670
{
67-
MHW_MI_SET_PREDICATE_DISABLE = 0x0,
68-
MHW_MI_SET_PREDICATE_ENABLE_ON_CLEAR,
69-
MHW_MI_SET_PREDICATE_ENABLE_ON_SET,
71+
MHW_MI_SET_PREDICATE_DISABLE = 0x0, // Predication is Disabled and CS will process commands as usual.
72+
MHW_MI_SET_PREDICATE_ENABLE_ON_CLEAR, // Following Commands will be NOOPED by CS only if the MI_PREDICATE_RESULT_2 is clear.
73+
MHW_MI_SET_PREDICATE_ENABLE_ON_SET, // Following Commands will be NOOPED by CS only if the MI_PREDICATE_RESULT_2 is set.
7074
MHW_MI_SET_PREDICATE_ENABLE_ALWAYS = 0xF,
7175
} MHW_MI_SET_PREDICATE_ENABLE;
7276

@@ -281,11 +285,13 @@ typedef struct _MHW_MI_ATOMIC_PARAMS
281285
typedef struct _MHW_MI_SEMAPHORE_WAIT_PARAMS
282286
{
283287
PMOS_RESOURCE presSemaphoreMem; // Semaphore memory Resource
288+
uint64_t gpuVirtualAddress; // Semaphore memory Resource
284289
uint32_t dwResourceOffset;
285290
bool bRegisterPollMode;
286291
bool bPollingWaitMode;
287292
uint32_t dwCompareOperation;
288293
uint32_t dwSemaphoreData;
294+
bool b64bComparEnableWithGPR;
289295
MHW_COMMON_MI_SEMAPHORE_COMPARE_OPERATION CompareOperation;
290296
}MHW_MI_SEMAPHORE_WAIT_PARAMS, *PMHW_MI_SEMAPHORE_WAIT_PARAMS;
291297

media_common/agnostic/common/hw/mhw_state_heap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ typedef struct _MHW_KERNEL_PARAM
253253
void *pExtra; //!< Kernel parameter
254254
uint8_t *pBinary; //!< Pointer to kernel binary
255255
int32_t iSize; //!< Kernel size
256+
int32_t iPaddingSize; //!< Padding size
256257
int32_t iGrfCount; //!< Number of registers
257258
int32_t iBTCount; //!< Number of BT entries
258259
int32_t iThreadCount; //!< Number of threads (max)

media_common/agnostic/common/os/mos_defs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ enum MOS_COMPONENT
512512
COMPONENT_MEMDECOMP,
513513
COMPONENT_MCPY,
514514
COMPONENT_OCA,
515+
COMPONENT_MOS,
515516
};
516517
C_ASSERT(COMPONENT_OCA == 11); // When adding, update assert
517518

media_common/agnostic/common/os/mos_os.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include "mos_oca_interface.h"
5151
#include "mos_cache_manager.h"
5252

53+
class MhwInterfacesNext;
5354
#define MOS_NAL_UNIT_LENGTH 4
5455
#define MOS_NAL_UNIT_STARTCODE_LENGTH 3
5556
#define MOS_MAX_PATH_LENGTH 256
@@ -254,12 +255,15 @@ typedef int32_t MOS_SUBMISSION_TYPE;
254255
#define EXTRA_PADDING_NEEDED 4096
255256
#define MEDIA_CMF_UNCOMPRESSED_WRITE 0xC
256257

258+
struct _MHW_BATCH_BUFFER;
259+
typedef struct _MHW_BATCH_BUFFER MHW_BATCH_BUFFER, * PMHW_BATCH_BUFFER;
257260
//!
258261
//! \brief Structure to command buffer
259262
//!
260263
typedef struct _MOS_COMMAND_BUFFER
261264
{
262265
MOS_RESOURCE OsResource; //!< OS Resource
266+
PMHW_BATCH_BUFFER syncMhwBatchBuffer; //!< Pointer to sync mhw batch buffer
263267

264268
// Common fields
265269
uint32_t *pCmdBase; //!< Base address (CPU)
@@ -573,7 +577,7 @@ struct MosStreamState
573577
uint32_t dwEnableMediaSoloFrameNum = 0; //!< The frame number at which MediaSolo will be enabled, 0 is not valid.
574578
int32_t bSoloInUse = 0; //!< Flag to indicate if MediaSolo is enabled
575579
#endif // MOS_MEDIASOLO_SUPPORTED
576-
580+
MhwInterfacesNext *mhwInterface = nullptr;
577581
};
578582

579583
// OS agnostic MOS objects
@@ -2056,6 +2060,8 @@ typedef struct _MOS_INTERFACE
20562060

20572061
bool (*pfnGetCacheSetting)(MOS_COMPONENT id, uint32_t feature, bool bOut, ENGINE_TYPE engineType, MOS_CACHE_ELEMENT &element, bool isHeapSurf);
20582062

2063+
bool (* pfnIsGpuSyncByCmd) (PMOS_INTERFACE osInterface);
2064+
20592065
// Virtual Engine related
20602066
int32_t bSupportVirtualEngine; //!< Enable virtual engine flag
20612067
int32_t bUseHwSemaForResSyncInVE; //!< Flag to indicate if UMD need to send HW sema cmd under this OS when there is a resource sync need with Virtual Engine interface
@@ -2094,6 +2100,7 @@ typedef struct _MOS_INTERFACE
20942100

20952101
//!< os interface extension
20962102
void *pOsExt;
2103+
MhwInterfacesNext *mhwInterface;
20972104
} MOS_INTERFACE;
20982105

20992106
#ifdef __cplusplus

media_common/agnostic/common/os/mos_util_user_feature_keys.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@
421421
#define __MEDIA_USER_FEATURE_VALUE_VP_MMC_IN_USE "VP MMC In Use"
422422

423423
#define __MEDIA_USER_FEATURE_VALUE_NULLHW_ENABLE "NULL HW Enable"
424+
#if (_DEBUG || _RELEASE_INTERNAL)
425+
#define __MEDIA_USER_FEATURE_VALUE_NULLHW_PROXY_REPEAT_COUNT "NULL HW Proxy Repeat Count"
426+
#endif
424427
#define __MEDIA_USER_FEATURE_VALUE_MOCKADAPTOR_PLATFORM "MockAdaptor Platform"
425428
#define __MEDIA_USER_FEATURE_VALUE_MOCKADAPTOR_STEPPING "MockAdaptor Stepping"
426429
#define __MEDIA_USER_FEATURE_VALUE_MOCKADAPTOR_DEVICE "MockAdaptor Device ID"

media_common/agnostic/common/os/user_setting/media_user_setting_configure.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#define __MEDIA_USER_SETTING_CONFIGURE__H__
2929

3030
#include <string>
31+
#include <set>
3132
#include "media_user_setting_definition.h"
3233
#include "mos_utilities.h"
3334

@@ -229,6 +230,7 @@ class Configure
229230
std::string m_statedReportPath = "";
230231
#if (_DEBUG || _RELEASE_INTERNAL)
231232
std::string m_pidPath = "";
233+
static std::set<std::string> m_nonPidRegPaths; // Record non-pid reg path which does not have inner pid path
232234
#endif
233235
};
234236
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,8 @@ struct VPHAL_RENDER_PARAMS
10751075

10761076
bool bForceToRender = false; // Force to render to perform scaling.
10771077

1078+
HANDLE gpuAppTaskEvent; //!< GPU App task event
1079+
10781080
VPHAL_RENDER_PARAMS() : uSrcCount(0),
10791081
pSrc(),
10801082
uDstCount(0),
@@ -1097,7 +1099,8 @@ struct VPHAL_RENDER_PARAMS
10971099
pExtensionData(nullptr),
10981100
bPathKernel(false),
10991101
bUseVEHdrSfc(false),
1100-
bNonFirstFrame(false)
1102+
bNonFirstFrame(false),
1103+
gpuAppTaskEvent(nullptr)
11011104
{
11021105
}
11031106
};

media_common/agnostic/common/vp/kdll/hal_kerneldll_next.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ typedef struct tagKdll_CacheEntry
636636
// Kernel binary
637637
uint8_t *pBinary; // kernel binary
638638
int iSize; // kernel size
639+
int iPaddingSize; //kernel padding size
639640

640641
// Component kernel information
641642
int iKUID; // kernel unique id (static kernel)

media_common/linux/common/os/mos_defs_specific.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include <pthread.h>
3131
#include <semaphore.h>
32+
#include <cstdint>
3233
#include <string>
3334

3435
typedef pthread_mutex_t MOS_MUTEX, *PMOS_MUTEX; //!< mutex pointer

media_driver/agnostic/Xe_M/Xe_HPM/codec/hal/codechal_hw_xe_hpm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ CodechalHwInterfaceXe_Hpm::CodechalHwInterfaceXe_Hpm(
135135
: CodechalHwInterfaceG12(osInterface, codecFunction, mhwInterfaces, disableScalability)
136136
{
137137
CODECHAL_HW_FUNCTION_ENTER;
138-
m_avpInterface = static_cast<MhwInterfacesXehp_Sdv*>(mhwInterfaces)->m_avpInterface;
138+
139139
PrepareCmdSize(codecFunction);
140140
}
141141

media_driver/agnostic/Xe_M/Xe_XPM/codec/hal/codechal_hw_xe_xpm.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ CodechalHwInterfaceXe_Xpm::CodechalHwInterfaceXe_Xpm(
4949
{
5050
CODECHAL_HW_FUNCTION_ENTER;
5151

52-
53-
m_avpInterface = static_cast<MhwInterfacesXehp_Sdv*>(mhwInterfaces)->m_avpInterface;
54-
5552
m_bltState = MOS_New(BltStateXe_Xpm, m_osInterface);
5653
if(m_bltState != nullptr)
5754
{

media_driver/agnostic/Xe_M/Xe_XPM/hw/mhw_mi_hwcmd_xe_xpm.h

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,6 +2459,53 @@ class mhw_mi_xe_xpm
24592459
static const size_t byteSize = 12;
24602460
};
24612461

2462+
//!
2463+
//! \brief MI_USER_INTERRUPT
2464+
//! \details
2465+
//! This command is used to communicate Force Wakeup request to PM unit. No
2466+
//! The MI_USER_INTERRUPT command is used to generate a User Interrupt
2467+
//! condition. The parser will continue parsing after processing this
2468+
//! command. See User Interrupt.
2469+
//!
2470+
struct MI_USER_INTERRUPT_CMD
2471+
{
2472+
union
2473+
{
2474+
struct
2475+
{
2476+
uint32_t Reserved0 : __CODEGEN_BITFIELD( 0, 22) ; //!< Reserved
2477+
uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
2478+
uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
2479+
};
2480+
uint32_t Value;
2481+
} DW0;
2482+
2483+
//! \name Local enumerations
2484+
2485+
enum MI_COMMAND_OPCODE
2486+
{
2487+
MI_COMMAND_OPCODE_MIUSERINTERRUPT = 2, //!< No additional details
2488+
};
2489+
2490+
enum COMMAND_TYPE
2491+
{
2492+
COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
2493+
};
2494+
2495+
//! \name Initializations
2496+
2497+
//! \brief Explicit member initialization function
2498+
MI_USER_INTERRUPT_CMD()
2499+
{
2500+
DW0.Value = 0x1000000;
2501+
//DW0.MiCommandOpcode = MI_COMMAND_OPCODE_MIUSERINTERRUPT;
2502+
//DW0.CommandType = COMMAND_TYPE_MICOMMAND;
2503+
}
2504+
2505+
static const size_t dwSize = 1;
2506+
static const size_t byteSize = 4;
2507+
};
2508+
24622509
};
24632510

24642511
#pragma pack()

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

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8048,6 +8048,80 @@ bool CodechalVdencAvcState::IsMBBRCControlEnabled()
80488048
return m_mbBrcEnabled || m_avcPicParam->bNativeROI;
80498049
}
80508050

8051+
MOS_STATUS CodechalVdencAvcState::GetVulkanQueryPoolResults(
8052+
uint32_t queryFrameIndex,
8053+
void *pData,
8054+
uint64_t dataOffset,
8055+
bool is64bit,
8056+
uint8_t reportStatus,
8057+
bool reportOffset,
8058+
bool reportBitstreamSize)
8059+
{
8060+
CODECHAL_ENCODE_FUNCTION_ENTER;
8061+
MOS_STATUS eStatus = MOS_STATUS_SUCCESS;
8062+
8063+
EncodeStatusBuffer *encodeStatusBuf = &m_encodeStatusBuf;
8064+
8065+
uint32_t baseOffset =
8066+
queryFrameIndex * m_encodeStatusBuf.dwReportSize +
8067+
sizeof(uint32_t) * 2;
8068+
8069+
uint8_t *bytePtr = reinterpret_cast<uint8_t *>(pData);
8070+
uint64_t vkDataoffset = dataOffset;
8071+
uint8_t *statusData = reinterpret_cast<uint8_t *>(m_encodeStatusBuf.pData);
8072+
8073+
size_t dataSize = is64bit ? sizeof(uint64_t) : sizeof(uint32_t);
8074+
uint64_t offsetResult = 0;
8075+
uint64_t statusResult = 1;
8076+
void *pOffsetResult = &offsetResult;
8077+
void *pStatusResult = &statusResult;
8078+
8079+
if (!is64bit)
8080+
{
8081+
offsetResult = static_cast<uint32_t>(offsetResult);
8082+
statusResult = static_cast<uint32_t>(statusResult);
8083+
pOffsetResult = reinterpret_cast<uint32_t *>(&offsetResult);
8084+
pStatusResult = reinterpret_cast<uint32_t *>(&statusResult);
8085+
}
8086+
8087+
if (reportOffset)
8088+
{
8089+
eStatus = MOS_SecureMemcpy(bytePtr + vkDataoffset, dataSize, pOffsetResult, dataSize);
8090+
if (eStatus != MOS_STATUS_SUCCESS)
8091+
{
8092+
CODECHAL_ENCODE_ASSERTMESSAGE("Failed to get bitstream offset.");
8093+
return eStatus;
8094+
}
8095+
vkDataoffset += dataSize;
8096+
}
8097+
if (reportBitstreamSize)
8098+
{
8099+
eStatus = MOS_SecureMemcpy(
8100+
bytePtr + vkDataoffset,
8101+
dataSize,
8102+
statusData + baseOffset + encodeStatusBuf->dwBSByteCountOffset,
8103+
dataSize);
8104+
if (eStatus != MOS_STATUS_SUCCESS)
8105+
{
8106+
CODECHAL_ENCODE_ASSERTMESSAGE("Failed to get bitstream size from status buffer.");
8107+
return eStatus;
8108+
}
8109+
vkDataoffset += dataSize;
8110+
}
8111+
if (reportStatus)
8112+
{
8113+
eStatus = MOS_SecureMemcpy(bytePtr + vkDataoffset, dataSize, pStatusResult, dataSize);
8114+
if (eStatus != MOS_STATUS_SUCCESS)
8115+
{
8116+
CODECHAL_ENCODE_ASSERTMESSAGE("Failed to get encode status");
8117+
return eStatus;
8118+
}
8119+
}
8120+
8121+
return eStatus;
8122+
}
8123+
8124+
80518125
MOS_STATUS CodechalVdencAvcState::PrepareHWMetaData(
80528126
PMOS_RESOURCE presMetadataBuffer,
80538127
PMOS_RESOURCE presSliceSizeStreamoutBuffer,

0 commit comments

Comments
 (0)