Skip to content
Merged
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
4 changes: 2 additions & 2 deletions modules/memory/chrome/Camera3Buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013-2024 Intel Corporation
* Copyright (C) 2013-2025 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 @@ -415,7 +415,7 @@ void Camera3Buffer::dumpImage(const void* data, int frameNumber, const int size,
static unsigned int count = 0;
count++;

std::string fileName(gDumpPath);
std::string fileName(CameraDump::getDumpPath());
fileName += "dump_" + std::to_string(width) + "x" + std::to_string(height) + "_frame#" +
std::to_string(count) + "_req#" + std::to_string(frameNumber);

Expand Down
12 changes: 9 additions & 3 deletions src/3a/SensorManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2024 Intel Corporation.
* Copyright (C) 2015-2025 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,8 +195,14 @@ int SensorManager::getCurrentExposureAppliedDelay() {
uint32_t SensorManager::updateSensorExposure(SensorExpGroup sensorExposures, int64_t applyingSeq) {
AutoMutex l(mLock);

int64_t effectSeq = mLastSofSequence < 0 ? 0
: mLastSofSequence + PlatformData::getExposureLag(mCameraId);
int64_t effectSeq = 0;
if (PlatformData::isWaitFirstStats(mCameraId)) {
effectSeq = mLastSofSequence < 0 ? 0
: mLastSofSequence + PlatformData::getExposureLag(mCameraId);
} else {
effectSeq = mLastSofSequence < 0 ? PlatformData::getExposureLag(mCameraId)
: mLastSofSequence + PlatformData::getExposureLag(mCameraId);
}

if (sensorExposures.empty()) {
LOGW("%s: No exposure parameter", __func__);
Expand Down
9 changes: 5 additions & 4 deletions src/core/DeviceBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,9 @@ MainDevice::MainDevice(int cameraId, VideoNodeType nodeType, DeviceCallback* dev
MainDevice::~MainDevice() {}

int MainDevice::createBufferPool(const stream_t& config) {
LOG1("<id%d>%s, fmt:%s(%dx%d) field:%d", mCameraId, __func__,
CameraUtils::pixelCode2String(config.format), config.width, config.height, config.field);
LOG1("<id%d>%s, fmt:%s(%dx%d) field:%d, mBufType:%d", mCameraId, __func__,
CameraUtils::pixelCode2String(config.format), config.width, config.height, config.field,
mBufType);

// Pass down ISYS compression flag to driver, which is CSI-BE output compression
bool isISYSCompression = PlatformData::getISYSCompression(mCameraId);
Expand All @@ -322,10 +323,10 @@ int MainDevice::createBufferPool(const stream_t& config) {
csiBEDeviceNodeName.c_str(), ret);
}

struct v4l2_format v4l2fmt;
struct v4l2_format v4l2fmt = {};
v4l2fmt.fmt.pix_mp.field = config.field;

if (PlatformData::isCSIFrontEndCapture(mCameraId)) {
if (V4L2_TYPE_IS_MULTIPLANAR(mBufType)) {
int planesNum = CameraUtils::getNumOfPlanes(config.format);
LOG1("@%s Num of planes: %d, mCameraId:%d", __func__, planesNum, mCameraId);

Expand Down
12 changes: 9 additions & 3 deletions src/core/RequestThread.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2024 Intel Corporation.
* Copyright (C) 2015-2025 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 @@ -40,7 +40,7 @@ RequestThread::RequestThread(int cameraId, AiqUnitBase* a3AControl, ParameterGen
mLastEffectSeq(-1),
mLastAppliedSeq(-1),
mLastSofSeq(-1),
mBlockRequest(true),
mBlockRequest(PlatformData::isWaitFirstStats(cameraId)),
mSofEnabled(false),
mWaitFrameDurationOverride(0) {
CLEAR(mFakeReqBuf);
Expand Down Expand Up @@ -89,7 +89,7 @@ void RequestThread::clearRequests() {
mLastAppliedSeq = -1;
mLastSofSeq = -1;
mFirstRequest = true;
mBlockRequest = true;
mBlockRequest = PlatformData::isWaitFirstStats(mCameraId);
}

int RequestThread::configure(const stream_config_t* streamList) {
Expand All @@ -106,6 +106,12 @@ int RequestThread::configure(const stream_config_t* streamList) {

// Don't block request handling if no 3A stats (from video pipe)
mBlockRequest = PlatformData::isEnableAIQ(mCameraId) && (previewIndex >= 0 || videoIndex >= 0);

if (!PlatformData::isWaitFirstStats(mCameraId)) {
// Don't block request processing on Android for CTS testSharedSurfaceSwitch
mBlockRequest = false;
}

LOG1("%s: user specified Configmode: %d, blockRequest: %d", __func__,
static_cast<ConfigMode>(streamList->operation_mode), mBlockRequest);

Expand Down
31 changes: 28 additions & 3 deletions src/iutils/CameraDump.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2023 Intel Corporation.
* Copyright (C) 2015-2025 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 All @@ -18,6 +18,9 @@

#include "iutils/CameraDump.h"

#ifdef HAVE_ANDROID_OS
#include <cutils/properties.h>
#endif
#include <dirent.h>
#include <fcntl.h>
#include <math.h>
Expand Down Expand Up @@ -45,14 +48,20 @@ using std::string;
namespace icamera {

Thread* gDumpThread = nullptr;

#ifdef HAVE_ANDROID_OS
static const char* defaultDumpPath = "/data/camera";
constexpr char DUMP_LEVEL_PROPERTY_NAME[] = "vendor.camera.intel.dump_level_mask";
constexpr char DUMP_PATH_PROPERTY_NAME[] = "vendor.camera.intel.dump_path";
bool gDumpPathSet = false;
bool gDumpLevelSet = false;
#endif
int gDumpType = 0;
int gDumpFormat = 0;
uint32_t gDumpSkipNum = 0;
uint32_t gDumpRangeMin = 0;
uint32_t gDumpRangeMax = 0;
int gDumpFrequency = 1;
char gDumpPath[50];
char gDumpPath[100];
bool gDumpRangeEnabled = false;
int gDumpPatternEnabled = 0;
uint32_t gDumpPattern = 0xffffffff;
Expand Down Expand Up @@ -198,6 +207,12 @@ void CameraDump::setDumpThread(void) {
}

bool CameraDump::isDumpTypeEnable(int dumpType) {
#ifdef HAVE_ANDROID_OS
if (!gDumpLevelSet) {
gDumpLevelSet = true;
gDumpType = property_get_int32(DUMP_LEVEL_PROPERTY_NAME, 0);
}
#endif
return gDumpType & dumpType;
}

Expand All @@ -206,6 +221,12 @@ bool CameraDump::isDumpFormatEnable(int dumpFormat) {
}

const char* CameraDump::getDumpPath(void) {
#ifdef HAVE_ANDROID_OS
if (!gDumpPathSet) {
gDumpPathSet = true;
property_get(DUMP_PATH_PROPERTY_NAME, gDumpPath, defaultDumpPath);
}
#endif
return gDumpPath;
}

Expand Down Expand Up @@ -250,6 +271,10 @@ static string getNamePrefix(int cameraId, ModuleType_t type, Port port, int sUsa
static string getAiqSettingAppendix(int cameraId, int64_t sequence) {
char settingAppendix[MAX_NAME_LEN] = {'\0'};

if (!PlatformData::isEnableAIQ(cameraId)) {
return string(settingAppendix);
}

AiqResult* aiqResults =
const_cast<AiqResult*>(AiqResultStorage::getInstance(cameraId)->getAiqResult(sequence));
if (aiqResults == nullptr) {
Expand Down
10 changes: 1 addition & 9 deletions src/iutils/CameraDump.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2023 Intel Corporation.
* Copyright (C) 2015-2025 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 @@ -28,14 +28,6 @@

namespace icamera {

/**
* global dump level
* This global variable is set from system properties
* It is used to control the type of frame dump
*/
extern int gDumpType;
extern char gDumpPath[50];

// Dump bit mask definition
enum {
// IPU Buffer dump (bit[0-3]), export cameraDump=0xf
Expand Down
4 changes: 3 additions & 1 deletion src/platformdata/CameraParser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2024 Intel Corporation
* Copyright (C) 2015-2025 Intel Corporation
* Copyright 2008-2017, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -599,6 +599,8 @@ void CameraParser::handleSensor(CameraParser* profiles, const char* name, const
parseSupportedTuningConfig(atts[1], pCurrentCam->mSupportedTuningConfig);
} else if (strcmp(name, "enableAiqd") == 0) {
pCurrentCam->mEnableAiqd = strcmp(atts[1], "true") == 0;
} else if (strcmp(name, "isWaitFirstStats") == 0) {
pCurrentCam->mWaitFirstStats = strcmp(atts[1], "true") == 0;
} else if (strcmp(name, "testPatternMap") == 0) {
int size = strlen(atts[1]);
char src[size + 1];
Expand Down
6 changes: 5 additions & 1 deletion src/platformdata/PlatformData.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2024 Intel Corporation.
* Copyright (C) 2015-2025 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 @@ -1097,6 +1097,10 @@ bool PlatformData::isAiqdEnabled(int cameraId) {
return getInstance()->mStaticCfg.mCameras[cameraId].mEnableAiqd;
}

bool PlatformData::isWaitFirstStats(int cameraId) {
return getInstance()->mStaticCfg.mCameras[cameraId].mWaitFirstStats;
}

int PlatformData::getFormatByDevName(int cameraId, const string& devName, McFormat& format) {
MediaCtlConf* mc = getMediaCtlConf(cameraId);
CheckAndLogError(!mc, BAD_VALUE, "getMediaCtlConf returns nullptr, cameraId:%d", cameraId);
Expand Down
12 changes: 11 additions & 1 deletion src/platformdata/PlatformData.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2024 Intel Corporation.
* Copyright (C) 2015-2025 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 @@ -182,6 +182,7 @@ class PlatformData {
mFrameSyncCheckEnabled(false),
// FRAME_SYNC_E
mEnableAiqd(false),
mWaitFirstStats(true),
mCurrentMcConf(nullptr),
mGraphSettingsType(COUPLED),
mDVSType(MORPH_TABLE),
Expand Down Expand Up @@ -301,6 +302,7 @@ class PlatformData {
bool mFrameSyncCheckEnabled;
// FRAME_SYNC_E
bool mEnableAiqd;
bool mWaitFirstStats;
MediaCtlConf* mCurrentMcConf;
std::map<int, stream_array_t> mStreamToMcMap;
Parameters mCapability;
Expand Down Expand Up @@ -1434,6 +1436,14 @@ class PlatformData {
*/
static bool isAiqdEnabled(int cameraId);

/**
* if wait for the first stats
*
* \param cameraId: [0, MAX_CAMERA_NUMBER - 1]
* \return true if wait for the first stats
*/
static bool isWaitFirstStats(int cameraId);

/**
* if image from tpg
*
Expand Down
Loading