From: Daniel Vetter <daniel@ffwll.ch>
To: Brian Starkey <brian.starkey@arm.com>
Cc: Daniel Vetter <daniel@ffwll.ch>,
Russell King <rmk+kernel@armlinux.org.uk>,
dri-devel <dri-devel@lists.freedesktop.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm: tda998x: mali-dp: hdlcd: refactor connector registration
Date: Tue, 25 Oct 2016 12:19:19 +0200 [thread overview]
Message-ID: <20161025101919.35c53zoyf435urp3@phenom.ffwll.local> (raw)
In-Reply-To: <20161025095233.GD1988@e106950-lin.cambridge.arm.com>
On Tue, Oct 25, 2016 at 10:52:33AM +0100, Brian Starkey wrote:
> Hi Daniel,
>
> On Mon, Oct 24, 2016 at 10:24:42PM +0200, Daniel Vetter wrote:
> > On Mon, Oct 24, 2016 at 4:52 PM, Brian Starkey <brian.starkey@arm.com> wrote:
> > > >
> > > > > diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c
> > > > > b/drivers/gpu/drm/i2c/tda998x_drv.c
> > > > > index f4315bc..6e6fca2 100644
> > > > > --- a/drivers/gpu/drm/i2c/tda998x_drv.c
> > > > > +++ b/drivers/gpu/drm/i2c/tda998x_drv.c
> > > > > @@ -1369,7 +1369,6 @@ const struct drm_connector_helper_funcs
> > > > > tda998x_connector_helper_funcs = {
> > > > >
> > > > > static void tda998x_connector_destroy(struct drm_connector *connector)
> > > > > {
> > > > > - drm_connector_unregister(connector);
> > > > > drm_connector_cleanup(connector);
> > > > > }
> > > > >
> > > > > @@ -1441,16 +1440,10 @@ static int tda998x_bind(struct device *dev,
> > > > > struct device *master, void *data)
> > > > > if (ret)
> > > > > goto err_connector;
> > > > >
> > > > > - ret = drm_connector_register(&priv->connector);
> > > > > - if (ret)
> > > > > - goto err_sysfs;
> > > > > -
> > > >
> > > >
> > > > Instead of smashing all these patches into one, what about checking here
> > > > for midlayer driver set with:
> > > >
> > > > /* register here for drivers still using midlayer load/unload */
> > > > if (dev->driver->load)
> > > > drm_connector_register(connector),
> > > >
> > > > Similar in other places. That way we wouldn't need to switch the world in
> > > > one patch.
> > >
> > >
> > > I don't think that helps. If we do that in isolation (first), then
> > > mali-dp and hdlcd won't get their connectors registered because their
> > > bind order is:
> > >
> > > drm_dev_register();
> > > component_bind_all();
> > >
> > > If we change the mali-dp/hdlcd bind order first, then tda998x will
> > > explode on drm_connector_register() until it's patched to remove that.
> > >
> > > As I mentioned in my mail to Russell, the only way I can see to avoid
> > > patching all three drivers in one go is:
> > > 1) Add (probably open-coded) drm_connector_register_all() to the end
> > > of bind in hdlcd and mali-dp
> > > 2) Patch tda998x to remove drm_connector_register()
> > > 3) Reorder hdlcd/mali-dp bind and remove the connector registration
> > > added in 1)
> > >
> > > We can do that, but it's extra churn for the same result, and none of
> > > the 5 patches will really make sense in isolation anyway.
> >
> > I thought there's also armada to take care of, which this patch would
> > break? Maybe even another driver, so the hack would still be useful
> > for those other drivers.
>
> OK it seems like this situation has got very confused. In short, this
> patch does not break armada. Russell previously tested the tda998x
> patch against armada and reported no issues.
> Drivers with a ->load() callback don't need to register the connector
> anymore, because drm_dev_register() does it for them.
>
> As far as I know, this patch touching these three drivers is
> sufficient to allow all current users of tda998x to continue using it,
> whilst also allowing armada and tilcdc to be de-midlayered.
Ah, makes sense. Should I apply this to drm-misc so it's in a shared tree?
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2016-10-25 10:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20161024142312.GA1988@e106950-lin.cambridge.arm.com>
2016-10-24 14:27 ` Brian Starkey
2016-10-24 14:36 ` Daniel Vetter
2016-10-24 14:52 ` Brian Starkey
2016-10-24 20:24 ` Daniel Vetter
2016-10-25 9:52 ` Brian Starkey
2016-10-25 10:19 ` Daniel Vetter [this message]
2016-10-25 10:40 ` Brian Starkey
2016-10-31 9:00 ` Russell King - ARM Linux
2016-10-31 10:16 ` Russell King - ARM Linux
2016-10-31 8:58 ` Russell King - ARM Linux
2016-11-08 9:25 ` Daniel Vetter
2016-11-08 10:59 ` Russell King - ARM Linux
2016-11-08 11:27 ` Daniel Vetter
2016-11-15 9:46 ` [GIT PULL] " Russell King - ARM Linux
2016-11-16 21:31 ` Russell King - ARM Linux
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=20161025101919.35c53zoyf435urp3@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=brian.starkey@arm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+kernel@armlinux.org.uk \
/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®