From patchwork Thu Jun 28 18:28:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10494705 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D020760532 for ; Thu, 28 Jun 2018 18:29:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D571D2A762 for ; Thu, 28 Jun 2018 18:29:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C94AF2A78F; Thu, 28 Jun 2018 18:29:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F7F22A762 for ; Thu, 28 Jun 2018 18:29:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030484AbeF1S3S (ORCPT ); Thu, 28 Jun 2018 14:29:18 -0400 Received: from mail-yb0-f193.google.com ([209.85.213.193]:38948 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966642AbeF1S3O (ORCPT ); Thu, 28 Jun 2018 14:29:14 -0400 Received: by mail-yb0-f193.google.com with SMTP id k127-v6so2379837ybk.6 for ; Thu, 28 Jun 2018 11:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vKS1LBu73OLXzwuIh3/u4lEScoJITHbylwAHvgDLOHQ=; b=TgbiVMsxNd08268Lyf+FMgxIPBC06QuKWpnUtZX3TWMjFUxUogrLd8G2hinYhPhUoS LAEQmKQ7KJVRGLItsXM8i835WCK8Kk06+SNoGVecEPh4fURovtlTxzFekN5w/lLfqQ8Q d9SoEXGL+dl3E6FwX51dCU8UOcAfi1sXdFHkQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vKS1LBu73OLXzwuIh3/u4lEScoJITHbylwAHvgDLOHQ=; b=RIDcpPx00Y0/7Q4Gt7bFt3Us8U01YArUzrmgNPC8Me9Bep5voippWsDrCwJoEBBEZ9 Qfc9PpjBMg59nIL1JD7j4zoKIFYbfTXGA2lrfQmkjFDVoab1loyKCU7kXEFDL1hD8TJR ABVIxQwfB5fnUOqAv3j006LI2+Tnn/7J0ifuQVT2YlqrVU4RvTwTDJd3bdR9NoLFcUe6 rkI0up2th3GJmXLc0j2D9IHSsmKNQPBDqXMbfgsrTYHsEGvWo09FxjBJ4IvCTYgp+//R pOomFQIhQVxSoAB5XMt/2hBL4G4mEo7WYu81Js74Srw0SjzKLYJYqcRtiijsgQ6mQo+G VCbA== X-Gm-Message-State: APt69E137fuO4r4OPJXgzvgZ/zM89GCgOwPTCptDnRSjzrAC96aXUuss HassQiMXAKfDshl5k7rtTgkp8Q== X-Google-Smtp-Source: ADUXVKI/c1WAFFfdY9nVlN0V+yF9rJo65FHt9tStKU/8FugztnLtvXFhg9L/sDcfss7TDUsdlspzvA== X-Received: by 2002:a25:69cc:: with SMTP id e195-v6mr5625472ybc.154.1530210553435; Thu, 28 Jun 2018 11:29:13 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id g145-v6sm2732140ywe.17.2018.06.28.11.29.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 11:29:12 -0700 (PDT) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: robdclark@gmail.com, hoegsberg@chromium.org, jsanka@codeaurora.org, abhinavk@codeaurora.org, Sean Paul Subject: [DPU PATCH 06/15] drm/msm: Move debugfs root tracking to dpu Date: Thu, 28 Jun 2018 14:28:57 -0400 Message-Id: <20180628182906.84926-7-seanpaul@chromium.org> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog In-Reply-To: <20180628182906.84926-1-seanpaul@chromium.org> References: <20180628182906.84926-1-seanpaul@chromium.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't use it for anything else, so hide it in dpu. A few other whitespace/trivial fixes to revert dpu changes in msm. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 37 ++++++++++--------------- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 1 + drivers/gpu/drm/msm/msm_drv.c | 13 --------- drivers/gpu/drm/msm/msm_drv.h | 8 +----- 4 files changed, 17 insertions(+), 42 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index beba919a6ef6..61eecae15ab3 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -272,46 +272,38 @@ void *dpu_debugfs_create_regset32(const char *name, umode_t mode, regset, &dpu_fops_regset32); } -void *dpu_debugfs_get_root(struct dpu_kms *dpu_kms) -{ - struct msm_drm_private *priv; - - if (!dpu_kms || !dpu_kms->dev || !dpu_kms->dev->dev_private) - return NULL; - - priv = dpu_kms->dev->dev_private; - return priv->debug_root; -} - static int _dpu_debugfs_init(struct dpu_kms *dpu_kms) { void *p; int rc; - void *debugfs_root; p = dpu_hw_util_get_log_mask_ptr(); if (!dpu_kms || !p) return -EINVAL; - debugfs_root = dpu_debugfs_get_root(dpu_kms); - if (!debugfs_root) - return -EINVAL; + dpu_kms->debugfs_root = debugfs_create_dir("debug", + dpu_kms->dev->primary->debugfs_root); + if (IS_ERR_OR_NULL(dpu_kms->debugfs_root)) { + DRM_ERROR("debugfs create_dir failed %ld\n", + PTR_ERR(dpu_kms->debugfs_root)); + return PTR_ERR(dpu_kms->debugfs_root); + } - rc = dpu_dbg_debugfs_register(debugfs_root); + rc = dpu_dbg_debugfs_register(dpu_kms->debugfs_root); if (rc) { DRM_ERROR("failed to reg dpu dbg debugfs: %d\n", rc); return rc; } - /* allow debugfs_root to be NULL */ - debugfs_create_x32(DPU_DEBUGFS_HWMASKNAME, 0600, debugfs_root, p); + /* allow root to be NULL */ + debugfs_create_x32(DPU_DEBUGFS_HWMASKNAME, 0600, dpu_kms->debugfs_root, p); - (void) dpu_debugfs_danger_init(dpu_kms, debugfs_root); - (void) dpu_debugfs_vbif_init(dpu_kms, debugfs_root); - (void) dpu_debugfs_core_irq_init(dpu_kms, debugfs_root); + (void) dpu_debugfs_danger_init(dpu_kms, dpu_kms->debugfs_root); + (void) dpu_debugfs_vbif_init(dpu_kms, dpu_kms->debugfs_root); + (void) dpu_debugfs_core_irq_init(dpu_kms, dpu_kms->debugfs_root); - rc = dpu_core_perf_debugfs_init(&dpu_kms->perf, debugfs_root); + rc = dpu_core_perf_debugfs_init(&dpu_kms->perf, dpu_kms->debugfs_root); if (rc) { DPU_ERROR("failed to init perf %d\n", rc); return rc; @@ -327,6 +319,7 @@ static void _dpu_debugfs_destroy(struct dpu_kms *dpu_kms) dpu_debugfs_vbif_destroy(dpu_kms); dpu_debugfs_danger_destroy(dpu_kms); dpu_debugfs_core_irq_destroy(dpu_kms); + debugfs_remove_recursive(dpu_kms->debugfs_root); } } #else diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h index fb4ae84a388a..4f86a51affdc 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h @@ -153,6 +153,7 @@ struct dpu_kms { struct dpu_power_event *power_event; /* directory entry for debugfs */ + struct dentry *debugfs_root; struct dentry *debugfs_danger; struct dentry *debugfs_vbif; diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 5181f997f071..bcd001603768 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -16,7 +16,6 @@ * this program. If not, see . */ -#include #include #include #include @@ -281,8 +280,6 @@ static int msm_drm_uninit(struct device *dev) component_unbind_all(dev, ddev); - debugfs_remove_recursive(priv->debug_root); - if (mdss && mdss->funcs) mdss->funcs->destroy(ddev); @@ -596,15 +593,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) if (ret) goto fail; - priv->debug_root = debugfs_create_dir("debug", - ddev->primary->debugfs_root); - if (IS_ERR_OR_NULL(priv->debug_root)) { - pr_err("debugfs_root create_dir fail, error %ld\n", - PTR_ERR(priv->debug_root)); - priv->debug_root = NULL; - goto fail; - } - /* perform subdriver post initialization */ if (kms && kms->funcs && kms->funcs->postinit) { ret = kms->funcs->postinit(kms); @@ -1091,7 +1079,6 @@ static int msm_pm_resume(struct device *dev) return kms->funcs->pm_resume(dev); drm_atomic_helper_resume(ddev, priv->pm_state); - drm_kms_helper_poll_enable(ddev); return 0; diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index da7daacc5eb8..4a2f87fe11a9 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -74,11 +74,10 @@ struct msm_file_private { }; enum msm_mdp_plane_property { - /* range properties */ PLANE_PROP_ZPOS, PLANE_PROP_ALPHA, PLANE_PROP_PREMULTIPLIED, - PLANE_PROP_MAX_NUM, + PLANE_PROP_MAX_NUM }; struct msm_vblank_ctrl { @@ -238,9 +237,6 @@ struct msm_drm_private { /* whether registered and drm_dev_unregister should be called */ bool registered; - - /* msm drv debug root node */ - struct dentry *debug_root; }; /* get struct msm_kms * from drm_device * */ @@ -367,7 +363,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev, struct drm_encoder *encoder); struct msm_dsi; - #ifdef CONFIG_DRM_MSM_DSI void __init msm_dsi_register(void); void __exit msm_dsi_unregister(void); @@ -390,7 +385,6 @@ static inline int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, void __init msm_mdp_register(void); void __exit msm_mdp_unregister(void); - void __init msm_dpu_register(void); void __exit msm_dpu_unregister(void);