From patchwork Wed Dec 5 16:29:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10714561 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 F1F9113AF for ; Wed, 5 Dec 2018 16:30:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1A052D022 for ; Wed, 5 Dec 2018 16:30:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D58782DC14; Wed, 5 Dec 2018 16:30:08 +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 639CF2D022 for ; Wed, 5 Dec 2018 16:30:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727240AbeLEQaH (ORCPT ); Wed, 5 Dec 2018 11:30:07 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:34392 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbeLEQaH (ORCPT ); Wed, 5 Dec 2018 11:30:07 -0500 Received: by mail-yb1-f193.google.com with SMTP id a67-v6so8672817ybg.1 for ; Wed, 05 Dec 2018 08:30:07 -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=ZLcCLmYrUSTqkm4Fxp5QX6ca0QRp5eb+NvG21zkSHXA=; b=MrWVsNz26LY6iRxmDb9+v2grf2ACGbPELX5fHps1kA2k5uML2xJeRzElc5j8QQFcjg JULUHXFmkOSTHyY7aZEAHwpfvCx3ZStyO88A6Z9/CLm0aupMNKBVgW/ZYjlLVV+i087k rNNfJQpjMwac7tZEMJUkFZgg5abMJPmGhXnGCbqIO+aWZWFDWgu0vBROns9wLITc/6nd 9nSdmnTP/e+WFSyI6oeGcRJF7q91DI0xOvI23GmyFWTjDZu8e2vqahrR8Y4rD5VXVT8I ep9ZDbQM6jefXmN3eYk7qQRIt9WzED1mzsOfPo6oI8WLNIWeafB1kty1veSGNlYtv7nl G0NA== 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=ZLcCLmYrUSTqkm4Fxp5QX6ca0QRp5eb+NvG21zkSHXA=; b=THyFbDGePV13vdZsYSuh+TCA7oYCnoi/gREEooftFwc0YY+Os2Dy295cewqhn8XGup PLWlK8LzOBvd5h8tkRSrvF6doRFY1z4LnPA9fCRc3vcznTqF1oXOtOoUpAGcVISxekb2 8SAp1zhVJWS7rMOldta3d6pR+rB52xjrjyGP0+Y1I6+REcCQR24IUWuvOeeTWqpu1ZE8 4zr9ieuy0sjn/yramWe6v9t9HH/r7aMOcEh4lJZ7mFhSIuLa6jgohDJKwsEaXVEXPXWy IIagrMKT66yKmUzqWDuJpGtgtwuda/y3ff3TZAV5+5brOAbNzxT7yu0PjEBcqQLMJ8Jx 68Tw== X-Gm-Message-State: AA+aEWaiVJhpKzPBoARS7Opnv7hj5n3W3voy8FC/41kQTLqLTrcwvRlS mnwc7fCryT48m9zKyGrUgzAdwQ== X-Google-Smtp-Source: AFSGD/V0OW9eQwAeeF+zZBpXIVbKyTDvQxpLODp04wWiTK1Y3De3mqD9xuTPpfygiAI5dvM2R+A/fA== X-Received: by 2002:a25:14d5:: with SMTP id 204-v6mr24624704ybu.109.1544027406847; Wed, 05 Dec 2018 08:30:06 -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.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 08:30:06 -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 4/9] drm/msm: Don't track planes in msm private struct Date: Wed, 5 Dec 2018 11:29:36 -0500 Message-Id: <20181205162958.25025-4-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 | 7 +++---- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 2 -- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 2 -- drivers/gpu/drm/msm/msm_drv.h | 3 --- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index cbebc04e2d6ef..8dede6cb9b7d7 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -496,6 +496,7 @@ static void _dpu_kms_drm_obj_destroy(struct dpu_kms *dpu_kms) { struct msm_drm_private *priv; struct drm_crtc *crtc; + struct drm_plane *plane; struct drm_encoder *encoder; int i; @@ -514,9 +515,8 @@ static void _dpu_kms_drm_obj_destroy(struct dpu_kms *dpu_kms) drm_for_each_crtc(crtc, dpu_kms->dev) crtc->funcs->destroy(crtc); - for (i = 0; i < priv->num_planes; i++) - priv->planes[i]->funcs->destroy(priv->planes[i]); - priv->num_planes = 0; + 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]); @@ -581,7 +581,6 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms) ret = PTR_ERR(plane); goto fail; } - priv->planes[priv->num_planes++] = plane; if (type == DRM_PLANE_TYPE_CURSOR) cursor_planes[cursor_planes_idx++] = plane; diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c index 527a4ee06819f..40e2b462a03e1 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c @@ -325,7 +325,6 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms, static int modeset_init(struct mdp4_kms *mdp4_kms) { struct drm_device *dev = mdp4_kms->dev; - struct msm_drm_private *priv = dev->dev_private; struct drm_plane *plane; struct drm_crtc *crtc; int i, ret; @@ -356,7 +355,6 @@ static int modeset_init(struct mdp4_kms *mdp4_kms) ret = PTR_ERR(plane); goto fail; } - priv->planes[priv->num_planes++] = plane; } for (i = 0; i < ARRAY_SIZE(mdp4_crtcs); i++) { diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 7cf54737944e4..0a1fa40d375ce 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -451,7 +451,6 @@ static int modeset_init_intf(struct mdp5_kms *mdp5_kms, static int modeset_init(struct mdp5_kms *mdp5_kms) { struct drm_device *dev = mdp5_kms->dev; - struct msm_drm_private *priv = dev->dev_private; struct drm_encoder *encoder; const struct mdp5_cfg_hw *hw_cfg; unsigned int num_crtcs; @@ -502,7 +501,6 @@ static int modeset_init(struct mdp5_kms *mdp5_kms) DRM_DEV_ERROR(dev->dev, "failed to construct plane %d (%d)\n", i, ret); goto fail; } - priv->planes[priv->num_planes++] = plane; if (type == DRM_PLANE_TYPE_PRIMARY) primary[pi++] = plane; diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 1902713ed84b0..6cd61199d20a0 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -191,9 +191,6 @@ struct msm_drm_private { struct workqueue_struct *wq; - unsigned int num_planes; - struct drm_plane *planes[MAX_PLANES]; - struct msm_drm_thread disp_thread[MAX_CRTCS]; struct msm_drm_thread event_thread[MAX_CRTCS];