dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
To: Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH v2 6/7] drm/msm/dpu: assign intf to encoder in mode_set
Date: Mon, 4 Mar 2019 13:15:32 -0500	[thread overview]
Message-ID: <20190304181532.GY114153@art_vandelay> (raw)
In-Reply-To: <1550107156-17625-7-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

On Wed, Feb 13, 2019 at 05:19:15PM -0800, Jeykumar Sankaran wrote:
> Iterate and assign HW intf block to physical encoders
> in encoder modeset. Moving all the HW block assignments
> to encoder modeset to allow easy switching to state
> based resource management.
> 
> Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>

Reviewed-by: Sean Paul <sean@poorly.run>

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        | 22 +++++++++++++++++++-
>  .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c   | 24 ----------------------
>  2 files changed, 21 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index f648e7f..98ea478 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -968,7 +968,7 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
>  	struct dpu_hw_ctl *hw_ctl[MAX_CHANNELS_PER_ENC] = { NULL };
>  	struct dpu_hw_mixer *hw_lm[MAX_CHANNELS_PER_ENC] = { NULL };
>  	int num_lm = 0, num_ctl = 0;
> -	int i = 0, ret;
> +	int i, j, ret;
>  
>  	if (!drm_enc) {
>  		DPU_ERROR("invalid encoder\n");
> @@ -1065,6 +1065,26 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
>  			phys->hw_pp = dpu_enc->hw_pp[i];
>  			phys->hw_ctl = hw_ctl[i];
>  
> +			dpu_rm_init_hw_iter(&hw_iter, drm_enc->base.id,
> +					    DPU_HW_BLK_INTF);
> +			for (j = 0; j < MAX_CHANNELS_PER_ENC; j++) {
> +				struct dpu_hw_intf *hw_intf;
> +
> +				if (!dpu_rm_get_hw(&dpu_kms->rm, &hw_iter))
> +					break;
> +
> +				hw_intf = (struct dpu_hw_intf *)hw_iter.hw;
> +				if (hw_intf->idx == phys->intf_idx)
> +					phys->hw_intf = hw_intf;
> +			}
> +
> +			if (!phys->hw_intf) {
> +				DPU_ERROR_ENC(dpu_enc,
> +					      "no intf block assigned at idx: %d\n",
> +					      i);
> +				goto error;
> +			}
> +
>  			phys->connector = conn->state->connector;
>  			if (phys->ops.mode_set)
>  				phys->ops.mode_set(phys, mode, adj_mode);
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> index ce65521..02362c5 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> @@ -449,35 +449,11 @@ static int dpu_encoder_phys_vid_control_vblank_irq(
>  
>  static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc)
>  {
> -	struct msm_drm_private *priv;
> -	struct dpu_rm_hw_iter iter;
>  	struct dpu_hw_ctl *ctl;
>  	u32 flush_mask = 0;
>  
> -	if (!phys_enc || !phys_enc->parent || !phys_enc->parent->dev ||
> -			!phys_enc->parent->dev->dev_private) {
> -		DPU_ERROR("invalid encoder/device\n");
> -		return;
> -	}
> -	priv = phys_enc->parent->dev->dev_private;
> -
>  	ctl = phys_enc->hw_ctl;
>  
> -	dpu_rm_init_hw_iter(&iter, phys_enc->parent->base.id, DPU_HW_BLK_INTF);
> -	while (dpu_rm_get_hw(&phys_enc->dpu_kms->rm, &iter)) {
> -		struct dpu_hw_intf *hw_intf = (struct dpu_hw_intf *)iter.hw;
> -
> -		if (hw_intf->idx == phys_enc->intf_idx) {
> -			phys_enc->hw_intf = hw_intf;
> -			break;
> -		}
> -	}
> -
> -	if (!phys_enc->hw_intf) {
> -		DPU_ERROR("hw_intf not assigned\n");
> -		return;
> -	}
> -
>  	DPU_DEBUG_VIDENC(phys_enc, "\n");
>  
>  	if (WARN_ON(!phys_enc->hw_intf->ops.enable_timing))
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

  parent reply	other threads:[~2019-03-04 18:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14  1:19 [PATCH v2 0/7] move dpu resource parsing to encoder modeset Jeykumar Sankaran
2019-02-14  1:19 ` [PATCH v2 3/7] drm/msm/dpu: release resources on modeset failure Jeykumar Sankaran
     [not found]   ` <1550107156-17625-4-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2019-03-04 18:09     ` Sean Paul
     [not found] ` <1550107156-17625-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2019-02-14  1:19   ` [PATCH v2 1/7] drm/msm/dpu: move hw_inf encoder baseclass Jeykumar Sankaran
     [not found]     ` <1550107156-17625-2-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2019-03-04 18:08       ` Sean Paul
2019-02-14  1:19   ` [PATCH v2 2/7] drm/msm/dpu: remove phys_vid subclass Jeykumar Sankaran
     [not found]     ` <1550107156-17625-3-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2019-03-04 18:08       ` Sean Paul
2019-02-14  1:19   ` [PATCH v2 4/7] drm/msm/dpu: dont use encoder->crtc in atomic path Jeykumar Sankaran
     [not found]     ` <1550107156-17625-5-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2019-03-04 18:09       ` Sean Paul
2019-03-07  2:03         ` Jeykumar Sankaran
     [not found]           ` <ba0f304a0a28ed2be2ac585b671cfb1f-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2019-03-07 22:08             ` Sean Paul
2019-02-14  1:19   ` [PATCH v2 5/7] drm/msm/dpu: map mixer/ctl hw blocks in encoder modeset Jeykumar Sankaran
     [not found]     ` <1550107156-17625-6-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2019-03-04 18:12       ` Sean Paul
2019-02-14  1:19   ` [PATCH v2 6/7] drm/msm/dpu: assign intf to encoder in mode_set Jeykumar Sankaran
     [not found]     ` <1550107156-17625-7-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2019-03-04 18:15       ` Sean Paul [this message]
2019-02-14  1:19   ` [PATCH v2 7/7] drm/msm/dpu: check split role for single flush Jeykumar Sankaran
     [not found]     ` <1550107156-17625-8-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2019-03-04 18:16       ` Sean Paul
2019-02-14  1:39   ` [PATCH v2 0/7] move dpu resource parsing to encoder modeset Jeykumar Sankaran
2019-03-04 18:48   ` 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=20190304181532.GY114153@art_vandelay \
    --to=sean-p7ytbzm4h96eqtr555yldq@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@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;
as well as URLs for NNTP newsgroup(s).