Skip to content

Commit

Permalink
Merge pull request #97 from zouxiaoh/iotg_ipu6
Browse files Browse the repository at this point in the history
Release for upgrade to kernel 6.6.15 for ADL, RPL
  • Loading branch information
zouxiaoh authored Mar 21, 2024
2 parents 29d78b0 + 84c2398 commit d59e21a
Show file tree
Hide file tree
Showing 21 changed files with 1,870 additions and 1,323 deletions.

Large diffs are not rendered by default.

1,112 changes: 1,112 additions & 0 deletions config/linux/ipu6epmtl/gcss/graph_settings_ov01a_CJFLE21_MTL.xml

Large diffs are not rendered by default.

Binary file added config/linux/ipu6epmtl/ov01a_1BG101N3_MTL.aiqb
Binary file not shown.
Binary file added config/linux/ipu6epmtl/ov01a_CJFLE21_MTL.aiqb
Binary file not shown.
170 changes: 168 additions & 2 deletions config/linux/ipu6epmtl/sensors/ov01a10-uf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@
<sync.maxLatency value="0"/>
</StaticMetadata>

<supportedTuningConfig value="NORMAL,VIDEO,ov01a10,STILL_CAPTURE,VIDEO,ov01a10" />
<supportedTuningConfig value="NORMAL,VIDEO,ov01a_1BG101N3_MTL,
STILL_CAPTURE,VIDEO,ov01a_1BG101N3_MTL"/>

<!-- The lard tags configuration. Every tag should be 4-characters. -->
<!-- <TuningMode, cmc tag, aiq tag, isp tag, others tag> -->
Expand All @@ -168,7 +169,172 @@
<ltmGainLag value="1"/>
<yuvColorRangeMode value="full"/> <!-- there are 2 yuv color range mode, like full, reduced. -->
<pipeSwitchDelayFrame value="60"/>
<graphSettingsFile value="graph_settings_ov01a10.xml"/>
<graphSettingsFile value="graph_settings_ov01a_1BG101N3_MTL.xml"/>
<graphSettingsType value="dispersed"/>
<enablePSysProcessor value="true"/>
<dvsType value="IMG_TRANS"/>
<testPatternMap value="Off,0,ColorBars,2"/>
<enableAiqd value = "true"/>
<useCrlModule value = "false"/>
<pslOutputMapForRotation value="1280x720@1280x720,640x480@640x480,320x240@640x480"/>

<maxRequestsInflight value="5"/>
</Sensor>
<Sensor name="ov01a10-uf" description="OV01A10 sensor.">
<MediaCtlConfig id="0" ConfigMode="AUTO" outputWidth="1280" outputHeight="798" format="V4L2_PIX_FMT_SGRBG10"><!-- RAW10 BE capture -->
<format name="ov01a10 $I2CBUS" pad="0" width="1280" height="800" format="V4L2_MBUS_FMT_SBGGR10_1X10"/>
<format name="Intel IPU6 CSI-2 $CSI_PORT" pad="0" width="1280" height="800" format="V4L2_MBUS_FMT_SBGGR10_1X10"/>

<link srcName="ov01a10 $I2CBUS" srcPad="0" sinkName="Intel IPU6 CSI-2 $CSI_PORT" sinkPad="0" enable="true"/>

<format name="Intel IPU6 CSI2 BE SOC 0" pad="0" width="1280" height="800" format="V4L2_MBUS_FMT_SBGGR10_1X10"/>
<format name="Intel IPU6 CSI2 BE SOC 0" pad="1" width="1280" height="798" format="V4L2_MBUS_FMT_SGRBG10_1X10"/>
<selection name="Intel IPU6 CSI2 BE SOC 0" pad="1" target="V4L2_SEL_TGT_CROP" left="0" top="1" width="1280" height="798"/>

<link srcName="Intel IPU6 CSI-2 $CSI_PORT" srcPad="1" sinkName="Intel IPU6 CSI2 BE SOC 0" sinkPad="0" enable="true"/>
<link srcName="Intel IPU6 CSI2 BE SOC 0" srcPad="1" sinkName="Intel IPU6 BE SOC capture 0" sinkPad="0" enable="true"/>

<videonode name="Intel IPU6 BE SOC capture 0" videoNodeType="VIDEO_GENERIC"/>
<videonode name="Intel IPU6 CSI-2 $CSI_PORT" videoNodeType="VIDEO_ISYS_RECEIVER"/>
<videonode name="ov01a10 $I2CBUS" videoNodeType="VIDEO_PIXEL_ARRAY"/>
</MediaCtlConfig>

