tizen 2.3 release tizen_2.3 submit/tizen_2.3/20150202.065812 tizen_2.3_release
authorjk7744.park <jk7744.park@samsung.com>
Sun, 1 Feb 2015 05:05:24 +0000 (14:05 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Sun, 1 Feb 2015 05:05:24 +0000 (14:05 +0900)
include/drm/vigs_drm.h
packaging/libdrm.spec
vigs/Makefile.am
vigs/vigs.c
vigs/vigs.h

index 1694801..24f2a43 100644 (file)
@@ -33,7 +33,7 @@
 /*
  * Bump this whenever driver interface changes.
  */
-#define DRM_VIGS_DRIVER_VERSION 12
+#define DRM_VIGS_DRIVER_VERSION 14
 
 /*
  * Surface access flags.
 #define DRM_VIGS_SAF_WRITE 2
 #define DRM_VIGS_SAF_MASK 3
 
+/*
+ * Number of DP framebuffers.
+ */
+#define DRM_VIGS_NUM_DP_FB_BUF 4
+
+/*
+ * DP memory types.
+ */
+#define DRM_VIGS_DP_FB_Y 2
+#define DRM_VIGS_DP_FB_C 3
+
 struct drm_vigs_get_protocol_version
 {
     uint32_t version;
@@ -140,6 +151,36 @@ 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;
+    uint32_t dp_fb_buf;
+    uint32_t dp_mem_flag;
+    uint32_t width;
+    uint32_t height;
+    uint32_t stride;
+    uint32_t format;
+    uint32_t handle;
+    uint32_t size;
+    uint32_t id;
+};
+
+struct drm_vigs_dp_open_surface
+{
+    uint32_t dp_plane;
+    uint32_t dp_fb_buf;
+    uint32_t dp_mem_flag;
+    uint32_t handle;
+};
+
 #define DRM_VIGS_GET_PROTOCOL_VERSION 0x00
 #define DRM_VIGS_CREATE_SURFACE 0x01
 #define DRM_VIGS_CREATE_EXECBUFFER 0x02
@@ -155,6 +196,10 @@ struct drm_vigs_plane_set_zpos
 #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
 
 #define DRM_IOCTL_VIGS_GET_PROTOCOL_VERSION DRM_IOR(DRM_COMMAND_BASE + \
             DRM_VIGS_GET_PROTOCOL_VERSION, struct drm_vigs_get_protocol_version)
@@ -186,5 +231,12 @@ struct drm_vigs_plane_set_zpos
             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)
+#define DRM_IOCTL_VIGS_DP_OPEN_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
+            DRM_VIGS_DP_OPEN_SURFACE, struct drm_vigs_dp_open_surface)
 
 #endif
index 64eb830..5b509d3 100644 (file)
@@ -1,6 +1,6 @@
 Name:           libdrm
 Version:        2.4.35
-Release:        18
+Release:        20
 License:        MIT
 Summary:        Userspace interface to kernel DRM services
 Group:          System/Libraries
@@ -59,6 +59,7 @@ make %{?_smp_mflags}
 %post -n libkms1 -p /sbin/ldconfig
 %postun -n libkms1 -p /sbin/ldconfig
 
