Change the size of aux translation transfer.

Change-Id: I9b34babf26eee217c203d0c09d819765a45a9506
Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
Mrozek, Michal
2019-04-20 13:08:54 +02:00
parent 2b64ef6c01
commit 22c2c9b02c
12 changed files with 27 additions and 26 deletions

View File

@@ -105,7 +105,7 @@ class Buffer : public MemObj {
bool isValidSubBufferOffset(size_t offset);
uint64_t setArgStateless(void *memory, uint32_t patchSize) { return setArgStateless(memory, patchSize, false); }
uint64_t setArgStateless(void *memory, uint32_t patchSize, bool set32BitAddressing);
virtual void setArgStateful(void *memory, bool forceNonAuxMode, bool disableL3Cache) = 0;
virtual void setArgStateful(void *memory, bool forceNonAuxMode, bool programForAuxTranslation) = 0;
bool bufferRectPitchSet(const size_t *bufferOrigin,
const size_t *region,
size_t &bufferRowPitch,
@@ -165,7 +165,7 @@ class BufferHw : public Buffer {
: Buffer(context, properties, size, memoryStorage, hostPtr, gfxAllocation,
zeroCopy, isHostPtrSVM, isObjectRedescribed) {}
void setArgStateful(void *memory, bool forceNonAuxMode, bool disableL3Cache) override;
void setArgStateful(void *memory, bool forceNonAuxMode, bool programForAuxTranslation) override;
void appendBufferState(void *memory, Context *context, GraphicsAllocation *gfxAllocation);
static Buffer *create(Context *context,

View File

@@ -28,13 +28,12 @@ union SURFACE_STATE_BUFFER_LENGTH {
};
template <typename GfxFamily>
void BufferHw<GfxFamily>::setArgStateful(void *memory, bool forceNonAuxMode, bool disableL3Cache) {
void BufferHw<GfxFamily>::setArgStateful(void *memory, bool forceNonAuxMode, bool programForAuxTranslation) {
using RENDER_SURFACE_STATE = typename GfxFamily::RENDER_SURFACE_STATE;
using SURFACE_FORMAT = typename RENDER_SURFACE_STATE::SURFACE_FORMAT;
using AUXILIARY_SURFACE_MODE = typename RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE;
auto surfaceState = reinterpret_cast<RENDER_SURFACE_STATE *>(memory);
// The graphics allocation for Host Ptr surface will be created in makeResident call and GPU address is expected to be the same as CPU address
auto bufferAddress = (getGraphicsAllocation() != nullptr) ? getGraphicsAllocation()->getGpuAddress() : reinterpret_cast<uint64_t>(getHostPtr());
bufferAddress += this->offset;
@@ -42,7 +41,7 @@ void BufferHw<GfxFamily>::setArgStateful(void *memory, bool forceNonAuxMode, boo
auto bufferAddressAligned = alignDown(bufferAddress, 4);
auto bufferOffset = ptrDiff(bufferAddress, bufferAddressAligned);
auto surfaceSize = alignUp(getSize() + bufferOffset, 4);
auto surfaceSize = alignUp(getSize() + bufferOffset, programForAuxTranslation ? 512 : 4);
SURFACE_STATE_BUFFER_LENGTH Length = {0};
Length.Length = static_cast<uint32_t>(surfaceSize - 1);
@@ -63,7 +62,7 @@ void BufferHw<GfxFamily>::setArgStateful(void *memory, bool forceNonAuxMode, boo
surfaceState->setTileMode(RENDER_SURFACE_STATE::TILE_MODE_LINEAR);
surfaceState->setVerticalLineStride(0);
surfaceState->setVerticalLineStrideOffset(0);
surfaceState->setMemoryObjectControlState(getMocsValue(disableL3Cache));
surfaceState->setMemoryObjectControlState(getMocsValue(programForAuxTranslation));
surfaceState->setSurfaceBaseAddress(bufferAddressAligned);
Gmm *gmm = graphicsAllocation ? graphicsAllocation->getDefaultGmm() : nullptr;