All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] drm/probe-helpers: Work around multi-outputs-per-CRTC problem
@ 2024-07-15  9:38 Thomas Zimmermann
  2024-07-15  9:38 ` [PATCH 1/7] drm/probe-helper: Call connector detect functions in single helper Thomas Zimmermann
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2024-07-15  9:38 UTC (permalink / raw)
  To: jfalempe, airlied, daniel, airlied, mripard, maarten.lankhorst
  Cc: dri-devel, Thomas Zimmermann

Old or simple hardware only supports a single CRTC with multiple
conenctoed outputs. This breaks most userspace compositors, which
only support a single output per CRTC. This currently happens with
ast and mgag200 drivers. The drivers contain a work around that
dynamically disables all but one connected output.

Patches 1 and 2 push the workaround into probe helpers and make it
configurable in the kernel config. For each connector, the driver
needs to specify a bitmask of connectors with higher priority. If
one of them is connected, the connector at hand is always reported
as disconnected. Connectors without priority bitmask as not affected.

Patches 3 to 5 update and simplify the ast drivers. The new workaround
now allows to have multiple physical conenctors in ast. So patch 5
finally allows VGA and DisplayPort on the same device.

Patches 6 and 7 update mgag200.

Any future driver that exposes the same problem as ast and mgag200
can simply hook into the workaround. Hopefully userspace can be fixed
at some point.

Thomas Zimmermann (7):
  drm/probe-helper: Call connector detect functions in single helper
  drm/probe-helper: Optionally report single connected output per CRTC
  drm/ast: Set connector priorities
  drm/ast: Remove struct ast_bmc_connector
  drm/ast: Support ASTDP and VGA at the same time
  drm/mgag200: Set connector priorities
  drm/mgag200: Remove struct mgag200_bmc_connector

 drivers/gpu/drm/Kconfig                   |  15 +++
 drivers/gpu/drm/ast/ast_drv.h             |  17 +--
 drivers/gpu/drm/ast/ast_main.c            |   2 +-
 drivers/gpu/drm/ast/ast_mode.c            |  49 ++------
 drivers/gpu/drm/drm_probe_helper.c        | 137 +++++++++++++++++++---
 drivers/gpu/drm/mgag200/mgag200_bmc.c     |  44 +------
 drivers/gpu/drm/mgag200/mgag200_drv.h     |   9 +-
 drivers/gpu/drm/mgag200/mgag200_g200eh.c  |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200eh3.c |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200er.c  |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200ev.c  |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200ew3.c |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200se.c  |   4 +-
 drivers/gpu/drm/mgag200/mgag200_g200wb.c  |   4 +-
 include/drm/drm_connector.h               |   2 +
 include/drm/drm_probe_helper.h            |   2 +
 16 files changed, 177 insertions(+), 128 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH 0/7] drm: Add physical status and BMC support to conenctor
@ 2024-10-11  6:43 Thomas Zimmermann
  2024-10-11  6:43 ` [PATCH 1/7] drm/probe-helper: Call connector detect functions in single helper Thomas Zimmermann
  0 siblings, 1 reply; 16+ messages in thread
From: Thomas Zimmermann @ 2024-10-11  6:43 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, airlied, simona, jani.nikula, airlied,
	jfalempe
  Cc: dri-devel, Thomas Zimmermann

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(-)

-- 
2.46.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-10-11  6:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-15  9:38 [PATCH 0/7] drm/probe-helpers: Work around multi-outputs-per-CRTC problem Thomas Zimmermann
2024-07-15  9:38 ` [PATCH 1/7] drm/probe-helper: Call connector detect functions in single helper Thomas Zimmermann
2024-07-16  8:21   ` Maxime Ripard
2024-07-15  9:38 ` [PATCH 2/7] drm/probe-helper: Optionally report single connected output per CRTC Thomas Zimmermann
2024-07-16  9:01   ` Maxime Ripard
2024-07-16 10:47     ` Thomas Zimmermann
2024-07-16  9:46   ` Daniel Vetter
2024-07-16 10:37     ` Thomas Zimmermann
2024-07-15  9:38 ` [PATCH 3/7] drm/ast: Set connector priorities Thomas Zimmermann
2024-07-15  9:39 ` [PATCH 4/7] drm/ast: Remove struct ast_bmc_connector Thomas Zimmermann
2024-07-15  9:39 ` [PATCH 5/7] drm/ast: Support ASTDP and VGA at the same time Thomas Zimmermann
2024-07-16  8:42   ` oushixiong
2024-07-15  9:39 ` [PATCH 6/7] drm/mgag200: Set connector priorities Thomas Zimmermann
2024-07-15  9:39 ` [PATCH 7/7] drm/mgag200: Remove struct mgag200_bmc_connector Thomas Zimmermann
2024-07-17 12:54 ` [PATCH 0/7] drm/probe-helpers: Work around multi-outputs-per-CRTC problem Thomas Zimmermann
  -- strict thread matches above, loose matches on Subject: below --
2024-10-11  6:43 [PATCH 0/7] drm: Add physical status and BMC support to conenctor Thomas Zimmermann
2024-10-11  6:43 ` [PATCH 1/7] drm/probe-helper: Call connector detect functions in single helper Thomas Zimmermann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.