libcamera: camera_sensor: Register static properties
Register static properties in the CameraSensor class by inspecting the camera sensor properties database. Static properties are overridden by properties retrieved from the kernel interface at run-time if any overlap between the two sets occurs. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
a58a94e4c2
commit
cdfcb05bed
2 changed files with 16 additions and 1 deletions
|
@ -77,6 +77,7 @@ private:
|
||||||
int generateId();
|
int generateId();
|
||||||
int validateSensorDriver();
|
int validateSensorDriver();
|
||||||
void initVimcDefaultProperties();
|
void initVimcDefaultProperties();
|
||||||
|
void initStaticProperties();
|
||||||
int initProperties();
|
int initProperties();
|
||||||
|
|
||||||
const MediaEntity *entity_;
|
const MediaEntity *entity_;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <libcamera/property_ids.h>
|
#include <libcamera/property_ids.h>
|
||||||
|
|
||||||
#include "libcamera/internal/bayer_format.h"
|
#include "libcamera/internal/bayer_format.h"
|
||||||
|
#include "libcamera/internal/camera_sensor_properties.h"
|
||||||
#include "libcamera/internal/formats.h"
|
#include "libcamera/internal/formats.h"
|
||||||
#include "libcamera/internal/sysfs.h"
|
#include "libcamera/internal/sysfs.h"
|
||||||
#include "libcamera/internal/utils.h"
|
#include "libcamera/internal/utils.h"
|
||||||
|
@ -407,6 +408,16 @@ void CameraSensor::initVimcDefaultProperties()
|
||||||
activeArea_ = Rectangle(pixelArraySize_);
|
activeArea_ = Rectangle(pixelArraySize_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CameraSensor::initStaticProperties()
|
||||||
|
{
|
||||||
|
const CameraSensorProperties *props = CameraSensorProperties::get(model_);
|
||||||
|
if (!props)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Register the properties retrieved from the sensor database. */
|
||||||
|
properties_.set(properties::UnitCellSize, props->unitCellSize);
|
||||||
|
}
|
||||||
|
|
||||||
int CameraSensor::initProperties()
|
int CameraSensor::initProperties()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -444,7 +455,10 @@ int CameraSensor::initProperties()
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* Retrieve and store the camera sensor properties. */
|
/* Initialize the static properties from the sensor database. */
|
||||||
|
initStaticProperties();
|
||||||
|
|
||||||
|
/* Retrieve and register properties from the kernel interface. */
|
||||||
const ControlInfoMap &controls = subdev_->controls();
|
const ControlInfoMap &controls = subdev_->controls();
|
||||||
int32_t propertyValue;
|
int32_t propertyValue;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue