diff options
author | Inki Dae <inki.dae@samsung.com> | 2013-03-11 16:15:59 +0400 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2013-03-20 14:09:11 +0400 |
commit | a4f19aaab3e69f9d15cc995e3378d27c8ef4f780 (patch) | |
tree | f4bf1e9a2587550775525d47f8d34ec5334b95be /drivers/gpu/drm/exynos/exynos_drm_gem.c | |
parent | 9963cb6ef9e6f925617b3c74f0700bf5fbee9a1d (diff) | |
download | linux-a4f19aaab3e69f9d15cc995e3378d27c8ef4f780.tar.xz |
drm/exynos: Add a new function to get gem buffer size
This patch adds a new function to get gem buffer size. And this
funtion could be used for g2d driver or others can get gem buffer
size to check if the buffer is valid or not.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_gem.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 67e17ce112b6..0e6fe000578c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -164,6 +164,27 @@ out: exynos_gem_obj = NULL; } +unsigned long exynos_drm_gem_get_size(struct drm_device *dev, + unsigned int gem_handle, + struct drm_file *file_priv) +{ + struct exynos_drm_gem_obj *exynos_gem_obj; + struct drm_gem_object *obj; + + obj = drm_gem_object_lookup(dev, file_priv, gem_handle); + if (!obj) { + DRM_ERROR("failed to lookup gem object.\n"); + return 0; + } + + exynos_gem_obj = to_exynos_gem_obj(obj); + + drm_gem_object_unreference_unlocked(obj); + + return exynos_gem_obj->buffer->size; +} + + struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev, unsigned long size) { |