Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a84301c6 authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/radeon/dpm: implement vblank_too_short callback for btc



Check if we can switch the mclk during the vblank time otherwise
we may get artifacts on the screen when the mclk changes.

Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d0b54bdc
Loading
Loading
Loading
Loading
+15 −1
Original line number Original line Diff line number Diff line
@@ -2059,6 +2059,19 @@ static void btc_init_stutter_mode(struct radeon_device *rdev)
	}
	}
}
}


bool btc_dpm_vblank_too_short(struct radeon_device *rdev)
{
	struct rv7xx_power_info *pi = rv770_get_pi(rdev);
	u32 vblank_time = r600_dpm_get_vblank_time(rdev);
	u32 switch_limit = pi->mem_gddr5 ? 450 : 100;

	if (vblank_time < switch_limit)
		return true;
	else
		return false;

}

static void btc_apply_state_adjust_rules(struct radeon_device *rdev,
static void btc_apply_state_adjust_rules(struct radeon_device *rdev,
					 struct radeon_ps *rps)
					 struct radeon_ps *rps)
{
{
@@ -2068,7 +2081,8 @@ static void btc_apply_state_adjust_rules(struct radeon_device *rdev,
	u32 mclk, sclk;
	u32 mclk, sclk;
	u16 vddc, vddci;
	u16 vddc, vddci;


	if (rdev->pm.dpm.new_active_crtc_count > 1)
	if ((rdev->pm.dpm.new_active_crtc_count > 1) ||
	    btc_dpm_vblank_too_short(rdev))
		disable_mclk_switching = true;
		disable_mclk_switching = true;
	else
	else
		disable_mclk_switching = false;
		disable_mclk_switching = false;
+1 −0
Original line number Original line Diff line number Diff line
@@ -1768,6 +1768,7 @@ static struct radeon_asic btc_asic = {
		.print_power_state = &rv770_dpm_print_power_state,
		.print_power_state = &rv770_dpm_print_power_state,
		.debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
		.debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
		.force_performance_level = &rv770_dpm_force_performance_level,
		.force_performance_level = &rv770_dpm_force_performance_level,
		.vblank_too_short = &btc_dpm_vblank_too_short,
	},
	},
	.pflip = {
	.pflip = {
		.pre_page_flip = &evergreen_pre_page_flip,
		.pre_page_flip = &evergreen_pre_page_flip,
+1 −0
Original line number Original line Diff line number Diff line
@@ -556,6 +556,7 @@ void btc_dpm_post_set_power_state(struct radeon_device *rdev);
void btc_dpm_fini(struct radeon_device *rdev);
void btc_dpm_fini(struct radeon_device *rdev);
u32 btc_dpm_get_sclk(struct radeon_device *rdev, bool low);
u32 btc_dpm_get_sclk(struct radeon_device *rdev, bool low);
u32 btc_dpm_get_mclk(struct radeon_device *rdev, bool low);
u32 btc_dpm_get_mclk(struct radeon_device *rdev, bool low);
bool btc_dpm_vblank_too_short(struct radeon_device *rdev);
int sumo_dpm_init(struct radeon_device *rdev);
int sumo_dpm_init(struct radeon_device *rdev);
int sumo_dpm_enable(struct radeon_device *rdev);
int sumo_dpm_enable(struct radeon_device *rdev);
void sumo_dpm_disable(struct radeon_device *rdev);
void sumo_dpm_disable(struct radeon_device *rdev);