summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos
diff options
context:
space:
mode:
authorTobias Jakobi <tjakobi@math.uni-bielefeld.de>2014-07-23 16:57:13 +0200
committerInki Dae <inki.dae@samsung.com>2014-08-04 13:39:28 +0900
commitef7ce055a9e00f6376416466b996515a27b7cb31 (patch)
treecfbd52dcaa4d239c24ebdc7ca4ee14ae464da2a3 /drivers/gpu/drm/exynos
parent1cd1ea565f3ece26dff3a94bf73e4f6caae140b9 (diff)
downloadop-kernel-dev-ef7ce055a9e00f6376416466b996515a27b7cb31.zip
op-kernel-dev-ef7ce055a9e00f6376416466b996515a27b7cb31.tar.gz
drm/exynos: g2d: let exynos_g2d_get_ver_ioctl fail
Currently the DRM_IOCTL_EXYNOS_G2D_GET_VER ioctl always succeeds, even if no G2D support is available. Let the ioctl fail when this is the case, so that userspace can accurately probe for G2D support. This also fixes the exynos tests in libdrm. There 'g2d_init' doesn't fail when G2D is absent, leading to a segfault later. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: INki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_g2d.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 0d46178..df7a77d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -1042,8 +1042,23 @@ err:
int exynos_g2d_get_ver_ioctl(struct drm_device *drm_dev, void *data,
struct drm_file *file)
{
+ struct drm_exynos_file_private *file_priv = file->driver_priv;
+ struct exynos_drm_g2d_private *g2d_priv = file_priv->g2d_priv;
+ struct device *dev;
+ struct g2d_data *g2d;
struct drm_exynos_g2d_get_ver *ver = data;
+ if (!g2d_priv)
+ return -ENODEV;
+
+ dev = g2d_priv->dev;
+ if (!dev)
+ return -ENODEV;
+
+ g2d = dev_get_drvdata(dev);
+ if (!g2d)
+ return -EFAULT;
+
ver->major = G2D_HW_MAJOR_VER;
ver->minor = G2D_HW_MINOR_VER;
OpenPOWER on IntegriCloud