Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293757
b: refs/heads/master
c: 84ddfda
h: refs/heads/master
i:
  293755: dfbe659
v: v3
  • Loading branch information
Ben Skeggs committed Mar 13, 2012
1 parent c4bf537 commit 1779c2c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d3a766b6aa4e293e72bfd6add477f05ac7fdf5a
refs/heads/master: 84ddfda6d4765e410981edeef81c9b5a5a1ce87b
39 changes: 38 additions & 1 deletion trunk/drivers/gpu/drm/nouveau/nouveau_mxm.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,35 @@ mxm_shadow_dsm(struct drm_device *dev, u8 version)

#define WMI_WMMX_GUID "F6CB5C3C-9CAE-4EBD-B577-931EA32A2CC0"

static u8
wmi_wmmx_mxmi(struct drm_device *dev, u8 version)
{
u32 mxmi_args[] = { 0x494D584D /* MXMI */, version, 0 };
struct acpi_buffer args = { sizeof(mxmi_args), mxmi_args };
struct acpi_buffer retn = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *obj;
acpi_status status;

status = wmi_evaluate_method(WMI_WMMX_GUID, 0, 0, &args, &retn);
if (ACPI_FAILURE(status)) {
MXM_DBG(dev, "WMMX MXMI returned %d\n", status);
return 0x00;
}

obj = retn.pointer;
if (obj->type == ACPI_TYPE_INTEGER) {
version = obj->integer.value;
MXM_DBG(dev, "WMMX MXMI version %d.%d\n",
(version >> 4), version & 0x0f);
} else {
version = 0;
MXM_DBG(dev, "WMMX MXMI returned non-integer\n");
}

kfree(obj);
return version;
}

static bool
mxm_shadow_wmi(struct drm_device *dev, u8 version)
{
Expand All @@ -592,7 +621,15 @@ mxm_shadow_wmi(struct drm_device *dev, u8 version)
union acpi_object *obj;
acpi_status status;

if (!wmi_has_guid(WMI_WMMX_GUID))
if (!wmi_has_guid(WMI_WMMX_GUID)) {
MXM_DBG(dev, "WMMX GUID not found\n");
return false;
}

mxms_args[1] = wmi_wmmx_mxmi(dev, 0x00);
if (!mxms_args[1])
mxms_args[1] = wmi_wmmx_mxmi(dev, version);
if (!mxms_args[1])
return false;

status = wmi_evaluate_method(WMI_WMMX_GUID, 0, 0, &args, &retn);
Expand Down

0 comments on commit 1779c2c

Please sign in to comment.