From: Niklas <niklas.soderlund@ragnatech.se>
To: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Prabhakar <prabhakar.csengg@gmail.com>
Subject: Re: [PATCH v4 2/3] media: rcar-vin: Add support for MEDIA_BUS_FMT_SRGGB8_1X8 format
Date: Wed, 13 May 2020 00:28:40 +0200 [thread overview]
Message-ID: <20200512222840.GE2542285@oden.dyn.berto.se> (raw)
In-Reply-To: <1586945948-11026-3-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com>
Hi Lad,
Thanks for your work.
On 2020-04-15 11:19:07 +0100, Lad Prabhakar wrote:
> Add support for MEDIA_BUS_FMT_SRGGB8_1X8 format in rcar-vin by setting
> format type to RAW8 in VNMC register and appropriately setting the bpp
> and bytesperline to enable V4L2_PIX_FMT_SRGGB8.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> drivers/media/platform/rcar-vin/rcar-dma.c | 15 ++++++++++++++-
> drivers/media/platform/rcar-vin/rcar-v4l2.c | 4 ++++
> 2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c
> index 48bd9bfc3948..3e8e29573e6d 100644
> --- a/drivers/media/platform/rcar-vin/rcar-dma.c
> +++ b/drivers/media/platform/rcar-vin/rcar-dma.c
> @@ -85,6 +85,7 @@
> #define VNMC_INF_YUV8_BT601 (1 << 16)
> #define VNMC_INF_YUV10_BT656 (2 << 16)
> #define VNMC_INF_YUV10_BT601 (3 << 16)
> +#define VNMC_INF_RAW8 (4 << 16)
> #define VNMC_INF_YUV16 (5 << 16)
> #define VNMC_INF_RGB888 (6 << 16)
> #define VNMC_VUP (1 << 10)
> @@ -587,13 +588,19 @@ void rvin_crop_scale_comp(struct rvin_dev *vin)
> rvin_write(vin, vin->crop.top, VNSLPRC_REG);
> rvin_write(vin, vin->crop.top + vin->crop.height - 1, VNELPRC_REG);
>
> -
> /* TODO: Add support for the UDS scaler. */
> if (vin->info->model != RCAR_GEN3)
> rvin_crop_scale_comp_gen2(vin);
>
> fmt = rvin_format_from_pixel(vin, vin->format.pixelformat);
> stride = vin->format.bytesperline / fmt->bpp;
> +
> + /* For RAW8 format bpp is 1, but the hardware process RAW8
> + * format in 2 pixel unit hence configure VNIS_REG as stride / 2.
> + */
> + if (vin->format.pixelformat == V4L2_PIX_FMT_SRGGB8)
> + stride /= 2;
> +
> rvin_write(vin, stride, VNIS_REG);
> }
>
> @@ -676,6 +683,9 @@ static int rvin_setup(struct rvin_dev *vin)
>
> input_is_yuv = true;
> break;
> + case MEDIA_BUS_FMT_SRGGB8_1X8:
> + vnmc |= VNMC_INF_RAW8;
> + break;
> default:
> break;
> }
> @@ -737,6 +747,9 @@ static int rvin_setup(struct rvin_dev *vin)
> case V4L2_PIX_FMT_ABGR32:
> dmr = VNDMR_A8BIT(vin->alpha) | VNDMR_EXRGB | VNDMR_DTMD_ARGB;
> break;
> + case V4L2_PIX_FMT_SRGGB8:
> + dmr = 0;
> + break;
> default:
> vin_err(vin, "Invalid pixelformat (0x%x)\n",
> vin->format.pixelformat);
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> index 5151a3cd8a6e..ca542219e8ae 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -66,6 +66,10 @@ static const struct rvin_video_format rvin_formats[] = {
> .fourcc = V4L2_PIX_FMT_ABGR32,
> .bpp = 4,
> },
> + {
> + .fourcc = V4L2_PIX_FMT_SRGGB8,
> + .bpp = 1,
> + },
> };
>
> const struct rvin_video_format *rvin_format_from_pixel(struct rvin_dev *vin,
> --
> 2.20.1
>
--
Regards,
Niklas Söderlund
next prev parent reply other threads:[~2020-05-12 22:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 10:19 [PATCH v4 0/3] media: rcar-vin: Enable " Lad Prabhakar
2020-04-15 10:19 ` [PATCH v4 1/3] media: rcar-vin: Invalidate pipeline if conversion is not possible on input formats Lad Prabhakar
2020-05-12 22:26 ` Niklas
2020-05-13 11:16 ` Lad, Prabhakar
2020-05-19 13:12 ` Niklas
2020-04-15 10:19 ` [PATCH v4 2/3] media: rcar-vin: Add support for MEDIA_BUS_FMT_SRGGB8_1X8 format Lad Prabhakar
2020-05-12 22:28 ` Niklas [this message]
2020-04-15 10:19 ` [PATCH v4 3/3] media: rcar-csi2: " Lad Prabhakar
2020-04-29 22:08 ` [PATCH v4 0/3] media: rcar-vin: Enable " Lad, Prabhakar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200512222840.GE2542285@oden.dyn.berto.se \
--to=niklas.soderlund@ragnatech.se \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=prabhakar.csengg@gmail.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®