Skip to content

vga_switcheroo, drm: Push fbcon handling into DRM clients

Thomas Zimmermann amd-gfx dri-devel intel-gfx linux-fbdev nouveau sashiko-reviews 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 11 repliesIn review
  2. v110 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- implement all of pre_switch in a single commit to avoid possible deadlock in intermediate state (Sashiko)
- fix erroneous docs (Sashiko)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7drm/edid: Include <linux/fb.h>drivers/gpu/drm/drm_edid.c+1 -01 reply
2/7drm/client: Add acquire_outputs callback; implement for fbdev emulationdrivers/gpu/drm/clients/drm_fbdev_client.c drivers/gpu/drm/drm_client_event.c include/drm/drm_client.h +1 more+51 -71 reply
3/7vga_switcheroo: Add pre_switch callback to client opsdrivers/gpu/vga/vga_switcheroo.c include/linux/vga_switcheroo.h+11 -41 reply
4/7vga_switcheroo: Add post_switch callback to client opsdrivers/gpu/vga/vga_switcheroo.c include/linux/vga_switcheroo.h+10 -61 reply
5/7drm: Implement struct vga_switcheroo_client_ops.pre_switchdrivers/gpu/drm/amd/amdgpu/amdgpu_device.c drivers/gpu/drm/i915/i915_switcheroo.c drivers/gpu/drm/nouveau/nouveau_vga.c +2 more+35 -82 replies
6/7drm: Implement vga_switcheroo_client_ops.post_switchdrivers/gpu/drm/amd/amdgpu/amdgpu_device.c drivers/gpu/drm/i915/i915_switcheroo.c drivers/gpu/drm/nouveau/nouveau_vga.c +1 more+9 -131 reply
7/7vga-switcheroo: Remove unused interfacesdrivers/gpu/vga/vga_switcheroo.c include/linux/vga_switcheroo.h+9 -401 reply

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLyude PaulHelge DellerMaxime Ripard
SeriesA-b
1/7A-b
2/7A-b
3/7A-b
4/7A-b
5/7R-b A-b
6/7R-b A-b
7/7A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/7] vga_switcheroo, drm: Push fbcon handling into DRM clients

Vga_switcheroo currently invokes fb_switch_outputs() to inform fbcon about switching of the physical outputs among framebuffer devices. But new DRM clients to not use fbdev/fbcon and might require their own vga_switcheroo support. Let's strictly separate them from each other.

Remove fbdev/fbcon from vga_switcheroo. Introduce a pre_switch callback for vga_switcheroo clients to do the fbcon update. Allows for removing all direct interactions between vga_switcheroo and fbdev/fbcon.

There are only four drivers that support vga_switcheroo: amdgpu, radeon, i915 and nouveau. Update each of them with the new callback. When vga_switcheroo now invokes pre_switch, each DRM driver forwards to aquire_outputs and lets the DRM clients handle the new outputs.

At the same time, push the fbcon update into DRM's client for fbdev emulation. Do this with the new DRM client callback acquire_outputs, so that other clients can have their own handling of vga_switcheroo.

Also replace the existing reprobe hook with post_switch for symetry. For nouveau, this is merely a rename of the helper function. The other drivers dor not implement reprobe.

Tested with radeon on a notebook with Radeon HD 4225 and HD 5430.

v2:
- implement all of pre_switch in a single commit to avoid possible deadlock in intermediate state (Sashiko)
- fix erroneous docs (Sashiko)

Thomas Zimmermann (7):
drm/edid: Include <linux/fb.h>
drm/client: Add acquire_outputs callback; implement for fbdev
emulation
vga_switcheroo: Add pre_switch callback to client ops
vga_switcheroo: Add post_switch callback to client ops
drm: Implement struct vga_switcheroo_client_ops.pre_switch
drm: Implement vga_switcheroo_client_ops.post_switch
vga-switcheroo: Remove unused interfaces

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  9 ++++-
 drivers/gpu/drm/clients/drm_fbdev_client.c | 23 ++++++++----
 drivers/gpu/drm/drm_client_event.c         | 18 ++++++++++
 drivers/gpu/drm/drm_edid.c                 |  1 +
 drivers/gpu/drm/i915/i915_switcheroo.c     | 11 +++++-
 drivers/gpu/drm/nouveau/nouveau_vga.c      | 28 +++++++++------
 drivers/gpu/drm/radeon/radeon_device.c     |  9 ++++-
 drivers/gpu/vga/vga_switcheroo.c           | 41 +++++-----------------
 drivers/video/fbdev/core/fbcon.c           |  8 -----
 include/drm/drm_client.h                   | 14 ++++++++
 include/drm/drm_client_event.h             |  3 ++
 include/linux/vga_switcheroo.h             | 29 ++++++++-------
 12 files changed, 121 insertions(+), 73 deletions(-)

base-commit: 88c6be63ac7e9238c7791977d3f496ce6623afe4

Signature · 1 line
2.54.0