mbox series

[0/7] drm: Add physical status and BMC support to conenctor

Message ID 20241011065705.6728-1-tzimmermann@suse.de (mailing list archive)
Headers show
Series drm: Add physical status and BMC support to conenctor | expand

Message

Thomas Zimmermann Oct. 11, 2024, 6:43 a.m. UTC
Track a connector's physical status separately from the logical status
and implement BMC support for DRM drivers. Connectors with virtual BMC
stay connected even if no display is physically connected. DRM clients
then continue displaying output to the BMC.

Ast and mgag200 have been doing this for a while. Moving this into
struct drm_connector and probe helpers simplifies htese divers and
makes the functionality available to others. Hibmc is a candidate here.

Patch just simplifies code in probe helpers and has been acked as part
of the series at [1].

Pathces 2 and 3 add the physical status and a BMC flag to struct
drm_connector. Usually physical connector status and regular, logical
status are in sync, so nothing changes for most drivers. If the the
BMC flag has been set, the logical status is always connected. The
probe helpers also take care of sending hotplug events if the physical
status changes.

Patches 4 to 7 update ast and mgag200. Both drivers already implement
their own tracking of physical status, which is now handled by DRM
helpers. Ast also receives two simple bug fixes for cleaning up EDID
properties in the BMC case.

Tested on ast and mgag200 hardware. Another driver that could make use
of this functionality is hibmc.

[1] https://patchwork.freedesktop.org/series/136084/

Thomas Zimmermann (7):
  drm/probe-helper: Call connector detect functions in single helper
  drm: Add physical status to connector
  drm: Add bmc_attached flag to connector
  drm/ast: sil164: Clear EDID if no display is connected
  drm/ast: vga: Clear EDID if no display is connected
  drm/ast: Track physical connector status in struct drm_connector
  drm/mgag200: Track physical connector status in struct drm_connector

 drivers/gpu/drm/ast/ast_dp.c              | 21 +++-------
 drivers/gpu/drm/ast/ast_dp501.c           | 17 ++------
 drivers/gpu/drm/ast/ast_drv.h             | 24 ++---------
 drivers/gpu/drm/ast/ast_sil164.c          | 19 +++------
 drivers/gpu/drm/ast/ast_vga.c             | 30 +++-----------
 drivers/gpu/drm/drm_connector.c           |  1 +
 drivers/gpu/drm/drm_probe_helper.c        | 50 +++++++++++++----------
 drivers/gpu/drm/mgag200/mgag200_vga_bmc.c | 32 +++------------
 include/drm/drm_connector.h               | 15 +++++++
 9 files changed, 77 insertions(+), 132 deletions(-)

Comments

Jani Nikula Oct. 11, 2024, 9:08 a.m. UTC | #1
On Fri, 11 Oct 2024, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Track a connector's physical status separately from the logical status
> and implement BMC support for DRM drivers. Connectors with virtual BMC
> stay connected even if no display is physically connected. DRM clients
> then continue displaying output to the BMC.
>
> Ast and mgag200 have been doing this for a while. Moving this into
> struct drm_connector and probe helpers simplifies htese divers and
> makes the functionality available to others. Hibmc is a candidate here.
>
> Patch just simplifies code in probe helpers and has been acked as part
> of the series at [1].
>
> Pathces 2 and 3 add the physical status and a BMC flag to struct
> drm_connector. Usually physical connector status and regular, logical
> status are in sync, so nothing changes for most drivers. If the the
> BMC flag has been set, the logical status is always connected. The
> probe helpers also take care of sending hotplug events if the physical
> status changes.
>
> Patches 4 to 7 update ast and mgag200. Both drivers already implement
> their own tracking of physical status, which is now handled by DRM
> helpers. Ast also receives two simple bug fixes for cleaning up EDID
> properties in the BMC case.
>
> Tested on ast and mgag200 hardware. Another driver that could make use
> of this functionality is hibmc.

Overall,

Acked-by: Jani Nikula <jani.nikula@intel.com>

but please do improve the documentation, and consider alternatives to
the bmc_attached naming.

>
> [1] https://patchwork.freedesktop.org/series/136084/
>
> Thomas Zimmermann (7):
>   drm/probe-helper: Call connector detect functions in single helper
>   drm: Add physical status to connector
>   drm: Add bmc_attached flag to connector
>   drm/ast: sil164: Clear EDID if no display is connected
>   drm/ast: vga: Clear EDID if no display is connected
>   drm/ast: Track physical connector status in struct drm_connector
>   drm/mgag200: Track physical connector status in struct drm_connector
>
>  drivers/gpu/drm/ast/ast_dp.c              | 21 +++-------
>  drivers/gpu/drm/ast/ast_dp501.c           | 17 ++------
>  drivers/gpu/drm/ast/ast_drv.h             | 24 ++---------
>  drivers/gpu/drm/ast/ast_sil164.c          | 19 +++------
>  drivers/gpu/drm/ast/ast_vga.c             | 30 +++-----------
>  drivers/gpu/drm/drm_connector.c           |  1 +
>  drivers/gpu/drm/drm_probe_helper.c        | 50 +++++++++++++----------
>  drivers/gpu/drm/mgag200/mgag200_vga_bmc.c | 32 +++------------
>  include/drm/drm_connector.h               | 15 +++++++
>  9 files changed, 77 insertions(+), 132 deletions(-)
Maxime Ripard Oct. 11, 2024, 10:52 a.m. UTC | #2
Hi,

On Fri, Oct 11, 2024 at 08:43:05AM GMT, Thomas Zimmermann wrote:
> Track a connector's physical status separately from the logical status
> and implement BMC support for DRM drivers. Connectors with virtual BMC
> stay connected even if no display is physically connected. DRM clients
> then continue displaying output to the BMC.
> 
> Ast and mgag200 have been doing this for a while. Moving this into
> struct drm_connector and probe helpers simplifies htese divers and
> makes the functionality available to others. Hibmc is a candidate here.
> 
> Patch just simplifies code in probe helpers and has been acked as part
> of the series at [1].
> 
> Pathces 2 and 3 add the physical status and a BMC flag to struct
> drm_connector. Usually physical connector status and regular, logical
> status are in sync, so nothing changes for most drivers. If the the
> BMC flag has been set, the logical status is always connected. The
> probe helpers also take care of sending hotplug events if the physical
> status changes.
> 
> Patches 4 to 7 update ast and mgag200. Both drivers already implement
> their own tracking of physical status, which is now handled by DRM
> helpers. Ast also receives two simple bug fixes for cleaning up EDID
> properties in the BMC case.
> 
> Tested on ast and mgag200 hardware. Another driver that could make use
> of this functionality is hibmc.

Generally speaking, it looks ok, but given how much of a corner case it
is, we should have kunit tests to cover the whole thing.

Maxime