linux-arm-msm.vger.kernel.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: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 01/25] drm/msm/dpu: fix hw ctl retrieval for mixer muxing
Date: Thu, 11 Oct 2018 10:51:47 -0400	[thread overview]
Message-ID: <20181011145147.GA154175@art_vandelay> (raw)
In-Reply-To: <126041ab035da0674d0e5a6d2ce151da-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

On Wed, Oct 10, 2018 at 11:35:56AM -0700, Jeykumar Sankaran wrote:
> On 2018-10-10 07:29, Sean Paul wrote:
> > On Tue, Oct 09, 2018 at 10:46:41PM -0700, Jeykumar Sankaran wrote:
> > > On 2018-10-09 11:07, Sean Paul wrote:
> > > > On Mon, Oct 08, 2018 at 09:27:18PM -0700, Jeykumar Sankaran wrote:
> > > > > Layer mixer/pingpong block counts and hw ctl block counts
> > > > > will not be same for all the topologies (e.g. layer
> > > > > mixer muxing to single interface)
> > > > >
> > > > > Use the encoder's split_role info to retrieve the
> > > > > respective control path for programming.
> > > > >
> > > > > Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
> > > > > ---
> > > > >  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 ++++++---
> > > > >  1 file changed, 6 insertions(+), 3 deletions(-)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > > b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > > > index 96cdf06..d12f896 100644
> > > > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > > > @@ -1060,6 +1060,7 @@ static void dpu_encoder_virt_mode_set(struct
> > > > drm_encoder *drm_enc,
> > > > >
> > > > >  	for (i = 0; i < dpu_enc->num_phys_encs; i++) {
> > > > >  		struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
> > > > > +		int ctl_index;
> > > > >
> > > > >  		if (phys) {
> > > > >  			if (!dpu_enc->hw_pp[i]) {
> > > > > @@ -1068,14 +1069,16 @@ static void dpu_encoder_virt_mode_set(struct
> > > > drm_encoder *drm_enc,
> > > > >  				return;
> > > > >  			}
> > > > >
> > > > > -			if (!hw_ctl[i]) {
> > > > > +			ctl_index = phys->split_role == ENC_ROLE_SLAVE ? 1
> > > > : 0;
> > > > > +
> > > >
> > > > What if MAX_CHANNELS_PER_ENC isn't 2? Similarly, what if num_phys_encs
> > > 
> > > > MAX_CHANNELS_PER_ENC? It seems like there should be a more formal
> > > > relationship
> > > > between all of these verious values (num_of_h_tiles assumed to be <= 2
> > > > as
> > > > well).
> > > > If one of them changes beyond the assumed bound, the rest of the
> > driver
> > > > falls
> > > > over pretty hard.
> > > >
> > > MAX_CHANNELS_PER_ENC is set to 2 to represent HW limitation on the
> > chipset
> > > as
> > > we cannot gang up more than 2 LM chain to an interface. Supporting
> > > more
> > than
> > > 2
> > > might demand much larger changes than validating for boundaries.
> > > 
> > > num_phys_enc is the max no of phys encoders we create as we are
> > > looping
> > > through
> > > num_of_h_tiles which cannot be more than priv->dsi array size.
> > > 
> > > So its very unlikely we would expect these loops to go out of bound!
> > 
> > For now, sure. However a new revision of hardware will be a pain to add
> > support
> > for if we add more assumptions, and secondly it makes it _really_ hard
> > to
> > understand the code if you don't have Qualcomm employee-level access to
> > the
> > hardware design :).
> > 
> I am having a hard time understanding why you have to see these counts as
> "assumptions".


        ctl_index = phys->split_role == ENC_ROLE_SLAVE ? 1 : 0
        if (!hw_ctl[ctl_index]) {

Assumes that ARRAY_SIZE(hw_ctl) > 1 if phys is a slave


        if (!dpu_enc->hw_pp[i]) {

Assumes that ARRAY_SIZE(hw_pp) >= ARRAY_SIZE(dpu_enc->phys_encs)


> 
> Except for MAX_CHANNELS_PER_ENC, all the other counts are either calculated
> or derived from the other modules linked to the topology.
> 
> h_tiles is the drm_connector terminology which represents the number of
> panels
> the display is driving. We use this information to determine the HW
> block chains in the MDP. HW blocks counts (pp or ctl) need not be same
> as the h_tile count to replace them with.

I must be missing something, because it seems that there's a 1:1 mapping of

num_h_tiles : num_phys_encs

And for each physical encoder, there's exactly one intf, pp, ctl assigned to it.
The issue I had was that when we loop through N phys_encs, we assume that there
are at least N hw blocks.

I think the takeaway is that I don't understand the hardware and its constraints
as well as you, so if this makes sense to you, let's go with it. Perhaps I'll
stare at it a while longer to try to refine my mental model.

Sean

> 
> I believe maintaining the counts independently at each layer allows us to
> have more
> flexibility to support independent HW chaining for future revisions.
> 
> Would it be more convincing if I get the MAX_CHANNELS_PER_ENC value from
> catalog.c?
> 
> > So this is why I'm advocating for the reduction of the number of
> > "num_of_"
> > values we assume are all in the same range. It's a lot easier to
> > understand the
> > hardware when you can see that a phys encoder is needed per h tile, and
> > that a
> > ctl/pp is needed per phys encoder.
> This is exactly the idea I don't want to convey to the reader. For the LM
> merge path,
> each phys encoder will not be having its own control. Based on the topology
> we
> are supporting, HW block counts can vary. We can even drive:
> - 2 interfaces with 1 ctl and 1 ping pong
> - 1 interface with 1 ctl and 2 ping pongs
> - 1 interface with 1 ctl and 1 ping pong
> 
> Thanks,
> Jeykumar S.
> 
> > 
> > Anyways, just my $0.02.
> > 
> > Sean
> > 
> > > 
> > > Thanks,
> > > Jeykumar S.
> > > >
> > > > > +			if (!hw_ctl[ctl_index]) {
> > > > >  				DPU_ERROR_ENC(dpu_enc, "no ctl block
> > > > assigned"
> > > > > -					     "at idx: %d\n", i);
> > > > > +					     "at idx: %d\n", ctl_index);
> > > > >  				return;
> > > >
> > > > When you return on error here, should you give back the resources that
> > > > you've
> > > > already provisioned?
> > > >
> > > > >  			}
> > > > >
> > > > >  			phys->hw_pp = dpu_enc->hw_pp[i];
> > > > > -			phys->hw_ctl = hw_ctl[i];
> > > > > +			phys->hw_ctl = hw_ctl[ctl_index];
> > > > >
> > > > >  			phys->connector = conn->state->connector;
> > > > >  			if (phys->ops.mode_set)
> > > > > --
> > > > > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
> > > > Forum,
> > > > > a Linux Foundation Collaborative Project
> > > > >
> > > > > _______________________________________________
> > > > > Freedreno mailing list
> > > > > Freedreno@lists.freedesktop.org
> > > > > https://lists.freedesktop.org/mailman/listinfo/freedreno
> > > 
> > > --
> > > Jeykumar S
> 
> -- 
> Jeykumar S

-- 
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:[~2018-10-11 14:51 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09  4:27 [PATCH 00/25] reserve RM resources in CRTC state Jeykumar Sankaran
     [not found] ` <1539059262-8326-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09  4:27   ` [PATCH 01/25] drm/msm/dpu: fix hw ctl retrieval for mixer muxing Jeykumar Sankaran
     [not found]     ` <1539059262-8326-2-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 16:05       ` Jordan Crouse
2018-10-09 18:07     ` [Freedreno] " Sean Paul
2018-10-10  5:46       ` Jeykumar Sankaran
2018-10-10 14:29         ` [Freedreno] " Sean Paul
2018-10-10 18:35           ` Jeykumar Sankaran
     [not found]             ` <126041ab035da0674d0e5a6d2ce151da-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-11 14:51               ` Sean Paul [this message]
2018-10-09  4:27   ` [PATCH 02/25] drm/msm/dpu: avoid tracking reservations in RM Jeykumar Sankaran
     [not found]     ` <1539059262-8326-3-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 19:57       ` Sean Paul
2018-10-09  4:27   ` [PATCH 03/25] drm/msm/dpu: remove dev from RM Jeykumar Sankaran
     [not found]     ` <1539059262-8326-4-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 19:58       ` Sean Paul
2018-10-09  4:27   ` [PATCH 04/25] drm/msm/dpu: clean up dpu_rm_check_property_topctl declaration Jeykumar Sankaran
     [not found]     ` <1539059262-8326-5-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 19:59       ` Sean Paul
2018-10-09  4:27   ` [PATCH 05/25] drm/msm/dpu: remove encoder from crtc mixer struct Jeykumar Sankaran
     [not found]     ` <1539059262-8326-6-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 20:03       ` Sean Paul
2018-10-09  4:27   ` [PATCH 06/25] drm/msm/dpu: clean up redundant hw type Jeykumar Sankaran
     [not found]     ` <1539059262-8326-7-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 20:32       ` Sean Paul
2018-10-10  0:40       ` kbuild test robot
2018-10-09  4:27   ` [PATCH 07/25] drm/msm/dpu: reserve using crtc state Jeykumar Sankaran
     [not found]     ` <1539059262-8326-8-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 21:06       ` Sean Paul
2018-10-10  6:28         ` Jeykumar Sankaran
     [not found]           ` <eabacae428bee1041fc7f9bafec144f7-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-12 22:19             ` Jeykumar Sankaran
2018-10-09 21:53     ` kbuild test robot
2018-10-09  4:27   ` [PATCH 08/25] drm/msm/dpu: release reservation " Jeykumar Sankaran
2018-10-10 14:50     ` Sean Paul
2018-10-09  4:27   ` [PATCH 09/25] drm/msm/dpu: make RM iterator static Jeykumar Sankaran
     [not found]     ` <1539059262-8326-10-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-10 14:51       ` Sean Paul
2018-10-09  4:27   ` [PATCH 10/25] drm/msm/dpu: maintain hw_mdp in kms Jeykumar Sankaran
     [not found]     ` <1539059262-8326-11-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 16:42       ` Jordan Crouse
2018-10-10 14:54       ` Sean Paul
2018-10-09  4:27   ` [PATCH 11/25] drm/msm/dpu: remove reserve in encoder mode_set Jeykumar Sankaran
     [not found]     ` <1539059262-8326-12-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-10 14:57       ` Sean Paul
2018-10-09  4:27   ` [PATCH 12/25] drm/msm/dpu: remove mode_set_complete Jeykumar Sankaran
2018-10-10 14:59     ` Sean Paul
2018-10-09  4:27   ` [PATCH 13/25] drm/msm/dpu: make RM iterator hw type specific Jeykumar Sankaran
     [not found]     ` <1539059262-8326-14-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-10 15:00       ` Sean Paul
2018-10-09  4:27   ` [PATCH 14/25] drm/msm/dpu: remove enc_id tagging for hw blocks Jeykumar Sankaran
2018-10-10 15:06     ` Sean Paul
2018-10-10 18:41       ` Jeykumar Sankaran
2018-10-09  4:27   ` [PATCH 15/25] drm/msm/dpu: avoid redundant hw blk reference Jeykumar Sankaran
     [not found]     ` <1539059262-8326-16-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-10 15:07       ` Sean Paul
2018-10-09  4:27   ` [PATCH 16/25] drm/msm/dpu: clean up test_only flag for RM reservation Jeykumar Sankaran
2018-10-10 15:10     ` Sean Paul
2018-10-09  4:27   ` [PATCH 17/25] drm/msm/dpu: remove RM HW block list iterator Jeykumar Sankaran
2018-10-09  4:27   ` [PATCH 18/25] drm/msm/dpu: merge RM interface reservation helpers Jeykumar Sankaran
     [not found]     ` <1539059262-8326-19-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 16:50       ` Jordan Crouse
     [not found]         ` <20181009165022.GD3130-9PYrDHPZ2Orvke4nUoYGnHL1okKdlPRT@public.gmane.org>
2018-10-09 18:20           ` Jeykumar Sankaran
2018-10-09  4:27   ` [PATCH 19/25] drm/msm/dpu: remove msm_display_topology Jeykumar Sankaran
2018-10-09  4:27   ` [PATCH 20/25] drm/msm/dpu: refine layer mixer reservations Jeykumar Sankaran
2018-10-09  4:27   ` [PATCH 21/25] drm/msm/dpu: merge RM reservation helpers Jeykumar Sankaran
2018-10-09  4:27   ` [PATCH 22/25] drm/msm/dpu: make crtc and encoder specific HW reservation Jeykumar Sankaran
     [not found]     ` <1539059262-8326-23-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 20:41       ` Sean Paul
2018-10-10  6:15         ` Jeykumar Sankaran
2018-10-10 14:33           ` [Freedreno] " Sean Paul
2018-10-09  4:27   ` [PATCH 23/25] drm/msm/dpu: remove max_width from RM Jeykumar Sankaran
2018-10-09  4:27   ` [PATCH 24/25] drm/msm/dpu: remove mutex locking for RM interfaces Jeykumar Sankaran
     [not found]     ` <1539059262-8326-25-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 19:57       ` Sean Paul
2018-10-10  6:03         ` Jeykumar Sankaran
     [not found]           ` <0c506d6b3edbfec7519a2bffa9bdaedc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-10 14:36             ` Sean Paul
2018-10-10 18:40               ` [Freedreno] " Jeykumar Sankaran
2018-10-09  4:27   ` [PATCH 25/25] drm/msm/dpu: maintain RM init check internally Jeykumar Sankaran
2018-10-09 19:29   ` [PATCH 00/25] reserve RM resources in CRTC state 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=20181011145147.GA154175@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=jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@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).