From: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
To: Bruce Wang <bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 4/5] drm/msm/dpu: Change _dpu_crtc_power_enable to void
Date: Wed, 19 Sep 2018 15:13:12 -0400 [thread overview]
Message-ID: <20180919191312.GX188300@art_vandelay> (raw)
In-Reply-To: <20180919154415.131292-5-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
On Wed, Sep 19, 2018 at 11:44:14AM -0400, Bruce Wang wrote:
> All checks for _dpu_crtc_power_enable are not true, so the function
> can never return an error code. All calls of the function have also
> been changed so that they don't expect a return value.
>
> Signed-off-by: Bruce Wang <bzwang@chromium.org>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 35 ++++--------------------
> 1 file changed, 5 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index 017d16131dac..f0b52281c46f 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -60,37 +60,16 @@ static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
> return to_dpu_kms(priv->kms);
> }
>
> -static inline int _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, bool enable)
> +static inline void _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, bool enable)
> {
> - struct drm_crtc *crtc;
> - struct msm_drm_private *priv;
> - struct dpu_kms *dpu_kms;
> -
> - if (!dpu_crtc) {
> - DPU_ERROR("invalid dpu crtc\n");
> - return -EINVAL;
> - }
> -
> - crtc = &dpu_crtc->base;
> - if (!crtc->dev || !crtc->dev->dev_private) {
> - DPU_ERROR("invalid drm device\n");
> - return -EINVAL;
> - }
> -
> - priv = crtc->dev->dev_private;
> - if (!priv->kms) {
> - DPU_ERROR("invalid kms\n");
> - return -EINVAL;
> - }
> -
> - dpu_kms = to_dpu_kms(priv->kms);
> + struct drm_crtc *crtc = &dpu_crtc->base;
> + struct msm_drm_private *priv = crtc->dev->dev_private;
> + struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms);
>
> if (enable)
> pm_runtime_get_sync(&dpu_kms->pdev->dev);
> else
> pm_runtime_put_sync(&dpu_kms->pdev->dev);
> -
> - return 0;
> }
>
> static void dpu_crtc_destroy(struct drm_crtc *crtc)
> @@ -849,14 +828,10 @@ static int _dpu_crtc_vblank_enable_no_lock(
I think this can go to void now too since the if (!dpu_crtc) check at the top is
a no-op.
This is a good thing, too since this function is only called from void functions
with one exception where its return value isn't passed on!
Sean
> dev = crtc->dev;
>
> if (enable) {
> - int ret;
> -
> /* drop lock since power crtc cb may try to re-acquire lock */
> mutex_unlock(&dpu_crtc->crtc_lock);
> - ret = _dpu_crtc_power_enable(dpu_crtc, true);
> + _dpu_crtc_power_enable(dpu_crtc, true);
> mutex_lock(&dpu_crtc->crtc_lock);
> - if (ret)
> - return ret;
>
> list_for_each_entry(enc, &dev->mode_config.encoder_list, head) {
> if (enc->crtc != crtc)
> --
> 2.19.0.397.gdd90340f6a-goog
>
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2018-09-19 19:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-19 15:44 [PATCH 0/5] drm/msm/dpu: Clean up dpu code Bruce Wang
[not found] ` <20180919154415.131292-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-19 15:44 ` [PATCH 1/5] drm/msm/dpu: Remove unneeded checks from dpu_plane Bruce Wang
[not found] ` <20180919154415.131292-2-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-19 19:01 ` Sean Paul
2018-09-19 15:44 ` [PATCH 2/5] drm/msm/dpu: Clean up plane atomic disable/update Bruce Wang
[not found] ` <20180919154415.131292-3-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-19 19:02 ` Sean Paul
2018-09-19 15:44 ` [PATCH 3/5] drm/msm/dpu: Remove impossible checks Bruce Wang
[not found] ` <20180919154415.131292-4-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-19 19:10 ` Sean Paul
2018-09-19 15:44 ` [PATCH 4/5] drm/msm/dpu: Change _dpu_crtc_power_enable to void Bruce Wang
[not found] ` <20180919154415.131292-5-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-19 19:13 ` Sean Paul [this message]
2018-09-19 19:14 ` Sean Paul
2018-09-19 15:44 ` [PATCH 5/5] drm/msm/dpu: Change _dpu_crtc_vblank_enable_no_lock " Bruce Wang
[not found] ` <20180919154415.131292-6-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-09-19 19:14 ` Sean Paul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180919191312.GX188300@art_vandelay \
--to=sean-p7ytbzm4h96eqtr555yldq@public.gmane.org \
--cc=abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox