mirror of https://gitee.com/openkylin/linux.git
3e46304e74
gmux has 3 switch registers: * GMUX_PORT_SWITCH_DISPLAY switches the panel * GMUX_PORT_SWITCH_DDC switches the panel's DDC lines (only on pre-retinas; on retinas this is a no-op) * GMUX_PORT_SWITCH_EXTERNAL switches the external DP port(s) (only on models without Thunderbolt, i.e. introduced before 2011; those with Thunderbolt switch only HPD/AUX, not the main link) Currently we switch all 3 registers in unison. gmux does not preserve the switch state during suspend, so we currently read GMUX_PORT_SWITCH_DISPLAY before suspend and restore all 3 registers to this value on resume. With the upcoming ->switch_ddc callback, GMUX_PORT_SWITCH_DDC may temporarily contain a different value than the other 2 registers. If we happen to suspend at this moment, we'll write an incorrect value to GMUX_PORT_SWITCH_DDC on resume. Also, on models with Thunderbolt the integrated GPU is unable to drive the external DP port(s), so we want to keep GMUX_PORT_SWITCH_EXTERNAL permanently switched to the discrete GPU on those machines. Consequently we can no longer assume that GMUX_PORT_SWITCH_DISPLAY represents the correct value for all 3 registers on suspend. Track the state of all 3 registers: Add gmux_read_switch_state() and gmux_write_switch_state(). Instead of reading the switch state on every suspend, read it once on driver initialization so that we know the current switch state all the time. (This allows us to use some optimizations and shortcuts, e.g. we can skip switching DDC if we know that it's already switched to the requested GPU.) Change the ->switchto callback to use gmux_write_switch_state(). Tested-by: Lukas Wunner <lukas@wunner.de> [MBP 9,1 2012 intel IVB + nvidia GK107 pre-retina 15"] Signed-off-by: Lukas Wunner <lukas@wunner.de> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/5679f414cb0ddf1654dcc359571f3764b275edf0.1452525860.git.lukas@wunner.de |
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
acer-wmi.c | ||
acerhdf.c | ||
alienware-wmi.c | ||
amilo-rfkill.c | ||
apple-gmux.c | ||
asus-laptop.c | ||
asus-nb-wmi.c | ||
asus-wireless.c | ||
asus-wmi.c | ||
asus-wmi.h | ||
classmate-laptop.c | ||
compal-laptop.c | ||
dell-laptop.c | ||
dell-rbtn.c | ||
dell-rbtn.h | ||
dell-smo8800.c | ||
dell-wmi-aio.c | ||
dell-wmi.c | ||
eeepc-laptop.c | ||
eeepc-wmi.c | ||
fujitsu-laptop.c | ||
fujitsu-tablet.c | ||
hdaps.c | ||
hp-wireless.c | ||
hp-wmi.c | ||
hp_accel.c | ||
ibm_rtl.c | ||
ideapad-laptop.c | ||
intel-hid.c | ||
intel-rst.c | ||
intel-smartconnect.c | ||
intel_ips.c | ||
intel_ips.h | ||
intel_menlow.c | ||
intel_mid_powerbtn.c | ||
intel_mid_thermal.c | ||
intel_oaktrail.c | ||
intel_pmc_ipc.c | ||
intel_pmic_gpio.c | ||
intel_punit_ipc.c | ||
intel_scu_ipc.c | ||
intel_scu_ipcutil.c | ||
intel_telemetry_core.c | ||
intel_telemetry_debugfs.c | ||
intel_telemetry_pltdrv.c | ||
msi-laptop.c | ||
msi-wmi.c | ||
mxm-wmi.c | ||
panasonic-laptop.c | ||
pvpanic.c | ||
samsung-laptop.c | ||
samsung-q10.c | ||
sony-laptop.c | ||
surfacepro3_button.c | ||
tc1100-wmi.c | ||
thinkpad_acpi.c | ||
topstar-laptop.c | ||
toshiba-wmi.c | ||
toshiba_acpi.c | ||
toshiba_bluetooth.c | ||
toshiba_haps.c | ||
wmi.c | ||
xo1-rfkill.c | ||
xo15-ebook.c |