From patchwork Wed Dec 5 16:29:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10714565 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2868914E2 for ; Wed, 5 Dec 2018 16:30:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 155422DC63 for ; Wed, 5 Dec 2018 16:30:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13B442DC14; Wed, 5 Dec 2018 16:30:12 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 886902DC51 for ; Wed, 5 Dec 2018 16:30:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727177AbeLEQaL (ORCPT ); Wed, 5 Dec 2018 11:30:11 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:37409 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727103AbeLEQaK (ORCPT ); Wed, 5 Dec 2018 11:30:10 -0500 Received: by mail-yw1-f65.google.com with SMTP id h193so8778455ywc.4 for ; Wed, 05 Dec 2018 08:30:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AFvJWLAJMpKA64yaJT6R+QidA40COE2wXiKPh9wS1Hc=; b=KG/LFGsj6AjdbTPdxMrdhy45VjlEiG+aN5oS4kGGwllskHUTQ8+ZI995eCcQzupz2k iOJzthpL8djiRpzz9G2/QKvNbAo4tkagTOmUTlwbso4SS8kWTNxN0ynCWEKDVDAIr2Yt 2uxtSsvir9qEAxwYl1F6UeZCdqjCEtykhi3pnVuxvcOMsYqDFpH0q9PTM7xvgPx5Y/t4 LC0i0pe0twQvFiVIK2FAxG+v6QRynXXjRAksJlMZklGQvmxh7MyV4B2Ur4osJOuxUjud QskhJB/nqrIPK63CYStIbNYEWnCP7xZ7KqOloNM/kcF0CKhqUjrSsd0w6viEVfoCD664 AMGw== 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:mime-version:content-transfer-encoding; bh=AFvJWLAJMpKA64yaJT6R+QidA40COE2wXiKPh9wS1Hc=; b=A/0IhrB+zbj+ta7ziQEzLtRvBUuWrwtd6ZtvzcEfBNu+CQfUdz5KCLS2JTgn5rPssD /M8l7N7IXbH20i/WalW65E1kdWJ1jc+QR6iklEU/BQVo1ZnD3uDCVwlI5mYM7lAd3l9g +SjnoASwr5YcNdB9gziXi6QNLHzqlzjaICA50J7fwRrXgUGQY2nm65ak6IYD8a4MaTCF p7tFoNd+wVT5r78YoYPT4FsfAHxtnSv3VRemDU66T0ovdDH0ge4X9HZg11uMUs5N4ehG VDv9+kyVyGfsEsGvLe2u4RS3mjp6MzVBWdvRGooGBUucCScFqfHo/hKe8SYIz2ZVcaRk zrpg== X-Gm-Message-State: AA+aEWaYcGWG3eI9yj7z2MLMGVEpsZaL8El8hQP+es2wGZTeuOUeZoT/ goET/TX15FnVDyncIkAxfI8zWTJQCXk= X-Google-Smtp-Source: AFSGD/VbhxsN8V44+ZdxDbMP9z+Ze8quGzlZDnPoB0Xw9ZvnJbLQsvF+iTMoMFatya0IKdEyVOqI3w== X-Received: by 2002:a81:1fd4:: with SMTP id f203mr24384944ywf.422.1544027408583; Wed, 05 Dec 2018 08:30:08 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id n133sm6460470ywb.55.2018.12.05.08.30.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 08:30:08 -0800 (PST) From: Sean Paul Cc: robdclark@gmail.com, jsanka@codeaurora.org, Sean Paul , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 5/9] drm/msm: Don't track connectors in msm private struct Date: Wed, 5 Dec 2018 11:29:37 -0500 Message-Id: <20181205162958.25025-5-sean@poorly.run> X-Mailer: git-send-email 2.20.0.rc1.387.gf8505762e3-goog In-Reply-To: <20181205162958.25025-1-sean@poorly.run> References: <20181205162958.25025-1-sean@poorly.run> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) 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 From: Sean Paul drm core already tracks this, so we can just lean on that instead of tracking ourselves. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 10 ++++++---- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 3 --- drivers/gpu/drm/msm/dsi/dsi.c | 2 -- drivers/gpu/drm/msm/edp/edp.c | 3 --- drivers/gpu/drm/msm/hdmi/hdmi.c | 3 --- drivers/gpu/drm/msm/msm_drv.h | 3 --- drivers/gpu/drm/msm/msm_fbdev.c | 2 +- 7 files changed, 7 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 8dede6cb9b7d7..4f2fcdfe2644e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -498,7 +498,8 @@ static void _dpu_kms_drm_obj_destroy(struct dpu_kms *dpu_kms) struct drm_crtc *crtc; struct drm_plane *plane; struct drm_encoder *encoder; - int i; + struct drm_connector_list_iter conn_iter; + struct drm_connector *connector; if (!dpu_kms) { DPU_ERROR("invalid dpu_kms\n"); @@ -518,9 +519,10 @@ static void _dpu_kms_drm_obj_destroy(struct dpu_kms *dpu_kms) drm_for_each_plane(plane, dpu_kms->dev) plane->funcs->destroy(plane); - for (i = 0; i < priv->num_connectors; i++) - priv->connectors[i]->funcs->destroy(priv->connectors[i]); - priv->num_connectors = 0; + drm_connector_list_iter_begin(dpu_kms->dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) + connector->funcs->destroy(connector); + drm_connector_list_iter_end(&conn_iter); drm_for_each_encoder(encoder, dpu_kms->dev) encoder->funcs->destroy(encoder); diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c index 40e2b462a03e1..e86134fed2244 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c @@ -265,9 +265,6 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms, DRM_DEV_ERROR(dev->dev, "failed to initialize LVDS connector\n"); return PTR_ERR(connector); } - - priv->connectors[priv->num_connectors++] = connector; - break; case DRM_MODE_ENCODER_TMDS: encoder = mdp4_dtv_encoder_init(dev); diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 97b906a9b3945..e1d990f316732 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -250,8 +250,6 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, goto fail; } - priv->connectors[priv->num_connectors++] = msm_dsi->connector; - return 0; fail: /* bridge/connector are normally destroyed by drm: */ diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c index 694c2d43011f6..10adf89d5d469 100644 --- a/drivers/gpu/drm/msm/edp/edp.c +++ b/drivers/gpu/drm/msm/edp/edp.c @@ -148,7 +148,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev, struct drm_encoder *encoder) { struct platform_device *pdev = edp->pdev; - struct msm_drm_private *priv = dev->dev_private; int ret; edp->encoder = encoder; @@ -188,8 +187,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev, encoder->bridge = edp->bridge; - priv->connectors[priv->num_connectors++] = edp->connector; - return 0; fail: diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 1901ae820ef0b..ce564331e6080 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -291,7 +291,6 @@ static struct hdmi *msm_hdmi_init(struct platform_device *pdev) int msm_hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev, struct drm_encoder *encoder) { - struct msm_drm_private *priv = dev->dev_private; struct platform_device *pdev = hdmi->pdev; int ret; @@ -340,8 +339,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, encoder->bridge = hdmi->bridge; - priv->connectors[priv->num_connectors++] = hdmi->connector; - platform_set_drvdata(pdev, hdmi); return 0; diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 6cd61199d20a0..6c013addce68c 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -194,9 +194,6 @@ struct msm_drm_private { struct msm_drm_thread disp_thread[MAX_CRTCS]; struct msm_drm_thread event_thread[MAX_CRTCS]; - unsigned int num_connectors; - struct drm_connector *connectors[MAX_CONNECTORS]; - /* Properties */ struct drm_property *plane_property[PLANE_PROP_MAX_NUM]; diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c index c03e860ba737f..a62ef39d65f25 100644 --- a/drivers/gpu/drm/msm/msm_fbdev.c +++ b/drivers/gpu/drm/msm/msm_fbdev.c @@ -174,7 +174,7 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev) drm_fb_helper_prepare(dev, helper, &msm_fb_helper_funcs); - ret = drm_fb_helper_init(dev, helper, priv->num_connectors); + ret = drm_fb_helper_init(dev, helper, dev->mode_config.num_connector); if (ret) { DRM_DEV_ERROR(dev->dev, "could not init fbdev: ret=%d\n", ret); goto fail;