Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified config/linux/ipu8/gcss/OV13B10_09B13.IPU8.bin
Binary file not shown.
Binary file modified config/linux/ipu8/gcss/OV13B10_09B13_2M.IPU8.bin
Binary file not shown.
146 changes: 101 additions & 45 deletions modules/ipu_desc/ipu75xa/FragmentsConfigurator.cpp

Large diffs are not rendered by default.

28 changes: 22 additions & 6 deletions modules/ipu_desc/ipu75xa/FragmentsConfigurator.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,21 @@
#include "GraphResolutionConfiguratorInclude.h"
#include <map>

class Ipu8FragmentsConfigurator
class Gen2FragmentsConfigurator
{
public:
static const int32_t MIN_STRIPE_WIDTH_BEFORE_TNR = 128;
static const int32_t MIN_STRIPE_WIDTH_AFTER_TNR = 64;
static const int32_t UPSCALER_MAX_OUTPUT_WIDTH = 4672;
Ipu8FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node, uint8_t numberOfFragments);

Gen2FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node, uint8_t numberOfFragments);
virtual ~Gen2FragmentsConfigurator() = default;

StaticGraphStatus configureFragments(std::vector<SmurfKernelInfo*>& smurfKernels);

private:
// Stripe Actions - each filter will perform one action according to its role
protected:
virtual bool enforceUpscalerAspectRatioConstraints() const { return true; }

StaticGraphStatus configFragmentsDownscaler(StaticGraphRunKernel* runKernel, StaticGraphFragmentDesc* kernelFragments, uint32_t prevKernelUuid, StaticGraphFragmentDesc* prevKernelFragments);
StaticGraphStatus configFragmentsCropper(StaticGraphRunKernel* runKernel, StaticGraphFragmentDesc* kernelFragments, uint32_t prevKernelUuid, StaticGraphFragmentDesc* prevKernelFragments);
StaticGraphStatus configFragmentsUpscaler(StaticGraphRunKernel* runKernel, StaticGraphFragmentDesc* kernelFragments, uint32_t prevKernelUuid, StaticGraphFragmentDesc* prevKernelFragments);
Expand All @@ -61,10 +64,23 @@ class Ipu8FragmentsConfigurator
IStaticGraphConfig* _staticGraph = nullptr;
uint8_t _numberOfFragments = 0;

// Fragments binaries do not contain output start x, so we keep them here
std::map<uint32_t, std::vector<uint16_t>> _outputStartX;

// Save TNR resolutions for feeder configurations
StaticGraphFragmentDesc* _tnrScalerFragments = nullptr;
StaticGraphRunKernel* _tnrScalerRunKernel = nullptr;
};

class Ipu8FragmentsConfigurator : public Gen2FragmentsConfigurator
{
public:
Ipu8FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node, uint8_t numberOfFragments);
};

class Ipu9FragmentsConfigurator : public Gen2FragmentsConfigurator
{
public:
Ipu9FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node, uint8_t numberOfFragments);

protected:
bool enforceUpscalerAspectRatioConstraints() const override { return false; }
};
645 changes: 429 additions & 216 deletions modules/ipu_desc/ipu75xa/GraphResolutionConfigurator.cpp

Large diffs are not rendered by default.

65 changes: 57 additions & 8 deletions modules/ipu_desc/ipu75xa/GraphResolutionConfigurator.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ enum class GraphResolutionConfiguratorKernelRole : uint8_t
{
UpScaler,
DownScaler,
DownScalerSmall,
EspaCropper,
CasEspaCropper,
EspaCropperSmall,
NonRcb,
Output,
TnrOutput,
Expand All @@ -88,6 +91,8 @@ enum class GraphResolutionConfiguratorKernelRole : uint8_t
None
};

class Gen2FragmentsConfigurator;

class RunKernelCoords
{
public:
Expand Down Expand Up @@ -177,6 +182,7 @@ class GraphResolutionConfigurator
};

class Ipu8FragmentsConfigurator;
class Ipu9FragmentsConfigurator;

class SmurfKernelInfo
{
Expand All @@ -188,11 +194,11 @@ class SmurfKernelInfo
StaticGraphKernelResCrop _originalSmurfOutputCrop = { 0,0,0,0 };
};

