Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[codechal,mhw] Align structures for 64-bit optimize move/copy structures #1873

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ struct SliceDescriptor
int32_t m_numCtusInCurrSlice; //!< number of CTUs in current slice

//Rect slices params
uint16_t m_tileIdx; //!< tile index corresponding to the first CTU in the slice
uint32_t m_numSlicesInTile; //!< number of slices in current tile for the special case of multiple slices inside a single tile
uint16_t m_tileIdx; //!< tile index corresponding to the first CTU in the slice
int16_t m_sliceWidthInTiles; //!< slice width in units of tiles
int16_t m_sliceHeightInTiles; //!< slice height in units of tiles
uint16_t m_sliceHeightInCtu; //!< slice height in units of CTUs for the special case of multiple slices inside a single tile
Expand Down
2 changes: 1 addition & 1 deletion media_common/agnostic/common/cp/mhw_cp_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ typedef struct _MHW_ADD_CP_COPY_PARAMS
{
PMOS_RESOURCE presSrc;
PMOS_RESOURCE presDst;
uint32_t size;
uint64_t offset;
uint32_t size;
bool bypass;
} MHW_ADD_CP_COPY_PARAMS, *PMHW_ADD_CP_COPY_PARAMS;

Expand Down
4 changes: 2 additions & 2 deletions media_common/agnostic/common/hw/mhw_mi.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ typedef struct _MHW_PIPE_CONTROL_PARAMS
typedef struct _MHW_MI_COPY_MEM_MEM_PARAMS
{
PMOS_RESOURCE presSrc;
uint32_t dwSrcOffset;
PMOS_RESOURCE presDst;
uint32_t dwSrcOffset;
uint32_t dwDstOffset;
} MHW_MI_COPY_MEM_MEM_PARAMS, *PMHW_MI_COPY_MEM_MEM_PARAMS;

Expand Down Expand Up @@ -260,9 +260,9 @@ typedef struct _MHW_MI_FLUSH_DW_PARAMS
uint32_t dwResourceOffset;
uint32_t dwDataDW1; // Value to Write
uint32_t dwDataDW2;
bool bVideoPipelineCacheInvalidate;
uint32_t postSyncOperation;
uint32_t bQWordEnable;
bool bVideoPipelineCacheInvalidate;
bool bEnablePPCFlush;
} MHW_MI_FLUSH_DW_PARAMS, *PMHW_MI_FLUSH_DW_PARAMS;

Expand Down
8 changes: 4 additions & 4 deletions media_common/agnostic/common/hw/mhw_render.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,12 @@ typedef struct _MHW_RENDER_ENGINE_CAPS
typedef struct _MHW_STATE_BASE_ADDR_PARAMS
{
PMOS_RESOURCE presGeneralState;
uint32_t dwGeneralStateSize;
PMOS_RESOURCE presDynamicState;
uint32_t dwDynamicStateSize;
bool bDynamicStateRenderTarget;
PMOS_RESOURCE presIndirectObjectBuffer;
uint32_t dwIndirectObjectBufferSize;
PMOS_RESOURCE presInstructionBuffer;
uint32_t dwGeneralStateSize;
uint32_t dwDynamicStateSize;
uint32_t dwIndirectObjectBufferSize;
uint32_t dwInstructionBufferSize;
uint32_t mocs4InstructionCache;
uint32_t mocs4GeneralState;
Expand All @@ -147,6 +146,7 @@ typedef struct _MHW_STATE_BASE_ADDR_PARAMS
uint32_t mocs4IndirectObjectBuffer;
uint32_t mocs4StatelessDataport;
uint32_t l1CacheConfig;
bool bDynamicStateRenderTarget;
bool addressDis;
} MHW_STATE_BASE_ADDR_PARAMS, *PMHW_STATE_BASE_ADDR_PARAMS;

