Commit b8c9fd5a authored by Alex Deucher's avatar Alex Deucher

drm/radeon/atpx: track whether if this is a hybrid graphics platform

hybrid graphics in this case refers to systems which use the new
platform d3 cold ACPI methods as opposed to ATPX for dGPU power
control.
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 522761cb
...@@ -28,6 +28,7 @@ struct radeon_atpx_functions { ...@@ -28,6 +28,7 @@ struct radeon_atpx_functions {
struct radeon_atpx { struct radeon_atpx {
acpi_handle handle; acpi_handle handle;
struct radeon_atpx_functions functions; struct radeon_atpx_functions functions;
bool is_hybrid;
}; };
static struct radeon_atpx_priv { static struct radeon_atpx_priv {
...@@ -67,6 +68,10 @@ bool radeon_has_atpx_dgpu_power_cntl(void) { ...@@ -67,6 +68,10 @@ bool radeon_has_atpx_dgpu_power_cntl(void) {
return radeon_atpx_priv.atpx.functions.power_cntl; return radeon_atpx_priv.atpx.functions.power_cntl;
} }
bool radeon_is_atpx_hybrid(void) {
return radeon_atpx_priv.atpx.is_hybrid;
}
/** /**
* radeon_atpx_call - call an ATPX method * radeon_atpx_call - call an ATPX method
* *
...@@ -190,9 +195,11 @@ static int radeon_atpx_validate(struct radeon_atpx *atpx) ...@@ -190,9 +195,11 @@ static int radeon_atpx_validate(struct radeon_atpx *atpx)
ATPX_DYNAMIC_DGPU_POWER_OFF_SUPPORTED)) ATPX_DYNAMIC_DGPU_POWER_OFF_SUPPORTED))
atpx->functions.power_cntl = true; atpx->functions.power_cntl = true;
atpx->is_hybrid = false;
if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) {
printk("Hybrid Graphics, ATPX dGPU power cntl disabled\n"); printk("ATPX Hybrid Graphics\n");
atpx->functions.power_cntl = false; atpx->functions.power_cntl = false;
atpx->is_hybrid = true;
} }
return 0; return 0;
......
...@@ -164,10 +164,12 @@ void radeon_debugfs_cleanup(struct drm_minor *minor); ...@@ -164,10 +164,12 @@ void radeon_debugfs_cleanup(struct drm_minor *minor);
void radeon_register_atpx_handler(void); void radeon_register_atpx_handler(void);
void radeon_unregister_atpx_handler(void); void radeon_unregister_atpx_handler(void);
bool radeon_has_atpx_dgpu_power_cntl(void); bool radeon_has_atpx_dgpu_power_cntl(void);
bool radeon_is_atpx_hybrid(void);
#else #else
static inline void radeon_register_atpx_handler(void) {} static inline void radeon_register_atpx_handler(void) {}
static inline void radeon_unregister_atpx_handler(void) {} static inline void radeon_unregister_atpx_handler(void) {}
static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; } static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; }
static inline bool radeon_is_atpx_hybrid(void) { return false; }
#endif #endif
int radeon_no_wb; int radeon_no_wb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment