disp: msm: sde: calculate line_time once during modeset

Calculate line_time once during modeset and allow
each plane to use it instead of calculating for each frame.
It also simplifies the line_time calculation for
command mode display.

Change-Id: I94ce29eec94bfdbee9016fbf93378661ebf79c03
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
这个提交包含在:
Dhaval Patel
2021-01-26 14:29:47 -08:00
提交者 Prabhanjan Kandula
父节点 6de4718ee9
当前提交 b5cde14bca
修改 9 个文件,包含 57 行新增67 行删除

查看文件

@@ -5875,6 +5875,33 @@ exit:
return ret;
}
static void sde_crtc_update_line_time(struct drm_crtc *crtc)
{
struct sde_crtc *sde_crtc = to_sde_crtc(crtc);
struct drm_encoder *encoder;
u32 min_transfer_time = 0, updated_fps = 0;
drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) {
if (sde_encoder_check_curr_mode(encoder, MSM_DISPLAY_CMD_MODE))
sde_encoder_get_transfer_time(encoder, &min_transfer_time);
}
if (min_transfer_time) {
/* get fps by doing 1000 ms / transfer_time */
updated_fps = DIV_ROUND_UP(1000000, min_transfer_time);
/* get line time by doing 1000ns / (fps * vactive) */
sde_crtc->line_time_in_ns = DIV_ROUND_UP(1000000000,
updated_fps * crtc->mode.vdisplay);
} else {
/* get line time by doing 1000ns / (fps * vtotal) */
sde_crtc->line_time_in_ns = DIV_ROUND_UP(1000000000,
drm_mode_vrefresh(&crtc->mode) * crtc->mode.vtotal);
}
SDE_EVT32(min_transfer_time, updated_fps, crtc->mode.vdisplay, crtc->mode.vtotal,
drm_mode_vrefresh(&crtc->mode), sde_crtc->line_time_in_ns);
}
void sde_crtc_set_qos_dirty(struct drm_crtc *crtc)
{
struct drm_plane *plane;
@@ -5890,6 +5917,7 @@ void sde_crtc_set_qos_dirty(struct drm_crtc *crtc)
pstate->dirty |= SDE_PLANE_DIRTY_QOS;
}
sde_crtc_update_line_time(crtc);
}
/**