Expand Down
2 changes: 1 addition & 1 deletion media_common/agnostic/common/hw/mhw_sfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ typedef struct _MHW_SFC_OUT_SURFACE_PARAMS
//!
typedef struct _MHW_SFC_LOCK_PARAMS
{
uint8_t sfcPipeMode; //!< SFC Pipe Mode
uint32_t dwGaClientId; // Ga Client Id
uint8_t sfcPipeMode; //!< SFC Pipe Mode
bool bOutputToMemory; // Write Vebox or Vdbox o/p to memory
} MHW_SFC_LOCK_PARAMS, *PMHW_SFC_LOCK_PARAMS;

Expand Down
18 changes: 9 additions & 9 deletions media_common/agnostic/common/hw/mhw_state_heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ typedef enum _MHW_SCALING_MODE
//!
typedef struct _MHW_AVS_PARAMS
{
MOS_FORMAT Format;
float fScaleX;
float fScaleY;
int32_t *piYCoefsX;
int32_t *piYCoefsY;
int32_t *piUVCoefsX;
int32_t *piUVCoefsY;
MOS_FORMAT Format;
float fScaleX;
float fScaleY;
bool bForcePolyPhaseCoefs;
bool bUse8x8Filter;
} MHW_AVS_PARAMS, *PMHW_AVS_PARAMS;
Expand Down Expand Up @@ -617,6 +617,12 @@ typedef struct _MHW_SAMPLER_AVS_TABLE_PARAM
//!
typedef struct _MHW_SAMPLER_STATE_AVS_PARAM
{
PMHW_SAMPLER_AVS_TABLE_PARAM pMhwSamplerAvsTableParam; // pointer to AVS scaling 8x8 table params

void *pTable8x8_Ptr; // Table data ptr in GSH
int32_t iTable8x8_Index; // Table allocation index (not needed on Gen8+)
uint32_t dwTable8x8_Offset; // Table data offset in GSH

int16_t stateID;

// STE params
Expand Down Expand Up @@ -656,12 +662,6 @@ typedef struct _MHW_SAMPLER_STATE_AVS_PARAM
uint16_t YSlope1;
uint16_t S2U;
uint16_t S1U;

PMHW_SAMPLER_AVS_TABLE_PARAM pMhwSamplerAvsTableParam; // pointer to AVS scaling 8x8 table params

int32_t iTable8x8_Index; // Table allocation index (not needed on Gen8+)
void *pTable8x8_Ptr; // Table data ptr in GSH
uint32_t dwTable8x8_Offset; // Table data offset in GSH
} MHW_SAMPLER_STATE_AVS_PARAM, *PMHW_SAMPLER_STATE_AVS_PARAM;

//!
Expand Down
14 changes: 7 additions & 7 deletions media_common/agnostic/common/hw/mhw_vebox.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,18 +399,18 @@ typedef struct _MHW_LACE_PARAMS
typedef struct _MHW_COLORPIPE_PARAMS
{
uint32_t bActive; //!< Active or not
uint32_t dwAceLevel;
uint32_t dwAceStrength;
MHW_STE_PARAMS SteParams;
MHW_STD_PARAMS StdParams;
MHW_LACE_PARAMS LaceParams;
MHW_TCC_PARAMS TccParams;
bool bEnableACE;
bool bEnableSTE;
bool bEnableSTD; // vebox STD alone enabled or not
bool bEnableTCC;
bool bAceLevelChanged;
uint32_t dwAceLevel;
uint32_t dwAceStrength;
bool bEnableLACE;
MHW_STE_PARAMS SteParams;
MHW_STD_PARAMS StdParams;
MHW_TCC_PARAMS TccParams;
MHW_LACE_PARAMS LaceParams;
} MHW_COLORPIPE_PARAMS, *PMHW_COLORPIPE_PARAMS;