class Ipu8GraphResolutionConfigurator : public GraphResolutionConfigurator
class Gen2GraphResolutionConfigurator : public GraphResolutionConfigurator
{
public:
Ipu8GraphResolutionConfigurator(IStaticGraphConfig* staticGraph);
~Ipu8GraphResolutionConfigurator();
Gen2GraphResolutionConfigurator(IStaticGraphConfig* staticGraph);
virtual ~Gen2GraphResolutionConfigurator();

StaticGraphStatus updateStaticGraphConfig(const RegionOfInterest& roi, bool isCenteredZoom); // Use only if 1-stripe processing is not needed
StaticGraphStatus updateStaticGraphConfig(const RegionOfInterest& roi, bool isCenteredZoom, bool& isFragmentsChanged);
Expand All @@ -203,7 +209,7 @@ class Ipu8GraphResolutionConfigurator : public GraphResolutionConfigurator
// This function is used for statistics output only
virtual StaticGraphStatus getStatsRoiFromSensorRoi(const SensorRoi& sensorRoi, ResolutionRoi& statsRoi);

private:
protected:
StaticGraphStatus initRunKernel(GraphResolutionConfiguratorKernelRole role, StaticGraphRunKernel*& runKernel);
StaticGraphStatus initRunKernel(uint32_t kernelUuid, StaticGraphRunKernel*& runKernel);
StaticGraphStatus initOutputRunKernel();
Expand All @@ -217,15 +223,22 @@ class Ipu8GraphResolutionConfigurator : public GraphResolutionConfigurator
StaticGraphStatus updateRunKernelOfScalers(ResolutionRoi& roi, bool& isFragmentsChanged);

StaticGraphStatus updateRunKernelDownScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, uint32_t& outputWidth, uint32_t& outputHeight);
StaticGraphStatus updateRunKernelUpScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, StaticGraphKernelResCrop& cropperKernelCrop, uint32_t inputWidth, uint32_t inputHeight, uint32_t outputWidth, uint32_t outputHeight);
virtual StaticGraphStatus updateRunKernelUpScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, StaticGraphKernelResCrop& cropperKernelCrop,
uint32_t inputWidth, uint32_t inputHeight, uint32_t outputWidth, uint32_t outputHeight) = 0;
StaticGraphStatus updateRunKernelCropper(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, StaticGraphRunKernel* downscalerRunKernel, uint32_t outputWidth, uint32_t outputHeight);
StaticGraphStatus updateRunKernelSmurf(SmurfKernelInfo* smurfInfo);

StaticGraphStatus SanityCheck();
StaticGraphStatus SanityCheckCrop(StaticGraphKernelResCrop* crop);

uint32_t _upscalerStepW = 1;
uint32_t _upscalerStepH = 1;
// Virtual hooks for derived class differences
virtual bool enforceUpscalerAspectRatioConstraints() const { return true; }
virtual void postScalerUpdate() {}
#if SUPPORT_FRAGMENTS == 1
virtual Gen2FragmentsConfigurator* createFragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node, uint8_t numberOfFragments) = 0;
StaticGraphStatus doFragmentsUpdate(bool& isFragmentsChanged);
Gen2FragmentsConfigurator* _fragmentsConfigurator = nullptr;
#endif

StaticGraphKernelResCrop _originalCropOfDownScaler = { 0,0,0,0 };
StaticGraphKernelResCrop _originalCropOfUpscaler = { 0,0,0,0 };
Expand All @@ -243,6 +256,42 @@ class Ipu8GraphResolutionConfigurator : public GraphResolutionConfigurator

// For striping
OuterNode* _node = nullptr;
Ipu8FragmentsConfigurator* _fragmentsConfigurator = nullptr;
bool _isFragments = false;
};

class Ipu8GraphResolutionConfigurator : public Gen2GraphResolutionConfigurator
{
public:
Ipu8GraphResolutionConfigurator(IStaticGraphConfig* staticGraph);
~Ipu8GraphResolutionConfigurator();

private:
StaticGraphStatus updateRunKernelUpScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, StaticGraphKernelResCrop& cropperKernelCrop,
uint32_t inputWidth, uint32_t inputHeight, uint32_t outputWidth, uint32_t outputHeight) override;
#if SUPPORT_FRAGMENTS == 1
Gen2FragmentsConfigurator* createFragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node, uint8_t numberOfFragments) override;
#endif

uint32_t _upscalerStepW = 1;
uint32_t _upscalerStepH = 1;
};

class Ipu9GraphResolutionConfigurator : public Gen2GraphResolutionConfigurator
{
public:
Ipu9GraphResolutionConfigurator(IStaticGraphConfig* staticGraph);
~Ipu9GraphResolutionConfigurator();

private:
StaticGraphStatus updateRunKernelUpScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, StaticGraphKernelResCrop& cropperKernelCrop,
uint32_t inputWidth, uint32_t inputHeight, uint32_t outputWidth, uint32_t outputHeight) override;
void postScalerUpdate() override;
bool enforceUpscalerAspectRatioConstraints() const override { return false; }

StaticGraphRunKernel* _downscalerSmallRunKernel;
StaticGraphRunKernel* _cropperSmallRunKernel;

#if SUPPORT_FRAGMENTS == 1
Gen2FragmentsConfigurator* createFragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node, uint8_t numberOfFragments) override;
#endif
};
3 changes: 3 additions & 0 deletions modules/ipu_desc/ipu75xa/GraphResolutionConfiguratorInclude.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#include "Ipu7xStaticGraphAutogen.h"
#include "Ipu7xStaticGraphTypesAutogen.h"
#include "Ipu7xGraphResolutionConfiguratorAutogen.h"
#elif defined(GRC_IPU7)
#include "Ipu7StaticGraphAutogen.h"
#include "Ipu7StaticGraphTypesAutogen.h"
#elif defined(GRC_IPU75XA)
#include "Ipu75xaStaticGraphAutogen.h"
#include "Ipu75xaStaticGraphTypesAutogen.h"
Expand Down
30 changes: 30 additions & 0 deletions modules/ipu_desc/ipu75xa/GraphTuningModeConfigurator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "GraphResolutionConfiguratorInclude.h"
#include "GraphTuningModeConfigurator.h"

