diff options
author | Maíra Canal <mcanal@igalia.com> | 2023-04-18 16:05:25 +0300 |
---|---|---|
committer | Maíra Canal <mairacanal@riseup.net> | 2023-05-08 15:57:20 +0300 |
commit | cd0755508d81736d026bc25647a89dfc79162d95 (patch) | |
tree | 0be0246531dc9b2148a2bc719e850f65d53686ae /drivers/gpu/drm/vkms/vkms_formats.c | |
parent | cf7f8c671c830302bd382ac640591ee3d6381ad3 (diff) | |
download | linux-cd0755508d81736d026bc25647a89dfc79162d95.tar.xz |
drm/vkms: add rotate-270 property
Currently, vkms supports the rotate-90, rotate-180, reflect-x and
reflect-y properties. Therefore, improve the vkms IGT test coverage by
adding the rotate-270 property to vkms. The rotation was implement by
software: rotate the way the blending occurs by making the source x axis
be the destination y axis and the source y axis be the destination x
axis and reverse-read the axis.
Now, vkms supports all possible rotation values.
Tested with igt@kms_rotation_crc@primary-rotation-270 [1],
and igt@kms_rotation_crc@sprite-rotation-270 [1].
[1] https://patchwork.freedesktop.org/series/116025/
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230418130525.128733-6-mcanal@igalia.com
Diffstat (limited to 'drivers/gpu/drm/vkms/vkms_formats.c')
-rw-r--r-- | drivers/gpu/drm/vkms/vkms_formats.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c index f56f359e0d2d..ebacb8efa055 100644 --- a/drivers/gpu/drm/vkms/vkms_formats.c +++ b/drivers/gpu/drm/vkms/vkms_formats.c @@ -2,6 +2,8 @@ #include <linux/kernel.h> #include <linux/minmax.h> + +#include <drm/drm_blend.h> #include <drm/drm_rect.h> #include <drm/drm_fixed.h> @@ -44,7 +46,7 @@ static void *get_packed_src_addr(const struct vkms_frame_info *frame_info, int y static int get_x_position(const struct vkms_frame_info *frame_info, int limit, int x) { - if (frame_info->rotation & DRM_MODE_REFLECT_X) + if (frame_info->rotation & (DRM_MODE_REFLECT_X | DRM_MODE_ROTATE_270)) return limit - x - 1; return x; } @@ -119,7 +121,7 @@ void vkms_compose_row(struct line_buffer *stage_buffer, struct vkms_plane_state for (size_t x = 0; x < limit; x++, src_pixels += frame_info->cpp) { int x_pos = get_x_position(frame_info, limit, x); - if (frame_info->rotation & DRM_MODE_ROTATE_90) + if (drm_rotation_90_or_270(frame_info->rotation)) src_pixels = get_packed_src_addr(frame_info, x + frame_info->rotated.y1) + frame_info->cpp * y; |