From patchwork Fri Jul 14 10:46:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Ser X-Patchwork-Id: 13313470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79037EB64DC for ; Fri, 14 Jul 2023 10:46:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1115C10E86C; Fri, 14 Jul 2023 10:46:19 +0000 (UTC) Received: from mail-4317.proton.ch (mail-4317.proton.ch [185.70.43.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 872E710E86E for ; Fri, 14 Jul 2023 10:46:16 +0000 (UTC) Date: Fri, 14 Jul 2023 10:46:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail; t=1689331573; x=1689590773; bh=U0CfyV7Bh7oJ5xaa/saFWtrA0Pz5NAcT4Y6W8/mn8hQ=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=odbn76IJyiVQ5By+eUEjMDaO/zBoO09PEUpb/8FOAaIttsK3HWXhf+jiEEK1t9Lho MAcYUPT84Cv7BWDKV39nkJFgPAEsLRmw/ug1GzJCycIEIpA8L2lw80tq8FlKmKCGWy zPW+CJO1g43IN9mQnBV9wBraYvtkR+viQr3i+arU5Dpm3mDQG4as+NiF8H95VJ5t2e I6av2FCuWn/AzniLRc3r82jyKS5KrdiOImOCRZqxn90a9WYJOXaOeiFNmc7KDvYcx5 yE2Bt6n2IKmt2p0wSFNXanM8yYlWAUvhhhd+nYIu0ChsUtwDXB72sM06gQXP+JNnrN /H3Z7NXYpCqbA== To: dri-devel@lists.freedesktop.org From: Simon Ser Subject: [PATCH 1/3] drm/drv: use enum drm_minor_type when appropriate Message-ID: <20230714104557.518457-1-contact@emersion.fr> Feedback-ID: 1358184:user:proton MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , =?utf-8?b?TWFyZWsgT2zFocOhaw==?= , James Zhu , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This makes it easier to figure out what the "type" variable can be set to when reading the implementation of these functions. Signed-off-by: Simon Ser Cc: Christian König Cc: James Zhu Cc: Marek Olšák Cc: Daniel Vetter Reviewed-by:JamesZhufortheseries.Best Regards! James Zhu --- drivers/gpu/drm/drm_drv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 12687dd9e1ac..3eda026ffac6 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -84,7 +84,7 @@ DEFINE_STATIC_SRCU(drm_unplug_srcu); */ static struct drm_minor **drm_minor_get_slot(struct drm_device *dev, - unsigned int type) + enum drm_minor_type type) { switch (type) { case DRM_MINOR_PRIMARY: @@ -116,7 +116,7 @@ static void drm_minor_alloc_release(struct drm_device *dev, void *data) } } -static int drm_minor_alloc(struct drm_device *dev, unsigned int type) +static int drm_minor_alloc(struct drm_device *dev, enum drm_minor_type type) { struct drm_minor *minor; unsigned long flags; @@ -160,7 +160,7 @@ static int drm_minor_alloc(struct drm_device *dev, unsigned int type) return 0; } -static int drm_minor_register(struct drm_device *dev, unsigned int type) +static int drm_minor_register(struct drm_device *dev, enum drm_minor_type type) { struct drm_minor *minor; unsigned long flags; @@ -203,7 +203,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type) return ret; } -static void drm_minor_unregister(struct drm_device *dev, unsigned int type) +static void drm_minor_unregister(struct drm_device *dev, enum drm_minor_type type) { struct drm_minor *minor; unsigned long flags; From patchwork Fri Jul 14 10:46:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Ser X-Patchwork-Id: 13313468 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D9AB1EB64DA for ; Fri, 14 Jul 2023 10:46:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C101D10E08E; Fri, 14 Jul 2023 10:46:10 +0000 (UTC) Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) by gabe.freedesktop.org (Postfix) with ESMTPS id 76C9D10E08E for ; Fri, 14 Jul 2023 10:46:09 +0000 (UTC) Date: Fri, 14 Jul 2023 10:46:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail; t=1689331566; x=1689590766; bh=DY6x2Fh4B/JVNyCv47E1PVT/qIbnNcx2Fez2vh2dzN0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=dyBGoTrp7bR/f5YPyCKPsvuPs21/a/w7KSasRgnDTHwhDkZtcA63iXXyo3tOJtoPv BYnjicyHi2HjcAVIuZi3ue4q1u5mVUMAKhmJ9/NydvwtE8eEFcCJgnPFqCU4X2ppgx ArXnj+5Q85PBB8RFrR1T9cB6Y0jlsLk+AiEKSyrCmPPlCgolc8uOS2xImYZP5fprIJ UykByOLofJ5DHJoH0kWIyznBfOsEdnU7pD+27gtrOSzEMDWTxqzNg67ZEgs7jFhNS8 MqGqyEPaMwpDdHExMoPZb6zWyGm+SrYFHNphMZ1c0t+H0fqwd9wOY7EP9vjRTU1H1Q U18OOgZrg9HXQ== To: dri-devel@lists.freedesktop.org From: Simon Ser Subject: [PATCH 2/3] drm/file: use explicit values for enum drm_minor_type Message-ID: <20230714104557.518457-2-contact@emersion.fr> In-Reply-To: <20230714104557.518457-1-contact@emersion.fr> References: <20230714104557.518457-1-contact@emersion.fr> Feedback-ID: 1358184:user:proton MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , =?utf-8?b?TWFyZWsgT2zFocOhaw==?= , James Zhu , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This makes it clearer that the values cannot be changed because they are ABI. Signed-off-by: Simon Ser Cc: Christian König Cc: James Zhu Cc: Marek Olšák Cc: Daniel Vetter --- include/drm/drm_file.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index 966912053cb0..010239392adf 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -50,16 +50,16 @@ struct file; * header include loops we need it here for now. */ -/* Note that the order of this enum is ABI (it determines +/* Note that the values of this enum are ABI (it determines * /dev/dri/renderD* numbers). * * Setting DRM_MINOR_ACCEL to 32 gives enough space for more drm minors to * be implemented before we hit any future */ enum drm_minor_type { - DRM_MINOR_PRIMARY, - DRM_MINOR_CONTROL, - DRM_MINOR_RENDER, + DRM_MINOR_PRIMARY = 0, + DRM_MINOR_CONTROL = 1, + DRM_MINOR_RENDER = 2, DRM_MINOR_ACCEL = 32, }; From patchwork Fri Jul 14 10:46:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Ser X-Patchwork-Id: 13313469 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52CFEC001DD for ; Fri, 14 Jul 2023 10:46:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9420010E86B; Fri, 14 Jul 2023 10:46:15 +0000 (UTC) Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) by gabe.freedesktop.org (Postfix) with ESMTPS id 82F0210E86B for ; Fri, 14 Jul 2023 10:46:11 +0000 (UTC) Date: Fri, 14 Jul 2023 10:46:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail; t=1689331569; x=1689590769; bh=F88L1jddDY0lJbDr0j8tOCNblklIgEUw4HUYT/cLCZY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Jw3e7fhIBpB0TFm64KbXc8dQjpiKyBEc2iv2vaKA9t+OeiWZguZ44IE8vVAMr0nCB N5renVnXw8Cj4YDzyrc9EZx0JRuMS1qMgNKXZcMXDBr91blFDvS0AE7JRdxQQBlGP/ WuKGquhsbtu52hENlkGxUA6PChxGlXAdPwUjuxFUuEepCDtLgS5JWtQlj3MfqXFOaP BUmHoECgD6RuGJgFHvWkJ54Y61l8uCy689qb2oN+8M5QuxhX31C4gPOwTHwdzGgchH lq2wZiLm7uQx2EjIhAm0AOKKRNSWMnf735ntQ53i6MaGxwL7SYkiWOobMWS4KUxZu1 AmnPGvakgRwnA== To: dri-devel@lists.freedesktop.org From: Simon Ser Subject: [RFC PATCH 3/3] drm/file: drop DRM_MINOR_CONTROL Message-ID: <20230714104557.518457-3-contact@emersion.fr> In-Reply-To: <20230714104557.518457-1-contact@emersion.fr> References: <20230714104557.518457-1-contact@emersion.fr> Feedback-ID: 1358184:user:proton MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , =?utf-8?b?TWFyZWsgT2zFocOhaw==?= , James Zhu , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This entry should never be used by the kernel. Record the historical context in a comment. Signed-off-by: Simon Ser Cc: Christian König Cc: James Zhu Cc: Marek Olšák Cc: Daniel Vetter Reviewed-by: Thomas Zimmermann --- include/drm/drm_file.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index 010239392adf..a23cc2f6163f 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -53,12 +53,14 @@ struct file; /* Note that the values of this enum are ABI (it determines * /dev/dri/renderD* numbers). * + * There used to be a DRM_MINOR_CONTROL = 1 entry, but such nodes were never + * exposed. Still, some user-space has logic to handle them. + * * Setting DRM_MINOR_ACCEL to 32 gives enough space for more drm minors to * be implemented before we hit any future */ enum drm_minor_type { DRM_MINOR_PRIMARY = 0, - DRM_MINOR_CONTROL = 1, DRM_MINOR_RENDER = 2, DRM_MINOR_ACCEL = 32, };