--- drivers/gpu/drm/radeon/radeon_display.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -1144,6 +1144,7 @@ bool radeon_crtc_scaling_mode_fixup(stru dst_v = radeon_crtc->native_mode.vdisplay; src_h = crtc->mode.hdisplay; dst_h = radeon_crtc->native_mode.vdisplay; + printk("dst_v CRTC:%d [%d]= %08x\n", crtc->base.id, __LINE__, dst_v); /* copy native mode */ memcpy(&radeon_crtc->native_mode, &radeon_encoder->native_mode, @@ -1160,6 +1161,7 @@ bool radeon_crtc_scaling_mode_fixup(stru radeon_crtc->rmx_type = RMX_FULL; src_v = crtc->mode.vdisplay; dst_v = crtc->mode.vdisplay - (radeon_crtc->v_border * 2); + printk("dst_v CRTC:%d [%d]= %08x\n", crtc->base.id, __LINE__, dst_v); src_h = crtc->mode.hdisplay; dst_h = crtc->mode.hdisplay - (radeon_crtc->h_border * 2); } @@ -1181,9 +1183,27 @@ bool radeon_crtc_scaling_mode_fixup(stru fixed20_12 a, b; a.full = dfixed_const(src_v); b.full = dfixed_const(dst_v); + if (!a.full) { + DRM_ERROR("a.full CRTC:%d [%d] = 0\n", crtc->base.id, __LINE__); + return false; + } + if (!b.full) { + DRM_ERROR("b.full CRTC:%d [%d] = 0\n", crtc->base.id, __LINE__); + return false; + } + radeon_crtc->vsc.full = dfixed_div(a, b); a.full = dfixed_const(src_h); b.full = dfixed_const(dst_h); + if (!a.full) { + DRM_ERROR("a.full CRTC:%d [%d] = 0\n", crtc->base.id, __LINE__); + return false; + } + if (!b.full) { + DRM_ERROR("b.full CRTC:%d [%d] = 0\n", crtc->base.id, __LINE__); + return false; + } + radeon_crtc->hsc.full = dfixed_div(a, b); } else { radeon_crtc->vsc.full = dfixed_const(1);