From patchwork Tue Sep 12 08:08:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 112246 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4862945qgf; Tue, 12 Sep 2017 01:09:26 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4lX+QuNHhv4NjwVLQNlxFtfF9AQnu7D6Sq67HawUr/xw+AoM2zKM6HwkmDf89jAPqBLL1n X-Received: by 10.99.109.13 with SMTP id i13mr14434442pgc.349.1505203766161; Tue, 12 Sep 2017 01:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505203766; cv=none; d=google.com; s=arc-20160816; b=rRJHxTaDD34lMGP7n6rz359xY7Zfy0pCMSKYk7AkP0e9056wElOTQmE4EDgvLLCG37 /AX6BkFJuN6VsAipMFJHfitiu/YeZPQAWuEVp3VqjzsxjGkuf1j4r1o/QhDIlaezc32C Sacaa/5FQeSzEJ7rcmvZMEE8kQ2YBEQJHSblTkMz4MnVFLpTGHvSrEfPtPyzaUBn6DX1 +5vebfpFPXnWJhsKvsTccMW4urGIfHDknPrQGxjOo3wQe4B6sBRh3TzvC9OhSsNcnz5F hl0fvfSWfsoT63FmCb50OGIwvAUVJPc26f7S7nr0F/ei94aBLdkpubWuhWsGolGW7VmT x+2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:cms-type:in-reply-to:message-id :date:subject:to:from:delivered-to:arc-authentication-results; bh=QVedMAEPpnswGf0hqewwIoW6j4jSdYx8si7IqbgGIR8=; b=LFbBIkfx8AFgnilnwDHN86L+bA5CgaPn7dVSn6uM2JKdRMMpTS1XQG5WyUXXU7X34Z +kJQiFJvWC5k19CtJpSnNLqmjWddJPbOmKr26yXXGKCz+XPNlTnuXpRzDJomQBKMhYcW 7HS5uL/2vM6SmXy6cM3PbR/ICfrC71BMFKRqzh5txcMGrzuR9J2sXqLEm42L1JEpi2WS 9C7l0x/7NWIy1qk3qam6hq2x4Q5m+TcepbHts89UM1SH5pRuZiWwCBLS8/H19VcshAfZ eX5w4cJhk9M5g9dgoEq3ndCXGNVxecEQX2IY3VLvNP5sJ3kIe9p1EJtJb1vJ4oNMwQOf +gbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id z14si7420029pgc.589.2017.09.12.01.09.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 01:09:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2632E89852; Tue, 12 Sep 2017 08:09:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id BEADB898C7 for ; Tue, 12 Sep 2017 08:09:15 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20170912080914euoutp01f9c1ca02b3b4d821d7ae0a1a21deb8f2~jjtbpWD7D1458314583euoutp01k; Tue, 12 Sep 2017 08:09:14 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170912080913eucas1p22a3798a12a77ab554c288b75323132fc~jjta0hAIh0567305673eucas1p2w; Tue, 12 Sep 2017 08:09:13 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3.samsung.com (EUCPMTA) with SMTP id A4.0C.12867.82697B95; Tue, 12 Sep 2017 09:09:13 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170912080912eucas1p1e71e4680f78288053ca47330cada3271~jjtaLchPI1364513645eucas1p1J; Tue, 12 Sep 2017 08:09:12 +0000 (GMT) X-AuditID: cbfec7f2-f793b6d000003243-ba-59b796289dea Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 37.3D.20118.82697B95; Tue, 12 Sep 2017 09:09:12 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OW500MV7QN2C7A0@eusync4.samsung.com>; Tue, 12 Sep 2017 09:09:12 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 5/6] drm/exynos: Add generic support for devices shared with V4L2 subsystem Date: Tue, 12 Sep 2017 10:08:57 +0200 Message-id: <1505203739-29747-6-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1505203739-29747-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNIsWRmVeSWpSXmKPExsWy7djPc7qa07ZHGsz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JI CJhInO65xQJhi0lcuLeerYuRi0NIYAmjRNvVV8wQThOTxKLGh+wgVWwChhJdb7vYQGwRATeJ psMzWUGKmAUeMUn07r8ENkpYIFZi+pVVQEUcHCwCqhJHv1eDmLwCHhIT9phBLJOTOHlsMiuI zSngKdHX85AZxBYCKjk0/yzbBEbeBYwMqxhFUkuLc9Nzi430ihNzi0vz0vWS83M3MQLDbdux n1t2MHa9Cz7EKMDBqMTDq9G9LVKINbGsuDL3EKMEB7OSCO+Pnu2RQrwpiZVVqUX58UWlOanF hxilOViUxHl796yOFBJITyxJzU5NLUgtgskycXBKNTCGP4xOWPzOofrNw5D5lRNOcy2Z+Gw5 96cXN7VzQirFNr/ezn97ZtL3pevO7ttwwlBgt5etapUk67Ml++3ZS6waDx+M3Mn/bJ11Q/ib zEtfAypZJ6zs0NSrnCn5ybdAIWfRz7+L0tdHZxo+vLosiCXJYBHb522O6Vyaf3+Ln9x14Ma1 V5OaOVmFlFiKMxINtZiLihMBIAlg3DMCAAA= X-CMS-MailID: 20170912080912eucas1p1e71e4680f78288053ca47330cada3271 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 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: 20170912080912eucas1p1e71e4680f78288053ca47330cada3271 X-RootMTR: 20170912080912eucas1p1e71e4680f78288053ca47330cada3271 References: <1505203739-29747-1-git-send-email-m.szyprowski@samsung.com> Cc: Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Krzysztof Kozlowski , Tobias Jakobi , Sylwester Nawrocki , Marek Szyprowski X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 27242af103ea..6b46d7aab0c6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -228,6 +228,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) @@ -279,6 +280,17 @@ struct exynos_drm_driver_info { } }; +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; @@ -300,7 +312,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 21f4271c012a..ac4ac73a6edb 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -274,6 +274,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);