Skip to content

Commit

Permalink
[VP] Enable 64b Effinicient
Browse files Browse the repository at this point in the history
Enable 64b Effinicient:  (1) Add compute walker 2 and remove cfe and compute walker (2) Enable bindless mode
  • Loading branch information
kchen1024 authored and intel-mediadev committed Jul 8, 2024
1 parent 34429a3 commit 32a5aa6
Show file tree
Hide file tree
Showing 21 changed files with 643 additions and 229 deletions.
5 changes: 4 additions & 1 deletion media_common/agnostic/common/hw/mhw_render.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ typedef struct _MHW_RENDER_ENGINE_L3_CACHE_CONFIG

typedef enum _MHW_RENDER_ENGINE_ADDRESS_SHIFT
{
MHW_RENDER_ENGINE_KERNEL_POINTER_SHIFT = 6,
MHW_RENDER_ENGINE_STATE_BASE_ADDRESS_SHIFT = 12
} MHW_RENDER_ENGINE_ADDRESS_SHIFT;

Expand Down Expand Up @@ -146,6 +147,7 @@ typedef struct _MHW_STATE_BASE_ADDR_PARAMS
uint32_t mocs4IndirectObjectBuffer;
uint32_t mocs4StatelessDataport;
uint32_t l1CacheConfig;
bool addressDis;
} MHW_STATE_BASE_ADDR_PARAMS, *PMHW_STATE_BASE_ADDR_PARAMS;

typedef struct _MHW_VFE_SCOREBOARD_DELTA
Expand Down Expand Up @@ -309,7 +311,8 @@ typedef struct _MHW_GPGPU_WALKER_PARAMS
MHW_EMIT_LOCAL_MODE emitLocal;

bool hasBarrier;

PMHW_INLINE_DATA_PARAMS inlineDataParamBase;

} MHW_GPGPU_WALKER_PARAMS, *PMHW_GPGPU_WALKER_PARAMS;

typedef struct _MHW_MEDIA_OBJECT_PARAMS
Expand Down
11 changes: 11 additions & 0 deletions media_common/agnostic/common/hw/mhw_state_heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ typedef struct MHW_BLOCK_MANAGER *PMHW_BLOCK_MANAGER;

#define MHW_INVALID_SYNC_TAG 0xFFFFFFFF

#define MAX_INLINE_DATA_PARAMS 32

enum MW_RENDER_ENGINE_ADDRESS_SHIFT
{
MHW_STATE_HEAP_SURFACE_STATE_SHIFT = 0
Expand Down Expand Up @@ -699,6 +701,14 @@ typedef enum _MHW_CHROMAKEY_MODE
MHW_CHROMAKEY_MODE_REPLACE_BLACK = 1
} MHW_CHROMAKEY_MODE;

typedef struct _MHW_INLINE_DATA_PARAMS
{
uint32_t dwOffset;
uint32_t dwSize;
PMOS_RESOURCE resource;
bool isPtrType;
} MHW_INLINE_DATA_PARAMS, *PMHW_INLINE_DATA_PARAMS;

typedef struct _MHW_SAMPLER_STATE_UNORM_PARAM
{
MHW_SAMPLER_FILTER_MODE SamplerFilterMode;
Expand Down Expand Up @@ -845,6 +855,7 @@ struct MHW_STATE_HEAP_SETTINGS
HeapManager::Behavior m_dshBehavior = HeapManager::Behavior::wait; //!< DSH behavior

uint32_t dwNumSyncTags = 0; //!< to be removed with old interfaces
MOS_HW_RESOURCE_DEF m_heapUsageType = MOS_CODEC_RESOURCE_USAGE_BEGIN_CODEC;
};

typedef struct _MHW_STATE_HEAP_DYNAMIC_ALLOC_PARAMS
Expand Down
1 change: 1 addition & 0 deletions media_common/agnostic/common/os/mos_os_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ typedef enum MOS_HW_COMMAND_ENUM
MOS_SURFACE_STATE,
MOS_SURFACE_STATE_ADV,
MOS_STATE_BASE_ADDR,
MOS_COMPUTE_WALKER,
MOS_VEBOX_STATE,
MOS_VEBOX_DI_IECP,
MOS_VEBOX_TILING_CONVERT,
Expand Down
9 changes: 9 additions & 0 deletions media_common/agnostic/common/renderhal/renderhal.h
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ typedef struct _RENDERHAL_STATE_HEAP_SETTINGS
int32_t iSurfaceStates; // Number of Surfaces per SSH
int32_t iSurfacesPerBT; // Number of Surfaces per BT
int32_t iBTAlignment; // BT Alignment size
MOS_HW_RESOURCE_DEF heapUsageType;
} RENDERHAL_STATE_HEAP_SETTINGS, *PRENDERHAL_STATE_HEAP_SETTINGS;

typedef struct _RENDERHAL_STATE_HEAP
Expand Down Expand Up @@ -1197,6 +1198,7 @@ typedef struct _RENDERHAL_INTERFACE
bool bEnableGpgpuMidBatchPreEmption; // Middle Batch Buffer Preemption
bool bEnableGpgpuMidThreadPreEmption; // Middle Thread Preemption
bool bComputeContextInUse; // Compute Context use for media
bool isBindlessHeapInUse; // Bindless Heap Mode use

uint32_t dwMaskCrsThdConDataRdLn; // Unifies pfnSetupInterfaceDescriptor for g75,g8,...
uint32_t dwMinNumberThreadsInGroup; // Unifies pfnSetupInterfaceDescriptor for g75,g8,...
Expand Down Expand Up @@ -1460,6 +1462,13 @@ typedef struct _RENDERHAL_INTERFACE
PMHW_SAMPLER_STATE_PARAM pSamplerParams,
int32_t iSamplers);

MOS_STATUS (*pfnSetAndGetSamplerStates) (
PRENDERHAL_INTERFACE pRenderHal,
int32_t iMediaID,
PMHW_SAMPLER_STATE_PARAM pSamplerParams,
int32_t iSamplers,
std::map<uint32_t, uint32_t> &samplerMap);

int32_t (* pfnAllocateMediaID) (
PRENDERHAL_INTERFACE pRenderHal,
int32_t iKernelAllocationID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,12 @@ class XRenderHal_Platform_Interface
return MOS_STATUS_SUCCESS;
};

virtual bool IsBindlessHeapInUse(
PRENDERHAL_INTERFACE pRenderHal)
{
return false;
}

//! \brief Allocates scratch space buffer.
//! \details On some new pltforms, a single scratch space buffer may be allocated and used for
//! all threads.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ extern const RENDERHAL_STATE_HEAP_SETTINGS g_cRenderHal_State_Heap_Settings_xe_h
RENDERHAL_SSH_BINDING_TABLES, //!< iBindingTables
RENDERHAL_SSH_SURFACE_STATES, //!< iSurfaceStates
RENDERHAL_SSH_SURFACES_PER_BT, //!< iSurfacesPerBT
RENDERHAL_SSH_BINDING_TABLE_ALIGN //!< iBTAlignment
RENDERHAL_SSH_BINDING_TABLE_ALIGN, //!< iBTAlignment
MOS_CODEC_RESOURCE_USAGE_BEGIN_CODEC //!< heapUsageType
};

extern const RENDERHAL_ENLARGE_PARAMS g_cRenderHal_Enlarge_State_Heap_Settings_Adv_xe_hpg =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ extern const RENDERHAL_STATE_HEAP_SETTINGS g_cRenderHal_State_Heap_Settings_g12
RENDERHAL_SSH_BINDING_TABLES, //!< iBindingTables
RENDERHAL_SSH_SURFACE_STATES, //!< iSurfaceStates
RENDERHAL_SSH_SURFACES_PER_BT, //!< iSurfacesPerBT
RENDERHAL_SSH_BINDING_TABLE_ALIGN //!< iBTAlignment
RENDERHAL_SSH_BINDING_TABLE_ALIGN, //!< iBTAlignment
MOS_CODEC_RESOURCE_USAGE_BEGIN_CODEC //!< heapUsageType
};

const uint32_t g_cLookup_RotationMode_g12[8] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ extern const RENDERHAL_STATE_HEAP_SETTINGS g_cRenderHal_State_Heap_Settings_xe2_
RENDERHAL_SSH_BINDING_TABLES, //!< iBindingTables
RENDERHAL_SSH_SURFACE_STATES, //!< iSurfaceStates
RENDERHAL_SSH_SURFACES_PER_BT, //!< iSurfacesPerBT
RENDERHAL_SSH_BINDING_TABLE_ALIGN //!< iBTAlignment
RENDERHAL_SSH_BINDING_TABLE_ALIGN, //!< iBTAlignment
MOS_CODEC_RESOURCE_USAGE_BEGIN_CODEC //!< heapUsageType
};

extern const RENDERHAL_ENLARGE_PARAMS g_cRenderHal_Enlarge_State_Heap_Settings_Adv_xe2_hpg =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ extern const RENDERHAL_STATE_HEAP_SETTINGS g_cRenderHal_State_Heap_Settings_hpg_
RENDERHAL_SSH_BINDING_TABLES, //!< iBindingTables
RENDERHAL_SSH_SURFACE_STATES, //!< iSurfaceStates
RENDERHAL_SSH_SURFACES_PER_BT, //!< iSurfacesPerBT
RENDERHAL_SSH_BINDING_TABLE_ALIGN //!< iBTAlignment
RENDERHAL_SSH_BINDING_TABLE_ALIGN, //!< iBTAlignment
MOS_CODEC_RESOURCE_USAGE_BEGIN_CODEC //!< heapUsageType
};

extern const RENDERHAL_ENLARGE_PARAMS g_cRenderHal_Enlarge_State_Heap_Settings_Adv_hpg_base =
Expand Down
11 changes: 10 additions & 1 deletion media_softlet/agnostic/common/hw/mhw_render_cmdpar.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ struct MHW_VFE_SCOREBOARD
MHW_VFE_SCOREBOARD_DELTA ScoreboardDelta[MHW_MAX_DEPENDENCY_COUNT] = {};
};

struct MHW_HEAPS_RESOURCE
{
PMOS_RESOURCE presInstructionBuffer = nullptr;
PMHW_INLINE_DATA_PARAMS inlineDataParamsBase = nullptr;
};

enum MHW_VFE_SLICE_DISABLE
{
MHW_VFE_SLICE_ALL = 0,
Expand Down Expand Up @@ -219,6 +225,7 @@ struct _MHW_PAR_T(STATE_BASE_ADDRESS)
uint32_t mocs4IndirectObjectBuffer = 0;
uint32_t mocs4StatelessDataport = 0;
uint32_t l1CacheConfig = 0;
bool addressDis = false;
};

struct _MHW_PAR_T(MEDIA_VFE_STATE)
Expand Down Expand Up @@ -391,7 +398,9 @@ struct _MHW_PAR_T(COMPUTE_WALKER)
bool isGenerateLocalId = false;
MHW_EMIT_LOCAL_MODE emitLocal = MHW_EMIT_LOCAL_NONE;
uint32_t preferredSlmAllocationSize = 0;

_MHW_PAR_T(CFE_STATE) cfeState = {};
MHW_HEAPS_RESOURCE heapsResource = {};

};

struct _MHW_PAR_T(STATE_COMPUTE_MODE)
Expand Down
Loading

0 comments on commit 32a5aa6

Please sign in to comment.