From patchwork Tue Oct 17 11:07:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 116066 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4748092qgn; Tue, 17 Oct 2017 04:08:22 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDgjWAGKMGUSbV0eXval+jYC5aHxMVrYdeUX6ukeFJQWMeJjFJdKGK66m4TZX2z6uKkDXUo X-Received: by 10.99.109.73 with SMTP id i70mr10449878pgc.177.1508238502405; Tue, 17 Oct 2017 04:08:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508238502; cv=none; d=google.com; s=arc-20160816; b=vlUG7+P62weun20jhSB3QJ98l1xQlZivhdz80p4cWiULcVzdTqGKX7iiDkLW9N1FTu 7kZT444BcJu/AKI0kMb7JXaqM88VKTiaqJhc/LvCeNP0+u9GhWgY6+d3FOUzjpn0orqE pgNVmmhVkFTHkiWofcwKqiQ0Mvu3hqaw2wIcygGVkpasd5zw7eFQ3yIiBZsG6OMRKFcK RAPszuuxEb8533kyu7ZQOFdEcfvCHqDLFgUTNJbMnCjVR2RsTvMKT3U8WcIPtN20+A/S cAmMJ7JgZXJMkqnFCdgjcNIcEhhGxfi2V1bhFxLjL9AcM+juLkPq1UrJAHVy5OiD9Mcl 7Q5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=aVx4/ayVTeGGWrnrVvWul/DHwwkL0supdvTTR/qYWgA=; b=NFozPoCfWTK4gLGXrsvvUkilT5r2tUZnRdix7SuMhxRPgpc2RVzQ6BjIlOpP5SeHwk 3QqGebwcw81cNWrbsSK4JxVAHoHQkzHEePRBuDYqeb87OocMY3y+09GwDFYjWYKNS8Gf 93wZXFHpM9OWeQXVa0Sw5hWdw+N5qxk3mtSvhuqJ/Ngn3RJ8zEtvHh/qMwroOtn5k8r7 fQCi1upwjJXfgyPpN3qY45FlRmeFyxP1fJSprt1vSbhXaL9VIrB/jNeTqUo0+I5c4H32 905SEtaSOdmMDws9yY4544dsSZHbqAGYNK/h/RLpXiEXCo2DCGnHXMzeh6cclWPHZF0u dF/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6si5974285pll.26.2017.10.17.04.08.22; Tue, 17 Oct 2017 04:08:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761299AbdJQLIV (ORCPT + 4 others); Tue, 17 Oct 2017 07:08:21 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:38781 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758955AbdJQLIR (ORCPT ); Tue, 17 Oct 2017 07:08:17 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20171017110815euoutp01487dac3c3088e75b94b1990595c0c4b6~uVuut_gUw2029520295euoutp01Q; Tue, 17 Oct 2017 11:08:15 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171017110814eucas1p237fdc381e4f6875770862483deb83fbc~uVut4JkcW3257532575eucas1p21; Tue, 17 Oct 2017 11:08:14 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id CB.AF.12743.E94E5E95; Tue, 17 Oct 2017 12:08:14 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20171017110813eucas1p19603112d8f9ff41a77c17203b46f5041~uVus_b8ia3155431554eucas1p19; Tue, 17 Oct 2017 11:08:13 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d0000031c7-1d-59e5e49e2d1c Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id A0.16.18832.D94E5E95; Tue, 17 Oct 2017 12:08:13 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OXY00HTLS9D1IC0@eusync3.samsung.com>; Tue, 17 Oct 2017 12:08:13 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Andrzej Hajda , Bartlomiej Zolnierkiewicz , Tobias Jakobi , Krzysztof Kozlowski , Sylwester Nawrocki , Andrzej Pietrasiewicz , Hoegeun Kwon Subject: [PATCH v3 5/9] drm/exynos: Add generic support for devices shared with V4L2 subsystem Date: Tue, 17 Oct 2017 13:07:48 +0200 Message-id: <20171017110752.25096-6-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.14.2 In-reply-to: <20171017110752.25096-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMIsWRmVeSWpSXmKPExsWy7djPc7rznjyNNLj5WMDi1rpzrBazX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HhICJxPcpyl2MnECmmMSFe+vZuhi5OIQEljBKbJ58mhHCaWKSWPz4KzNIFZuA oUTX2y42EFtEwE2i6fBMVhCbWWAfs8TGNm8QW1ggQaLn+CFGEJtFQFVi46sTTCA2r4CtxOnX i5kgtslLvF9wH6yGU8BO4saXC2BzhIBqHq15zTiBkXcBI8MqRpHU0uLc9NxiQ73ixNzi0rx0 veT83E2MwADcduzn5h2MlzYGH2IU4GBU4uHNOPQkUog1say4MvcQowQHs5II765bTyOFeFMS K6tSi/Lji0pzUosPMUpzsCiJ8/buWR0pJJCeWJKanZpakFoEk2Xi4JRqYBSbt89wE2/v7p/q R9rOnlrZVL3rbOIeFye2rHCFC523Hpf0uKVL8t/oCNa4t149qmLtjWtWLF07Dut4vTuSrrLg c8FMLh7pjxtUDy3jv/xGafWEvPL3y2OcOo88OyZ/8IoOq/4b7WW7HR+eqsvpPLKVzXraQ4kG y9OGLv+TKv/eZBdxElmeX67EUpyRaKjFXFScCACLMt32PAIAAA== X-CMS-MailID: 20171017110813eucas1p19603112d8f9ff41a77c17203b46f5041 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-CMS-RootMailID: 20171017110813eucas1p19603112d8f9ff41a77c17203b46f5041 X-RootMTR: 20171017110813eucas1p19603112d8f9ff41a77c17203b46f5041 References: <20171017110752.25096-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Some hardware modules, like FIMC in Exynos4 series are shared between V4L2 (camera support) and DRM (memory-to-memory processing) subsystems. This patch provides a simple check to let such drivers to be used in the driver components framework. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 17 ++++++++++++++++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) -- 2.14.2 -- 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_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index cac0d84385d3..60ae6ae06eb2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -216,6 +216,7 @@ struct exynos_drm_driver_info { #define DRM_COMPONENT_DRIVER BIT(0) /* supports component framework */ #define DRM_VIRTUAL_DEVICE BIT(1) /* create virtual platform device */ #define DRM_DMA_DEVICE BIT(2) /* can be used for dma allocations */ +#define DRM_SHARED_DEVICE BIT(3) /* devices shared with V4L2 subsystem */ #define DRV_PTR(drv, cond) (IS_ENABLED(cond) ? &drv : NULL) @@ -267,6 +268,17 @@ static struct exynos_drm_driver_info exynos_drm_drivers[] = { } }; +int exynos_drm_check_shared_device(struct device *dev) +{ + /* + * Exynos DRM drivers handle only devices that support + * the LCD Writeback data path, rest is handled by V4L2 driver + */ + if (!of_property_read_bool(dev->of_node, "samsung,lcd-wb")) + return -ENODEV; + return 0; +} + static int compare_dev(struct device *dev, void *data) { return dev == (struct device *)data; @@ -288,7 +300,10 @@ static struct component_match *exynos_drm_match_add(struct device *dev) &info->driver->driver, (void *)platform_bus_type.match))) { put_device(p); - component_match_add(dev, &match, compare_dev, d); + + if (!(info->flags & DRM_SHARED_DEVICE) || + exynos_drm_check_shared_device(d) == 0) + component_match_add(dev, &match, compare_dev, d); p = d; } put_device(p); diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index b47f810d64d2..8b3b31d35168 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -275,6 +275,8 @@ static inline int exynos_dpi_bind(struct drm_device *dev, } #endif +int exynos_drm_check_shared_device(struct device *dev); + int exynos_atomic_commit(struct drm_device *dev, struct drm_atomic_state *state, bool nonblock); int exynos_atomic_check(struct drm_device *dev, struct drm_atomic_state *state);