From patchwork Thu Apr 20 09:13:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 97726 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp629042obc; Thu, 20 Apr 2017 02:14:15 -0700 (PDT) X-Received: by 10.99.99.2 with SMTP id x2mr6911294pgb.46.1492679655514; Thu, 20 Apr 2017 02:14:15 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id p26si5755192pfl.391.2017.04.20.02.14.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Apr 2017 02:14:15 -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 95F7A6E358; Thu, 20 Apr 2017 09:14:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.w1.samsung.com (mailout4.w1.samsung.com [210.118.77.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0FD3E6E35A for ; Thu, 20 Apr 2017 09:14:10 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OOP00MOXAZK6A20@mailout4.w1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 20 Apr 2017 10:14:08 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170420091407eucas1p21f8d633a7e8a6fe58e85be92e4888095~3EDseMfWa1334513345eucas1p2S; Thu, 20 Apr 2017 09:14:07 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 14.02.04459.FDB78F85; Thu, 20 Apr 2017 10:14:07 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170420091406eucas1p2ba4648e8e70ecca9c472017c21d654e1~3EDryrtsW1181311813eucas1p2i; Thu, 20 Apr 2017 09:14:06 +0000 (GMT) X-AuditID: cbfec7f1-f796e6d00000116b-cf-58f87bdfff8f Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 8C.3B.20206.7FB78F85; Thu, 20 Apr 2017 10:14:31 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OOP00DTXAZACLB0@eusync2.samsung.com>; Thu, 20 Apr 2017 10:14:06 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [RFC 1/4] drm: Export functions to create custom DRM objects Date: Thu, 20 Apr 2017 11:13:37 +0200 Message-id: <1492679620-12792-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1492679620-12792-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsWy7djP87r3q39EGLStFra4te4cq8XGGetZ Lf5vm8hsceXrezaLSfcnsFjMOL+PyWLtkbvsFs8X/mC2mDH5JZtF2+oPrA5cHnu/LWDx2Dnr LrvH/e7jTB7/jrF79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EhfurWfrYuTiEBJYwijx4/NPKKeJSeLxxv/MIFVsAoYSXW+72EBsEQE3iabDM1lB bGaBc0wS9xb7djFycAgLuEps3pIAEmYRUJU43/aOHcTmFfCQ+LL5GDPEMjmJk8cmg7VyCnhK HD67GOwIIaCa7punmCYw8i5gZFjFKJJaWpybnltspFecmFtcmpeul5yfu4kRGO7bjv3csoOx 613wIUYBDkYlHt4NGd8jhFgTy4orcw8xSnAwK4nwKpb/iBDiTUmsrEotyo8vKs1JLT7EaAp0 1ERmKdHkfGAs5pXEG5oYmlsaGhlbWJgbGSmJ8079cCVcSCA9sSQ1OzW1ILUIpo+Jg1OqgfFi 8CuXlw/7GiYw9hzepvbqxKL49UfsucJiFq/69MbVyLRK7VvLslBLPueGQ78mXcjwmSX5QOrB 81dZVUeKHbasPF2hOun0pjCvuPqXUvu1ajbOnMcgciZChK15dWLz3GhtL7dgkSkvnDsmKWd1 zyifYnN2zeTVFzjin5SEhs7Vri+aPvn6C08lluKMREMt5qLiRAAntQ7LjQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170420091406eucas1p2ba4648e8e70ecca9c472017c21d654e1 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-HopCount: 7 X-CMS-RootMailID: 20170420091406eucas1p2ba4648e8e70ecca9c472017c21d654e1 X-RootMTR: 20170420091406eucas1p2ba4648e8e70ecca9c472017c21d654e1 References: <1492679620-12792-1-git-send-email-m.szyprowski@samsung.com> Cc: Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Tobias Jakobi , 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" Make drm_mode_object_add() and drm_mode_object_unregister() functions public, so the drivers can register their own DRM objects to the core. Those objects can be queried by generic DRM_IOCTL_MODE_OBJ_GETPROPERTIES ioctl. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/drm_crtc_internal.h | 4 ---- drivers/gpu/drm/drm_mode_object.c | 2 ++ include/drm/drm_mode_object.h | 6 ++++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h index d077c5490041..160d489f7240 100644 --- a/drivers/gpu/drm/drm_crtc_internal.h +++ b/drivers/gpu/drm/drm_crtc_internal.h @@ -101,14 +101,10 @@ int drm_mode_destroyblob_ioctl(struct drm_device *dev, int __drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj, uint32_t obj_type, bool register_obj, void (*obj_free_cb)(struct kref *kref)); -int drm_mode_object_add(struct drm_device *dev, struct drm_mode_object *obj, - uint32_t obj_type); void drm_mode_object_register(struct drm_device *dev, struct drm_mode_object *obj); struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev, uint32_t id, uint32_t type); -void drm_mode_object_unregister(struct drm_device *dev, - struct drm_mode_object *object); int drm_mode_object_get_properties(struct drm_mode_object *obj, bool atomic, uint32_t __user *prop_ptr, uint64_t __user *prop_values, diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c index da9a9adbcc98..052dcabe26af 100644 --- a/drivers/gpu/drm/drm_mode_object.c +++ b/drivers/gpu/drm/drm_mode_object.c @@ -73,6 +73,7 @@ int drm_mode_object_add(struct drm_device *dev, { return __drm_mode_object_add(dev, obj, obj_type, true, NULL); } +EXPORT_SYMBOL(drm_mode_object_add); void drm_mode_object_register(struct drm_device *dev, struct drm_mode_object *obj) @@ -103,6 +104,7 @@ void drm_mode_object_unregister(struct drm_device *dev, } mutex_unlock(&dev->mode_config.idr_mutex); } +EXPORT_SYMBOL(drm_mode_object_unregister); struct drm_mode_object *__drm_mode_object_find(struct drm_device *dev, uint32_t id, uint32_t type) diff --git a/include/drm/drm_mode_object.h b/include/drm/drm_mode_object.h index a767b4a30a6d..f91aee0a1705 100644 --- a/include/drm/drm_mode_object.h +++ b/include/drm/drm_mode_object.h @@ -112,6 +112,12 @@ struct drm_object_properties { return "(unknown)"; \ } +int drm_mode_object_add(struct drm_device *dev, + struct drm_mode_object *obj, uint32_t obj_type); + +void drm_mode_object_unregister(struct drm_device *dev, + struct drm_mode_object *object); + struct drm_mode_object *drm_mode_object_find(struct drm_device *dev, uint32_t id, uint32_t type); void drm_mode_object_get(struct drm_mode_object *obj); From patchwork Thu Apr 20 09:13:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 97728 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp629079obc; Thu, 20 Apr 2017 02:14:20 -0700 (PDT) X-Received: by 10.99.119.195 with SMTP id s186mr7049229pgc.179.1492679660902; Thu, 20 Apr 2017 02:14:20 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id i194si5755117pgd.257.2017.04.20.02.14.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Apr 2017 02:14:20 -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 A43D06E366; Thu, 20 Apr 2017 09:14:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.w1.samsung.com (mailout4.w1.samsung.com [210.118.77.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 520636E35C for ; Thu, 20 Apr 2017 09:14:11 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OOP00NI2AZK3920@mailout4.w1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 20 Apr 2017 10:14:08 +0100 (BST) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170420091407eucas1p12dea025d96097894d93b5d58af306155~3EDs0qven0631506315eucas1p13; Thu, 20 Apr 2017 09:14:07 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id C4.02.04459.FDB78F85; Thu, 20 Apr 2017 10:14:07 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170420091407eucas1p2da1e16aa00e6d0bf8bd305422c3a9ba9~3EDsKcpYL1335313353eucas1p2V; Thu, 20 Apr 2017 09:14:07 +0000 (GMT) X-AuditID: cbfec7f1-f796e6d00000116b-d1-58f87bdf8c2e Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0E.69.17452.16C78F85; Thu, 20 Apr 2017 10:16:17 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OOP00DTXAZACLB0@eusync2.samsung.com>; Thu, 20 Apr 2017 10:14:07 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [RFC 2/4] drm: Add support for vendor specific DRM objects with custom properties Date: Thu, 20 Apr 2017 11:13:38 +0200 Message-id: <1492679620-12792-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1492679620-12792-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDIsWRmVeSWpSXmKPExsWy7djP87r3q39EGHw9q2Vxa905VouNM9az WvzfNpHZ4srX92wWk+5PYLGYcX4fk8XaI3fZLZ4v/MFsMWPySzaLttUfWB24PPZ+W8DisXPW XXaP+93HmTz+HWP36NuyitHj8ya5ALYoLpuU1JzMstQifbsEroyNH9+wFzyUqfhx7T5jA+MT 8S5GTg4JAROJS43tTBC2mMSFe+vZuhi5OIQEljJKvG+eDeV8ZpR4uuszK0zHzD3tjBCJZYwS 137/ZYJwGpgkVt5YDVbFJmAo0fW2iw3EFhFwk2g6PJMVpIhZ4AyTxJ7f3WALhQViJI71PWIH sVkEVCXunl8OFucV8JCYvX4pG8Q6OYmTxyaDDeUU8JQ4fHYx2DYJgW52ic0rTgIVcQA5shKb DjBD1LtI7H74hRHCFpZ4dXwLO4QtI9HZcRDq0X5GiaZWbQh7BqPEube8ELa1xOHjF8F2MQvw SUzaNp0ZYjyvREebEESJh8S7F6uhxjtK7Lw5G2ykkMAcRondv8UnMMosYGRYxSiSWlqcm55a bKRXnJhbXJqXrpecn7uJERjnp/8d/7iD8f0Jq0OMAhyMSjy8EWnfI4RYE8uKK3MPMUpwMCuJ 8CqW/4gQ4k1JrKxKLcqPLyrNSS0+xCjNwaIkzst16lqEkEB6Yklqdmp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OlRmOAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170420091407eucas1p2da1e16aa00e6d0bf8bd305422c3a9ba9 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-HopCount: 7 X-CMS-RootMailID: 20170420091407eucas1p2da1e16aa00e6d0bf8bd305422c3a9ba9 X-RootMTR: 20170420091407eucas1p2da1e16aa00e6d0bf8bd305422c3a9ba9 References: <1492679620-12792-1-git-send-email-m.szyprowski@samsung.com> Cc: Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Tobias Jakobi , 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" Add a DRM_MODE_PROP_VENDOR flag, which allows to create DRM properties for vendor, custom DRM objects. This allows to create OBJECT type properties, which were reserved only for ATOMIC mode sets. This flag is also checked in drm_object_property_get_value() function to let userspace to get default value for such properties instead of calling the atomic path. This change, together with ability of registering custom DRM objects from the device drivers allows exposing some driver specific entities as DRM objects, which can be then queried with standard DRM_IOCTL_MODE_OBJ_GETPROPERTIES and DRM_IOCTL_MODE_GETPROPERTY ioctls. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/drm_mode_object.c | 9 +++++---- drivers/gpu/drm/drm_property.c | 2 +- include/drm/drm_property.h | 7 +++++++ include/uapi/drm/drm_mode.h | 1 + 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c index 052dcabe26af..3cbefc1a7f4c 100644 --- a/drivers/gpu/drm/drm_mode_object.c +++ b/drivers/gpu/drm/drm_mode_object.c @@ -268,12 +268,13 @@ int drm_object_property_get_value(struct drm_mode_object *obj, { int i; - /* read-only properties bypass atomic mechanism and still store - * their value in obj->properties->values[].. mostly to avoid - * having to deal w/ EDID and similar props in atomic paths: + /* custom vendor or read-only properties bypass atomic mechanism + * and still store their value in obj->properties->values[].. mostly + * to avoid having to deal w/ EDID and similar props in atomic paths: */ if (drm_drv_uses_atomic_modeset(property->dev) && - !(property->flags & DRM_MODE_PROP_IMMUTABLE)) + !(property->flags & + (DRM_MODE_PROP_IMMUTABLE | DRM_MODE_PROP_VENDOR))) return drm_atomic_get_property(obj, property, val); for (i = 0; i < obj->properties->count; i++) { diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c index 3e88fa24eab3..a3fd496665de 100644 --- a/drivers/gpu/drm/drm_property.c +++ b/drivers/gpu/drm/drm_property.c @@ -318,7 +318,7 @@ struct drm_property *drm_property_create_object(struct drm_device *dev, flags |= DRM_MODE_PROP_OBJECT; - if (WARN_ON(!(flags & DRM_MODE_PROP_ATOMIC))) + if (WARN_ON(!(flags & (DRM_MODE_PROP_ATOMIC | DRM_MODE_PROP_VENDOR)))) return NULL; property = drm_property_create(dev, flags, name, 1); diff --git a/include/drm/drm_property.h b/include/drm/drm_property.h index 13e8c17d1c79..d9a3d6450ffe 100644 --- a/include/drm/drm_property.h +++ b/include/drm/drm_property.h @@ -152,6 +152,13 @@ struct drm_property { * properties. This is generally used to expose probe state to * usersapce, e.g. the EDID, or the connector path property on DP * MST sinks. + * + * DRM_MODE_PROP_VENDOR + * Set for vendor specific properties, for non-modeset vendor + * specific objects, which can be accessed by + * DRM_IOCTL_MODE_GETPROPERTY and DRM_IOCTL_MODE_OBJ_GETPROPERTIES, + * properties are not exposed to legacy userspace. + * */ uint32_t flags; diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 8c67fc03d53d..2100afc1328a 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -322,6 +322,7 @@ struct drm_mode_get_connector { * witout being aware that this could be triggering a lengthy modeset. */ #define DRM_MODE_PROP_ATOMIC 0x80000000 +#define DRM_MODE_PROP_VENDOR 0x40000000 struct drm_mode_property_enum { __u64 value;