Skip to content

Commit

Permalink
[VP] Integrate L0 FC FastPath
Browse files Browse the repository at this point in the history
integrate fast path
  • Loading branch information
peiyigu-intel authored and intel-mediadev committed Aug 13, 2024
1 parent 2dce560 commit 5641059
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 15 deletions.
13 changes: 8 additions & 5 deletions media_common/agnostic/common/renderhal/renderhal.h
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,8 @@ typedef enum _RENDERHAL_PLANE_DEFINITION
RENDERHAL_PLANES_R32G32B32A32F,
RENDERHAL_PLANES_Y8_ADV,
RENDERHAL_PLANES_G32R32F,
RENDERHAL_PLANES_NV12_2PLANES_COMBINED,
RENDERHAL_PLANES_P016_2PLANES_COMBINED,

RENDERHAL_PLANES_DEFINITION_COUNT
} RENDERHAL_PLANE_DEFINITION, *PRENDERHAL_PLANE_DEFINITION;
Expand Down Expand Up @@ -1028,7 +1030,7 @@ typedef struct _RENDERHAL_SURFACE_STATE_PARAMS
uint32_t forceCommonSurfaceMessage : 1;
uint32_t surfaceType : 11;
MOS_COMPONENT Component : 4;
uint32_t reserved : 1;
uint32_t combineChannelY : 1; // Combine 2 Luma Channel pixels into 1 pixel, so that kernel can reduce write times
RENDERHAL_MEMORY_OBJECT_CONTROL MemObjCtl; // Caching attributes
} RENDERHAL_SURFACE_STATE_PARAMS, *PRENDERHAL_SURFACE_STATE_PARAMS;

Expand Down Expand Up @@ -1394,10 +1396,11 @@ typedef struct _RENDERHAL_INTERFACE
PRENDERHAL_SURFACE_STATE_PARAMS pParams);

MOS_STATUS (*pfnGetPlaneDefinitionForCommonMessage) (
PRENDERHAL_INTERFACE pRenderHal,
MOS_FORMAT format,
bool isRenderTarget,
RENDERHAL_PLANE_DEFINITION &planeDefinition);
PRENDERHAL_INTERFACE pRenderHal,
MOS_FORMAT format,
PRENDERHAL_SURFACE_STATE_PARAMS &pParam,
bool isRenderTarget,
RENDERHAL_PLANE_DEFINITION &planeDefinition);

//---------------------------
// State Setup - HW + OS Specific
Expand Down
1 change: 1 addition & 0 deletions media_common/agnostic/common/vp/hal/vp_common_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ enum VpKernelID
kernelRenderCopy,

kernelL0FcCommon,
kernelL0FcFP,

baseKernelMaxNumID
};
Expand Down
47 changes: 37 additions & 10 deletions media_softlet/agnostic/common/renderhal/renderhal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,24 @@ extern const MHW_SURFACE_PLANES g_cRenderHal_SurfacePlanes[RENDERHAL_PLANES_DEFI
{ 1,
{
{ MHW_GENERIC_PLANE, 1, 1, 1, 1, 0, 0, MHW_GFX3DSTATE_SURFACEFORMAT_R16G16B16A16_UNORM }
}
}
}
},
//RENDERHAL_PLANES_NV12_2PLANES_COMBINED Combine 2 Luma Channel pixels into 1 pixel, so that kernel can reduce write times
{
2,
{
{MHW_Y_PLANE, 2, 1, 1, 1, 2, 0, MHW_GFX3DSTATE_SURFACEFORMAT_R8G8_UNORM},
{MHW_U_PLANE, 2, 2, 1, 1, 2, 0, MHW_GFX3DSTATE_SURFACEFORMAT_R8G8_UNORM}
}
},
//RENDERHAL_PLANES_P016_2PLANES_COMBINED Combine 2 Luma Channel pixels into 1 pixel, so that kernel can reduce write times
{
2,
{
{MHW_Y_PLANE, 2, 1, 1, 1, 2, 0, MHW_GFX3DSTATE_SURFACEFORMAT_R8G8_UNORM},
{MHW_U_PLANE, 2, 2, 1, 1, 2, 0, MHW_GFX3DSTATE_SURFACEFORMAT_R8G8_UNORM}
}
},
};

//!
Expand Down Expand Up @@ -4077,7 +4093,7 @@ MOS_STATUS RenderHal_GetSurfaceStateEntries(
if (pParams->forceCommonSurfaceMessage)
{
MHW_RENDERHAL_CHK_NULL_RETURN(pRenderHal->pfnGetPlaneDefinitionForCommonMessage);
MHW_RENDERHAL_CHK_STATUS_RETURN(pRenderHal->pfnGetPlaneDefinitionForCommonMessage(pRenderHal, pSurface->Format, pRenderHalSurface->SurfType == RENDERHAL_SURF_OUT_RENDERTARGET, PlaneDefinition));
MHW_RENDERHAL_CHK_STATUS_RETURN(pRenderHal->pfnGetPlaneDefinitionForCommonMessage(pRenderHal, pSurface->Format, pParams, pRenderHalSurface->SurfType == RENDERHAL_SURF_OUT_RENDERTARGET, PlaneDefinition));
}

// Get plane definitions
Expand Down Expand Up @@ -4247,10 +4263,11 @@ MOS_STATUS RenderHal_GetSurfaceStateEntries(
//! Error code if invalid parameters, MOS_STATUS_SUCCESS otherwise
//!
MOS_STATUS RenderHal_GetPlaneDefinitionForCommonMessage(
PRENDERHAL_INTERFACE pRenderHal,
MOS_FORMAT format,
bool isRenderTarget,
RENDERHAL_PLANE_DEFINITION& planeDefinition)
PRENDERHAL_INTERFACE pRenderHal,
MOS_FORMAT format,
PRENDERHAL_SURFACE_STATE_PARAMS &pParam,
bool isRenderTarget,
RENDERHAL_PLANE_DEFINITION &planeDefinition)
{
switch (format)
{
Expand All @@ -4266,13 +4283,23 @@ MOS_STATUS RenderHal_GetPlaneDefinitionForCommonMessage(
case Format_B10G10R10A2:
case Format_A16B16G16R16F:
case Format_Y410:
case Format_NV12:
case Format_P010:
case Format_P016:
case Format_P210:
case Format_P216:
//already handled rightly in normal non-adv GetPlaneDefinition
break;
case Format_NV12:
if (pParam->combineChannelY)
{
planeDefinition = RENDERHAL_PLANES_NV12_2PLANES_COMBINED;
}
break;
case Format_P010:
case Format_P016:
if (pParam->combineChannelY)
{
planeDefinition = RENDERHAL_PLANES_P016_2PLANES_COMBINED;
}
break;
case Format_400P:
planeDefinition = RENDERHAL_PLANES_R8;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ typedef struct _SURFACE_PARAMS
SurfaceType surfType;
bool isOutput;
bool needVerticalStirde;
bool combineChannelY;
} SURFACE_PARAMS, *PSURFACE_PARAMS;

using KERNEL_CONFIGS = std::map<VpKernelID, void *>; // Only for legacy/non-cm kernels
Expand Down

0 comments on commit 5641059

Please sign in to comment.