Skip to content

Commit

Permalink
[VP] Refactor for build issue
Browse files Browse the repository at this point in the history
Refactor for build issue: Avoid storing the address of local variable
  • Loading branch information
kchen1024 authored and intel-mediadev committed Jul 12, 2024
1 parent 5b952fd commit 47bae3c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 17 deletions.
1 change: 1 addition & 0 deletions media_common/agnostic/common/hw/mhw_render.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ typedef struct _MHW_GPGPU_WALKER_PARAMS

bool hasBarrier;
PMHW_INLINE_DATA_PARAMS inlineDataParamBase;
uint32_t inlineDataParamSize;

} MHW_GPGPU_WALKER_PARAMS, *PMHW_GPGPU_WALKER_PARAMS;

Expand Down
2 changes: 0 additions & 2 deletions media_common/agnostic/common/hw/mhw_state_heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ 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
1 change: 1 addition & 0 deletions media_softlet/agnostic/common/hw/mhw_render_cmdpar.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ struct MHW_HEAPS_RESOURCE
{
PMOS_RESOURCE presInstructionBuffer = nullptr;
PMHW_INLINE_DATA_PARAMS inlineDataParamsBase = nullptr;
uint32_t inlineDataParamSize = 0;
};

enum MHW_VFE_SLICE_DISABLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1264,8 +1264,8 @@ MOS_STATUS RenderCmdPacket::PrepareComputeWalkerParams(KERNEL_WALKER_PARAMS para

gpgpuWalker.SLMSize = params.slmSize;
gpgpuWalker.hasBarrier = params.hasBarrier;
gpgpuWalker.inlineDataParamBase = params.inlineDataParams;

gpgpuWalker.inlineDataParamBase = params.inlineDataParamBase;
gpgpuWalker.inlineDataParamSize = params.inlineDataParamSize;
return MOS_STATUS_SUCCESS;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ typedef struct _KERNEL_WALKER_PARAMS

bool hasBarrier;
uint32_t slmSize;
MHW_INLINE_DATA_PARAMS inlineDataParams[MAX_INLINE_DATA_PARAMS];
uint32_t inlineDataParamNum;
PMHW_INLINE_DATA_PARAMS inlineDataParamBase;
uint32_t inlineDataParamSize;
}KERNEL_WALKER_PARAMS, * PKERNEL_WALKER_PARAMS;

typedef struct _KERNEL_PACKET_RENDER_DATA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ void VpRenderKernelObj::DumpSurface(VP_SURFACE* pSurface, PCCHAR fileName)
#endif
}

MOS_STATUS VpRenderKernelObj::SetInlineDataParameter(KERNEL_WALKER_PARAMS &walkerParam, KRN_ARG args, RENDERHAL_INTERFACE *renderhal)
MOS_STATUS VpRenderKernelObj::SetInlineDataParameter(KRN_ARG args, RENDERHAL_INTERFACE *renderhal)
{
VP_FUNC_CALL();
MHW_INLINE_DATA_PARAMS inlineDataPar = {};
Expand All @@ -762,15 +762,10 @@ MOS_STATUS VpRenderKernelObj::SetInlineDataParameter(KERNEL_WALKER_PARAMS &walke
{
inlineDataPar.isPtrType = false;
}
if (walkerParam.inlineDataParamNum < MAX_INLINE_DATA_PARAMS)
{
walkerParam.inlineDataParams[walkerParam.inlineDataParamNum] = inlineDataPar;
walkerParam.inlineDataParamNum++;
}
else
{
VP_RENDER_ASSERTMESSAGE("Exceed max inline data params!");
}

// walkerParam.inlineDataParamBase will add m_inlineDataParams.data() in each kernel
// walkerParam.inlineDataParamSize will add m_inlineDataParams.size() in each kernel
m_inlineDataParams.push_back(inlineDataPar);

return MOS_STATUS_SUCCESS;
}
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ class VpRenderKernelObj

virtual MOS_STATUS InitRenderHalSurfaceCMF(MOS_SURFACE* src, PRENDERHAL_SURFACE renderHalSurface);

virtual MOS_STATUS SetInlineDataParameter(KERNEL_WALKER_PARAMS &walkerParam, KRN_ARG args, RENDERHAL_INTERFACE *renderhal);
virtual MOS_STATUS SetInlineDataParameter(KRN_ARG args, RENDERHAL_INTERFACE *renderhal);

virtual MOS_STATUS UpdateBindlessSurfaceResource(SurfaceType surf, std::set<uint32_t> surfStateOffset)
{
Expand Down Expand Up @@ -617,6 +617,7 @@ class VpRenderKernelObj
bool m_useIndependentSamplerGroup = false; //true means multi kernels has their own stand alone sampler states group. only can be true when m_isAdvKernel is true.

std::shared_ptr<mhw::vebox::Itf> m_veboxItf = nullptr;
std ::vector<MHW_INLINE_DATA_PARAMS> m_inlineDataParams = {};

MEDIA_CLASS_DEFINE_END(vp__VpRenderKernelObj)
};
Expand Down

1 comment on commit 47bae3c

@heitbaum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.