From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Paul Elder <paul.elder@ideasonboard.com>,
linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
devicetree@vger.kernel.org
Cc: kieran.bingham@ideasonboard.com, umang.jain@ideasonboard.com,
aford173@gmail.com,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Dafna Hirschfeld <dafna@fastmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
"moderated list:ARM/Rockchip SoC support"
<linux-arm-kernel@lists.infradead.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 05/11] media: rkisp1: Fix RSZ_CTRL bits for i.MX8MP
Date: Mon, 18 Dec 2023 17:31:18 +0200 [thread overview]
Message-ID: <03b98b67-e88c-4bb0-a01d-5a90f78e04a3@ideasonboard.com> (raw)
In-Reply-To: <20231129092759.242641-6-paul.elder@ideasonboard.com>
Hi Paul,
On 29/11/2023 11:27, Paul Elder wrote:
> The ISP8000Nano, found in the i.MX8MP, has a different architecture to
> crop at the resizer input. Instead of the "dual crop" block between the
> ISP and the resizers found in the RK3399, cropping has been moved to the
> input of the resizer blocks. As a result, the resizer CFG_UPD and
> CFG_UPD_AUTO bits have been moved to make space for a new CROP_ENABLE
> bit.
>
> Fix the resizer shadow update accordingly, using the DUAL_CROP feature
> to infer whether or not the resizer implements cropping. Support for
> resizer cropping itself will be added in a subsequent commit.
>
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
I don't think this one is correct.
The above is perhaps true for ISP8000, but ISP8000Nano does not have
CROP_ENABLE bit, and the CFG_UPD and CFG_UPD_AUTO are at the same
locations as on RK3399.
I don't have documentation to prove this, but experimentation shows that
this is the case.
Tomi
> ---
> Changes since v3:
>
> - Condition on RKISP1_FEATURE_DUAL_CROP feature
> - Update commit message
>
> Changes since v2:
>
> - Condition on RKISP1_FEATURE_RSZ_CROP feature
> - Rename bits
> - Use the rkisp1_has_feature() macro
>
> .../media/platform/rockchip/rkisp1/rkisp1-regs.h | 5 +++++
> .../platform/rockchip/rkisp1/rkisp1-resizer.c | 15 +++++++++++----
> 2 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h
> index 3b19c8411360..95646b45f28b 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h
> @@ -168,6 +168,11 @@
> #define RKISP1_CIF_RSZ_CTRL_CFG_UPD_AUTO BIT(9)
> #define RKISP1_CIF_RSZ_SCALER_FACTOR BIT(16)
>
> +/* For resizer instances that support cropping */
> +#define RKISP1_CIF_RSZ_CTRL_CROP_ENABLE BIT(8)
> +#define RKISP1_CIF_RSZ_CTRL_CROP_CFG_UPD BIT(9)
> +#define RKISP1_CIF_RSZ_CTRL_CROP_CFG_UPD_AUTO BIT(10)
> +
> /* MI_IMSC - MI_MIS - MI_RIS - MI_ICR - MI_ISR */
> #define RKISP1_CIF_MI_FRAME(stream) BIT((stream)->id)
> #define RKISP1_CIF_MI_MBLK_LINE BIT(2)
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
> index c1aaeed58acc..6d6ebc53c6e5 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
> @@ -178,10 +178,17 @@ static void rkisp1_rsz_update_shadow(struct rkisp1_resizer *rsz,
> {
> u32 ctrl_cfg = rkisp1_rsz_read(rsz, RKISP1_CIF_RSZ_CTRL);
>
> - if (when == RKISP1_SHADOW_REGS_ASYNC)
> - ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CFG_UPD_AUTO;
> - else
> - ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CFG_UPD;
> + if (when == RKISP1_SHADOW_REGS_ASYNC) {
> + if (rkisp1_has_feature(rsz->rkisp1, DUAL_CROP))
> + ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CFG_UPD_AUTO;
> + else
> + ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CROP_CFG_UPD_AUTO;
> + } else {
> + if (rkisp1_has_feature(rsz->rkisp1, DUAL_CROP))
> + ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CFG_UPD;
> + else
> + ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CROP_CFG_UPD;
> + }
>
> rkisp1_rsz_write(rsz, RKISP1_CIF_RSZ_CTRL, ctrl_cfg);
> }
next prev parent reply other threads:[~2023-12-18 15:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 9:27 [PATCH v4 00/11] media: rkisp1: Add support for i.MX8MP Paul Elder
2023-11-29 9:27 ` [PATCH v4 01/11] media: rkisp1: Add and use rkisp1_has_feature() macro Paul Elder
2023-11-29 9:27 ` [PATCH v4 02/11] media: rkisp1: Support setting memory stride for main path Paul Elder
2023-11-29 9:27 ` [PATCH v4 03/11] media: rkisp1: Support devices lacking self path Paul Elder
2023-11-29 9:27 ` [PATCH v4 04/11] media: rkisp1: Support devices lacking dual crop Paul Elder
2023-11-29 9:27 ` [PATCH v4 05/11] media: rkisp1: Fix RSZ_CTRL bits for i.MX8MP Paul Elder
2023-12-18 15:31 ` Tomi Valkeinen [this message]
2023-12-18 15:48 ` Laurent Pinchart
2023-11-29 9:27 ` [PATCH v4 06/11] dt-bindings: media: rkisp1: Add i.MX8MP ISP to compatible Paul Elder
2023-11-29 9:27 ` [PATCH v4 07/11] media: rkisp1: Add match data for i.MX8MP ISP Paul Elder
2023-11-29 9:27 ` [PATCH v4 08/11] media: rkisp1: Configure gasket on i.MX8MP Paul Elder
2023-11-29 9:27 ` [PATCH v4 09/11] media: rkisp1: Shift DMA buffer addresses " Paul Elder
2023-11-29 9:27 ` [PATCH v4 10/11] media: rkisp1: Add YC swap capability Paul Elder
2023-11-29 9:27 ` [PATCH v4 11/11] media: rkisp1: Add UYVY as an output format Paul Elder
2023-12-03 21:32 ` Adam Ford
2023-12-03 22:15 ` Adam Ford
2023-11-29 10:58 ` [PATCH v4 00/11] media: rkisp1: Add support for i.MX8MP Alexander Stein
2023-12-11 7:49 ` Alexander Stein
2023-11-29 11:36 ` Adam Ford
2023-11-30 9:45 ` Paul Elder
2023-12-09 23:59 ` Adam Ford
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=03b98b67-e88c-4bb0-a01d-5a90f78e04a3@ideasonboard.com \
--to=tomi.valkeinen@ideasonboard.com \
--cc=aford173@gmail.com \
--cc=dafna@fastmail.com \
--cc=devicetree@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=kieran.bingham@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=paul.elder@ideasonboard.com \
--cc=umang.jain@ideasonboard.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;
as well as URLs for NNTP newsgroup(s).