From patchwork Mon May 15 14:30:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 94176 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6974895vqo; Mon, 15 May 2023 07:44:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5TAMVIjmS/5JxYHQVp8iMjLRK3GPRfqGAHKEK9AHVklcYOOIx8vKTB9UynYS1zti57pNdy X-Received: by 2002:a05:6a00:13a6:b0:643:d40c:7db1 with SMTP id t38-20020a056a0013a600b00643d40c7db1mr41262712pfg.3.1684161877744; Mon, 15 May 2023 07:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684161877; cv=none; d=google.com; s=arc-20160816; b=FPcUI9Tc2y1zNnM/+0F751HfuG94/+1mU/L/GV/cXhJsUte1WaaXCu6y2oSxz6dun7 XTjLLdyMr/eY0aR+f4+CzX3yTbbbA0Ltpo5rYPvleyvswJqREX3b78qxMvSCeZ4PZDGU rWLcmPQC+V5XN8Bd/BingLMIY+jSAiRuIRoqU7dzanTGBxhgmyXU66EHPzctTJLYrlEX ZfSh9838ckct15W345P0e1FL9JsIPie/o3WeB0TPuJSOLjupGXUPG91NI86HVCs4JufY hFpEwZmO+jRgKJ0XDMbIZjDwCHyPRrNaNGJEbz5D9K+6wxOccesrhfGoLsfbHcMEaxv6 TUgQ== 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=IPtbgHx5pvKBNpqMIwwso4Kz83kyTXBOXbUJsvgFKio=; b=RJ2A/0agGYWN4kguqU8fDV+Taxi9gqqo7JvrlAEs2p1juFu+ssbbNdvLIAQ0fcK3hJ H5uB52AJ5Ixna7JwTk4kLZdwD9VOgb/I1clLDB0aRxZiBmkO5jBLvfqOxrVKXtha/S3l XC/oLwLMOMtEB8TRT7uLFFLLzM5e0KSzQJUxoyA9YfLpy58ClZzWufzO8ehf/NqILkBc VD9jFuT9nqMyBuvmp7k3U6C5/MAd4Ycv8fmJ3N+lm1cjUMYN+boh48MpFgvLwGNXJLMf XHxs+oD1ff5jH5J0lfsEs3m57XNrejxdfzYsJrcnvzRDYXxSy0r025mn0ENl13kX6h15 Zpmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=h7IgYrEF; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v1-20020a637a01000000b0053007fe33aasi16155316pgc.425.2023.05.15.07.44.21; Mon, 15 May 2023 07:44:37 -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=h7IgYrEF; 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 S241290AbjEOOa6 (ORCPT + 99 others); Mon, 15 May 2023 10:30:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240914AbjEOOay (ORCPT ); Mon, 15 May 2023 10:30:54 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 325D211D; Mon, 15 May 2023 07:30:53 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6436e004954so13311352b3a.0; Mon, 15 May 2023 07:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684161052; x=1686753052; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IPtbgHx5pvKBNpqMIwwso4Kz83kyTXBOXbUJsvgFKio=; b=h7IgYrEFwajKVJ586ZDDv70DkO3URA7qqNdbXJOx6+Hy4RCSrL2yPbZXywpq5w6+y4 OcoXUxVoAoSkDrQ4pUVNlZHW4Q+gOGshZ0pzsm/pRn0m2/+qqVnYLEyj/nmVo+E2PCjA oAGUhjP5fB/ZEu8VEDM0iixekXob7I7Fkmh0xnZtD1ZyNM3EiaCW3nvDp88RklNt1ahl rPCpSkv8Z61oCgLpUUVqiqyvDpj/s4bkH1xNGTtZ0P6ZSczXe3gnr7vQXr1H0zdmRRY5 vS65EHnMET4ad642Ra39vqN01oJqPOMw3McMQGgdAt+e0OTKBK1sme3h5tYjYJ6vjw7h /vKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684161052; x=1686753052; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IPtbgHx5pvKBNpqMIwwso4Kz83kyTXBOXbUJsvgFKio=; b=lllINPvTE1iPv31FHurU/slnPCO0r3Mfu3atkuhQmhVXrtS4tD7Q07nSNZY0ipJqfC mDe4EB/mdXjSFUw9y4vyQ5AYaTz+jRLBAPyAsxF9x8TqAbJbHCWshje1/VqlMVYjb8xM 1tSoB1w8SdxDqDs+qlgbekd4rhi7mlSUe44cII7s8TgthgMbMMMy0e4VzluHImeEI4rX 2WZxJCdxAFaxrc0qIjsTLRMEgRCx00Ftq++1fPhcdmVYwzDEKIrhC2zQ47q/oPZSnz4s WIM2EiCcdCCUs1w4Ji3pw3s0vOwHD+FfTAUKq5VSQ8eNWsK8VwTQVVKaDGB91I3v5XN8 ZQxQ== X-Gm-Message-State: AC+VfDwR7xvPei0fQzT+/iayjLj0m5hHxA+sIbZ2wbnEYP1HvzOKjBef 2SqLHAsAkVoHN7bCBywWdjM= X-Received: by 2002:a05:6a21:9988:b0:100:3964:6cb with SMTP id ve8-20020a056a21998800b00100396406cbmr36102198pzb.40.1684161052599; Mon, 15 May 2023 07:30:52 -0700 (PDT) Received: from localhost ([2a00:79e1:abd:4a00:61b:48ed:72ab:435b]) by smtp.gmail.com with ESMTPSA id s145-20020a632c97000000b0050bc4ca9024sm11564000pgs.65.2023.05.15.07.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 07:30:52 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org, Daniel Vetter , Tvrtko Ursulin , Boris Brezillon , Christopher Healy , Emil Velikov , =?utf-8?q?Christian_K=C3=B6nig?= , Rob Clark , Dmitry Baryshkov , Rob Clark , Abhinav Kumar , Sean Paul , David Airlie , linux-arm-msm@vger.kernel.org (open list:DRM DRIVER FOR MSM ADRENO GPU), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v4 3/9] drm/msm: Switch to fdinfo helper Date: Mon, 15 May 2023 07:30:10 -0700 Message-Id: <20230515143023.801167-4-robdclark@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515143023.801167-1-robdclark@gmail.com> References: <20230515143023.801167-1-robdclark@gmail.com> MIME-Version: 1.0 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,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765971725364565904?= X-GMAIL-MSGID: =?utf-8?q?1765971725364565904?= From: Rob Clark Now that we have a common helper, use it. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_drv.c | 11 +++++------ drivers/gpu/drm/msm/msm_gpu.c | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 2f2f9e42c519..467c689a95f2 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1036,57 +1036,56 @@ static const struct drm_ioctl_desc msm_ioctls[] = { DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_PREP, msm_ioctl_gem_cpu_prep, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_FINI, msm_ioctl_gem_cpu_fini, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(MSM_GEM_SUBMIT, msm_ioctl_gem_submit, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(MSM_WAIT_FENCE, msm_ioctl_wait_fence, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(MSM_GEM_MADVISE, msm_ioctl_gem_madvise, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(MSM_SUBMITQUEUE_NEW, msm_ioctl_submitqueue_new, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(MSM_SUBMITQUEUE_CLOSE, msm_ioctl_submitqueue_close, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(MSM_SUBMITQUEUE_QUERY, msm_ioctl_submitqueue_query, DRM_RENDER_ALLOW), }; -static void msm_fop_show_fdinfo(struct seq_file *m, struct file *f) +static void msm_show_fdinfo(struct drm_printer *p, struct drm_file *file) { - struct drm_file *file = f->private_data; struct drm_device *dev = file->minor->dev; struct msm_drm_private *priv = dev->dev_private; - struct drm_printer p = drm_seq_file_printer(m); if (!priv->gpu) return; - msm_gpu_show_fdinfo(priv->gpu, file->driver_priv, &p); + msm_gpu_show_fdinfo(priv->gpu, file->driver_priv, p); } static const struct file_operations fops = { .owner = THIS_MODULE, DRM_GEM_FOPS, - .show_fdinfo = msm_fop_show_fdinfo, + .show_fdinfo = drm_show_fdinfo, }; static const struct drm_driver msm_driver = { .driver_features = DRIVER_GEM | DRIVER_RENDER | DRIVER_ATOMIC | DRIVER_MODESET | DRIVER_SYNCOBJ, .open = msm_open, - .postclose = msm_postclose, + .postclose = msm_postclose, .lastclose = drm_fb_helper_lastclose, .dumb_create = msm_gem_dumb_create, .dumb_map_offset = msm_gem_dumb_map_offset, .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 = msm_gem_prime_import_sg_table, .gem_prime_mmap = msm_gem_prime_mmap, #ifdef CONFIG_DEBUG_FS .debugfs_init = msm_debugfs_init, #endif + .show_fdinfo = msm_show_fdinfo, .ioctls = msm_ioctls, .num_ioctls = ARRAY_SIZE(msm_ioctls), .fops = &fops, .name = "msm", .desc = "MSM Snapdragon DRM", .date = "20130625", .major = MSM_VERSION_MAJOR, .minor = MSM_VERSION_MINOR, .patchlevel = MSM_VERSION_PATCHLEVEL, }; diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index b1647b851018..52db90e34ead 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -144,22 +144,20 @@ int msm_gpu_pm_suspend(struct msm_gpu *gpu) return ret; gpu->suspend_count++; return 0; } void msm_gpu_show_fdinfo(struct msm_gpu *gpu, struct msm_file_private *ctx, struct drm_printer *p) { - drm_printf(p, "drm-driver:\t%s\n", gpu->dev->driver->name); - drm_printf(p, "drm-client-id:\t%u\n", ctx->seqno); drm_printf(p, "drm-engine-gpu:\t%llu ns\n", ctx->elapsed_ns); drm_printf(p, "drm-cycles-gpu:\t%llu\n", ctx->cycles); drm_printf(p, "drm-maxfreq-gpu:\t%u Hz\n", gpu->fast_rate); } int msm_gpu_hw_init(struct msm_gpu *gpu) { int ret; WARN_ON(!mutex_is_locked(&gpu->lock));