Quoting Mahesh Kumar (2018-07-31 15:24:45) > + for_each_new_crtc_in_state(state, crtc, crtc_state, i) { > + const struct drm_display_mode *adjusted_mode; > + int hdisplay, vdisplay; > + enum pipe pipe; > + > + if (!crtc_state->enable) > + continue; > + > + pipe = to_intel_crtc(crtc)->pipe; > + adjusted_mode = &crtc_state->adjusted_mode; > + drm_mode_get_hv_timing(adjusted_mode, &hdisplay, &vdisplay); You should check with Ville whether the adjusted_mode is already adjusted. But at any rate hdisplay is not affected by hv_timing. > + total_width += hdisplay; > + > + if (pipe < for_pipe) > + width_before_pipe += hdisplay; > + else if (pipe == for_pipe) > + pipe_width = hdisplay; > + } > + > + ddb_size_before_pipe = (ddb_size * width_before_pipe) / total_width; ddb_size_before_pipe can just be alloc->start. (brackets here) are redundant, so have a discussion as to whether they aide or hinder comprehension. > + pipe_size = (ddb_size * pipe_width) / total_width; > + alloc->start = ddb_size_before_pipe; > alloc->end = alloc->start + pipe_size; To avoid truncation fun (and prev_crtc->end != this_crtc->start), use alloc->end = ddb_size * (width_before_pipe + pipe_width) / total_width; -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx