From patchwork Mon Jan 9 11:55:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13093326 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 CA7D1C54EBD for ; Mon, 9 Jan 2023 11:57:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E408410E3F4; Mon, 9 Jan 2023 11:56:59 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id D04D910E3F4; Mon, 9 Jan 2023 11:56:57 +0000 (UTC) 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=7dSte2z1Mtl2v4PoQpzRSMquyCqk8sCGcS1bqRC+NmM=; b=IArct7bkaTCqF1aanZh1iKAr9D o0Ejbs1vdOEqIDGiqkPEXvKfiHOUkCrNhM4X2UjsHYwgEZx4Kgz4NzSIjbNZs6928IOQ87ZEk1ZtA qNjFhQkqIJ2HlbDqXQCdLspVbx9i3ufw3VxaOFhEZCwcAtZ/NLA/Boi2DWg/S2PpXzQtAjCCrMLF5 saSkbJvq03ieB+J/LWJdHIPyGUuBPvafT+NGZIABPJgY+JovVGUSC6Ndvuxu1Y3JPP7G6QKNjNiDU gw7rXVVbT9fMnsS82Z6T2vCbrpGikAElb6eq7vZTbnCnVAbr/kry7Gm1ljhApFD3Qs47Z7l2IhMy/ WsQgSXBw==; 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 1pEqlj-003LkJ-Bk; Mon, 09 Jan 2023 12:56:47 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: David Airlie , Daniel Vetter , Lucas Stach , Russell King , Christian Gmeiner , Emma Anholt , Alexey Brodkin , David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Tomi Valkeinen Subject: [PATCH v2 3/7] drm/arc: use new debugfs device-centered functions Date: Mon, 9 Jan 2023 08:55:17 -0300 Message-Id: <20230109115520.40088-4-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230109115520.40088-1-mcanal@igalia.com> References: <20230109115520.40088-1-mcanal@igalia.com> 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: =?utf-8?q?Andr=C3=A9_Almeida?= , Daniel Vetter , =?utf-8?q?Ma=C3=ADra_Canal?= , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Melissa Wen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Replace the use of drm_debugfs_create_files() with the new drm_debugfs_add_file() function, which centers 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 arcpgu_probe(), before drm_dev_register(). Reviewed-by: Daniel Vetter Signed-off-by: MaĆ­ra Canal Acked-by: Alexey Brodkin --- drivers/gpu/drm/tiny/arcpgu.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c index 611bbee15071..88ceaf8c869c 100644 --- a/drivers/gpu/drm/tiny/arcpgu.c +++ b/drivers/gpu/drm/tiny/arcpgu.c @@ -335,11 +335,10 @@ static int arcpgu_unload(struct drm_device *drm) return 0; } -#ifdef CONFIG_DEBUG_FS -static int arcpgu_show_pxlclock(struct seq_file *m, void *arg) +static int __maybe_unused arcpgu_show_pxlclock(struct seq_file *m, void *arg) { - struct drm_info_node *node = (struct drm_info_node *)m->private; - struct drm_device *drm = node->minor->dev; + struct drm_debugfs_entry *entry = m->private; + struct drm_device *drm = entry->dev; struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm); unsigned long clkrate = clk_get_rate(arcpgu->clk); unsigned long mode_clock = arcpgu->pipe.crtc.mode.crtc_clock * 1000; @@ -349,18 +348,6 @@ static int arcpgu_show_pxlclock(struct seq_file *m, void *arg) return 0; } -static struct drm_info_list arcpgu_debugfs_list[] = { - { "clocks", arcpgu_show_pxlclock, 0 }, -}; - -static void arcpgu_debugfs_init(struct drm_minor *minor) -{ - drm_debugfs_create_files(arcpgu_debugfs_list, - ARRAY_SIZE(arcpgu_debugfs_list), - minor->debugfs_root, minor); -} -#endif - static const struct drm_driver arcpgu_drm_driver = { .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, .name = "arcpgu", @@ -371,9 +358,6 @@ static const struct drm_driver arcpgu_drm_driver = { .patchlevel = 0, .fops = &arcpgu_drm_ops, DRM_GEM_DMA_DRIVER_OPS, -#ifdef CONFIG_DEBUG_FS - .debugfs_init = arcpgu_debugfs_init, -#endif }; static int arcpgu_probe(struct platform_device *pdev) @@ -390,6 +374,8 @@ static int arcpgu_probe(struct platform_device *pdev) if (ret) return ret; + drm_debugfs_add_file(&arcpgu->drm, "clocks", arcpgu_show_pxlclock, NULL); + ret = drm_dev_register(&arcpgu->drm, 0); if (ret) goto err_unload;