kernel: camera: add bayer raw14 format.

Add raw14 bayer format driver support

bug 4335141

Change-Id: I45c4fb2f692a98cf33d81415104e815c14340a68
Signed-off-by: snchen <snchen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3176545
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
snchen
2023-10-19 14:56:31 +08:00
committed by mobile promotions
parent 93ba193a32
commit b2db309d50
3 changed files with 64 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 only // SPDX-License-Identifier: GPL-2.0-only
/* SPDX-FileCopyrightText: Copyright (c) 2015-2024 NVIDIA CORPORATION & AFFILIATES. /*
* SPDX-FileCopyrightText: Copyright (c) 2015-2024 NVIDIA CORPORATION & AFFILIATES.
* All rights reserved. * All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
@@ -12,7 +13,7 @@
* more details. * more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <media/tegra-v4l2-camera.h> #include <media/tegra-v4l2-camera.h>
@@ -39,6 +40,26 @@
#define HDR_ENABLE 0x1 #define HDR_ENABLE 0x1
static const struct camera_common_colorfmt camera_common_color_fmts[] = { static const struct camera_common_colorfmt camera_common_color_fmts[] = {
{
MEDIA_BUS_FMT_SBGGR14_1X14,
V4L2_COLORSPACE_SRGB,
V4L2_PIX_FMT_SBGGR14,
},
{
MEDIA_BUS_FMT_SRGGB14_1X14,
V4L2_COLORSPACE_SRGB,
V4L2_PIX_FMT_SRGGB14,
},
{
MEDIA_BUS_FMT_SGRBG14_1X14,
V4L2_COLORSPACE_SRGB,
V4L2_PIX_FMT_SGRBG14,
},
{
MEDIA_BUS_FMT_SGBRG14_1X14,
V4L2_COLORSPACE_SRGB,
V4L2_PIX_FMT_SGBRG14
},
{ {
MEDIA_BUS_FMT_SRGGB12_1X12, MEDIA_BUS_FMT_SRGGB12_1X12,
V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_SRGB,

View File

@@ -1,8 +1,19 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* /*
* sensor_common.c - utilities for tegra sensor drivers * SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES.
* All rights reserved.
* *
* Copyright (c) 2017-2023, NVIDIA CORPORATION & AFFILIATES. 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/>.
*/ */
#include <media/sensor_common.h> #include <media/sensor_common.h>
@@ -243,6 +254,14 @@ static int extract_pixel_format(
*format = V4L2_PIX_FMT_SGBRG12; *format = V4L2_PIX_FMT_SGBRG12;
else if (strncmp(pixel_t, "bayer_grbg12", size) == 0) else if (strncmp(pixel_t, "bayer_grbg12", size) == 0)
*format = V4L2_PIX_FMT_SGRBG12; *format = V4L2_PIX_FMT_SGRBG12;
else if (strncmp(pixel_t, "bayer_bggr14", size) == 0)
*format = V4L2_PIX_FMT_SBGGR14;
else if (strncmp(pixel_t, "bayer_rggb14", size) == 0)
*format = V4L2_PIX_FMT_SRGGB14;
else if (strncmp(pixel_t, "bayer_gbrg14", size) == 0)
*format = V4L2_PIX_FMT_SGBRG14;
else if (strncmp(pixel_t, "bayer_grbg14", size) == 0)
*format = V4L2_PIX_FMT_SGRBG14;
else if (strncmp(pixel_t, "rgb_rgb88824", size) == 0) else if (strncmp(pixel_t, "rgb_rgb88824", size) == 0)
*format = V4L2_PIX_FMT_RGB24; *format = V4L2_PIX_FMT_RGB24;
else if (strncmp(pixel_t, "bayer_wdr_pwl_rggb12", size) == 0) else if (strncmp(pixel_t, "bayer_wdr_pwl_rggb12", size) == 0)

View File

@@ -1,8 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only
/* * SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES.
* All rights reserved.
*
* NVIDIA Tegra Video Input Device Driver VI5 formats * NVIDIA Tegra Video Input Device Driver VI5 formats
* *
* Copyright (c) 2017-2022, NVIDIA CORPORATION. All rights reserved. * Author: Bhanu Murthy V <bmurthyv@nvidia.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/ */
#ifndef __VI5_FORMATS_H_ #ifndef __VI5_FORMATS_H_
@@ -91,6 +97,16 @@ static const struct tegra_video_format vi5_video_formats[] = {
TEGRA_VIDEO_FORMAT(RAW8, 8, SBGGR8_1X8, 1, 1, T_R8, TEGRA_VIDEO_FORMAT(RAW8, 8, SBGGR8_1X8, 1, 1, T_R8,
RAW8, SBGGR8, "BGBG.. GRGR.."), RAW8, SBGGR8, "BGBG.. GRGR.."),
/* RAW 14 */
TEGRA_VIDEO_FORMAT(RAW14, 14, SRGGB14_1X14, 2, 1, T_R16,
RAW14, SRGGB14, "RGRG.. GBGB.."),
TEGRA_VIDEO_FORMAT(RAW14, 14, SGRBG14_1X14, 2, 1, T_R16,
RAW14, SGRBG14, "GRGR.. BGBG.."),
TEGRA_VIDEO_FORMAT(RAW14, 14, SGBRG14_1X14, 2, 1, T_R16,
RAW14, SGBRG14, "GBGB.. RGRG.."),
TEGRA_VIDEO_FORMAT(RAW14, 14, SBGGR14_1X14, 2, 1, T_R16,
RAW14, SBGGR14, "BGBG.. GRGR.."),
/* RAW 10 */ /* RAW 10 */
TEGRA_VIDEO_FORMAT(RAW10, 10, SRGGB10_1X10, 2, 1, T_R16, TEGRA_VIDEO_FORMAT(RAW10, 10, SRGGB10_1X10, 2, 1, T_R16,
RAW10, SRGGB10, "RGRG.. GBGB.."), RAW10, SRGGB10, "RGRG.. GBGB.."),