//!
Expand Down Expand Up @@ -625,10 +625,10 @@ typedef struct _MHW_CAPPIPE_PARAMS
//!
typedef struct _MHW_3DLUT_PARAMS
{
uint8_t *pLUT; //!< Pointer to the LUT value
uint32_t bActive; //!< Active or not
uint32_t LUTSize; //!< Size (one dimensions) of the LUT
uint32_t LUTLength; //!< Length of the LUT, in unit of bit
uint8_t *pLUT; //!< Pointer to the LUT value
MHW_3DLUT_INTERPOLATION InterpolationMethod; //!< Vebox 3DLut interpolation method
} MHW_3DLUT_PARAMS, *PMHW_3DLUT_PARAMS;

Expand Down
16 changes: 8 additions & 8 deletions media_common/agnostic/common/hw/vdbox/mhw_vdbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,24 +276,24 @@ using PMHW_VDBOX_PIPE_MODE_SELECT_PARAMS = MHW_VDBOX_PIPE_MODE_SELECT_PARAMS * ;

typedef struct _MHW_VDBOX_SURFACE_PARAMS
{
uint32_t Mode;
PMOS_SURFACE psSurface; // 2D surface parameters
uint32_t Mode;
uint32_t dwUVPlaneAlignment;
uint32_t dwActualWidth;
uint32_t dwActualHeight;
uint32_t dwReconSurfHeight;
uint32_t dwCompressionFormat;
MOS_MEMCOMP_STATE mmcState;
uint8_t mmcSkipMask;
uint8_t ucVDirection;
uint8_t ChromaType;
uint8_t ucSurfaceStateId;
uint8_t ucBitDepthLumaMinus8;
uint8_t ucBitDepthChromaMinus8;
uint32_t dwUVPlaneAlignment;
bool bDisplayFormatSwizzle;
bool bSrc8Pak10Mode;
bool bColorSpaceSelection;
bool bVdencDynamicScaling;
uint32_t dwActualWidth;
uint32_t dwActualHeight;
uint32_t dwReconSurfHeight;
MOS_MEMCOMP_STATE mmcState;
uint8_t mmcSkipMask;
uint32_t dwCompressionFormat;
uint8_t refsMmcEnable;
uint8_t refsMmcType;
} MHW_VDBOX_SURFACE_PARAMS, *PMHW_VDBOX_SURFACE_PARAMS;
Expand Down
10 changes: 5 additions & 5 deletions media_driver/agnostic/common/cm/cm_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -579,19 +579,19 @@ struct CM_HAL_WAVEFRONT26Z_DISPATCH_INFO
//*-----------------------------------------------------------------------------
struct CM_HAL_KERNEL_THREADSPACE_PARAM
{
CM_HAL_DEPENDENCY dependencyInfo; // [in] Kernel dependency
CM_HAL_DEPENDENCY dependencyVectors; // [in] for engineering build
CM_WALKING_PARAMETERS walkingParams; // [in] for engineering build
PCM_HAL_SCOREBOARD threadCoordinates; // [in]
uint32_t colorCountMinusOne; // [in] for color count minus one
uint16_t threadSpaceWidth; // [in] Kernel Threadspace width
uint16_t threadSpaceHeight; // [in] Kernel Threadspace height
CM_DEPENDENCY_PATTERN patternType; // [in] Kernel dependency as enum
CM_HAL_DEPENDENCY dependencyInfo; // [in] Kernel dependency
PCM_HAL_SCOREBOARD threadCoordinates; // [in]
uint8_t reuseBBUpdateMask; // [in]
CM_HAL_WAVEFRONT26Z_DISPATCH_INFO dispatchInfo; // [in]
uint8_t globalDependencyMask; // [in] dependency mask in gloabal dependency vectors
uint8_t walkingParamsValid; // [in] for engineering build
CM_WALKING_PARAMETERS walkingParams; // [in] for engineering build
uint8_t dependencyVectorsValid; // [in] for engineering build
CM_HAL_DEPENDENCY dependencyVectors; // [in] for engineering build
uint32_t colorCountMinusOne; // [in] for color count minus one
CM_MW_GROUP_SELECT groupSelect; // [in] for group select on BDW+
CM_HAL_BB_DIRTY_STATUS bbDirtyStatus; // [in] batch buffer dirty status
CM_WALKING_PATTERN walkingPattern; // [in] media walking pattern as enum
Expand Down
2 changes: 1 addition & 1 deletion media_driver/agnostic/common/cm/cm_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ typedef struct _CM_CREATEVMESURFACE_PARAM

typedef struct _CM_CREATESAMPLER_PARAM
{
CM_SAMPLER_STATE sampleState; // [in]
void *samplerHandle; // [out]
void *samplerIndexHandle; // [out]
CM_SAMPLER_STATE sampleState; // [in]
int32_t returnValue; // [out]
}CM_CREATESAMPLER_PARAM, *PCM_CREATESAMPLER_PARAM;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class CodechalSfcState
float m_cscInOffset[3] = {0}; //!< Csc In Offset
float m_cscOutOffset[3] = {0}; //!< Csc Out Offset

MHW_AVS_PARAMS m_avsParams = {Format_Any}; //!< Avs Params
MHW_AVS_PARAMS m_avsParams = {.Format = Format_Any}; //!< Avs Params
MHW_SFC_AVS_LUMA_TABLE m_lumaTable = {0}; //!< Avs Luma Table
MHW_SFC_AVS_CHROMA_TABLE m_chromaTable = {0}; //!< Avs Chroma Table
MHW_SFC_AVS_STATE m_avsState = {0}; //<! Avs State
Expand Down
6 changes: 3 additions & 3 deletions media_driver/agnostic/common/codec/hal/codechal_decode_vc1.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ typedef struct _CODECHAL_DECODE_VC1_BITSTREAM
{
uint8_t* pOriginalBitBuffer; // pointer to the original capsuted bitstream
uint8_t* pOriginalBufferEnd; // pointer to the end of the original uncapsuted bitstream
uint32_t u32ZeroNum; // number of continuous zeros before the current bype.
uint32_t u32ProcessedBitNum; // number of bits being processed from initiation
uint8_t CacheBuffer[CODECHAL_DECODE_VC1_BITSTRM_BUF_LEN + 4]; // cache buffer of uncapsuted raw bitstream
uint32_t* pu32Cache; // pointer to the cache buffer
uint32_t* pu32CacheEnd; // pointer to the updating end of the cache buffer
uint32_t* pu32CacheDataEnd; // pointer to the last valid uint32_t of the cache buffer
uint32_t u32ZeroNum; // number of continuous zeros before the current bype.
uint32_t u32ProcessedBitNum; // number of bits being processed from initiation
uint8_t CacheBuffer[CODECHAL_DECODE_VC1_BITSTRM_BUF_LEN + 4]; // cache buffer of uncapsuted raw bitstream
int32_t iBitOffset; // offset = 32 is the MSB, offset = 1 is the LSB.
int32_t iBitOffsetEnd; // bit offset of the last valid uint32_t
bool bIsEBDU; // 1 if it is EBDU and emulation prevention bytes are present.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ class CodecHalEncodeSfcBase
float m_cscInOffset[3] = { 0.0f, };
float m_cscOutOffset[3] = { 0.0f, };

MHW_AVS_PARAMS m_avsParams = { Format_Any, };
MHW_AVS_PARAMS m_avsParams = { .Format = Format_Any, };
MHW_SFC_AVS_LUMA_TABLE m_lumaTable = { 0, };
MHW_SFC_AVS_CHROMA_TABLE m_chromaTable = { 0, };
MHW_SFC_AVS_STATE m_avsState = { 0, };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,11 @@ struct HucInputCmd2
//!
struct Vp9CmdInitializerParams
{
uint8_t vdencMvCosts[12] = { 0 };
uint8_t vdencRdMvCosts[12] = { 0 };
uint8_t vdencHmeMvCosts[8] = { 0 };
uint8_t vdencModeCosts[CODEC_VDENC_NUM_MODE_COST] = { 0 };

uint16_t pictureCodingType = 0;

PCODEC_VP9_ENCODE_SEQUENCE_PARAMS seqParams = nullptr;
PCODEC_VP9_ENCODE_PIC_PARAMS picParams = nullptr;
PCODEC_VP9_ENCODE_SEGMENT_PARAMS segmentParams = nullptr;
bool segmentationEnabled = false;
bool segmentMapProvided = false;
PCODEC_VP9_ENCODE_SEGMENT_PARAMS segmentParams = nullptr;
bool prevFrameSegEnabled = false;
uint8_t numRefFrames = 0;
bool me16Enabled = false;
Expand All @@ -197,6 +190,12 @@ struct Vp9CmdInitializerParams
uint16_t rdQpLambda = 0;
bool vdencPakOnlyMultipassEnabled = false;

uint8_t vdencMvCosts[12] = { 0 };
uint8_t vdencRdMvCosts[12] = { 0 };
uint8_t vdencHmeMvCosts[8] = { 0 };
uint8_t vdencModeCosts[CODEC_VDENC_NUM_MODE_COST] = { 0 };

uint16_t pictureCodingType = 0;
};
#endif

Expand Down
34 changes: 17 additions & 17 deletions media_driver/agnostic/common/codec/hal/codechal_utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,39 @@ typedef enum _CODECHAL_WALKER_DEGREE

typedef struct _CODECHAL_WALKER_CODEC_PARAMS
{
CODECHAL_WALKER_DEGREE WalkerDegree;
uint32_t WalkerMode;
bool bUseScoreboard;
uint32_t dwResolutionX;
uint32_t dwResolutionY;
uint32_t wPictureCodingType;
uint32_t bDirectSpatialMVPredFlag;
uint32_t dwNumSlices;
uint32_t ScoreboardMask;
bool bUseScoreboard;
bool bNoDependency;
CODECHAL_WALKER_DEGREE WalkerDegree;
bool bUseVerticalRasterScan;
uint32_t wPictureCodingType;
bool bMbEncIFrameDistInUse;
bool bMbaff;
uint32_t bDirectSpatialMVPredFlag;
bool bColorbitSupported;
uint32_t dwNumSlices;
uint16_t usSliceHeight;
bool bGroupIdSelectSupported;
uint8_t ucGroupId;
uint32_t ScoreboardMask;
uint16_t usTotalThreadNumPerLcu; //Used by Gen10 HEVC
} CODECHAL_WALKER_CODEC_PARAMS, *PCODECHAL_WALKER_CODEC_PARAMS;

typedef struct _CODECHAL_SURFACE_CODEC_PARAMS
{
PMOS_SURFACE psSurface; // 2D surface parameters
PMOS_RESOURCE presBuffer; // Buffer parameters
uint32_t dwSize; // Buffer size
uint32_t dwOffset; // Buffer offset
uint32_t dwBindingTableOffset; // Binding table offset for given surface
uint32_t dwUVBindingTableOffset; // Binding table offset for the UV plane
uint32_t dwVerticalLineStride;
uint32_t dwVerticalLineStrideOffset;
uint8_t ucVDirection;
uint32_t dwCacheabilityControl;
uint32_t ChromaType;
uint32_t Mode;
bool bIs2DSurface;
bool bUseUVPlane;
Expand All @@ -90,18 +101,7 @@ typedef struct _CODECHAL_SURFACE_CODEC_PARAMS
bool bRenderTarget;
bool bIsWritable;
bool bUseHalfHeight;
PMOS_SURFACE psSurface; // 2D surface parameters
PMOS_RESOURCE presBuffer; // Buffer parameters
uint32_t dwSize; // Buffer size
uint32_t dwOffset; // Buffer offset
uint32_t dwBindingTableOffset; // Binding table offset for given surface
uint32_t dwUVBindingTableOffset; // Binding table offset for the UV plane
uint32_t dwVerticalLineStride;
uint32_t dwVerticalLineStrideOffset;
uint8_t ucVDirection;
uint32_t dwCacheabilityControl;
bool bForceChromaFormat;
uint32_t ChromaType;
bool bRawSurface;
uint8_t ucSurfaceStateId;

Expand Down
Loading