All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Wang <bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
To: jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Cc: Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Subject: Re: [PATCH 04/11] drm/msm/dpu: Remove dpu_crtc_is_enabled()
Date: Thu, 18 Oct 2018 17:45:19 -0400	[thread overview]
Message-ID: <CAA3FfWWFE4HYUvaqe5NZiEuVqeyQwNRXAgfkVqsTzcXpJ1-H=A@mail.gmail.com> (raw)
In-Reply-To: <20181018195836.15885-5-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

On Thu, Oct 18, 2018 at 3:59 PM Jordan Crouse <jcrouse@codeaurora.org> wrote:
>
> The static inline function dpu_crtc_enabled() is only called once
> and the function that calls it in turn is only called once and
> the return value can be easily checked in the calling functions
> so collapse everything down.
>
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Reviewed-by: Bruce Wang <bzwang@chromium.org>

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 17 ++++++-----------
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h      |  9 ---------
>  2 files changed, 6 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
> index 22e84b3d7f98..e68ccb7a898a 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
> @@ -57,18 +57,13 @@ static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
>         return to_dpu_kms(priv->kms);
>  }
>
> -static bool _dpu_core_perf_crtc_is_power_on(struct drm_crtc *crtc)
> -{
> -       return dpu_crtc_is_enabled(crtc);
> -}
> -
>  static bool _dpu_core_video_mode_intf_connected(struct drm_crtc *crtc)
>  {
>         struct drm_crtc *tmp_crtc;
>
>         drm_for_each_crtc(tmp_crtc, crtc->dev) {
>                 if ((dpu_crtc_get_intf_mode(tmp_crtc) == INTF_MODE_VIDEO) &&
> -                               _dpu_core_perf_crtc_is_power_on(tmp_crtc)) {
> +                               tmp_crtc->enabled) {
>                         DPU_DEBUG("video interface connected crtc:%d\n",
>                                 tmp_crtc->base.id);
>                         return true;
> @@ -164,7 +159,7 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc,
>                 curr_client_type = dpu_crtc_get_client_type(crtc);
>
>                 drm_for_each_crtc(tmp_crtc, crtc->dev) {
> -                       if (_dpu_core_perf_crtc_is_power_on(tmp_crtc) &&
> +                       if (tmp_crtc->enabled &&
>                             (dpu_crtc_get_client_type(tmp_crtc) ==
>                                             curr_client_type) &&
>                             (tmp_crtc != crtc)) {
> @@ -223,7 +218,7 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,
>         int ret = 0;
>
>         drm_for_each_crtc(tmp_crtc, crtc->dev) {
> -               if (_dpu_core_perf_crtc_is_power_on(tmp_crtc) &&
> +               if (tmp_crtc->enabled &&
>                         curr_client_type ==
>                                 dpu_crtc_get_client_type(tmp_crtc)) {
>                         dpu_cstate = to_dpu_crtc_state(tmp_crtc->state);
> @@ -280,7 +275,7 @@ void dpu_core_perf_crtc_release_bw(struct drm_crtc *crtc)
>          */
>         if (dpu_crtc_get_intf_mode(crtc) == INTF_MODE_CMD)
>                 drm_for_each_crtc(tmp_crtc, crtc->dev) {
> -                       if (_dpu_core_perf_crtc_is_power_on(tmp_crtc) &&
> +                       if (tmp_crtc->enabled &&
>                                 dpu_crtc_get_intf_mode(tmp_crtc) ==
>                                                 INTF_MODE_VIDEO)
>                                 return;
> @@ -315,7 +310,7 @@ static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms)
>         struct dpu_crtc_state *dpu_cstate;
>
>         drm_for_each_crtc(crtc, kms->dev) {
> -               if (_dpu_core_perf_crtc_is_power_on(crtc)) {
> +               if (crtc->enabled) {
>                         dpu_cstate = to_dpu_crtc_state(crtc->state);
>                         clk_rate = max(dpu_cstate->new_perf.core_clk_rate,
>                                                         clk_rate);
> @@ -366,7 +361,7 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,
>         old = &dpu_crtc->cur_perf;
>         new = &dpu_cstate->new_perf;
>
> -       if (_dpu_core_perf_crtc_is_power_on(crtc) && !stop_req) {
> +       if (crtc->enabled && !stop_req) {
>                 for (i = 0; i < DPU_POWER_HANDLE_DBUS_ID_MAX; i++) {
>                         /*
>                          * cases for bus bandwidth update.
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
> index 2be4312038c9..90bb255fad3a 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
> @@ -311,13 +311,4 @@ static inline enum dpu_crtc_client_type dpu_crtc_get_client_type(
>         return crtc && crtc->state ? RT_CLIENT : NRT_CLIENT;
>  }
>
> -/**
> - * dpu_crtc_is_enabled - check if dpu crtc is enabled or not
> - * @crtc: Pointer to crtc
> - */
> -static inline bool dpu_crtc_is_enabled(struct drm_crtc *crtc)
> -{
> -       return crtc ? crtc->enabled : false;
> -}
> -
>  #endif /* _DPU_CRTC_H_ */
> --
> 2.18.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

  parent reply	other threads:[~2018-10-18 21:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18 19:58 [PATCH 00/11] DPU cleanups Jordan Crouse
     [not found] ` <20181018195836.15885-1-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-18 19:58   ` [PATCH 01/11] drm/msm/dpu: Remove dpu_dbg Jordan Crouse
     [not found]     ` <20181018195836.15885-2-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-19 17:34       ` Bruce Wang
2018-10-19 18:11       ` Bruce Wang
     [not found]         ` <CAA3FfWU-KB=VCmrkriO8M1zdPg9FGO_bii7qjbzGXupapJFF9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-10-19 19:59           ` Jordan Crouse
2018-10-18 19:58   ` [PATCH 02/11] drm/msm/dpu: Use DEFINE_SHOW_ATTRIBUTE Jordan Crouse
     [not found]     ` <20181018195836.15885-3-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-18 21:43       ` Bruce Wang
2018-10-18 19:58   ` [PATCH 03/11] drm/msm/dpu: Remove dpu_crtc_get_mixer_height Jordan Crouse
     [not found]     ` <20181018195836.15885-4-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-18 21:44       ` Bruce Wang
2018-10-18 19:58   ` [PATCH 04/11] drm/msm/dpu: Remove dpu_crtc_is_enabled() Jordan Crouse
     [not found]     ` <20181018195836.15885-5-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-18 21:45       ` Bruce Wang [this message]
2018-10-18 19:58   ` [PATCH 05/11] drm/msm/dpu: Cleanup some container_of helper functions Jordan Crouse
2018-10-18 21:49     ` Sam Ravnborg
2018-10-18 19:58   ` [PATCH 06/11] drm/msm/dpu: Cleanup callers of dpu_hw_blk_init Jordan Crouse
2018-10-18 21:53     ` Sam Ravnborg
     [not found]       ` <20181018215359.GA5328-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
2018-10-19 17:13         ` Jordan Crouse
2018-10-18 19:58   ` [PATCH 07/11] drm/msm: Make irq_postinstall optional Jordan Crouse
     [not found]     ` <20181018195836.15885-8-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-19 13:56       ` Bruce Wang
2018-10-18 19:58   ` [PATCH 08/11] drm/msm/dpu: Remove dpu_irq and unused functions Jordan Crouse
     [not found]     ` <20181018195836.15885-9-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-19 14:56       ` Bruce Wang
2018-10-18 19:58   ` [PATCH 09/11] drm/msm/dpu: Debugfs related cleanups Jordan Crouse
     [not found]     ` <20181018195836.15885-10-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-22 15:45       ` Bruce Wang
2018-10-18 19:58   ` [PATCH 10/11] drm/msm/dpu: Further cleanups for static inline functions Jordan Crouse
2018-10-18 22:06     ` Sam Ravnborg
     [not found]       ` <20181018220620.GB5328-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
2018-10-19 17:09         ` Jordan Crouse
2018-10-18 19:58   ` [PATCH 11/11] drm/msm/dpu: Clean up dpu_media_info.h " Jordan Crouse
     [not found]     ` <20181018195836.15885-12-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-19 15:10       ` Bruce Wang
2018-11-05 23:30 [PATCH v2 00/11] DPU cleanups Jordan Crouse
     [not found] ` <20181105233103.7657-1-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-05 23:30   ` [PATCH 04/11] drm/msm/dpu: Remove dpu_crtc_is_enabled() Jordan Crouse
2018-11-06 14:31     ` 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='CAA3FfWWFE4HYUvaqe5NZiEuVqeyQwNRXAgfkVqsTzcXpJ1-H=A@mail.gmail.com' \
    --to=bzwang-f7+t8e8rja9g9huczpvpmw@public.gmane.org \
    --cc=abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.