dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpu/nouveau/nouveau_acpi.c: Fix Type Mismatch ACPI warning
@ 2016-05-19  0:42 Marcos Paulo de Souza
       [not found] ` <1463618578-5662-1-git-send-email-marcos.souza.org-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Marcos Paulo de Souza @ 2016-05-19  0:42 UTC (permalink / raw)
  To: marcos.souza.org, airlied, daniel.vetter, bskeggs, lukas,
	christian.koenig, dvhart, dri-devel

nouveau_optimus_dsm is using ACPI_TYPE_BUFFER, and this triggers warnings on ACPI:
[    7.730564] ACPI: \_SB_.PCI0.RP05.PEGP: failed to evaluate _DSM
[    7.730570] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (201509    30/nsarguments-95)

To fix it, change ACPI_TYPE_BUFFER to ACPI_TYPE_PACKAGE, as the warning tells to do.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---

After booting my Asus Laptop, and after a suspend/resume too, dmesg shows warnings:
[    1.633361] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[    1.633434] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[    7.730176] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[    7.730564] ACPI: \_SB_.PCI0.RP05.PEGP: failed to evaluate _DSM
[    7.730570] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   49.732059] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   49.732424] ACPI: \_SB_.PCI0.RP05.PEGP: failed to evaluate _DSM
[   49.732430] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   74.366300] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   74.366657] ACPI: \_SB_.PCI0.RP05.PEGP: failed to evaluate _DSM
[   74.366663] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[  140.357789] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[  140.358532] ACPI: \_SB_.PCI0.RP05.PEGP: failed to evaluate _DSM
[  140.358547] ACPI Warning: \_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)

I don't know if this is the right thing to do, I just looked at intel_acpi.c to check how to use/check for ACPI Package.
The patch below silenced the "type mismatch" warnings, and some of the "evaluated _DSM" ones.

If this is not the right approach, please let me know how to fix it, I don't have knowledge in ACPI, but I really want to help.

 drivers/gpu/drm/nouveau/nouveau_acpi.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index cdf5227..f04aef3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -73,22 +73,10 @@ static const char nouveau_op_dsm_muid[] = {
 
 static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
 {
-	int i;
 	union acpi_object *obj;
-	char args_buff[4];
-	union acpi_object argv4 = {
-		.buffer.type = ACPI_TYPE_BUFFER,
-		.buffer.length = 4,
-		.buffer.pointer = args_buff
-	};
-
-	/* ACPI is little endian, AABBCCDD becomes {DD,CC,BB,AA} */
-	for (i = 0; i < 4; i++)
-		args_buff[i] = (arg >> i * 8) & 0xFF;
-
 	*result = 0;
 	obj = acpi_evaluate_dsm_typed(handle, nouveau_op_dsm_muid, 0x00000100,
-				      func, &argv4, ACPI_TYPE_BUFFER);
+				      func, NULL, ACPI_TYPE_PACKAGE);
 	if (!obj) {
 		acpi_handle_info(handle, "failed to evaluate _DSM\n");
 		return AE_ERROR;
-- 
2.5.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-22 10:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-19  0:42 [PATCH] gpu/nouveau/nouveau_acpi.c: Fix Type Mismatch ACPI warning Marcos Paulo de Souza
     [not found] ` <1463618578-5662-1-git-send-email-marcos.souza.org-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-19  9:49   ` Pierre Moreau
2016-05-20  2:22     ` Marcos Souza
     [not found]       ` <CAH0vN5+s8CGjTwW_W7Z-AC9ZMsq7GqygYtCbEkL2+9y3DhJWAw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-22 10:25         ` Peter Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).