<StaticMetadata>
<!-- format,widthxheight,field(none:0,alternate:7),mcId -->
<supportedStreamConfig value="V4L2_PIX_FMT_NV12,1280x720,0,0,
V4L2_PIX_FMT_NV12,640x480,0,0,
V4L2_PIX_FMT_NV12,640x360,0,0"/>

<supportedFeatures value="MANUAL_EXPOSURE,
MANUAL_WHITE_BALANCE,
IMAGE_ENHANCEMENT,
NOISE_REDUCTION,
PER_FRAME_CONTROL,
SCENE_MODE"/>
<supportedAeExposureTimeRange value="AUTO,10,1000000"/> <!--scene_mode,min_exposure_time,max_exposure_time -->
<supportedAeGainRange value="AUTO,0,60"/> <!--scene_mode,min_gain,max_gain -->
<fpsRange value="15,15,15,30,30,30"/>
<evRange value="-6,6"/>
<evStep value="1,3"/>
<supportedAeMode value="AUTO,MANUAL"/>
<supportedVideoStabilizationModes value="OFF"/>
<supportedSceneMode value="NORMAL"/>
<supportedAntibandingMode value="AUTO,50Hz,60Hz,OFF"/>
<supportedAwbMode value="AUTO,INCANDESCENT,FLUORESCENT,DAYLIGHT,FULL_OVERCAST,PARTLY_OVERCAST,SUNSET,VIDEO_CONFERENCE,MANUAL_CCT_RANGE,MANUAL_WHITE_POINT,MANUAL_GAIN,MANUAL_COLOR_TRANSFORM"/>
<supportedAfMode value="OFF"/>

<!-- 0:FALSE, 1: TRUE -->
<ae.lockAvailable value="1"/>
<awb.lockAvailable value="1"/>
<!-- 0: OFF, 1: AUTO, 2: USE_SCENE_MODE, 3: OFF_KEEP_STATE -->
<control.availableModes value="1"/>
<control.maxRegions value="1,0,0"/>
<!-- 0: DISABLE, 1: FACE_PRIORITY -->
<control.availableSceneModes value="1"/>
<!-- 0: OFF, 1: SMPLE, 2: FULL -->
<statistics.info.availableFaceDetectModes value="0,1"/>
<statistics.info.maxFaceCount value="10"/>

<sensor.orientation value="0"/>
<sensor.info.sensitivityRange value="100,800"/>
<!-- microsecond -->
<sensor.info.exposureTimeRange value="100,100000"/> <!-- align with supportedAeExposureTimeRange -->

<!-- Blow static metadata are for camera HAL V3 -->
<sensor.info.activeArraySize value="0,0,1280,800"/> <!-- 1296,800 -->
<sensor.info.pixelArraySize value="1280x800"/>
<!-- 4096x1.12um 3072x1.12um -->
<sensor.info.physicalSize value="3.69,2.77"/>
<!-- 0: off, 1: solid color, 2: color bars -->
<sensor.availableTestPatternModes value="0,2"/>
<!-- 0:RGGB, 1:GRBG, 2:GBRG, 3:BGGR, 4:RGB -->
<sensor.info.colorFilterArrangement value="2"/>

<!-- shading 0:OFF,1:FAST,2:HIGH_QUALITY-->
<shading.availableModes value="0,1,2"/>

<!-- Lens -->
<lens.facing value="0"/>
<!-- Lens info -->
<lens.info.availableApertures value="2.5"/>
<lens.info.availableFilterDensities value="0.0"/>
<lens.info.availableFocalLengths value="4.28"/>
<lens.info.availableOpticalStabilization value="0"/>
<lens.info.hyperfocalDistance value="0.0"/>
<lens.info.minimumFocusDistance value="0.1"/>
<lens.info.shadingMapSize value="50,38"/>
<!-- 0:UNCALIBRATED, 1:APPROXIMATE, 2:CALIBRATED -->
<lens.info.focusDistanceCalibration value="1"/>

<!-- raw, yuv, jpeg -->
<request.maxNumOutputStreams value="1,3,1"/>
<!-- 0 or 1 -->
<request.maxNumInputStreams value="1"/>
<request.pipelineMaxDepth value="6"/>
<!-- 0:backward, 1:manual_sensor, 2:manual_pso_processing, 3:raw, 4:zsl, 5:read_sensor_settings, 6:burst_capture, 7: yuv reprocessing -->
<request.availableCapabilities value="0,1,2,4,5,6,7"/>

