Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1574399rwl; Wed, 12 Apr 2023 15:26:46 -0700 (PDT) X-Google-Smtp-Source: AKy350Z7Iouf9EF5CLhoqaDGIlPSJVZU7Y0cRAGqpRAGdKLpgHXmDl7OZP7OXkh8LDfXidOD7iQC X-Received: by 2002:a05:6402:32b:b0:504:9b97:a578 with SMTP id q11-20020a056402032b00b005049b97a578mr196611edw.22.1681338406165; Wed, 12 Apr 2023 15:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681338406; cv=none; d=google.com; s=arc-20160816; b=llWWGDShT0tiTZMiTUKJ7RKDt3R1NF0XW6mpcU5F9GnobSOsWxZB2lJAvbimh4DDVz o4xIOJyOH1LOgqiKAsSZTFFH4iO0/0Cy4DYcQa8R0q481KveZsWcRbm/lZu9pq1JTgF5 xmrhSKRzZ+VtO7ii6g9SE6qQTYWKo5RTnPlyHQ66MuVTpZKEbNiHt6VoD/D9jp4+FoWw vRYpR3qSwmyrerhzr9eauPgpRwEqyXOXtMh8vaONEGDOjH3G0PSNo1N0r3SwMB8mO+vc sX/vYeNUD5JBdsJWd3NaykdQyB11ulWjjeFXsZgA2vAcXNq7BmWB0KccFzd4NSnul63s DaJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/nX5ZUWZ+h14V2FRkq8UuCb9+sDAe/a4u14goLUk2eQ=; b=uPwVkPnd1W7Hcr/p1QdnpBNrVOg8Dn5XDFid2YJSCzkZ6/X1qpcmzG4K6SRESMMW8+ 5rcvNpk+Pu2MD6AnDbA2IfJt4bRY1xuyK5qqziaxdS6Jhjqq4AUhsAvEWMWRRkowsAhv w3cdNv1j909DF525bNJlOdT+SN6fHXQ9ETwhFcRKLyDRu40IrZudM8kfUP49OTc/riga JpjeXEXVIIALulW9VkcEb6L0BfdWhBJZR7pnKNUzwC+cu02DhIdLFFkPlzntxlx7hanj UyC01BJZhEljNyxO0MDlPR3KZMioZXRpjcP5ksXW712Ud2zYwKuviEwb7xifd1/j9Jyn uGrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=cE5xZzmi; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lf1-20020a170906ae4100b008b17e6556c3si12623080ejb.587.2023.04.12.15.25.58; Wed, 12 Apr 2023 15:26:46 -0700 (PDT) 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=@gmail.com header.s=20221208 header.b=cE5xZzmi; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbjDLWSk (ORCPT + 99 others); Wed, 12 Apr 2023 18:18:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjDLWSj (ORCPT ); Wed, 12 Apr 2023 18:18:39 -0400 Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BC8D49FE; Wed, 12 Apr 2023 15:18:38 -0700 (PDT) Received: by mail-oi1-x235.google.com with SMTP id cd20so2439129oib.0; Wed, 12 Apr 2023 15:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681337917; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/nX5ZUWZ+h14V2FRkq8UuCb9+sDAe/a4u14goLUk2eQ=; b=cE5xZzmiH+xB6rbLmtl0fzBJVegyhjkLsVveqwxO5qbNd4xIuKTR3hTFoqJeF9WUhm JlHLAC27LDrFCRNQay/+gqmrXNnoQ8btdgulvP28AuJaWw/c9JRdp4CiPW7KItWgORuP X3GdvgE4UN5p2reyTu+wLa1eNhaMkyUyDlipXEMw/uQeYawfDdj847Rp2y1ncrbAMPRR Pqh+A+wEisSSGwOy8FrS/bJ6eDtK6RIBn3Bp7m8s0zUaaWShkI3zI4+DluUfRpkSm9TF WpiQwT1ks7DbLSHJFmx23w1eXfdDI5y+vXcfAmosXdK406t32J/z2S1j08SeSoPMpb6s OSVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681337917; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/nX5ZUWZ+h14V2FRkq8UuCb9+sDAe/a4u14goLUk2eQ=; b=aXpn83ZYGt4urCkqt9rVZS+hvSd/7HAHO1RKIHyhrFSs9pfC2c7M+LGAk0MDGA8I0q 6smEvkl7DhGaoX9YXA0BiXFaU6c3E6vkMhZzXiIBl765b5qwJnSKnlwIOMn95JrDJ4rw CPokvxckvx1T3XsjIksPXzVD/3ybKr3xjIqUkKIfTSDOjeARK+Kzb5n70kccsiuGsSUk DM1uWwwjhJsIbTKoHAM7XiA4k/xndCmEC4YF3ICS0DQ5HlOSbxav0MJ5ne2tNhLwSKg1 TYXu25+rQkhfcrCD6MrxgKgpd+XwoYVZndhB84a3pJ48r1WjzSXk6lIflu34hpURQYG0 lCkw== X-Gm-Message-State: AAQBX9eilHgNlxxHjvbh93h+3CdeGf83bdiziQXIOKojvj+OtpLEmfBJ s4RV5GAhTYL5DhWNSnk/Dr+IGSmSnPoGMGr87rU= X-Received: by 2002:aca:917:0:b0:386:a109:57c8 with SMTP id 23-20020aca0917000000b00386a10957c8mr34183oij.5.1681337917575; Wed, 12 Apr 2023 15:18:37 -0700 (PDT) MIME-Version: 1.0 References: <20230411225725.2032862-1-robdclark@gmail.com> <20230411225725.2032862-6-robdclark@gmail.com> In-Reply-To: From: Rob Clark Date: Wed, 12 Apr 2023 15:18:26 -0700 Message-ID: Subject: Re: [PATCH v3 5/7] drm/etnaviv: Switch to fdinfo helper To: Rob Clark , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Boris Brezillon , Tvrtko Ursulin , Christopher Healy , Emil Velikov , Rob Clark , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" , open list Cc: Daniel Vetter Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 Wed, Apr 12, 2023 at 12:59=E2=80=AFAM Daniel Vetter wr= ote: > > On Tue, Apr 11, 2023 at 03:56:10PM -0700, Rob Clark wrote: > > From: Rob Clark > > > > Signed-off-by: Rob Clark > > You're on an old tree, this got reverted. But I'm kinda wondering whether > another patch on top shouldn't just includ the drm_show_fdinfo in > DRM_GEM_FOPS macro ... There's really no good reasons for drivers to not > have this I think? oh, I'm roughly on msm-next, so didn't see the revert.. I'll drop this one. But with things in flux, this is why I decided against adding it to DRM_GEM_FOPS. Ie. we should do that as a followup cleanup step once everyone is moved over to the new helpers to avoid conflicts or build breaks when merging things via different driver trees BR, -R > -Daniel > > > --- > > drivers/gpu/drm/etnaviv/etnaviv_drv.c | 10 ++++------ > > 1 file changed, 4 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/et= naviv/etnaviv_drv.c > > index 44ca803237a5..170000d6af94 100644 > > --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c > > +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c > > @@ -476,9 +476,8 @@ static const struct drm_ioctl_desc etnaviv_ioctls[]= =3D { > > ETNA_IOCTL(PM_QUERY_SIG, pm_query_sig, DRM_RENDER_ALLOW), > > }; > > > > -static void etnaviv_fop_show_fdinfo(struct seq_file *m, struct file *f= ) > > +static void etnaviv_fop_show_fdinfo(struct drm_printer *p, struct drm_= file *file) > > { > > - struct drm_file *file =3D f->private_data; > > struct drm_device *dev =3D file->minor->dev; > > struct etnaviv_drm_private *priv =3D dev->dev_private; > > struct etnaviv_file_private *ctx =3D file->driver_priv; > > @@ -487,8 +486,6 @@ static void etnaviv_fop_show_fdinfo(struct seq_file= *m, struct file *f) > > * For a description of the text output format used here, see > > * Documentation/gpu/drm-usage-stats.rst. > > */ > > - seq_printf(m, "drm-driver:\t%s\n", dev->driver->name); > > - seq_printf(m, "drm-client-id:\t%u\n", ctx->id); > > > > for (int i =3D 0; i < ETNA_MAX_PIPES; i++) { > > struct etnaviv_gpu *gpu =3D priv->gpu[i]; > > @@ -507,7 +504,7 @@ static void etnaviv_fop_show_fdinfo(struct seq_file= *m, struct file *f) > > cur =3D snprintf(engine + cur, sizeof(engine) - c= ur, > > "%sNN", cur ? "/" : ""); > > > > - seq_printf(m, "drm-engine-%s:\t%llu ns\n", engine, > > + drm_printf(p, "drm-engine-%s:\t%llu ns\n", engine, > > ctx->sched_entity[i].elapsed_ns); > > } > > } > > @@ -515,7 +512,7 @@ static void etnaviv_fop_show_fdinfo(struct seq_file= *m, struct file *f) > > static const struct file_operations fops =3D { > > .owner =3D THIS_MODULE, > > DRM_GEM_FOPS, > > - .show_fdinfo =3D etnaviv_fop_show_fdinfo, > > + .show_fdinfo =3D drm_fop_show_fdinfo, > > }; > > > > static const struct drm_driver etnaviv_drm_driver =3D { > > @@ -529,6 +526,7 @@ static const struct drm_driver etnaviv_drm_driver = =3D { > > #ifdef CONFIG_DEBUG_FS > > .debugfs_init =3D etnaviv_debugfs_init, > > #endif > > + .show_fdinfo =3D etnaviv_fop_show_fdinfo, > > .ioctls =3D etnaviv_ioctls, > > .num_ioctls =3D DRM_ETNAVIV_NUM_IOCTLS, > > .fops =3D &fops, > > -- > > 2.39.2 > > > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch