From patchwork Fri Sep 29 07:32:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 114497 Delivered-To: patch@linaro.org Received: by 10.140.104.133 with SMTP id a5csp485839qgf; Fri, 29 Sep 2017 00:33:10 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAw6Yl0UkOYn9atdH+cU2g/qVDqpaCyZiNL4dpjvqgeRM+FE5CmnwGkLrXNCz8zakPfF+b2 X-Received: by 10.98.144.155 with SMTP id q27mr6589923pfk.275.1506670390715; Fri, 29 Sep 2017 00:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506670390; cv=none; d=google.com; s=arc-20160816; b=P+kw3G9gXNPriBMuppHEzaaYIf0bz56yI3sFRkAtxdrgEs6tHI7PRQa+7lvzLaUo5L 0AGbRBLeEXNow01ZzSfBi86LMp+bsofhha6tvLhxKRJCYol2dR2UgsfVSvMZF1NDeX3W dpSassXhLhRmPqawid24FDHJJK3mgHQRIIEtr3Q7FaLMnSTpjxl/Iml49L+pI9UEGS3C pDBhWmbbnpoLsa7a/LLgR1VlWWJ2PE+v31zyft4G0oQ1Ri0b+rlJDG62S2r0Nfrr+6pT yutGuBPqQLRM/zENZOF0J9cPMwGZwI9Tc5b6ERvWsmIeAB4chtkogMSWDGiNmrdOwu60 u0sA== 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=6buab8UcTls0zfMypS1eX4wH/p/9qlWqhr/oLDAVkpk=; b=TLZMWvMJT0/tNdZiB4HOFYDjcu2wOVB9NzuBKnHD9fFEihMKz2fewekcrYwjc1cqYf O89SU1aKCVEjGxd4nGGMlTa0AlUVyUZLFgcHl/3s5S+8/hlroYM46Id1ak02FB3ub7Lt Vdtf+zf0uWShJ3iTJzTkFcf8kX9Lz2z8v2NA9//XPs6pa0JRTIVsZbLvx7jvW84LRXWb ZUdBAlAXH4lvyFLv7bgZMvDcGW74YzRMku714oOd8sVh7ItR1NkPCVEOd2q8GmoMPdJ+ wxMK2GrfRkihoUTsMPGiQhhfMpJHb4G5TAst4hm3ma1+mf1XWYIbSVQxh8psYPmg+O7B 0Lmw== 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 x9si2960069pfe.236.2017.09.29.00.33.10; Fri, 29 Sep 2017 00:33:10 -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 S1751436AbdI2HdJ (ORCPT + 4 others); Fri, 29 Sep 2017 03:33:09 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:50811 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbdI2HdG (ORCPT ); Fri, 29 Sep 2017 03:33:06 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20170929073304euoutp02a11b48bef41a8d6587b7872629f06991~oxLtey4va2418524185euoutp02K; Fri, 29 Sep 2017 07:33:04 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170929073303eucas1p2de8e8f2e78baa40db83348990744976d~oxLsv1o4E1261412614eucas1p25; Fri, 29 Sep 2017 07:33:03 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id AA.CF.12907.F27FDC95; Fri, 29 Sep 2017 08:33:03 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170929073302eucas1p267023e6a8d0fe3b1d62d3be2f43ba6f0~oxLsFd1Un2361623616eucas1p25; Fri, 29 Sep 2017 07:33:02 +0000 (GMT) X-AuditID: cbfec7f1-f793a6d00000326b-b8-59cdf72f59b6 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id ED.7F.18832.E27FDC95; Fri, 29 Sep 2017 08:33:02 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OX1004HN6AWR260@eusync1.samsung.com>; Fri, 29 Sep 2017 08:33:02 +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 Subject: [PATCH v2 5/9] drm/exynos: Add generic support for devices shared with V4L2 subsystem Date: Fri, 29 Sep 2017 09:32:50 +0200 Message-id: <1506670374-15689-6-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1506670374-15689-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrIIsWRmVeSWpSXmKPExsWy7djP87r6389GGuzcLWxxa905VotZL9tZ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GLSVy4t56ti5GLQ0hgCaPE36YPTBBOE5NE94PnzCBVbAKGEl1vu9hA bBEBN4mmwzNZQYqYBSYzS6xf+RWsSFggQeLox9OsIDaLgKrEot1PwRp4BTwk2rb3MUGsk5M4 eWwyWA2ngKfEtd6lYGcIAdX8uv6FeQIj7wJGhlWMIqmlxbnpucWGesWJucWleel6yfm5mxiB wbft2M/NOxgvbQw+xCjAwajEw3tD7mykEGtiWXFl7iFGCQ5mJRHe+d+AQrwpiZVVqUX58UWl OanFhxilOViUxHl796yOFBJITyxJzU5NLUgtgskycXBKNTC2Rgm+WbWhuGhvbGbHvb7ohq+O z7cKfX010+7+0qNlcucntH/zYnJcOrM4/d+EVfvuNqzeK1Cc0O32erFJOn+c62Fz5WbXe7Xy ReyWYZNiov+uuzKbx9nFPutc0GLWfMMtRpv16jdNivd2z6j+o2qnJBM84+yno23LnOz7z1t+ P6u0W+kdf5ISS3FGoqEWc1FxIgC9vHyXOgIAAA== X-CMS-MailID: 20170929073302eucas1p267023e6a8d0fe3b1d62d3be2f43ba6f0 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: 20170929073302eucas1p267023e6a8d0fe3b1d62d3be2f43ba6f0 X-RootMTR: 20170929073302eucas1p267023e6a8d0fe3b1d62d3be2f43ba6f0 References: <1506670374-15689-1-git-send-email-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(-) -- 1.9.1 -- 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 @@ 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; @@ -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);