]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/nouveau/gsp: Fix ACPI MXDM/MXDS method invocations
authorLyude Paul <lyude@redhat.com>
Fri, 22 Dec 2023 04:31:55 +0000 (14:31 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 5 Jan 2024 02:27:53 +0000 (12:27 +1000)
Currently we get an error from ACPI because both of these arguments expect
a single argument, and we don't provide one. I'm not totally clear on what
that argument does, but we're able to find the missing value from
_acpiCacheMethodData() in src/kernel/platform/acpi_common.c in nvidia's
driver. So, let's add that - which doesn't get eDP displays to power on
quite yet, but gets rid of the argument warning at least.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-7-airlied@gmail.com
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c

index 1a6d7c89660de4fde611e0971139c33eeed9a8ed..774ca47b019fbc1bbf6a2a495124907961fd6db1 100644 (file)
@@ -1150,6 +1150,8 @@ static void
 r535_gsp_acpi_mux_id(acpi_handle handle, u32 id, MUX_METHOD_DATA_ELEMENT *mode,
                                                 MUX_METHOD_DATA_ELEMENT *part)
 {
+       union acpi_object mux_arg = { ACPI_TYPE_INTEGER };
+       struct acpi_object_list input = { 1, &mux_arg };
        acpi_handle iter = NULL, handle_mux = NULL;
        acpi_status status;
        unsigned long long value;
@@ -1172,14 +1174,18 @@ r535_gsp_acpi_mux_id(acpi_handle handle, u32 id, MUX_METHOD_DATA_ELEMENT *mode,
        if (!handle_mux)
                return;
 
-       status = acpi_evaluate_integer(handle_mux, "MXDM", NULL, &value);
+       /* I -think- 0 means "acquire" according to nvidia's driver source */
+       input.pointer->integer.type = ACPI_TYPE_INTEGER;
+       input.pointer->integer.value = 0;
+
+       status = acpi_evaluate_integer(handle_mux, "MXDM", &input, &value);
        if (ACPI_SUCCESS(status)) {
                mode->acpiId = id;
                mode->mode   = value;
                mode->status = 0;
        }
 
-       status = acpi_evaluate_integer(handle_mux, "MXDS", NULL, &value);
+       status = acpi_evaluate_integer(handle_mux, "MXDS", &input, &value);
        if (ACPI_SUCCESS(status)) {
                part->acpiId = id;
                part->mode   = value;