Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: mv some definition from amdgpu_acpi.c to amdgpu_acpi.h

These will be shared with the new powerplay module.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Rex Zhu and committed by
Alex Deucher
7e85be99 3a2c788d

+53 -60
-56
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
··· 32 32 #include "amdgpu_acpi.h" 33 33 #include "atom.h" 34 34 35 - #define ACPI_AC_CLASS "ac_adapter" 36 - 37 35 extern void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev); 38 - 39 - struct atif_verify_interface { 40 - u16 size; /* structure size in bytes (includes size field) */ 41 - u16 version; /* version */ 42 - u32 notification_mask; /* supported notifications mask */ 43 - u32 function_bits; /* supported functions bit vector */ 44 - } __packed; 45 - 46 - struct atif_system_params { 47 - u16 size; /* structure size in bytes (includes size field) */ 48 - u32 valid_mask; /* valid flags mask */ 49 - u32 flags; /* flags */ 50 - u8 command_code; /* notify command code */ 51 - } __packed; 52 - 53 - struct atif_sbios_requests { 54 - u16 size; /* structure size in bytes (includes size field) */ 55 - u32 pending; /* pending sbios requests */ 56 - u8 panel_exp_mode; /* panel expansion mode */ 57 - u8 thermal_gfx; /* thermal state: target gfx controller */ 58 - u8 thermal_state; /* thermal state: state id (0: exit state, non-0: state) */ 59 - u8 forced_power_gfx; /* forced power state: target gfx controller */ 60 - u8 forced_power_state; /* forced power state: state id */ 61 - u8 system_power_src; /* system power source */ 62 - u8 backlight_level; /* panel backlight level (0-255) */ 63 - } __packed; 64 - 65 - #define ATIF_NOTIFY_MASK 0x3 66 - #define ATIF_NOTIFY_NONE 0 67 - #define ATIF_NOTIFY_81 1 68 - #define ATIF_NOTIFY_N 2 69 - 70 - struct atcs_verify_interface { 71 - u16 size; /* structure size in bytes (includes size field) */ 72 - u16 version; /* version */ 73 - u32 function_bits; /* supported functions bit vector */ 74 - } __packed; 75 - 76 - #define ATCS_VALID_FLAGS_MASK 0x3 77 - 78 - struct atcs_pref_req_input { 79 - u16 size; /* structure size in bytes (includes size field) */ 80 - u16 client_id; /* client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num) */ 81 - u16 valid_flags_mask; /* valid flags mask */ 82 - u16 flags; /* flags */ 83 - u8 req_type; /* request type */ 84 - u8 perf_req; /* performance request */ 85 - } __packed; 86 - 87 - struct atcs_pref_req_output { 88 - u16 size; /* structure size in bytes (includes size field) */ 89 - u8 ret_val; /* return value */ 90 - } __packed; 91 - 92 36 /* Call the ATIF method 93 37 */ 94 38 /**
+53 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.h
··· 24 24 #ifndef AMDGPU_ACPI_H 25 25 #define AMDGPU_ACPI_H 26 26 27 - struct amdgpu_device; 28 - struct acpi_bus_event; 27 + #define ACPI_AC_CLASS "ac_adapter" 29 28 30 - int amdgpu_atif_handler(struct amdgpu_device *adev, 31 - struct acpi_bus_event *event); 29 + struct atif_verify_interface { 30 + u16 size; /* structure size in bytes (includes size field) */ 31 + u16 version; /* version */ 32 + u32 notification_mask; /* supported notifications mask */ 33 + u32 function_bits; /* supported functions bit vector */ 34 + } __packed; 35 + 36 + struct atif_system_params { 37 + u16 size; /* structure size in bytes (includes size field) */ 38 + u32 valid_mask; /* valid flags mask */ 39 + u32 flags; /* flags */ 40 + u8 command_code; /* notify command code */ 41 + } __packed; 42 + 43 + struct atif_sbios_requests { 44 + u16 size; /* structure size in bytes (includes size field) */ 45 + u32 pending; /* pending sbios requests */ 46 + u8 panel_exp_mode; /* panel expansion mode */ 47 + u8 thermal_gfx; /* thermal state: target gfx controller */ 48 + u8 thermal_state; /* thermal state: state id (0: exit state, non-0: state) */ 49 + u8 forced_power_gfx; /* forced power state: target gfx controller */ 50 + u8 forced_power_state; /* forced power state: state id */ 51 + u8 system_power_src; /* system power source */ 52 + u8 backlight_level; /* panel backlight level (0-255) */ 53 + } __packed; 54 + 55 + #define ATIF_NOTIFY_MASK 0x3 56 + #define ATIF_NOTIFY_NONE 0 57 + #define ATIF_NOTIFY_81 1 58 + #define ATIF_NOTIFY_N 2 59 + 60 + struct atcs_verify_interface { 61 + u16 size; /* structure size in bytes (includes size field) */ 62 + u16 version; /* version */ 63 + u32 function_bits; /* supported functions bit vector */ 64 + } __packed; 65 + 66 + #define ATCS_VALID_FLAGS_MASK 0x3 67 + 68 + struct atcs_pref_req_input { 69 + u16 size; /* structure size in bytes (includes size field) */ 70 + u16 client_id; /* client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num) */ 71 + u16 valid_flags_mask; /* valid flags mask */ 72 + u16 flags; /* flags */ 73 + u8 req_type; /* request type */ 74 + u8 perf_req; /* performance request */ 75 + } __packed; 76 + 77 + struct atcs_pref_req_output { 78 + u16 size; /* structure size in bytes (includes size field) */ 79 + u8 ret_val; /* return value */ 80 + } __packed; 32 81 33 82 /* AMD hw uses four ACPI control methods: 34 83 * 1. ATIF