All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] drm/panel: Handle the "panel is missing" case properly
@ 2018-05-03 16:40 Boris Brezillon
  2018-05-03 16:40   ` Boris Brezillon
                   ` (5 more replies)
  0 siblings, 6 replies; 32+ messages in thread
From: Boris Brezillon @ 2018-05-03 16:40 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter, dri-devel, Thierry Reding,
	Eric Anholt, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, devicetree
  Cc: Boris Brezillon

Hello,

This is a new attempt at fixing the "panel is missing" issue (described
in this thread [1]). I lost track of Eric's proposal, but I recently
proposed to address this problem through a new ->detect() hook in the
panel_funcs interface [2], which was rejected.

So here is a new version based on the feedback I had from Daniel,
Thierry and Rob.

The idea is to allow of_drm_find_panel() to return -ENODEV and let the
DRM driver decide what to do with that (silently ignore the missing
component and register the DRM device, or fail to register the DRM
device).

Patch 1 is just a fix for an OF node ref leak I found in the tegra
driver while working on this patch series. It can be applied
independently but I send it here since patch 2 depends on it.

Patch 2 changes the semantic of of_drm_find_panel() so that it returns
an ERR_PTR() instead of NULL when the panel is not found. This way
we'll be able to differentiate the "panel is missing" from "panel has
not been probed yet" errors.

Patch 3 and 4 are adding new tests in of_drm_find_panel() and
drm_of_find_panel_or_bridge() to return -ENODEV when the status
property of the DT node is not set to "okay".

Patch 5 is patching the VC4 DSI encoder driver to gracefully handle the
-ENODEV case and allow the registration of the DRM device when the DSI
device is disabled.

And finally, patch 6 is modifying the rpi-touchscreen panel driver to
update the status property of the DT node when the device is not
reachable on the I2C bus. This way, the DSI encoder driver will get an
-ENODEV and the DRM device will be registered even if the DSI panel
is not connected.
Note that the status prop update is currently done in the I2C driver
instead of the I2C or device-model core because I think modifying the
behavior for all I2C devices (or all devices) is too risky.

Feel free to comment on this implementation

Thanks,

Boris

Changes since v1:
- Everything :-)

[1]https://lists.freedesktop.org/archives/dri-devel/2017-November/157688.html
[2]https://www.spinics.net/lists/dri-devel/msg174808.html

Boris Brezillon (6):
  drm/tegra: Fix a device_node leak when the DRM panel is not found
  drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of
    NULL
  drm/panel: Let of_drm_find_panel() return -ENODEV when the panel is
    disabled
  drm/of: Make drm_of_find_panel_or_bridge() fail when the device is
    disabled
  drm/vc4: Support the case where the DSI device is disabled
  drm/panel: rpi-touchscreen: Set status to "fail" when ->probe() fails

 drivers/gpu/drm/bridge/cdns-dsi.c                  |  2 +-
 drivers/gpu/drm/bridge/lvds-encoder.c              |  4 +--
 drivers/gpu/drm/drm_of.c                           | 13 ++++++--
 drivers/gpu/drm/drm_panel.c                        | 11 +++++--
 drivers/gpu/drm/exynos/exynos_dp.c                 |  9 ++++--
 drivers/gpu/drm/exynos/exynos_drm_dpi.c            |  9 ++++--
 drivers/gpu/drm/exynos/exynos_drm_dsi.c            |  6 ++--
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c          |  8 +++--
 drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c  |  4 +--
 .../gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c    | 10 +++++--
 drivers/gpu/drm/msm/dsi/dsi_host.c                 |  2 +-
 .../gpu/drm/panel/panel-raspberrypi-touchscreen.c  | 35 ++++++++++++++++++++++
 drivers/gpu/drm/rcar-du/rcar_lvds.c                |  9 ++++--
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c             |  2 +-
 drivers/gpu/drm/sti/sti_dvo.c                      |  7 +++--
 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c             |  4 +--
 drivers/gpu/drm/tegra/dsi.c                        |  6 ++--
 drivers/gpu/drm/tegra/output.c                     | 17 ++++++-----
 drivers/gpu/drm/vc4/vc4_dsi.c                      | 15 ++++++++--
 include/drm/drm_panel.h                            |  2 +-
 20 files changed, 131 insertions(+), 44 deletions(-)

-- 
2.14.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2018-05-07 11:14 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 16:40 [PATCH v2 0/6] drm/panel: Handle the "panel is missing" case properly Boris Brezillon
2018-05-03 16:40 ` [PATCH v2 1/6] drm/tegra: Fix a device_node leak when the DRM panel is not found Boris Brezillon
2018-05-03 16:40   ` Boris Brezillon
2018-05-04  9:50   ` Thierry Reding
2018-05-04  9:53     ` Thierry Reding
2018-05-04  9:54     ` Boris Brezillon
2018-05-03 16:40 ` [PATCH v2 2/6] drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL Boris Brezillon
2018-05-04 10:18   ` Thierry Reding
2018-05-04 11:58     ` Boris Brezillon
2018-05-04 12:11       ` Thierry Reding
2018-05-03 16:40 ` [PATCH v2 3/6] drm/panel: Let of_drm_find_panel() return -ENODEV when the panel is disabled Boris Brezillon
2018-05-04 10:20   ` Thierry Reding
2018-05-03 16:40 ` [PATCH v2 4/6] drm/of: Make drm_of_find_panel_or_bridge() fail when the device " Boris Brezillon
2018-05-04 10:20   ` Thierry Reding
2018-05-03 16:40 ` [PATCH v2 5/6] drm/vc4: Support the case where the DSI " Boris Brezillon
2018-05-04 10:28   ` Thierry Reding
2018-05-04 12:05     ` Boris Brezillon
2018-05-04 13:29       ` Thierry Reding
2018-05-04 13:49         ` Boris Brezillon
2018-05-04 13:56           ` Thierry Reding
2018-05-04 10:30   ` Thierry Reding
2018-05-04 12:00     ` Boris Brezillon
2018-05-03 16:40 ` [PATCH v2 6/6] drm/panel: rpi-touchscreen: Set status to "fail" when ->probe() fails Boris Brezillon
2018-05-03 17:12   ` Rob Herring
2018-05-04  8:06     ` Boris Brezillon
2018-05-04  9:47       ` Thierry Reding
2018-05-04 12:17         ` Boris Brezillon
2018-05-04 14:20           ` Daniel Vetter
2018-05-04 14:24             ` Boris Brezillon
2018-05-04 15:01               ` Boris Brezillon
2018-05-04 19:29             ` Rob Herring
2018-05-07 11:14               ` Boris Brezillon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.