From patchwork Mon Dec 26 15:50:21 2022 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: 13081882 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 EF3D4C4332F for ; Mon, 26 Dec 2022 15:51:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D3CBC10E036; Mon, 26 Dec 2022 15:51:47 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4933010E08D; Mon, 26 Dec 2022 15:51:45 +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=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_Canal?= To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org 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 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?= , Tomi Valkeinen , Emma Anholt , Alexey Brodkin , =?utf-8?q?Ma=C3=ADra_Canal?= , Liviu Dudau , etnaviv@lists.freedesktop.org, Gurchetan Singh , Melissa Wen , noralf@tronnes.org, Gerd Hoffmann , Russell King , David Airlie 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_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íra 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/etnaviv/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) static int show_unlocked(struct seq_file *m, void *arg) { - struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_debugfs_entry *entry = m->private; + struct drm_device *dev = entry->dev; int (*show)(struct drm_device *dev, struct seq_file *m) = - node->info_ent->data; + entry->file.data; return show(dev, m); } static int show_each_gpu(struct seq_file *m, void *arg) { - struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_debugfs_entry *entry = m->private; + struct drm_device *dev = entry->dev; struct etnaviv_drm_private *priv = dev->dev_private; struct etnaviv_gpu *gpu; int (*show)(struct etnaviv_gpu *gpu, struct seq_file *m) = - node->info_ent->data; + entry->file.data; unsigned int i; int ret = 0; @@ -223,20 +223,13 @@ static int show_each_gpu(struct seq_file *m, void *arg) return ret; } -static struct drm_info_list etnaviv_debugfs_list[] = { +static struct drm_debugfs_info etnaviv_debugfs_list[] = { {"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 /* @@ -478,9 +471,6 @@ static const struct drm_driver etnaviv_drm_driver = { .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_import_sg_table = etnaviv_gem_prime_import_sg_table, .gem_prime_mmap = drm_gem_prime_mmap, -#ifdef CONFIG_DEBUG_FS - .debugfs_init = etnaviv_debugfs_init, -#endif .ioctls = etnaviv_ioctls, .num_ioctls = DRM_ETNAVIV_NUM_IOCTLS, .fops = &fops, @@ -534,6 +524,11 @@ static int etnaviv_bind(struct device *dev) load_gpu(drm); +#ifdef CONFIG_DEBUG_FS + drm_debugfs_add_files(drm, etnaviv_debugfs_list, + ARRAY_SIZE(etnaviv_debugfs_list)); +#endif + ret = drm_dev_register(drm, 0); if (ret) goto out_unbind; From patchwork Mon Dec 26 15:50:22 2022 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: 13081883 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 6C85FC4332F for ; Mon, 26 Dec 2022 15:51:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE9D010E08D; Mon, 26 Dec 2022 15:51:57 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6683F10E08D; Mon, 26 Dec 2022 15:51:55 +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=OXbSziPUtP0NBz3Ri+ufOZyM1ccFIFns/4pM3n5+BoA=; b=sH/9P5+QlsEJ0PJH2fS/fN+z3L yswK1yklIoI7QvSv2JHFUpMjquDkVvKdnX3tw2B5MpDi2SZnKy4vQdxDReNBi2BgRvTQJC17gMiLk uV+bF5wvKfJOH2qYMj+1JdYn7OYCzWuZ65/Fk9ctaYDooydC7XcWoG1gMBU5733479MLRmiXsUzex kctrDwPy8nefJhsDbtcX+alG1Kjc6rMX+UlMsN6mHFaS+8xMuQSqCruBplhvxJ1Wf4pXmuO5oUwPp Pu701BuJOrURY5nGiYyc1E27otqa+9Y+o0wLEVOW5n5yQRERV65GUGM6JiYJdrWxYaGgqlgvDyMKN gglfZREw==; 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 1p9plX-00AXBr-Vp; Mon, 26 Dec 2022 16:51:52 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/9] drm/gud: use new debugfs device-centered functions Date: Mon, 26 Dec 2022 12:50:22 -0300 Message-Id: <20221226155029.244355-3-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 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?= , Tomi Valkeinen , Emma Anholt , Alexey Brodkin , =?utf-8?q?Ma=C3=ADra_Canal?= , Liviu Dudau , etnaviv@lists.freedesktop.org, Gurchetan Singh , Melissa Wen , noralf@tronnes.org, Gerd Hoffmann , Russell King , David Airlie 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 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 gud_probe(), before drm_dev_register(). Signed-off-by: Maíra Canal Acked-by: Noralf Trønnes --- drivers/gpu/drm/gud/gud_drv.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c index 5aac7cda0505..9d7bf8ee45f1 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -325,8 +325,8 @@ static struct drm_gem_object *gud_gem_prime_import(struct drm_device *drm, struc static int gud_stats_debugfs(struct seq_file *m, void *data) { - struct drm_info_node *node = m->private; - struct gud_device *gdrm = to_gud_device(node->minor->dev); + struct drm_debugfs_entry *entry = m->private; + struct gud_device *gdrm = to_gud_device(entry->dev); char buf[10]; string_get_size(gdrm->bulk_len, 1, STRING_UNITS_2, buf, sizeof(buf)); @@ -352,16 +352,6 @@ static int gud_stats_debugfs(struct seq_file *m, void *data) return 0; } -static const struct drm_info_list gud_debugfs_list[] = { - { "stats", gud_stats_debugfs, 0, NULL }, -}; - -static void gud_debugfs_init(struct drm_minor *minor) -{ - drm_debugfs_create_files(gud_debugfs_list, ARRAY_SIZE(gud_debugfs_list), - minor->debugfs_root, minor); -} - static const struct drm_simple_display_pipe_funcs gud_pipe_funcs = { .check = gud_pipe_check, .update = gud_pipe_update, @@ -386,7 +376,6 @@ static const struct drm_driver gud_drm_driver = { .fops = &gud_fops, DRM_GEM_SHMEM_DRIVER_OPS, .gem_prime_import = gud_gem_prime_import, - .debugfs_init = gud_debugfs_init, .name = "gud", .desc = "Generic USB Display", @@ -623,6 +612,8 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id) if (!gdrm->dmadev) dev_warn(dev, "buffer sharing not supported"); + drm_debugfs_add_file(drm, "stats", gud_stats_debugfs, NULL); + ret = drm_dev_register(drm, 0); if (ret) { put_device(gdrm->dmadev); From patchwork Mon Dec 26 15:50:23 2022 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: 13081884 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 AFCF3C4332F for ; Mon, 26 Dec 2022 15:52:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 221F710E13F; Mon, 26 Dec 2022 15:52:05 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 07E8210E13F; Mon, 26 Dec 2022 15:52:04 +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=0LSeLroT+4iYVUyGWLQGxKN0jHFcT9Gxb+4qzoP5J+A=; b=s7CSeUDHOhaOAF/3BILTnVdW+m 5VIVUpOdRfJNr19KiBV8XBKoSK7ptAgrKBOiTe8F1Ad0+uKKOylZM/Cw/XXQTCo781/2jIupDaKcI 3VseF4uL2Qofcly4fWKTpm4MbvTfzEaem/jn/dHXRFscprDDKJBIxBKTf0MsWCU4tFkyH3PbpkCuQ W4C4yM01NXLoeQ9xukczSYOga3kY0eB67kpwqCjfn5lNxMZpt6mQqNpz1lDT9EbKR8Z1poFrC3JpT Anwqldl4kTYagiP1i20MoT0x+e5EXb6o5zAGnVJY9mKFSTShI2Mb6ZZJu7hF3B4cQhD+6ePt3TefM FaMcbR0Q==; 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 1p9plg-00AXBr-Ae; Mon, 26 Dec 2022 16:52:01 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/9] drm/arm/hdlcd: use new debugfs device-centered functions Date: Mon, 26 Dec 2022 12:50:23 -0300 Message-Id: <20221226155029.244355-4-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 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?= , Tomi Valkeinen , Emma Anholt , Alexey Brodkin , =?utf-8?q?Ma=C3=ADra_Canal?= , Liviu Dudau , etnaviv@lists.freedesktop.org, Gurchetan Singh , Melissa Wen , noralf@tronnes.org, Gerd Hoffmann , Russell King , David Airlie 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_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 hdlcd_drm_bind(), before drm_dev_register(). Signed-off-by: Maíra Canal Acked-by: Liviu Dudau --- drivers/gpu/drm/arm/hdlcd_drv.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 7043d1c9ed8f..e3507dd6f82a 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -195,8 +195,8 @@ static int hdlcd_setup_mode_config(struct drm_device *drm) #ifdef CONFIG_DEBUG_FS static int hdlcd_show_underrun_count(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 hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm); seq_printf(m, "underrun : %d\n", atomic_read(&hdlcd->buffer_underrun_count)); @@ -208,8 +208,8 @@ static int hdlcd_show_underrun_count(struct seq_file *m, void *arg) static int hdlcd_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 hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm); unsigned long clkrate = clk_get_rate(hdlcd->clk); unsigned long mode_clock = hdlcd->crtc.mode.crtc_clock * 1000; @@ -219,17 +219,10 @@ static int hdlcd_show_pxlclock(struct seq_file *m, void *arg) return 0; } -static struct drm_info_list hdlcd_debugfs_list[] = { +static struct drm_debugfs_info hdlcd_debugfs_list[] = { { "interrupt_count", hdlcd_show_underrun_count, 0 }, { "clocks", hdlcd_show_pxlclock, 0 }, }; - -static void hdlcd_debugfs_init(struct drm_minor *minor) -{ - drm_debugfs_create_files(hdlcd_debugfs_list, - ARRAY_SIZE(hdlcd_debugfs_list), - minor->debugfs_root, minor); -} #endif DEFINE_DRM_GEM_DMA_FOPS(fops); @@ -237,9 +230,6 @@ DEFINE_DRM_GEM_DMA_FOPS(fops); static const struct drm_driver hdlcd_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, DRM_GEM_DMA_DRIVER_OPS, -#ifdef CONFIG_DEBUG_FS - .debugfs_init = hdlcd_debugfs_init, -#endif .fops = &fops, .name = "hdlcd", .desc = "ARM HDLCD Controller DRM", @@ -303,6 +293,10 @@ static int hdlcd_drm_bind(struct device *dev) drm_mode_config_reset(drm); drm_kms_helper_poll_init(drm); +#ifdef CONFIG_DEBUG_FS + drm_debugfs_add_files(drm, hdlcd_debugfs_list, ARRAY_SIZE(hdlcd_debugfs_list)); +#endif + ret = drm_dev_register(drm, 0); if (ret) goto err_register; From patchwork Mon Dec 26 15:50:24 2022 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: 13081885 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 5C2B5C4332F for ; Mon, 26 Dec 2022 15:52:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AFA1F10E13A; Mon, 26 Dec 2022 15:52:17 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 243C610E13A; Mon, 26 Dec 2022 15:52:16 +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=S+8GLqhBxZmxLiHQRo6IYE0Qn7cawY8cH2s3+D0vP1w=; b=AeQ9maYObSMNrqxbsUYpICEL3M 1IAvesfrGmAWCzL6BSe7hz1hfw6lqLpCsNQd8pYLatMAK/vQJRDXeBHdswoI4wrVqPx6hPfxTk+8H 42T+lS6Aa+1ohtn6PkjBseHHudZDOfA8P7srIjwdL560FXFCgVTXlqz2iS4o2kNLkpEJwZhbIQ7ZU H0o1CPw27gvwqN8NE5dYtqf0Vhvx/H5SVi+19Usy1MAYBt4Qw5YKRaebC86wtL1Gvmv9eCX1VIig9 La4QzRektNpMMlwLGkUHKlKIdbazn4303RhCun0Oi1e/fkVrlh99VICi5ZEmm31UalI4atMgMEKXG p+ip06Iw==; 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 1p9pls-00AXBr-Ho; Mon, 26 Dec 2022 16:52:13 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/9] drm/pl111: use new debugfs device-centered functions Date: Mon, 26 Dec 2022 12:50:24 -0300 Message-Id: <20221226155029.244355-5-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 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?= , Tomi Valkeinen , Emma Anholt , Alexey Brodkin , =?utf-8?q?Ma=C3=ADra_Canal?= , Liviu Dudau , etnaviv@lists.freedesktop.org, Gurchetan Singh , Melissa Wen , noralf@tronnes.org, Gerd Hoffmann , Russell King , David Airlie 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 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 pl111_amba_probe(), before drm_dev_register(). Signed-off-by: Maíra Canal --- drivers/gpu/drm/pl111/pl111_debugfs.c | 15 ++++----------- drivers/gpu/drm/pl111/pl111_drm.h | 2 +- drivers/gpu/drm/pl111/pl111_drv.c | 6 ++---- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/pl111/pl111_debugfs.c b/drivers/gpu/drm/pl111/pl111_debugfs.c index 6744fa16f464..458f69e5435e 100644 --- a/drivers/gpu/drm/pl111/pl111_debugfs.c +++ b/drivers/gpu/drm/pl111/pl111_debugfs.c @@ -32,8 +32,8 @@ static const struct { static int pl111_debugfs_regs(struct seq_file *m, void *unused) { - struct drm_info_node *node = (struct drm_info_node *)m->private; - struct drm_device *dev = node->minor->dev; + struct drm_debugfs_entry *entry = m->private; + struct drm_device *dev = entry->dev; struct pl111_drm_dev_private *priv = dev->dev_private; int i; @@ -46,14 +46,7 @@ static int pl111_debugfs_regs(struct seq_file *m, void *unused) return 0; } -static const struct drm_info_list pl111_debugfs_list[] = { - {"regs", pl111_debugfs_regs, 0}, -}; - -void -pl111_debugfs_init(struct drm_minor *minor) +void pl111_debugfs_init(struct drm_device *drm) { - drm_debugfs_create_files(pl111_debugfs_list, - ARRAY_SIZE(pl111_debugfs_list), - minor->debugfs_root, minor); + drm_debugfs_add_file(drm, "regs", pl111_debugfs_regs, NULL); } diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h index 2a46b5bd8576..7fe74be917f1 100644 --- a/drivers/gpu/drm/pl111/pl111_drm.h +++ b/drivers/gpu/drm/pl111/pl111_drm.h @@ -157,6 +157,6 @@ struct pl111_drm_dev_private { int pl111_display_init(struct drm_device *dev); irqreturn_t pl111_irq(int irq, void *data); -void pl111_debugfs_init(struct drm_minor *minor); +void pl111_debugfs_init(struct drm_device *drm); #endif /* _PL111_DRM_H_ */ diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c index 00deba0b7271..c031eb4abc0d 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -228,10 +228,6 @@ static const struct drm_driver pl111_drm_driver = { .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_import_sg_table = pl111_gem_import_sg_table, .gem_prime_mmap = drm_gem_prime_mmap, - -#if defined(CONFIG_DEBUG_FS) - .debugfs_init = pl111_debugfs_init, -#endif }; static int pl111_amba_probe(struct amba_device *amba_dev, @@ -304,6 +300,8 @@ static int pl111_amba_probe(struct amba_device *amba_dev, if (ret != 0) goto dev_put; + pl111_debugfs_init(drm); + ret = drm_dev_register(drm, 0); if (ret < 0) goto dev_put; From patchwork Mon Dec 26 15:50:25 2022 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: 13081886 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 132B3C46467 for ; Mon, 26 Dec 2022 15:52:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 21D2D10E19F; Mon, 26 Dec 2022 15:52:28 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 44FCE10E1C2; Mon, 26 Dec 2022 15:52:26 +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=/kZMLPqQnBN8PK+NTipJKTw+jAOXbJ78l4KtMYdcI1I=; b=bmtntYHbu51SuuWqOk02JYIKIh EeAVKEi4LQN8uLcUR088djajJp8Kyuju5ZKB1gFveA/G1gGI8mcQ0GMCT1dm4qZ1PVqAX3+H01O/p NPWjOysfQfFZVbeiahMiF0rHAhlafzgmb6QPPi70+QMu5+6CNjg7gFU/IFSiKLJValEtgmSKTKaAc SQE214nyfah6VLadxcVJ5p9g6zH4yL8qIq/WsWNQmhM2eEbjs3tRuiidbNetubTLOhvb/gpxWpOjG gnf/iiP3fenG/XGvZ/sddxv/KNQV9Z3NBywwf+/A345XuM0YXmttdkZ0ckP0Ix17aWSDgZdZEzWka NuHaO+jA==; 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 1p9pm2-00AXBr-Iu; Mon, 26 Dec 2022 16:52:23 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/9] drm/arc: use new debugfs device-centered functions Date: Mon, 26 Dec 2022 12:50:25 -0300 Message-Id: <20221226155029.244355-6-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 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?= , Tomi Valkeinen , Emma Anholt , Alexey Brodkin , =?utf-8?q?Ma=C3=ADra_Canal?= , Liviu Dudau , etnaviv@lists.freedesktop.org, Gurchetan Singh , Melissa Wen , noralf@tronnes.org, Gerd Hoffmann , Russell King , David Airlie 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 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 arcpgu_probe(), before drm_dev_register(). Signed-off-by: Maíra Canal --- drivers/gpu/drm/tiny/arcpgu.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c index 611bbee15071..b074a0b4c7b3 100644 --- a/drivers/gpu/drm/tiny/arcpgu.c +++ b/drivers/gpu/drm/tiny/arcpgu.c @@ -338,8 +338,8 @@ static int arcpgu_unload(struct drm_device *drm) #ifdef CONFIG_DEBUG_FS static int 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; @@ -348,17 +348,6 @@ static int arcpgu_show_pxlclock(struct seq_file *m, void *arg) seq_printf(m, "mode: %lu\n", mode_clock); 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 = { @@ -371,9 +360,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 +376,10 @@ static int arcpgu_probe(struct platform_device *pdev) if (ret) return ret; +#ifdef CONFIG_DEBUG_FS + drm_debugfs_add_file(&arcpgu->drm, "clocks", arcpgu_show_pxlclock, NULL); +#endif + ret = drm_dev_register(&arcpgu->drm, 0); if (ret) goto err_unload; From patchwork Mon Dec 26 15:50:26 2022 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: 13081887 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 44134C4332F for ; Mon, 26 Dec 2022 15:52:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A0C3510E1FF; Mon, 26 Dec 2022 15:52:37 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id C37CE10E1C2; Mon, 26 Dec 2022 15:52:35 +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=v7BLxcmv54ZghGIeL/NetHeNVse710hXnO8qNFDiNp0=; b=ZfSpBYkgdJpaWdhpFW7tGqNe+r nhhtt+CV18qthe4KwLsiJ89OUo2WvsKbl6Z9+ZXKv+uX93ArrYP53iZ3JZqUyX+QM2aMOEfK9oetm hol/OLCXeSCGFABw0gSKaltriuUM92t5OyRF6jD+/PNQvvnmlYXt0kI2NWJyXMMdZ8Uon1XWP3jA3 k5XjuDX5I332whUg9Lcm2Stly5MArl1ipWjQZie26vFmUGL7oKmQNYk7fGUDgNtNQy9gKQkcN1upW 82fgxAyD5AE0HgyzuWzLEzz1KqyWNYzQMIzehgbsE57x2mpdYq/yZKuV2p1LS2Z6WJjceSa1n39rC bNIusnGQ==; 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 1p9pmC-00AXBr-6O; Mon, 26 Dec 2022 16:52:32 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/9] drm/virtio: use new debugfs device-centered functions Date: Mon, 26 Dec 2022 12:50:26 -0300 Message-Id: <20221226155029.244355-7-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 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?= , Tomi Valkeinen , Emma Anholt , Alexey Brodkin , =?utf-8?q?Ma=C3=ADra_Canal?= , Liviu Dudau , etnaviv@lists.freedesktop.org, Gurchetan Singh , Melissa Wen , noralf@tronnes.org, Gerd Hoffmann , Russell King , David Airlie 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_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 virtio_gpu_probe(), before drm_dev_register(). Signed-off-by: Maíra Canal --- drivers/gpu/drm/virtio/virtgpu_debugfs.c | 17 +++++++---------- drivers/gpu/drm/virtio/virtgpu_drv.c | 5 ++--- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_debugfs.c b/drivers/gpu/drm/virtio/virtgpu_debugfs.c index 853dd9aa397e..91c81b7429cc 100644 --- a/drivers/gpu/drm/virtio/virtgpu_debugfs.c +++ b/drivers/gpu/drm/virtio/virtgpu_debugfs.c @@ -68,8 +68,8 @@ static int virtio_gpu_features(struct seq_file *m, void *data) static int virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data) { - struct drm_info_node *node = (struct drm_info_node *) m->private; - struct virtio_gpu_device *vgdev = node->minor->dev->dev_private; + struct drm_debugfs_entry *entry = m->private; + struct virtio_gpu_device *vgdev = entry->dev->dev_private; seq_printf(m, "fence %llu %lld\n", (u64)atomic64_read(&vgdev->fence_drv.last_fence_id), @@ -80,8 +80,8 @@ virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data) static int virtio_gpu_debugfs_host_visible_mm(struct seq_file *m, void *data) { - struct drm_info_node *node = (struct drm_info_node *)m->private; - struct virtio_gpu_device *vgdev = node->minor->dev->dev_private; + struct drm_debugfs_entry *entry = m->private; + struct virtio_gpu_device *vgdev = entry->dev->dev_private; struct drm_printer p; if (!vgdev->has_host_visible) { @@ -94,7 +94,7 @@ virtio_gpu_debugfs_host_visible_mm(struct seq_file *m, void *data) return 0; } -static struct drm_info_list virtio_gpu_debugfs_list[] = { +static struct drm_debugfs_info virtio_gpu_debugfs_list[] = { { "virtio-gpu-features", virtio_gpu_features }, { "virtio-gpu-irq-fence", virtio_gpu_debugfs_irq_info, 0, NULL }, { "virtio-gpu-host-visible-mm", virtio_gpu_debugfs_host_visible_mm }, @@ -102,10 +102,7 @@ static struct drm_info_list virtio_gpu_debugfs_list[] = { #define VIRTIO_GPU_DEBUGFS_ENTRIES ARRAY_SIZE(virtio_gpu_debugfs_list) -void -virtio_gpu_debugfs_init(struct drm_minor *minor) +void virtio_gpu_debugfs_init(struct drm_device *drm) { - drm_debugfs_create_files(virtio_gpu_debugfs_list, - VIRTIO_GPU_DEBUGFS_ENTRIES, - minor->debugfs_root, minor); + drm_debugfs_add_files(drm, virtio_gpu_debugfs_list, VIRTIO_GPU_DEBUGFS_ENTRIES); } diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c index ae97b98750b6..83aa77e5893b 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -98,6 +98,8 @@ static int virtio_gpu_probe(struct virtio_device *vdev) if (ret) goto err_free; + virtio_gpu_debugfs_init(dev); + ret = drm_dev_register(dev, 0); if (ret) goto err_deinit; @@ -179,9 +181,6 @@ static const struct drm_driver driver = { .dumb_create = virtio_gpu_mode_dumb_create, .dumb_map_offset = virtio_gpu_mode_dumb_mmap, -#if defined(CONFIG_DEBUG_FS) - .debugfs_init = virtio_gpu_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_mmap = drm_gem_prime_mmap, diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index b7a64c7dcc2c..663d405ccacd 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -469,7 +469,7 @@ struct drm_gem_object *virtgpu_gem_prime_import_sg_table( struct sg_table *sgt); /* virtgpu_debugfs.c */ -void virtio_gpu_debugfs_init(struct drm_minor *minor); +void virtio_gpu_debugfs_init(struct drm_device *drm); /* virtgpu_vram.c */ bool virtio_gpu_is_vram(struct virtio_gpu_object *bo); From patchwork Mon Dec 26 15:50:27 2022 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: 13081888 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 0A4A7C4332F for ; Mon, 26 Dec 2022 15:52:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 79C9A10E1C2; Mon, 26 Dec 2022 15:52:47 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0AA2310E1C2; Mon, 26 Dec 2022 15:52:46 +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=2KQSyzc12nremCtqn5TfrmPqMZix6V9Y7uEbsEysZ74=; b=E6wMkrPtAOJTUVxMLtofbSjOor q/qpy2TaRaukkyayFYrKbWrsggAh7dlAVA+XekCX8h7ZUMCf0a0SH/Yd8lLZyODiOKtJWOuPpmmJU 02poneDirwjMMF0vlNz1+61U+CMNKuEOfzNA8B/VaCVuqI0LgoiOtyL6RzgpAMBxfn91kUjsGaqkn 61m3d+9o8JMWyrBp2zp5q71gN9Bb8r8kjKJtZIrHS/dLxHQTAgCk+v6bll3GB6exLihLlsY0e079e OPh6SbONn32vjgVc2s9+qY9h/0XWj2caWQ6liu1Xbw/IUDRz1jdFMmLZzPWoWj3+g7deA5V96A2Yb cB9nJLOQ==; 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 1p9pmM-00AXBr-3s; Mon, 26 Dec 2022 16:52:42 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/9] drm/omap: use new debugfs device-centered functions Date: Mon, 26 Dec 2022 12:50:27 -0300 Message-Id: <20221226155029.244355-8-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 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?= , Tomi Valkeinen , Emma Anholt , Alexey Brodkin , =?utf-8?q?Ma=C3=ADra_Canal?= , Liviu Dudau , etnaviv@lists.freedesktop.org, Gurchetan Singh , Melissa Wen , noralf@tronnes.org, Gerd Hoffmann , Russell King , David Airlie 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_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 omapdrm_init(), before drm_dev_register(). Signed-off-by: Maíra Canal --- drivers/gpu/drm/omapdrm/omap_debugfs.c | 29 +++++++++----------------- drivers/gpu/drm/omapdrm/omap_drv.c | 7 ++++--- drivers/gpu/drm/omapdrm/omap_drv.h | 2 +- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_debugfs.c b/drivers/gpu/drm/omapdrm/omap_debugfs.c index bfb2ccb40bd1..491aa74eb2ec 100644 --- a/drivers/gpu/drm/omapdrm/omap_debugfs.c +++ b/drivers/gpu/drm/omapdrm/omap_debugfs.c @@ -19,8 +19,8 @@ static int gem_show(struct seq_file *m, void *arg) { - struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_debugfs_entry *entry = m->private; + struct drm_device *dev = entry->dev; struct omap_drm_private *priv = dev->dev_private; seq_printf(m, "All Objects:\n"); @@ -33,8 +33,8 @@ static int gem_show(struct seq_file *m, void *arg) static int mm_show(struct seq_file *m, void *arg) { - struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_debugfs_entry *entry = m->private; + struct drm_device *dev = entry->dev; struct drm_printer p = drm_seq_file_printer(m); drm_mm_print(&dev->vma_offset_manager->vm_addr_space_mm, &p); @@ -45,8 +45,8 @@ static int mm_show(struct seq_file *m, void *arg) #ifdef CONFIG_DRM_FBDEV_EMULATION static int fb_show(struct seq_file *m, void *arg) { - struct drm_info_node *node = (struct drm_info_node *) m->private; - struct drm_device *dev = node->minor->dev; + struct drm_debugfs_entry *entry = m->private; + struct drm_device *dev = entry->dev; struct omap_drm_private *priv = dev->dev_private; struct drm_framebuffer *fb; @@ -68,7 +68,7 @@ static int fb_show(struct seq_file *m, void *arg) #endif /* list of debufs files that are applicable to all devices */ -static struct drm_info_list omap_debugfs_list[] = { +static struct drm_debugfs_info omap_debugfs_list[] = { {"gem", gem_show, 0}, {"mm", mm_show, 0}, #ifdef CONFIG_DRM_FBDEV_EMULATION @@ -76,21 +76,12 @@ static struct drm_info_list omap_debugfs_list[] = { #endif }; -/* list of debugfs files that are specific to devices with dmm/tiler */ -static struct drm_info_list omap_dmm_debugfs_list[] = { - {"tiler_map", tiler_map_show, 0}, -}; - -void omap_debugfs_init(struct drm_minor *minor) +void omap_debugfs_init(struct drm_device *drm) { - drm_debugfs_create_files(omap_debugfs_list, - ARRAY_SIZE(omap_debugfs_list), - minor->debugfs_root, minor); + drm_debugfs_add_files(drm, omap_debugfs_list, ARRAY_SIZE(omap_debugfs_list)); if (dmm_is_available()) - drm_debugfs_create_files(omap_dmm_debugfs_list, - ARRAY_SIZE(omap_dmm_debugfs_list), - minor->debugfs_root, minor); + drm_debugfs_add_file(drm, "tiler_map", tiler_map_show, NULL); } #endif diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index eaf67b9e5f12..06fc1bc0aa07 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -691,9 +691,6 @@ static const struct drm_driver omap_drm_driver = { DRIVER_ATOMIC | DRIVER_RENDER, .open = dev_open, .lastclose = drm_fb_helper_lastclose, -#ifdef CONFIG_DEBUG_FS - .debugfs_init = omap_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 = omap_gem_prime_import, @@ -781,6 +778,10 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) omap_fbdev_init(ddev); +#ifdef CONFIG_DEBUG_FS + omap_debugfs_init(ddev); +#endif + drm_kms_helper_poll_init(ddev); omap_modeset_enable_external_hpd(ddev); diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h index 825960fd3ea9..1e0d9e10cd6b 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.h +++ b/drivers/gpu/drm/omapdrm/omap_drv.h @@ -103,7 +103,7 @@ struct omap_drm_private { }; -void omap_debugfs_init(struct drm_minor *minor); +void omap_debugfs_init(struct drm_device *drm); struct omap_global_state * __must_check omap_get_global_state(struct drm_atomic_state *s); From patchwork Mon Dec 26 15:50:28 2022 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: 13081889 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 8049AC4332F for ; Mon, 26 Dec 2022 15:52:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91DD610E251; Mon, 26 Dec 2022 15:52:58 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1863610E244; Mon, 26 Dec 2022 15:52: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=wCkwnKyVnNlCcwUvRlGs3jpInf3FOmDQ9chM1+XfHRE=; b=CihnBgoSU/lhybzAyjyfMUYuIP d0XYdA+KE4xCmNGRHqewaHvsWodIavMknXgYMij3uFQAk7Vo9c8OZYLPsfVKz586SRGUgwAToAVaA U+T1BU5kTepqpU4hNtVzjTgk4l65quJp2xbLJhBrgw5IDif8lMny0febZfqmzg4y0LFQ0wWgi+FKf IQfgw1N3rwwBI2d7avG/mUNad9rxhglgvHXHboCi6gRbpLYgPS6J2QBY4vSw8fwQJK1/MUC0sX1MQ C5nC8sgwuonKoYSondKk9N+LFHGh26q/R2GWTD3OXOciQZWu/CmfcW9d15OcA/I00S3W/OeSQGs09 nxS7cUHA==; 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 1p9pmX-00AXBr-2P; Mon, 26 Dec 2022 16:52:53 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/9] drm/qxl: remove unused debugfs structure Date: Mon, 26 Dec 2022 12:50:28 -0300 Message-Id: <20221226155029.244355-9-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 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?= , Tomi Valkeinen , Emma Anholt , Alexey Brodkin , =?utf-8?q?Ma=C3=ADra_Canal?= , Liviu Dudau , etnaviv@lists.freedesktop.org, Gurchetan Singh , Melissa Wen , noralf@tronnes.org, Gerd Hoffmann , Russell King , David Airlie Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The current debugfs structure was introduced at f64122c1f6ad and it was never used by the driver. Considering the addition of more device-centered functions to the DRM core, remove the current debugfs structure. Signed-off-by: Maíra Canal --- drivers/gpu/drm/qxl/qxl_debugfs.c | 29 ----------------------------- drivers/gpu/drm/qxl/qxl_drv.h | 20 -------------------- 2 files changed, 49 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c b/drivers/gpu/drm/qxl/qxl_debugfs.c index 2d9ed3b94574..bdfce1a8f006 100644 --- a/drivers/gpu/drm/qxl/qxl_debugfs.c +++ b/drivers/gpu/drm/qxl/qxl_debugfs.c @@ -95,32 +95,3 @@ qxl_debugfs_init(struct drm_minor *minor) qxl_ttm_debugfs_init(dev); #endif } - -void qxl_debugfs_add_files(struct qxl_device *qdev, - struct drm_info_list *files, - unsigned int nfiles) -{ - unsigned int i; - - for (i = 0; i < qdev->debugfs_count; i++) { - if (qdev->debugfs[i].files == files) { - /* Already registered */ - return; - } - } - - i = qdev->debugfs_count + 1; - if (i > QXL_DEBUGFS_MAX_COMPONENTS) { - DRM_ERROR("Reached maximum number of debugfs components.\n"); - DRM_ERROR("Report so we increase QXL_DEBUGFS_MAX_COMPONENTS.\n"); - return; - } - qdev->debugfs[qdev->debugfs_count].files = files; - qdev->debugfs[qdev->debugfs_count].num_files = nfiles; - qdev->debugfs_count = i; -#if defined(CONFIG_DEBUG_FS) - drm_debugfs_create_files(files, nfiles, - qdev->ddev.primary->debugfs_root, - qdev->ddev.primary); -#endif -} diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index ea993d7162e8..0868d5d2a839 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.h +++ b/drivers/gpu/drm/qxl/qxl_drv.h @@ -60,8 +60,6 @@ struct iosys_map; #define DRIVER_MINOR 1 #define DRIVER_PATCHLEVEL 0 -#define QXL_DEBUGFS_MAX_COMPONENTS 32 - extern int qxl_num_crtc; #define QXL_INTERRUPT_MASK (\ @@ -165,14 +163,6 @@ struct qxl_drm_image { struct list_head chunk_list; }; -/* - * Debugfs - */ -struct qxl_debugfs { - struct drm_info_list *files; - unsigned int num_files; -}; - struct qxl_device { struct drm_device ddev; @@ -228,10 +218,6 @@ struct qxl_device { wait_queue_head_t io_cmd_event; struct work_struct client_monitors_config_work; - /* debugfs */ - struct qxl_debugfs debugfs[QXL_DEBUGFS_MAX_COMPONENTS]; - unsigned int debugfs_count; - struct mutex update_area_mutex; struct idr surf_id_idr; @@ -256,8 +242,6 @@ struct qxl_device { #define to_qxl(dev) container_of(dev, struct qxl_device, ddev) -int qxl_debugfs_fence_init(struct qxl_device *rdev); - int qxl_device_init(struct qxl_device *qdev, struct pci_dev *pdev); void qxl_device_fini(struct qxl_device *qdev); @@ -430,10 +414,6 @@ void qxl_gem_prime_vunmap(struct drm_gem_object *obj, /* qxl_irq.c */ int qxl_irq_init(struct qxl_device *qdev); -void qxl_debugfs_add_files(struct qxl_device *qdev, - struct drm_info_list *files, - unsigned int nfiles); - int qxl_surface_id_alloc(struct qxl_device *qdev, struct qxl_bo *surf); void qxl_surface_id_dealloc(struct qxl_device *qdev, From patchwork Mon Dec 26 15:50:29 2022 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: 13081890 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 C2FC3C4332F for ; Mon, 26 Dec 2022 15:53:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D6CA10E244; Mon, 26 Dec 2022 15:53:11 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id B1B2F10E244; Mon, 26 Dec 2022 15:53:08 +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=5SmaVKwidGFUBxDk6HT8gctynP24Ms6u0M3QIUhvqTc=; b=sqM2assGCvM8FowEX27V/FRsFZ KR/pvQOO4i5bL7fpJQpBedM5FiJH8e/I2d5B4ivKliS8hVvNcVpIt83KzlcB8+eDUC5P7LVOUg98m lJlhwwQLjrZTbzrJnAyhXH8i72YfsW9AQkTsUI5iSlU6Lyp1EubBhF6PpmJk/emBeC7qTIxIR4EHr wvqIsPBxpVSfrstSkLYKoTzupcIktr6WT16TjF4t3iAVT08mdiP6l8pozd6wkkXyus8Gh3s39eXGA 8kuPvLHHC1PMcPy4c+aatITAvKEDrckyXqbPgUX0NIzzHndJ8o11sdEanNrIOTcthv6d1UtESJPMh bzxClPsQ==; 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 1p9pmi-00AXBr-FM; Mon, 26 Dec 2022 16:53:05 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 9/9] drm/qxl: use new debugfs device-centered functions Date: Mon, 26 Dec 2022 12:50:29 -0300 Message-Id: <20221226155029.244355-10-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 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?= , Tomi Valkeinen , Emma Anholt , Alexey Brodkin , =?utf-8?q?Ma=C3=ADra_Canal?= , Liviu Dudau , etnaviv@lists.freedesktop.org, Gurchetan Singh , Melissa Wen , noralf@tronnes.org, Gerd Hoffmann , Russell King , David Airlie 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_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 Reviewed-by: Daniel Vetter Reviewed-by: Daniel Vetter --- 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) - 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 */