From: Emil Velikov <emil.l.velikov@gmail.com>
To: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: ML dri-devel <dri-devel@lists.freedesktop.org>,
devicetree <devicetree@vger.kernel.org>,
"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
David Airlie <airlied@linux.ie>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Rob Herring <robh+dt@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: Re: [PATCH v6 2/3] drm: Add support for the LogiCVC display controller
Date: Fri, 8 May 2020 11:32:46 +0100 [thread overview]
Message-ID: <CACvgo52dMPk_KPyNYhBTDOo_+s7hJuGDNjoWun63Jj4uMidszA@mail.gmail.com> (raw)
In-Reply-To: <20200507201103.GH2422122@aptenodytes>
On Thu, 7 May 2020 at 21:11, Paul Kocialkowski
<paul.kocialkowski@bootlin.com> wrote:
>
> Hi Emil,
>
> Thanks for the review!
>
> On Mon 04 May 20, 14:28, Emil Velikov wrote:
> > Just had a casual quick look for custom KMS properties, since new
> > drivers made that mistake in the past.
> > Thanks for not including any o/
>
> Yeah I made sure not to include any, I know it easily gets very problematic and
> creates disparity between drivers while needing to be kept alive even when a
> standard way arises due to the no API breakage policy.
>
> The not-for-merge patch that I've sent does introduce some for the colorkey,
> and that's why they are marked as such :)
>
> > I made a couple of trivial suggestions - if you agree, feel free to
> > keep them as follow-up patches.
> >
> > On Thu, 30 Apr 2020 at 20:28, Paul Kocialkowski
> > <paul.kocialkowski@bootlin.com> wrote:
> >
> > > +int logicvc_of_property_parse_u32(struct device_node *of_node,
> > > + const char *name, u32 *target)
> > > +{
> > > + struct logicvc_of_property *property;
> > > + const char *string;
> > > + u32 value;
> > > + int ret;
> > > +
> > > + property = logicvc_of_property_lookup(name);
> > > + if (!property)
> > > + return -EINVAL;
> > > +
> > One could have the logicvc_of_properties[] entries indexed with the
> > logicvc_of_property_parse_{u32,bool} caller, using that instead of the
> > name string.
>
> Do I understand correctly that you're suggesting passing each entry's
> struct logicvc_of_property pointer to the function?
>
> I went for strings to make the code explicit and easy to read so I'd really
> like to keep it that way and avoid passing things like
> &logicvc_of_properties[4] or an index integer.
>
Add a some #define/enum and go to town. Example with sub-optimal names below:
enum foobar {
LVC_OF_DISP_INTF,
LVC_OF_DISP_CLRSPC,
...
};
static struct logicvc_of_property logicvc_of_properties[] = {
[LVC_OF_DISP_INTF] = {
.name = "xylon,display-interface",
...
},
[LVC_OF_DISP_CLRSPC] = {
.name = "xylon,display-colorspace",
...
},
...
}
While the callers are:
ret = logicvc_of_property_parse_u32(of_node, LVC_OF_DISP_INTF,
&config->display_colorspace);
ret = logicvc_of_property_parse_u32(of_node, LVC_OF_DISP_CLRSPC,
&config->display_depth);
-Emil
next prev parent reply other threads:[~2020-05-08 10:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 19:27 [PATCH v6 0/3] drm: LogiCVC display controller support Paul Kocialkowski
2020-04-30 19:27 ` [PATCH v6 1/3] dt-bindings: display: Document the Xylon LogiCVC display controller Paul Kocialkowski
2020-04-30 19:27 ` [PATCH v6 2/3] drm: Add support for the " Paul Kocialkowski
2020-05-04 13:28 ` Emil Velikov
2020-05-07 20:11 ` Paul Kocialkowski
2020-05-08 10:32 ` Emil Velikov [this message]
2020-04-30 19:27 ` [PATCH v6 3/3] NOTFORMERGE: drm/logicvc: Add plane colorkey support Paul Kocialkowski
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=CACvgo52dMPk_KPyNYhBTDOo_+s7hJuGDNjoWun63Jj4uMidszA@mail.gmail.com \
--to=emil.l.velikov@gmail.com \
--cc=airlied@linux.ie \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.kocialkowski@bootlin.com \
--cc=robh+dt@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=tzimmermann@suse.de \
/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).