From nobody Wed Sep 17 01:27:55 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11825C4332F for ; Mon, 26 Dec 2022 15:51:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232126AbiLZPvu (ORCPT ); Mon, 26 Dec 2022 10:51:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232117AbiLZPvp (ORCPT ); Mon, 26 Dec 2022 10:51:45 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C737326DD for ; Mon, 26 Dec 2022 07:51:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ovYu3O6J/03o6FRSeZBXYjTQnhI8+HeH3STrFxD4fqo=; b=q6Y2ynNG9Hqvk3GBR5TbozENdA tokY4kYGNRQTgj3V4qFoAAM0Ppk2hHnlSKALYuQ5z2Iro6G1Duy9yge28CQGvKOvrZeQaZ12v8THZ xgTLVC/7xEzYa1qJezouE+D1i0Z6FDi87WtRTBBf0q+ef7lMMm+VjnJ9vtMitt71c0uGaKo4fbfR9 7Cuuf+4vVqWjG1fcrS5Z0aCkpTyU1tHyeOvcy8kPJv1VPbz/STlgu1hNzAsiEWv+u/ZDxuP3JB9uC O7ZYeg72Q5ERXtbg+++geXfml80M+qLb0Z7O3dy0IqWet2W0WUyJzc7qzuX7zeH21QueeNP+5CmCH scFpab5g==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1p9plN-00AXBr-Hs; Mon, 26 Dec 2022 16:51:42 +0100 From: =?UTF-8?q?Ma=C3=ADra=20Canal?= To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Melissa Wen , =?UTF-8?q?Andr=C3=A9=20Almeida?= , Lucas Stach , Russell King , Christian Gmeiner , etnaviv@lists.freedesktop.org, noralf@tronnes.org, Liviu Dudau , Brian Starkey , Emma Anholt , Alexey Brodkin , David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Tomi Valkeinen , =?UTF-8?q?Ma=C3=ADra=20Canal?= Subject: [PATCH 1/9] drm/etnaviv: use new debugfs device-centered functions Date: Mon, 26 Dec 2022 12:50:21 -0300 Message-Id: <20221226155029.244355-2-mcanal@igalia.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221226155029.244355-1-mcanal@igalia.com> References: <20221226155029.244355-1-mcanal@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the use of drm_debugfs_create_files() with the new drm_debugfs_add_files() function, which center the debugfs files management on the drm_device instead of drm_minor. Moreover, remove the debugfs_init hook and add the debugfs files directly on etnaviv_bind(), before drm_dev_register(). Signed-off-by: Ma=C3=ADra Canal --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 29 +++++++++++---------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnavi= v/etnaviv_drv.c index 1d2b4fb4bcf8..2b265460672e 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -191,22 +191,22 @@ static int etnaviv_ring_show(struct etnaviv_gpu *gpu,= struct seq_file *m) =20 static int show_unlocked(struct seq_file *m, void *arg) { - struct drm_info_node *node =3D (struct drm_info_node *) m->private; - struct drm_device *dev =3D node->minor->dev; + struct drm_debugfs_entry *entry =3D m->private; + struct drm_device *dev =3D entry->dev; int (*show)(struct drm_device *dev, struct seq_file *m) =3D - node->info_ent->data; + entry->file.data; =20 return show(dev, m); } =20 static int show_each_gpu(struct seq_file *m, void *arg) { - struct drm_info_node *node =3D (struct drm_info_node *) m->private; - struct drm_device *dev =3D node->minor->dev; + struct drm_debugfs_entry *entry =3D m->private; + struct drm_device *dev =3D entry->dev; struct etnaviv_drm_private *priv =3D dev->dev_private; struct etnaviv_gpu *gpu; int (*show)(struct etnaviv_gpu *gpu, struct seq_file *m) =3D - node->info_ent->data; + entry->file.data; unsigned int i; int ret =3D 0; =20 @@ -223,20 +223,13 @@ static int show_each_gpu(struct seq_file *m, void *ar= g) return ret; } =20 -static struct drm_info_list etnaviv_debugfs_list[] =3D { +static struct drm_debugfs_info etnaviv_debugfs_list[] =3D { {"gpu", show_each_gpu, 0, etnaviv_gpu_debugfs}, {"gem", show_unlocked, 0, etnaviv_gem_show}, { "mm", show_unlocked, 0, etnaviv_mm_show }, {"mmu", show_each_gpu, 0, etnaviv_mmu_show}, {"ring", show_each_gpu, 0, etnaviv_ring_show}, }; - -static void etnaviv_debugfs_init(struct drm_minor *minor) -{ - drm_debugfs_create_files(etnaviv_debugfs_list, - ARRAY_SIZE(etnaviv_debugfs_list), - minor->debugfs_root, minor); -} #endif =20 /* @@ -478,9 +471,6 @@ static const struct drm_driver etnaviv_drm_driver =3D { .prime_fd_to_handle =3D drm_gem_prime_fd_to_handle, .gem_prime_import_sg_table =3D etnaviv_gem_prime_import_sg_table, .gem_prime_mmap =3D drm_gem_prime_mmap, -#ifdef CONFIG_DEBUG_FS - .debugfs_init =3D etnaviv_debugfs_init, -#endif .ioctls =3D etnaviv_ioctls, .num_ioctls =3D DRM_ETNAVIV_NUM_IOCTLS, .fops =3D &fops, @@ -534,6 +524,11 @@ static int etnaviv_bind(struct device *dev) =20 load_gpu(drm); =20 +#ifdef CONFIG_DEBUG_FS + drm_debugfs_add_files(drm, etnaviv_debugfs_list, + ARRAY_SIZE(etnaviv_debugfs_list)); +#endif + ret =3D drm_dev_register(drm, 0); if (ret) goto out_unbind; --=20 2.38.1