From patchwork Mon Oct 23 07:54:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 116650 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4357853qgn; Mon, 23 Oct 2017 00:55:05 -0700 (PDT) X-Google-Smtp-Source: ABhQp+T2GoYP6LDIs/vI5iYLjcXfn+IiHcTP3fjVmFlpVhqpdRmHgvDEDJj8ZZMiyRa8fuzdUy6G X-Received: by 10.99.109.77 with SMTP id i74mr11320615pgc.208.1508745305076; Mon, 23 Oct 2017 00:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508745305; cv=none; d=google.com; s=arc-20160816; b=xgSO5jaVcD51B9yT+qqhWIojCXWiRTXcg80eHnDAg8FrGtYFfg/JclHc7WGItm2Bfy HP2kS8T1hvFXjaj75m+clvMbyFlm99NJm52S09wAHdgZB4W7kjzmLxzngTkKFfSjShQ0 IHYtaakQKz4cqgnQNc0mZHcGVhOcKVB9wP4/OGlwUSlOEnao+H50UWQQMBbbI0C83vcR S0PVm68/rQ0JtcD0xIekMRwQbAZmPJMSPmM3OXo+CtRrOle/uRLFMqb/aeYY40yOcOgG 0G8NNNJ7REWV/pC2OK5gCSEDB+TAXmiX3JPLlEa8ilTbtVXXEZTZAQ7D/p6+761okEfa oghw== 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:dkim-signature:dkim-filter :arc-authentication-results; bh=aVx4/ayVTeGGWrnrVvWul/DHwwkL0supdvTTR/qYWgA=; b=Ni+9bjoYLueQQl9YhRI/Ba+xOHI1ac+NgmzVSXUlDtpzJg8NkOCw8hiwHUd5wqflu+ Y6LOaqLSKUV57b7YZgOCRQs+WO5y9xnQJc7gEdI0p/eE1ZlmYfv5U3h9uSFQE50c6rW1 uSRxgqrl5/QObVplF9WZN9519/3+W22SaHYPbHXoPtoPgJFJJiCo1dbZ1sk6mDSklH7a NIPVYUjoNhXadTRV3a6xm4wIOhYCanktdx4e0SvdMCcYN/8mAHJh+ImTkvjCIabo+lWv H+s8k0hxE8jMgww1mRaWuJKdNI13h4iqC9oBIhJaxS3kGwTtQ13VksxZoWZTouH+qVwG 5A1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=mTg5i9Vo; 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 r10si4527109pgq.332.2017.10.23.00.55.04; Mon, 23 Oct 2017 00:55:05 -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; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=mTg5i9Vo; 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 S1751326AbdJWHzD (ORCPT + 4 others); Mon, 23 Oct 2017 03:55:03 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:56831 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbdJWHyy (ORCPT ); Mon, 23 Oct 2017 03:54:54 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20171023075452euoutp01bf1dae69fd2f449b3b49d7dea6a0c5ee~wI9mRBKjs0794307943euoutp01S; Mon, 23 Oct 2017 07:54:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20171023075452euoutp01bf1dae69fd2f449b3b49d7dea6a0c5ee~wI9mRBKjs0794307943euoutp01S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1508745292; bh=yiD9AeGs+Qnm7Fni5OfBOGKn42Vx5GeVBYg6D4yURFM=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=mTg5i9Vo8ZlytaNk4RHJk+NyR2usTsLUhB0RqSp/GBbyIEVqzwuO1P2s1eTsQgH+w 5ogGsYks9cAot8dyJFaVR3J8oeagDBPVC0X1b6eFy+i/53id2sV3R1irALjVlidurd 2SxdjKVsTvAiPl2dP2x7IaTyKgiosdPSAKoh4UHQ= Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20171023075451eucas1p1a6ebd86d77eb2cef753c9d01b12f62ac~wI9llDZZ00572405724eucas1p1d; Mon, 23 Oct 2017 07:54:51 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 49.1A.12944.B40ADE95; Mon, 23 Oct 2017 08:54:51 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171023075450eucas1p24923c2a0793ac24364b97770dadd56e0~wI9k1dNRp2187021870eucas1p20; Mon, 23 Oct 2017 07:54:50 +0000 (GMT) X-AuditID: cbfec7f4-f79ab6d000003290-96-59eda04bcdcf Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 36.D3.18832.A40ADE95; Mon, 23 Oct 2017 08:54:50 +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 <0OY900M2KNB49IB0@eusync3.samsung.com>; Mon, 23 Oct 2017 08:54:50 +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 v4 5/9] drm/exynos: Add generic support for devices shared with V4L2 subsystem Date: Mon, 23 Oct 2017 09:54:24 +0200 Message-id: <20171023075428.7003-6-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.14.2 In-reply-to: <20171023075428.7003-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKIsWRmVeSWpSXmKPExsWy7djPc7reC95GGkxtV7C4te4cq8Wsl+0s FhtnrGe1uPL1PZvF++VdbBaT7k9gsTh/fgO7xYzz+5gs1h65y25x+E07q8WMyS/ZLNpWf2B1 4PHYtKqTzeN+93Emj3/H2D36tqxi9Pi8SS6ANYrLJiU1J7MstUjfLoEr4+sL4YInIhUPZn5i bmDcKNjFyMkhIWAisXrSPjYIW0ziwr31QDYXh5DAUkaJJzcmsUI4nxklphzZzQzTcegWTNUy RomVT+awQDgNTBKLF85jAqliEzCU6HrbBTZXRMBNounwTLBRzAK7mCVeTH7NDpIQFkiQmL9n FiOIzSKgKrH56DJWEJtXwEai9cFzVoh18hLvF9wHq+EUsJW4dH8nVHwNm8ThyXwQtotE46IW qLiwxKvjW9ghbBmJzo6DTBB2P6NEU6s2hD2DUeLcW14I21ri8PGLYL3MAnwSk7ZNB3qTAyjO K9HRJgRR4iHR+rEfaryjRMukc1DfT2CU+Ph4IfsERukFjAyrGEVSS4tz01OLTfSKE3OLS/PS 9ZLzczcxAiP79L/jX3YwLj5md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ZzUXEiAOXf0y48AgAA X-CMS-MailID: 20171023075450eucas1p24923c2a0793ac24364b97770dadd56e0 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171023075450eucas1p24923c2a0793ac24364b97770dadd56e0 X-RootMTR: 20171023075450eucas1p24923c2a0793ac24364b97770dadd56e0 References: <20171023075428.7003-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);