linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events
       [not found]                 ` <CADnq5_Meh0nW90PZ=kAJdK=WjZKTdr7+5vN=vza+PzyJnEWKAA@mail.gmail.com>
@ 2012-08-01 13:49                   ` Luca Tettamanti
  2012-08-01 14:02                     ` Alex Deucher
                                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Luca Tettamanti @ 2012-08-01 13:49 UTC (permalink / raw)
  To: Alex Deucher
  Cc: airlied, dri-devel, Alex Deucher, joeyli, linux-acpi, Zhang Rui,
	Len Brown

AMD ACPI interface may overload the standard event
ACPI_VIDEO_NOTIFY_PROBE (0x81) to signal AMD-specific events. In such
cases we don't want to send the keypress (KEY_SWITCHVIDEOMODE) to the
userspace because the user did not press the mode switch key (the
spurious keypress confuses the DE which usually changes the
display configuration and messes up a dual-screen setup).
This patch gives the radeon driver the chance to examine the event and
block the keypress if the event is an "AMD event".

Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
---
Any comment from ACPI front?

 drivers/acpi/video.c                 |   10 ++++++++--
 drivers/gpu/drm/radeon/radeon_acpi.c |    7 ++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 1e0a9e1..a8592c4 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1457,7 +1457,12 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
 		acpi_video_device_enumerate(video);
 		acpi_video_device_rebind(video);
 		acpi_bus_generate_proc_event(device, event, 0);
-		keycode = KEY_SWITCHVIDEOMODE;
+		/* This event is also overloaded by AMD ACPI interface, don't
+		 * send the key press if the event has been handled elsewhere
+		 * (e.g. radeon DRM driver).
+		 */
+		if (!acpi_notifier_call_chain(device, event, 0))
+			keycode = KEY_SWITCHVIDEOMODE;
 		break;
 
 	case ACPI_VIDEO_NOTIFY_CYCLE:	/* Cycle Display output hotkey pressed. */
@@ -1479,7 +1484,8 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
 		break;
 	}
 
-	if (event != ACPI_VIDEO_NOTIFY_SWITCH)
+	if (event != ACPI_VIDEO_NOTIFY_SWITCH &&
+			event != ACPI_VIDEO_NOTIFY_PROBE)
 		acpi_notifier_call_chain(device, event, 0);
 
 	if (keycode) {
diff --git a/drivers/gpu/drm/radeon/radeon_acpi.c b/drivers/gpu/drm/radeon/radeon_acpi.c
index 96de08d..ee0d29e 100644
--- a/drivers/gpu/drm/radeon/radeon_acpi.c
+++ b/drivers/gpu/drm/radeon/radeon_acpi.c
@@ -273,7 +273,12 @@ int radeon_atif_handler(struct radeon_device *rdev,
 	}
 	/* TODO: check other events */
 
-	return NOTIFY_OK;
+	/* We've handled the event, stop the notifier chain. The ACPI interface
+	 * overloads ACPI_VIDEO_NOTIFY_PROBE, we don't want to send that to
+	 * userspace if the event was generated only to signal a SBIOS
+	 * request.
+	 */
+	return NOTIFY_BAD;
 }
 
 /* Call all ACPI methods here */
-- 
1.7.10.4

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

* Re: [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events
  2012-08-01 13:49                   ` [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events Luca Tettamanti
@ 2012-08-01 14:02                     ` Alex Deucher
  2012-08-01 14:50                     ` joeyli
  2012-08-02  0:45                     ` Zhang Rui
  2 siblings, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2012-08-01 14:02 UTC (permalink / raw)
  To: Luca Tettamanti
  Cc: airlied, dri-devel, Alex Deucher, joeyli, linux-acpi, Zhang Rui,
	Len Brown

On Wed, Aug 1, 2012 at 9:49 AM, Luca Tettamanti <kronos.it@gmail.com> wrote:
> AMD ACPI interface may overload the standard event
> ACPI_VIDEO_NOTIFY_PROBE (0x81) to signal AMD-specific events. In such
> cases we don't want to send the keypress (KEY_SWITCHVIDEOMODE) to the
> userspace because the user did not press the mode switch key (the
> spurious keypress confuses the DE which usually changes the
> display configuration and messes up a dual-screen setup).
> This patch gives the radeon driver the chance to examine the event and
> block the keypress if the event is an "AMD event".
>
> Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>

Looks good to me, but I'm certainly not an ACPI expert.

Acked-by: Alex Deucher <alexander.deucher@amd.com>

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

* Re: [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events
  2012-08-01 13:49                   ` [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events Luca Tettamanti
  2012-08-01 14:02                     ` Alex Deucher
@ 2012-08-01 14:50                     ` joeyli
  2012-08-02  0:45                     ` Zhang Rui
  2 siblings, 0 replies; 8+ messages in thread
From: joeyli @ 2012-08-01 14:50 UTC (permalink / raw)
  To: Luca Tettamanti
  Cc: Alex Deucher, airlied, dri-devel, Alex Deucher, linux-acpi,
	Zhang Rui, Len Brown

於 三,2012-08-01 於 15:49 +0200,Luca Tettamanti 提到:
> AMD ACPI interface may overload the standard event
> ACPI_VIDEO_NOTIFY_PROBE (0x81) to signal AMD-specific events. In such
> cases we don't want to send the keypress (KEY_SWITCHVIDEOMODE) to the
> userspace because the user did not press the mode switch key (the
> spurious keypress confuses the DE which usually changes the
> display configuration and messes up a dual-screen setup).
> This patch gives the radeon driver the chance to examine the event and
> block the keypress if the event is an "AMD event".
> 
> Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>


Tested-by: Lee, Chun-Yi <jlee@suse.com>


This patch works to me on my HP notebook to avoid (VGA, 0x81) notify
event issued when AC-power unpluged.


Thanks
Joey Lee

> ---
> Any comment from ACPI front?
> 
>  drivers/acpi/video.c                 |   10 ++++++++--
>  drivers/gpu/drm/radeon/radeon_acpi.c |    7 ++++++-
>  2 files changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
> index 1e0a9e1..a8592c4 100644
> --- a/drivers/acpi/video.c
> +++ b/drivers/acpi/video.c
> @@ -1457,7 +1457,12 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
>  		acpi_video_device_enumerate(video);
>  		acpi_video_device_rebind(video);
>  		acpi_bus_generate_proc_event(device, event, 0);
> -		keycode = KEY_SWITCHVIDEOMODE;
> +		/* This event is also overloaded by AMD ACPI interface, don't
> +		 * send the key press if the event has been handled elsewhere
> +		 * (e.g. radeon DRM driver).
> +		 */
> +		if (!acpi_notifier_call_chain(device, event, 0))
> +			keycode = KEY_SWITCHVIDEOMODE;
>  		break;
>  
>  	case ACPI_VIDEO_NOTIFY_CYCLE:	/* Cycle Display output hotkey pressed. */
> @@ -1479,7 +1484,8 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
>  		break;
>  	}
>  
> -	if (event != ACPI_VIDEO_NOTIFY_SWITCH)
> +	if (event != ACPI_VIDEO_NOTIFY_SWITCH &&
> +			event != ACPI_VIDEO_NOTIFY_PROBE)
>  		acpi_notifier_call_chain(device, event, 0);
>  
>  	if (keycode) {
> diff --git a/drivers/gpu/drm/radeon/radeon_acpi.c b/drivers/gpu/drm/radeon/radeon_acpi.c
> index 96de08d..ee0d29e 100644
> --- a/drivers/gpu/drm/radeon/radeon_acpi.c
> +++ b/drivers/gpu/drm/radeon/radeon_acpi.c
> @@ -273,7 +273,12 @@ int radeon_atif_handler(struct radeon_device *rdev,
>  	}
>  	/* TODO: check other events */
>  
> -	return NOTIFY_OK;
> +	/* We've handled the event, stop the notifier chain. The ACPI interface
> +	 * overloads ACPI_VIDEO_NOTIFY_PROBE, we don't want to send that to
> +	 * userspace if the event was generated only to signal a SBIOS
> +	 * request.
> +	 */
> +	return NOTIFY_BAD;
>  }
>  
>  /* Call all ACPI methods here */


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

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

* Re: [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events
  2012-08-01 13:49                   ` [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events Luca Tettamanti
  2012-08-01 14:02                     ` Alex Deucher
  2012-08-01 14:50                     ` joeyli
@ 2012-08-02  0:45                     ` Zhang Rui
  2012-08-02 13:46                       ` Luca Tettamanti
  2 siblings, 1 reply; 8+ messages in thread
From: Zhang Rui @ 2012-08-02  0:45 UTC (permalink / raw)
  To: Luca Tettamanti
  Cc: Alex Deucher, airlied, dri-devel, Alex Deucher, joeyli,
	linux-acpi, Len Brown

On 三, 2012-08-01 at 15:49 +0200, Luca Tettamanti wrote:
> AMD ACPI interface may overload the standard event
> ACPI_VIDEO_NOTIFY_PROBE (0x81) to signal AMD-specific events. In such
> cases we don't want to send the keypress (KEY_SWITCHVIDEOMODE) to the
> userspace because the user did not press the mode switch key (the
> spurious keypress confuses the DE which usually changes the
> display configuration and messes up a dual-screen setup).
> This patch gives the radeon driver the chance to examine the event and
> block the keypress if the event is an "AMD event".
> 
> Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
> ---
> Any comment from ACPI front?
> 
it looks good to me.
But I'm wondering if we can use the following code for ACPI part, which
looks cleaner.
I know this may change the behavior of other events, but in theory, we
should not send any input event if we know something wrong in kernel.

what do you think?

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 1e0a9e1..8ad1f53 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1448,8 +1448,7 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
 	case ACPI_VIDEO_NOTIFY_SWITCH:	/* User requested a switch,
 					 * most likely via hotkey. */
 		acpi_bus_generate_proc_event(device, event, 0);
-		if (!acpi_notifier_call_chain(device, event, 0))
-			keycode = KEY_SWITCHVIDEOMODE;
+		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 
 	case ACPI_VIDEO_NOTIFY_PROBE:	/* User plugged in or removed a video
@@ -1479,8 +1478,8 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
 		break;
 	}
 
-	if (event != ACPI_VIDEO_NOTIFY_SWITCH)
-		acpi_notifier_call_chain(device, event, 0);
+	if (acpi_notifier_call_chain(device, event, 0))
+		keycode = 0;
 
 	if (keycode) {
 		input_report_key(input, keycode, 1);


>  drivers/acpi/video.c                 |   10 ++++++++--
>  drivers/gpu/drm/radeon/radeon_acpi.c |    7 ++++++-
>  2 files changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
> index 1e0a9e1..a8592c4 100644
> --- a/drivers/acpi/video.c
> +++ b/drivers/acpi/video.c
> @@ -1457,7 +1457,12 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
>  		acpi_video_device_enumerate(video);
>  		acpi_video_device_rebind(video);
>  		acpi_bus_generate_proc_event(device, event, 0);
> -		keycode = KEY_SWITCHVIDEOMODE;
> +		/* This event is also overloaded by AMD ACPI interface, don't
> +		 * send the key press if the event has been handled elsewhere
> +		 * (e.g. radeon DRM driver).
> +		 */
> +		if (!acpi_notifier_call_chain(device, event, 0))
> +			keycode = KEY_SWITCHVIDEOMODE;
>  		break;
>  
>  	case ACPI_VIDEO_NOTIFY_CYCLE:	/* Cycle Display output hotkey pressed. */
> @@ -1479,7 +1484,8 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
>  		break;
>  	}
>  
> -	if (event != ACPI_VIDEO_NOTIFY_SWITCH)
> +	if (event != ACPI_VIDEO_NOTIFY_SWITCH &&
> +			event != ACPI_VIDEO_NOTIFY_PROBE)
>  		acpi_notifier_call_chain(device, event, 0);
>  
>  	if (keycode) {
> diff --git a/drivers/gpu/drm/radeon/radeon_acpi.c b/drivers/gpu/drm/radeon/radeon_acpi.c
> index 96de08d..ee0d29e 100644
> --- a/drivers/gpu/drm/radeon/radeon_acpi.c
> +++ b/drivers/gpu/drm/radeon/radeon_acpi.c
> @@ -273,7 +273,12 @@ int radeon_atif_handler(struct radeon_device *rdev,
>  	}
>  	/* TODO: check other events */
>  
> -	return NOTIFY_OK;
> +	/* We've handled the event, stop the notifier chain. The ACPI interface
> +	 * overloads ACPI_VIDEO_NOTIFY_PROBE, we don't want to send that to
> +	 * userspace if the event was generated only to signal a SBIOS
> +	 * request.
> +	 */
> +	return NOTIFY_BAD;
>  }
>  
>  /* Call all ACPI methods here */


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

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

* Re: [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events
  2012-08-02  0:45                     ` Zhang Rui
@ 2012-08-02 13:46                       ` Luca Tettamanti
  2012-08-03  1:40                         ` Zhang Rui
  0 siblings, 1 reply; 8+ messages in thread
From: Luca Tettamanti @ 2012-08-02 13:46 UTC (permalink / raw)
  To: Zhang Rui
  Cc: Alex Deucher, airlied, dri-devel, Alex Deucher, joeyli,
	linux-acpi, Len Brown

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

On Thu, Aug 02, 2012 at 08:45:30AM +0800, Zhang Rui wrote:
> On 三, 2012-08-01 at 15:49 +0200, Luca Tettamanti wrote:
> > AMD ACPI interface may overload the standard event
> > ACPI_VIDEO_NOTIFY_PROBE (0x81) to signal AMD-specific events. In such
> > cases we don't want to send the keypress (KEY_SWITCHVIDEOMODE) to the
> > userspace because the user did not press the mode switch key (the
> > spurious keypress confuses the DE which usually changes the
> > display configuration and messes up a dual-screen setup).
> > This patch gives the radeon driver the chance to examine the event and
> > block the keypress if the event is an "AMD event".
> > 
> > Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
> > ---
> > Any comment from ACPI front?
> > 
> it looks good to me.
> But I'm wondering if we can use the following code for ACPI part, which
> looks cleaner.
> I know this may change the behavior of other events, but in theory, we
> should not send any input event if we know something wrong in kernel.
> 
> what do you think?

I like it, it's cleaner.
I've split the patch in two pieces (one for video, the other for
radeon) and adopted your suggestion.

BTW, I'm leaving for vacation in a few hours, I'll be offline till mid
August.

Luca

[-- Attachment #2: 0001-ACPI-video-allow-events-handlers-to-veto-the-keypres.patch --]
[-- Type: text/plain, Size: 1959 bytes --]

>From acce30c96b90d1bc550e82a9e7f19226fa194d5e Mon Sep 17 00:00:00 2001
From: Luca Tettamanti <kronos.it@gmail.com>
Date: Thu, 2 Aug 2012 15:30:27 +0200
Subject: [PATCH 1/2] ACPI video: allow events handlers to veto the keypress

The standard video events may be overloaded for device specific
purposes. For example AMD ACPI interface overloads
ACPI_VIDEO_NOTIFY_PROBE (0x81) to signal AMD-specific events. In such
cases we don't want to send the keypress (KEY_SWITCHVIDEOMODE) to the
userspace because the user did not press the mode switch key (the
spurious keypress confuses the DE which usually changes the
display configuration and messes up a dual-screen setup).
This patch gives the handlers the chance to examine the event and
block the keypress if the event is device specific.
v2: refactor as suggested by Zhang Rui <rui.zhang@intel.com>

Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
---
 drivers/acpi/video.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 1e0a9e1..d75642a 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1448,8 +1448,7 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
 	case ACPI_VIDEO_NOTIFY_SWITCH:	/* User requested a switch,
 					 * most likely via hotkey. */
 		acpi_bus_generate_proc_event(device, event, 0);
-		if (!acpi_notifier_call_chain(device, event, 0))
-			keycode = KEY_SWITCHVIDEOMODE;
+		keycode = KEY_SWITCHVIDEOMODE;
 		break;
 
 	case ACPI_VIDEO_NOTIFY_PROBE:	/* User plugged in or removed a video
@@ -1479,8 +1478,9 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
 		break;
 	}
 
-	if (event != ACPI_VIDEO_NOTIFY_SWITCH)
-		acpi_notifier_call_chain(device, event, 0);
+	if (acpi_notifier_call_chain(device, event, 0))
+		/* Something vetoed the keypress. */
+		keycode = 0;
 
 	if (keycode) {
 		input_report_key(input, keycode, 1);
-- 
1.7.10.4


[-- Attachment #3: 0002-drm-radeon-block-the-keypress-on-ATIF-events.patch --]
[-- Type: text/plain, Size: 1193 bytes --]

>From def5119d8f617eef0fac2cd35d7bb18c176ff8f6 Mon Sep 17 00:00:00 2001
From: Luca Tettamanti <kronos.it@gmail.com>
Date: Thu, 2 Aug 2012 15:33:03 +0200
Subject: [PATCH 2/2] drm/radeon: block the keypress on ATIF events

The AMD ACPI interface may use ACPI_VIDEO_NOTIFY_PROBE to signal SBIOS
requests; block the keypress in this case since the user did not
actually press the mode switch key.

Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
---
 drivers/gpu/drm/radeon/radeon_acpi.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_acpi.c b/drivers/gpu/drm/radeon/radeon_acpi.c
index 96de08d..ee0d29e 100644
--- a/drivers/gpu/drm/radeon/radeon_acpi.c
+++ b/drivers/gpu/drm/radeon/radeon_acpi.c
@@ -273,7 +273,12 @@ int radeon_atif_handler(struct radeon_device *rdev,
 	}
 	/* TODO: check other events */
 
-	return NOTIFY_OK;
+	/* We've handled the event, stop the notifier chain. The ACPI interface
+	 * overloads ACPI_VIDEO_NOTIFY_PROBE, we don't want to send that to
+	 * userspace if the event was generated only to signal a SBIOS
+	 * request.
+	 */
+	return NOTIFY_BAD;
 }
 
 /* Call all ACPI methods here */
-- 
1.7.10.4


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

* Re: [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events
  2012-08-02 13:46                       ` Luca Tettamanti
@ 2012-08-03  1:40                         ` Zhang Rui
  2012-08-03  1:45                           ` Alex Deucher
  0 siblings, 1 reply; 8+ messages in thread
From: Zhang Rui @ 2012-08-03  1:40 UTC (permalink / raw)
  To: Luca Tettamanti
  Cc: Alex Deucher, airlied, dri-devel, Alex Deucher, joeyli,
	linux-acpi, Len Brown

On 四, 2012-08-02 at 15:46 +0200, Luca Tettamanti wrote:
> On Thu, Aug 02, 2012 at 08:45:30AM +0800, Zhang Rui wrote:
> > On 三, 2012-08-01 at 15:49 +0200, Luca Tettamanti wrote:
> > > AMD ACPI interface may overload the standard event
> > > ACPI_VIDEO_NOTIFY_PROBE (0x81) to signal AMD-specific events. In such
> > > cases we don't want to send the keypress (KEY_SWITCHVIDEOMODE) to the
> > > userspace because the user did not press the mode switch key (the
> > > spurious keypress confuses the DE which usually changes the
> > > display configuration and messes up a dual-screen setup).
> > > This patch gives the radeon driver the chance to examine the event and
> > > block the keypress if the event is an "AMD event".
> > > 
> > > Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
> > > ---
> > > Any comment from ACPI front?
> > > 
> > it looks good to me.
> > But I'm wondering if we can use the following code for ACPI part, which
> > looks cleaner.
> > I know this may change the behavior of other events, but in theory, we
> > should not send any input event if we know something wrong in kernel.
> > 
> > what do you think?
> 
> I like it, it's cleaner.
> I've split the patch in two pieces (one for video, the other for
> radeon) and adopted your suggestion.
> 
Great.
Acked-by: Zhang Rui <rui.zhang@intel.com>

hmm, who should take these two patches?
and which tree the second patch is based on?

thanks,
rui

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

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

* Re: [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events
  2012-08-03  1:40                         ` Zhang Rui
@ 2012-08-03  1:45                           ` Alex Deucher
  2012-08-03  2:06                             ` Zhang Rui
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Deucher @ 2012-08-03  1:45 UTC (permalink / raw)
  To: Zhang Rui
  Cc: Luca Tettamanti, airlied, dri-devel, Alex Deucher, joeyli,
	linux-acpi, Len Brown

On Thu, Aug 2, 2012 at 9:40 PM, Zhang Rui <rui.zhang@intel.com> wrote:
> On 四, 2012-08-02 at 15:46 +0200, Luca Tettamanti wrote:
>> On Thu, Aug 02, 2012 at 08:45:30AM +0800, Zhang Rui wrote:
>> > On 三, 2012-08-01 at 15:49 +0200, Luca Tettamanti wrote:
>> > > AMD ACPI interface may overload the standard event
>> > > ACPI_VIDEO_NOTIFY_PROBE (0x81) to signal AMD-specific events. In such
>> > > cases we don't want to send the keypress (KEY_SWITCHVIDEOMODE) to the
>> > > userspace because the user did not press the mode switch key (the
>> > > spurious keypress confuses the DE which usually changes the
>> > > display configuration and messes up a dual-screen setup).
>> > > This patch gives the radeon driver the chance to examine the event and
>> > > block the keypress if the event is an "AMD event".
>> > >
>> > > Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
>> > > ---
>> > > Any comment from ACPI front?
>> > >
>> > it looks good to me.
>> > But I'm wondering if we can use the following code for ACPI part, which
>> > looks cleaner.
>> > I know this may change the behavior of other events, but in theory, we
>> > should not send any input event if we know something wrong in kernel.
>> >
>> > what do you think?
>>
>> I like it, it's cleaner.
>> I've split the patch in two pieces (one for video, the other for
>> radeon) and adopted your suggestion.
>>
> Great.
> Acked-by: Zhang Rui <rui.zhang@intel.com>
>
> hmm, who should take these two patches?

I'm happy to take the patches.

> and which tree the second patch is based on?

I've got a tree with all the radeon ACPI patches on the acpi_patches
branches of my git tree:
git://people.freedesktop.org/~agd5f/linux

Alex

>
> thanks,
> rui
>
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events
  2012-08-03  1:45                           ` Alex Deucher
@ 2012-08-03  2:06                             ` Zhang Rui
  0 siblings, 0 replies; 8+ messages in thread
From: Zhang Rui @ 2012-08-03  2:06 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Luca Tettamanti, airlied, dri-devel, Alex Deucher, joeyli,
	linux-acpi, Len Brown

On 四, 2012-08-02 at 21:45 -0400, Alex Deucher wrote:
> On Thu, Aug 2, 2012 at 9:40 PM, Zhang Rui <rui.zhang@intel.com> wrote:
> > On 四, 2012-08-02 at 15:46 +0200, Luca Tettamanti wrote:
> >> On Thu, Aug 02, 2012 at 08:45:30AM +0800, Zhang Rui wrote:
> >> > On 三, 2012-08-01 at 15:49 +0200, Luca Tettamanti wrote:
> >> > > AMD ACPI interface may overload the standard event
> >> > > ACPI_VIDEO_NOTIFY_PROBE (0x81) to signal AMD-specific events. In such
> >> > > cases we don't want to send the keypress (KEY_SWITCHVIDEOMODE) to the
> >> > > userspace because the user did not press the mode switch key (the
> >> > > spurious keypress confuses the DE which usually changes the
> >> > > display configuration and messes up a dual-screen setup).
> >> > > This patch gives the radeon driver the chance to examine the event and
> >> > > block the keypress if the event is an "AMD event".
> >> > >
> >> > > Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
> >> > > ---
> >> > > Any comment from ACPI front?
> >> > >
> >> > it looks good to me.
> >> > But I'm wondering if we can use the following code for ACPI part, which
> >> > looks cleaner.
> >> > I know this may change the behavior of other events, but in theory, we
> >> > should not send any input event if we know something wrong in kernel.
> >> >
> >> > what do you think?
> >>
> >> I like it, it's cleaner.
> >> I've split the patch in two pieces (one for video, the other for
> >> radeon) and adopted your suggestion.
> >>
> > Great.
> > Acked-by: Zhang Rui <rui.zhang@intel.com>
> >
> > hmm, who should take these two patches?
> 
> I'm happy to take the patches.
> 
> > and which tree the second patch is based on?
> 
> I've got a tree with all the radeon ACPI patches on the acpi_patches
> branches of my git tree:
> git://people.freedesktop.org/~agd5f/linux
> 
great.

thanks,
rui

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

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

end of thread, other threads:[~2012-08-03  2:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20120728145626.GA6304@growl>
     [not found] ` <CADnq5_OjWoLS=GO_qYEBeTPvXrKJeJUjUCzOZS5w3erjHeFDqg@mail.gmail.com>
     [not found]   ` <20120729130644.GA12378@growl>
     [not found]     ` <CADnq5_OdKXsiVnFbkBNB2ue4df6tGaZ7bVMP+TvetFcy0faKog@mail.gmail.com>
     [not found]       ` <20120730202449.GA5600@growl>
     [not found]         ` <CADnq5_NP9Rw8DhmS+Q5G1PaUqcHQtVA6KoCGH5MME6DEd-Lw7Q@mail.gmail.com>
     [not found]           ` <CAKPcRGpL6JBx5MnWk6fFVOYCPQGeeDC-ytOwA+J+gEEZS+4SuA@mail.gmail.com>
     [not found]             ` <CADnq5_NN8OcmyKDemO=Mv0as-02sYEHxxbn2G4XtSmpzEsnR0w@mail.gmail.com>
     [not found]               ` <20120731200520.GA5425@growl>
     [not found]                 ` <CADnq5_Meh0nW90PZ=kAJdK=WjZKTdr7+5vN=vza+PzyJnEWKAA@mail.gmail.com>
2012-08-01 13:49                   ` [PATCH/RFC] drm/radeon: ACPI: veto the keypress on ATIF events Luca Tettamanti
2012-08-01 14:02                     ` Alex Deucher
2012-08-01 14:50                     ` joeyli
2012-08-02  0:45                     ` Zhang Rui
2012-08-02 13:46                       ` Luca Tettamanti
2012-08-03  1:40                         ` Zhang Rui
2012-08-03  1:45                           ` Alex Deucher
2012-08-03  2:06                             ` Zhang Rui

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).