Fail resource allocation if the U plane offset exceeds the HW limitions (#26)

This commit is contained in:
johnmach 2021-03-08 14:08:17 +05:30 committed by GitHub
parent 496a00f646
commit 58c09f16d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -344,6 +344,17 @@ bool GmmLib::GmmTextureCalc::ValidateTexInfo(GMM_TEXTURE_INFO * pTexInfo,
return false;
}
if(GmmIsPlanar(pTexInfo->Format))
{
if((!GmmIsReconstructableSurface(pTexInfo->Format)) && (pTexInfo->OffsetInfo.Plane.Y[GMM_PLANE_U] >= GMM_MAX_UV_PLANE_Y_OFFSET))
{
GMM_ASSERTDPF(0,
"GmmLib::GmmTextureCalc::ValidateTexInfo:Y offset of U plane"
"exceeds max HW U plane Y offset restriction.\r\n");
return false;
}
}
GMM_DPF_EXIT;
return true;
}

View File

@ -52,3 +52,4 @@ OTHER DEALINGS IN THE SOFTWARE.
#define GMM_MEDIA_COMPRESSION_STATE_SIZE (64)
#define GMM_CLEAR_COLOR_FLOAT_SIZE (16)
#define GMM_MAX_LCU_SIZE 64 // Media Largest coding Unit
#define GMM_MAX_UV_PLANE_Y_OFFSET GMM_KBYTE(16) // RENDER_SURFACE_STATE structure only have 0:13 bit to write Y Offset for U or UV Plan(max value is <16384)