Skip to content

Commit

Permalink
[Media Common] [VP] Fix linux long latency issue
Browse files Browse the repository at this point in the history
increase the cmd buffer size when context init, reduce the cmd buffer reallocation counts
  • Loading branch information
pengwan1 authored and intel-mediadev committed Jul 18, 2024
1 parent 7a27da9 commit f0d7aeb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
3 changes: 2 additions & 1 deletion media_softlet/agnostic/common/os/mos_context_next.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2021, Intel Corporation
* Copyright (c) 2019-2024, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -262,6 +262,7 @@ class OsContextNext

public:
static const uint32_t m_cmdBufAlignment = 16; //!> Cmd buffer alignment
bool m_ocaLogSectionSupported = true;

protected:
GpuContextMgrNext *m_gpuContextMgr = nullptr; //!> GPU context manager of the device
Expand Down
15 changes: 13 additions & 2 deletions media_softlet/linux/common/os/mos_context_specific_next.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2022, Intel Corporation
* Copyright (c) 2019-2024, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -47,6 +47,7 @@
#include "mos_gpucontextmgr_next.h"
#include "mos_cmdbufmgr_next.h"
#include "mos_oca_rtlog_mgr.h"
#include "mos_oca_interface_specific.h"
#define BATCH_BUFFER_SIZE 0x80000

OsContextSpecificNext::OsContextSpecificNext()
Expand Down Expand Up @@ -75,6 +76,7 @@ MOS_STATUS OsContextSpecificNext::Init(DDI_DEVICE_CONTEXT ddiDriverContext)

if (GetOsContextValid() == false)
{
uint32_t commandBufferSize = 0;
m_skuTable.reset();
m_waTable.reset();
MosUtilities::MosZeroMemory(&m_platformInfo, sizeof(m_platformInfo));
Expand Down Expand Up @@ -291,9 +293,18 @@ MOS_STATUS OsContextSpecificNext::Init(DDI_DEVICE_CONTEXT ddiDriverContext)

SetOsContextValid(true);
// Prepare the command buffer manager
if (m_ocaLogSectionSupported)
{
// increase size for oca log section
commandBufferSize = MosOcaInterfaceSpecific::IncreaseSize(COMMAND_BUFFER_SIZE);
}
else
{
commandBufferSize = COMMAND_BUFFER_SIZE;
}
m_cmdBufMgr = CmdBufMgrNext::GetObject();
MOS_OS_CHK_NULL_RETURN(m_cmdBufMgr);
MOS_OS_CHK_STATUS_RETURN(m_cmdBufMgr->Initialize(this, COMMAND_BUFFER_SIZE/2));
MOS_OS_CHK_STATUS_RETURN(m_cmdBufMgr->Initialize(this, commandBufferSize));

// Prepare the gpu Context manager
m_gpuContextMgr = GpuContextMgrNext::GetObject(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2021, Intel Corporation
* Copyright (c) 2019-2024, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -541,6 +541,7 @@ MOS_STATUS GpuContextSpecificNext::Init(OsContextNext *osContext,

MosUtilities::MosUnlockMutex(m_cmdBufPoolMutex);

m_ocaLogSectionSupported = osContext->m_ocaLogSectionSupported;
if (m_ocaLogSectionSupported)
{
// increase size for oca log section
Expand Down

0 comments on commit f0d7aeb

Please sign in to comment.