libcamera: rkisp1: Eliminate hard-coded resizer limits

The minResolution_ and maxResolution_ limits are dynamically queried
in populateFormats() from the RkISP1Path video node. Therefore,
initializing these limits with the resizer limits in the constructor is
unnecessary.

This change allows us to remove the hard-coded max/min resolution limits
of the resizer from RkISP1Path, simplifying its constructor further.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
This commit is contained in:
Umang Jain 2024-09-24 12:43:41 +05:30
parent abe2ec64f9
commit e85c7ddd38
2 changed files with 7 additions and 17 deletions

View file

@ -54,11 +54,8 @@ const std::map<PixelFormat, uint32_t> formatToMediaBus = {
} /* namespace */ } /* namespace */
RkISP1Path::RkISP1Path(const char *name, const Span<const PixelFormat> &formats, RkISP1Path::RkISP1Path(const char *name, const Span<const PixelFormat> &formats)
const Size &minResolution, const Size &maxResolution) : name_(name), running_(false), formats_(formats), link_(nullptr)
: name_(name), running_(false), formats_(formats),
minResolution_(minResolution), maxResolution_(maxResolution),
link_(nullptr)
{ {
} }
@ -435,12 +432,10 @@ void RkISP1Path::stop()
} }
/* /*
* \todo Remove the hardcoded resolutions and formats once all users will have * \todo Remove the hardcoded formats once all users will have migrated to a
* migrated to a recent enough kernel. * recent enough kernel.
*/ */
namespace { namespace {
constexpr Size RKISP1_RSZ_MP_SRC_MIN{ 32, 16 };
constexpr Size RKISP1_RSZ_MP_SRC_MAX{ 4416, 3312 };
constexpr std::array<PixelFormat, 18> RKISP1_RSZ_MP_FORMATS{ constexpr std::array<PixelFormat, 18> RKISP1_RSZ_MP_FORMATS{
formats::YUYV, formats::YUYV,
formats::NV16, formats::NV16,
@ -462,8 +457,6 @@ constexpr std::array<PixelFormat, 18> RKISP1_RSZ_MP_FORMATS{
formats::SRGGB12, formats::SRGGB12,
}; };
constexpr Size RKISP1_RSZ_SP_SRC_MIN{ 32, 16 };
constexpr Size RKISP1_RSZ_SP_SRC_MAX{ 1920, 1920 };
constexpr std::array<PixelFormat, 8> RKISP1_RSZ_SP_FORMATS{ constexpr std::array<PixelFormat, 8> RKISP1_RSZ_SP_FORMATS{
formats::YUYV, formats::YUYV,
formats::NV16, formats::NV16,
@ -477,14 +470,12 @@ constexpr std::array<PixelFormat, 8> RKISP1_RSZ_SP_FORMATS{
} /* namespace */ } /* namespace */
RkISP1MainPath::RkISP1MainPath() RkISP1MainPath::RkISP1MainPath()
: RkISP1Path("main", RKISP1_RSZ_MP_FORMATS, : RkISP1Path("main", RKISP1_RSZ_MP_FORMATS)
RKISP1_RSZ_MP_SRC_MIN, RKISP1_RSZ_MP_SRC_MAX)
{ {
} }
RkISP1SelfPath::RkISP1SelfPath() RkISP1SelfPath::RkISP1SelfPath()
: RkISP1Path("self", RKISP1_RSZ_SP_FORMATS, : RkISP1Path("self", RKISP1_RSZ_SP_FORMATS)
RKISP1_RSZ_SP_SRC_MIN, RKISP1_RSZ_SP_SRC_MAX)
{ {
} }

View file

@ -32,8 +32,7 @@ struct V4L2SubdeviceFormat;
class RkISP1Path class RkISP1Path
{ {
public: public:
RkISP1Path(const char *name, const Span<const PixelFormat> &formats, RkISP1Path(const char *name, const Span<const PixelFormat> &formats);
const Size &minResolution, const Size &maxResolution);
bool init(MediaDevice *media); bool init(MediaDevice *media);