Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2895320rwl; Fri, 6 Jan 2023 12:21:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXvrUJv9KG3WRBRlrSLmwBiO2qD+mYaSvxwk46tTQ/cgD2BieQYFte0qjHtE2w4wf6oEH0tP X-Received: by 2002:a17:907:b9d5:b0:7c1:f6c:dd4e with SMTP id xa21-20020a170907b9d500b007c10f6cdd4emr47934420ejc.40.1673036509456; Fri, 06 Jan 2023 12:21:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673036509; cv=none; d=google.com; s=arc-20160816; b=BAIBoZbOq9PP2C67+Z6XbdhBTfSwj9aYEmgIsCnXwRYxoR7T7t1uuQOeLrfRFREG9X uvLQHK7qPdl8OEsCFABqoOgjiXuqFzPmVL0Ba4j8J0LViuCeqG3V1gPPf7CegS3g4Vtp O6FDOxNRYpIrQPUe/j/L6xDxdlVRn+kLUsY9xH+9WSYVhtUpsmrg+sjBs3QNrT1v/E89 ZcYGVlBCKr2HjrxeYIuscI8yiXrn684UoiU4TEew5ZAQVXuzULdMCw/8pxTVmfOLFwjG yggDejI0fEiZIDkDNCbyAQIco4vZ7G3z1bRy4jGrrqb5lXtgbELMVXdY/o4Fj/CdCJyb H7hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=PgDgCbalZVja6CJHZ1jEM9FmYuFNNbjDnPRPmmyR01o=; b=my5Q/U3TCzIuoHPxp5fBN1WZrYLXl5/nS473hGCx/wfI+vKrZ0Z3znhHhXSfi7M3Ro 3KZtU6A4xx7+Phcf1wY6d28EBrddggsG7g6rjcgKkKaX6vGF4B3eLamXyofHXVUzWJZ2 D+ZxMkAlRioBQIEndqkBckNE3d20HYhsLzgHz3WGE64wemoZU/W8EYCPB9ATB5dB8T+c M3w9F7vmv/TpAiFdu1IqbKZ4WfgqbEApzbH4RfEXJkQBYQb4VlUssc4WTHl8enMGcnPv /10nb5RPCXXHbeI6wK9GYxT03Tb39ngZz/PCkaDy1nYqvOkjEfEofz/i1KSogzAAvu4t sIUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=d3pgh8KL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp19-20020a170906c15300b007a45e4f4ff0si2595441ejc.885.2023.01.06.12.21.36; Fri, 06 Jan 2023 12:21:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=d3pgh8KL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235129AbjAFUAQ (ORCPT + 55 others); Fri, 6 Jan 2023 15:00:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbjAFUAO (ORCPT ); Fri, 6 Jan 2023 15:00:14 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A11CD77AD7 for ; Fri, 6 Jan 2023 12:00:13 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id k26-20020a05600c1c9a00b003d972646a7dso4312954wms.5 for ; Fri, 06 Jan 2023 12:00:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=PgDgCbalZVja6CJHZ1jEM9FmYuFNNbjDnPRPmmyR01o=; b=d3pgh8KLydQizYACXbm3xigjagcrLhYky+dtaJxgm0ZmF86PT3UfRqOmBWhD5akBOj anijEtMC9Zt+I57QREM0oknwQNrlOn1OqqNLnEcTH+ABvN2W6XcglaDv7/ZIfYRZhYaT O0h/JzAVISV+NiOLXwjsNscvo+o3iXdPkm+z0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PgDgCbalZVja6CJHZ1jEM9FmYuFNNbjDnPRPmmyR01o=; b=b+MlWXwsLdItjmF1nsT8DEcRmQhC4EIvEwJcIQco0Y1TgkqQGufAOrN2ssMzIhLb6z kzDU2gZi4iULd+qvagWXodq+lumWOEGb7vIFkG2IPNI0bT57IbMH4Duq45y5uxR+2NIk W0zWoARwOusAzSwvYR47b3fmGYyDM99173SrDqrizsPou9AYC+TBPVifsU2JPv65SsI8 wk/xApzgQ9bqLJ2ME132ZClabh8YGM6kQ355E420c6lp3ddxAleSz00stBVfs6+b8uhR Roso/BLFsufxbRpGHYB+hbRzEK3+7cMNjMvf6MY4vr3Tzr/uiPVFFUA4qJcoj647muIT KWnQ== X-Gm-Message-State: AFqh2kpO+9u0ip02RyLWNjHt9vxz0oDGcm/PYpRqCYeXh9uY0h6O53kg 9rxGWOkUCKr0dYi6Srt3+7kd/w== X-Received: by 2002:a05:600c:6007:b0:3cf:4ec9:385d with SMTP id az7-20020a05600c600700b003cf4ec9385dmr39663654wmb.19.1673035212237; Fri, 06 Jan 2023 12:00:12 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id bg23-20020a05600c3c9700b003d1de805de5sm3315612wmb.16.2023.01.06.12.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 12:00:11 -0800 (PST) Date: Fri, 6 Jan 2023 21:00:08 +0100 From: Daniel Vetter To: =?iso-8859-1?Q?Ma=EDra?= Canal Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Melissa Wen , =?iso-8859-1?Q?Andr=E9?= Almeida , 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 Subject: Re: [PATCH 9/9] drm/qxl: use new debugfs device-centered functions Message-ID: Mail-Followup-To: =?iso-8859-1?Q?Ma=EDra?= Canal , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Melissa Wen , =?iso-8859-1?Q?Andr=E9?= Almeida , 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 References: <20221226155029.244355-1-mcanal@igalia.com> <20221226155029.244355-10-mcanal@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221226155029.244355-10-mcanal@igalia.com> X-Operating-System: Linux phenom 5.19.0-2-amd64 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 26, 2022 at 12:50:29PM -0300, Ma?ra Canal wrote: > 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 qxl_pci_probe(), > before drm_dev_register(). > > Signed-off-by: Ma?ra Canal > --- > drivers/gpu/drm/qxl/qxl_debugfs.c | 18 ++++++++---------- > drivers/gpu/drm/qxl/qxl_drv.c | 5 ++--- > drivers/gpu/drm/qxl/qxl_drv.h | 2 +- > 3 files changed, 11 insertions(+), 14 deletions(-) > > diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c b/drivers/gpu/drm/qxl/qxl_debugfs.c > index bdfce1a8f006..fd18a7b193b3 100644 > --- a/drivers/gpu/drm/qxl/qxl_debugfs.c > +++ b/drivers/gpu/drm/qxl/qxl_debugfs.c > @@ -38,8 +38,8 @@ > static int > qxl_debugfs_irq_received(struct seq_file *m, void *data) > { > - struct drm_info_node *node = (struct drm_info_node *) m->private; > - struct qxl_device *qdev = to_qxl(node->minor->dev); > + struct drm_debugfs_entry *entry = m->private; > + struct qxl_device *qdev = to_qxl(entry->dev); > > seq_printf(m, "%d\n", atomic_read(&qdev->irq_received)); > seq_printf(m, "%d\n", atomic_read(&qdev->irq_received_display)); > @@ -52,8 +52,8 @@ qxl_debugfs_irq_received(struct seq_file *m, void *data) > static int > qxl_debugfs_buffers_info(struct seq_file *m, void *data) > { > - struct drm_info_node *node = (struct drm_info_node *) m->private; > - struct qxl_device *qdev = to_qxl(node->minor->dev); > + struct drm_debugfs_entry *entry = m->private; > + struct qxl_device *qdev = to_qxl(entry->dev); > struct qxl_bo *bo; > > list_for_each_entry(bo, &qdev->gem.objects, list) { > @@ -76,21 +76,19 @@ qxl_debugfs_buffers_info(struct seq_file *m, void *data) > return 0; > } > > -static struct drm_info_list qxl_debugfs_list[] = { > +static struct drm_debugfs_info qxl_debugfs_list[] = { > { "irq_received", qxl_debugfs_irq_received, 0, NULL }, > { "qxl_buffers", qxl_debugfs_buffers_info, 0, NULL }, > }; > #define QXL_DEBUGFS_ENTRIES ARRAY_SIZE(qxl_debugfs_list) > #endif > > -void > -qxl_debugfs_init(struct drm_minor *minor) > +void qxl_debugfs_init(struct drm_device *drm) > { > #if defined(CONFIG_DEBUG_FS) Again since it's all in the same file I'd drop the #ifdef and use __maybe_unused. Either way Reviewed-by: Daniel Vetter You could do the same trick for omap drm too I guess, but since it's a bit across files it's a bit more annoying (and you'd have one cross-file function call left but *meh*). For the other patches without review yet: Reviewed-by: Daniel Vetter I'd wait another week (because holiday break) for any maintainer feedback and then push. -Daniel > - struct qxl_device *dev = to_qxl(minor->dev); > + struct qxl_device *dev = to_qxl(drm); > > - drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES, > - minor->debugfs_root, minor); > + drm_debugfs_add_files(drm, qxl_debugfs_list, QXL_DEBUGFS_ENTRIES); > > qxl_ttm_debugfs_init(dev); > #endif > diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c > index a3b83f89e061..3ae2db78f671 100644 > --- a/drivers/gpu/drm/qxl/qxl_drv.c > +++ b/drivers/gpu/drm/qxl/qxl_drv.c > @@ -116,6 +116,8 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) > if (ret) > goto unload; > > + qxl_debugfs_init(&qdev->ddev); > + > drm_kms_helper_poll_init(&qdev->ddev); > > /* Complete initialization. */ > @@ -287,9 +289,6 @@ static struct drm_driver qxl_driver = { > > .dumb_create = qxl_mode_dumb_create, > .dumb_map_offset = drm_gem_ttm_dumb_map_offset, > -#if defined(CONFIG_DEBUG_FS) > - .debugfs_init = qxl_debugfs_init, > -#endif > .prime_handle_to_fd = drm_gem_prime_handle_to_fd, > .prime_fd_to_handle = drm_gem_prime_fd_to_handle, > .gem_prime_import_sg_table = qxl_gem_prime_import_sg_table, > diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h > index 0868d5d2a839..cb84a3bebcec 100644 > --- a/drivers/gpu/drm/qxl/qxl_drv.h > +++ b/drivers/gpu/drm/qxl/qxl_drv.h > @@ -397,7 +397,7 @@ int qxl_garbage_collect(struct qxl_device *qdev); > > /* debugfs */ > > -void qxl_debugfs_init(struct drm_minor *minor); > +void qxl_debugfs_init(struct drm_device *drm); > void qxl_ttm_debugfs_init(struct qxl_device *qdev); > > /* qxl_prime.c */ > -- > 2.38.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch