All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: markyacoub@chromium.org, dri-devel@lists.freedesktop.org,
	swboyd@chromium.org, seanpaul@chromium.org,
	quic_jesszhan@quicinc.com, quic_aravindh@quicinc.com,
	freedreno@lists.freedesktop.org
Subject: Re: [PATCH v2 1/3] drm/msm/dpu: move intf and wb assignment to dpu_encoder_setup_display()
Date: Thu, 16 Jun 2022 00:59:01 +0300	[thread overview]
Message-ID: <CAA8EJpp80=-uwXVQhkgGq6-nXw17Lv-5fRg0kuZOAQENcDmVrw@mail.gmail.com> (raw)
In-Reply-To: <1655328122-23619-1-git-send-email-quic_abhinavk@quicinc.com>

On Thu, 16 Jun 2022 at 00:22, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>
> intf and wb resources are not dependent on the rm global
> state so need not be allocated during dpu_encoder_virt_atomic_mode_set().
>
> Move the allocation of intf and wb resources to dpu_encoder_setup_display()
> so that we can utilize the hw caps even during atomic_check() phase.
>
> Since dpu_encoder_setup_display() already has protection against
> setting invalid intf_idx and wb_idx, these checks can now
> be dropped as well.
>
> changes in v2:
>         - add phys->hw_intf and phys->hw_wb checks back
>
> Fixes: e02a559a720f ("make changes to dpu_encoder to support virtual encoder")
> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 36 ++++++++++++++---------------
>  1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 3a462e327e0e..3be73211d631 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -1048,24 +1048,6 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc,
>                 phys->hw_pp = dpu_enc->hw_pp[i];
>                 phys->hw_ctl = to_dpu_hw_ctl(hw_ctl[i]);
>
> -               if (phys->intf_idx >= INTF_0 && phys->intf_idx < INTF_MAX)
> -                       phys->hw_intf = dpu_rm_get_intf(&dpu_kms->rm, phys->intf_idx);
> -
> -               if (phys->wb_idx >= WB_0 && phys->wb_idx < WB_MAX)
> -                       phys->hw_wb = dpu_rm_get_wb(&dpu_kms->rm, phys->wb_idx);
> -
> -               if (!phys->hw_intf && !phys->hw_wb) {
> -                       DPU_ERROR_ENC(dpu_enc,
> -                                     "no intf or wb block assigned at idx: %d\n", i);
> -                       return;
> -               }
> -
> -               if (phys->hw_intf && phys->hw_wb) {
> -                       DPU_ERROR_ENC(dpu_enc,
> -                                       "invalid phys both intf and wb block at idx: %d\n", i);
> -                       return;
> -               }
> -
>                 phys->cached_mode = crtc_state->adjusted_mode;
>                 if (phys->ops.atomic_mode_set)
>                         phys->ops.atomic_mode_set(phys, crtc_state, conn_state);
> @@ -2293,7 +2275,25 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
>                 struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
>                 atomic_set(&phys->vsync_cnt, 0);
>                 atomic_set(&phys->underrun_cnt, 0);
> +
> +               if (phys->intf_idx >= INTF_0 && phys->intf_idx < INTF_MAX)
> +                       phys->hw_intf = dpu_rm_get_intf(&dpu_kms->rm, phys->intf_idx);
> +
> +               if (phys->wb_idx >= WB_0 && phys->wb_idx < WB_MAX)
> +                       phys->hw_wb = dpu_rm_get_wb(&dpu_kms->rm, phys->wb_idx);
> +
> +               if (!phys->hw_intf && !phys->hw_wb) {
> +                       DPU_ERROR_ENC(dpu_enc, "no intf or wb block assigned at idx: %d\n", i);
> +                       ret = -EINVAL;
> +               }
> +
> +               if (phys->hw_intf && phys->hw_wb) {
> +                       DPU_ERROR_ENC(dpu_enc,
> +                                       "invalid phys both intf and wb block at idx: %d\n", i);
> +                       ret = -EINVAL;
> +               }
>         }
> +
>         mutex_unlock(&dpu_enc->enc_lock);
>
>         return ret;
> --
> 2.7.4
>


-- 
With best wishes
Dmitry

  parent reply	other threads:[~2022-06-15 21:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 21:22 [PATCH v2 1/3] drm/msm/dpu: move intf and wb assignment to dpu_encoder_setup_display() Abhinav Kumar
2022-06-15 21:22 ` [PATCH v2 2/3] drm/msm/dpu: fix maxlinewidth for writeback block Abhinav Kumar
2022-06-15 21:22 ` [PATCH v2 3/3] drm/msm/dpu: remove hard-coded linewidth limit for writeback Abhinav Kumar
2022-06-15 21:59 ` Dmitry Baryshkov [this message]
2022-06-16  8:36 ` [PATCH v2 1/3] drm/msm/dpu: move intf and wb assignment to dpu_encoder_setup_display() Dmitry Baryshkov

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='CAA8EJpp80=-uwXVQhkgGq6-nXw17Lv-5fRg0kuZOAQENcDmVrw@mail.gmail.com' \
    --to=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=markyacoub@chromium.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_aravindh@quicinc.com \
    --cc=quic_jesszhan@quicinc.com \
    --cc=seanpaul@chromium.org \
    --cc=swboyd@chromium.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.