2019-04-03 15:59:31 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2019-09-04 10:58:52 +02:00
|
|
|
#include "core/memory_manager/memory_constants.h"
|
2019-06-26 11:37:46 +02:00
|
|
|
#include "runtime/helpers/csr_deps.h"
|
2019-07-04 14:22:28 +02:00
|
|
|
#include "runtime/helpers/properties_helper.h"
|
2019-06-26 11:37:46 +02:00
|
|
|
|
2019-04-03 15:59:31 +02:00
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
namespace NEO {
|
2019-07-03 09:30:30 +02:00
|
|
|
struct BuiltinOpParams;
|
|
|
|
class Context;
|
2019-06-27 16:08:20 +02:00
|
|
|
class CommandStreamReceiver;
|
2019-04-03 15:59:31 +02:00
|
|
|
class GraphicsAllocation;
|
|
|
|
class LinearStream;
|
2019-06-26 11:37:46 +02:00
|
|
|
class TimestampPacketContainer;
|
|
|
|
|
|
|
|
struct BlitProperties {
|
2019-07-01 11:08:58 +02:00
|
|
|
static BlitProperties constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection blitDirection,
|
2019-06-27 16:08:20 +02:00
|
|
|
CommandStreamReceiver &commandStreamReceiver,
|
2019-09-17 10:43:14 +02:00
|
|
|
GraphicsAllocation *memObjAllocation, void *hostPtr, size_t hostPtrOffset,
|
|
|
|
bool blocking, size_t offset, uint64_t copySize);
|
2019-06-26 11:37:46 +02:00
|
|
|
|
2019-07-03 09:30:30 +02:00
|
|
|
static BlitProperties constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection blitDirection,
|
|
|
|
CommandStreamReceiver &commandStreamReceiver,
|
|
|
|
const BuiltinOpParams &builtinOpParams,
|
|
|
|
bool blocking);
|
|
|
|
|
2019-07-01 11:08:58 +02:00
|
|
|
static BlitProperties constructPropertiesForCopyBuffer(GraphicsAllocation *dstAllocation, GraphicsAllocation *srcAllocation,
|
|
|
|
bool blocking, size_t dstOffset, size_t srcOffset, uint64_t copySize);
|
|
|
|
|
2019-07-04 14:22:28 +02:00
|
|
|
static BlitProperties constructPropertiesForAuxTranslation(AuxTranslationDirection auxTranslationDirection,
|
|
|
|
GraphicsAllocation *allocation);
|
|
|
|
|
2019-07-03 09:30:30 +02:00
|
|
|
static BlitterConstants::BlitDirection obtainBlitDirection(uint32_t commandType);
|
|
|
|
|
2019-06-26 11:37:46 +02:00
|
|
|
TimestampPacketContainer *outputTimestampPacket = nullptr;
|
2019-07-01 11:08:58 +02:00
|
|
|
BlitterConstants::BlitDirection blitDirection;
|
2019-06-26 11:37:46 +02:00
|
|
|
CsrDependencies csrDependencies;
|
2019-07-04 14:22:28 +02:00
|
|
|
AuxTranslationDirection auxTranslationDirection = AuxTranslationDirection::None;
|
2019-06-26 11:37:46 +02:00
|
|
|
|
2019-06-27 16:08:20 +02:00
|
|
|
GraphicsAllocation *dstAllocation = nullptr;
|
|
|
|
GraphicsAllocation *srcAllocation = nullptr;
|
2019-06-26 11:37:46 +02:00
|
|
|
void *hostPtr = nullptr;
|
|
|
|
bool blocking = false;
|
|
|
|
size_t dstOffset = 0;
|
|
|
|
size_t srcOffset = 0;
|
|
|
|
uint64_t copySize = 0;
|
|
|
|
};
|
2019-04-03 15:59:31 +02:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct BlitCommandsHelper {
|
2019-06-27 16:08:20 +02:00
|
|
|
static size_t estimateBlitCommandsSize(uint64_t copySize, const CsrDependencies &csrDependencies, bool updateTimestampPacket);
|
|
|
|
static void dispatchBlitCommandsForBuffer(const BlitProperties &blitProperites, LinearStream &linearStream);
|
|
|
|
static void appendBlitCommandsForBuffer(const BlitProperties &blitProperites, typename GfxFamily::XY_COPY_BLT &blitCmd);
|
2019-04-03 15:59:31 +02:00
|
|
|
};
|
|
|
|
} // namespace NEO
|