mbox series

[0/5] drm+clk+genpd: support for bootloader enabled display

Message ID 20190630150230.7878-1-robdclark@gmail.com (mailing list archive)
Headers show
Series drm+clk+genpd: support for bootloader enabled display | expand

Message

Rob Clark June 30, 2019, 3:01 p.m. UTC
From: Rob Clark <robdclark@chromium.org>

The aarch64 laptops which ship with windows, have the display by the
bootloader, and efifb (yah!).  But unlike x86 laptops, device power
management isn't handled via ACPI[1].  Currently the CCF and genpd
frameworks will turn off power domains and clocks that they think are
unused.  This is rather unfortunate, as it kills efifb scanout before
getting to userspace and getting to the point where we can try to
probe the real display driver.

Also it has a few side-effects in that we can't set rate on running
clocks (in many cases).

The first two patches let us flag clocks and power domains which
might have been enabled by the bootloader, so we know not to disable
them in late_initcall.

The next two update drm/msm to cleanly shut down clocks which might
already be running.  *Eventually* we'll want to detect that scanout
is already running, and readback the hw state, to avoid briefly
disabling the screen while the driver loads.  But that is a big pile
of (mostly) drm/msm work.  (Windows also seems to have this problem,
it appears to do a modeset during boot.. so I guess the first step
is to at least not suck more than windows ;-))

The last patch updates the bridge driver to handle the case where
display is already active.  (AFAICT it is the same bridge chip used
so far on all the aarch64 laptops.)  Because the bridge driver can
be probed before the drm driver, and in fact you might end up with
a bridge driver but no drm driver, care must be taken to not disable
the bridge until the drm driver is ready to go, so:

  * Request enable gpio ASIS to avoid pulling down the enable
    gpio

  * Defer enabling runpm in the case that the bridge is already
    running until bridge->attach().  This is a point where we
    know the drm driver is ready to do a modeset.

(There are a couple related cleanups in drm/msm to avoid touching
the hw until we are past the point where we might -EPROBE_DEFER[2]
which I sent seperately as they are probably interesting to fewer
people.)

This has been tested on a lenovo yoga c630.  I've a wip/c630 branch[3]
with this and various other work-in-progress stuff for this laptop.
Next step, figuring out how to pick the proper panel driver, from
the two or three possibilites that ship on this laptop ;-)

[1] On windows, they use a "Platform Extension Plugin" (PEP) driver
[2] https://patchwork.freedesktop.org/series/62999/
[3] https://github.com/freedreno/kernel-msm/commits/wip/c630

Rob Clark (5):
  clk: inherit clocks enabled by bootloader
  genpd/gdsc: inherit display powerdomain from bootloader
  drm/msm/dsi: split clk rate setting and enable
  drm/msm/dsi: get the clocks into OFF state at init
  drm/bridge: ti-sn65dsi86: support booloader enabled display

 drivers/base/power/domain.c                | 10 ++++
 drivers/clk/clk.c                          | 48 +++++++++++++++++++
 drivers/clk/qcom/common.c                  | 25 ++++++++++
 drivers/clk/qcom/dispcc-sdm845.c           | 24 +++++-----
 drivers/clk/qcom/gcc-sdm845.c              |  3 +-
 drivers/clk/qcom/gdsc.c                    |  5 ++
 drivers/clk/qcom/gdsc.h                    |  1 +
 drivers/gpu/drm/bridge/ti-sn65dsi86.c      | 12 ++++-
 drivers/gpu/drm/msm/dsi/dsi.h              |  2 +
 drivers/gpu/drm/msm/dsi/dsi_cfg.c          |  3 ++
 drivers/gpu/drm/msm/dsi/dsi_cfg.h          |  1 +
 drivers/gpu/drm/msm/dsi/dsi_host.c         | 56 +++++++++++++++++-----
 drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c |  1 +
 include/linux/clk-provider.h               | 10 ++++
 include/linux/pm_domain.h                  |  4 ++
 15 files changed, 178 insertions(+), 27 deletions(-)