@@ -1042,8 +1042,19 @@ 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 = g2d_priv->dev;
+ struct g2d_data *g2d;
struct drm_exynos_g2d_get_ver *ver = data;
+ 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;
Sorry for the noise! Please disregard the patch for now, it causes more trouble than it solves! - Tobias Gesendet: Mittwoch, 23. Juli 2014 um 15:57 Uhr Von: "Tobias Jakobi" <tjakobi@math.uni-bielefeld.de> An: linux-samsung-soc@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, t.figa@samsung.com, inki.dae@samsung.com, "Tobias Jakobi" <tjakobi@math.uni-bielefeld.de> Betreff: [PATCH] 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> --- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 1.8.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html