Skip to content

Commit

Permalink
[VP] Set sRGB color space for non-video wall and no background colorf…
Browse files Browse the repository at this point in the history
…ill cases.

* [VP] Set sRGB color space for non-video wall and no background colorfill cases.

This solves the regression caused by
a9c2df7.
  • Loading branch information
Lu-Anxiao authored and intel-mediadev committed Oct 9, 2023
1 parent 176a5c3 commit 509ab5f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
18 changes: 13 additions & 5 deletions media_driver/linux/common/vp/ddi/media_libva_vp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ DdiVp_SetProcPipelineParams(

// Background Colorfill
// According to libva definition, if alpha in output background color is zero, then colorfill is not needed
if ((pPipelineParam->output_background_color >> 24) != 0)
if ((pPipelineParam->output_background_color >> 24) != 0 || pVpHalTgtSurf->ColorSpace == CSpace_sRGB)
{
if (pVpHalRenderParams->pColorFillParams == nullptr)
{
Expand All @@ -1157,10 +1157,18 @@ DdiVp_SetProcPipelineParams(

DDI_CHK_NULL(pVpHalRenderParams->pColorFillParams, "Null pColorFillParams.", VA_STATUS_ERROR_UNKNOWN);

// set background colorfill option
pVpHalRenderParams->pColorFillParams->Color = pPipelineParam->output_background_color;
pVpHalRenderParams->pColorFillParams->bYCbCr = false;
pVpHalRenderParams->pColorFillParams->CSpace = CSpace_sRGB;
if (pVpHalTgtSurf->ColorSpace == CSpace_sRGB && (pPipelineParam->output_background_color >> 24) == 0)
{
// set color space for sRGB output
pVpHalRenderParams->pColorFillParams->CSpace = CSpace_sRGB;
}
else
{
// set background colorfill option
pVpHalRenderParams->pColorFillParams->Color = pPipelineParam->output_background_color;
pVpHalRenderParams->pColorFillParams->bYCbCr = false;
pVpHalRenderParams->pColorFillParams->CSpace = CSpace_sRGB;
}
}else
{
MOS_FreeMemAndSetNull(pVpHalRenderParams->pColorFillParams);
Expand Down
19 changes: 14 additions & 5 deletions media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2112,8 +2112,9 @@ VAStatus DdiVpFunctions::SetBackgroundColorfill(
{
DDI_VP_FUNC_ENTER;
DDI_VP_CHK_NULL(vpHalRenderParams, "nullptr vpHalRenderParams.", VA_STATUS_ERROR_INVALID_PARAMETER);
DDI_VP_CHK_NULL(vpHalRenderParams->pTarget[0],"nullptr pTarget[0].", VA_STATUS_ERROR_INVALID_PARAMETER);

if ((outBackGroundcolor >> 24) != 0)
if ((outBackGroundcolor >> 24) != 0 || vpHalRenderParams->pTarget[0]->ColorSpace == CSpace_sRGB)
{
if (vpHalRenderParams->pColorFillParams == nullptr)
{
Expand All @@ -2122,10 +2123,18 @@ VAStatus DdiVpFunctions::SetBackgroundColorfill(

DDI_VP_CHK_NULL(vpHalRenderParams->pColorFillParams, "nullptr pColorFillParams.", VA_STATUS_ERROR_UNKNOWN);

// set background colorfill option
vpHalRenderParams->pColorFillParams->Color = outBackGroundcolor;
vpHalRenderParams->pColorFillParams->bYCbCr = false;
vpHalRenderParams->pColorFillParams->CSpace = CSpace_sRGB;
if (vpHalRenderParams->pTarget[0]->ColorSpace == CSpace_sRGB && (outBackGroundcolor >> 24) == 0)
{
// set color space for sRGB output
vpHalRenderParams->pColorFillParams->CSpace = CSpace_sRGB;
}
else
{
// set background colorfill option
vpHalRenderParams->pColorFillParams->Color = outBackGroundcolor;
vpHalRenderParams->pColorFillParams->bYCbCr = false;
vpHalRenderParams->pColorFillParams->CSpace = CSpace_sRGB;
}
}
else
{
Expand Down

0 comments on commit 509ab5f

Please sign in to comment.