mirror of https://gitee.com/openkylin/linux.git
drm/radeon: disable runtime pm in certain cases
If the platform does not support hybrid graphics or ATPX dGPU power control. bug: https://bugzilla.kernel.org/show_bug.cgi?id=51381 Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
This commit is contained in:
parent
3b496626ee
commit
066f1f0b47
|
@ -104,6 +104,14 @@ static const char radeon_family_name[][16] = {
|
||||||
"LAST",
|
"LAST",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(CONFIG_VGA_SWITCHEROO)
|
||||||
|
bool radeon_has_atpx_dgpu_power_cntl(void);
|
||||||
|
bool radeon_is_atpx_hybrid(void);
|
||||||
|
#else
|
||||||
|
static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; }
|
||||||
|
static inline bool radeon_is_atpx_hybrid(void) { return false; }
|
||||||
|
#endif
|
||||||
|
|
||||||
#define RADEON_PX_QUIRK_DISABLE_PX (1 << 0)
|
#define RADEON_PX_QUIRK_DISABLE_PX (1 << 0)
|
||||||
#define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1)
|
#define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1)
|
||||||
|
|
||||||
|
@ -160,6 +168,11 @@ static void radeon_device_handle_px_quirks(struct radeon_device *rdev)
|
||||||
|
|
||||||
if (rdev->px_quirk_flags & RADEON_PX_QUIRK_DISABLE_PX)
|
if (rdev->px_quirk_flags & RADEON_PX_QUIRK_DISABLE_PX)
|
||||||
rdev->flags &= ~RADEON_IS_PX;
|
rdev->flags &= ~RADEON_IS_PX;
|
||||||
|
|
||||||
|
/* disable PX is the system doesn't support dGPU power control or hybrid gfx */
|
||||||
|
if (!radeon_is_atpx_hybrid() &&
|
||||||
|
!radeon_has_atpx_dgpu_power_cntl())
|
||||||
|
rdev->flags &= ~RADEON_IS_PX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue