UPSTREAM: drm: Do not set connector->encoder in drivers
authorThierry Reding <treding@nvidia.com>
Mon, 16 Nov 2015 17:19:53 +0000 (18:19 +0100)
committerYakir Yang <ykk@rock-chips.com>
Wed, 6 Jul 2016 07:25:34 +0000 (15:25 +0800)
commit5b74e85c21e96c82b9210858159663fa5937a09f
tree46476788e2071706add9fd83d056e7a92f42eda0
parent76f10cb390f01ba74acea1fd1953d6232706afb8
UPSTREAM: drm: Do not set connector->encoder in drivers

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.

Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: Mark yao <mark.yao@rock-chips.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1447694393-24700-1-git-send-email-thierry.reding@gmail.com
Change-Id: Iaec2775976574d93810b4e160ac8889d6bb55cad
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
(cherry pick from eb47fe8033d6c2013ce47ec44f39fa0092aa8551)
drivers/gpu/drm/bridge/dw-hdmi.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/i2c/tda998x_drv.c
drivers/gpu/drm/imx/parallel-display.c
drivers/gpu/drm/shmobile/shmob_drm_crtc.c