From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Jyri Sarha <jsarha@ti.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/7] drm/omap: add drm_rotation_to_tiler helper()
Date: Tue, 23 May 2017 14:19:30 +0300 [thread overview]
Message-ID: <1791759.qAcp9LxhAR@avalon> (raw)
In-Reply-To: <1495007804-6133-2-git-send-email-tomi.valkeinen@ti.com>
Hi Tomi,
Thank you for the patch.
On Wednesday 17 May 2017 10:56:38 Tomi Valkeinen wrote:
> Add a helper function to convert DRM rotation to TILER rotation.
You could mention here that the patch drops an error message that could never
be printed as the DRM core guarantees that the rotation value is valid.
Apart from that,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
> drivers/gpu/drm/omapdrm/omap_fb.c | 56 ++++++++++++++++++++----------------
> 1 file changed, 31 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c
> b/drivers/gpu/drm/omapdrm/omap_fb.c index c565f5734a53..4fc5db5d2d29 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fb.c
> +++ b/drivers/gpu/drm/omapdrm/omap_fb.c
> @@ -122,6 +122,36 @@ bool omap_framebuffer_supports_rotation(struct
> drm_framebuffer *fb) return omap_gem_flags(plane->bo) & OMAP_BO_TILED;
> }
>
> +/* Note: DRM rotates counter-clockwise, TILER & DSS rotates clockwise */
> +static uint32_t drm_rotation_to_tiler(unsigned int drm_rot)
> +{
> + uint32_t orient;
> +
> + switch (drm_rot & DRM_ROTATE_MASK) {
> + default:
> + case DRM_ROTATE_0:
> + orient = 0;
> + break;
> + case DRM_ROTATE_90:
> + orient = MASK_XY_FLIP | MASK_X_INVERT;
> + break;
> + case DRM_ROTATE_180:
> + orient = MASK_X_INVERT | MASK_Y_INVERT;
> + break;
> + case DRM_ROTATE_270:
> + orient = MASK_XY_FLIP | MASK_Y_INVERT;
> + break;
> + }
> +
> + if (drm_rot & DRM_REFLECT_X)
> + orient ^= MASK_X_INVERT;
> +
> + if (drm_rot & DRM_REFLECT_Y)
> + orient ^= MASK_Y_INVERT;
> +
> + return orient;
> +}
> +
> /* update ovl info for scanout, handles cases of multi-planar fb's, etc.
> */
> void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
> @@ -148,31 +178,7 @@ void omap_framebuffer_update_scanout(struct
> drm_framebuffer *fb, uint32_t w = win->src_w;
> uint32_t h = win->src_h;
>
> - switch (win->rotation & DRM_ROTATE_MASK) {
> - default:
> - dev_err(fb->dev->dev, "invalid rotation: %02x",
> - (uint32_t)win->rotation);
> - /* fallthru to default to no rotation */
> - case 0:
> - case DRM_ROTATE_0:
> - orient = 0;
> - break;
> - case DRM_ROTATE_90:
> - orient = MASK_XY_FLIP | MASK_X_INVERT;
> - break;
> - case DRM_ROTATE_180:
> - orient = MASK_X_INVERT | MASK_Y_INVERT;
> - break;
> - case DRM_ROTATE_270:
> - orient = MASK_XY_FLIP | MASK_Y_INVERT;
> - break;
> - }
> -
> - if (win->rotation & DRM_REFLECT_X)
> - orient ^= MASK_X_INVERT;
> -
> - if (win->rotation & DRM_REFLECT_Y)
> - orient ^= MASK_Y_INVERT;
> + orient = drm_rotation_to_tiler(win->rotation);
>
> /* adjust x,y offset for flip/invert: */
> if (orient & MASK_XY_FLIP)
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-05-23 11:19 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-17 7:56 [PATCH 0/7] drm/omap: rotation fixes and cleanups Tomi Valkeinen
2017-05-17 7:56 ` [PATCH 1/7] drm/omap: add drm_rotation_to_tiler helper() Tomi Valkeinen
2017-05-23 11:19 ` Laurent Pinchart [this message]
2017-05-17 7:56 ` [PATCH 2/7] drm/omap: remove omap_drm_win Tomi Valkeinen
2017-05-23 11:41 ` Laurent Pinchart
2017-05-17 7:56 ` [PATCH 3/7] drm/omap: use DRM_ROTATE_* instead of OMAP_DSS_ROT_* Tomi Valkeinen
2017-05-23 13:07 ` Laurent Pinchart
2017-05-23 13:13 ` Tomi Valkeinen
2017-05-17 7:56 ` [PATCH 4/7] drm/omap: DRM_REFLECT_* instead of mirror boolean Tomi Valkeinen
2017-05-23 13:15 ` Laurent Pinchart
2017-05-23 13:21 ` Tomi Valkeinen
2017-05-17 7:56 ` [PATCH 5/7] drm/omap: pass rotation to dispc Tomi Valkeinen
2017-05-23 14:06 ` Laurent Pinchart
2017-05-23 14:36 ` Tomi Valkeinen
2017-05-17 7:56 ` [PATCH 6/7] drm/omap: fix YUV422 rotation with TILER Tomi Valkeinen
2017-05-24 6:44 ` Laurent Pinchart
2017-05-24 6:50 ` Tomi Valkeinen
2017-05-24 9:10 ` Laurent Pinchart
2017-05-17 7:56 ` [PATCH 7/7] drm/omap: fix YUV422 90/270 rotation with mirroring Tomi Valkeinen
2017-05-24 6:46 ` Laurent Pinchart
2017-05-24 6:55 ` Tomi Valkeinen
2017-05-24 7:02 ` Tomi Valkeinen
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=1791759.qAcp9LxhAR@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jsarha@ti.com \
--cc=tomi.valkeinen@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.