From: Alex Deucher <alexdeucher@gmail.com>
To: Lyude <lyude@redhat.com>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>,
Dave Airlie <airlied@linux.ie>,
LKML <linux-kernel@vger.kernel.org>,
"for 3.8" <stable@vger.kernel.org>, "Qu, Jim" <Jim.Qu@amd.com>,
Maling list - DRI developers <dri-devel@lists.freedesktop.org>,
"Deucher, Alexander" <alexander.deucher@amd.com>,
Rex Zhu <Rex.Zhu@amd.com>,
Christian Koenig <christian.koenig@amd.com>
Subject: Re: [PATCH] drm/amdgpu: Suppress keypresses from ACPI_VIDEO events
Date: Wed, 10 Oct 2018 15:06:32 -0400 [thread overview]
Message-ID: <CADnq5_Ohjr2nnX=y2QeiUncVabADnJDdO+MZmT5ag+yCJL+cHA@mail.gmail.com> (raw)
In-Reply-To: <20180922004346.12288-1-lyude@redhat.com>
On Fri, Sep 21, 2018 at 8:44 PM Lyude Paul <lyude@redhat.com> wrote:
>
> Currently we return NOTIFY_DONE for any event which we don't think is
> ours. However, many laptops will send more then just an ATIF event and
> will also send an ACPI_VIDEO_NOTIFY_PROBE event as well. Since we don't
> check for this, we return NOTIFY_DONE which causes a keypress for the
> ACPI event to be propogated to userspace. This is the equivalent of
> someone pressing the display key on a laptop every time there's a
> hotplug event.
>
> So, check for ACPI_VIDEO_NOTIFY_PROBE events and suppress keypresses
> from them.
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Cc: stable@vger.kernel.org
Applied. Thanks! Sorry for the delay.
Alex
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 17 ++++++++++++-----
> 1 file changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 353993218f21..f008804f0b97 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -358,7 +358,9 @@ static int amdgpu_atif_get_sbios_requests(struct amdgpu_atif *atif,
> *
> * Checks the acpi event and if it matches an atif event,
> * handles it.
> - * Returns NOTIFY code
> + *
> + * Returns:
> + * NOTIFY_BAD or NOTIFY_DONE, depending on the event.
> */
> static int amdgpu_atif_handler(struct amdgpu_device *adev,
> struct acpi_bus_event *event)
> @@ -372,11 +374,16 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,
> if (strcmp(event->device_class, ACPI_VIDEO_CLASS) != 0)
> return NOTIFY_DONE;
>
> + /* Is this actually our event? */
> if (!atif ||
> !atif->notification_cfg.enabled ||
> - event->type != atif->notification_cfg.command_code)
> - /* Not our event */
> - return NOTIFY_DONE;
> + event->type != atif->notification_cfg.command_code) {
> + /* These events will generate keypresses otherwise */
> + if (event->type == ACPI_VIDEO_NOTIFY_PROBE)
> + return NOTIFY_BAD;
> + else
> + return NOTIFY_DONE;
> + }
>
> if (atif->functions.sbios_requests) {
> struct atif_sbios_requests req;
> @@ -385,7 +392,7 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,
> count = amdgpu_atif_get_sbios_requests(atif, &req);
>
> if (count <= 0)
> - return NOTIFY_DONE;
> + return NOTIFY_BAD;
>
> DRM_DEBUG_DRIVER("ATIF: %d pending SBIOS requests\n", count);
>
> --
> 2.17.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2018-10-10 19:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-22 0:43 [PATCH] drm/amdgpu: Suppress keypresses from ACPI_VIDEO events Lyude Paul
2018-10-10 19:06 ` Alex Deucher [this message]
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='CADnq5_Ohjr2nnX=y2QeiUncVabADnJDdO+MZmT5ag+yCJL+cHA@mail.gmail.com' \
--to=alexdeucher@gmail.com \
--cc=Jim.Qu@amd.com \
--cc=Rex.Zhu@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=stable@vger.kernel.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 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).