1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include <linux/pci.h>
25#include <linux/acpi.h>
26#include <linux/slab.h>
27#include <linux/power_supply.h>
28#include <linux/pm_runtime.h>
29#include <acpi/video.h>
30#include <acpi/actbl.h>
31
32#include <drm/drm_crtc_helper.h>
33#include "amdgpu.h"
34#include "amdgpu_pm.h"
35#include "amdgpu_display.h"
36#include "amd_acpi.h"
37#include "atom.h"
38
39struct amdgpu_atif_notification_cfg {
40 bool enabled;
41 int command_code;
42};
43
44struct amdgpu_atif_notifications {
45 bool thermal_state;
46 bool forced_power_state;
47 bool system_power_state;
48 bool brightness_change;
49 bool dgpu_display_event;
50 bool gpu_package_power_limit;
51};
52
53struct amdgpu_atif_functions {
54 bool system_params;
55 bool sbios_requests;
56 bool temperature_change;
57 bool query_backlight_transfer_characteristics;
58 bool ready_to_undock;
59 bool external_gpu_information;
60};
61
62struct amdgpu_atif {
63 acpi_handle handle;
64
65 struct amdgpu_atif_notifications notifications;
66 struct amdgpu_atif_functions functions;
67 struct amdgpu_atif_notification_cfg notification_cfg;
68#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
69 struct backlight_device *bd;
70#endif
71 struct amdgpu_dm_backlight_caps backlight_caps;
72};
73
74
75
76
77
78
79
80
81
82
83
84
85
86static union acpi_object *amdgpu_atif_call(struct amdgpu_atif *atif,
87 int function,
88 struct acpi_buffer *params)
89{
90 acpi_status status;
91 union acpi_object atif_arg_elements[2];
92 struct acpi_object_list atif_arg;
93 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
94
95 atif_arg.count = 2;
96 atif_arg.pointer = &atif_arg_elements[0];
97
98 atif_arg_elements[0].type = ACPI_TYPE_INTEGER;
99 atif_arg_elements[0].integer.value = function;
100
101 if (params) {
102 atif_arg_elements[1].type = ACPI_TYPE_BUFFER;
103 atif_arg_elements[1].buffer.length = params->length;
104 atif_arg_elements[1].buffer.pointer = params->pointer;
105 } else {
106
107 atif_arg_elements[1].type = ACPI_TYPE_INTEGER;
108 atif_arg_elements[1].integer.value = 0;
109 }
110
111 status = acpi_evaluate_object(atif->handle, NULL, &atif_arg,
112 &buffer);
113
114
115 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
116 DRM_DEBUG_DRIVER("failed to evaluate ATIF got %s\n",
117 acpi_format_exception(status));
118 kfree(buffer.pointer);
119 return NULL;
120 }
121
122 return buffer.pointer;
123}
124
125
126
127
128
129
130
131
132
133
134
135static void amdgpu_atif_parse_notification(struct amdgpu_atif_notifications *n, u32 mask)
136{
137 n->thermal_state = mask & ATIF_THERMAL_STATE_CHANGE_REQUEST_SUPPORTED;
138 n->forced_power_state = mask & ATIF_FORCED_POWER_STATE_CHANGE_REQUEST_SUPPORTED;
139 n->system_power_state = mask & ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST_SUPPORTED;
140 n->brightness_change = mask & ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST_SUPPORTED;
141 n->dgpu_display_event = mask & ATIF_DGPU_DISPLAY_EVENT_SUPPORTED;
142 n->gpu_package_power_limit = mask & ATIF_GPU_PACKAGE_POWER_LIMIT_REQUEST_SUPPORTED;
143}
144
145
146
147
148
149
150
151
152
153
154
155static void amdgpu_atif_parse_functions(struct amdgpu_atif_functions *f, u32 mask)
156{
157 f->system_params = mask & ATIF_GET_SYSTEM_PARAMETERS_SUPPORTED;
158 f->sbios_requests = mask & ATIF_GET_SYSTEM_BIOS_REQUESTS_SUPPORTED;
159 f->temperature_change = mask & ATIF_TEMPERATURE_CHANGE_NOTIFICATION_SUPPORTED;
160 f->query_backlight_transfer_characteristics =
161 mask & ATIF_QUERY_BACKLIGHT_TRANSFER_CHARACTERISTICS_SUPPORTED;
162 f->ready_to_undock = mask & ATIF_READY_TO_UNDOCK_NOTIFICATION_SUPPORTED;
163 f->external_gpu_information = mask & ATIF_GET_EXTERNAL_GPU_INFORMATION_SUPPORTED;
164}
165
166
167
168
169
170
171
172
173
174
175
176
177static int amdgpu_atif_verify_interface(struct amdgpu_atif *atif)
178{
179 union acpi_object *info;
180 struct atif_verify_interface output;
181 size_t size;
182 int err = 0;
183
184 info = amdgpu_atif_call(atif, ATIF_FUNCTION_VERIFY_INTERFACE, NULL);
185 if (!info)
186 return -EIO;
187
188 memset(&output, 0, sizeof(output));
189
190 size = *(u16 *) info->buffer.pointer;
191 if (size < 12) {
192 DRM_INFO("ATIF buffer is too small: %zu\n", size);
193 err = -EINVAL;
194 goto out;
195 }
196 size = min(sizeof(output), size);
197
198 memcpy(&output, info->buffer.pointer, size);
199
200
201 DRM_DEBUG_DRIVER("ATIF version %u\n", output.version);
202
203 amdgpu_atif_parse_notification(&atif->notifications, output.notification_mask);
204 amdgpu_atif_parse_functions(&atif->functions, output.function_bits);
205
206out:
207 kfree(info);
208 return err;
209}
210
211static acpi_handle amdgpu_atif_probe_handle(acpi_handle dhandle)
212{
213 acpi_handle handle = NULL;
214 char acpi_method_name[255] = { 0 };
215 struct acpi_buffer buffer = { sizeof(acpi_method_name), acpi_method_name };
216 acpi_status status;
217
218
219
220
221 status = acpi_get_handle(dhandle, "ATIF", &handle);
222 if (ACPI_SUCCESS(status))
223 goto out;
224
225 if (amdgpu_has_atpx()) {
226 status = acpi_get_handle(amdgpu_atpx_get_dhandle(), "ATIF",
227 &handle);
228 if (ACPI_SUCCESS(status))
229 goto out;
230 }
231
232 DRM_DEBUG_DRIVER("No ATIF handle found\n");
233 return NULL;
234out:
235 acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
236 DRM_DEBUG_DRIVER("Found ATIF handle %s\n", acpi_method_name);
237 return handle;
238}
239
240
241
242
243
244
245
246
247
248
249
250
251
252static int amdgpu_atif_get_notification_params(struct amdgpu_atif *atif)
253{
254 union acpi_object *info;
255 struct amdgpu_atif_notification_cfg *n = &atif->notification_cfg;
256 struct atif_system_params params;
257 size_t size;
258 int err = 0;
259
260 info = amdgpu_atif_call(atif, ATIF_FUNCTION_GET_SYSTEM_PARAMETERS,
261 NULL);
262 if (!info) {
263 err = -EIO;
264 goto out;
265 }
266
267 size = *(u16 *) info->buffer.pointer;
268 if (size < 10) {
269 err = -EINVAL;
270 goto out;
271 }
272
273 memset(¶ms, 0, sizeof(params));
274 size = min(sizeof(params), size);
275 memcpy(¶ms, info->buffer.pointer, size);
276
277 DRM_DEBUG_DRIVER("SYSTEM_PARAMS: mask = %#x, flags = %#x\n",
278 params.flags, params.valid_mask);
279 params.flags = params.flags & params.valid_mask;
280
281 if ((params.flags & ATIF_NOTIFY_MASK) == ATIF_NOTIFY_NONE) {
282 n->enabled = false;
283 n->command_code = 0;
284 } else if ((params.flags & ATIF_NOTIFY_MASK) == ATIF_NOTIFY_81) {
285 n->enabled = true;
286 n->command_code = 0x81;
287 } else {
288 if (size < 11) {
289 err = -EINVAL;
290 goto out;
291 }
292 n->enabled = true;
293 n->command_code = params.command_code;
294 }
295
296out:
297 DRM_DEBUG_DRIVER("Notification %s, command code = %#x\n",
298 (n->enabled ? "enabled" : "disabled"),
299 n->command_code);
300 kfree(info);
301 return err;
302}
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320static int amdgpu_atif_query_backlight_caps(struct amdgpu_atif *atif)
321{
322 union acpi_object *info;
323 struct atif_qbtc_output characteristics;
324 struct atif_qbtc_arguments arguments;
325 struct acpi_buffer params;
326 size_t size;
327 int err = 0;
328
329 arguments.size = sizeof(arguments);
330 arguments.requested_display = ATIF_QBTC_REQUEST_LCD1;
331
332 params.length = sizeof(arguments);
333 params.pointer = (void *)&arguments;
334
335 info = amdgpu_atif_call(atif,
336 ATIF_FUNCTION_QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS,
337 ¶ms);
338 if (!info) {
339 err = -EIO;
340 goto out;
341 }
342
343 size = *(u16 *) info->buffer.pointer;
344 if (size < 10) {
345 err = -EINVAL;
346 goto out;
347 }
348
349 memset(&characteristics, 0, sizeof(characteristics));
350 size = min(sizeof(characteristics), size);
351 memcpy(&characteristics, info->buffer.pointer, size);
352
353 atif->backlight_caps.caps_valid = true;
354 atif->backlight_caps.min_input_signal =
355 characteristics.min_input_signal;
356 atif->backlight_caps.max_input_signal =
357 characteristics.max_input_signal;
358out:
359 kfree(info);
360 return err;
361}
362
363
364
365
366
367
368
369
370
371
372
373
374static int amdgpu_atif_get_sbios_requests(struct amdgpu_atif *atif,
375 struct atif_sbios_requests *req)
376{
377 union acpi_object *info;
378 size_t size;
379 int count = 0;
380
381 info = amdgpu_atif_call(atif, ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS,
382 NULL);
383 if (!info)
384 return -EIO;
385
386 size = *(u16 *)info->buffer.pointer;
387 if (size < 0xd) {
388 count = -EINVAL;
389 goto out;
390 }
391 memset(req, 0, sizeof(*req));
392
393 size = min(sizeof(*req), size);
394 memcpy(req, info->buffer.pointer, size);
395 DRM_DEBUG_DRIVER("SBIOS pending requests: %#x\n", req->pending);
396
397 count = hweight32(req->pending);
398
399out:
400 kfree(info);
401 return count;
402}
403
404
405
406
407
408
409
410
411
412
413
414
415
416static int amdgpu_atif_handler(struct amdgpu_device *adev,
417 struct acpi_bus_event *event)
418{
419 struct amdgpu_atif *atif = adev->atif;
420 int count;
421
422 DRM_DEBUG_DRIVER("event, device_class = %s, type = %#x\n",
423 event->device_class, event->type);
424
425 if (strcmp(event->device_class, ACPI_VIDEO_CLASS) != 0)
426 return NOTIFY_DONE;
427
428
429 if (!atif ||
430 !atif->notification_cfg.enabled ||
431 event->type != atif->notification_cfg.command_code) {
432
433 if (event->type == ACPI_VIDEO_NOTIFY_PROBE)
434 return NOTIFY_BAD;
435 else
436 return NOTIFY_DONE;
437 }
438
439 if (atif->functions.sbios_requests) {
440 struct atif_sbios_requests req;
441
442
443 count = amdgpu_atif_get_sbios_requests(atif, &req);
444
445 if (count <= 0)
446 return NOTIFY_BAD;
447
448 DRM_DEBUG_DRIVER("ATIF: %d pending SBIOS requests\n", count);
449
450 if (req.pending & ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST) {
451#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
452 if (atif->bd) {
453 DRM_DEBUG_DRIVER("Changing brightness to %d\n",
454 req.backlight_level);
455
456
457
458
459
460 backlight_device_set_brightness(atif->bd, req.backlight_level);
461 }
462#endif
463 }
464
465 if (req.pending & ATIF_DGPU_DISPLAY_EVENT) {
466 if (adev->flags & AMD_IS_PX) {
467 pm_runtime_get_sync(adev_to_drm(adev)->dev);
468
469 drm_helper_hpd_irq_event(adev_to_drm(adev));
470 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
471 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
472 }
473 }
474
475 }
476
477
478
479
480
481
482 return NOTIFY_BAD;
483}
484
485
486
487
488
489
490
491
492
493
494
495
496
497static union acpi_object *amdgpu_atcs_call(acpi_handle handle, int function,
498 struct acpi_buffer *params)
499{
500 acpi_status status;
501 union acpi_object atcs_arg_elements[2];
502 struct acpi_object_list atcs_arg;
503 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
504
505 atcs_arg.count = 2;
506 atcs_arg.pointer = &atcs_arg_elements[0];
507
508 atcs_arg_elements[0].type = ACPI_TYPE_INTEGER;
509 atcs_arg_elements[0].integer.value = function;
510
511 if (params) {
512 atcs_arg_elements[1].type = ACPI_TYPE_BUFFER;
513 atcs_arg_elements[1].buffer.length = params->length;
514 atcs_arg_elements[1].buffer.pointer = params->pointer;
515 } else {
516
517 atcs_arg_elements[1].type = ACPI_TYPE_INTEGER;
518 atcs_arg_elements[1].integer.value = 0;
519 }
520
521 status = acpi_evaluate_object(handle, "ATCS", &atcs_arg, &buffer);
522
523
524 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
525 DRM_DEBUG_DRIVER("failed to evaluate ATCS got %s\n",
526 acpi_format_exception(status));
527 kfree(buffer.pointer);
528 return NULL;
529 }
530
531 return buffer.pointer;
532}
533
534
535
536
537
538
539
540
541
542
543
544static void amdgpu_atcs_parse_functions(struct amdgpu_atcs_functions *f, u32 mask)
545{
546 f->get_ext_state = mask & ATCS_GET_EXTERNAL_STATE_SUPPORTED;
547 f->pcie_perf_req = mask & ATCS_PCIE_PERFORMANCE_REQUEST_SUPPORTED;
548 f->pcie_dev_rdy = mask & ATCS_PCIE_DEVICE_READY_NOTIFICATION_SUPPORTED;
549 f->pcie_bus_width = mask & ATCS_SET_PCIE_BUS_WIDTH_SUPPORTED;
550}
551
552
553
554
555
556
557
558
559
560
561
562
563static int amdgpu_atcs_verify_interface(acpi_handle handle,
564 struct amdgpu_atcs *atcs)
565{
566 union acpi_object *info;
567 struct atcs_verify_interface output;
568 size_t size;
569 int err = 0;
570
571 info = amdgpu_atcs_call(handle, ATCS_FUNCTION_VERIFY_INTERFACE, NULL);
572 if (!info)
573 return -EIO;
574
575 memset(&output, 0, sizeof(output));
576
577 size = *(u16 *) info->buffer.pointer;
578 if (size < 8) {
579 DRM_INFO("ATCS buffer is too small: %zu\n", size);
580 err = -EINVAL;
581 goto out;
582 }
583 size = min(sizeof(output), size);
584
585 memcpy(&output, info->buffer.pointer, size);
586
587
588 DRM_DEBUG_DRIVER("ATCS version %u\n", output.version);
589
590 amdgpu_atcs_parse_functions(&atcs->functions, output.function_bits);
591
592out:
593 kfree(info);
594 return err;
595}
596
597
598
599
600
601
602
603
604
605
606bool amdgpu_acpi_is_pcie_performance_request_supported(struct amdgpu_device *adev)
607{
608 struct amdgpu_atcs *atcs = &adev->atcs;
609
610 if (atcs->functions.pcie_perf_req && atcs->functions.pcie_dev_rdy)
611 return true;
612
613 return false;
614}
615
616
617
618
619
620
621
622
623
624
625int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev)
626{
627 acpi_handle handle;
628 union acpi_object *info;
629 struct amdgpu_atcs *atcs = &adev->atcs;
630
631
632 handle = ACPI_HANDLE(&adev->pdev->dev);
633 if (!handle)
634 return -EINVAL;
635
636 if (!atcs->functions.pcie_dev_rdy)
637 return -EINVAL;
638
639 info = amdgpu_atcs_call(handle, ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION, NULL);
640 if (!info)
641 return -EIO;
642
643 kfree(info);
644
645 return 0;
646}
647
648
649
650
651
652
653
654
655
656
657
658
659int amdgpu_acpi_pcie_performance_request(struct amdgpu_device *adev,
660 u8 perf_req, bool advertise)
661{
662 acpi_handle handle;
663 union acpi_object *info;
664 struct amdgpu_atcs *atcs = &adev->atcs;
665 struct atcs_pref_req_input atcs_input;
666 struct atcs_pref_req_output atcs_output;
667 struct acpi_buffer params;
668 size_t size;
669 u32 retry = 3;
670
671 if (amdgpu_acpi_pcie_notify_device_ready(adev))
672 return -EINVAL;
673
674
675 handle = ACPI_HANDLE(&adev->pdev->dev);
676 if (!handle)
677 return -EINVAL;
678
679 if (!atcs->functions.pcie_perf_req)
680 return -EINVAL;
681
682 atcs_input.size = sizeof(struct atcs_pref_req_input);
683
684 atcs_input.client_id = adev->pdev->devfn | (adev->pdev->bus->number << 8);
685 atcs_input.valid_flags_mask = ATCS_VALID_FLAGS_MASK;
686 atcs_input.flags = ATCS_WAIT_FOR_COMPLETION;
687 if (advertise)
688 atcs_input.flags |= ATCS_ADVERTISE_CAPS;
689 atcs_input.req_type = ATCS_PCIE_LINK_SPEED;
690 atcs_input.perf_req = perf_req;
691
692 params.length = sizeof(struct atcs_pref_req_input);
693 params.pointer = &atcs_input;
694
695 while (retry--) {
696 info = amdgpu_atcs_call(handle, ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST, ¶ms);
697 if (!info)
698 return -EIO;
699
700 memset(&atcs_output, 0, sizeof(atcs_output));
701
702 size = *(u16 *) info->buffer.pointer;
703 if (size < 3) {
704 DRM_INFO("ATCS buffer is too small: %zu\n", size);
705 kfree(info);
706 return -EINVAL;
707 }
708 size = min(sizeof(atcs_output), size);
709
710 memcpy(&atcs_output, info->buffer.pointer, size);
711
712 kfree(info);
713
714 switch (atcs_output.ret_val) {
715 case ATCS_REQUEST_REFUSED:
716 default:
717 return -EINVAL;
718 case ATCS_REQUEST_COMPLETE:
719 return 0;
720 case ATCS_REQUEST_IN_PROGRESS:
721 udelay(10);
722 break;
723 }
724 }
725
726 return 0;
727}
728
729
730
731
732
733
734
735
736
737
738
739
740static int amdgpu_acpi_event(struct notifier_block *nb,
741 unsigned long val,
742 void *data)
743{
744 struct amdgpu_device *adev = container_of(nb, struct amdgpu_device, acpi_nb);
745 struct acpi_bus_event *entry = (struct acpi_bus_event *)data;
746
747 if (strcmp(entry->device_class, ACPI_AC_CLASS) == 0) {
748 if (power_supply_is_system_supplied() > 0)
749 DRM_DEBUG_DRIVER("pm: AC\n");
750 else
751 DRM_DEBUG_DRIVER("pm: DC\n");
752
753 amdgpu_pm_acpi_event_handler(adev);
754 }
755
756
757 return amdgpu_atif_handler(adev, entry);
758}
759
760
761
762
763
764
765
766
767
768
769
770int amdgpu_acpi_init(struct amdgpu_device *adev)
771{
772 acpi_handle handle, atif_handle;
773 struct amdgpu_atif *atif;
774 struct amdgpu_atcs *atcs = &adev->atcs;
775 int ret;
776
777
778 handle = ACPI_HANDLE(&adev->pdev->dev);
779
780 if (!adev->bios || !handle)
781 return 0;
782
783
784 ret = amdgpu_atcs_verify_interface(handle, atcs);
785 if (ret) {
786 DRM_DEBUG_DRIVER("Call to ATCS verify_interface failed: %d\n", ret);
787 }
788
789
790 atif_handle = amdgpu_atif_probe_handle(handle);
791 if (!atif_handle)
792 goto out;
793
794 atif = kzalloc(sizeof(*atif), GFP_KERNEL);
795 if (!atif) {
796 DRM_WARN("Not enough memory to initialize ATIF\n");
797 goto out;
798 }
799 atif->handle = atif_handle;
800
801
802 ret = amdgpu_atif_verify_interface(atif);
803 if (ret) {
804 DRM_DEBUG_DRIVER("Call to ATIF verify_interface failed: %d\n", ret);
805 kfree(atif);
806 goto out;
807 }
808 adev->atif = atif;
809
810#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
811 if (atif->notifications.brightness_change) {
812 if (amdgpu_device_has_dc_support(adev)) {
813#if defined(CONFIG_DRM_AMD_DC)
814 struct amdgpu_display_manager *dm = &adev->dm;
815 atif->bd = dm->backlight_dev;
816#endif
817 } else {
818 struct drm_encoder *tmp;
819
820
821 list_for_each_entry(tmp, &adev_to_drm(adev)->mode_config.encoder_list,
822 head) {
823 struct amdgpu_encoder *enc = to_amdgpu_encoder(tmp);
824
825 if ((enc->devices & (ATOM_DEVICE_LCD_SUPPORT)) &&
826 enc->enc_priv) {
827 struct amdgpu_encoder_atom_dig *dig = enc->enc_priv;
828 if (dig->bl_dev) {
829 atif->bd = dig->bl_dev;
830 break;
831 }
832 }
833 }
834 }
835 }
836#endif
837
838 if (atif->functions.sbios_requests && !atif->functions.system_params) {
839
840
841
842
843 atif->functions.system_params = true;
844 }
845
846 if (atif->functions.system_params) {
847 ret = amdgpu_atif_get_notification_params(atif);
848 if (ret) {
849 DRM_DEBUG_DRIVER("Call to GET_SYSTEM_PARAMS failed: %d\n",
850 ret);
851
852 atif->notification_cfg.enabled = false;
853 }
854 }
855
856 if (atif->functions.query_backlight_transfer_characteristics) {
857 ret = amdgpu_atif_query_backlight_caps(atif);
858 if (ret) {
859 DRM_DEBUG_DRIVER("Call to QUERY_BACKLIGHT_TRANSFER_CHARACTERISTICS failed: %d\n",
860 ret);
861 atif->backlight_caps.caps_valid = false;
862 }
863 } else {
864 atif->backlight_caps.caps_valid = false;
865 }
866
867out:
868 adev->acpi_nb.notifier_call = amdgpu_acpi_event;
869 register_acpi_notifier(&adev->acpi_nb);
870
871 return ret;
872}
873
874void amdgpu_acpi_get_backlight_caps(struct amdgpu_device *adev,
875 struct amdgpu_dm_backlight_caps *caps)
876{
877 if (!adev->atif) {
878 caps->caps_valid = false;
879 return;
880 }
881 caps->caps_valid = adev->atif->backlight_caps.caps_valid;
882 caps->min_input_signal = adev->atif->backlight_caps.min_input_signal;
883 caps->max_input_signal = adev->atif->backlight_caps.max_input_signal;
884}
885
886
887
888
889
890
891
892
893void amdgpu_acpi_fini(struct amdgpu_device *adev)
894{
895 unregister_acpi_notifier(&adev->acpi_nb);
896 kfree(adev->atif);
897}
898
899
900
901
902
903
904bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device *adev)
905{
906 if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
907 if (adev->flags & AMD_IS_APU)
908 return true;
909 }
910
911 return false;
912}
913