diff options
-rw-r--r-- | exynos/exynos_drm.c | 4 | ||||
-rw-r--r-- | exynos/exynos_drm.h | 17 | ||||
-rw-r--r-- | exynos/exynos_fimg2d.c | 2 | ||||
-rw-r--r-- | libkms/exynos.c | 4 |
4 files changed, 21 insertions, 6 deletions
diff --git a/exynos/exynos_drm.c b/exynos/exynos_drm.c index b008ad73..b593eb6c 100644 --- a/exynos/exynos_drm.c +++ b/exynos/exynos_drm.c @@ -282,14 +282,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; diff --git a/libkms/exynos.c b/libkms/exynos.c index ef64a668..070edfc6 100644 --- a/libkms/exynos.c +++ b/libkms/exynos.c @@ -136,7 +136,7 @@ static int exynos_bo_map(struct kms_bo *_bo, void **out) { struct exynos_bo *bo = (struct exynos_bo *)_bo; - struct drm_mode_map_dumb arg; + struct drm_exynos_gem_map arg; void *map = NULL; int ret; @@ -149,7 +149,7 @@ exynos_bo_map(struct kms_bo *_bo, void **out) memset(&arg, 0, sizeof(arg)); arg.handle = bo->base.handle; - ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_MODE_MAP_DUMB, &arg); + ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_EXYNOS_GEM_MAP, &arg); if (ret) return ret; |