Commit fa6e1cd6 authored by Ella Feng's avatar Ella Feng Committed by Xianzhong

MGS-5372 [#imx-1708] Fix the VX/CL apps hang for 865 GPU/VIP

Add VIP HW type to avoid GPU/VIP command mess when run VX/CL apps.

Date: 4 Dec, 2019
Singed-off-by: default avatarElla Feng <ella.feng@nxp.com>
parent f4bdd2f3
......@@ -2159,11 +2159,16 @@ gckHARDWARE_Construct(
{
hardware->type = gcvHARDWARE_3D2D;
}
else
if (gckHARDWARE_IsFeatureAvailable(hardware, gcvFEATURE_PIPE_2D))
else if (gckHARDWARE_IsFeatureAvailable(hardware, gcvFEATURE_PIPE_2D))
{
hardware->type = gcvHARDWARE_2D;
}
else if (gckHARDWARE_IsFeatureAvailable(hardware, gcvFEATURE_NN_ENGINE)
|| gckHARDWARE_IsFeatureAvailable(hardware, gcvFEATURE_TP_ENGINE)
)
{
hardware->type = gcvHARDWARE_VIP;
}
else
{
hardware->type = gcvHARDWARE_3D;
......
......@@ -2399,7 +2399,15 @@ _Commit(
}
/* Determine the objects. */
kernel = Device->map[HwType].kernels[subCommit->coreId];
if (HwType == gcvHARDWARE_3D || HwType == gcvHARDWARE_3D2D || HwType == gcvHARDWARE_VIP)
{
kernel = Device->coreInfoArray[subCommit->coreId].kernel;
}
else
{
kernel = Device->map[HwType].kernels[subCommit->coreId];
}
if (Engine == gcvENGINE_BLT)
{
command = kernel->asyncCommand;
......@@ -2414,8 +2422,8 @@ _Commit(
kernel->hardware,
gcvBROADCAST_GPU_COMMIT));
/* Commit command buffers. */
{
/* Commit command buffers. */
status = gckCOMMAND_Commit(command,
subCommit,
ProcessId,
......@@ -2461,7 +2469,15 @@ _Commit(
subCommit = &Commit->subCommit;
userPtr = gcvNULL;
kernel = Device->map[HwType].kernels[subCommit->coreId];
if (HwType == gcvHARDWARE_3D || HwType == gcvHARDWARE_3D2D || HwType == gcvHARDWARE_VIP)
{
kernel = Device->coreInfoArray[subCommit->coreId].kernel;
}
else
{
kernel = Device->map[HwType].kernels[subCommit->coreId];
}
if (!kernel->hardware->options.gpuProfiler || !kernel->profileEnable)
{
......@@ -2505,7 +2521,14 @@ _Commit(
}
}
kernel = Device->map[HwType].kernels[subCommit->coreId];
if (HwType == gcvHARDWARE_3D || HwType == gcvHARDWARE_3D2D || HwType == gcvHARDWARE_VIP)
{
kernel = Device->coreInfoArray[subCommit->coreId].kernel;
}
else
{
kernel = Device->map[HwType].kernels[subCommit->coreId];
}
if ((kernel->hardware->options.gpuProfiler == gcvTRUE) &&
(kernel->profileEnable == gcvTRUE))
......@@ -5365,19 +5388,19 @@ gckDEVICE_ChipInfo(
IN gcsHAL_INTERFACE_PTR Interface
)
{
{
gctUINT i;
gcsCORE_INFO * info = Device->coreInfoArray;
gctUINT i;
gcsCORE_INFO * info = Device->coreInfoArray;
for (i = 0; i < Device->coreNum; i++)
{
Interface->u.ChipInfo.types[i] = info[i].type;
Interface->u.ChipInfo.ids[i] = info[i].chipID;
}
for (i = 0; i < Device->coreNum; i++)
{
Interface->u.ChipInfo.types[i] = info[i].type;
Interface->u.ChipInfo.ids[i] = info[i].chipID;
Interface->u.ChipInfo.count = Device->coreNum;
Interface->u.ChipInfo.coreIndexs[i] = info[i].core;
}
Interface->u.ChipInfo.count = Device->coreNum;
return gcvSTATUS_OK;
}
......@@ -5444,15 +5467,23 @@ gckDEVICE_SetTimeOut(
gceHARDWARE_TYPE type = Interface->hardwareType;
gcsCORE_LIST *coreList;
gctUINT32 processID = 0;
gcsCORE_INFO *info = Device->coreInfoArray;
coreList = &Device->map[type];
/* Get the current process ID. */
gckOS_GetProcessID(&processID);
coreList = &Device->map[type];
for (i = 0; i < coreList->num; i++)
for (i = 0; i < Device->coreNum; i++)
{
kernel = coreList->kernels[i];
if (type == gcvHARDWARE_3D || type == gcvHARDWARE_3D2D || type == gcvHARDWARE_VIP)
{
kernel = info[i].kernel;
}
else
{
kernel = coreList->kernels[i];
}
kernel->timeOut = Interface->u.SetTimeOut.timeOut;
......@@ -5502,8 +5533,14 @@ gckDEVICE_Dispatch(
else
{
/* Need go through gckKERNEL dispatch. */
kernel = Device->map[type].kernels[coreIndex];
if (type == gcvHARDWARE_3D || type == gcvHARDWARE_3D2D || type == gcvHARDWARE_VIP)
{
kernel = Device->coreInfoArray[coreIndex].kernel;
}
else
{
kernel = Device->map[type].kernels[coreIndex];
}
#if gcdENABLE_VG
if (kernel->vg)
......
......@@ -231,6 +231,8 @@ typedef struct _gckHARDWARE * gckHARDWARE;
#define gcdMAX_DRAW_BUFFERS 16
#define gcdMAX_3DGPU_COUNT 8
#define gcdMAX_MAJOR_CORE_COUNT 8
/*******************************************************************************
**
** gcmVERIFY_OBJECT
......
......@@ -323,6 +323,7 @@ typedef struct _gcsTLS * gcsTLS_PTR;
typedef struct _gcsTLS
{
gceHARDWARE_TYPE currentType;
gceHARDWARE_TYPE targetType;
/* To which core device control is called,
* it is index in a hardware type.
......@@ -1010,6 +1011,24 @@ gcoHAL_GetCurrentCoreIndex(
OUT gctUINT32 *Core
);
gceSTATUS
gcoHAL_ConvertCoreIndexGlobal(
IN gcoHAL Hal,
IN gceHARDWARE_TYPE Type,
IN gctUINT32 CoreCount,
IN gctUINT32 *LocalCoreIndexs,
OUT gctUINT32 *GlobalCoreIndexs
);
gceSTATUS
gcoHAL_ConvertCoreIndexLocal(
IN gcoHAL Hal,
IN gceHARDWARE_TYPE Type,
IN gctUINT32 CoreCount,
IN gctUINT32 *GlobalCoreIndexs,
OUT gctUINT32 *LocalCoreIndexs
);
gceSTATUS
gcoHAL_SelectChannel(
IN gcoHAL Hal,
......
......@@ -281,6 +281,8 @@ typedef struct _gcsHAL_CHIP_INFO
/* Chip IDs. */
OUT gctUINT32 ids[gcvCORE_COUNT];
OUT gctUINT32 coreIndexs[gcvCORE_COUNT];
}
gcsHAL_CHIP_INFO;
......
......@@ -1812,10 +1812,11 @@ gcePIPE_SELECT;
typedef enum _gceHARDWARE_TYPE
{
gcvHARDWARE_INVALID,
gcvHARDWARE_3D2D,
gcvHARDWARE_3D,
gcvHARDWARE_2D,
gcvHARDWARE_VIP,
gcvHARDWARE_VG,
gcvHARDWARE_3D2D,
gcvHARDWARE_NUM_TYPES,
}
gceHARDWARE_TYPE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment