aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c18
1 files changed, 13 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..7f0afc526419 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -31,6 +31,7 @@
31#include <drm/drm_crtc_helper.h> 31#include <drm/drm_crtc_helper.h>
32#include "amdgpu.h" 32#include "amdgpu.h"
33#include "amdgpu_pm.h" 33#include "amdgpu_pm.h"
34#include "amdgpu_display.h"
34#include "amd_acpi.h" 35#include "amd_acpi.h"
35#include "atom.h" 36#include "atom.h"
36 37
@@ -358,7 +359,9 @@ out:
358 * 359 *
359 * Checks the acpi event and if it matches an atif event, 360 * Checks the acpi event and if it matches an atif event,
360 * handles it. 361 * handles it.
361 * Returns NOTIFY code 362 *
363 * Returns:
364 * NOTIFY_BAD or NOTIFY_DONE, depending on the event.
362 */ 365 */
363static int amdgpu_atif_handler(struct amdgpu_device *adev, 366static int amdgpu_atif_handler(struct amdgpu_device *adev,
364 struct acpi_bus_event *event) 367 struct acpi_bus_event *event)
@@ -372,11 +375,16 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,
372 if (strcmp(event->device_class, ACPI_VIDEO_CLASS) != 0) 375 if (strcmp(event->device_class, ACPI_VIDEO_CLASS) != 0)
373 return NOTIFY_DONE; 376 return NOTIFY_DONE;
374 377
378 /* Is this actually our event? */
375 if (!atif || 379 if (!atif ||
376 !atif->notification_cfg.enabled || 380 !atif->notification_cfg.enabled ||
377 event->type != atif->notification_cfg.command_code) 381 event->type != atif->notification_cfg.command_code) {
378 /* Not our event */ 382 /* These events will generate keypresses otherwise */
379 return NOTIFY_DONE; 383 if (event->type == ACPI_VIDEO_NOTIFY_PROBE)
384 return NOTIFY_BAD;
385 else
386 return NOTIFY_DONE;
387 }
380 388
381 if (atif->functions.sbios_requests) { 389 if (atif->functions.sbios_requests) {
382 struct atif_sbios_requests req; 390 struct atif_sbios_requests req;
@@ -385,7 +393,7 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,
385 count = amdgpu_atif_get_sbios_requests(atif, &req); 393 count = amdgpu_atif_get_sbios_requests(atif, &req);
386 394
387 if (count <= 0) 395 if (count <= 0)
388 return NOTIFY_DONE; 396 return NOTIFY_BAD;
389 397
390 DRM_DEBUG_DRIVER("ATIF: %d pending SBIOS requests\n", count); 398 DRM_DEBUG_DRIVER("ATIF: %d pending SBIOS requests\n", count);
391 399