#if SUPPORT_TM_SWITCH == 1
bool GraphTuningModeConfigurator::SwitchTuningModeBasedOnKey(uint8_t tuningModeKey)
{
GraphTopology* graphTopology = nullptr;
_staticGraph->getGraphTopology(&graphTopology);
SubGraphInnerNodeConfiguration innerNodeConfig = {};
bool modeSwitched = false;
for (int i = 0; i < graphTopology->numOfLinks; i++)
{
auto& link = graphTopology->links[i];
for (int j = 0; j < 2; ++j)
{
if (link->srcNode != nullptr && link->srcNode->nodeTuningModes[j].key == tuningModeKey && link->srcNode->nodeKernels.operationMode != link->srcNode->nodeTuningModes[j].id)
{
link->srcNode->nodeKernels.operationMode = link->srcNode->nodeTuningModes[j].id;
modeSwitched = true;
}
if (link->destNode != nullptr && link->destNode->nodeTuningModes[j].key == tuningModeKey && link->destNode->nodeKernels.operationMode != link->destNode->nodeTuningModes[j].id)
{
link->destNode->nodeKernels.operationMode = link->destNode->nodeTuningModes[j].id;
modeSwitched = true;
}
}
}
return modeSwitched;
}
#endif
49 changes: 49 additions & 0 deletions modules/ipu_desc/ipu75xa/GraphTuningModeConfigurator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* INTEL CONFIDENTIAL
* Copyright (c) 2026 Intel Corporation
* All Rights Reserved.
*
* The source code contained or described herein and all documents related to
* the source code ("Material") are owned by Intel Corporation or its
* suppliers or licensors. Title to the Material remains with Intel
* Corporation or its suppliers and licensors. The Material may contain trade
* secrets and proprietary and confidential information of Intel Corporation
* and its suppliers and licensors, and is protected by worldwide copyright
* and trade secret laws and treaty provisions. No part of the Material may be
* used, copied, reproduced, modified, published, uploaded, posted,
* transmitted, distributed, or disclosed in any way without Intel's prior
* express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or
* delivery of the Materials, either expressly, by implication, inducement,
* estoppel or otherwise. Any license under such intellectual property rights
* must be express and approved by Intel in writing.
*
* Unless otherwise agreed by Intel in writing, you may not remove or alter
* this notice or any other notice embedded in Materials by Intel or Intels
* suppliers or licensors in any way.
*/
#pragma once
#include <vector>
#include <map>
#include <stdint.h>
#if SUPPORT_TM_SWITCH == 1
class GraphTuningModeConfigurator
{
public:
GraphTuningModeConfigurator(IStaticGraphConfig* staticGraph)
{
_staticGraph = staticGraph;

if (_staticGraph == nullptr)
{
return;
}
}
~GraphTuningModeConfigurator(){}
bool SwitchTuningModeBasedOnKey(uint8_t tuningModeKey);
protected:
IStaticGraphConfig* _staticGraph;
};
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ uint32_t GraphResolutionConfiguratorHelper::getRunKernelUuid(GraphResolutionConf
return 0;
}

uint32_t GraphResolutionConfiguratorHelper::getRunKernelUuidOfOutput(HwSink hwSink, int32_t graphId, GraphLink** links)
uint32_t GraphResolutionConfiguratorHelper::getRunKernelUuidOfOutput(HwSink hwSink, int32_t graphId, GraphLink** links, int numberOfLinks)
{
(void)graphId;
(void)links;
(void)numberOfLinks;

switch (hwSink)
{
Expand Down Expand Up @@ -86,7 +87,6 @@ uint32_t GraphResolutionConfiguratorHelper::getRunKernelUuidOfOutput(HwSink hwSi

return 0;
}

StaticGraphStatus GraphResolutionConfiguratorHelper::getRunKernelUuidForResHistoryUpdate(std::vector<uint32_t>& kernelUuids)
{
kernelUuids.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class GraphResolutionConfiguratorHelper
public:

static uint32_t getRunKernelUuid(GraphResolutionConfiguratorKernelRole role);
static uint32_t getRunKernelUuidOfOutput(HwSink hwSink, int32_t graphId, GraphLink** links);
static uint32_t getRunKernelUuidOfOutput(HwSink hwSink, int32_t graphId, GraphLink** links, int numberOfLinks = 0);
static StaticGraphStatus getRunKernelUuidForResHistoryUpdate(std::vector<uint32_t>& kernelUuids);
static uint32_t getRunKernelIoBufferSystemApiUuid();
static uint32_t getRunKernelDownscalerSystemApiUuid();
Expand Down
Loading
Loading