Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] media: meson-ge2d: fix rotation parameters
@ 2021-04-12 13:48 Neil Armstrong
  2021-04-19 18:21 ` Kevin Hilman
  0 siblings, 1 reply; 2+ messages in thread
From: Neil Armstrong @ 2021-04-12 13:48 UTC (permalink / raw)
  To: hverkuil-cisco
  Cc: linux-media, linux-amlogic, linux-arm-kernel, linux-kernel,
	Neil Armstrong

With these settings, 90deg and 270deg rotation leads to inverted
vertical, fix them to have correct rotation.

Fixes: 59a635327ca7 ("media: meson: Add M2M driver for the Amlogic GE2D Accelerator Unit")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/media/platform/meson/ge2d/ge2d.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/meson/ge2d/ge2d.c b/drivers/media/platform/meson/ge2d/ge2d.c
index 153612ca96fc..a1393fefa8ae 100644
--- a/drivers/media/platform/meson/ge2d/ge2d.c
+++ b/drivers/media/platform/meson/ge2d/ge2d.c
@@ -757,7 +757,7 @@ static int ge2d_s_ctrl(struct v4l2_ctrl *ctrl)
 
 		if (ctrl->val == 90) {
 			ctx->hflip = 0;
-			ctx->vflip = 0;
+			ctx->vflip = 1;
 			ctx->xy_swap = 1;
 		} else if (ctrl->val == 180) {
 			ctx->hflip = 1;
@@ -765,7 +765,7 @@ static int ge2d_s_ctrl(struct v4l2_ctrl *ctrl)
 			ctx->xy_swap = 0;
 		} else if (ctrl->val == 270) {
 			ctx->hflip = 1;
-			ctx->vflip = 1;
+			ctx->vflip = 0;
 			ctx->xy_swap = 1;
 		} else {
 			ctx->hflip = 0;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: meson-ge2d: fix rotation parameters
  2021-04-12 13:48 [PATCH] media: meson-ge2d: fix rotation parameters Neil Armstrong
@ 2021-04-19 18:21 ` Kevin Hilman
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Hilman @ 2021-04-19 18:21 UTC (permalink / raw)
  To: Neil Armstrong, hverkuil-cisco
  Cc: linux-media, linux-amlogic, linux-arm-kernel, linux-kernel,
	Neil Armstrong

Neil Armstrong <narmstrong@baylibre.com> writes:

> With these settings, 90deg and 270deg rotation leads to inverted
> vertical, fix them to have correct rotation.
>
> Fixes: 59a635327ca7 ("media: meson: Add M2M driver for the Amlogic GE2D Accelerator Unit")
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>

Reviewed-by: Kevin Hilman <khilman@baylibre.com>

> ---
>  drivers/media/platform/meson/ge2d/ge2d.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/meson/ge2d/ge2d.c b/drivers/media/platform/meson/ge2d/ge2d.c
> index 153612ca96fc..a1393fefa8ae 100644
> --- a/drivers/media/platform/meson/ge2d/ge2d.c
> +++ b/drivers/media/platform/meson/ge2d/ge2d.c
> @@ -757,7 +757,7 @@ static int ge2d_s_ctrl(struct v4l2_ctrl *ctrl)
>  
>  		if (ctrl->val == 90) {
>  			ctx->hflip = 0;
> -			ctx->vflip = 0;
> +			ctx->vflip = 1;
>  			ctx->xy_swap = 1;
>  		} else if (ctrl->val == 180) {
>  			ctx->hflip = 1;
> @@ -765,7 +765,7 @@ static int ge2d_s_ctrl(struct v4l2_ctrl *ctrl)
>  			ctx->xy_swap = 0;
>  		} else if (ctrl->val == 270) {
>  			ctx->hflip = 1;
> -			ctx->vflip = 1;
> +			ctx->vflip = 0;
>  			ctx->xy_swap = 1;
>  		} else {
>  			ctx->hflip = 0;
> -- 
> 2.25.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 13:48 [PATCH] media: meson-ge2d: fix rotation parameters Neil Armstrong
2021-04-19 18:21 ` Kevin Hilman

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git