2021-04-24 00:43:48 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "shared/source/helpers/common_types.h"
|
|
|
|
#include "shared/source/helpers/vec.h"
|
|
|
|
|
2021-10-29 18:12:13 +08:00
|
|
|
namespace WalkerPartition {
|
|
|
|
struct WalkerPartitionArgs;
|
|
|
|
}
|
|
|
|
|
2021-04-24 00:43:48 +08:00
|
|
|
namespace NEO {
|
2021-11-11 03:56:42 +08:00
|
|
|
struct HardwareInfo;
|
2021-04-24 00:43:48 +08:00
|
|
|
class LinearStream;
|
2021-11-04 23:28:06 +08:00
|
|
|
struct PipeControlArgs;
|
2021-04-24 00:43:48 +08:00
|
|
|
|
|
|
|
namespace ImplicitScaling {
|
|
|
|
extern bool apiSupport;
|
2021-09-14 01:39:55 +08:00
|
|
|
} // namespace ImplicitScaling
|
2021-04-24 00:43:48 +08:00
|
|
|
|
|
|
|
struct ImplicitScalingHelper {
|
|
|
|
static bool isImplicitScalingEnabled(const DeviceBitfield &devices, bool preCondition);
|
2021-09-14 01:39:55 +08:00
|
|
|
static bool isSemaphoreProgrammingRequired();
|
2021-10-29 18:12:13 +08:00
|
|
|
static bool isCrossTileAtomicRequired(bool defaultCrossTileRequirement);
|
2021-04-24 00:43:48 +08:00
|
|
|
static bool isSynchronizeBeforeExecutionRequired();
|
2021-09-16 20:11:22 +08:00
|
|
|
static bool isAtomicsUsedForSelfCleanup();
|
2021-10-29 18:12:13 +08:00
|
|
|
static bool isSelfCleanupRequired(const WalkerPartition::WalkerPartitionArgs &args, bool apiSelfCleanup);
|
2021-09-16 20:11:22 +08:00
|
|
|
static bool isWparidRegisterInitializationRequired();
|
2021-10-29 18:12:13 +08:00
|
|
|
static bool isPipeControlStallRequired(bool defaultEmitPipeControl);
|
2021-04-24 00:43:48 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct ImplicitScalingDispatch {
|
|
|
|
using WALKER_TYPE = typename GfxFamily::WALKER_TYPE;
|
|
|
|
|
2021-10-29 18:12:13 +08:00
|
|
|
static size_t getSize(bool apiSelfCleanup,
|
2021-04-24 00:43:48 +08:00
|
|
|
bool preferStaticPartitioning,
|
|
|
|
const DeviceBitfield &devices,
|
2021-09-08 05:21:19 +08:00
|
|
|
const Vec3<size_t> &groupStart,
|
|
|
|
const Vec3<size_t> &groupCount);
|
2021-10-29 18:12:13 +08:00
|
|
|
|
2021-04-24 00:43:48 +08:00
|
|
|
static void dispatchCommands(LinearStream &commandStream,
|
|
|
|
WALKER_TYPE &walkerCmd,
|
|
|
|
const DeviceBitfield &devices,
|
|
|
|
uint32_t &partitionCount,
|
|
|
|
bool useSecondaryBatchBuffer,
|
2021-10-29 18:12:13 +08:00
|
|
|
bool apiSelfCleanup,
|
2021-04-24 00:43:48 +08:00
|
|
|
bool usesImages,
|
|
|
|
uint64_t workPartitionAllocationGpuVa);
|
2021-10-29 18:12:13 +08:00
|
|
|
|
|
|
|
static bool &getPipeControlStallRequired();
|
|
|
|
|
2021-11-11 03:56:42 +08:00
|
|
|
static size_t getBarrierSize(const HardwareInfo &hwInfo,
|
|
|
|
bool apiSelfCleanup,
|
|
|
|
bool usePostSync);
|
2021-10-29 18:12:13 +08:00
|
|
|
static void dispatchBarrierCommands(LinearStream &commandStream,
|
|
|
|
const DeviceBitfield &devices,
|
2021-11-04 23:28:06 +08:00
|
|
|
PipeControlArgs &flushArgs,
|
2021-11-11 03:56:42 +08:00
|
|
|
const HardwareInfo &hwInfo,
|
|
|
|
uint64_t gpuAddress,
|
|
|
|
uint64_t immediateData,
|
2021-10-29 18:12:13 +08:00
|
|
|
bool apiSelfCleanup,
|
|
|
|
bool useSecondaryBatchBuffer);
|
|
|
|
|
2021-11-18 03:51:43 +08:00
|
|
|
static size_t getRegisterConfigurationSize();
|
|
|
|
static void dispatchRegisterConfiguration(LinearStream &commandStream,
|
|
|
|
uint64_t workPartitionSurfaceAddress,
|
|
|
|
uint32_t addressOffset);
|
|
|
|
|
|
|
|
static size_t getOffsetRegisterSize();
|
|
|
|
static void dispatchOffsetRegister(LinearStream &commandStream,
|
|
|
|
uint32_t addressOffset);
|
|
|
|
|
2021-11-30 22:41:26 +08:00
|
|
|
static uint32_t getPostSyncOffset();
|
|
|
|
|
2021-10-29 18:12:13 +08:00
|
|
|
private:
|
|
|
|
static bool pipeControlStallRequired;
|
2021-04-24 00:43:48 +08:00
|
|
|
};
|
|
|
|
|
2021-09-03 19:42:31 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct PartitionRegisters {
|
|
|
|
enum {
|
|
|
|
wparidCCSOffset = 0x221C,
|
|
|
|
addressOffsetCCSOffset = 0x23B4
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-04-24 00:43:48 +08:00
|
|
|
} // namespace NEO
|