2019-04-03 21:59:31 +08:00
|
|
|
/*
|
2020-01-22 23:22:30 +08:00
|
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
2019-04-03 21:59:31 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-01-22 23:22:30 +08:00
|
|
|
#include "core/command_stream/csr_deps.h"
|
2020-01-27 20:06:03 +08:00
|
|
|
#include "core/helpers/aux_translation.h"
|
2019-09-04 16:58:52 +08:00
|
|
|
#include "core/memory_manager/memory_constants.h"
|
2019-11-07 16:15:53 +08:00
|
|
|
#include "core/utilities/stackvec.h"
|
2019-06-26 17:37:46 +08:00
|
|
|
|
2019-04-03 21:59:31 +08:00
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
namespace NEO {
|
2019-06-27 22:08:20 +08:00
|
|
|
class CommandStreamReceiver;
|
2019-04-03 21:59:31 +08:00
|
|
|
class GraphicsAllocation;
|
|
|
|
class LinearStream;
|
2019-11-13 00:56:10 +08:00
|
|
|
struct TimestampPacketStorage;
|
|
|
|
|
|
|
|
template <typename TagType>
|
|
|
|
struct TagNode;
|
2019-06-26 17:37:46 +08:00
|
|
|
|
2019-11-18 20:35:44 +08:00
|
|
|
struct BlitProperties;
|
|
|
|
struct TimestampPacketDependencies;
|
2019-11-25 16:11:37 +08:00
|
|
|
using BlitPropertiesContainer = StackVec<BlitProperties, 16>;
|
2019-11-18 20:35:44 +08:00
|
|
|
|
2019-06-26 17:37:46 +08:00
|
|
|
struct BlitProperties {
|
2019-07-01 17:08:58 +08:00
|
|
|
static BlitProperties constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection blitDirection,
|
2019-06-27 22:08:20 +08:00
|
|
|
CommandStreamReceiver &commandStreamReceiver,
|
2019-12-12 17:47:28 +08:00
|
|
|
GraphicsAllocation *memObjAllocation,
|
|
|
|
GraphicsAllocation *preallocatedHostAllocation,
|
|
|
|
void *hostPtr, uint64_t memObjGpuVa,
|
|
|
|
uint64_t hostAllocGpuVa, size_t hostPtrOffset,
|
2019-11-07 16:15:53 +08:00
|
|
|
size_t copyOffset, uint64_t copySize);
|
2019-06-26 17:37:46 +08:00
|
|
|
|
2019-07-01 17:08:58 +08:00
|
|
|
static BlitProperties constructPropertiesForCopyBuffer(GraphicsAllocation *dstAllocation, GraphicsAllocation *srcAllocation,
|
2019-11-07 16:15:53 +08:00
|
|
|
size_t dstOffset, size_t srcOffset, uint64_t copySize);
|
2019-07-01 17:08:58 +08:00
|
|
|
|
2019-07-04 20:22:28 +08:00
|
|
|
static BlitProperties constructPropertiesForAuxTranslation(AuxTranslationDirection auxTranslationDirection,
|
|
|
|
GraphicsAllocation *allocation);
|
|
|
|
|
2019-11-18 20:35:44 +08:00
|
|
|
static void setupDependenciesForAuxTranslation(BlitPropertiesContainer &blitPropertiesContainer, TimestampPacketDependencies ×tampPacketDependencies,
|
2020-01-27 20:06:03 +08:00
|
|
|
TimestampPacketContainer &kernelTimestamps, const CsrDependencies &depsFromEvents,
|
2019-11-18 20:35:44 +08:00
|
|
|
CommandStreamReceiver &gpguCsr, CommandStreamReceiver &bcsCsr);
|
|
|
|
|
2019-07-03 15:30:30 +08:00
|
|
|
static BlitterConstants::BlitDirection obtainBlitDirection(uint32_t commandType);
|
|
|
|
|
2019-11-13 00:56:10 +08:00
|
|
|
TagNode<TimestampPacketStorage> *outputTimestampPacket = nullptr;
|
2019-07-01 17:08:58 +08:00
|
|
|
BlitterConstants::BlitDirection blitDirection;
|
2019-06-26 17:37:46 +08:00
|
|
|
CsrDependencies csrDependencies;
|
2019-07-04 20:22:28 +08:00
|
|
|
AuxTranslationDirection auxTranslationDirection = AuxTranslationDirection::None;
|
2019-06-26 17:37:46 +08:00
|
|
|
|
2019-06-27 22:08:20 +08:00
|
|
|
GraphicsAllocation *dstAllocation = nullptr;
|
|
|
|
GraphicsAllocation *srcAllocation = nullptr;
|
2019-12-12 17:47:28 +08:00
|
|
|
uint64_t dstGpuAddress = 0;
|
|
|
|
uint64_t srcGpuAddress = 0;
|
|
|
|
uint64_t copySize = 0;
|
2019-06-26 17:37:46 +08:00
|
|
|
size_t dstOffset = 0;
|
|
|
|
size_t srcOffset = 0;
|
|
|
|
};
|
2019-04-03 21:59:31 +08:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct BlitCommandsHelper {
|
2019-06-27 22:08:20 +08:00
|
|
|
static size_t estimateBlitCommandsSize(uint64_t copySize, const CsrDependencies &csrDependencies, bool updateTimestampPacket);
|
2019-11-07 16:15:53 +08:00
|
|
|
static size_t estimateBlitCommandsSize(const BlitPropertiesContainer &blitPropertiesContainer);
|
2019-10-28 18:54:59 +08:00
|
|
|
static void dispatchBlitCommandsForBuffer(const BlitProperties &blitProperties, LinearStream &linearStream);
|
|
|
|
static void appendBlitCommandsForBuffer(const BlitProperties &blitProperties, typename GfxFamily::XY_COPY_BLT &blitCmd);
|
2019-04-03 21:59:31 +08:00
|
|
|
};
|
|
|
|
} // namespace NEO
|