[0/4] drm+dt: multi panel selection and yoga c630 display
mbox series

Message ID 20191207203553.286017-1-robdclark@gmail.com
Headers show
Series
  • drm+dt: multi panel selection and yoga c630 display
Related show

Message

Rob Clark Dec. 7, 2019, 8:35 p.m. UTC
From: Rob Clark <robdclark@chromium.org>

It is not uncommon for devices to use one of several possible panels.
The Lenovo Yoga C630 laptop is one such device.  This patchset
introduces an optional "panel-id" property which can be used by the
firmware to find the correct panel node to enable.  The second patch
adds support in drm/of to automatically pick the enabled endpoint, to
avoid adding the same logic in multiple bridges/drivers.  The last
patch uses this mechanism to enable display support for the Yoga C630.

An example usage:

  boe_panel {
      compatible = "boe,nv133fhm-n61";
      panel-id = <0xc4>;
      /* fw will change status to "Ok" if this panel is installed */
      status = "disabled";

      ports {
          port {
              boe_panel_in_edp: endpoint {
                  remote-endpoint = <&sn65dsi86_out_boe>;
              };
          };
      };
  };

  ivo_panel {
      compatible = "ivo,m133nwf4-r0";
      panel-id = <0xc5>;
      /* fw will change status to "Ok" if this panel is installed */
      status = "disabled";

      ports {
          port {
              ivo_panel_in_edp: endpoint {
                  remote-endpoint = <&sn65dsi86_out_ivo>;
              };
          };
      };
  };

  sn65dsi86: bridge@2c {
      compatible = "ti,sn65dsi86";

      ports {
          #address-cells = <1>;
          #size-cells = <0>;

          port@0 {
              reg = <0>;
              sn65dsi86_in_a: endpoint {
                  remote-endpoint = <&dsi0_out>;
              };
          };

          port@1 {
              reg = <1>;

              sn65dsi86_out_boe: endpoint@c4 {
                  remote-endpoint = <&boe_panel_in_edp>;
              };

              sn65dsi86_out_ivo: endpoint@c5 {
                  remote-endpoint = <&ivo_panel_in_edp>;
              };
          };
      };
  };

This replaces an earlier proposal[1] to use chosen/panel-id to select the
installed panel, in favor of adding support[2] to an EFI driver module
(DtbLoader.efi) to find the installed panel, locate it in dtb via the
'panel-id' property, and update it's status to "Ok".

[1] https://patchwork.kernel.org/cover/11024613/
[2] https://github.com/robclark/edk2/commits/dtbloader

In this case, DtbLoader, which is somewhat generic (ie. this mechanism
applies to all snapdragon based devices which orignally ship with
windows), determines the panel-id of the installed panel from the
UEFIDisplayInfo variable.

As I understand, a similar situation exists with the pine64 laptops.  A
similar scheme could be used to support this, by loading the panel-id
from a u-boot variable.

In other cases (phones), a more device specific shim would be needed to
determine the panel-id by reading some GPIOs, or some other more device-
specific mechanism.

Bjorn Andersson (1):
  arm64: dts: qcom: c630: Enable display

Rob Clark (3):
  dt-bindings: display: panel: document panel-id
  drm/of: add support to find any enabled endpoint
  drm/bridge: ti-sn65dsi86: find any enabled endpoint

 .../bindings/display/panel/panel-common.yaml  |  26 +++
 .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 165 ++++++++++++++++++
 drivers/gpu/drm/bridge/ti-sn65dsi86.c         |   2 +-
 drivers/gpu/drm/drm_of.c                      |  41 ++++-
 4 files changed, 232 insertions(+), 2 deletions(-)