Skip to contentSkip to conversation

ACPI: video: prevent ACPI video actions upon display switch notifications

PATCH Applied Zhang Rui 6 participants 11 messages Jan 25, 2008 – Mar 14, 2008 ACPI

lore
Share & tools
lore

Zhang Rui

author
#0 lore raw

PATCH 2/4 ACPI: video: prevent ACPI video actions upon display switch notifications

From: Zhang Rui <[email protected]>

Display switching via ACPI control methods are known to work on none platform AFAIK.
And graphics people want to control the display switching all by themselves. Prevent ACPI from handling display switch hotkey events in this patch.

---
 drivers/acpi/video.c |   63 ---------------------------------------------------
 1 file changed, 63 deletions(-)
drivers/acpi/video.c +0 -63
Index: linux-2.6/drivers/acpi/video.c
===================================================================
@@ -276,7 +276,6 @@ static void acpi_video_device_rebind(str
 static void acpi_video_device_bind(struct acpi_video_bus *video,
 				   struct acpi_video_device *device);
 static int acpi_video_device_enumerate(struct acpi_video_bus *video);
-static int acpi_video_switch_output(struct acpi_video_bus *video, int event);
 static int acpi_video_device_lcd_set_level(struct acpi_video_device *device,
 			int level);
 static int acpi_video_device_lcd_get_level_current(
@@ -1583,64 +1582,6 @@ static int acpi_video_device_enumerate(s
 	return status;
 }
 
-/*
- *  Arg:
- *  	video	: video bus device 
- *  	event	: notify event
- *
- *  Return:
- *  	< 0	: error
- *  
- *	1. Find out the current active output device.
- *	2. Identify the next output device to switch to.
- *	3. call _DSS to do actual switch.
- */
-
-static int acpi_video_switch_output(struct acpi_video_bus *video, int event)
-{
-	struct list_head *node;
-	struct acpi_video_device *dev = NULL;
-	struct acpi_video_device *dev_next = NULL;
-	struct acpi_video_device *dev_prev = NULL;
-	unsigned long state;
-	int status = 0;
-
-	mutex_lock(&video->device_list_lock);
-
-	list_for_each(node, &video->video_device_list) {
-		dev = container_of(node, struct acpi_video_device, entry);
-		status = acpi_video_device_get_state(dev, &state);
-		if (state & 0x2) {
-			dev_next = container_of(node->next,
-					struct acpi_video_device, entry);
-			dev_prev = container_of(node->prev,
-					struct acpi_video_device, entry);
-			goto out;
-		}
-	}
-
-	dev_next = container_of(node->next, struct acpi_video_device, entry);
-	dev_prev = container_of(node->prev, struct acpi_video_device, entry);
-
- out:
-	mutex_unlock(&video->device_list_lock);
-
-	switch (event) {
-	case ACPI_VIDEO_NOTIFY_CYCLE:
-	case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:
-		acpi_video_device_set_state(dev, 0);
-		acpi_video_device_set_state(dev_next, 0x80000001);
-		break;
-	case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:
-		acpi_video_device_set_state(dev, 0);
-		acpi_video_device_set_state(dev_prev, 0x80000001);
-	default:
-		break;
-	}
-
-	return status;
-}
-
 static int
 acpi_video_get_next_level(struct acpi_video_device *device,
 			  u32 level_current, u32 event)
@@ -1800,23 +1741,19 @@ static void acpi_video_bus_notify(acpi_h
 					 * connector. */
 		acpi_video_device_enumerate(video);
 		acpi_video_device_rebind(video);
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 
 	case ACPI_VIDEO_NOTIFY_CYCLE:	/* Cycle Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 	case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:	/* Next Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_VIDEO_NEXT;
 		break;
 	case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:	/* previous Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_VIDEO_PREV;
 		break;
reviewer Applied
#1 lore raw

Applied.

thanks,
-Len

Quoted 120 lines · Zhang Rui

From: Zhang Rui <[email protected]>

Display switching via ACPI control methods are known to work on none platform AFAIK.
And graphics people want to control the display switching all by themselves. Prevent ACPI from handling display switch hotkey events in this patch.

---
 drivers/acpi/video.c |   63 ---------------------------------------------------
 1 file changed, 63 deletions(-)

Index: linux-2.6/drivers/acpi/video.c
===================================================================

drivers/acpi/video.c +0 -64
@@ -276,7 +276,6 @@ static void acpi_video_device_rebind(str
 static void acpi_video_device_bind(struct acpi_video_bus *video,
 				   struct acpi_video_device *device);
 static int acpi_video_device_enumerate(struct acpi_video_bus *video);
-static int acpi_video_switch_output(struct acpi_video_bus *video, int event);
 static int acpi_video_device_lcd_set_level(struct acpi_video_device *device,
 			int level);
 static int acpi_video_device_lcd_get_level_current(
@@ -1583,64 +1582,6 @@ static int acpi_video_device_enumerate(s
 	return status;
 }
 
-/*
- *  Arg:
- *  	video	: video bus device 
- *  	event	: notify event
- *
- *  Return:
- *  	< 0	: error
- *  
- *	1. Find out the current active output device.
- *	2. Identify the next output device to switch to.
- *	3. call _DSS to do actual switch.
- */
-
-static int acpi_video_switch_output(struct acpi_video_bus *video, int event)
-{
-	struct list_head *node;
-	struct acpi_video_device *dev = NULL;
-	struct acpi_video_device *dev_next = NULL;
-	struct acpi_video_device *dev_prev = NULL;
-	unsigned long state;
-	int status = 0;
-
-	mutex_lock(&video->device_list_lock);
-
-	list_for_each(node, &video->video_device_list) {
-		dev = container_of(node, struct acpi_video_device, entry);
-		status = acpi_video_device_get_state(dev, &state);
-		if (state & 0x2) {
-			dev_next = container_of(node->next,
-					struct acpi_video_device, entry);
-			dev_prev = container_of(node->prev,
-					struct acpi_video_device, entry);
-			goto out;
-		}
-	}
-
-	dev_next = container_of(node->next, struct acpi_video_device, entry);
-	dev_prev = container_of(node->prev, struct acpi_video_device, entry);
-
- out:
-	mutex_unlock(&video->device_list_lock);
-
-	switch (event) {
-	case ACPI_VIDEO_NOTIFY_CYCLE:
-	case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:
-		acpi_video_device_set_state(dev, 0);
-		acpi_video_device_set_state(dev_next, 0x80000001);
-		break;
-	case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:
-		acpi_video_device_set_state(dev, 0);
-		acpi_video_device_set_state(dev_prev, 0x80000001);
-	default:
-		break;
-	}
-
-	return status;
-}
-
 static int
 acpi_video_get_next_level(struct acpi_video_device *device,
 			  u32 level_current, u32 event)
@@ -1800,23 +1741,19 @@ static void acpi_video_bus_notify(acpi_h
 					 * connector. */
 		acpi_video_device_enumerate(video);
 		acpi_video_device_rebind(video);
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 
 	case ACPI_VIDEO_NOTIFY_CYCLE:	/* Cycle Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 	case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:	/* Next Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_VIDEO_NEXT;
 		break;
 	case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:	/* previous Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_VIDEO_PREV;
 		break;
 
 
-

To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Zhang Rui
Quoted 6 lines · Zhang Rui

From: Zhang Rui <[email protected]>

Display switching via ACPI control methods are known to work on none platform AFAIK.
And graphics people want to control the display switching all by themselves. Prevent ACPI from handling display switch hotkey events in this patch.

I expect this one has to be reverted.
I can double check tomorrow, but I am pretty sure I have a Compaq and also saw more and I expect there are a lot more that work pretty fine with Display Output Switching (_DOS) set to be handled by BIOS and not graphics driver.

As said, I can double check, but this would be a regression.

IMO the logic should be:
- Let the BIOS handle the switching (also works without X)
- If a graphics driver gets active which can do the switching, it can take over control by:
echo 0 >/proc/acpi/video/*/DOS

Thomas

Quoted 113 lines
---
 drivers/acpi/video.c |   63 ---------------------------------------------------
 1 file changed, 63 deletions(-)

Index: linux-2.6/drivers/acpi/video.c
===================================================================

drivers/acpi/video.c +0 -64
@@ -276,7 +276,6 @@ static void acpi_video_device_rebind(str
 static void acpi_video_device_bind(struct acpi_video_bus *video,
 				   struct acpi_video_device *device);
 static int acpi_video_device_enumerate(struct acpi_video_bus *video);
-static int acpi_video_switch_output(struct acpi_video_bus *video, int event);
 static int acpi_video_device_lcd_set_level(struct acpi_video_device *device,
 			int level);
 static int acpi_video_device_lcd_get_level_current(
@@ -1583,64 +1582,6 @@ static int acpi_video_device_enumerate(s
 	return status;
 }
 
-/*
- *  Arg:
- *  	video	: video bus device 
- *  	event	: notify event
- *
- *  Return:
- *  	< 0	: error
- *  
- *	1. Find out the current active output device.
- *	2. Identify the next output device to switch to.
- *	3. call _DSS to do actual switch.
- */
-
-static int acpi_video_switch_output(struct acpi_video_bus *video, int event)
-{
-	struct list_head *node;
-	struct acpi_video_device *dev = NULL;
-	struct acpi_video_device *dev_next = NULL;
-	struct acpi_video_device *dev_prev = NULL;
-	unsigned long state;
-	int status = 0;
-
-	mutex_lock(&video->device_list_lock);
-
-	list_for_each(node, &video->video_device_list) {
-		dev = container_of(node, struct acpi_video_device, entry);
-		status = acpi_video_device_get_state(dev, &state);
-		if (state & 0x2) {
-			dev_next = container_of(node->next,
-					struct acpi_video_device, entry);
-			dev_prev = container_of(node->prev,
-					struct acpi_video_device, entry);
-			goto out;
-		}
-	}
-
-	dev_next = container_of(node->next, struct acpi_video_device, entry);
-	dev_prev = container_of(node->prev, struct acpi_video_device, entry);
-
- out:
-	mutex_unlock(&video->device_list_lock);
-
-	switch (event) {
-	case ACPI_VIDEO_NOTIFY_CYCLE:
-	case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:
-		acpi_video_device_set_state(dev, 0);
-		acpi_video_device_set_state(dev_next, 0x80000001);
-		break;
-	case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:
-		acpi_video_device_set_state(dev, 0);
-		acpi_video_device_set_state(dev_prev, 0x80000001);
-	default:
-		break;
-	}
-
-	return status;
-}
-
 static int
 acpi_video_get_next_level(struct acpi_video_device *device,
 			  u32 level_current, u32 event)
@@ -1800,23 +1741,19 @@ static void acpi_video_bus_notify(acpi_h
 					 * connector. */
 		acpi_video_device_enumerate(video);
 		acpi_video_device_rebind(video);
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 
 	case ACPI_VIDEO_NOTIFY_CYCLE:	/* Cycle Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 	case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:	/* Next Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_VIDEO_NEXT;
 		break;
 	case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:	/* previous Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_VIDEO_PREV;
 		break;
 
 
-

To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 14 lines · Thomas Renninger
Quoted 6 lines · Zhang Rui

From: Zhang Rui <[email protected]>

Display switching via ACPI control methods are known to work on none platform AFAIK.
And graphics people want to control the display switching all by themselves. Prevent ACPI from handling display switch hotkey events in this patch.

I expect this one has to be reverted.
I can double check tomorrow, but I am pretty sure I have a Compaq and also saw more and I expect there are a lot more that work pretty fine with Display Output Switching (_DOS) set to be handled by BIOS and not graphics driver.

Quoted 8 lines

As said, I can double check, but this would be a regression.

IMO the logic should be:
- Let the BIOS handle the switching (also works without X)
- If a graphics driver gets active which can do the switching, it can take over control by:
echo 0 >/proc/acpi/video/*/DOS

I mixed this up with the default value for _DOS:
git commit a21101c46ca5b4320e31408853cdcbf7cb1ce4ed

Again, IMO the logic should be:
- Let the BIOS handle the switching (also works without X)
- If a graphics driver gets active which can do the switching, it can take over control by:
echo 0 >/proc/acpi/video/*/DOS

Also the bug which above commit claims to fix has an interesting add-on comment (after the bug got closed):
----------------
My HP 6710B also crashes when DOS=0, DOS=1,2 or 3 works just fine though. This has an GM965 intel chipset. What does the ACPI spec say about values other then 0 or 1 ?

It seems that the change that was done from 1 to 0 causes some quit bad regressions on some laptops, while fixing others. Otoh all reporters say that DOS=2 works..
----------------

Thomas

Quoted 112 lines

Thomas

Quoted 109 lines
---
 drivers/acpi/video.c |   63 ---------------------------------------------------
 1 file changed, 63 deletions(-)

Index: linux-2.6/drivers/acpi/video.c
===================================================================

drivers/acpi/video.c +0 -63
@@ -276,7 +276,6 @@ static void acpi_video_device_rebind(str
 static void acpi_video_device_bind(struct acpi_video_bus *video,
 				   struct acpi_video_device *device);
 static int acpi_video_device_enumerate(struct acpi_video_bus *video);
-static int acpi_video_switch_output(struct acpi_video_bus *video, int event);
 static int acpi_video_device_lcd_set_level(struct acpi_video_device *device,
 			int level);
 static int acpi_video_device_lcd_get_level_current(
@@ -1583,64 +1582,6 @@ static int acpi_video_device_enumerate(s
 	return status;
 }
 
-/*
- *  Arg:
- *  	video	: video bus device 
- *  	event	: notify event
- *
- *  Return:
- *  	< 0	: error
- *  
- *	1. Find out the current active output device.
- *	2. Identify the next output device to switch to.
- *	3. call _DSS to do actual switch.
- */
-
-static int acpi_video_switch_output(struct acpi_video_bus *video, int event)
-{
-	struct list_head *node;
-	struct acpi_video_device *dev = NULL;
-	struct acpi_video_device *dev_next = NULL;
-	struct acpi_video_device *dev_prev = NULL;
-	unsigned long state;
-	int status = 0;
-
-	mutex_lock(&video->device_list_lock);
-
-	list_for_each(node, &video->video_device_list) {
-		dev = container_of(node, struct acpi_video_device, entry);
-		status = acpi_video_device_get_state(dev, &state);
-		if (state & 0x2) {
-			dev_next = container_of(node->next,
-					struct acpi_video_device, entry);
-			dev_prev = container_of(node->prev,
-					struct acpi_video_device, entry);
-			goto out;
-		}
-	}
-
-	dev_next = container_of(node->next, struct acpi_video_device, entry);
-	dev_prev = container_of(node->prev, struct acpi_video_device, entry);
-
- out:
-	mutex_unlock(&video->device_list_lock);
-
-	switch (event) {
-	case ACPI_VIDEO_NOTIFY_CYCLE:
-	case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:
-		acpi_video_device_set_state(dev, 0);
-		acpi_video_device_set_state(dev_next, 0x80000001);
-		break;
-	case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:
-		acpi_video_device_set_state(dev, 0);
-		acpi_video_device_set_state(dev_prev, 0x80000001);
-	default:
-		break;
-	}
-
-	return status;
-}
-
 static int
 acpi_video_get_next_level(struct acpi_video_device *device,
 			  u32 level_current, u32 event)
@@ -1800,23 +1741,19 @@ static void acpi_video_bus_notify(acpi_h
 					 * connector. */
 		acpi_video_device_enumerate(video);
 		acpi_video_device_rebind(video);
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 
 	case ACPI_VIDEO_NOTIFY_CYCLE:	/* Cycle Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 	case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:	/* Next Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_VIDEO_NEXT;
 		break;
 	case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:	/* previous Display output hotkey pressed. */
-		acpi_video_switch_output(video, event);
 		acpi_bus_generate_proc_event(device, event, 0);
 		keycode = KEY_VIDEO_PREV;
 		break;
Quoted 9 lines
Quoted 4 lines

-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#4 lore raw

Re: [PATCH 2/4] ACPI: video: prevent ACPI video actions upondisplay switch notifications

Quoted 32 lines · Thomas Renninger
Quoted 4 lines · Thomas Renninger
Quoted 3 lines · Zhang Rui

From: Zhang Rui <[email protected]>

Display switching via ACPI control methods are known to work on

none

Quoted 2 lines
Quoted 2 lines

platform AFAIK.
And graphics people want to control the display switching all by

themselves.

Quoted 1 line
Quoted 1 line

Prevent ACPI from handling display switch hotkey events in this

patch.

Quoted 3 lines

I expect this one has to be reverted.
I can double check tomorrow, but I am pretty sure I have a Compaq

and

Quoted 1 line

also saw more and I expect there are a lot more that work pretty

fine

Quoted 1 line

with Display Output Switching (_DOS) set to be handled by BIOS and

not

Quoted 7 lines

graphics driver.

As said, I can double check, but this would be a regression.

IMO the logic should be:
- Let the BIOS handle the switching (also works without X)
- If a graphics driver gets active which can do the switching, it

can

Quoted 3 lines

take over control by:
echo 0 >/proc/acpi/video/*/DOS

Quoted 8 lines

I mixed this up with the default value for _DOS:
git commit a21101c46ca5b4320e31408853cdcbf7cb1ce4ed

Again, IMO the logic should be:
- Let the BIOS handle the switching (also works without X)
- If a graphics driver gets active which can do the switching, it can take over control by:

   echo 0 >/proc/acpi/video/*/DOS

That's what I thought at the beginning,
and the bug
http://bugzilla.kernel.org/show_bug.cgi?id=6001
suggested me to set _DOS to 0 by default.

Quoted 7 lines

Also the bug which above commit claims to fix has an interesting add-on
comment (after the bug got closed):
----------------
My HP 6710B also crashes when DOS=0, DOS=1,2 or 3 works just fine though.

which version of kernel are you using?
I get this problem before, but it can not be reproduced in the kernel later than 2.6.23.

Quoted 4 lines

This
has an GM965 intel chipset. What does the ACPI spec say about values other then
0 or 1 ?

nothing interesting.
And many laptops don't follow the ACPI spec on this. :(

Quoted 6 lines

It seems that the change that was done from 1 to 0 causes some quit bad
regressions on some laptops, while fixing others. Otoh all reporters say that
DOS=2 works..
----------------

well, DOS=2 doesn't work either...
there is no solution that can work for all laptops.

thanks,
rui

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

Re: [PATCH 2/4] ACPI: video: prevent ACPI video actions upondisplay switch notifications

Quoted 36 lines · Rui
Quoted 27 lines · Thomas Renninger
Quoted 16 lines · Thomas Renninger
Quoted 8 lines · Zhang Rui

From: Zhang Rui <[email protected]>

Display switching via ACPI control methods are known to work on none platform AFAIK.
And graphics people want to control the display switching all by themselves.
Prevent ACPI from handling display switch hotkey events in this patch.

I expect this one has to be reverted.
I can double check tomorrow, but I am pretty sure I have a Compaq and also saw more and I expect there are a lot more that work pretty fine with Display Output Switching (_DOS) set to be handled by BIOS and not graphics driver.

Quoted 8 lines

As said, I can double check, but this would be a regression.

IMO the logic should be:
- Let the BIOS handle the switching (also works without X)
- If a graphics driver gets active which can do the switching, it can take over control by:
echo 0 >/proc/acpi/video/*/DOS

Quoted 8 lines

I mixed this up with the default value for _DOS:
git commit a21101c46ca5b4320e31408853cdcbf7cb1ce4ed

Again, IMO the logic should be:
- Let the BIOS handle the switching (also works without X)
- If a graphics driver gets active which can do the switching, it can take over control by:

   echo 0 >/proc/acpi/video/*/DOS
Quoted 4 lines

That's what I thought at the beginning,
and the bug
http://bugzilla.kernel.org/show_bug.cgi?id=6001
suggested me to set _DOS to 0 by default.

Yep. I think _DOS set to 0 by default is wrong and in the bug machines were stated where this causes problems now.

Quoted 15 lines
Quoted 6 lines

Also the bug which above commit claims to fix has an interesting add-on
comment (after the bug got closed):
----------------
My HP 6710B also crashes when DOS=0, DOS=1,2 or 3 works just fine though.

which version of kernel are you using?
I get this problem before, but it can not be reproduced in the kernel later than 2.6.23.

Quoted 2 lines

This has an GM965 intel chipset. What does the ACPI spec say about values other then 0 or 1 ?

nothing interesting.
And many laptops don't follow the ACPI spec on this. :(

Quoted 7 lines
Quoted 5 lines

It seems that the change that was done from 1 to 0 causes some quit bad regressions on some laptops, while fixing others. Otoh all reporters say that
DOS=2 works..
----------------

well, DOS=2 doesn't work either...
there is no solution that can work for all laptops.

Above was not from myself, but copied out from the bug.
The guy(s) complained that DOS=0 now breaks their machines... I try to find some time to look at this a bit deeper and will then comment in the bug (can take some time...).
IMO recent HPs can/should be taken as a reference as they tend to stick to the ACPI spec closely.
As said, it was late and I mixed up patches, the patch to switch _DOS default value to 0 was already in 2.6.24?
I don't know now how much was tried already.
A) To switch DOS to 0 when e.g. intel graphics driver gets active (should be done by the graphics driver package or if X is started if the driver is aware of the hotkey and can do the switching).
B) Otherwise (e.g. if framebuffer or graphics driver which do not switch the display) it should stay to be BIOS handled.
This is the correct way IMO this should get handled.

Puhh, this needs a lot testing (different graphics drivers, different machines,...) and implementation to switch to DOS=0 in graphics drivers...

Thanks,

Thomas

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

Re: [Linux-gfx] Re: [PATCH 2/4] ACPI: video: prevent ACPI video actions upondisplay switch notifications

Quoted 16 lines · Thomas Renninger

Above was not from myself, but copied out from the bug.
The guy(s) complained that DOS=0 now breaks their machines... I try to find some time to look at this a bit deeper and will then comment in the bug (can take some time...).
IMO recent HPs can/should be taken as a reference as they tend to stick to the ACPI spec closely.
As said, it was late and I mixed up patches, the patch to switch _DOS default value to 0 was already in 2.6.24?
I don't know now how much was tried already.
A) To switch DOS to 0 when e.g. intel graphics driver gets active (should be done by the graphics driver package or if X is started if the driver is aware of the hotkey and can do the switching).
B) Otherwise (e.g. if framebuffer or graphics driver which do not switch the display) it should stay to be BIOS handled.
This is the correct way IMO this should get handled.

Quoted 3 lines

Puhh, this needs a lot testing (different graphics drivers, different machines,...) and implementation to switch to DOS=0 in graphics drivers...

Yeah, you're right that userspace drivers should probably set the DOS value when they startup, though '3' may be a better value since userspace probably doesn't care about the _DGS stuff.

The trouble is that DOS=0 works for some machines but breaks others, does anyone have a summary of the reports against the various values?

Jesse

#7 lore raw

Re: [Linux-gfx] Re: [PATCH 2/4] ACPI: video: prevent ACPI video actions upondisplay switch notifications

Quoted 3 lines · Jesse Barnes

Yeah, you're right that userspace drivers should probably set the DOS value when they startup, though '3' may be a better value since userspace probably doesn't care about the _DGS stuff.

Just punt it to userspace. Really. Never do any ACPI video display switching actions automatically by default (unless you use a *whitelist*). Don't set _DOS by default. Don't touch anything related to video-display switching by default, AT ALL. Just propagate any video switching events we get down to userspace, and that's it for default behaviour.

Add a sysfs control to let userspace ask ACPI video to handle the display switching (as it used to). Let userspace configure how ACPI video should behave when it gets ACPI display switch notifications.

It is one of these areas where no matter what you do, if you touch anything you will break a box somewhere. So you just punt it to userspace, because in userspace it is possible to have a massive DMI model database with the proper parameters for a given userspace X.org capabilities, and a given box AML quirks.

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
#9 lore raw

Re: [PATCH 2/4] ACPI: video: prevent ACPI video actions upondisplay switch notifications

In reply to Thomas Renninger
Quoted 6 lines · Thomas Renninger

Above was not from myself, but copied out from the bug.
The guy(s) complained that DOS=0 now breaks their machines... I try to find some time to look at this a bit deeper and will then comment in the bug (can take some time...).
IMO recent HPs can/should be taken as a reference as they tend to stick to the ACPI spec closely.

Setting my HP 2510p to a DOS of 0 leaves it smashing CPU state on every other lid open event, so I suspect it's not tested at all. I'd lean towards saying that the kernel default should probably be 1, with userspace altering that as appropriate.

Signature · 1 line
Matthew Garrett | [email protected]
author
#10 lore raw

Re: [PATCH 2/4] ACPI: video: prevent ACPI video actionsupondisplay switch notifications

In reply to Thomas Renninger
Quoted 78 lines · Thomas Renninger
Quoted 7 lines · Rui
Quoted 6 lines · Thomas Renninger
Quoted 4 lines · Thomas Renninger
Quoted 3 lines · Zhang Rui

From: Zhang Rui <[email protected]>

Display switching via ACPI control methods are known to work

on

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

none platform AFAIK.
And graphics people want to control the display switching all

by

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

themselves.
Prevent ACPI from handling display switch hotkey events in

this

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

patch.

I expect this one has to be reverted.
I can double check tomorrow, but I am pretty sure I have a

Compaq

Quoted 1 line
Quoted 1 line
Quoted 1 line

and also saw more and I expect there are a lot more that work

pretty

Quoted 1 line
Quoted 1 line
Quoted 1 line

fine with Display Output Switching (_DOS) set to be handled by

BIOS and

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

not graphics driver.

As said, I can double check, but this would be a regression.

IMO the logic should be:
- Let the BIOS handle the switching (also works without X)
- If a graphics driver gets active which can do the switching,

it

Quoted 10 lines
Quoted 10 lines
Quoted 3 lines

can take over control by:
echo 0 >/proc/acpi/video/*/DOS

I mixed this up with the default value for _DOS:
git commit a21101c46ca5b4320e31408853cdcbf7cb1ce4ed

Again, IMO the logic should be:
- Let the BIOS handle the switching (also works without X)
- If a graphics driver gets active which can do the switching, it

can

Quoted 6 lines
Quoted 2 lines

take over control by:

   echo 0 >/proc/acpi/video/*/DOS

That's what I thought at the beginning,
and the bug
http://bugzilla.kernel.org/show_bug.cgi?id=6001
suggested me to set _DOS to 0 by default.

Yep. I think _DOS set to 0 by default is wrong and in the bug machines were stated where this causes problems now.

Quoted 8 lines
Quoted 6 lines

Also the bug which above commit claims to fix has an interesting add-on
comment (after the bug got closed):
----------------
My HP 6710B also crashes when DOS=0, DOS=1,2 or 3 works just fine though.

which version of kernel are you using?
I get this problem before, but it can not be reproduced in the

kernel

Quoted 3 lines

later than 2.6.23.

Quoted 1 line

This has an GM965 intel chipset. What does the ACPI spec say about

values

Quoted 5 lines
Quoted 1 line

other then 0 or 1 ?

nothing interesting.
And many laptops don't follow the ACPI spec on this. :(

Quoted 1 line

It seems that the change that was done from 1 to 0 causes some

quit bad

Quoted 1 line
Quoted 1 line

regressions on some laptops, while fixing others. Otoh all

reporters

Quoted 5 lines
Quoted 3 lines

say that
DOS=2 works..
----------------

well, DOS=2 doesn't work either...
there is no solution that can work for all laptops.

Quoted 9 lines

Above was not from myself, but copied out from the bug. The guy(s) complained that DOS=0 now breaks their machines... I try to find some time to look at this a bit deeper and will then comment in the bug (can take some time...).
IMO recent HPs can/should be taken as a reference as they tend to stick
to the ACPI spec closely.
As said, it was late and I mixed up patches, the patch to switch _DOS default value to 0 was already in 2.6.24?

Yes.

Quoted 9 lines

I don't know now how much was tried already.
A) To switch DOS to 0 when e.g. intel graphics driver gets active (should be done by the graphics driver package or if X is started if the
driver is aware of the hotkey and can do the switching).
B) Otherwise (e.g. if framebuffer or graphics driver which do not switch
the display) it should stay to be BIOS handled.
This is the correct way IMO this should get handled.

Well, I agree. If the patch causes regressions, we should revert it. And I saw several bugs on this.

thanks,
rui

Quoted 3 lines

Puhh, this needs a lot testing (different graphics drivers, different machines,...) and implementation to switch to DOS=0 in graphics drivers...

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#8 lore raw

Re: [Linux-gfx] Re: [PATCH 2/4] ACPI: video: prevent ACPI video actions upondisplay switch notifications

In reply to Jesse Barnes
Quoted 23 lines · Jesse
Quoted 5 lines · Thomas Renninger

Above was not from myself, but copied out from the bug. The guy(s) complained that DOS=0 now breaks their machines... I try to find some time to look at this a bit deeper and will then comment in the bug (can take some time...).
IMO recent HPs can/should be taken as a reference as they tend to

stick

Quoted 2 lines

to the ACPI spec closely.
As said, it was late and I mixed up patches, the patch to switch

_DOS

Quoted 4 lines

default value to 0 was already in 2.6.24?
I don't know now how much was tried already.
A) To switch DOS to 0 when e.g. intel graphics driver gets active (should be done by the graphics driver package or if X is started if

the

Quoted 2 lines

driver is aware of the hotkey and can do the switching).
B) Otherwise (e.g. if framebuffer or graphics driver which do not

switch

Quoted 4 lines

the display) it should stay to be BIOS handled. This is the correct way IMO this should get handled.

Puhh, this needs a lot testing (different graphics drivers,

different

Quoted 8 lines
Quoted 2 lines

machines,...) and implementation to switch to DOS=0 in graphics drivers...

Yeah, you're right that userspace drivers should probably set the DOS value
when they startup, though '3' may be a better value since userspace probably
doesn't care about the _DGS stuff.

Well, it doesn't work on many platforms.

And from the comments here:
http://bugzilla.kernel.org/show_bug.cgi?id=9159#c5
Maybe DOS values other than "1" is not well tested.

Quoted 3 lines

The trouble is that DOS=0 works for some machines but breaks others, does
anyone have a summary of the reports against the various values?

No. :(.
And I'm afraid that the symptom is different on different machines...

thanks,
rui