diff options
author | Dave Airlie <airlied@redhat.com> | 2010-05-31 03:10:52 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-31 20:24:30 -0400 |
commit | fc5ea29d72bde1bec230538becf396caad8621b8 (patch) | |
tree | 99c144d3351622904bc4f76b5cd9091001c6eafc /drivers/gpu/drm/nouveau | |
parent | afeb3e11147adb357603b071d6d7d1f30ea7f19d (diff) |
drm/nouveau: fixup confusion over which handle the DSM is hanging off.
This fixes the DSM setup correctly since vga switcheroo.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_acpi.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c index b3f146a811ca..d4bcca8a5133 100644 --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c | |||
@@ -34,7 +34,6 @@ | |||
34 | static struct nouveau_dsm_priv { | 34 | static struct nouveau_dsm_priv { |
35 | bool dsm_detected; | 35 | bool dsm_detected; |
36 | acpi_handle dhandle; | 36 | acpi_handle dhandle; |
37 | acpi_handle dsm_handle; | ||
38 | acpi_handle rom_handle; | 37 | acpi_handle rom_handle; |
39 | } nouveau_dsm_priv; | 38 | } nouveau_dsm_priv; |
40 | 39 | ||
@@ -108,9 +107,9 @@ static int nouveau_dsm_set_discrete_state(acpi_handle handle, enum vga_switchero | |||
108 | static int nouveau_dsm_switchto(enum vga_switcheroo_client_id id) | 107 | static int nouveau_dsm_switchto(enum vga_switcheroo_client_id id) |
109 | { | 108 | { |
110 | if (id == VGA_SWITCHEROO_IGD) | 109 | if (id == VGA_SWITCHEROO_IGD) |
111 | return nouveau_dsm_switch_mux(nouveau_dsm_priv.dsm_handle, NOUVEAU_DSM_LED_STAMINA); | 110 | return nouveau_dsm_switch_mux(nouveau_dsm_priv.dhandle, NOUVEAU_DSM_LED_STAMINA); |
112 | else | 111 | else |
113 | return nouveau_dsm_switch_mux(nouveau_dsm_priv.dsm_handle, NOUVEAU_DSM_LED_SPEED); | 112 | return nouveau_dsm_switch_mux(nouveau_dsm_priv.dhandle, NOUVEAU_DSM_LED_SPEED); |
114 | } | 113 | } |
115 | 114 | ||
116 | static int nouveau_dsm_power_state(enum vga_switcheroo_client_id id, | 115 | static int nouveau_dsm_power_state(enum vga_switcheroo_client_id id, |
@@ -119,7 +118,7 @@ static int nouveau_dsm_power_state(enum vga_switcheroo_client_id id, | |||
119 | if (id == VGA_SWITCHEROO_IGD) | 118 | if (id == VGA_SWITCHEROO_IGD) |
120 | return 0; | 119 | return 0; |
121 | 120 | ||
122 | return nouveau_dsm_set_discrete_state(nouveau_dsm_priv.dsm_handle, state); | 121 | return nouveau_dsm_set_discrete_state(nouveau_dsm_priv.dhandle, state); |
123 | } | 122 | } |
124 | 123 | ||
125 | static int nouveau_dsm_init(void) | 124 | static int nouveau_dsm_init(void) |
@@ -158,13 +157,12 @@ static bool nouveau_dsm_pci_probe(struct pci_dev *pdev) | |||
158 | return false; | 157 | return false; |
159 | } | 158 | } |
160 | 159 | ||
161 | ret = nouveau_dsm(nvidia_handle, NOUVEAU_DSM_SUPPORTED, | 160 | ret = nouveau_dsm(dhandle, NOUVEAU_DSM_SUPPORTED, |
162 | NOUVEAU_DSM_SUPPORTED_FUNCTIONS, &result); | 161 | NOUVEAU_DSM_SUPPORTED_FUNCTIONS, &result); |
163 | if (ret < 0) | 162 | if (ret < 0) |
164 | return false; | 163 | return false; |
165 | 164 | ||
166 | nouveau_dsm_priv.dhandle = dhandle; | 165 | nouveau_dsm_priv.dhandle = dhandle; |
167 | nouveau_dsm_priv.dsm_handle = nvidia_handle; | ||
168 | return true; | 166 | return true; |
169 | } | 167 | } |
170 | 168 | ||
@@ -183,7 +181,7 @@ static bool nouveau_dsm_detect(void) | |||
183 | } | 181 | } |
184 | 182 | ||
185 | if (vga_count == 2 && has_dsm) { | 183 | if (vga_count == 2 && has_dsm) { |
186 | acpi_get_name(nouveau_dsm_priv.dsm_handle, ACPI_FULL_PATHNAME, &buffer); | 184 | acpi_get_name(nouveau_dsm_priv.dhandle, ACPI_FULL_PATHNAME, &buffer); |
187 | printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n", | 185 | printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n", |
188 | acpi_method_name); | 186 | acpi_method_name); |
189 | nouveau_dsm_priv.dsm_detected = true; | 187 | nouveau_dsm_priv.dsm_detected = true; |