mbox series

[0/3] drm/loongson: Introduce component framework support

Message ID 20240513001243.1739336-1-sui.jingfeng@linux.dev (mailing list archive)
Headers show
Series drm/loongson: Introduce component framework support | expand

Message

Sui Jingfeng May 13, 2024, 12:12 a.m. UTC
Introduce the component framework to bind childs and siblings, for better
modularity and paper over the deferral probe problems if it need to attach
exterinal module someday. Hardware units come with PCI(e) are actually all
ready to drive, but there has some board specific modules will return
-EPROBE_DEFER. We need all other submodules ready to attach before we can
register the drm device to userspace.

The idea is to devide the exterinal module dependent part and exterinal
module independent part clearly, for example, the display controller and
the builtin GPIO-I2C just belong to exterinal module independent part.
While the output is belong to exterinal module dependent part.

Also for better reflecting the hardware, we intend to abstract the output
ports as child devices. The output ports may consists of encoder phy and
level shift, while the GPU and VPU are standalone siblings. As those units
are relative separate hardware units from display controller itself.

By design, the display controller PCI(e) is selected as the component
master, gpio-i2c go with master. The manually created virtual child device
are functional as agents for the master, it could return the -EPROBE_DEFER
back to the component core. This allows the master don't have to tear down
everything, the majority setups work can be preserved. The potential cyclic
dependency problem can be solved with such framework.
Sui Jingfeng (3):
  drm/loongson: Add helpers for creating subdevice
  drm/loongson: Introduce component framework support
  drm/loongson: Refactor lsdc device initialize and the output port

 drivers/gpu/drm/loongson/Makefile             |   1 +
 drivers/gpu/drm/loongson/loongson_device.c    |  42 ++++
 drivers/gpu/drm/loongson/loongson_module.c    |  17 +-
 drivers/gpu/drm/loongson/loongson_module.h    |   1 +
 drivers/gpu/drm/loongson/lsdc_drv.c           | 208 +++++++++++-------
 drivers/gpu/drm/loongson/lsdc_drv.h           |  34 +--
 drivers/gpu/drm/loongson/lsdc_output.c        | 183 +++++++++++++++
 drivers/gpu/drm/loongson/lsdc_output.h        |  38 +++-
 drivers/gpu/drm/loongson/lsdc_output_7a1000.c |   3 +-
 drivers/gpu/drm/loongson/lsdc_output_7a2000.c |  15 +-
 10 files changed, 422 insertions(+), 120 deletions(-)
 create mode 100644 drivers/gpu/drm/loongson/lsdc_output.c