Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8041995rwb; Wed, 23 Nov 2022 14:39:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf4RK3myFPH38qKNE46EUvfxBpVrVhShGsea8dwU036rrWOU4c1IX2Kzs3Qu8OpuXyJ5/hko X-Received: by 2002:a05:6402:1d87:b0:459:41fa:8e07 with SMTP id dk7-20020a0564021d8700b0045941fa8e07mr10197829edb.140.1669243191106; Wed, 23 Nov 2022 14:39:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669243191; cv=none; d=google.com; s=arc-20160816; b=bvusApdB5CbaP47kzc4ONWymMwEi5o9qFemAPI3ShQtDWuKJkmL5jifF0ek39BUOPe GGzep2yQ19kH80fOQwIzDKlzHdLe+3tYryofTDthOHodmpxKL8eqoFLnPgyLyz7Toxrh U5k9QxqgBtVCcrew+VMPlCey9swHJ7eRNbIt8mFlkY7N55m5/+EjZ9mWgsKR+NuJ2Mfh xhVhO7WL20TYBfj+BKlOokYP4et9iDRFMcpVBh9i0ZFsD6Jl9Q1LeV5oDTyuz1Qmk53V 4icG0ON44GwegS9E/IG7vR3rxc2a+kd0YQ4JY8MRyKy1zU82wNyLea6QL8OQKMk2AUxH r/cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hCh4U8zVhwKGsDmBXqQLqlAvxngk0YWQZ8JQb1CCQDc=; b=JODYZECWZDAiBhQ/ONU5FkLoKCknlOI+a1JM9cniH4DQKsTb7kC0jzE6wB3yOpLRJg JLI2aOv1PZirDyuxqOKJbCOHZpHmc0gFzxQfzWP+rrPwUwh+KE3+iBQPuUw6LKoqwE8a wktFtEXs7raspdQMWzw1h8jpTagx0RLHx7t4Kuhyo2P7pZm+iZe8+lTkJNKON3Pe8eTJ SVoIcKABxkdLnIa75i/eBsDv4PlaVw9kXf7lDkIVL3MxtWGexs4esYvxnE0sbmfn1czD /m2Uwqyxor9Ze4jAgxZLEPNwIb/x+kSgLUK7GGlZnilEGRZLlOADgzi8UoCQm89h18Ly gGxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=VY1uYu85; 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 r13-20020a05640251cd00b00462e5d768b3si686062edd.612.2022.11.23.14.39.29; Wed, 23 Nov 2022 14:39:51 -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=fail header.i=@igalia.com header.s=20170329 header.b=VY1uYu85; 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 S229927AbiKWWJO (ORCPT + 88 others); Wed, 23 Nov 2022 17:09:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbiKWWIm (ORCPT ); Wed, 23 Nov 2022 17:08:42 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 054B9D53B9 for ; Wed, 23 Nov 2022 14:08:25 -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=hCh4U8zVhwKGsDmBXqQLqlAvxngk0YWQZ8JQb1CCQDc=; b=VY1uYu85clfuaO3JYrJRIH7kIe 0Ohlc0+BkXTD/53qBOyYcW1oiIa9KmBeGJwWYCYEyiqJ1rpkxXhozaOxFfX9FbcGVcFf0SqXJlGsm ahXNUTa/cwzZO2qNsTWjZsoloAFaScQLGc/cFs/Tby+uy2pWOrmjM4JLRZJ7eXNZkZ/nGrhLpp8Ml 50txmlowkA9hB5Ltxuo74fZ/yjd0IimkmwIUsj/c2xtIUwRIz7xUAATEbgPcubvJJMPiOJkrxHbJy fxVsRSianKzpMPw1BhyoShWchDUxRiwygAtAvtYM/6kw8/ygxNc0WLN3n3UlVj204HGpLXkani+vY lN1NHxcA==; Received: from [177.34.169.227] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1oxxui-0080ww-KB; Wed, 23 Nov 2022 23:08:17 +0100 From: =?UTF-8?q?Ma=C3=ADra=20Canal?= To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Oded Gabbay , Jani Nikula Cc: Melissa Wen , =?UTF-8?q?Andr=C3=A9=20Almeida?= , Emma Anholt , Rodrigo Siqueira , Wambui Karuga , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Ma=C3=ADra=20Canal?= Subject: [PATCH v2 5/6] drm/vkms: use new debugfs device-centered functions Date: Wed, 23 Nov 2022 19:07:24 -0300 Message-Id: <20221123220725.1272155-6-mcanal@igalia.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123220725.1272155-1-mcanal@igalia.com> References: <20221123220725.1272155-1-mcanal@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 Replace the use of drm_debugfs_create_files() with the new drm_debugfs_add_files() 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 vkms_create(), before drm_dev_register(). Signed-off-by: MaĆ­ra Canal --- drivers/gpu/drm/vkms/vkms_drv.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index 293dbca50c31..a4d445e09df5 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -91,8 +91,8 @@ static void vkms_atomic_commit_tail(struct drm_atomic_state *old_state) static int vkms_config_show(struct seq_file *m, void *data) { - 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 vkms_device *vkmsdev = drm_device_to_vkms_device(dev); seq_printf(m, "writeback=%d\n", vkmsdev->config->writeback); @@ -102,24 +102,16 @@ static int vkms_config_show(struct seq_file *m, void *data) return 0; } -static const struct drm_info_list vkms_config_debugfs_list[] = { +static const struct drm_debugfs_info vkms_config_debugfs_list[] = { { "vkms_config", vkms_config_show, 0 }, }; -static void vkms_config_debugfs_init(struct drm_minor *minor) -{ - drm_debugfs_create_files(vkms_config_debugfs_list, ARRAY_SIZE(vkms_config_debugfs_list), - minor->debugfs_root, minor); -} - static const struct drm_driver vkms_driver = { .driver_features = DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_GEM, .release = vkms_release, .fops = &vkms_driver_fops, DRM_GEM_SHMEM_DRIVER_OPS, - .debugfs_init = vkms_config_debugfs_init, - .name = DRIVER_NAME, .desc = DRIVER_DESC, .date = DRIVER_DATE, @@ -201,6 +193,9 @@ static int vkms_create(struct vkms_config *config) if (ret) goto out_devres; + drm_debugfs_add_files(&vkms_device->drm, vkms_config_debugfs_list, + ARRAY_SIZE(vkms_config_debugfs_list)); + ret = drm_dev_register(&vkms_device->drm, 0); if (ret) goto out_devres; -- 2.38.1