From patchwork Wed Jan 11 17:37:46 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: 13097063 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 CD871C5479D for ; Wed, 11 Jan 2023 17:39:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F229910E7BD; Wed, 11 Jan 2023 17:39:26 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 545D710E7B9 for ; Wed, 11 Jan 2023 17:39:21 +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=oi+V6e0DSIlcwpc457pwLqM6HXb1h4o60/pcYsijnfI=; b=U7TgwudrGtcub6TPmNlgXFDFzf PHQy1W/FLEXJOZF6hCsHCeNJzd5gLsK0uNrjkMN0GA50NX4t6doLxiJqSB9Om1DJkPg/aHL/2wZii RhlzifQRVCUM5VkhzPDPzZbBLzT7ShVkT3kJFUqcozb9NeHW0c9FWHHegKdiW0bJD3Ynm9YPvbRPa JY7DUwDKcK0pfJixZPGaCwXNUWeJxJgz1x+4MIQb2RJD6BTuSbesurMbM1IIOFlGa9LgFSmL0xRJ4 tuQvAA4sNs8ngEmvofI94ZQS9rOrOTGif/4eq4zNMo9+uUtI7ECQIR3URh028QyXshZUuLeW2hlAS 0bUOs8TQ==; 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 1pFf4C-005Sku-MS; Wed, 11 Jan 2023 18:39:13 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Jani Nikula , Alain Volmat Subject: [PATCH 11/13] drm/sti: Use the encoders' debugfs infrastructure Date: Wed, 11 Jan 2023 14:37:46 -0300 Message-Id: <20230111173748.752659-12-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111173748.752659-1-mcanal@igalia.com> References: <20230111173748.752659-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: Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , =?utf-8?q?Andr=C3=A9_Alme?= =?utf-8?q?ida?= , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Replace the use of drm_debugfs_add_files() with the new drm_debugfs_encoder_add_files() function, which centers the debugfs files management on the drm_encoder instead of drm_device. Using this function on late register callbacks is more adequate as the callback passes a drm_encoder as parameter. Signed-off-by: MaĆ­ra Canal --- drivers/gpu/drm/sti/sti_tvout.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c index 2499715a69b7..5601888caec4 100644 --- a/drivers/gpu/drm/sti/sti_tvout.c +++ b/drivers/gpu/drm/sti/sti_tvout.c @@ -496,8 +496,8 @@ static void tvout_dbg_hd_dac_cfg(struct seq_file *s, int val) static int tvout_dbg_show(struct seq_file *s, void *data) { - struct drm_info_node *node = s->private; - struct sti_tvout *tvout = (struct sti_tvout *)node->info_ent->data; + struct drm_debugfs_encoder_entry *entry = s->private; + struct sti_tvout *tvout = (struct sti_tvout *)entry->file.data; struct drm_crtc *crtc; seq_printf(s, "TVOUT: (vaddr = 0x%p)", tvout->regs); @@ -566,20 +566,9 @@ static int tvout_dbg_show(struct seq_file *s, void *data) return 0; } -static struct drm_info_list tvout_debugfs_files[] = { - { "tvout", tvout_dbg_show, 0, NULL }, -}; - -static void tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor) +static void tvout_debugfs_init(struct sti_tvout *tvout, struct drm_encoder *encoder) { - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(tvout_debugfs_files); i++) - tvout_debugfs_files[i].data = tvout; - - drm_debugfs_create_files(tvout_debugfs_files, - ARRAY_SIZE(tvout_debugfs_files), - minor->debugfs_root, minor); + drm_debugfs_encoder_add_file(encoder, "tvout", tvout_dbg_show, tvout); } static void sti_tvout_encoder_dpms(struct drm_encoder *encoder, int mode) @@ -607,7 +596,7 @@ static int sti_tvout_late_register(struct drm_encoder *encoder) if (tvout->debugfs_registered) return 0; - tvout_debugfs_init(tvout, encoder->dev->primary); + tvout_debugfs_init(tvout, encoder); tvout->debugfs_registered = true; return 0;