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 <dave.stevenson@raspberrypi.com>
This commit is contained in:
Dave Stevenson
2024-10-22 17:17:31 +01:00
committed by Dom Cobley
parent 01dd65c67a
commit 97026bb399
2 changed files with 4 additions and 0 deletions

View File

@@ -269,6 +269,8 @@ EXPORT_SYMBOL(drm_plane_create_alpha_property);
* "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
@@ -286,6 +288,7 @@ int drm_plane_create_rotation_property(struct drm_plane *plane,
{ __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;

View File

@@ -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