summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2015-10-06 19:09:16 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2023-12-04 14:34:26 +0900
commit20503be605a8119c5423777d2e4fe362768851e0 (patch)
tree15c5c581422357dca2bf57640c68b4e2b6b6b1f4
parent789cc118f936299fb286c9485c91b821038a8fdf (diff)
downloadlibdrm-20503be605a8119c5423777d2e4fe362768851e0.tar.gz
libdrm-20503be605a8119c5423777d2e4fe362768851e0.tar.bz2
libdrm-20503be605a8119c5423777d2e4fe362768851e0.zip
exynos: support DRM_IOCTL_EXYNOS_GEM_MAP
The commit d41b7a3a745a("exynos: Don't use DRM_EXYNOS_GEM_{MAP_OFFSET/ MMAP} ioctls") removed it same with the ioctl that this patch adds. The reason that removed DRM_IOCTL_EXYNOS_GEM_MAP_OFFSET was we could use DRM_IOCTL_MODE_MAP_DUMB. Both did exactly same thing. Now exynos-drm driver of linux kernel revives it as DRM_EXYNOS_GEM_MAP because of render node. DRM_IOCTL_MODE_MAP_DUMB isn't permitted in render node, so this patch also supports DRM_IOCTL_EXYNOS_GEM_MAP. Change-Id: Ib548dc8a6bea076375465f64ee2fdd658a90e435 Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> exynos: fix build warnings Fix build warnings to exynos_fimg2d module. This patch fixes below two build warnings, exynos_fimg2d.c: In function 'g2d_scale_and_blend': exynos_fimg2d.c:978:3: warning: 'scale_y' may be used uninitialized in this function [-Wmaybe-uninitialized] g2d_add_cmd(ctx, SRC_YSCALE_REG, scale_y); ^ exynos_fimg2d.c:977:3: warning: 'scale_x' may be used uninitialized in this function [-Wmaybe-uninitialized] g2d_add_cmd(ctx, SRC_XSCALE_REG, scale_x); Change-Id: I70908088c61b85570aec6e3ec19b405df4820d37 Signed-off-by: Inki Dae <inki.dae@samsung.com> Conflicts: libkms/exynos.c Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
-rw-r--r--exynos/exynos_drm.c4
-rw-r--r--exynos/exynos_drm.h17
-rw-r--r--exynos/exynos_fimg2d.c2
3 files changed, 19 insertions, 4 deletions
diff --git a/exynos/exynos_drm.c b/exynos/exynos_drm.c
index 3e322a17..b7c62db1 100644
--- a/exynos/exynos_drm.c
+++ b/exynos/exynos_drm.c
@@ -278,14 +278,14 @@ drm_public void *exynos_bo_map(struct exynos_bo *bo)
{
if (!bo->vaddr) {
struct exynos_device *dev = bo->dev;
- struct drm_mode_map_dumb arg;
+ struct drm_exynos_gem_map arg;
void *map = NULL;
int ret;
memset(&arg, 0, sizeof(arg));
arg.handle = bo->handle;
- ret = drmIoctl(dev->fd, DRM_IOCTL_MODE_MAP_DUMB, &arg);
+ ret = drmIoctl(dev->fd, DRM_IOCTL_EXYNOS_GEM_MAP, &arg);
if (ret) {
fprintf(stderr, "failed to map dumb buffer[%s].\n",
strerror(errno));
diff --git a/exynos/exynos_drm.h b/exynos/exynos_drm.h
index 50181c40..bb7ddb61 100644
--- a/exynos/exynos_drm.h
+++ b/exynos/exynos_drm.h
@@ -47,6 +47,19 @@ struct drm_exynos_gem_create {
};
/**
+ * A structure for getting a fake-offset that can be used with mmap.
+ *
+ * @handle: handle of gem object.
+ * @reserved: just padding to be 64-bit aligned.
+ * @offset: a fake-offset of gem object.
+ */
+struct drm_exynos_gem_map {
+ __u32 handle;
+ __u32 reserved;
+ __u64 offset;
+};
+
+/**
* A structure to gem information.
*
* @handle: a handle to gem object created.
@@ -132,6 +145,7 @@ struct drm_exynos_g2d_exec {
};
#define DRM_EXYNOS_GEM_CREATE 0x00
+#define DRM_EXYNOS_GEM_MAP 0x01
/* Reserved 0x04 ~ 0x05 for exynos specific gem ioctl */
#define DRM_EXYNOS_GEM_GET 0x04
#define DRM_EXYNOS_VIDI_CONNECTION 0x07
@@ -143,7 +157,8 @@ struct drm_exynos_g2d_exec {
#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
-
+#define DRM_IOCTL_EXYNOS_GEM_MAP DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_EXYNOS_GEM_MAP, struct drm_exynos_gem_map)
#define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \
DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info)
diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c
index ac6fa687..1d09a3b6 100644
--- a/exynos/exynos_fimg2d.c
+++ b/exynos/exynos_fimg2d.c
@@ -913,7 +913,7 @@ g2d_scale_and_blend(struct g2d_context *ctx, struct g2d_image *src,
union g2d_bitblt_cmd_val bitblt;
union g2d_blend_func_val blend;
unsigned int scale, gem_space;
- unsigned int scale_x, scale_y;
+ unsigned int scale_x = 0, scale_y = 0;
if (src_w == dst_w && src_h == dst_h)
scale = 0;