* [PATCH] media: rockchip: rga: fix offset lookup @ 2024-08-06 9:48 John Keeping 2024-08-09 8:45 ` Hans Verkuil 2024-08-09 14:31 ` Michael Tretter 0 siblings, 2 replies; 4+ messages in thread From: John Keeping @ 2024-08-06 9:48 UTC (permalink / raw) To: linux-media Cc: John Keeping, Jacob Chen, Ezequiel Garcia, Mauro Carvalho Chehab, Heiko Stuebner, linux-rockchip, linux-arm-kernel, linux-kernel 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. Signed-off-by: John Keeping <jkeeping@inmusicbrands.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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] media: rockchip: rga: fix offset lookup 2024-08-06 9:48 [PATCH] media: rockchip: rga: fix offset lookup John Keeping @ 2024-08-09 8:45 ` Hans Verkuil 2024-08-09 14:31 ` Michael Tretter 1 sibling, 0 replies; 4+ messages in thread From: Hans Verkuil @ 2024-08-09 8:45 UTC (permalink / raw) To: John Keeping, linux-media Cc: Jacob Chen, Ezequiel Garcia, Mauro Carvalho Chehab, Heiko Stuebner, linux-rockchip, linux-arm-kernel, linux-kernel, Michael Tretter +Michael Tretter Michael, can you confirm this? Regards, Hans On 06/08/2024 11:48, 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. > > Signed-off-by: John Keeping <jkeeping@inmusicbrands.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: ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: rockchip: rga: fix offset lookup 2024-08-06 9:48 [PATCH] media: rockchip: rga: fix offset lookup John Keeping 2024-08-09 8:45 ` Hans Verkuil @ 2024-08-09 14:31 ` Michael Tretter 2024-08-10 13:00 ` John Keeping 1 sibling, 1 reply; 4+ messages in thread From: Michael Tretter @ 2024-08-09 14:31 UTC (permalink / raw) To: John Keeping Cc: linux-media, Jacob Chen, Ezequiel Garcia, Mauro Carvalho Chehab, Heiko Stuebner, linux-rockchip, linux-arm-kernel, linux-kernel, kernel 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@inmusicbrands.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 > > > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: rockchip: rga: fix offset lookup 2024-08-09 14:31 ` Michael Tretter @ 2024-08-10 13:00 ` John Keeping 0 siblings, 0 replies; 4+ messages in thread From: John Keeping @ 2024-08-10 13:00 UTC (permalink / raw) To: Michael Tretter, linux-media, Jacob Chen, Ezequiel Garcia, Mauro Carvalho Chehab, Heiko Stuebner, linux-rockchip, linux-arm-kernel, linux-kernel, kernel Hi Michael, On Fri, Aug 09, 2024 at 04:31:43PM +0200, Michael Tretter wrote: > 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. Ah, yes. I'm not sure how I missed that. I have confirmed your suggested change works and will send an updated patch. Thanks, John > > > > Signed-off-by: John Keeping <jkeeping@inmusicbrands.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 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-08-10 13:01 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-08-06 9:48 [PATCH] media: rockchip: rga: fix offset lookup John Keeping 2024-08-09 8:45 ` Hans Verkuil 2024-08-09 14:31 ` Michael Tretter 2024-08-10 13:00 ` John Keeping
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).