[MAX96712][MAX96726]support RAW10 and RAW16 to ToT

Bug 5277201

Change-Id: I0d402e7d26b700f78e3a5ce4a461b33f4f2cda1c
Signed-off-by: Shawn Bai <xueyuanb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3458947
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Jukka Kaartinen <jkaartinen@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
This commit is contained in:
Shawn Bai
2025-09-26 07:03:20 +00:00
committed by mobile promotions
parent ef3128dda2
commit 2e202467e3
5 changed files with 61 additions and 6 deletions

View File

@@ -139,6 +139,16 @@ static const struct camera_common_colorfmt camera_common_color_fmts[] = {
V4L2_COLORSPACE_SRGB,
V4L2_PIX_FMT_VYUY,
},
{
MEDIA_BUS_FMT_SBGGR10_1X10,
V4L2_COLORSPACE_RAW,
V4L2_PIX_FMT_SBGGR10,
},
{
MEDIA_BUS_FMT_SBGGR16_1X16,
V4L2_COLORSPACE_RAW,
V4L2_PIX_FMT_SBGGR16
}
};
struct camera_common_csi_io_pad_ctx {

View File

@@ -295,7 +295,11 @@ static int extract_pixel_format(
{
size_t size = strnlen(pixel_t, OF_MAX_STR_LEN);
if (strncmp(pixel_t, "bayer_bggr10", size) == 0)
if (strncmp(pixel_t, "RAW16", size) == 0)
*format = V4L2_PIX_FMT_SBGGR16;
else if (strncmp(pixel_t, "RAW10", size) == 0)
*format = V4L2_PIX_FMT_SBGGR10;
else if (strncmp(pixel_t, "bayer_bggr10", size) == 0)
*format = V4L2_PIX_FMT_SBGGR10;
else if (strncmp(pixel_t, "bayer_rggb10", size) == 0)
*format = V4L2_PIX_FMT_SRGGB10;
@@ -946,6 +950,7 @@ int sensor_common_init_sensor_properties(
temp_str);
goto fail;
}
of_node_put(node);
}

View File

@@ -286,6 +286,15 @@ static void tegra_channel_update_format(struct tegra_channel *chan,
u32 scaled_width = 0;
u32 bytesperline = 0;
if (!chan)
return;
if (!chan->video) {
dev_dbg(chan->vi->dev, "%s: chan->video NULL pointer\n",
__func__);
return;
}
if (__builtin_umul_overflow(width, numerator, &scaled_width)) {
dev_err(&chan->video->dev, "%s: update format failed due to an overflow\n",
__func__);
@@ -1358,10 +1367,17 @@ tegra_channel_dv_timings_cap(struct file *file, void *fh,
int tegra_channel_s_ctrl(struct v4l2_ctrl *ctrl)
{
struct tegra_channel *chan = container_of(ctrl->handler,
struct tegra_channel, ctrl_handler);
struct tegra_channel *chan;
int err = 0;
if (!ctrl)
return -EINVAL;
chan = container_of(ctrl->handler, struct tegra_channel, ctrl_handler);
if (!chan)
return -EINVAL;
switch (ctrl->id) {
case TEGRA_CAMERA_CID_GAIN_TPG:
{

View File

@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-only
* SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES.
* SPDX-FileCopyrightText: Copyright (c) 2017-2025 NVIDIA CORPORATION & AFFILIATES.
* All rights reserved.
*
* NVIDIA Tegra Video Input Device Driver VI5 formats
@@ -127,6 +127,16 @@ static const struct tegra_video_format vi5_video_formats[] = {
TEGRA_VIDEO_FORMAT(RAW12, 12, SBGGR12_1X12, 2, 1, T_R16,
RAW12, SBGGR12, "BGBG.. GRGR.."),
/* RAW 16 */
TEGRA_VIDEO_FORMAT(RAW16, 16, SRGGB16_1X16, 2, 1, T_R16,
RAW16, SRGGB16, "RGRG.. GBGB.."),
TEGRA_VIDEO_FORMAT(RAW16, 16, SGRBG16_1X16, 2, 1, T_R16,
RAW16, SGRBG16, "GRGR.. BGBG.."),
TEGRA_VIDEO_FORMAT(RAW16, 16, SGBRG16_1X16, 2, 1, T_R16,
RAW16, SGBRG16, "GBGB.. RGRG.."),
TEGRA_VIDEO_FORMAT(RAW16, 16, SBGGR16_1X16, 2, 1, T_R16,
RAW16, SBGGR16, "BGBG.. GRGR.."),
/* RGB888 */
TEGRA_VIDEO_FORMAT(RGB888, 24, RGB888_1X24, 4, 1, T_A8R8G8B8,
RGB888, RGBA32, "RGBA-8-8-8-8"),

View File

@@ -1,8 +1,20 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
/* SPDX-FileCopyrightText: Copyright (c) 2015-2025 NVIDIA CORPORATION & AFFILIATES.
* All rights reserved.
*
* NVIDIA Tegra Video Input Device Driver Core Helpers
*
* Copyright (c) 2015-2022, NVIDIA CORPORATION. All rights reserved.
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __TEGRA_CORE_H__
@@ -51,6 +63,7 @@ enum tegra_image_dt {
TEGRA_IMAGE_DT_RAW10,
TEGRA_IMAGE_DT_RAW12,
TEGRA_IMAGE_DT_RAW14,
TEGRA_IMAGE_DT_RAW16,
};
/* Supported CSI to VI Data Formats */
@@ -61,6 +74,7 @@ enum tegra_vf_code {
TEGRA_VF_RAW10,
TEGRA_VF_RAW12,
TEGRA_VF_RAW14,
TEGRA_VF_RAW16,
TEGRA_VF_EMBEDDED8,
TEGRA_VF_RGB565,
TEGRA_VF_RGB555,