From patchwork Wed Jul 23 14:28:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Jakobi X-Patchwork-Id: 4611151 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BE9B89F2B8 for ; Wed, 23 Jul 2014 14:28:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2DFA20172 for ; Wed, 23 Jul 2014 14:28:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD69620123 for ; Wed, 23 Jul 2014 14:28:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757728AbaGWO2V (ORCPT ); Wed, 23 Jul 2014 10:28:21 -0400 Received: from mout.gmx.net ([212.227.15.18]:49523 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757725AbaGWO2U convert rfc822-to-8bit (ORCPT ); Wed, 23 Jul 2014 10:28:20 -0400 Received: from [129.70.15.110] by 3capp-gmx-bs69.server.lan (via HTTP); Wed, 23 Jul 2014 16:28:16 +0200 MIME-Version: 1.0 Message-ID: From: "Tobias Jakobi" To: "Tobias Jakobi" Cc: linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, t.figa@samsung.com, inki.dae@samsung.com, "Tobias Jakobi" Subject: Aw: [PATCH] drm/exynos: g2d: let exynos_g2d_get_ver_ioctl fail Date: Wed, 23 Jul 2014 16:28:16 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <1406123832-7026-1-git-send-email-tjakobi@math.uni-bielefeld.de> References: <1406123832-7026-1-git-send-email-tjakobi@math.uni-bielefeld.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K0:GzhWAMJOlFQCpVGjZ4tk30NXxmQUmMZ8NLZJvi2Z05y LLiep28b5Y86bSrhbXx9jbqLF4BYD2D4b40HAEqEgKoGM+elWS xE8IYxdOPwpbkr17m8+cy8vDvqdGakEQQlEBgo1vt5hqMZIjDi EKil0J/j6FWG11mzXBxoaqXFERS7Ir19O8svDUyDOvydrvO8KB qWeFE9W4OzJkXObbsiLpyg2os26AxzccWA7hq4YqDKzBoJc9pP 89EMnOfb+tlE2dSQY3U4XG2cEDnBPUhxVf5HLI5D1ISMmnvGJJ ssmRjY= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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" An: linux-samsung-soc@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, t.figa@samsung.com, inki.dae@samsung.com, "Tobias Jakobi" 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 --- 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 diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 5fa1bb6..cde8a89 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -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;