]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
Merge tag 'drm-misc-next-2018-11-21' of git://anongit.freedesktop.org/drm/drm-misc...
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_acpi.c
index 353993218f213ff6e3686edfc9444b3296ba31f9..7f0afc52641934c95e0a7765350ed0228b92d501 100644 (file)
@@ -31,6 +31,7 @@
 #include <drm/drm_crtc_helper.h>
 #include "amdgpu.h"
 #include "amdgpu_pm.h"
+#include "amdgpu_display.h"
 #include "amd_acpi.h"
 #include "atom.h"
 
@@ -358,7 +359,9 @@ out:
  *
  * 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 +375,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 +393,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);
 
This page took 0.034404 seconds and 4 git commands to generate.