From patchwork Thu Jun 28 18:28:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10494725 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 7C5E460325 for ; Thu, 28 Jun 2018 18:29:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 816052A762 for ; Thu, 28 Jun 2018 18:29:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75CB92A780; Thu, 28 Jun 2018 18:29:39 +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 DFCBB2A762 for ; Thu, 28 Jun 2018 18:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967798AbeF1S3h (ORCPT ); Thu, 28 Jun 2018 14:29:37 -0400 Received: from mail-yb0-f193.google.com ([209.85.213.193]:34136 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967882AbeF1S3L (ORCPT ); Thu, 28 Jun 2018 14:29:11 -0400 Received: by mail-yb0-f193.google.com with SMTP id e9-v6so2384041ybq.1 for ; Thu, 28 Jun 2018 11:29:11 -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=t4zNKqOnAWXS889Bq84nGNXDrIuEc2mENMuww8xCMfA=; b=C0NQV2KCYIiKQPQZaYA5a5X7GOmsj99a985x99Zefb8JdnMbW5KPFw8ZOlY6eB6a// ogl1Gfcwdqi1frNlFTFTUigppqGD+3XvjSt/l9urXRPwjrs7EcEGFGOmZ4Hp9qgNJeCw ed+L8Jk5nIYknvgIxcb3lQv4pahnsRg1peXz4= 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=t4zNKqOnAWXS889Bq84nGNXDrIuEc2mENMuww8xCMfA=; b=R7ADYDahfv73qesT2AChvt7nzq6+aXgvsmSFjgMi062QZcqRnY33iwd3xvyqVyoEvf OK+6cUdV9ISSX/07YoHsK1EELenxTaFMt4jZ+eyxR0QRmelCEw2Ynn9noWlbeOQs716j dY7WeT3n87rhU3+lS0CYc+6NXl1FfGTGtpfdNQqYHjZIlVHJlPHe3KfKV9etLX8Q0F2A CREdSq5cS+RCQEI9pf930X/Oe/HulxLDt4GmH6I/20Us2ntK6eq12KnMFUlnO+H4ZcVt y+ikoYPrAPkFhELs4pWYqS9X4rL64V4u1Uncn5+DNexuzxFoKlf+hNLZ5aRCxRMLZFH7 P7nA== X-Gm-Message-State: APt69E1MmYNKXPVVoyeBimP+M6ATFEZKt+l9Kbo8zVtt9NsbJTCZKMNL kLPuk2fbnvWe0SqPi9QZGm06yzpRuRQ= X-Google-Smtp-Source: ADUXVKKoOawCgZtjIQ0eGNOSXXKJik+jm+miX954wQcR4V369nTL4GJYs39A9uYkGBIbzWLUg7sv+A== X-Received: by 2002:a25:a268:: with SMTP id b95-v6mr5815292ybi.88.1530210550950; Thu, 28 Jun 2018 11:29:10 -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.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 11:29:10 -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 03/15] drm/msm: Move dpu_dbg init/destroy into dpu_kms Date: Thu, 28 Jun 2018 14:28:54 -0400 Message-Id: <20180628182906.84926-4-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 No need to have this in msm_drv, so move it into dpu. While we're at it, remove the other CONFIG_DRM_MSM_DPU ifdef gates. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 18 ++++++++++- drivers/gpu/drm/msm/msm_drv.c | 41 ------------------------- 2 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 3003176e731d..0b813a089cba 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -279,6 +279,12 @@ static int _dpu_debugfs_init(struct dpu_kms *dpu_kms) if (!debugfs_root) return -EINVAL; + rc = dpu_dbg_debugfs_register(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); @@ -1072,6 +1078,8 @@ static void dpu_kms_destroy(struct msm_kms *kms) } dpu_kms = to_dpu_kms(kms); + + dpu_dbg_destroy(); _dpu_kms_hw_destroy(dpu_kms); } @@ -1401,10 +1409,16 @@ static int dpu_kms_hw_init(struct msm_kms *kms) goto end; } + rc = dpu_dbg_init(&dpu_kms->pdev->dev); + if (rc) { + DRM_ERROR("failed to init dpu dbg: %d\n", rc); + goto end; + } + priv = dev->dev_private; if (!priv) { DPU_ERROR("invalid private data\n"); - goto end; + goto dbg_destroy; } dpu_kms->mmio = msm_ioremap(dpu_kms->pdev, "mdp_phys", "mdp_phys"); @@ -1592,6 +1606,8 @@ static int dpu_kms_hw_init(struct msm_kms *kms) pm_runtime_put_sync(&dpu_kms->pdev->dev); error: _dpu_kms_hw_destroy(dpu_kms); +dbg_destroy: + dpu_dbg_destroy(); end: return rc; } diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 51d6b310ca33..6177b3f18912 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -26,9 +26,6 @@ #include "msm_fence.h" #include "msm_gpu.h" #include "msm_kms.h" -#ifdef CONFIG_DRM_MSM_DPU -#include "dpu_dbg.h" -#endif /* * MSM driver version: @@ -307,10 +304,6 @@ static int msm_drm_uninit(struct device *dev) component_unbind_all(dev, ddev); -#ifdef CONFIG_DRM_MSM_DPU - dpu_dbg_destroy(); -#endif - debugfs_remove_recursive(priv->debug_root); if (mdss && mdss->funcs) @@ -485,14 +478,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) drm_mode_config_init(ddev); -#ifdef CONFIG_DRM_MSM_DPU - ret = dpu_dbg_init(&pdev->dev); - if (ret) { - dev_err(dev, "failed to init dpu dbg: %d\n", ret); - goto dbg_init_fail; - } -#endif - msm_gem_shrinker_init(ddev); ret = msm_init_vram(ddev); @@ -511,11 +496,9 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) case KMS_MDP5: kms = mdp5_kms_init(ddev); break; -#ifdef CONFIG_DRM_MSM_DPU case KMS_DPU: kms = dpu_kms_init(ddev); break; -#endif default: kms = ERR_PTR(-ENODEV); break; @@ -665,14 +648,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) goto fail; } -#ifdef CONFIG_DRM_MSM_DPU - ret = dpu_dbg_debugfs_register(priv->debug_root); - if (ret) { - dev_err(dev, "failed to reg dpu dbg debugfs: %d\n", ret); - goto fail; - } -#endif - /* perform subdriver post initialization */ if (kms && kms->funcs && kms->funcs->postinit) { ret = kms->funcs->postinit(kms); @@ -690,10 +665,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) msm_drm_uninit(dev); return ret; bind_fail: -#ifdef CONFIG_DRM_MSM_DPU - dpu_dbg_destroy(); -dbg_init_fail: -#endif if (mdss && mdss->funcs) mdss->funcs->destroy(ddev); mdss_init_fail: @@ -1413,9 +1384,7 @@ static int msm_pdev_remove(struct platform_device *pdev) static const struct of_device_id dt_match[] = { { .compatible = "qcom,mdp4", .data = (void *)KMS_MDP4 }, { .compatible = "qcom,mdss", .data = (void *)KMS_MDP5 }, -#ifdef CONFIG_DRM_MSM_DPU { .compatible = "qcom,dpu-mdss", .data = (void *)KMS_DPU }, -#endif {} }; MODULE_DEVICE_TABLE(of, dt_match); @@ -1430,16 +1399,6 @@ static struct platform_driver msm_platform_driver = { }, }; -#ifdef CONFIG_QCOM_KGSL -void __init adreno_register(void) -{ -} - -void __exit adreno_unregister(void) -{ -} -#endif - static int __init msm_drm_register(void) { if (!modeset)