mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
refactor: reduce usage of gmmlib headers
use own ImageTilingMode wrapper Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d8ef0aa99d
commit
95f69a5107
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/gmm_helper/gmm_lib.h"
|
||||
#include "shared/source/helpers/blit_properties_container.h"
|
||||
#include "shared/source/helpers/vec.h"
|
||||
|
||||
@@ -15,6 +14,7 @@
|
||||
namespace NEO {
|
||||
|
||||
enum class ImagePlane;
|
||||
enum class ImageTilingMode;
|
||||
class CsrDependencies;
|
||||
class GraphicsAllocation;
|
||||
class LinearStream;
|
||||
@@ -82,10 +82,10 @@ struct BlitCommandsHelper {
|
||||
static void appendBlitMemSetCommand(const BlitProperties &blitProperties, void *blitCmd);
|
||||
static void appendSurfaceType(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd);
|
||||
static void appendTilingEnable(typename GfxFamily::XY_COLOR_BLT &blitCmd);
|
||||
static void appendTilingType(const GMM_TILE_TYPE srcTilingType, const GMM_TILE_TYPE dstTilingType, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd);
|
||||
static void appendTilingType(ImageTilingMode srcTilingType, ImageTilingMode dstTilingType, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd);
|
||||
static void appendSliceOffsets(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd, uint32_t sliceIndex, const RootDeviceEnvironment &rootDeviceEnvironment, uint32_t srcSlicePitch, uint32_t dstSlicePitch);
|
||||
static void appendBaseAddressOffset(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd, const bool isSource);
|
||||
static void getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch, GMM_TILE_TYPE &tileType,
|
||||
static void getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch, ImageTilingMode &tileType,
|
||||
uint32_t &mipTailLod, uint32_t &compressionDetails,
|
||||
const RootDeviceEnvironment &rootDeviceEnvironment, ImagePlane plane);
|
||||
static void dispatchDebugPauseCommands(LinearStream &commandStream, uint64_t debugPauseStateGPUAddress, DebugPauseState confirmationTrigger,
|
||||
|
||||
@@ -121,19 +121,19 @@ void BlitCommandsHelper<GfxFamily>::appendSurfaceType(const BlitProperties &blit
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void BlitCommandsHelper<GfxFamily>::appendTilingType(const GMM_TILE_TYPE srcTilingType, const GMM_TILE_TYPE dstTilingType, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd) {
|
||||
void BlitCommandsHelper<GfxFamily>::appendTilingType(ImageTilingMode srcTilingType, ImageTilingMode dstTilingType, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd) {
|
||||
using XY_BLOCK_COPY_BLT = typename GfxFamily::XY_BLOCK_COPY_BLT;
|
||||
UNRECOVERABLE_IF((srcTilingType != dstTilingType) && blitCmd.getSpecialModeOfOperation() == XY_BLOCK_COPY_BLT::SPECIAL_MODE_OF_OPERATION::SPECIAL_MODE_OF_OPERATION_FULL_RESOLVE);
|
||||
if (srcTilingType == GMM_TILED_4) {
|
||||
if (srcTilingType == ImageTilingMode::tiled4) {
|
||||
blitCmd.setSourceTiling(XY_BLOCK_COPY_BLT::TILING::TILING_TILE4);
|
||||
} else if (srcTilingType == GMM_TILED_64) {
|
||||
} else if (srcTilingType == ImageTilingMode::tiled64) {
|
||||
blitCmd.setSourceTiling(XY_BLOCK_COPY_BLT::TILING::TILING_TILE64);
|
||||
} else {
|
||||
blitCmd.setSourceTiling(XY_BLOCK_COPY_BLT::TILING::TILING_LINEAR);
|
||||
}
|
||||
if (dstTilingType == GMM_TILED_4) {
|
||||
if (dstTilingType == ImageTilingMode::tiled4) {
|
||||
blitCmd.setDestinationTiling(XY_BLOCK_COPY_BLT::TILING::TILING_TILE4);
|
||||
} else if (dstTilingType == GMM_TILED_64) {
|
||||
} else if (dstTilingType == ImageTilingMode::tiled64) {
|
||||
blitCmd.setDestinationTiling(XY_BLOCK_COPY_BLT::TILING::TILING_TILE64);
|
||||
} else {
|
||||
blitCmd.setDestinationTiling(XY_BLOCK_COPY_BLT::TILING::TILING_LINEAR);
|
||||
@@ -170,16 +170,16 @@ void BlitCommandsHelper<GfxFamily>::appendColorDepth(const BlitProperties &blitP
|
||||
|
||||
template <typename GfxFamily>
|
||||
void BlitCommandsHelper<GfxFamily>::getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch,
|
||||
GMM_TILE_TYPE &tileType, uint32_t &mipTailLod, uint32_t &compressionDetails,
|
||||
ImageTilingMode &tileType, uint32_t &mipTailLod, uint32_t &compressionDetails,
|
||||
const RootDeviceEnvironment &rootDeviceEnvironment, ImagePlane plane) {
|
||||
if (allocation.getDefaultGmm()) {
|
||||
auto gmmResourceInfo = allocation.getDefaultGmm()->gmmResourceInfo.get();
|
||||
mipTailLod = gmmResourceInfo->getMipTailStartLODSurfaceState();
|
||||
auto resInfo = gmmResourceInfo->getResourceFlags()->Info;
|
||||
if (resInfo.Tile4) {
|
||||
tileType = GMM_TILED_4;
|
||||
tileType = ImageTilingMode::tiled4;
|
||||
} else if (resInfo.Tile64) {
|
||||
tileType = GMM_TILED_64;
|
||||
tileType = ImageTilingMode::tiled64;
|
||||
}
|
||||
|
||||
if (!resInfo.Linear) {
|
||||
@@ -199,8 +199,8 @@ void BlitCommandsHelper<GfxFamily>::getBlitAllocationProperties(const GraphicsAl
|
||||
|
||||
template <typename GfxFamily>
|
||||
void BlitCommandsHelper<GfxFamily>::appendBlitCommandsForImages(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd, const RootDeviceEnvironment &rootDeviceEnvironment, uint32_t &srcSlicePitch, uint32_t &dstSlicePitch) {
|
||||
auto srcTileType = GMM_NOT_TILED;
|
||||
auto dstTileType = GMM_NOT_TILED;
|
||||
auto srcTileType = ImageTilingMode::notTiled;
|
||||
auto dstTileType = ImageTilingMode::notTiled;
|
||||
auto srcAllocation = blitProperties.srcAllocation;
|
||||
auto dstAllocation = blitProperties.dstAllocation;
|
||||
auto srcRowPitch = static_cast<uint32_t>(blitProperties.srcRowPitch);
|
||||
@@ -224,8 +224,8 @@ void BlitCommandsHelper<GfxFamily>::appendBlitCommandsForImages(const BlitProper
|
||||
srcSlicePitch = std::max(srcSlicePitch, srcRowPitch * srcQPitch);
|
||||
dstSlicePitch = std::max(dstSlicePitch, dstRowPitch * dstQPitch);
|
||||
|
||||
blitCmd.setSourcePitch(srcTileType == GMM_NOT_TILED ? srcRowPitch : srcRowPitch / 4);
|
||||
blitCmd.setDestinationPitch(dstTileType == GMM_NOT_TILED ? dstRowPitch : dstRowPitch / 4);
|
||||
blitCmd.setSourcePitch(srcTileType == ImageTilingMode::notTiled ? srcRowPitch : srcRowPitch / 4);
|
||||
blitCmd.setDestinationPitch(dstTileType == ImageTilingMode::notTiled ? dstRowPitch : dstRowPitch / 4);
|
||||
blitCmd.setSourceSurfaceQpitch(srcQPitch / 4);
|
||||
blitCmd.setDestinationSurfaceQpitch(dstQPitch / 4);
|
||||
blitCmd.setSourceMipTailStartLOD(srcMipTailLod);
|
||||
|
||||
@@ -233,14 +233,14 @@ struct ImageDescriptor {
|
||||
};
|
||||
|
||||
enum class ImageTilingMode {
|
||||
tiledAuto = 0,
|
||||
tiledW,
|
||||
tiledX,
|
||||
tiledY,
|
||||
tiledYf,
|
||||
tiledYs,
|
||||
tiledW,
|
||||
notTiled,
|
||||
tiled4,
|
||||
tiled64,
|
||||
tiledYf,
|
||||
tiledYs,
|
||||
};
|
||||
|
||||
struct ImageInfo {
|
||||
@@ -260,7 +260,7 @@ struct ImageInfo {
|
||||
bool linearStorage;
|
||||
bool useLocalMemory;
|
||||
bool isDisplayable;
|
||||
ImageTilingMode forceTiling;
|
||||
ImageTilingMode forceTiling = ImageTilingMode::notTiled;
|
||||
};
|
||||
|
||||
struct ImageImplicitArgs {
|
||||
|
||||
Reference in New Issue
Block a user