From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15C8A125BA for ; Fri, 9 Aug 2024 14:32:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723213930; cv=none; b=dzSBqCy1L3/5LrHRRW+/yp3Iw1Jj+rAUk3t+VWtaKcMiHRqT+k9+BJu/zEsZJ7CgaAROzSPziOJ9OIJV1+u2vne+X7MxZm5WdySwToFP9Zfu30+edlZP1Uy0MNJI41Bz1hc+lqle+d4c7dFO6x6CBy7Xup2lK29YADYgTEbrskc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723213930; c=relaxed/simple; bh=cjwpeh0kqDVJHM+invAc8ZyTc7e+zxck2KdMC6bVlyU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RB+b010cYXCtPjpI2TRs8C8A9UrVtbMw7YFmrjrdsMMZfn88Qvbbk9DhBbcLa31/ATmCMoYTCBKnBVZoL3nfBcasCkMQzZ7m04uujACrFHPcgaLBYCOPhYBl4E9WrvH6fDzr7hV+NDBonun9lWUzSpDz6aGNps7KZOn9YojgF/k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1scQei-0000pa-Pc; Fri, 09 Aug 2024 16:31:48 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1scQed-005gfq-Tz; Fri, 09 Aug 2024 16:31:43 +0200 Received: from mtr by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1scQed-00Aq7J-2b; Fri, 09 Aug 2024 16:31:43 +0200 Date: Fri, 9 Aug 2024 16:31:43 +0200 From: Michael Tretter To: John Keeping Cc: linux-media@vger.kernel.org, Jacob Chen , Ezequiel Garcia , Mauro Carvalho Chehab , Heiko Stuebner , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH] media: rockchip: rga: fix offset lookup Message-ID: Mail-Followup-To: Michael Tretter , John Keeping , linux-media@vger.kernel.org, Jacob Chen , Ezequiel Garcia , Mauro Carvalho Chehab , Heiko Stuebner , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de References: <20240806094842.248775-1-jkeeping@inmusicbrands.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240806094842.248775-1-jkeeping@inmusicbrands.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mtr@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 > --- > 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 > > >