All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
To: skolluku-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Cc: mark.rutland-5wv7dgnIgG8@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	linux-arm-msm-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [DPU PATCH 2/2] drm/msm: Add hardware catalog file for SDM845
Date: Tue, 20 Mar 2018 11:17:11 -0400	[thread overview]
Message-ID: <20180320151711.GP223881@art_vandelay> (raw)
In-Reply-To: <a4863676581e8a25f13233a65a387ae4-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

On Tue, Mar 20, 2018 at 07:13:38PM +0530, skolluku@codeaurora.org wrote:
> On 2018-03-19 19:29, Sean Paul wrote:
> > On Wed, Mar 14, 2018 at 11:21:38AM +0530, Sravanthi Kollukuduru wrote:
> > > This change adds the hardware catalog information in driver source
> > > for SDM845. This removes the current logic of dt based parsing
> > > of target catalog information.
> > > 
> > > Signed-off-by: Sravanthi Kollukuduru <skolluku@codeaurora.org>

<snip />

> > > +{
> > > +	/* Layer capability */
> > > +	static const struct dpu_sspp_sub_blks vig_sblk_0 = {
> > > +		.maxlinewidth = 2560,
> > > +		.pixel_ram_size = 50 * 1024,
> > > +		.maxdwnscale = 4,
> > > +		.maxupscale = 20,
> > > +		.maxhdeciexp = DECIMATION_40X_MAX_H,
> > > +		.maxvdeciexp = DECIMATION_40X_MAX_V,
> > > +		.smart_dma_priority = 5,
> > > +		.src_blk = {.name = "sspp_src_0", .id = DPU_SSPP_SRC,
> > > +			.base = 0x00, .len = 0x150,},
> > > +		.scaler_blk = {.name = "sspp_scaler0",
> > > +			.id = DPU_SSPP_SCALER_QSEED3,
> > > +			.base = 0xa00, .len = 0xa0,},
> > > +		.csc_blk = {.name = "sspp_csc0", .id = DPU_SSPP_CSC_10BIT,
> > > +			.base = 0x1a00, .len = 0x100,},
> > > +		.format_list = plane_formats_yuv,
> > > +		.virt_format_list = plane_formats,
> > > +	};
> > 
> > Instead of locating all of these parameters in one file, these should be
> > located in their respective driver file. It also seems like you could
> > separate
> > out the common stuff such as line width, ram size, scaling, format, etc
> > parameters from the pipeline setup.
> > 
> > The same comments apply to the other blocks. Move things into the
> > drivers,
> > use compatibility string to determine the version, and then associate
> > the common
> > parameters with of_device_id.data.
> > 
> > Sean
> > 
> > <snip />
> 
> Thanks Sean for the feedback.
> The idea behind this approach is to maintain a one point access for all the
> target specific information, analogous to the current dpu dtsi file.
> This also ensures easy maintenance for different hardware versions, as all
> it
> takes is to add another file instead of updating across individual sub block
> files.

I am not convinced this is what we should optimize for. This file is basically
unreadable, and it's abstracting relevant details away from the block code. There
are also a TON of duplicated parameters/values which is error-prone. Lastly,
this is not the type of file that you want to copy/paste multiple times, it would
be much better to simply add the new structs to the block drivers where applicable.

> 
> Also, i'm not quite clear on how compatibility strings is applicable to sub
> blocks.

Consider the following example from rockchip:
https://gitlab.freedesktop.org/seanpaul/dpu-staging/blob/for-next/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#L538

Each time the vop is changed, it gets a new compatible string in the dt bindings.
This compatible string is tied to a parameters that describe the features of
that version of vop. This data is tied to the driver data during probe and used
whe needed throughout the driver.

So all of your catalog data should be broken up into structs specific to the
various sub-blocks of the dpu driver and associated with compatible strings.
When a new chip comes out with different parameters, a new struct should be
defined along with a new compatible string.

Make sense?

Sean

> Please clarify.
> 
> Thanks,
> Sravanthi

-- 
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-03-20 15:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14  5:51 [DPU PATCH 0/2] Add hardware catalog information in driver source for SDM845 Sravanthi Kollukuduru
2018-03-14  5:51 ` [DPU PATCH 1/2] dt-bindings: msm/disp: Remove hw block offset DT entries " Sravanthi Kollukuduru
     [not found]   ` <1521006698-23703-2-git-send-email-skolluku-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-03-18 12:49     ` Rob Herring
2018-03-19  6:19       ` skolluku
2018-03-29 15:04         ` Rob Herring
     [not found]           ` <CAL_Jsq+d8wvrX9myO4JN6WcuSmuERRNC_uyMEzQCkSxfB5qpVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-03-29 15:28             ` Sean Paul
     [not found] ` <1521006698-23703-1-git-send-email-skolluku-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-03-14  5:51   ` [DPU PATCH 2/2] drm/msm: Add hardware catalog file " Sravanthi Kollukuduru
2018-03-19 13:59     ` Sean Paul
2018-03-20 13:43       ` skolluku-sgV2jX0FEOL9JmXXK+q4OQ
     [not found]         ` <a4863676581e8a25f13233a65a387ae4-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-03-20 15:17           ` Sean Paul [this message]
2018-03-21 10:35             ` skolluku-sgV2jX0FEOL9JmXXK+q4OQ
2018-03-21 13:52               ` [Freedreno] " 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=20180320151711.GP223881@art_vandelay \
    --to=seanpaul-f7+t8e8rja9g9huczpvpmw@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=hoegsberg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=linux-arm-msm-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=skolluku-sgV2jX0FEOL9JmXXK+q4OQ@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.