All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org
Subject: [PATCH 06/11] drm/nouveau/gsp: Fix ACPI MXDM/MXDS method invocations
Date: Fri, 22 Dec 2023 14:31:55 +1000	[thread overview]
Message-ID: <20231222043308.3090089-7-airlied@gmail.com> (raw)
In-Reply-To: <20231222043308.3090089-1-airlied@gmail.com>

From: Lyude Paul <lyude@redhat.com>

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>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
index 1a6d7c89660d..774ca47b019f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
@@ -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;
-- 
2.43.0


  parent reply	other threads:[~2023-12-22  4:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-22  4:31 nouveau GSP fixes Dave Airlie
2023-12-22  4:31 ` [PATCH 01/11] nouveau/gsp: add three notifier callbacks that we see in normal operation (v2) Dave Airlie
2023-12-22  4:31 ` [PATCH 02/11] nouveau/gsp: drop some acpi related debug Dave Airlie
2023-12-22  4:31 ` [PATCH 03/11] nouveau: fix disp disabling with GSP Dave Airlie
2023-12-22  4:31 ` [PATCH 04/11] nouveau/gsp: free acpi object after use Dave Airlie
2023-12-22  4:31 ` [PATCH 05/11] nouveau/gsp: free userd allocation Dave Airlie
2023-12-22  4:31 ` Dave Airlie [this message]
2023-12-22  4:31 ` [PATCH 07/11] nouveau/gsp: convert gsp errors to generic errors Dave Airlie
2023-12-23  6:20   ` Timur Tabi
2023-12-22  4:31 ` [PATCH 08/11] nouveau/gsp: don't free ctrl messages on errors Dave Airlie
2024-01-03 14:46   ` Dan Carpenter
2024-01-04  0:41     ` Dave Airlie
2024-01-04  0:41       ` Dave Airlie
2024-01-04 11:38       ` Dan Carpenter
2024-01-04 11:38         ` Dan Carpenter
2023-12-22  4:31 ` [PATCH 09/11] nouveau/gsp: always free the alloc messages on r535 Dave Airlie
2023-12-22  4:31 ` [PATCH 10/11] nouveau: push event block/allowing out of the fence context Dave Airlie
2023-12-22  4:32 ` [PATCH 11/11] drm/nouveau/dp: Honor GSP link training retry timeouts Dave Airlie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231222043308.3090089-7-airlied@gmail.com \
    --to=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=nouveau@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.