android_kernel_motorola_sm6225/drivers/gpu
Lukas Wunner e02328f47b vga_switcheroo: Drop client power state VGA_SWITCHEROO_INIT
hda_intel.c:azx_probe() defers initialization of an audio controller
on the discrete GPU if the GPU is powered off. The power state of the
GPU is determined by calling vga_switcheroo_get_client_state().

vga_switcheroo_get_client_state() returns VGA_SWITCHEROO_INIT if
vga_switcheroo is not enabled, i.e. if no second GPU or no handler
has registered.

This can go wrong in the following scenario:
- Driver for the integrated GPU is not loaded.
- Driver for the discrete GPU registers with vga_switcheroo, uses driver
  power control to power down the GPU, handler cuts power to the GPU.
- Driver for the audio controller gets loaded after the GPU was powered
  down, calls vga_switcheroo_get_client_state() which returns
  VGA_SWITCHEROO_INIT instead of VGA_SWITCHEROO_OFF.
- Consequence: azx_probe() tries to initialize the audio controller even
  though the GPU is powered down.

The power state VGA_SWITCHEROO_INIT was introduced by c8e9cf7bb2
("vga_switcheroo: Add a helper function to get the client state").
It is not apparent what its benefit might be. The idea seems to
be to initialize the audio controller even if the power state is
VGA_SWITCHEROO_OFF (were vga_switcheroo enabled), but as shown
above this can fail.

Drop VGA_SWITCHEROO_INIT to solve this.

Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-11-05 11:07:36 +10:00
..
drm drm/panel: Changes for v4.4-rc1 2015-11-05 11:07:13 +10:00
host1x gpu: host1x: Fix MLOCK's debug info 2015-10-02 14:40:12 +02:00
ipu-v3 imx-drm fixes and color format updates 2015-11-05 11:06:56 +10:00
vga vga_switcheroo: Drop client power state VGA_SWITCHEROO_INIT 2015-11-05 11:07:36 +10:00
Makefile gpu: host1x: Provide a proper struct bus_type 2015-01-27 10:09:14 +01:00