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 59BFFC636CC for ; Tue, 7 Feb 2023 16:18:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8291210E540; Tue, 7 Feb 2023 16:18:12 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8471910E540 for ; Tue, 7 Feb 2023 16:18:10 +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:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID: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=Kk6tXoFllmUjulLEbqfetFM0rdub8t1mYF4QItytTz8=; b=I4TeAWlaWjbcnz1M/ZxNqFx/jn 5kKDtRB125PR+Tri7gpqDz+oCiQB4kxmZw6EfOHY0FlYmTjflcsvGcfciPCoNYUAtiUsQ4x/3ORzw coeCb31H9zu3O15PUsDRLEmdK20+txRXn68iZbQz09AUgAQM3zxM/RzHoIZj1epC4Nj5esPzwWwGW fulibyLLKJTOrlWviJ0vWWSbr5BYC34NAeszkggRFqoFIV/o/3JZj9++vnpndC2HXpMenrm2bnC4P Z3SSYFheLjfmGxMaRzxSEcBNqhSV5JxYv0OnSNTiPWTSNS3nrkYtRGK0pyC8LtgHya8bYIm/y89IJ x5upGOwA==; Received: from [187.36.234.139] (helo=[192.168.1.195]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1pPQfK-00Bz2P-My; Tue, 07 Feb 2023 17:17:55 +0100 Message-ID: Date: Tue, 7 Feb 2023 13:17:47 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: DRM accel and debugfs/sysfs Content-Language: en-US To: Jeffrey Hugo , Stanislaw Gruszka , Daniel Vetter References: <20230201152003.GA2623449@linux.intel.com> <5dfdf605-55a2-28d3-aecf-713a632b2431@igalia.com> <5651b98b-ace8-5009-409f-d6032cb5374d@quicinc.com> From: =?UTF-8?Q?Ma=c3=adra_Canal?= In-Reply-To: <5651b98b-ace8-5009-409f-d6032cb5374d@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: Oded Gabbay , Jacek Lawrynowicz , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 2/7/23 12:43, Jeffrey Hugo wrote: > On 2/7/2023 4:31 AM, Maíra Canal wrote: >> Hi Stanislaw, >> >> On 2/1/23 12:20, Stanislaw Gruszka wrote: >>> Hi >>> >>> I was about to send debugfs support for ivpu and noticed that there >>> are current changes that deprecate drm_devel->debugfs_init callback. >>> >>> Further I looked at this commit [1], that stated we should not >>> use drm_minor for debugfs and sysfs. What is quite contrary to >>> what drm accel framework did in the first place. >>> >>> So my question is how we should use debugfs/sysfs in accel? >>> Use it with old fashioned minor-centric way or change >>> the framework somehow ? >> >> As we are trying to replace drm_debugfs_create_files() [1], it would >> be nice to see the accel debugfs support use the new debugfs API. This >> would mean using the debugfs_list from the drm_device, deprecating >> the debugfs_init callback, and adding the a similar code snippet to >> accel_debugfs_init: >> >> list_for_each_entry_safe(entry, tmp, &dev->debugfs_list, list) { >>      debugfs_create_file(entry->file.name, 0444, >>                  minor->debugfs_root, entry, &drm_debugfs_entry_fops); >>      list_del(&entry->list); >> >> Maybe Daniel has some more thoughts on this matter, but I guess it >> would be better to drop the use of the old-fashioned minor-centric >> implementation in accel. >> >> [1] https://cgit.freedesktop.org/drm/drm-misc/tree/Documentation/gpu/todo.rst#n511 >> >> Best Regards, >> - Maíra Canal > > Thank you for the details Maira.  It helps to explain what the todo is suggesting.  Is there an example of a driver/drm_device that uses debugfs_list which you can easily point to? The implementation of this device-centered infrastructure is linked in [1] and an example of the conversion of debugfs APIs is linked in [2], and other drivers such as v3d, vkms, vc4 and gud use this new API as well. [1] https://cgit.freedesktop.org/drm/drm-misc/commit/?id=1c9cacbea880513a896aee65a5c58007bcb55653 [2] https://cgit.freedesktop.org/drm/drm-misc/commit/?id=2e3ab8a6994f265bbd4dbd00448b84548f18464c Best Regards, - Maíra Canal > > -Jeff > >> >>> >>> [1] https://cgit.freedesktop.org/drm/drm-misc/commit/?id=99845faae7099cd704ebf67514c1157c26960a26 >>> >>> Regards >>> Stanislaw >>> >