1 From b3b3d12cf0734318a0fed0b33e13d714188369db Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 22 Oct 2024 17:17:31 +0100
4 Subject: [PATCH] drm: Add a DRM_MODE_TRANSPOSE option to the DRM rotation
7 Some hardware will implement transpose as a rotation operation,
8 which when combined with X and Y reflect can result in a rotation,
9 but is a discrete operation in its own right.
11 Add an option for transpose only.
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 drivers/gpu/drm/drm_blend.c | 3 +++
16 include/uapi/drm/drm_mode.h | 1 +
17 2 files changed, 4 insertions(+)
19 --- a/drivers/gpu/drm/drm_blend.c
20 +++ b/drivers/gpu/drm/drm_blend.c
21 @@ -263,6 +263,8 @@ EXPORT_SYMBOL(drm_plane_create_alpha_pro
25 + * DRM_MODE_TRANSPOSE:
28 * Rotation is the specified amount in degrees in counter clockwise direction,
29 * the X and Y axis are within the source rectangle, i.e. the X/Y axis before
30 @@ -280,6 +282,7 @@ int drm_plane_create_rotation_property(s
31 { __builtin_ffs(DRM_MODE_ROTATE_270) - 1, "rotate-270" },
32 { __builtin_ffs(DRM_MODE_REFLECT_X) - 1, "reflect-x" },
33 { __builtin_ffs(DRM_MODE_REFLECT_Y) - 1, "reflect-y" },
34 + { __builtin_ffs(DRM_MODE_TRANSPOSE) - 1, "transpose" },
36 struct drm_property *prop;
38 --- a/include/uapi/drm/drm_mode.h
39 +++ b/include/uapi/drm/drm_mode.h
40 @@ -203,6 +203,7 @@ extern "C" {
42 #define DRM_MODE_REFLECT_X (1<<4)
43 #define DRM_MODE_REFLECT_Y (1<<5)
44 +#define DRM_MODE_TRANSPOSE (1<<6)
47 * DRM_MODE_REFLECT_MASK