From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Icenowy Zheng <icenowy@aosc.io>
Cc: Rob Herring <robh+dt@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-sunxi@googlegroups.com
Subject: Re: [linux-sunxi] Re: [PATCH v7 05/13] drm/sun4i: abstract a engine type
Date: Tue, 16 May 2017 14:14:50 +0200 [thread overview]
Message-ID: <20170516121450.oz3peeushg557lji@flea.home> (raw)
In-Reply-To: <4F7E36DB-B5F9-4DDE-A80D-0C1A75F0A882@aosc.io>
[-- Attachment #1: Type: text/plain, Size: 3147 bytes --]
On Mon, May 15, 2017 at 05:35:02PM +0800, Icenowy Zheng wrote:
>
>
> 于 2017年5月15日 GMT+08:00 下午5:20:01, Maxime Ripard <maxime.ripard@free-electrons.com> 写到:
> >On Mon, May 15, 2017 at 12:30:37AM +0800, Icenowy Zheng wrote:
> >> As we are going to add support for the Allwinner DE2 engine in
> >sun4i-drm
> >> driver, we will finally have two types of display engines -- the DE1
> >> backend and the DE2 mixer. They both do some display blending and
> >feed
> >> graphics data to TCON, and is part of the "Display Engine" called by
> >> Allwinner, so I choose to call them both "engine" here.
> >>
> >> Abstract the engine type to a new struct with an ops struct, which
> >contains
> >> functions that should be called outside the engine-specified code (in
> >> TCON, CRTC or TV Encoder code).
> >>
> >> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> >> Reviewed-by: Chen-Yu Tsai <wens@csie.org>
> >> ---
> >> Changes in v7:
> >> - Mention "Display Engine" for the name "engine".
> >> - Fixed some small issues found by Chen-Yu and added his ACK.
> >> Changes in v6:
> >> - Rebased on wens's multi-pipeline patchset.
> >> - Split out Makefile changes.
> >
> >You also added a get_id callback here...
> >
> >> +static const struct sunxi_engine_ops sun4i_backend_engine_ops = {
> >> + .commit = sun4i_backend_commit,
> >> + .layers_init = sun4i_layers_init,
> >> + .apply_color_correction = sun4i_backend_apply_color_correction,
> >> + .disable_color_correction = sun4i_backend_disable_color_correction,
> >> +};
> >> +
> >
> >... that you don't populate ...
> >
> >> @@ -477,7 +481,7 @@ static int sun4i_tcon_bind(struct device *dev,
> >struct device *master,
> >> dev_set_drvdata(dev, tcon);
> >> tcon->drm = drm;
> >> tcon->dev = dev;
> >> - tcon->id = backend->id;
> >> + tcon->id = sunxi_engine_get_id(engine);
> >
> >... that you call to fill the TCON ID ...
> >
> >> +/**
> >> + * sunxi_engine_get_id - Get the ID of the engine.
> >> + * @engine: pointer to the engine
> >> + *
> >> + * If the ID is not necessary, just do not implement it in
> >sunxi_engine_ops,
> >> + * and a default -1 will be returned.
> >> + */
> >> +static inline int
> >> +sunxi_engine_get_id(struct sunxi_engine *engine)
> >> +{
> >> + if (engine->ops && engine->ops->get_id)
> >> + return engine->ops->get_id(engine);
> >> +
> >> + return -1;
> >
> >... and will return -1 if not populated, which essentially means that
> >instead of having 0 or 1, we're now having -1 as our id.
> >
> >This is a regression, and I'm even wondering if we can't just store
> >the ID in the sunxi_engine structure. Is anything preventing us to do
> >that, instead of using a callback?
>
> Some engines (de2 mixer) doesn't use the ID. But 0 is a valid ID here.
Surely it will at some point.
> If we just store it in sunxi_engine, it should be assigned -1 for de2 mixer.
> Is this applicable?
>
> If it's okay I will do so.
Yes, it sounds reasonable.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
next prev parent reply other threads:[~2017-05-16 12:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-14 16:30 [PATCH v7 00/13] Initial Allwinner Display Engine 2.0 Support Icenowy Zheng
2017-05-14 16:30 ` [PATCH v7 01/13] dt-bindings: add binding for the Allwinner DE2 CCU Icenowy Zheng
2017-05-15 8:40 ` Maxime Ripard
2017-05-14 16:30 ` [PATCH v7 02/13] clk: sunxi-ng: add support for " Icenowy Zheng
2017-05-15 8:40 ` Maxime Ripard
2017-05-14 16:30 ` [PATCH v7 03/13] dt-bindings: add bindings for DE2 on V3s SoC Icenowy Zheng
2017-05-15 9:24 ` Maxime Ripard
2017-05-14 16:30 ` [PATCH v7 04/13] drm/sun4i: return only planes for layers created Icenowy Zheng
2017-05-15 9:24 ` Maxime Ripard
2017-05-14 16:30 ` [PATCH v7 05/13] drm/sun4i: abstract a engine type Icenowy Zheng
2017-05-15 9:20 ` Maxime Ripard
2017-05-15 9:35 ` [linux-sunxi] " Icenowy Zheng
2017-05-16 12:14 ` Maxime Ripard [this message]
2017-05-14 16:30 ` [PATCH v7 06/13] drm/sun4i: add a dedicated module for sun4i-backend and sun4i-layer Icenowy Zheng
2017-05-14 16:30 ` [PATCH v7 07/13] drm/sun4i: add a Kconfig option for sun4i-backend Icenowy Zheng
2017-05-14 16:30 ` [PATCH v7 08/13] drm/sun4i: add support for Allwinner DE2 mixers Icenowy Zheng
2017-05-14 16:30 ` [PATCH v7 09/13] drm/sun4i: Add compatible string for V3s display engine Icenowy Zheng
2017-05-14 16:30 ` [PATCH v7 10/13] drm/sun4i: tcon: add support for V3s TCON Icenowy Zheng
2017-05-14 16:30 ` [PATCH v7 11/13] ARM: sun8i: v3s: add device nodes for DE2 display pipeline Icenowy Zheng
2017-05-15 9:24 ` Maxime Ripard
2017-05-17 9:27 ` icenowy
2017-05-17 9:32 ` icenowy
2017-05-14 16:30 ` [PATCH v7 12/13] ARM: sun8i: v3s: add pinmux for LCD pins of V3s SoC Icenowy Zheng
2017-05-14 16:30 ` [PATCH v7 13/13] [DO NOT MERGE] ARM: sun8i: v3s: enable LCD panel of Lichee Pi Zero Icenowy Zheng
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=20170516121450.oz3peeushg557lji@flea.home \
--to=maxime.ripard@free-electrons.com \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=icenowy@aosc.io \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=robh+dt@kernel.org \
--cc=wens@csie.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
all inboxes | Powered by JetHome®