params->vertical_total_min > 0) {
set_reg_field_value(v_total_max,
- params->vertical_total_max,
+ params->vertical_total_max - 1,
CRTC_V_TOTAL_MAX,
CRTC_V_TOTAL_MAX);
set_reg_field_value(v_total_min,
- params->vertical_total_min,
+ params->vertical_total_min - 1,
CRTC_V_TOTAL_MIN,
CRTC_V_TOTAL_MIN);
CRTC_REG_UPDATE(
CRTC0_CRTC_V_TOTAL_MIN,
- CRTC_V_TOTAL_MIN, params->vertical_total_min);
+ CRTC_V_TOTAL_MIN, params->vertical_total_min - 1);
CRTC_REG_UPDATE(
CRTC0_CRTC_V_TOTAL_MAX,
- CRTC_V_TOTAL_MAX, params->vertical_total_max);
+ CRTC_V_TOTAL_MAX, params->vertical_total_max - 1);
CRTC_REG_SET_N(CRTC0_CRTC_V_TOTAL_CONTROL, 6,
FD(CRTC0_CRTC_V_TOTAL_CONTROL__CRTC_V_TOTAL_MIN_SEL), 1,
FD(CRTC0_CRTC_V_TOTAL_CONTROL__CRTC_V_TOTAL_MAX_SEL), 1,
{
unsigned int min_frame_duration_in_ns = 0, max_frame_duration_in_ns = 0;
unsigned int index = map_index_from_stream(core_freesync, stream);
+ uint32_t vtotal = stream->timing.v_total;
min_frame_duration_in_ns = ((unsigned int) (div64_u64(
(1000000000ULL * 1000000),
*vmin = div64_u64(div64_u64(((unsigned long long)(
min_frame_duration_in_ns) * stream->timing.pix_clk_khz),
stream->timing.h_total), 1000000);
+
+ /* In case of 4k free sync monitor, vmin or vmax cannot be less than vtotal */
+ if (*vmin < vtotal) {
+ ASSERT(false);
+ *vmin = vtotal;
+ }
+
+ if (*vmax < vtotal) {
+ ASSERT(false);
+ *vmax = vtotal;
+ }
}
static void calc_v_total_from_duration(const struct dc_stream *stream,