From patchwork Mon Sep 4 01:53:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 720030 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 008B1CA0FE3 for ; Mon, 4 Sep 2023 01:53:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237088AbjIDBxr (ORCPT ); Sun, 3 Sep 2023 21:53:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240586AbjIDBxr (ORCPT ); Sun, 3 Sep 2023 21:53:47 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1009E7 for ; Sun, 3 Sep 2023 18:53:43 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2bcde83ce9fso14959901fa.1 for ; Sun, 03 Sep 2023 18:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693792422; x=1694397222; darn=vger.kernel.org; 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=BTtKn/J1k9sfk/fyOsFRulPqHOclNW7fP9voBuBEnyk=; b=pXi/epLaf1wGRMDQFJkY7cSve9S3M2n4CDZ9v0Lkjd600V/xlycyDuVsecOdvxyk+2 dOPZPa5790jGTRoM8YfDxU4sdb7qHse4PJHVYdIrB575yDAGehzAzl5I15JxoMS7pQp/ H8ARkVadpVK5ZPNx+uGCXOaIMz7JObAlBY8iH7lf0/uHwdxhdaFjPqtn1KJEYzIc6Rbq /jBg6aBzrNqFFgz0nJOL61M38FzPzaBE1RI2ZyghJRS1O6cp4u5OwcKj+sXwdEJamg6K ZncCmPqCBeOqQ4yglsLHVnegXZFeWxPCThs5LdttBG+AufYYlGGy+hVpRSdm0zmcQ50I nwXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693792422; x=1694397222; 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=BTtKn/J1k9sfk/fyOsFRulPqHOclNW7fP9voBuBEnyk=; b=h3xlMaFDl8KTxE74l/EVMzFPNPfvVsaMUvTvT2EFYPM8A9BWs6xT2nPCzzNe7POem0 lJrr7h9P591VWGZZeIPrMGjyWT/szundnUz8vqDaEoHZykQC7FY5f0X4nRWcGeh2iFmE XA4pKnqQpUpXaL+Ez5cL06Ag2EZSe9GQPD60KI8J1QdQ80ng6XKCltrd7XuDoxup41H+ 2zygYiKZWGThyNNX7UOFJdz9BgcAZ8FUIJVOQ+wqg32INz9gheDBrNmDi8arPOSsF9kD Q71n44l8eHjafgMFaOXJI5VNvwMKQ5BIhH1YAu0Hhjh4zDpxS2dR039/qTq7eVW7AHD+ b3AA== X-Gm-Message-State: AOJu0Yxia2lMQ/riq5luRFOfu+jIPiSZ8COJ0HvSGfJEWmKryQUknqMi O5Wv2ZCUzAsNHyJb39sCGGBHQg== X-Google-Smtp-Source: AGHT+IEvwjnbDSz8/au6NJ2uDEmaZAs1o17IPKjclpVWzd/6tjjypwk2exCpVbKLsi4YDfdMLPVKyg== X-Received: by 2002:a2e:9215:0:b0:2b9:3883:a765 with SMTP id k21-20020a2e9215000000b002b93883a765mr5662698ljg.31.1693792422145; Sun, 03 Sep 2023 18:53:42 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id o14-20020a2e9b4e000000b002b6d68b520esm1736657ljj.65.2023.09.03.18.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Sep 2023 18:53:41 -0700 (PDT) From: Dmitry Baryshkov To: David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Clark , Sean Paul , Abhinav Kumar Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH 3/3] drm/msm/dpu: move encoder status to standard encoder debugfs dir Date: Mon, 4 Sep 2023 04:53:38 +0300 Message-Id: <20230904015338.2941417-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230904015338.2941417-1-dmitry.baryshkov@linaro.org> References: <20230904015338.2941417-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Now as we have standard per-encoder debugfs directory, move DPU encoder status file to that directory. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 45 +++------------------ 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index d34e684a4178..b219382d1153 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -184,7 +184,6 @@ struct dpu_encoder_virt { struct drm_crtc *crtc; struct drm_connector *connector; - struct dentry *debugfs_root; struct mutex enc_lock; DECLARE_BITMAP(frame_busy_mask, MAX_PHYS_ENCODERS_PER_VIRTUAL); void (*crtc_frame_event_cb)(void *, u32 event); @@ -2096,7 +2095,8 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc) #ifdef CONFIG_DEBUG_FS static int _dpu_encoder_status_show(struct seq_file *s, void *data) { - struct dpu_encoder_virt *dpu_enc = s->private; + struct drm_encoder *drm_enc = s->private; + struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); int i; mutex_lock(&dpu_enc->enc_lock); @@ -2118,48 +2118,16 @@ static int _dpu_encoder_status_show(struct seq_file *s, void *data) DEFINE_SHOW_ATTRIBUTE(_dpu_encoder_status); -static int _dpu_encoder_init_debugfs(struct drm_encoder *drm_enc) +static void dpu_encoder_debugfs_init(struct drm_encoder *drm_enc, struct dentry *root) { - struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc); - - char name[12]; - - if (!drm_enc->dev) { - DPU_ERROR("invalid encoder or kms\n"); - return -EINVAL; - } - - snprintf(name, sizeof(name), "encoder%u", drm_enc->base.id); - - /* create overall sub-directory for the encoder */ - dpu_enc->debugfs_root = debugfs_create_dir(name, - drm_enc->dev->primary->debugfs_root); - /* don't error check these */ debugfs_create_file("status", 0600, - dpu_enc->debugfs_root, dpu_enc, &_dpu_encoder_status_fops); - - return 0; + root, drm_enc, &_dpu_encoder_status_fops); } #else -static int _dpu_encoder_init_debugfs(struct drm_encoder *drm_enc) -{ - return 0; -} +#define dpu_encoder_debugfs_init NULL #endif -static int dpu_encoder_late_register(struct drm_encoder *encoder) -{ - return _dpu_encoder_init_debugfs(encoder); -} - -static void dpu_encoder_early_unregister(struct drm_encoder *encoder) -{ - struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(encoder); - - debugfs_remove_recursive(dpu_enc->debugfs_root); -} - static int dpu_encoder_virt_add_phys_encs( struct msm_display_info *disp_info, struct dpu_encoder_virt *dpu_enc, @@ -2343,8 +2311,7 @@ static const struct drm_encoder_helper_funcs dpu_encoder_helper_funcs = { static const struct drm_encoder_funcs dpu_encoder_funcs = { .destroy = dpu_encoder_destroy, - .late_register = dpu_encoder_late_register, - .early_unregister = dpu_encoder_early_unregister, + .debugfs_init = dpu_encoder_debugfs_init, }; struct drm_encoder *dpu_encoder_init(struct drm_device *dev,