summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Vorobiov <s.vorobiov@samsung.com>2014-08-22 10:53:59 +0400
committerSeung-Woo Kim <sw0312.kim@samsung.com>2018-02-26 10:18:49 +0900
commit45712c2053b41a56aec3ef4986952bd7f7b18afa (patch)
treed53815b4518c6a814cca784de7054795c9d1de79
parent0f0f95d18c5ea0d03413df1f94410937c0cb6ea4 (diff)
downloadlibdrm-45712c2053b41a56aec3ef4986952bd7f7b18afa.tar.gz
libdrm-45712c2053b41a56aec3ef4986952bd7f7b18afa.tar.bz2
libdrm-45712c2053b41a56aec3ef4986952bd7f7b18afa.zip
VIGS: Implement plane flip/rotate
Planes can now be horizontally/vertically flipped and rotated by 90, 180 or 270 degrees Change-Id: I3db7dc3854add2b777e41aed54039a0d2323e0b1 Signed-off-by: Stanislav Vorobiov <s.vorobiov@samsung.com> Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
-rw-r--r--include/drm/vigs_drm.h13
-rw-r--r--vigs/Makefile.am2
-rw-r--r--vigs/vigs.c20
-rw-r--r--vigs/vigs.h17
4 files changed, 50 insertions, 2 deletions
diff --git a/include/drm/vigs_drm.h b/include/drm/vigs_drm.h
index 7abf0433..24f2a431 100644
--- a/include/drm/vigs_drm.h
+++ b/include/drm/vigs_drm.h
@@ -33,7 +33,7 @@
/*
* Bump this whenever driver interface changes.
*/
-#define DRM_VIGS_DRIVER_VERSION 13
+#define DRM_VIGS_DRIVER_VERSION 14
/*
* Surface access flags.
@@ -151,6 +151,14 @@ struct drm_vigs_plane_set_zpos
int zpos;
};
+struct drm_vigs_plane_set_transform
+{
+ uint32_t plane_id;
+ int hflip;
+ int vflip;
+ int rotation;
+};
+
struct drm_vigs_dp_create_surface
{
uint32_t dp_plane;
@@ -188,6 +196,7 @@ struct drm_vigs_dp_open_surface
#define DRM_VIGS_FENCE_SIGNALED 0x0C
#define DRM_VIGS_FENCE_UNREF 0x0D
#define DRM_VIGS_PLANE_SET_ZPOS 0x0E
+#define DRM_VIGS_PLANE_SET_TRANSFORM 0x0F
#define DRM_VIGS_DP_CREATE_SURFACE 0x20
#define DRM_VIGS_DP_OPEN_SURFACE 0x21
@@ -222,6 +231,8 @@ struct drm_vigs_dp_open_surface
DRM_VIGS_FENCE_UNREF, struct drm_vigs_fence_unref)
#define DRM_IOCTL_VIGS_PLANE_SET_ZPOS DRM_IOW(DRM_COMMAND_BASE + \
DRM_VIGS_PLANE_SET_ZPOS, struct drm_vigs_plane_set_zpos)
+#define DRM_IOCTL_VIGS_PLANE_SET_TRANSFORM DRM_IOW(DRM_COMMAND_BASE + \
+ DRM_VIGS_PLANE_SET_TRANSFORM, struct drm_vigs_plane_set_transform)
#define DRM_IOCTL_VIGS_DP_CREATE_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
DRM_VIGS_DP_CREATE_SURFACE, struct drm_vigs_dp_create_surface)
diff --git a/vigs/Makefile.am b/vigs/Makefile.am
index 7f17ebbc..eabb2684 100644
--- a/vigs/Makefile.am
+++ b/vigs/Makefile.am
@@ -11,7 +11,7 @@ AM_CFLAGS = \
libdrm_vigs_la_LTLIBRARIES = libdrm_vigs.la
libdrm_vigs_ladir = $(libdir)
-libdrm_vigs_la_LDFLAGS = -version-number 8:0:0 -no-undefined
+libdrm_vigs_la_LDFLAGS = -version-number 9:0:0 -no-undefined
libdrm_vigs_la_LIBADD = ../libdrm.la
libdrm_vigs_la_SOURCES = vigs.c
diff --git a/vigs/vigs.c b/vigs/vigs.c
index 36236f7a..33a59d7a 100644
--- a/vigs/vigs.c
+++ b/vigs/vigs.c
@@ -674,6 +674,26 @@ int vigs_drm_plane_set_zpos(struct vigs_drm_device *dev,
return (ret != 0) ? -errno : 0;
}
+int vigs_drm_plane_set_transform(struct vigs_drm_device *dev,
+ uint32_t plane_id,
+ int hflip,
+ int vflip,
+ vigs_drm_rotation rotation)
+{
+ struct drm_vigs_plane_set_transform req =
+ {
+ .plane_id = plane_id,
+ .hflip = hflip,
+ .vflip = vflip,
+ .rotation = rotation
+ };
+ int ret;
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_PLANE_SET_TRANSFORM, &req);
+
+ return (ret != 0) ? -errno : 0;
+}
+
int vigs_drm_dp_surface_create(struct vigs_drm_device *dev,
uint32_t dp_plane,
uint32_t dp_fb_buf,
diff --git a/vigs/vigs.h b/vigs/vigs.h
index 34e08db0..7453431b 100644
--- a/vigs/vigs.h
+++ b/vigs/vigs.h
@@ -44,6 +44,17 @@ typedef enum
} vigs_drm_surface_format;
/*
+ * Rotations.
+ */
+typedef enum
+{
+ vigs_drm_rotation_0 = 0x0,
+ vigs_drm_rotation_90 = 0x1,
+ vigs_drm_rotation_180 = 0x2,
+ vigs_drm_rotation_270 = 0x3,
+} vigs_drm_rotation;
+
+/*
* Surface access flags.
*/
#define VIGS_DRM_SAF_READ 1
@@ -240,6 +251,12 @@ int vigs_drm_plane_set_zpos(struct vigs_drm_device *dev,
uint32_t plane_id,
int zpos);
+int vigs_drm_plane_set_transform(struct vigs_drm_device *dev,
+ uint32_t plane_id,
+ int hflip,
+ int vflip,
+ vigs_drm_rotation rotation);
+
/*
* @}
*/