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: 9689927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A713D600C8 for ; Thu, 20 Apr 2017 09:14:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B21828459 for ; Thu, 20 Apr 2017 09:14:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FF4228464; Thu, 20 Apr 2017 09:14:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10C8228459 for ; Thu, 20 Apr 2017 09:14:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S943757AbdDTJOS (ORCPT ); Thu, 20 Apr 2017 05:14:18 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:53524 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S943131AbdDTJOL (ORCPT ); Thu, 20 Apr 2017 05:14:11 -0400 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 linux-samsung-soc@vger.kernel.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 Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Andrzej Hajda , Bartlomiej Zolnierkiewicz , Tobias Jakobi , Rob Clark , Daniel Vetter 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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OKZBnZIAGHJwD3IOV9O0S3DIe3MkomC1e0bP7AlsD4yXhLkZODgkBE4lN 29cxQdhiEhfurWfrYuTiEBJYwijx4/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?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170420091406eucas1p2ba4648e8e70ecca9c472017c21d654e1 X-RootMTR: 20170420091406eucas1p2ba4648e8e70ecca9c472017c21d654e1 References: <1492679620-12792-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 X-Virus-Scanned: ClamAV using ClamSMTP 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);