Skip to content

Commit

Permalink
[Decode] Cleanup KW issues on Linux
Browse files Browse the repository at this point in the history
unintialize in constructor

Change-Id: Ie26a0f5da4d95dcad0e14ff6161cfc1692b6497e
  • Loading branch information
shawnli2 authored and Sherry-Lin committed Jul 25, 2019
1 parent 7b6de80 commit dab49ad
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2663,6 +2663,7 @@ CodechalDecodeHevc::CodechalDecodeHevc(
m_saoLineBufferPicWidth(0),
m_mvBufferProgrammed(false),
m_dmemBufferIdx(0),
m_dmemBufferSize(0),
m_dmemTransferSize(0),
m_dmemBufferProgrammed(false),
m_copyDataBufferSize(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4815,6 +4815,7 @@ CodechalDecodeVc1::CodechalDecodeVc1(
MOS_ZeroMemory(m_unequalFieldRefListIdx, sizeof(m_unequalFieldRefListIdx));
MOS_ZeroMemory(&m_destSurface, sizeof(m_destSurface));
MOS_ZeroMemory(&m_deblockSurface, sizeof(m_deblockSurface));
MOS_ZeroMemory(&m_resDataBuffer, sizeof(m_resDataBuffer));
MOS_ZeroMemory(&m_resBitplaneBuffer, sizeof(m_resBitplaneBuffer));
MOS_ZeroMemory(&m_resSyncObjectWaContextInUse, sizeof(m_resSyncObjectWaContextInUse));
MOS_ZeroMemory(&m_resSyncObjectVideoContextInUse, sizeof(m_resSyncObjectVideoContextInUse));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ CodechalDecodeVp9 ::CodechalDecodeVp9(
m_vp9DepthIndicator(0),
m_chromaFormatinProfile(0),
m_dataSize(0),
m_dataOffset(0),
m_frameCtxIdx(0),
m_curMvTempBufIdx(0),
m_colMvTempBufIdx(0),
Expand All @@ -180,8 +181,11 @@ CodechalDecodeVp9 ::CodechalDecodeVp9(
m_allocatedWidthInSb(0),
m_allocatedHeightInSb(0),
m_mvBufferSize(0),
m_resetSegIdBuffer(false),
m_pendingResetPartial(0),
m_saveInterProbs(0)
m_saveInterProbs(0),
m_fullProbBufferUpdate(false),
m_dmemBufferSize(0)
{
CODECHAL_DECODE_FUNCTION_ENTER;

Expand Down
4 changes: 2 additions & 2 deletions media_driver/agnostic/common/codec/hal/codechal_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ CodechalDecode::CodechalDecode (
{
CODECHAL_DECODE_FUNCTION_ENTER;

MOS_ZeroMemory(&m_dummyReference, sizeof(MOS_SURFACE));

CODECHAL_DECODE_CHK_NULL_NO_STATUS_RETURN(hwInterface);
CODECHAL_DECODE_CHK_NULL_NO_STATUS_RETURN(hwInterface->GetOsInterface());
CODECHAL_DECODE_CHK_NULL_NO_STATUS_RETURN(hwInterface->GetMiInterface());
Expand All @@ -251,8 +253,6 @@ CodechalDecode::CodechalDecode (

m_mode = standardInfo->Mode;
m_isHybridDecoder = standardInfo->bIsHybridCodec ? true : false;

MOS_ZeroMemory(&m_dummyReference, sizeof(MOS_SURFACE));
}

MOS_STATUS CodechalDecode::SetGpuCtxCreatOption(
Expand Down
3 changes: 3 additions & 0 deletions media_driver/agnostic/common/hw/mhw_mi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ MhwMiInterface::MhwMiInterface(
{
MHW_FUNCTION_ENTER;

MOS_ZeroMemory(&UseGlobalGtt, sizeof(UseGlobalGtt));
MOS_ZeroMemory(&MediaResetParam, sizeof(MediaResetParam));

if (cpInterface == nullptr || osInterface == nullptr)
{
MHW_ASSERTMESSAGE("Invalid input pointers provided");
Expand Down
4 changes: 2 additions & 2 deletions media_driver/agnostic/common/hw/mhw_mi.h
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ class MhwMiInterface
MOS_STATUS (*AddResourceToCmd) (
PMOS_INTERFACE pOsInterface,
PMOS_COMMAND_BUFFER cmdBuffer,
PMHW_RESOURCE_PARAMS params);
PMHW_RESOURCE_PARAMS params) = nullptr;

//!
//! \brief Helper function to get GTT type (PGTT or GGTT)
Expand Down Expand Up @@ -758,7 +758,7 @@ class MhwMiInterface
} MediaResetParam;

//! \brief Mmio registers address
MHW_MI_MMIOREGISTERS m_mmioRegisters; //!< mfx mmio registers
MHW_MI_MMIOREGISTERS m_mmioRegisters = {}; //!< mfx mmio registers

};

Expand Down
3 changes: 2 additions & 1 deletion media_driver/agnostic/common/shared/media_perf_profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ struct NodeHeader

MediaPerfProfiler::MediaPerfProfiler()
{
MOS_ZeroMemory(&m_perfStoreBuffer, sizeof(m_perfStoreBuffer));
m_perfDataIndex = 0;
m_ref = 0;
m_initialized = false;

m_profilerEnabled = 0;

MOS_USER_FEATURE_VALUE_DATA userFeatureData;
// Check whether profiler is enabled
MOS_ZeroMemory(&userFeatureData, sizeof(userFeatureData));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,12 @@ CodechalDecodeVc1G8::CodechalDecodeVc1G8(
PCODECHAL_STANDARD_INFO standardInfo) :
CodechalDecodeVc1(hwInterface, debugInterface, standardInfo)
{
MOS_ZeroMemory(&m_olpBatchBuffer, sizeof(m_olpBatchBuffer));

CODECHAL_DECODE_CHK_NULL_NO_STATUS_RETURN(hwInterface);

m_olpCurbeStaticDataLength = CODECHAL_DECODE_VC1_CURBE_SIZE_OLP_G8;

MOS_ZeroMemory(&m_olpBatchBuffer, sizeof(m_olpBatchBuffer));

MOS_STATUS eStatus = CodecHalGetKernelBinaryAndSize(
(uint8_t *)IGCODECKRN_G8,
IDR_CODEC_AllVC1_NV12,
Expand Down
9 changes: 9 additions & 0 deletions media_driver/linux/common/codec/ddi/media_ddi_decode_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ DdiMediaDecode::DdiMediaDecode(DDI_DECODE_CONFIG_ATTR *ddiDecodeAttr)
m_ddiDecodeAttr = ddiDecodeAttr;
m_ddiDecodeCtx = nullptr;
MOS_ZeroMemory(&m_destSurface, sizeof(m_destSurface));
m_groupIndex = 0;
m_picWidthInMB = 0;
m_picHeightInMB = 0;
m_decProcessingType = 0;
m_width = 0;
m_height = 0;
m_streamOutEnabled = false;
m_sliceParamBufNum = 0;
m_sliceCtrlBufNum = 0;
m_codechalSettings = CodechalSetting::CreateCodechalSetting();
}

Expand Down
4 changes: 2 additions & 2 deletions media_driver/linux/common/os/mos_gpucontext_specific.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ class GpuContextSpecific : public GpuContext
//! \brief Os context
OsContext *m_osContext = nullptr;

MOS_GPUCTX_CREATOPTIONS_ENHANCED *m_createOptionEnhanced;
MOS_GPUCTX_CREATOPTIONS_ENHANCED *m_createOptionEnhanced = nullptr;
MOS_LINUX_CONTEXT* m_i915Context = nullptr;
uint32_t m_i915ExecFlag;
uint32_t m_i915ExecFlag = 0;

#if MOS_COMMAND_RESINFO_DUMP_SUPPORTED
std::vector<const void *> m_cmdResPtrs; //!< Command OS resource pointers registered by pfnRegisterResource
Expand Down
6 changes: 3 additions & 3 deletions media_driver/linux/ult/ult_app/driver_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ class DriverDllLoader

public:

VADriverContext m_ctx;
VADriverVTable m_vtable;
VADriverVTableVPP m_vtable_vpp;
VADriverContext m_ctx = {};
VADriverVTable m_vtable = {};
VADriverVTableVPP m_vtable_vpp = {};

private:

Expand Down

0 comments on commit dab49ad

Please sign in to comment.