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

Commit 1b22f6d7 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge branch 'drm-fixes-4.12' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

A few fixes for 4.12:
- fix a UVD regression on SI
- fix overflow in watermark calcs on large modes

* 'drm-fixes-4.12' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: Fix overflow of watermark calcs at > 4k resolutions.
  drm/amdgpu: Fix overflow of watermark calcs at > 4k resolutions.
  drm/radeon: fix "force the UVD DPB into VRAM as well"
parents 32c1431e 55f61a04
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -1207,8 +1207,11 @@ static void dce_v10_0_program_watermarks(struct amdgpu_device *adev,
	u32 tmp, wm_mask, lb_vblank_lead_lines = 0;
	u32 tmp, wm_mask, lb_vblank_lead_lines = 0;


	if (amdgpu_crtc->base.enabled && num_heads && mode) {
	if (amdgpu_crtc->base.enabled && num_heads && mode) {
		active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;
		active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
		line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);
					    (u32)mode->clock);
		line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
					  (u32)mode->clock);
		line_time = min(line_time, (u32)65535);


		/* watermark for high clocks */
		/* watermark for high clocks */
		if (adev->pm.dpm_enabled) {
		if (adev->pm.dpm_enabled) {
+5 −2
Original line number Original line Diff line number Diff line
@@ -1176,8 +1176,11 @@ static void dce_v11_0_program_watermarks(struct amdgpu_device *adev,
	u32 tmp, wm_mask, lb_vblank_lead_lines = 0;
	u32 tmp, wm_mask, lb_vblank_lead_lines = 0;


	if (amdgpu_crtc->base.enabled && num_heads && mode) {
	if (amdgpu_crtc->base.enabled && num_heads && mode) {
		active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;
		active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
		line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);
					    (u32)mode->clock);
		line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
					  (u32)mode->clock);
		line_time = min(line_time, (u32)65535);


		/* watermark for high clocks */
		/* watermark for high clocks */
		if (adev->pm.dpm_enabled) {
		if (adev->pm.dpm_enabled) {
+5 −2
Original line number Original line Diff line number Diff line
@@ -983,8 +983,11 @@ static void dce_v6_0_program_watermarks(struct amdgpu_device *adev,
	fixed20_12 a, b, c;
	fixed20_12 a, b, c;


	if (amdgpu_crtc->base.enabled && num_heads && mode) {
	if (amdgpu_crtc->base.enabled && num_heads && mode) {
		active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;
		active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
		line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);
					    (u32)mode->clock);
		line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
					  (u32)mode->clock);
		line_time = min(line_time, (u32)65535);
		priority_a_cnt = 0;
		priority_a_cnt = 0;
		priority_b_cnt = 0;
		priority_b_cnt = 0;


+5 −2
Original line number Original line Diff line number Diff line
@@ -1091,8 +1091,11 @@ static void dce_v8_0_program_watermarks(struct amdgpu_device *adev,
	u32 tmp, wm_mask, lb_vblank_lead_lines = 0;
	u32 tmp, wm_mask, lb_vblank_lead_lines = 0;


	if (amdgpu_crtc->base.enabled && num_heads && mode) {
	if (amdgpu_crtc->base.enabled && num_heads && mode) {
		active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;
		active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
		line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);
					    (u32)mode->clock);
		line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
					  (u32)mode->clock);
		line_time = min(line_time, (u32)65535);


		/* watermark for high clocks */
		/* watermark for high clocks */
		if (adev->pm.dpm_enabled) {
		if (adev->pm.dpm_enabled) {
+5 −2
Original line number Original line Diff line number Diff line
@@ -9267,8 +9267,11 @@ static void dce8_program_watermarks(struct radeon_device *rdev,
	u32 tmp, wm_mask;
	u32 tmp, wm_mask;


	if (radeon_crtc->base.enabled && num_heads && mode) {
	if (radeon_crtc->base.enabled && num_heads && mode) {
		active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;
		active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
		line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);
					    (u32)mode->clock);
		line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
					  (u32)mode->clock);
		line_time = min(line_time, (u32)65535);


		/* watermark for high clocks */
		/* watermark for high clocks */
		if ((rdev->pm.pm_method == PM_METHOD_DPM) &&
		if ((rdev->pm.pm_method == PM_METHOD_DPM) &&
Loading