diff options
author | Inki Dae <inki.dae@samsung.com> | 2012-05-04 15:51:17 +0900 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2012-05-08 18:46:32 +0900 |
commit | 40cd7e0c02f37af4b44fc00531873832e45587e9 (patch) | |
tree | d941353be010a62e1a2154a54b5b11a73c4ca6a3 /drivers/gpu/drm/exynos/exynos_drm_gem.c | |
parent | b2df26c10b16afe2eed904f2b85a4d2047531d30 (diff) | |
download | blackbird-obmc-linux-40cd7e0c02f37af4b44fc00531873832e45587e9.tar.gz blackbird-obmc-linux-40cd7e0c02f37af4b44fc00531873832e45587e9.zip |
drm/exynos: added a feature to get gem buffer information.
this patch adds a feature to get a gem buffer information and user application
can get the gem buffer information simply in runtime through gem handle.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_gem.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 31bb85f5d274..fc91293c4560 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -604,6 +604,32 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data, return 0; } +int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ struct exynos_drm_gem_obj *exynos_gem_obj; + struct drm_exynos_gem_info *args = data; + struct drm_gem_object *obj; + + mutex_lock(&dev->struct_mutex); + + obj = drm_gem_object_lookup(dev, file_priv, args->handle); + if (!obj) { + DRM_ERROR("failed to lookup gem object.\n"); + mutex_unlock(&dev->struct_mutex); + return -EINVAL; + } + + exynos_gem_obj = to_exynos_gem_obj(obj); + + args->flags = exynos_gem_obj->flags; + args->size = exynos_gem_obj->size; + + drm_gem_object_unreference(obj); + mutex_unlock(&dev->struct_mutex); + + return 0; +} + int exynos_drm_gem_init_object(struct drm_gem_object *obj) { DRM_DEBUG_KMS("%s\n", __FILE__); |