+
 %files devel
 %dir %{_includedir}/libdrm
 %{_includedir}/*
index 195bbf3..fdc7740 100644 (file)
@@ -12,7 +12,7 @@ AM_CFLAGS = \
 
 libdrm_vigs_la_LTLIBRARIES = libdrm_vigs.la
 libdrm_vigs_ladir = $(libdir)
-libdrm_vigs_la_LDFLAGS = -version-number 7:0:0 -no-undefined
+libdrm_vigs_la_LDFLAGS = -version-number 9:0:0 -no-undefined
 libdrm_vigs_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
 
 libdrm_vigs_la_SOURCES = vigs.c
index 0e1a418..33a59d7 100644 (file)
@@ -673,3 +673,151 @@ 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,
+                               uint32_t dp_mem_flag,
+                               uint32_t width,
+                               uint32_t height,
+                               uint32_t stride,
+                               uint32_t format,
+                               struct vigs_drm_surface **sfc)
+{
+    struct vigs_drm_surface_impl *sfc_impl;
+    struct drm_vigs_dp_create_surface req =
+    {
+        .dp_plane = dp_plane,
+        .dp_fb_buf = dp_fb_buf,
+        .dp_mem_flag = dp_mem_flag,
+        .width = width,
+        .height = height,
+        .stride = stride,
+        .format = format,
+    };
+    int ret;
+
+    sfc_impl = calloc(sizeof(*sfc_impl), 1);
+
+    if (!sfc_impl) {
+        ret = -ENOMEM;
+        goto fail1;
+    }
+
+    ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_DP_CREATE_SURFACE, &req);
+
+    if (ret != 0) {
+        ret = -errno;
+        goto fail2;
+    }
+
+    vigs_drm_gem_impl_init((struct vigs_drm_gem_impl*)sfc_impl,
+                           dev,
+                           req.handle,
+                           req.size,
+                           0);
+
+    sfc_impl->base.width = width;
+    sfc_impl->base.height = height;
+    sfc_impl->base.stride = stride;
+    sfc_impl->base.format = format;
+    sfc_impl->base.scanout = 0;
+    sfc_impl->base.id = req.id;
+
+    *sfc = &sfc_impl->base;
+
+    return 0;
+
+fail2:
+    free(sfc_impl);
+fail1:
+    *sfc = NULL;
+
+    return ret;
+}
+
+int vigs_drm_dp_surface_open(struct vigs_drm_device *dev,
+                             uint32_t dp_plane,
+                             uint32_t dp_fb_buf,
+                             uint32_t dp_mem_flag,
+                             struct vigs_drm_surface **sfc)
+{
+    struct vigs_drm_surface_impl *sfc_impl;
+    struct drm_vigs_dp_open_surface req =
+    {
+        .dp_plane = dp_plane,
+        .dp_fb_buf = dp_fb_buf,
+        .dp_mem_flag = dp_mem_flag
+    };
+    struct drm_vigs_surface_info info_req;
+    int ret;
+
+    sfc_impl = calloc(sizeof(*sfc_impl), 1);
+
+    if (!sfc_impl) {
+        ret = -ENOMEM;
+        goto fail1;
+    }
+
+    ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_DP_OPEN_SURFACE, &req);
+
+    if (ret != 0) {
+        ret = -errno;
+        goto fail2;
+    }
+
+    info_req.handle = req.handle;
+
+    ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_SURFACE_INFO, &info_req);
+
+    if (ret != 0) {
+        ret = -errno;
+        goto fail3;
+    }
+
+    vigs_drm_gem_impl_init((struct vigs_drm_gem_impl*)sfc_impl,
+                           dev,
+                           req.handle,
+                           info_req.size,
+                           0);
+
+    sfc_impl->base.width = info_req.width;
+    sfc_impl->base.height = info_req.height;
+    sfc_impl->base.stride = info_req.stride;
+    sfc_impl->base.format = info_req.format;
+    sfc_impl->base.scanout = info_req.scanout;
+    sfc_impl->base.id = info_req.id;
+
+    *sfc = &sfc_impl->base;
+
+    return 0;
+
+fail3:
+    vigs_drm_gem_close(dev, req.handle);
+fail2:
+    free(sfc_impl);
+fail1:
+    *sfc = NULL;
+
+    return ret;
+}
index 0830090..7453431 100644 (file)
@@ -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,37 @@ 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);
+
+/*
+ * @}
+ */
+
+/*
+ * DP functions.
+ * @{
+ */
+
+int vigs_drm_dp_surface_create(struct vigs_drm_device *dev,
+                               uint32_t dp_plane,
+                               uint32_t dp_fb_buf,
+                               uint32_t dp_mem_flag,
+                               uint32_t width,
+                               uint32_t height,
+                               uint32_t stride,
+                               uint32_t format,
+                               struct vigs_drm_surface **sfc);
+
+int vigs_drm_dp_surface_open(struct vigs_drm_device *dev,
+                             uint32_t dp_plane,
+                             uint32_t dp_fb_buf,
+                             uint32_t dp_mem_flag,
+                             struct vigs_drm_surface **sfc);
+
 /*
  * @}
  */