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