Enable gpu switching on the MacBook Pro
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest1 of 6 patches 0 repliesNew
- v21 of 22 patches 11 repliesSuperseded
Changes in v4 from the cover letter
* Previously when switching the display, the DDC lines were switched as well. But actually this is not necessary: If a GPU probes EDID, DDC must be switched and locked to the GPU anyway, so why switch DDC preemptively? Also, previously the DDC lines were switched back to the previous owner on unlock. This is unnecessary for the same reason. So I did away with all that and it simplifies the code considerably. This works fine as long as anything accessing DDC calls vga_switcheroo_lock_ddc() first. If something in the kernel or a VM or in user space accesses DDC and omits locking it first, things may go awry. (However, if locking is omitted, things could go awry with the previous behaviour as well.) I'm curious if this new behaviour provokes objections.
* I now have conclusive evidence that only the pre-retina MacBook Pro can switch DDC. The mux in the retina is incapable of that. So the ->switch_ddc callback is no longer advertised to vga_switcheroo on retinas.
1 of 6 patches is in this archive. The cover letter announces 6.
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 5/6 | drm/nouveau: Switch DDC when reading the EDIDdrivers/ | +11 | 0 replies |
Reviews trailers per patch
The patch has no Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Lukas Wunner | William Brown | Darren Hart |
|---|---|---|---|
| Series | T-b T-b T-b T-b | T-b T-b | A-b |
| 5/6 | T-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.
Cover letter [PATCH v4 0/6] Enable gpu switching on the MacBook Pro
Changes since v3:
* Previously when switching the display, the DDC lines were switched as well. But actually this is not necessary: If a GPU probes EDID, DDC must be switched and locked to the GPU anyway, so why switch DDC preemptively? Also, previously the DDC lines were switched back to the previous owner on unlock. This is unnecessary for the same reason. So I did away with all that and it simplifies the code considerably. This works fine as long as anything accessing DDC calls vga_switcheroo_lock_ddc() first. If something in the kernel or a VM or in user space accesses DDC and omits locking it first, things may go awry. (However, if locking is omitted, things could go awry with the previous behaviour as well.) I'm curious if this new behaviour provokes objections.
* I now have conclusive evidence that only the pre-retina MacBook Pro can switch DDC. The mux in the retina is incapable of that. So the ->switch_ddc callback is no longer advertised to vga_switcheroo on retinas.
Also available on GitHub for easier reviewing:
https://github.com/l1k/linux/commits/mbp_switcheroo_v4
For those who haven't been following this series so far:
The pre-retina MacBook Pro uses an LVDS panel and a gmux controller to switch the panel between its two GPUs. The panel mode in VBIOS is notoriously bogus on these machines and some models have no VBIOS at all, so the inactive GPU cannot set up its LVDS output.
Extend vga_switcheroo to support switching only the DDC lines. Introduce a drm_get_edid_switcheroo() helper which uses this feature. Amend i915, nouveau and radeon to call it for LVDS connectors.
This only enables EDID probing on the pre-retina MBP (2008 - 2013), and only under the condition that apple-gmux loads before the DRM drivers. Later patches will address reprobing of the DRM drivers if apple-gmux loads late.
The retina MBP (2012 - present) uses eDP and is apparently not capable of switching AUX separately from the main link. This will also be addressed in later patches.
Previous installments:
v1: http://lists.freedesktop.org/archives/dri-devel/2015-April/081515.html
v2: http://lists.freedesktop.org/archives/dri-devel/2015-August/088156.html
v3: http://lists.freedesktop.org/archives/dri-devel/2015-October/091741.html
Lukas Wunner (6):
vga_switcheroo: Add support for switching only the DDC
apple-gmux: Add switch_ddc support
drm/edid: Switch DDC when reading the EDID drm/i915: Switch DDC when reading the EDID drm/nouveau: Switch DDC when reading the EDID drm/radeon: Switch DDC when reading the EDID
drivers/gpu/drm/drm_edid.c | 26 ++++++++++++ drivers/gpu/drm/i915/intel_lvds.c | 3 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 13 +++++- drivers/gpu/drm/radeon/radeon_connectors.c | 4 ++ drivers/gpu/vga/vga_switcheroo.c | 66 ++++++++++++++++++++++++++++- drivers/platform/x86/apple-gmux.c | 21 ++++++++- include/drm/drm_crtc.h | 2 + include/linux/vga_switcheroo.h | 15 +++++-- 8 files changed, 141 insertions(+), 9 deletions(-)
Signature · 6 lines
1.8.5.2 (Apple Git-48) _______________________________________________ Nouveau mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/nouveau