diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-11-21 11:33:10 +0100 | 
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-11-21 14:17:56 +0100 | 
| commit | 70c5f93669249886b151812076509f30569aff80 (patch) | |
| tree | 05dce785f3a70e022b91016c87e4092f143a2fef /drivers/gpu/drm/amd/include | |
| parent | c83ecfa5851f4d35be88f32dabb3a53f51cf5c32 (diff) | |
| parent | f150891fd9878ef0d9197c4e8451ce67c3bdd014 (diff) | |
Merge airlied/drm-next into drm-misc-next
Bake in the conflict between the drm_print.h extraction and the
addition of DRM_DEBUG_LEASES since we lost it a few too many times.
Also fix a new use of drm_plane_helper_check_state in msm to follow
Ville's conversion in
commit a01cb8ba3f6282934cff65e89ab36b18b14cbe27
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Wed Nov 1 22:16:19 2017 +0200
    drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/amd/include')
| -rw-r--r-- | drivers/gpu/drm/amd/include/amd_shared.h | 109 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/include/asic_reg/uvd/uvd_6_0_d.h | 15 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/include/atombios.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/include/cgs_common.h | 8 | 
4 files changed, 83 insertions, 50 deletions
| diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h index 20457bb5a906..b72f8a43d86b 100644 --- a/drivers/gpu/drm/amd/include/amd_shared.h +++ b/drivers/gpu/drm/amd/include/amd_shared.h @@ -23,36 +23,11 @@  #ifndef __AMD_SHARED_H__  #define __AMD_SHARED_H__ -#define AMD_MAX_USEC_TIMEOUT		200000  /* 200 ms */ +#include <drm/amd_asic_type.h>  struct seq_file; -/* - * Supported ASIC types - */ -enum amd_asic_type { -	CHIP_TAHITI = 0, -	CHIP_PITCAIRN, -	CHIP_VERDE, -	CHIP_OLAND, -	CHIP_HAINAN, -	CHIP_BONAIRE, -	CHIP_KAVERI, -	CHIP_KABINI, -	CHIP_HAWAII, -	CHIP_MULLINS, -	CHIP_TOPAZ, -	CHIP_TONGA, -	CHIP_FIJI, -	CHIP_CARRIZO, -	CHIP_STONEY, -	CHIP_POLARIS10, -	CHIP_POLARIS11, -	CHIP_POLARIS12, -	CHIP_VEGA10, -	CHIP_RAVEN, -	CHIP_LAST, -}; +#define AMD_MAX_USEC_TIMEOUT		200000  /* 200 ms */  /*   * Chip flags @@ -257,43 +232,54 @@ struct amd_ip_funcs {  	void (*get_clockgating_state)(void *handle, u32 *flags);  }; -enum amd_pp_task; +enum amd_pp_task; +enum amd_pp_clock_type;  struct pp_states_info; +struct amd_pp_simple_clock_info; +struct amd_pp_display_configuration; +struct amd_pp_clock_info; +struct pp_display_clock_request; +struct pp_wm_sets_with_clock_ranges_soc15; +struct pp_clock_levels_with_voltage; +struct pp_clock_levels_with_latency; +struct amd_pp_clocks;  struct amd_pm_funcs { -	int (*get_temperature)(void *handle); +/* export for dpm on ci and si */  	int (*pre_set_power_state)(void *handle);  	int (*set_power_state)(void *handle);  	void (*post_set_power_state)(void *handle);  	void (*display_configuration_changed)(void *handle); -	u32 (*get_sclk)(void *handle, bool low); -	u32 (*get_mclk)(void *handle, bool low);  	void (*print_power_state)(void *handle, void *ps); -	void (*debugfs_print_current_performance_level)(void *handle, struct seq_file *m); -	int (*force_performance_level)(void *handle, enum amd_dpm_forced_level level);  	bool (*vblank_too_short)(void *handle); -	void (*powergate_uvd)(void *handle, bool gate); -	void (*powergate_vce)(void *handle, bool gate);  	void (*enable_bapm)(void *handle, bool enable); +	int (*check_state_equal)(void *handle, +				void  *cps, +				void  *rps, +				bool  *equal); +/* export for sysfs */ +	int (*get_temperature)(void *handle);  	void (*set_fan_control_mode)(void *handle, u32 mode);  	u32 (*get_fan_control_mode)(void *handle);  	int (*set_fan_speed_percent)(void *handle, u32 speed);  	int (*get_fan_speed_percent)(void *handle, u32 *speed);  	int (*force_clock_level)(void *handle, enum pp_clock_type type, uint32_t mask);  	int (*print_clock_levels)(void *handle, enum pp_clock_type type, char *buf); +	int (*force_performance_level)(void *handle, enum amd_dpm_forced_level level);  	int (*get_sclk_od)(void *handle);  	int (*set_sclk_od)(void *handle, uint32_t value);  	int (*get_mclk_od)(void *handle);  	int (*set_mclk_od)(void *handle, uint32_t value); -	int (*check_state_equal)(void *handle, -				void  *cps, -				void  *rps, -				bool  *equal); -	int (*read_sensor)(void *handle, int idx, void *value, -			   int *size); +	int (*read_sensor)(void *handle, int idx, void *value, int *size); +	enum amd_dpm_forced_level (*get_performance_level)(void *handle); +	enum amd_pm_state_type (*get_current_power_state)(void *handle); +	int (*get_fan_speed_rpm)(void *handle, uint32_t *rpm); +	int (*get_pp_num_states)(void *handle, struct pp_states_info *data); +	int (*get_pp_table)(void *handle, char **table); +	int (*set_pp_table)(void *handle, const char *buf, size_t size); +	void (*debugfs_print_current_performance_level)(void *handle, struct seq_file *m); -	struct amd_vce_state* (*get_vce_clock_state)(void *handle, u32 idx);  	int (*reset_power_profile_state)(void *handle,  			struct amd_pp_profile *request);  	int (*get_power_profile_state)(void *handle, @@ -302,16 +288,39 @@ struct amd_pm_funcs {  			struct amd_pp_profile *request);  	int (*switch_power_profile)(void *handle,  			enum amd_pp_profile_type type); -	int (*load_firmware)(void *handle); -	int (*wait_for_fw_loading_complete)(void *handle); -	enum amd_dpm_forced_level (*get_performance_level)(void *handle); -	enum amd_pm_state_type (*get_current_power_state)(void *handle); +/* export to amdgpu */ +	void (*powergate_uvd)(void *handle, bool gate); +	void (*powergate_vce)(void *handle, bool gate); +	struct amd_vce_state* (*get_vce_clock_state)(void *handle, u32 idx);  	int (*dispatch_tasks)(void *handle, enum amd_pp_task task_id,  				   void *input, void *output); -	int (*get_fan_speed_rpm)(void *handle, uint32_t *rpm); -	int (*get_pp_num_states)(void *handle, struct pp_states_info *data); -	int (*get_pp_table)(void *handle, char **table); -	int (*set_pp_table)(void *handle, const char *buf, size_t size); +	int (*load_firmware)(void *handle); +	int (*wait_for_fw_loading_complete)(void *handle); +	int (*set_clockgating_by_smu)(void *handle, uint32_t msg_id); +/* export to DC */ +	u32 (*get_sclk)(void *handle, bool low); +	u32 (*get_mclk)(void *handle, bool low); +	int (*display_configuration_change)(void *handle, +		const struct amd_pp_display_configuration *input); +	int (*get_display_power_level)(void *handle, +		struct amd_pp_simple_clock_info *output); +	int (*get_current_clocks)(void *handle, +		struct amd_pp_clock_info *clocks); +	int (*get_clock_by_type)(void *handle, +		enum amd_pp_clock_type type, +		struct amd_pp_clocks *clocks); +	int (*get_clock_by_type_with_latency)(void *handle, +		enum amd_pp_clock_type type, +		struct pp_clock_levels_with_latency *clocks); +	int (*get_clock_by_type_with_voltage)(void *handle, +		enum amd_pp_clock_type type, +		struct pp_clock_levels_with_voltage *clocks); +	int (*set_watermarks_for_clocks_ranges)(void *handle, +		struct pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges); +	int (*display_clock_voltage_request)(void *handle, +		struct pp_display_clock_request *clock); +	int (*get_display_mode_validation_clocks)(void *handle, +		struct amd_pp_simple_clock_info *clocks);  }; diff --git a/drivers/gpu/drm/amd/include/asic_reg/uvd/uvd_6_0_d.h b/drivers/gpu/drm/amd/include/asic_reg/uvd/uvd_6_0_d.h index 378f4b6b43da..344237256d02 100644 --- a/drivers/gpu/drm/amd/include/asic_reg/uvd/uvd_6_0_d.h +++ b/drivers/gpu/drm/amd/include/asic_reg/uvd/uvd_6_0_d.h @@ -36,6 +36,16 @@  #define mmUVD_UDEC_DBW_ADDR_CONFIG                                              0x3bd5  #define mmUVD_POWER_STATUS_U                                                    0x3bfd  #define mmUVD_NO_OP                                                             0x3bff +#define mmUVD_RB_BASE_LO2                                                       0x3c21 +#define mmUVD_RB_BASE_HI2                                                       0x3c22 +#define mmUVD_RB_SIZE2                                                          0x3c23 +#define mmUVD_RB_RPTR2                                                          0x3c24 +#define mmUVD_RB_WPTR2                                                          0x3c25 +#define mmUVD_RB_BASE_LO                                                        0x3c26 +#define mmUVD_RB_BASE_HI                                                        0x3c27 +#define mmUVD_RB_SIZE                                                           0x3c28 +#define mmUVD_RB_RPTR                                                           0x3c29 +#define mmUVD_RB_WPTR                                                           0x3c2a  #define mmUVD_LMI_RBC_RB_64BIT_BAR_LOW                                          0x3c69  #define mmUVD_LMI_RBC_RB_64BIT_BAR_HIGH                                         0x3c68  #define mmUVD_LMI_RBC_IB_64BIT_BAR_LOW                                          0x3c67 @@ -43,6 +53,11 @@  #define mmUVD_LMI_VCPU_CACHE_64BIT_BAR_LOW                                      0x3c5f  #define mmUVD_LMI_VCPU_CACHE_64BIT_BAR_HIGH                                     0x3c5e  #define mmUVD_SEMA_CNTL                                                         0x3d00 +#define mmUVD_RB_WPTR3                                                          0x3d1c +#define mmUVD_RB_RPTR3                                                          0x3d1b +#define mmUVD_RB_BASE_LO3                                                       0x3d1d +#define mmUVD_RB_BASE_HI3                                                       0x3d1e +#define mmUVD_RB_SIZE3                                                          0x3d1f  #define mmUVD_LMI_EXT40_ADDR                                                    0x3d26  #define mmUVD_CTX_INDEX                                                         0x3d28  #define mmUVD_CTX_DATA                                                          0x3d29 diff --git a/drivers/gpu/drm/amd/include/atombios.h b/drivers/gpu/drm/amd/include/atombios.h index 181a2c3c6362..f696bbb643ef 100644 --- a/drivers/gpu/drm/amd/include/atombios.h +++ b/drivers/gpu/drm/amd/include/atombios.h @@ -4292,6 +4292,7 @@ typedef struct _ATOM_DPCD_INFO  #define ATOM_VRAM_OPERATION_FLAGS_SHIFT        30  #define   ATOM_VRAM_BLOCK_NEEDS_NO_RESERVATION   0x1  #define   ATOM_VRAM_BLOCK_NEEDS_RESERVATION      0x0 +#define   ATOM_VRAM_BLOCK_SRIOV_MSG_SHARE_RESERVATION 0x2  /***********************************************************************************/  // Structure used in VRAM_UsageByFirmwareTable diff --git a/drivers/gpu/drm/amd/include/cgs_common.h b/drivers/gpu/drm/amd/include/cgs_common.h index 030b14649c4e..675988d56392 100644 --- a/drivers/gpu/drm/amd/include/cgs_common.h +++ b/drivers/gpu/drm/amd/include/cgs_common.h @@ -423,6 +423,10 @@ typedef int (*cgs_enter_safe_mode)(struct cgs_device *cgs_device, bool en);  typedef void (*cgs_lock_grbm_idx)(struct cgs_device *cgs_device, bool lock); +struct amd_pp_init; +typedef void* (*cgs_register_pp_handle)(struct cgs_device *cgs_device, +			int (*call_back_func)(struct amd_pp_init *, void **)); +  struct cgs_ops {  	/* memory management calls (similar to KFD interface) */  	cgs_alloc_gpu_mem_t alloc_gpu_mem; @@ -459,6 +463,7 @@ struct cgs_ops {  	cgs_is_virtualization_enabled_t is_virtualization_enabled;  	cgs_enter_safe_mode enter_safe_mode;  	cgs_lock_grbm_idx lock_grbm_idx; +	cgs_register_pp_handle register_pp_handle;  };  struct cgs_os_ops; /* To be define in OS-specific CGS header */ @@ -537,4 +542,7 @@ struct cgs_device  #define cgs_lock_grbm_idx(cgs_device, lock) \  		CGS_CALL(lock_grbm_idx, cgs_device, lock) +#define cgs_register_pp_handle(cgs_device, call_back_func) \ +		CGS_CALL(register_pp_handle, cgs_device, call_back_func) +  #endif /* _CGS_COMMON_H */ | 