<!-- input fmt, output fmt number, output fmts; fmt: YCbCr_420_888:0x23 (35), IMPLEMENTATION_DEFINED:0x22 (34), Blob:0x21 (33) -->
<scaler.availableInputOutputFormatsMap value="35,2,33,35,34,2,33,35"/>
<!-- [width, height, raw-out-size] -->
<sensor.opaqueRawSize value="1280,800,100"/>
<!-- available stream configurations: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, type: output(0)|input(1) -->
<scaler.availableStreamConfigurations value="
33,1280x720,0,
33,640x480,0,
33,640x360,0" />
<!-- minimum frame duration: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, duration:(ns) -->
<scaler.availableMinFrameDurations value="
33,1280x720,33333333,
33,640x480,33333333,
33,640x360,33333333" />
<!-- maximum stall duration: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, duration:(ns) -->
<scaler.availableStallDurations value="
33,1280x720,33333333,
33,640x480,33333333,
33,640x360,33333333" />

<jpeg.maxSize value="1382400"/> <!-- 1280*720*1.5 -->
<jpeg.availableThumbnailSizes value="0,0,320,180,320,240"/> <!-- INCREASING ORDER -->

<!-- 0:off, 1:fast, 2:high_quality, 3:zero_shutter_lag -->
<edge.availableEdgeModes value="0,1,2,3"/>
<!-- 0:off, 1:fast, 2:high_quality -->
<hotPixel.availableHotPixelModes value="1,2"/>
<!-- 0:off, 1:fast, 2:high_quality, 3:minimal, 4:zero_shutter_lag -->
<noiseReduction.availableNoiseReductionModes value="0,1,2,4"/>
<tonemap.maxCurvePoints value="1024"/>
<!-- 0:contrast_curve, 1:fast, 2:high_quality, 3:gamma_value, 4:preset_curve -->
<tonemap.availableToneMapModes value="1,2,3,4"/>
<!-- Number of frames -->
<reprocess.maxCaptureStall value="4"/>

<!-- 0:limited, 1:full, 2:legacy, 3:level3 -->
<info.supportedHardwareLevel value="1"/>
<!-- 0:per-frame, -1:unknown, other positive number:frame count -->
<sync.maxLatency value="0"/>
</StaticMetadata>

<supportedTuningConfig value="NORMAL,VIDEO,ov01a_CJFLE21_MTL,
STILL_CAPTURE,VIDEO,ov01a_CJFLE21_MTL"/>

<!-- The lard tags configuration. Every tag should be 4-characters. -->
<!-- <TuningMode, cmc tag, aiq tag, isp tag, others tag> -->
<lardTags value="VIDEO,DFLT,DFLT,DFLT,DFLT"/>

