lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHCN7xLihh_r=zn+2EsqZvsOumeJY52DHmrkVv0+A7Grib8AhQ@mail.gmail.com>
Date:   Sun, 3 Dec 2023 15:32:52 -0600
From:   Adam Ford <aford173@...il.com>
To:     Paul Elder <paul.elder@...asonboard.com>
Cc:     linux-media@...r.kernel.org, linux-rockchip@...ts.infradead.org,
        devicetree@...r.kernel.org, kieran.bingham@...asonboard.com,
        tomi.valkeinen@...asonboard.com, umang.jain@...asonboard.com,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Dafna Hirschfeld <dafna@...tmail.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Heiko Stuebner <heiko@...ech.de>,
        "moderated list:ARM/Rockchip SoC support" 
        <linux-arm-kernel@...ts.infradead.org>,
        open list <linux-kernel@...r.kernel.org>,
        Fabio Estevam <festevam@...il.com>
Subject: Re: [PATCH v4 11/11] media: rkisp1: Add UYVY as an output format

On Wed, Nov 29, 2023 at 3:29 AM Paul Elder <paul.elder@...asonboard.com> wrote:
>
> Add support for UYVY as an output format. The uv_swap bit in the
> MI_XTD_FORMAT_CTRL register that is used for the NV formats does not
> work for packed YUV formats. Thus, UYVY support is implemented via
> byte-swapping. This method clearly does not work for implementing
> support for YVYU and VYUY.
>
> Signed-off-by: Paul Elder <paul.elder@...asonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> ---
>  .../platform/rockchip/rkisp1/rkisp1-capture.c | 41 +++++++++++++++++++
>  1 file changed, 41 insertions(+)


Paul,

I tested this patch series from one of the older submissions and I was
able to get it working, but I could not get the video to capture to
work no matter what resolution or video format I tried.  Each time, I
get the same error message:  rkisp1 32e10000.isp: start pipeline
failed -32

Do you have an example of how you configured the pipeline and how you
invoked the video capture?

thanks

adam

>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> index a352893308b6..b50b044d22af 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> @@ -97,6 +97,12 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_mp_fmts[] = {
>                 .uv_swap = 0,
>                 .write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT,
>                 .mbus = MEDIA_BUS_FMT_YUYV8_2X8,
> +       }, {
> +               .fourcc = V4L2_PIX_FMT_UYVY,
> +               .uv_swap = 0,
> +               .yc_swap = 1,
> +               .write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT,
> +               .mbus = MEDIA_BUS_FMT_YUYV8_2X8,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_YUV422P,
>                 .uv_swap = 0,
> @@ -231,6 +237,13 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
>                 .write_format = RKISP1_MI_CTRL_SP_WRITE_INT,
>                 .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
>                 .mbus = MEDIA_BUS_FMT_YUYV8_2X8,
> +       }, {
> +               .fourcc = V4L2_PIX_FMT_UYVY,
> +               .uv_swap = 0,
> +               .yc_swap = 1,
> +               .write_format = RKISP1_MI_CTRL_SP_WRITE_INT,
> +               .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
> +               .mbus = MEDIA_BUS_FMT_YUYV8_2X8,
>         }, {
>                 .fourcc = V4L2_PIX_FMT_YUV422P,
>                 .uv_swap = 0,
> @@ -464,6 +477,20 @@ static void rkisp1_mp_config(struct rkisp1_capture *cap)
>                 rkisp1_write(rkisp1, RKISP1_CIF_MI_XTD_FORMAT_CTRL, reg);
>         }
>
> +       /*
> +        * U/V swapping with the MI_XTD_FORMAT_CTRL register only works for
> +        * NV12/NV21 and NV16/NV61, so instead use byte swap to support UYVY.
> +        * YVYU and VYUY cannot be supported with this method.
> +        */
> +       if (rkisp1->info->features & RKISP1_FEATURE_MI_OUTPUT_ALIGN) {
> +               reg = rkisp1_read(rkisp1, RKISP1_CIF_MI_OUTPUT_ALIGN_FORMAT);
> +               if (cap->pix.cfg->yc_swap)
> +                       reg |= RKISP1_CIF_OUTPUT_ALIGN_FORMAT_MP_BYTE_SWAP_BYTES;
> +               else
> +                       reg &= ~RKISP1_CIF_OUTPUT_ALIGN_FORMAT_MP_BYTE_SWAP_BYTES;
> +               rkisp1_write(rkisp1, RKISP1_CIF_MI_OUTPUT_ALIGN_FORMAT, reg);
> +       }
> +
>         rkisp1_mi_config_ctrl(cap);
>
>         reg = rkisp1_read(rkisp1, RKISP1_CIF_MI_CTRL);
> @@ -507,6 +534,20 @@ static void rkisp1_sp_config(struct rkisp1_capture *cap)
>                 rkisp1_write(rkisp1, RKISP1_CIF_MI_XTD_FORMAT_CTRL, reg);
>         }
>
> +       /*
> +        * U/V swapping with the MI_XTD_FORMAT_CTRL register only works for
> +        * NV12/NV21 and NV16/NV61, so instead use byte swap to support UYVY.
> +        * YVYU and VYUY cannot be supported with this method.
> +        */
> +       if (rkisp1->info->features & RKISP1_FEATURE_MI_OUTPUT_ALIGN) {
> +               reg = rkisp1_read(rkisp1, RKISP1_CIF_MI_OUTPUT_ALIGN_FORMAT);
> +               if (cap->pix.cfg->yc_swap)
> +                       reg |= RKISP1_CIF_OUTPUT_ALIGN_FORMAT_SP_BYTE_SWAP_BYTES;
> +               else
> +                       reg &= ~RKISP1_CIF_OUTPUT_ALIGN_FORMAT_SP_BYTE_SWAP_BYTES;
> +               rkisp1_write(rkisp1, RKISP1_CIF_MI_OUTPUT_ALIGN_FORMAT, reg);
> +       }
> +
>         rkisp1_mi_config_ctrl(cap);
>
>         mi_ctrl = rkisp1_read(rkisp1, RKISP1_CIF_MI_CTRL);
> --
> 2.39.2
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