From patchwork Wed Dec 5 16:29:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10714555 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 86B2E13AF for ; Wed, 5 Dec 2018 16:30:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73CC72D024 for ; Wed, 5 Dec 2018 16:30:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 676632D027; Wed, 5 Dec 2018 16:30:05 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 388832DC42 for ; Wed, 5 Dec 2018 16:30:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BBFE26E49D; Wed, 5 Dec 2018 16:30:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc44.google.com (mail-yw1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5CEDB6E49D for ; Wed, 5 Dec 2018 16:30:01 +0000 (UTC) Received: by mail-yw1-xc44.google.com with SMTP id l200so8757560ywe.10 for ; Wed, 05 Dec 2018 08:30:01 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=1VFBmLh7yCSA8aAVzBuiHPc5Af5h0q0mli7lxlnCI5U=; b=Ihvp/8/ksEz2M+RDgsCi2s/+fMDyLutid9KlkxMyNU69/ZTsMH5GMu9hZ0A63kk9JY yY3isGGSW8BfrkCvojj2hdVk4L7CE77ZOwiUEKy5hsBCY938rK6Q2itXIE/I+MN+FTee IpT3Drir7SEG/6kU+83+G3P6efL934zqkMQ6yVnADgWvRmoFjBFrz/hAmc+fIUdx5vwU yXN97P94nQOkeQ2tguY9mrlAwh/u0Hql9rixGMc8mtCFptTD3cduSrUExfCz7Qh0TPB3 TxELyMJdb7szqLDO7P3bOJX2MHH8msKbGM6rM9YCJQmKDwd/ZhPYiRWAl7OB6IWJrUIF sSpg== X-Gm-Message-State: AA+aEWbDUbtxLtBRC081BTd0DUn039r5Ti5CNkzBDMVn8dDgmhP1dddR 80penVWLLPfbQuMS3H3ABr93Lw== X-Google-Smtp-Source: AFSGD/VRvirxxIZrwa2rpI2rSGu1PxPl5TT34tDl3O+pCLS4YVIxJDNDb39HMOwU4JgSFCcKlWL7yQ== X-Received: by 2002:a81:1688:: with SMTP id 130mr1312189yww.271.1544027400401; Wed, 05 Dec 2018 08:30:00 -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.29.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 08:29:59 -0800 (PST) From: Sean Paul To: Subject: [PATCH 1/9] drm/msm: Don't track crtcs in msm private struct Date: Wed, 5 Dec 2018 11:29:33 -0500 Message-Id: <20181205162958.25025-1-sean@poorly.run> X-Mailer: git-send-email 2.20.0.rc1.387.gf8505762e3-goog MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Sean Paul , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 | 9 ++- drivers/gpu/drm/msm/disp/mdp4/mdp4_irq.c | 10 +-- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 4 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_irq.c | 10 +-- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 12 +--- drivers/gpu/drm/msm/msm_drv.c | 79 +++++++++++++----------- drivers/gpu/drm/msm/msm_drv.h | 3 - 7 files changed, 62 insertions(+), 65 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 1969f0d07d865..3796a2978a40b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -497,6 +497,7 @@ static void _dpu_kms_setup_displays(struct drm_device *dev, static void _dpu_kms_drm_obj_destroy(struct dpu_kms *dpu_kms) { struct msm_drm_private *priv; + struct drm_crtc *crtc; int i; if (!dpu_kms) { @@ -511,9 +512,8 @@ static void _dpu_kms_drm_obj_destroy(struct dpu_kms *dpu_kms) } priv = dpu_kms->dev->dev_private; - for (i = 0; i < priv->num_crtcs; i++) - priv->crtcs[i]->funcs->destroy(priv->crtcs[i]); - priv->num_crtcs = 0; + 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]); @@ -598,12 +598,11 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms) ret = PTR_ERR(crtc); goto fail; } - priv->crtcs[priv->num_crtcs++] = crtc; } /* All CRTCs are compatible with all encoders */ for (i = 0; i < priv->num_encoders; i++) - priv->encoders[i]->possible_crtcs = (1 << priv->num_crtcs) - 1; + priv->encoders[i]->possible_crtcs = (1 << max_crtc_count) - 1; return 0; fail: diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_irq.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_irq.c index b764d7f103127..7c597d21c97ba 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_irq.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_irq.c @@ -15,6 +15,7 @@ * this program. If not, see . */ +#include #include #include "msm_drv.h" @@ -79,8 +80,7 @@ irqreturn_t mdp4_irq(struct msm_kms *kms) struct mdp_kms *mdp_kms = to_mdp_kms(kms); struct mdp4_kms *mdp4_kms = to_mdp4_kms(mdp_kms); struct drm_device *dev = mdp4_kms->dev; - struct msm_drm_private *priv = dev->dev_private; - unsigned int id; + struct drm_crtc *crtc; uint32_t status, enable; enable = mdp4_read(mdp4_kms, REG_MDP4_INTR_ENABLE); @@ -91,9 +91,9 @@ irqreturn_t mdp4_irq(struct msm_kms *kms) mdp_dispatch_irqs(mdp_kms, status); - for (id = 0; id < priv->num_crtcs; id++) - if (status & mdp4_crtc_vblank(priv->crtcs[id])) - drm_handle_vblank(dev, id); + drm_for_each_crtc(crtc, dev) + if (status & mdp4_crtc_vblank(crtc)) + drm_handle_vblank(dev, drm_crtc_index(crtc)); return IRQ_HANDLED; } diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c index e437aa806f7be..f7f678c55e3ac 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c @@ -373,7 +373,7 @@ static int modeset_init(struct mdp4_kms *mdp4_kms) goto fail; } - crtc = mdp4_crtc_init(dev, plane, priv->num_crtcs, i, + crtc = mdp4_crtc_init(dev, plane, ARRAY_SIZE(mdp4_crtcs), i, mdp4_crtcs[i]); if (IS_ERR(crtc)) { DRM_DEV_ERROR(dev->dev, "failed to construct crtc for %s\n", @@ -381,8 +381,6 @@ static int modeset_init(struct mdp4_kms *mdp4_kms) ret = PTR_ERR(crtc); goto fail; } - - priv->crtcs[priv->num_crtcs++] = crtc; } /* diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_irq.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_irq.c index 280e368bc9bb8..c66a7fbd9b9c3 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_irq.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_irq.c @@ -17,6 +17,7 @@ #include +#include #include #include "msm_drv.h" @@ -92,8 +93,7 @@ irqreturn_t mdp5_irq(struct msm_kms *kms) struct mdp_kms *mdp_kms = to_mdp_kms(kms); struct mdp5_kms *mdp5_kms = to_mdp5_kms(mdp_kms); struct drm_device *dev = mdp5_kms->dev; - struct msm_drm_private *priv = dev->dev_private; - unsigned int id; + struct drm_crtc *crtc; uint32_t status, enable; enable = mdp5_read(mdp5_kms, REG_MDP5_INTR_EN); @@ -104,9 +104,9 @@ irqreturn_t mdp5_irq(struct msm_kms *kms) mdp_dispatch_irqs(mdp_kms, status); - for (id = 0; id < priv->num_crtcs; id++) - if (status & mdp5_crtc_vblank(priv->crtcs[id])) - drm_handle_vblank(dev, id); + drm_for_each_crtc(crtc, dev) + if (status & mdp5_crtc_vblank(crtc)) + drm_handle_vblank(dev, drm_crtc_index(crtc)); return IRQ_HANDLED; } diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index d27e35a217bd7..4fb70532b0484 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -520,7 +520,6 @@ static int modeset_init(struct mdp5_kms *mdp5_kms) DRM_DEV_ERROR(dev->dev, "failed to construct crtc %d (%d)\n", i, ret); goto fail; } - priv->crtcs[priv->num_crtcs++] = crtc; } /* @@ -530,7 +529,7 @@ static int modeset_init(struct mdp5_kms *mdp5_kms) for (i = 0; i < priv->num_encoders; i++) { struct drm_encoder *encoder = priv->encoders[i]; - encoder->possible_crtcs = (1 << priv->num_crtcs) - 1; + encoder->possible_crtcs = (1 << num_crtcs) - 1; } return 0; @@ -589,12 +588,11 @@ static bool mdp5_get_scanoutpos(struct drm_device *dev, unsigned int pipe, ktime_t *stime, ktime_t *etime, const struct drm_display_mode *mode) { - struct msm_drm_private *priv = dev->dev_private; struct drm_crtc *crtc; struct drm_encoder *encoder; int line, vsw, vbp, vactive_start, vactive_end, vfp_end; - crtc = priv->crtcs[pipe]; + crtc = drm_crtc_from_index(dev, pipe); if (!crtc) { DRM_ERROR("Invalid crtc %d\n", pipe); return false; @@ -646,14 +644,10 @@ static bool mdp5_get_scanoutpos(struct drm_device *dev, unsigned int pipe, static u32 mdp5_get_vblank_counter(struct drm_device *dev, unsigned int pipe) { - struct msm_drm_private *priv = dev->dev_private; struct drm_crtc *crtc; struct drm_encoder *encoder; - if (pipe >= priv->num_crtcs) - return 0; - - crtc = priv->crtcs[pipe]; + crtc = drm_crtc_from_index(dev, pipe); if (!crtc) return 0; diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 81bfac744a555..dcc671eba24dc 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -224,15 +224,19 @@ static void vblank_ctrl_worker(struct kthread_work *work) spin_lock_irqsave(&vbl_ctrl->lock, flags); list_for_each_entry_safe(vbl_ev, tmp, &vbl_ctrl->event_list, node) { + struct drm_crtc *crtc = drm_crtc_from_index(priv->dev, + vbl_ev->crtc_id); + + if (WARN_ON(!crtc)) + continue; + list_del(&vbl_ev->node); spin_unlock_irqrestore(&vbl_ctrl->lock, flags); if (vbl_ev->enable) - kms->funcs->enable_vblank(kms, - priv->crtcs[vbl_ev->crtc_id]); + kms->funcs->enable_vblank(kms, crtc); else - kms->funcs->disable_vblank(kms, - priv->crtcs[vbl_ev->crtc_id]); + kms->funcs->disable_vblank(kms, crtc); kfree(vbl_ev); @@ -270,12 +274,12 @@ static int msm_drm_uninit(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct drm_device *ddev = platform_get_drvdata(pdev); + struct drm_crtc *crtc; struct msm_drm_private *priv = ddev->dev_private; struct msm_kms *kms = priv->kms; struct msm_mdss *mdss = priv->mdss; struct msm_vblank_ctrl *vbl_ctrl = &priv->vblank_ctrl; struct vblank_event *vbl_ev, *tmp; - int i; /* We must cancel and cleanup any pending vblank enable/disable * work before drm_irq_uninstall() to avoid work re-enabling an @@ -288,17 +292,18 @@ static int msm_drm_uninit(struct device *dev) } /* clean up display commit/event worker threads */ - for (i = 0; i < priv->num_crtcs; i++) { - if (priv->disp_thread[i].thread) { - kthread_flush_worker(&priv->disp_thread[i].worker); - kthread_stop(priv->disp_thread[i].thread); - priv->disp_thread[i].thread = NULL; + drm_for_each_crtc(crtc, ddev) { + unsigned int pipe = drm_crtc_index(crtc); + if (priv->disp_thread[pipe].thread) { + kthread_flush_worker(&priv->disp_thread[pipe].worker); + kthread_stop(priv->disp_thread[pipe].thread); + priv->disp_thread[pipe].thread = NULL; } - if (priv->event_thread[i].thread) { - kthread_flush_worker(&priv->event_thread[i].worker); - kthread_stop(priv->event_thread[i].thread); - priv->event_thread[i].thread = NULL; + if (priv->event_thread[pipe].thread) { + kthread_flush_worker(&priv->event_thread[pipe].worker); + kthread_stop(priv->event_thread[pipe].thread); + priv->event_thread[pipe].thread = NULL; } } @@ -438,10 +443,11 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) { struct platform_device *pdev = to_platform_device(dev); struct drm_device *ddev; + struct drm_crtc *crtc; struct msm_drm_private *priv; struct msm_kms *kms; struct msm_mdss *mdss; - int ret, i; + int ret; struct sched_param param; ddev = drm_dev_alloc(drv, dev); @@ -547,39 +553,42 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) * other real time and normal priority task */ param.sched_priority = 16; - for (i = 0; i < priv->num_crtcs; i++) { + drm_for_each_crtc(crtc, ddev) { + unsigned int pipe = drm_crtc_index(crtc); /* initialize display thread */ - priv->disp_thread[i].crtc_id = priv->crtcs[i]->base.id; - kthread_init_worker(&priv->disp_thread[i].worker); - priv->disp_thread[i].dev = ddev; - priv->disp_thread[i].thread = + priv->disp_thread[pipe].crtc_id = crtc->base.id; + kthread_init_worker(&priv->disp_thread[pipe].worker); + priv->disp_thread[pipe].dev = ddev; + priv->disp_thread[pipe].thread = kthread_run(kthread_worker_fn, - &priv->disp_thread[i].worker, - "crtc_commit:%d", priv->disp_thread[i].crtc_id); - if (IS_ERR(priv->disp_thread[i].thread)) { + &priv->disp_thread[pipe].worker, + "crtc_commit:%d", + priv->disp_thread[pipe].crtc_id); + if (IS_ERR(priv->disp_thread[pipe].thread)) { DRM_DEV_ERROR(dev, "failed to create crtc_commit kthread\n"); - priv->disp_thread[i].thread = NULL; + priv->disp_thread[pipe].thread = NULL; goto err_msm_uninit; } - ret = sched_setscheduler(priv->disp_thread[i].thread, + ret = sched_setscheduler(priv->disp_thread[pipe].thread, SCHED_FIFO, ¶m); if (ret) dev_warn(dev, "disp_thread set priority failed: %d\n", ret); /* initialize event thread */ - priv->event_thread[i].crtc_id = priv->crtcs[i]->base.id; - kthread_init_worker(&priv->event_thread[i].worker); - priv->event_thread[i].dev = ddev; - priv->event_thread[i].thread = + priv->event_thread[pipe].crtc_id = crtc->base.id; + kthread_init_worker(&priv->event_thread[pipe].worker); + priv->event_thread[pipe].dev = ddev; + priv->event_thread[pipe].thread = kthread_run(kthread_worker_fn, - &priv->event_thread[i].worker, - "crtc_event:%d", priv->event_thread[i].crtc_id); - if (IS_ERR(priv->event_thread[i].thread)) { + &priv->event_thread[pipe].worker, + "crtc_event:%d", + priv->event_thread[pipe].crtc_id); + if (IS_ERR(priv->event_thread[pipe].thread)) { DRM_DEV_ERROR(dev, "failed to create crtc_event kthread\n"); - priv->event_thread[i].thread = NULL; + priv->event_thread[pipe].thread = NULL; goto err_msm_uninit; } @@ -590,14 +599,14 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) * frame_pending counters beyond 2. This can lead to commit * failure at crtc commit level. */ - ret = sched_setscheduler(priv->event_thread[i].thread, + ret = sched_setscheduler(priv->event_thread[pipe].thread, SCHED_FIFO, ¶m); if (ret) dev_warn(dev, "event_thread set priority failed:%d\n", ret); } - ret = drm_vblank_init(ddev, priv->num_crtcs); + ret = drm_vblank_init(ddev, ddev->mode_config.num_crtc); if (ret < 0) { DRM_DEV_ERROR(dev, "failed to initialize vblank\n"); goto err_msm_uninit; diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 71a03ce21da53..fc677da06e33b 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 { unsigned int num_planes; struct drm_plane *planes[MAX_PLANES]; - unsigned int num_crtcs; - struct drm_crtc *crtcs[MAX_CRTCS]; - struct msm_drm_thread disp_thread[MAX_CRTCS]; struct msm_drm_thread event_thread[MAX_CRTCS]; From patchwork Wed Dec 5 16:29:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10714559 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 0E5BD17DB 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 F0C392D024 for ; Wed, 5 Dec 2018 16:30:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4DFF2DC3E; Wed, 5 Dec 2018 16:30:07 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 683EB2D024 for ; Wed, 5 Dec 2018 16:30:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B9546E4A1; Wed, 5 Dec 2018 16:30:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc42.google.com (mail-yw1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by gabe.freedesktop.org (Postfix) with ESMTPS id E74196E4A0 for ; Wed, 5 Dec 2018 16:30:02 +0000 (UTC) Received: by mail-yw1-xc42.google.com with SMTP id i22so8458516ywa.11 for ; Wed, 05 Dec 2018 08:30:02 -0800 (PST) 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=G94Eu5gU6RTEWJIidkNWF5B94PVih5AphIDwP6zjUto=; b=BPSsgcZIppjg5CZXVgi6lIGqzx2x4djB1EJcZDTzfivlUj0vJiwq66q0cn2zyKyoQx OfGc0m3LyewB+wJZN1NQFPwO3OuePh2KlYOER7PN7eYPuZ5E48A1hQ9L9mlMwUau47DR D2MiSRYkfdk36Emt1yddKlzBUotwI0mz0RqilEMMx4lUcGGu5I5CwLZqTDYVaQfb3DnV ivFGRKo3LG0DAHJmvxg6LcVexYxg++xvQDXJu2UOr4rYe8P4v0Gby6Rz2woQ40ntMOX2 bt/98WjcgcRx/6mcRxoCf4Z0WVY0a/EIcwIJS2VsVHJSYDtjL34eQ1K++jg0pWiHDYGt dT2g== X-Gm-Message-State: AA+aEWaLx8DE558sLjtOIhtn7qyFQ7H7IFp783uu5Nt275HB3wmUx4uj T7TKT5NVLuLWhTikmvQ8IWc8Eg== X-Google-Smtp-Source: AFSGD/VPX1EYnVaujezwu+IOoTPP21fgW5ultxTNtG0WCrFFoZgVKsgd/zLr2p7aRpPcep0U9hEUmA== X-Received: by 2002:a81:6a04:: with SMTP id f4mr24998434ywc.485.1544027402062; Wed, 05 Dec 2018 08:30:02 -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.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 08:30:01 -0800 (PST) From: Sean Paul To: Subject: [PATCH 2/9] drm/msm: Don't track encoders in msm private struct Date: Wed, 5 Dec 2018 11:29:34 -0500 Message-Id: <20181205162958.25025-2-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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Sean Paul , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 | 16 ++++++++-------- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 5 ----- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 12 ++++-------- drivers/gpu/drm/msm/msm_drv.h | 3 --- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 3796a2978a40b..cbebc04e2d6ef 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -457,8 +457,6 @@ static void _dpu_kms_initialize_dsi(struct drm_device *dev, return; } - priv->encoders[priv->num_encoders++] = encoder; - for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) { if (!priv->dsi[i]) { DPU_DEBUG("invalid msm_dsi for ctrl %d\n", i); @@ -498,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_encoder *encoder; int i; if (!dpu_kms) { @@ -523,9 +522,8 @@ static void _dpu_kms_drm_obj_destroy(struct dpu_kms *dpu_kms) priv->connectors[i]->funcs->destroy(priv->connectors[i]); priv->num_connectors = 0; - for (i = 0; i < priv->num_encoders; i++) - priv->encoders[i]->funcs->destroy(priv->encoders[i]); - priv->num_encoders = 0; + drm_for_each_encoder(encoder, dpu_kms->dev) + encoder->funcs->destroy(encoder); } static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms) @@ -534,6 +532,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms) struct drm_plane *primary_planes[MAX_PLANES], *plane; struct drm_plane *cursor_planes[MAX_PLANES] = { NULL }; struct drm_crtc *crtc; + struct drm_encoder *encoder; struct msm_drm_private *priv; struct dpu_mdss_cfg *catalog; @@ -556,7 +555,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms) */ _dpu_kms_setup_displays(dev, priv, dpu_kms); - max_crtc_count = min(catalog->mixer_count, priv->num_encoders); + max_crtc_count = min(catalog->mixer_count, + (u32)dev->mode_config.num_encoder); /* Create the planes, keeping track of one primary/cursor per crtc */ for (i = 0; i < catalog->sspp_count; i++) { @@ -601,8 +601,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms) } /* All CRTCs are compatible with all encoders */ - for (i = 0; i < priv->num_encoders; i++) - priv->encoders[i]->possible_crtcs = (1 << max_crtc_count) - 1; + drm_for_each_encoder(encoder, dpu_kms->dev) + encoder->possible_crtcs = (1 << max_crtc_count) - 1; return 0; fail: diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c index f7f678c55e3ac..527a4ee06819f 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c @@ -266,7 +266,6 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms, return PTR_ERR(connector); } - priv->encoders[priv->num_encoders++] = encoder; priv->connectors[priv->num_connectors++] = connector; break; @@ -288,9 +287,6 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms, return ret; } } - - priv->encoders[priv->num_encoders++] = encoder; - break; case DRM_MODE_ENCODER_DSI: /* only DSI1 supported for now */ @@ -309,7 +305,6 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms, /* TODO: Add DMA_S later? */ encoder->possible_crtcs = 1 << DMA_P; - priv->encoders[priv->num_encoders++] = encoder; ret = msm_dsi_modeset_init(priv->dsi[dsi_id], dev, encoder); if (ret) { diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 4fb70532b0484..7cf54737944e4 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -332,7 +332,6 @@ static struct drm_encoder *construct_encoder(struct mdp5_kms *mdp5_kms, struct mdp5_ctl *ctl) { struct drm_device *dev = mdp5_kms->dev; - struct msm_drm_private *priv = dev->dev_private; struct drm_encoder *encoder; encoder = mdp5_encoder_init(dev, intf, ctl); @@ -341,8 +340,6 @@ static struct drm_encoder *construct_encoder(struct mdp5_kms *mdp5_kms, return encoder; } - priv->encoders[priv->num_encoders++] = encoder; - return encoder; } @@ -455,6 +452,7 @@ 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; int i, ret, pi = 0, ci = 0; @@ -478,7 +476,8 @@ static int modeset_init(struct mdp5_kms *mdp5_kms) * the MDP5 interfaces) than the number of layer mixers present in HW, * but let's be safe here anyway */ - num_crtcs = min(priv->num_encoders, mdp5_kms->num_hwmixers); + num_crtcs = min((unsigned)dev->mode_config.num_encoder, + mdp5_kms->num_hwmixers); /* * Construct planes equaling the number of hw pipes, and CRTCs for the @@ -526,11 +525,8 @@ static int modeset_init(struct mdp5_kms *mdp5_kms) * Now that we know the number of crtcs we've created, set the possible * crtcs for the encoders */ - for (i = 0; i < priv->num_encoders; i++) { - struct drm_encoder *encoder = priv->encoders[i]; - + drm_for_each_encoder(encoder, dev) encoder->possible_crtcs = (1 << num_crtcs) - 1; - } return 0; diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index fc677da06e33b..c6eff08e80170 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -197,9 +197,6 @@ struct msm_drm_private { struct msm_drm_thread disp_thread[MAX_CRTCS]; struct msm_drm_thread event_thread[MAX_CRTCS]; - unsigned int num_encoders; - struct drm_encoder *encoders[MAX_ENCODERS]; - unsigned int num_bridges; struct drm_bridge *bridges[MAX_BRIDGES]; From patchwork Wed Dec 5 16:29:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10714563 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 6FC9813AF for ; Wed, 5 Dec 2018 16:30:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F57E2DC51 for ; Wed, 5 Dec 2018 16:30:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5416E2DC4D; Wed, 5 Dec 2018 16:30:10 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0202D2DC14 for ; Wed, 5 Dec 2018 16:30:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F2D06E4A0; Wed, 5 Dec 2018 16:30:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb1-xb42.google.com (mail-yb1-xb42.google.com [IPv6:2607:f8b0:4864:20::b42]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2A066E4A0 for ; Wed, 5 Dec 2018 16:30:05 +0000 (UTC) Received: by mail-yb1-xb42.google.com with SMTP id s15so137433ybk.6 for ; Wed, 05 Dec 2018 08:30:05 -0800 (PST) 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=s9WBbVUWnS8+gNiVBm0oOF4WfSw2JrldIInFTVe12gU=; b=kjYrxFUTR+SuB/blTSFr2BO8fVh4+Zy0f5TBROLWP+LngI7YuC2oPwcpBAkzThAG3O BIhuBMVDFsCMmvcHwkCyBM452+5wg3lJLiuytt1vPmGuoIOAXpei2nQXhhP9NXkctOUe fLUDlQ8he/4F/caee5ootXS5eMAWYzgmKcSShZsRlNKN/kKQgZaxGBsIgKsSFobB/Oiq ibll8ovpXnRzFpTefN4jYkRiRQVnbrZkA2sN1/ej+pxjY0hkrYqT/KYfsR5WZd0ehZkE 91V64MeY/fchb0p0BxelGdBZogd0zEgk7xJIms9rHa4ZWwg0NSINfE1z3whqzY2x8Xl3 GsfA== X-Gm-Message-State: AA+aEWb2urCflKTQ2LdqXPEBEZ/v+B1hVBO3Fwt94Xb4dUr9TKf2whJK riOuGVypprJXyLJqIEmODK9OCbFg7lU= X-Google-Smtp-Source: AFSGD/VEvarS/KY3rXqQg613HZMzURDTmMxtS3lMhODpcs5QuX1kFdMcJf0tsMe6lnVClJbYvYdg/Q== X-Received: by 2002:a25:e094:: with SMTP id x142mr10335100ybg.42.1544027405051; Wed, 05 Dec 2018 08:30:05 -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.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 08:30:04 -0800 (PST) From: Sean Paul To: Subject: [PATCH 3/9] drm/msm: Don't track bridges in msm private struct Date: Wed, 5 Dec 2018 11:29:35 -0500 Message-Id: <20181205162958.25025-3-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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Sean Paul , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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/dsi/dsi.c | 1 - drivers/gpu/drm/msm/edp/edp.c | 1 - drivers/gpu/drm/msm/hdmi/hdmi.c | 1 - drivers/gpu/drm/msm/msm_drv.h | 3 --- 4 files changed, 6 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 7b2a1e6a88107..97b906a9b3945 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -250,7 +250,6 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, goto fail; } - priv->bridges[priv->num_bridges++] = msm_dsi->bridge; priv->connectors[priv->num_connectors++] = msm_dsi->connector; return 0; diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c index 6a63aba98a307..694c2d43011f6 100644 --- a/drivers/gpu/drm/msm/edp/edp.c +++ b/drivers/gpu/drm/msm/edp/edp.c @@ -188,7 +188,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev, encoder->bridge = edp->bridge; - priv->bridges[priv->num_bridges++] = edp->bridge; priv->connectors[priv->num_connectors++] = edp->connector; return 0; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index ace8aab072761..1901ae820ef0b 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -340,7 +340,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, encoder->bridge = hdmi->bridge; - priv->bridges[priv->num_bridges++] = hdmi->bridge; priv->connectors[priv->num_connectors++] = hdmi->connector; platform_set_drvdata(pdev, hdmi); diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index c6eff08e80170..1902713ed84b0 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -197,9 +197,6 @@ struct msm_drm_private { struct msm_drm_thread disp_thread[MAX_CRTCS]; struct msm_drm_thread event_thread[MAX_CRTCS]; - unsigned int num_bridges; - struct drm_bridge *bridges[MAX_BRIDGES]; - unsigned int num_connectors; struct drm_connector *connectors[MAX_CONNECTORS]; 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: 10714567 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 932CB17DB 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 84D052DC51 for ; Wed, 5 Dec 2018 16:30:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 831FF2DC63; 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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 119512DC67 for ; Wed, 5 Dec 2018 16:30:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 824C56E4A8; Wed, 5 Dec 2018 16:30:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C2B56E4A6 for ; Wed, 5 Dec 2018 16:30:08 +0000 (UTC) Received: by mail-yb1-xb44.google.com with SMTP id f6-v6so8637791ybg.12 for ; Wed, 05 Dec 2018 08:30:08 -0800 (PST) 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=N0d20OZuIKiiuuTS70s6JfouRGA88/zFLTBv4xCYlm6aVCM/eCQJQ28/tUJRwoHSoy K3ka39Nb511s8vcsNHVMT+WJbNSGkzYDJtJYvkZtJ/LgW2ZTO0arFxNpbIrH24xiemC2 tshRmv4zNfVaUmzem5qKU0ZzoM8UnIQA1c2a+nEyfZNEJMyvagFyQzflYdVMcD3Y8M7/ Eid0W3o4g9S2khJSVzRO+YSvgobAH8kQVWZfv6PZjtDEXmeywh5ALxWurN55qXwQWjzK FOW1KaeJ76LbSjHBlca3yedBaKwCRJGt/xaWFhqLo2W6KhU1gAq+x8wRemi3MLYWf/GW jstQ== X-Gm-Message-State: AA+aEWbFpqHHIByWAvTWLkdCBqQzMaep9shYYm7l8wJdo2VT/NXH3IS3 mA7vKEBPiED4KY1CrildBKNesvFOcYg= 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 To: 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Sean Paul , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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]; 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: 10714577 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 2E9D917DB for ; Wed, 5 Dec 2018 16:30:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F8F92D022 for ; Wed, 5 Dec 2018 16:30:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DA322DCB1; Wed, 5 Dec 2018 16:30:17 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 939062D022 for ; Wed, 5 Dec 2018 16:30:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4FB06E4AF; Wed, 5 Dec 2018 16:30:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc43.google.com (mail-yw1-xc43.google.com [IPv6:2607:f8b0:4864:20::c43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7AC3F6E4A5 for ; Wed, 5 Dec 2018 16:30:09 +0000 (UTC) Received: by mail-yw1-xc43.google.com with SMTP id r130so8770756ywg.7 for ; Wed, 05 Dec 2018 08:30:09 -0800 (PST) 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=FnF5YlmEEKxurYfcbzWfSU3ub9+Z6Sksa5/3FVVZU6CYN08oDO4V1bLtTvkK0cb5FC fsBHfX5dg6SUzG9nPUQDzCj+dzI0/rp1lXtk4zFRl5UwZNvSbYJQqtWzEn9MBOn68vFu qYqJd44YD9DHRziuIknpZBoYK+OnBDn+Vbcsoscx/dOGE8JyPEyJi3jZrekL3hNwIUe9 x2KrYI5Sirtt5rJeirRF60qljx7Vy0rU/BMZVLxr3MpUk+IqjjLp6YDWSHvj5d/UymOQ pIfK+MzdVDk3pWeHDyjVD+NSLO0qZ+RtxCxVxJ5ze/3B8fmLBY04PLP16qOS02FQ6Xgb 0wFQ== X-Gm-Message-State: AA+aEWbj5j1avfBRCzIgK0y0QVbFKEYJNJSAhs34bqGV/Gj+j3rg5DbO mxPEX1MefLJgBgrLGCMGHwdOjA== 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 To: 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Sean Paul , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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; From patchwork Wed Dec 5 16:29:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10714573 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 3374B17DB for ; Wed, 5 Dec 2018 16:30:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23C472DCAB for ; Wed, 5 Dec 2018 16:30:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AFC52DC3E; Wed, 5 Dec 2018 16:30:15 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9CC432DCA2 for ; Wed, 5 Dec 2018 16:30:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A82A6E4AA; Wed, 5 Dec 2018 16:30:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc42.google.com (mail-yw1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8DF336E4AB for ; Wed, 5 Dec 2018 16:30:11 +0000 (UTC) Received: by mail-yw1-xc42.google.com with SMTP id h193so8778507ywc.4 for ; Wed, 05 Dec 2018 08:30:11 -0800 (PST) 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=TcBxYvhDgOXfovQonTT/DRAOmEBO6f/w9cFOsK5SsY0=; b=d/Zd87xLSWDBv/lfBJWkjiEPI25fc3oOQhYzHsd5FzzLvsgC5jtIQtQm9rk6xhu+ku AswEXFfegOzCoFdFkVU6caeVxNxxzdWHO2IYS2mzqVGk1z4Et0++rAR1HkzGODMk0krK K4cld7YqQHTJ5vkJiXHZRdSAzePSR4qZOL/gmKRZfKqkJfk/a2xq/tf+FHEmIaLb7hFd /SfkGCIlv0zn8SaCikq7MRnnDbbPnVb9ml6CfRP1rHwr67wlIQds3l1zXYq44Mf5M+wI +2uo5Gd6r1/gjroiL7utDjO4wqJwyIGxA7n5qsZhWtNVafqN6Qs9KWFiMMqElrxHxAcJ pKdg== X-Gm-Message-State: AA+aEWZP2Lnmqc/5djyvJVZfmXSKN6A9KZVLqksNaQwzE6Fa7tPgtEbI lISzyP6NdDpcxvM8IQy0TbFerw== X-Google-Smtp-Source: AFSGD/W4jpFkbycX57BeTCS88b1iYQ6t2HHTuFXwBxb8dw0+vUtoKM90J/XEHmLERdq2bKg7j8JoIg== X-Received: by 2002:a81:1492:: with SMTP id 140mr24359380ywu.333.1544027410762; Wed, 05 Dec 2018 08:30:10 -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.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 08:30:10 -0800 (PST) From: Sean Paul To: Subject: [PATCH 6/9] drm/msm: mdp5: Remove premultiplied from plane state Date: Wed, 5 Dec 2018 11:29:38 -0500 Message-Id: <20181205162958.25025-6-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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Sean Paul , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul It's always 0, and not exposed via property, so remove it and all affected code. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 13 +------------ drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h | 1 - drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 2 -- drivers/gpu/drm/msm/msm_drv.h | 1 - 4 files changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index c5fde1a4191aa..035be33405f08 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -310,18 +310,7 @@ static void blend_setup(struct drm_crtc *crtc) DBG("Stage %d fg_alpha %x bg_alpha %x", i, fg_alpha, bg_alpha); - if (format->alpha_enable && pstates[i]->premultiplied) { - blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_CONST) | - MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL); - if (fg_alpha != 0xff) { - bg_alpha = fg_alpha; - blend_op |= - MDP5_LM_BLEND_OP_MODE_BG_MOD_ALPHA | - MDP5_LM_BLEND_OP_MODE_BG_INV_MOD_ALPHA; - } else { - blend_op |= MDP5_LM_BLEND_OP_MODE_BG_INV_ALPHA; - } - } else if (format->alpha_enable) { + if (format->alpha_enable) { blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_PIXEL) | MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL); if (fg_alpha != 0xff) { diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h index 854dfd30e8292..61b3331dcab9c 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h @@ -108,7 +108,6 @@ struct mdp5_plane_state { struct mdp5_hw_pipe *r_hwpipe; /* right hwpipe */ /* aligned with property */ - uint8_t premultiplied; uint8_t zpos; uint8_t alpha; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 1a36d6f612826..e96aff8e55757 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -174,7 +174,6 @@ mdp5_plane_atomic_print_state(struct drm_printer *p, drm_printf(p, "\tright-hwpipe=%s\n", pstate->r_hwpipe ? pstate->r_hwpipe->name : "(null)"); - drm_printf(p, "\tpremultiplied=%u\n", pstate->premultiplied); drm_printf(p, "\tzpos=%u\n", pstate->zpos); drm_printf(p, "\talpha=%u\n", pstate->alpha); drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage)); @@ -192,7 +191,6 @@ static void mdp5_plane_reset(struct drm_plane *plane) /* assign default blend parameters */ mdp5_state->alpha = 255; - mdp5_state->premultiplied = 0; if (plane->type == DRM_PLANE_TYPE_PRIMARY) mdp5_state->zpos = STAGE_BASE; diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 6c013addce68c..b6aa04511ded9 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -73,7 +73,6 @@ struct msm_file_private { enum msm_mdp_plane_property { PLANE_PROP_ZPOS, PLANE_PROP_ALPHA, - PLANE_PROP_PREMULTIPLIED, PLANE_PROP_MAX_NUM }; From patchwork Wed Dec 5 16:29:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10714585 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 5184B13AF for ; Wed, 5 Dec 2018 16:30:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 418892DCAC for ; Wed, 5 Dec 2018 16:30:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35F672DC9B; Wed, 5 Dec 2018 16:30:23 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BD1312DCBE for ; Wed, 5 Dec 2018 16:30:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E92986E49C; Wed, 5 Dec 2018 16:30:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F54F6E4AB for ; Wed, 5 Dec 2018 16:30:13 +0000 (UTC) Received: by mail-yb1-xb44.google.com with SMTP id j145so3734355ybg.11 for ; Wed, 05 Dec 2018 08:30:13 -0800 (PST) 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=ctkl0GTGA80LHhrezbVlODyEHhudGv5yalbggZE0d84=; b=VSHN4rWV5I2Ol0eDA/GaWSg/nw1nDWfMp5rsBLFNWSOlWxbe4Iv25bINukmbT6sC/3 d57ksJpRRBI57XD3v1OhPMDEQ1Qt7JRWdvmF2YAEgOozHu++PZFBTdV9HugENiJLEjpH Z6cNW/oGzqBeAT48K3RIwOz73tz+txEJH/L08BCCAcglDmSShiaeZJpnrl40kJl23S7/ Z/6zp75Q+CZkT+MLyWdRI2hCHUFEjXPxtk0j3/U3WCmQ7LUZyFkGm1TlHkBMYUMghKEN 8jm0vwoCa34MYjFCcSZ82Li8qmM6JGXt1VlDFn0qJklAOnsWNGPdKAYfJN/82tcSROD9 8RvA== X-Gm-Message-State: AA+aEWbqoJVZ3p2QZ/pcrNFdKPjVNPLiLvRQrFGJxKSMfthWwYXhC5hi ARtTX5IgeadcsV82YE9+6+k/Lg== X-Google-Smtp-Source: AFSGD/V0SO0NhmNmRKRWBkGI8G9bWKVh/Ig/zorO4B8gt/UNAwcy5tS5XRNfz6byx3j8qJ+ZVwGhUA== X-Received: by 2002:a25:1986:: with SMTP id 128-v6mr24144629ybz.234.1544027412404; Wed, 05 Dec 2018 08:30:12 -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.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 08:30:12 -0800 (PST) From: Sean Paul To: Subject: [PATCH 7/9] drm/msm: mdp5: Remove alpha from plane state Date: Wed, 5 Dec 2018 11:29:39 -0500 Message-Id: <20181205162958.25025-7-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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Sean Paul , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul It's always 0xFF, so remove it and any code that relies on it being != 0xFF. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 27 ++++++---------------- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h | 1 - drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 4 ---- drivers/gpu/drm/msm/msm_drv.h | 1 - 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index 035be33405f08..bfa97ec063965 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -230,7 +230,7 @@ static void blend_setup(struct drm_crtc *crtc) struct mdp5_hw_mixer *r_mixer = pipeline->r_mixer; uint32_t r_lm = r_mixer ? r_mixer->lm : 0; struct mdp5_ctl *ctl = mdp5_cstate->ctl; - uint32_t blend_op, fg_alpha, bg_alpha, ctl_blend_flags = 0; + uint32_t blend_op, ctl_blend_flags = 0; unsigned long flags; enum mdp5_pipe stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { { SSPP_NONE } }; enum mdp5_pipe r_stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { { SSPP_NONE } }; @@ -300,44 +300,31 @@ static void blend_setup(struct drm_crtc *crtc) plane = pstates[i]->base.plane; blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_CONST) | MDP5_LM_BLEND_OP_MODE_BG_ALPHA(BG_CONST); - fg_alpha = pstates[i]->alpha; - bg_alpha = 0xFF - pstates[i]->alpha; if (!format->alpha_enable && bg_alpha_enabled) mixer_op_mode = 0; else mixer_op_mode |= mdp5_lm_use_fg_alpha_mask(i); - DBG("Stage %d fg_alpha %x bg_alpha %x", i, fg_alpha, bg_alpha); - if (format->alpha_enable) { blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_PIXEL) | - MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL); - if (fg_alpha != 0xff) { - bg_alpha = fg_alpha; - blend_op |= - MDP5_LM_BLEND_OP_MODE_FG_MOD_ALPHA | - MDP5_LM_BLEND_OP_MODE_FG_INV_MOD_ALPHA | - MDP5_LM_BLEND_OP_MODE_BG_MOD_ALPHA | - MDP5_LM_BLEND_OP_MODE_BG_INV_MOD_ALPHA; - } else { - blend_op |= MDP5_LM_BLEND_OP_MODE_BG_INV_ALPHA; - } + MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL) | + MDP5_LM_BLEND_OP_MODE_BG_INV_ALPHA; } mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_OP_MODE(lm, blender(i)), blend_op); mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_FG_ALPHA(lm, - blender(i)), fg_alpha); + blender(i)), 0xFF); mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_BG_ALPHA(lm, - blender(i)), bg_alpha); + blender(i)), 0); if (r_mixer) { mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_OP_MODE(r_lm, blender(i)), blend_op); mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_FG_ALPHA(r_lm, - blender(i)), fg_alpha); + blender(i)), 0xFF); mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_BG_ALPHA(r_lm, - blender(i)), bg_alpha); + blender(i)), 0); } } diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h index 61b3331dcab9c..8605a7dee44c1 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h @@ -109,7 +109,6 @@ struct mdp5_plane_state { /* aligned with property */ uint8_t zpos; - uint8_t alpha; /* assigned by crtc blender */ enum mdp_mixer_stage_id stage; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index e96aff8e55757..5ea06804cef2b 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -175,7 +175,6 @@ mdp5_plane_atomic_print_state(struct drm_printer *p, pstate->r_hwpipe ? pstate->r_hwpipe->name : "(null)"); drm_printf(p, "\tzpos=%u\n", pstate->zpos); - drm_printf(p, "\talpha=%u\n", pstate->alpha); drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage)); } @@ -189,9 +188,6 @@ static void mdp5_plane_reset(struct drm_plane *plane) kfree(to_mdp5_plane_state(plane->state)); mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL); - /* assign default blend parameters */ - mdp5_state->alpha = 255; - if (plane->type == DRM_PLANE_TYPE_PRIMARY) mdp5_state->zpos = STAGE_BASE; else diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index b6aa04511ded9..a578bad540130 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -72,7 +72,6 @@ struct msm_file_private { enum msm_mdp_plane_property { PLANE_PROP_ZPOS, - PLANE_PROP_ALPHA, PLANE_PROP_MAX_NUM }; From patchwork Wed Dec 5 16:29:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10714583 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 99BEC13AF for ; Wed, 5 Dec 2018 16:30:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89B132DCB6 for ; Wed, 5 Dec 2018 16:30:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DE5C2DC95; Wed, 5 Dec 2018 16:30:21 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3C4142DCB6 for ; Wed, 5 Dec 2018 16:30:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B962E6E4B3; Wed, 5 Dec 2018 16:30:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc44.google.com (mail-yw1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1CDE86E4AD for ; Wed, 5 Dec 2018 16:30:15 +0000 (UTC) Received: by mail-yw1-xc44.google.com with SMTP id t13so8762087ywe.13 for ; Wed, 05 Dec 2018 08:30:15 -0800 (PST) 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=MNSoVxpbDAFulqdzGJF0tl4VqfCNxxkqjPheU9YEYlw=; b=LDbHdl+hu72s9zV9sPJ2dlv8C+zzG0ZT79QzeGF5HeR/p9gPvcVFNQkwE7IQHxdwHn kCR99DsAEhxzbyyzvgfSbPQNBF6q00Lx8SiL/EAUbthND6v19ZoTc8oxREtuX9iFV33Z jVDPzhlWj04ZYnSWqxCNvv5R7zMXKtTUPfBZZaSCnyUq0PQH0e44xQ743Q8dDClCxKVH VdLTQdnkERt33v3XP0zDRYqFfuwxkFJeZuf5kjfwMFlRwLEKRVRUXch4ZO+iV/w6GKa4 WwVDNj0c/ol4agUlPThYQgiE8ZB9faq7MVYmwMkcg5Dr4edNfb3QCVKvHze+tu/hqmf3 l6rA== X-Gm-Message-State: AA+aEWZIB1URCGtF/I+ybNEhJ93C27LUh8EIYtQTSg58O/EEurP3FnFm 8nPAxOuaYuuxt24oa9Gq6HzJtA== X-Google-Smtp-Source: AFSGD/UmIK9hweY+JfL6OWLn7wwkqPQ+HqLYhz6xDMri9ymyfbXwVLrv3kPD/sATAFzciCQsKJlTXg== X-Received: by 2002:a81:b657:: with SMTP id h23mr25241209ywk.378.1544027414070; Wed, 05 Dec 2018 08:30:14 -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.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 08:30:13 -0800 (PST) From: Sean Paul To: Subject: [PATCH 8/9] drm/msm: mdp5: Remove mdp5_plane_install_rotation_property() Date: Wed, 5 Dec 2018 11:29:40 -0500 Message-Id: <20181205162958.25025-8-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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Sean Paul , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul Just call drm_plane_create_rotation_property() directly Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 5ea06804cef2b..41590588a6f39 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -52,17 +52,6 @@ static void mdp5_plane_destroy(struct drm_plane *plane) kfree(mdp5_plane); } -static void mdp5_plane_install_rotation_property(struct drm_device *dev, - struct drm_plane *plane) -{ - drm_plane_create_rotation_property(plane, - DRM_MODE_ROTATE_0, - DRM_MODE_ROTATE_0 | - DRM_MODE_ROTATE_180 | - DRM_MODE_REFLECT_X | - DRM_MODE_REFLECT_Y); -} - /* helper to install properties which are common to planes and crtcs */ static void mdp5_plane_install_properties(struct drm_plane *plane, struct drm_mode_object *obj) @@ -98,7 +87,12 @@ static void mdp5_plane_install_properties(struct drm_plane *plane, INSTALL_RANGE_PROPERTY(zpos, ZPOS, 1, 255, 1); - mdp5_plane_install_rotation_property(dev, plane); + drm_plane_create_rotation_property(plane, + DRM_MODE_ROTATE_0, + DRM_MODE_ROTATE_0 | + DRM_MODE_ROTATE_180 | + DRM_MODE_REFLECT_X | + DRM_MODE_REFLECT_Y); #undef INSTALL_RANGE_PROPERTY #undef INSTALL_ENUM_PROPERTY From patchwork Wed Dec 5 16:29:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10714581 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 0A44017DB for ; Wed, 5 Dec 2018 16:30:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDF302DC42 for ; Wed, 5 Dec 2018 16:30:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E233D2DC9B; Wed, 5 Dec 2018 16:30:19 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 504702DCAF for ; Wed, 5 Dec 2018 16:30:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 47A2B6E4AD; Wed, 5 Dec 2018 16:30:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc42.google.com (mail-yw1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9079F6E4AE for ; Wed, 5 Dec 2018 16:30:16 +0000 (UTC) Received: by mail-yw1-xc42.google.com with SMTP id j6so8766877ywj.6 for ; Wed, 05 Dec 2018 08:30:16 -0800 (PST) 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=ngd2Aw/DW8VqdrZtDdTzB+U6Pf80gAkmc9rvJ2vnxo8=; b=RYo8BjU+7phrKd9E5SD3qgMDecuK/o3Fe9v/rx+SsnJG5xXk7lJxWtBtEMHCyTDHZA vO5OSTalZ/tXIZDuBnpK0vt9EvCurr0Bz9b3E73erBABc34HuSVPjf5X7m7OgvY9fPT4 oXrG7NEkAZ9zlKI+V3ZDRhakEgvo3VQzR8aMLXATN3qZ3TmSksXKbZlGYdR9cxdnKBgZ JqZnRqT+bawZBYeHrA8sxC5FMbg88AuCXd5f7xH5Ta22ogjtV3H5HXRluhRg80HE6p0V srXSUoyBeYvRBcjLCivDRazAUZjlbm3fCGpZtBtOUpaqsOFhIy09K+fwOxvYgV7azgmv bLTw== X-Gm-Message-State: AA+aEWYvxHS06PsY8lNS3yHOGR4n21oA/PluzEr6ULJgdUXwOfWrCzX2 JxMhGwTB4NcuxfTUdIKqJwNxZQ== X-Google-Smtp-Source: AFSGD/WIX8FCqz4FVWTStbtU/dFEvqvGAHDUzriYkEaOFZ/ghJxwW8jO9pqsaKjirTbHGSsdOXqqdA== X-Received: by 2002:a81:af27:: with SMTP id n39mr24976207ywh.452.1544027415700; Wed, 05 Dec 2018 08:30:15 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 08:30:15 -0800 (PST) From: Sean Paul To: Subject: [PATCH 9/9] drm/msm: mdp5: Remove custom property code in plane Date: Wed, 5 Dec 2018 11:29:41 -0500 Message-Id: <20181205162958.25025-9-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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Sean Paul , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul mdp5 only exposes one custom property, and it's zpos. Fortunately, we have a standard zpos property now, we can remove the hand-rolled property code entirely from mdp5 and rely on core. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h | 3 - drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 101 +-------------------- drivers/gpu/drm/msm/msm_drv.h | 8 -- 4 files changed, 3 insertions(+), 111 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index bfa97ec063965..4ccef117ced90 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -551,7 +551,7 @@ static int pstate_cmp(const void *a, const void *b) { struct plane_state *pa = (struct plane_state *)a; struct plane_state *pb = (struct plane_state *)b; - return pa->state->zpos - pb->state->zpos; + return pa->state->base.normalized_zpos - pb->state->base.normalized_zpos; } /* is there a helper for this? */ diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h index 8605a7dee44c1..44d03fc31e323 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h @@ -107,9 +107,6 @@ struct mdp5_plane_state { struct mdp5_hw_pipe *hwpipe; struct mdp5_hw_pipe *r_hwpipe; /* right hwpipe */ - /* aligned with property */ - uint8_t zpos; - /* assigned by crtc blender */ enum mdp_mixer_stage_id stage; }; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 41590588a6f39..da999d236dff2 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -56,103 +56,13 @@ static void mdp5_plane_destroy(struct drm_plane *plane) static void mdp5_plane_install_properties(struct drm_plane *plane, struct drm_mode_object *obj) { - struct drm_device *dev = plane->dev; - struct msm_drm_private *dev_priv = dev->dev_private; - struct drm_property *prop; - -#define INSTALL_PROPERTY(name, NAME, init_val, fnc, ...) do { \ - prop = dev_priv->plane_property[PLANE_PROP_##NAME]; \ - if (!prop) { \ - prop = drm_property_##fnc(dev, 0, #name, \ - ##__VA_ARGS__); \ - if (!prop) { \ - dev_warn(dev->dev, \ - "Create property %s failed\n", \ - #name); \ - return; \ - } \ - dev_priv->plane_property[PLANE_PROP_##NAME] = prop; \ - } \ - drm_object_attach_property(&plane->base, prop, init_val); \ - } while (0) - -#define INSTALL_RANGE_PROPERTY(name, NAME, min, max, init_val) \ - INSTALL_PROPERTY(name, NAME, init_val, \ - create_range, min, max) - -#define INSTALL_ENUM_PROPERTY(name, NAME, init_val) \ - INSTALL_PROPERTY(name, NAME, init_val, \ - create_enum, name##_prop_enum_list, \ - ARRAY_SIZE(name##_prop_enum_list)) - - INSTALL_RANGE_PROPERTY(zpos, ZPOS, 1, 255, 1); - + drm_plane_create_zpos_property(plane, 1, 1, 255); drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180 | DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y); - -#undef INSTALL_RANGE_PROPERTY -#undef INSTALL_ENUM_PROPERTY -#undef INSTALL_PROPERTY -} - -static int mdp5_plane_atomic_set_property(struct drm_plane *plane, - struct drm_plane_state *state, struct drm_property *property, - uint64_t val) -{ - struct drm_device *dev = plane->dev; - struct mdp5_plane_state *pstate; - struct msm_drm_private *dev_priv = dev->dev_private; - int ret = 0; - - pstate = to_mdp5_plane_state(state); - -#define SET_PROPERTY(name, NAME, type) do { \ - if (dev_priv->plane_property[PLANE_PROP_##NAME] == property) { \ - pstate->name = (type)val; \ - DBG("Set property %s %d", #name, (type)val); \ - goto done; \ - } \ - } while (0) - - SET_PROPERTY(zpos, ZPOS, uint8_t); - - DRM_DEV_ERROR(dev->dev, "Invalid property\n"); - ret = -EINVAL; -done: - return ret; -#undef SET_PROPERTY -} - -static int mdp5_plane_atomic_get_property(struct drm_plane *plane, - const struct drm_plane_state *state, - struct drm_property *property, uint64_t *val) -{ - struct drm_device *dev = plane->dev; - struct mdp5_plane_state *pstate; - struct msm_drm_private *dev_priv = dev->dev_private; - int ret = 0; - - pstate = to_mdp5_plane_state(state); - -#define GET_PROPERTY(name, NAME, type) do { \ - if (dev_priv->plane_property[PLANE_PROP_##NAME] == property) { \ - *val = pstate->name; \ - DBG("Get property %s %lld", #name, *val); \ - goto done; \ - } \ - } while (0) - - GET_PROPERTY(zpos, ZPOS, uint8_t); - - DRM_DEV_ERROR(dev->dev, "Invalid property\n"); - ret = -EINVAL; -done: - return ret; -#undef SET_PROPERTY } static void @@ -168,7 +78,7 @@ mdp5_plane_atomic_print_state(struct drm_printer *p, drm_printf(p, "\tright-hwpipe=%s\n", pstate->r_hwpipe ? pstate->r_hwpipe->name : "(null)"); - drm_printf(p, "\tzpos=%u\n", pstate->zpos); + drm_printf(p, "\tzpos=%u\n", pstate->base.normalized_zpos); drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage)); } @@ -182,11 +92,6 @@ static void mdp5_plane_reset(struct drm_plane *plane) kfree(to_mdp5_plane_state(plane->state)); mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL); - if (plane->type == DRM_PLANE_TYPE_PRIMARY) - mdp5_state->zpos = STAGE_BASE; - else - mdp5_state->zpos = STAGE0 + drm_plane_index(plane); - mdp5_state->base.plane = plane; plane->state = &mdp5_state->base; @@ -225,8 +130,6 @@ static const struct drm_plane_funcs mdp5_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = mdp5_plane_destroy, - .atomic_set_property = mdp5_plane_atomic_set_property, - .atomic_get_property = mdp5_plane_atomic_get_property, .reset = mdp5_plane_reset, .atomic_duplicate_state = mdp5_plane_duplicate_state, .atomic_destroy_state = mdp5_plane_destroy_state, diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index a578bad540130..60a7da09cf3b3 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -70,11 +70,6 @@ struct msm_file_private { int queueid; }; -enum msm_mdp_plane_property { - PLANE_PROP_ZPOS, - PLANE_PROP_MAX_NUM -}; - struct msm_vblank_ctrl { struct kthread_work work; struct list_head event_list; @@ -192,9 +187,6 @@ struct msm_drm_private { struct msm_drm_thread disp_thread[MAX_CRTCS]; struct msm_drm_thread event_thread[MAX_CRTCS]; - /* Properties */ - struct drm_property *plane_property[PLANE_PROP_MAX_NUM]; - /* VRAM carveout, used when no IOMMU: */ struct { unsigned long size;