[PATCH v2 0/6] drm/panel: Handle the "panel is missing" case properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux