[PATCH] drm: Do not set connector->encoder in drivers

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Nov 16 09:46:46 PST 2015


On Mon, Nov 16, 2015 at 06:19:53PM +0100, Thierry Reding wrote:
> From: Thierry Reding <treding at nvidia.com>
> 
> An encoder is associated with a connector by the DRM core as a result of
> setting up a configuration. Drivers using the atomic or legacy helpers
> should never set up this link, even if it is a static one.
> 
> While at it, try to catch this kind of error in the future by adding a
> WARN_ON() in drm_mode_connector_attach_encoder(). Note that this doesn't
> cover all the cases, since drivers could set this up after attaching.
> Drivers that use the atomic helpers will get a warning later on, though,
> so hopefully the two combined cover enough to help people avoid this in
> the future.

I'm pretty sure that when I started out writing armada-drm,
pre-initialising the connector's encoder was required, otherwise
DRM would oops.  Has something changed which makes a NULL pointer
there at initialisation always safe?

-- 
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.


More information about the dri-devel mailing list