Revert "Update H/V alignment GMM API"

This reverts commit b3e1bb08ba.

Change-Id: I412a515892c5f6ee2cfee3aae862d2473fe19dee
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-04-15 07:59:20 +02:00
committed by sys_ocldev
parent 2fd7a9a3bb
commit d7ab156a56
9 changed files with 34 additions and 27 deletions

View File

@@ -200,6 +200,14 @@ uint32_t Gmm::queryQPitch(GMM_RESOURCE_TYPE resType) {
return gmmResourceInfo->getQPitch();
}
uint32_t Gmm::getRenderHAlignment() {
return GmmHelper::getRenderAlignment(gmmResourceInfo->getHAlign());
}
uint32_t Gmm::getRenderVAlignment() {
return GmmHelper::getRenderAlignment(gmmResourceInfo->getVAlign());
}
void Gmm::updateImgInfo(ImageInfo &imgInfo, cl_image_desc &imgDesc, cl_uint arrayIndex) {
imgDesc.image_width = gmmResourceInfo->getBaseWidth();
imgDesc.image_row_pitch = gmmResourceInfo->getRenderPitch();

View File

@@ -32,6 +32,9 @@ class Gmm {
void queryImageParams(ImageInfo &inputOutputImgInfo);
uint32_t getRenderHAlignment();
uint32_t getRenderVAlignment();
void applyAuxFlagsForBuffer(bool preferRenderCompression);
void applyMemoryFlags(bool systemMemoryPool, StorageInfo &storageInfo);

View File

@@ -106,6 +106,18 @@ uint64_t GmmHelper::decanonize(uint64_t address) {
return (uint64_t)(address & 0xFFFFFFFFFFFF);
}
uint32_t GmmHelper::getRenderAlignment(uint32_t alignment) {
uint32_t returnAlign = 0;
if (alignment == 8) {
returnAlign = 2;
} else if (alignment == 16) {
returnAlign = 3;
} else {
returnAlign = 1;
}
return returnAlign;
}
uint32_t GmmHelper::getRenderMultisamplesCount(uint32_t numSamples) {
if (numSamples == 2) {
return 1;

View File

@@ -47,6 +47,7 @@ class GmmHelper {
static void queryImgFromBufferParams(ImageInfo &imgInfo, GraphicsAllocation *gfxAlloc);
static GMM_CUBE_FACE_ENUM getCubeFaceIndex(uint32_t target);
static bool allowTiling(const cl_image_desc &imageDesc);
static uint32_t getRenderAlignment(uint32_t alignment);
static uint32_t getRenderMultisamplesCount(uint32_t numSamples);
static GMM_YUV_PLANE convertPlane(OCLPlane oclPlane);

View File

@@ -42,10 +42,6 @@ class GmmResourceInfo {
MOCKABLE_VIRTUAL uint32_t getVAlign() { return resourceInfo->GetVAlign(); }
MOCKABLE_VIRTUAL uint32_t getHAlignSurfaceState() { return resourceInfo->GetHAlignSurfaceState(); }
MOCKABLE_VIRTUAL uint32_t getVAlignSurfaceState() { return resourceInfo->GetVAlignSurfaceState(); }
MOCKABLE_VIRTUAL uint32_t getMaxLod() { return resourceInfo->GetMaxLod(); }
MOCKABLE_VIRTUAL uint32_t getTileModeSurfaceState() { return resourceInfo->GetTileModeSurfaceState(); }

View File

@@ -48,8 +48,8 @@ void ImageHw<GfxFamily>::setImageArg(void *memory, bool setAsMediaBlockImage, ui
auto vAlign = RENDER_SURFACE_STATE::SURFACE_VERTICAL_ALIGNMENT_VALIGN_4;
if (gmm) {
hAlign = static_cast<typename RENDER_SURFACE_STATE::SURFACE_HORIZONTAL_ALIGNMENT>(gmm->gmmResourceInfo->getHAlignSurfaceState());
vAlign = static_cast<typename RENDER_SURFACE_STATE::SURFACE_VERTICAL_ALIGNMENT>(gmm->gmmResourceInfo->getVAlignSurfaceState());
hAlign = static_cast<typename RENDER_SURFACE_STATE::SURFACE_HORIZONTAL_ALIGNMENT>(gmm->getRenderHAlignment());
vAlign = static_cast<typename RENDER_SURFACE_STATE::SURFACE_VERTICAL_ALIGNMENT>(gmm->getRenderVAlignment());
}
if (cubeFaceIndex != __GMM_NO_CUBE_MAP) {