<supportedISysSizes value="1280x800"/> <!-- ascending order request -->
<supportedISysFormat value="V4L2_PIX_FMT_SGRBG10"/>
<enableAIQ value="true"/>
<iSysRawFormat value="V4L2_PIX_FMT_SGRBG10"/>
<maxRawDataNum value="32"/>
<pSysFormat value="V4L2_PIX_FMT_NV12"/>
<initialSkipFrame value="0"/>
<exposureLag value="2"/>
<gainLag value="2"/>
<ltmGainLag value="1"/>
<yuvColorRangeMode value="full"/> <!-- there are 2 yuv color range mode, like full, reduced. -->
<pipeSwitchDelayFrame value="60"/>
<graphSettingsFile value="graph_settings_ov01a_CJFLE21_MTL.xml"/>
<graphSettingsType value="dispersed"/>
<enablePSysProcessor value="true"/>
<dvsType value="IMG_TRANS"/>
Expand Down
3 changes: 2 additions & 1 deletion modules/algowrapper/graph/GraphConfigImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,8 @@ status_t GraphConfigImpl::selectSetting(

status_t GraphConfigImpl::getGraphConfigData(IGraphType::GraphConfigData* data) {
// The graph id, csi output and sensor mode must be same if there are two graph config pipes
LOG1("Query graphs, count %lu", mGraphConfigPipe.size());
LOG1("Query graphs, count %lu, 1st graph id %d", mGraphConfigPipe.size(),
mGraphConfigPipe.begin()->second->getGraphId());
for (auto& item : mGraphConfigPipe) {
LOG1(" Graph usage %d, graph id %d", item.first, item.second->getGraphId());
data->graphIds.insert(item.second->getGraphId());
Expand Down
5 changes: 1 addition & 4 deletions src/3a/AiqEngine.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2023 Intel Corporation.
* Copyright (C) 2015-2024 Intel Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -271,9 +271,6 @@ int AiqEngine::getSkippingNum(AiqResult* aiqResult) {
// Skip 3 frames when pipe switching
skipNum = 3;
}
} else if (mAiqRunningForPerframe) {
// The 1st result takes effect @ frame (initialSkip) (applied before stream on)
skipNum = PlatformData::getInitialSkipFrame(mCameraId);
}

return skipNum;
Expand Down
6 changes: 3 additions & 3 deletions src/3a/AiqUnit.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2023 Intel Corporation.
* Copyright (C) 2015-2024 Intel Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -151,7 +151,7 @@ int AiqUnit::configure(const stream_config_t* streamList) {

void AiqUnit::resetIntelCcaHandle(const std::vector<ConfigMode>& configModes) {
bool reinit = false;
if ((PlatformData::supportUpdateTuning() || PlatformData::isDvsSupported(mCameraId)) &&
if ((PlatformData::supportUpdateTuning(mCameraId) || PlatformData::isDvsSupported(mCameraId)) &&
!configModes.empty()) {
std::shared_ptr<IGraphConfig> graphConfig =
IGraphConfigManager::getInstance(mCameraId)->getGraphConfig(configModes[0]);
Expand Down Expand Up @@ -361,7 +361,7 @@ int AiqUnit::initIntelCcaHandle(const std::vector<ConfigMode>& configModes) {
}
// DOL_FEATURE_E

if (PlatformData::supportUpdateTuning()) {
if (PlatformData::supportUpdateTuning(mCameraId)) {
if (graphConfig != nullptr) {
std::vector<int32_t> streamIds;
graphConfig->graphGetStreamIds(streamIds);
Expand Down
8 changes: 6 additions & 2 deletions src/3a/SensorManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2023 Intel Corporation.
* Copyright (C) 2015-2024 Intel Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -195,7 +195,7 @@ int SensorManager::getCurrentExposureAppliedDelay() {
uint32_t SensorManager::updateSensorExposure(SensorExpGroup sensorExposures, int64_t applyingSeq) {
AutoMutex l(mLock);

int64_t effectSeq = mLastSofSequence < 0 ? PlatformData::getInitialSkipFrame(mCameraId)
int64_t effectSeq = mLastSofSequence < 0 ? 0
: mLastSofSequence + PlatformData::getExposureLag(mCameraId);

if (sensorExposures.empty()) {
Expand Down Expand Up @@ -250,6 +250,10 @@ uint32_t SensorManager::updateSensorExposure(SensorExpGroup sensorExposures, int
mSensorHwCtrl->setDigitalGains(digitalGains);
}

if (effectSeq == 0) {
effectSeq = PlatformData::getInitialSkipFrame(mCameraId);
}

LOG2("<seq%ld>@%s: effectSeq %ld, applyingSeq %ld", mLastSofSequence, __func__, effectSeq,
applyingSeq);
return ((uint32_t)effectSeq);
Expand Down
21 changes: 13 additions & 8 deletions src/core/IspParamAdaptor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2023 Intel Corporation.
* Copyright (C) 2015-2024 Intel Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -244,7 +244,7 @@ int IspParamAdaptor::configure(const stream_t& stream, ConfigMode configMode, Tu
CheckAndLogError(ret != OK, ret, "%s, Failed to allocate isp parameter buffers", __func__);
}

if (PlatformData::supportUpdateTuning()) {
if (PlatformData::supportUpdateTuning(mCameraId)) {
for (auto& ispParamIt : mStreamIdToIspParameterMap) {
int ispTuningIndex = mGraphConfig->getTuningModeByStreamId(ispParamIt.first);
// Use the tuning mode in graph to update the isp tuning data
Expand Down Expand Up @@ -880,19 +880,24 @@ int IspParamAdaptor::runIspAdaptL(ia_isp_bxt_program_group* pgPtr, ia_isp_bxt_gd
inputParams->stream_id = inputParams->program_group.base.run_kernels[0].stream_id;

if (ispSettings) {
inputParams->nr_setting = ispSettings->nrSetting;
inputParams->ee_setting = ispSettings->eeSetting;
if (VIDEO_STREAM_ID == inputParams->stream_id) {
inputParams->nr_setting = ispSettings->nrSetting;
inputParams->ee_setting = ispSettings->eeSetting;
} else {
inputParams->nr_setting = ispSettings->nrStillSetting;
inputParams->ee_setting = ispSettings->eeStillSetting;
}
LOG2("%s: ISP NR setting, level: %d, strength: %d", __func__,
static_cast<int>(ispSettings->nrSetting.feature_level),
static_cast<int>(ispSettings->nrSetting.strength));
static_cast<int>(inputParams->nr_setting.feature_level),
static_cast<int>(inputParams->nr_setting.strength));
LOG2("%s: ISP EE setting, level: %d, strength: %d", __func__,
inputParams->ee_setting.feature_level, inputParams->ee_setting.strength);

inputParams->effects = ispSettings->effects;
inputParams->manual_brightness = ispSettings->manualSettings.manualBrightness;
inputParams->manual_contrast = ispSettings->manualSettings.manualContrast;
inputParams->manual_hue = ispSettings->manualSettings.manualHue;
inputParams->manual_saturation = ispSettings->manualSettings.manualSaturation;
LOG2("%s: ISP EE setting, level: %d, strength: %d", __func__,
ispSettings->eeSetting.feature_level, ispSettings->eeSetting.strength);

if (ispSettings->palOverride) {
CheckAndLogError(ispSettings->palOverride->size > cca::MAX_PAL_TUNING_SIZE, NO_MEMORY,
Expand Down
4 changes: 3 additions & 1 deletion src/core/IspSettings.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2019 Intel Corporation.
* Copyright (C) 2018-2024 Intel Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,6 +33,8 @@ struct IspImageEnhancement {
struct IspSettings {
ia_isp_feature_setting nrSetting;
ia_isp_feature_setting eeSetting;
ia_isp_feature_setting nrStillSetting;
ia_isp_feature_setting eeStillSetting;
ia_isp_effect effects;
bool videoStabilization;
IspImageEnhancement manualSettings;
Expand Down
14 changes: 13 additions & 1 deletion src/core/PSysProcessor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2023 Intel Corporation.
* Copyright (C) 2017-2024 Intel Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -320,6 +320,9 @@ int PSysProcessor::setParameters(const Parameters& param) {
static_cast<int>(mIspSettings.nrSetting.feature_level),
static_cast<int>(mIspSettings.nrSetting.strength));

mIspSettings.nrStillSetting = mIspSettings.nrSetting;
mIspSettings.eeStillSetting = mIspSettings.eeSetting;

camera_video_stabilization_mode_t stabilizationMode;
ret = param.getVideoStabilizationMode(stabilizationMode);
if (ret == OK) {
Expand Down Expand Up @@ -1073,6 +1076,15 @@ void PSysProcessor::dispatchTask(CameraBufferPortMap& inBuf, CameraBufferPortMap
mIspSettings.nrSetting.strength += edgeNrSetting.nrStrength;
LOG2("edgeStrength %d, nrStrength %d", edgeNrSetting.edgeStrength,
edgeNrSetting.nrStrength);

TuningMode stillMode = (mTuningMode == TUNING_MODE_VIDEO) ?
TUNING_MODE_STILL_CAPTURE : TUNING_MODE_VIDEO_ULL;
PlatformData::getEdgeNrSetting(mCameraId, totalGain, hdrRatio, stillMode,
edgeNrSetting);
mIspSettings.eeStillSetting.strength += edgeNrSetting.edgeStrength;
mIspSettings.nrStillSetting.strength += edgeNrSetting.nrStrength;
LOG2("Still edgeStrength %d, nrStrength %d", edgeNrSetting.edgeStrength,
edgeNrSetting.nrStrength);
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/core/RequestThread.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2023 Intel Corporation.
* Copyright (C) 2015-2024 Intel Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -144,7 +144,8 @@ bool RequestThread::blockRequest() {
* 2. Too many requests in flight;
* 3. if no trigger event is available.
*/
return ((mBlockRequest && (mLastRequestId >= 0)) ||
return ((mBlockRequest &&
(mLastRequestId >= PlatformData::getInitialPendingFrame(mCameraId))) ||
(mRequestsInProcessing >= PlatformData::getMaxRequestsInflight(mCameraId)) ||
(mPerframeControlSupport && (mRequestTriggerEvent == NONE_EVENT)));
}
Expand Down
Loading

0 comments on commit d59e21a

Please sign in to comment.