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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZrYoT7HmTc7OT2Y4@pengutronix.de>
Date: Fri, 9 Aug 2024 16:31:43 +0200
From: Michael Tretter <m.tretter@...gutronix.de>
To: John Keeping <jkeeping@...usicbrands.com>
Cc: linux-media@...r.kernel.org, Jacob Chen <jacob-chen@...wrt.com>,
	Ezequiel Garcia <ezequiel@...guardiasur.com.ar>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Heiko Stuebner <heiko@...ech.de>,
	linux-rockchip@...ts.infradead.org,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	kernel@...gutronix.de
Subject: Re: [PATCH] media: rockchip: rga: fix offset lookup

Hi John,

On Tue, 06 Aug 2024 10:48:41 +0100, John Keeping wrote:
> The rot_mir_point_matrix is arranged with the rotation values in rows
> and mirror settings in the columns.  Fix the order of indexing to match
> this so that the correct values are used.

The table and indexing is correct. The rows (second index) contain the
mirror modes and the columns (first index) contain the rotation modes,
and the table and the indexing are correct. If you read the columns, the
corner moves clockwise, but if you read the rows, the corner moves in a
z or s form, indicating that these are the mirror modes.

It's probably worth documenting, how the table works.

However, there is a mixup of the arguments between the call to
rga_lookup_draw_pos() and the use in the function.

The function definition is

static struct rga_addr_offset *
rga_lookup_draw_pos(struct rga_corners_addr_offset * offsets,
                    u32 rotate_mode, u32 mirr_mode)

but it is called as

rga_lookup_draw_pos(&offsets, mir_mode, rot_mode);

I think, fixing the order of the arguments in the function call is the
correct fix to your observed bug.

Michael

> 
> Signed-off-by: John Keeping <jkeeping@...usicbrands.com>
> ---
>  drivers/media/platform/rockchip/rga/rga-hw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/rockchip/rga/rga-hw.c b/drivers/media/platform/rockchip/rga/rga-hw.c
> index 11c3d72347572..b7d51ddb10fa4 100644
> --- a/drivers/media/platform/rockchip/rga/rga-hw.c
> +++ b/drivers/media/platform/rockchip/rga/rga-hw.c
> @@ -97,7 +97,7 @@ static struct rga_addr_offset *rga_lookup_draw_pos(struct
>  	if (!offsets)
>  		return NULL;
>  
> -	switch (rot_mir_point_matrix[rotate_mode][mirr_mode]) {
> +	switch (rot_mir_point_matrix[mirr_mode][rotate_mode]) {
>  	case LT:
>  		return &offsets->left_top;
>  	case LB:
> -- 
> 2.45.2
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