disp: msm: add support for variable compression ratios

Currently the compression ratio is hard-coded to either 2:1 or
3:1 in several places. This is not sufficient for new compression
algorithms as they can support higher compression ratios.

Add support for calculating the compression ratios from the source
and target bpp thereby eliminating hard-coding.

Change-Id: I6383f3d0c781193d0a9ed74df5a95d8e856edb3d
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Этот коммит содержится в:
Abhinav Kumar
2019-11-14 19:17:52 -08:00
коммит произвёл Gerrit - the friendly Code Review server
родитель 27844b7b60
Коммит e3f23771ba
5 изменённых файлов: 49 добавлений и 34 удалений

Просмотреть файл

@@ -50,8 +50,6 @@ static void drm_mode_to_intf_timing_params(
struct intf_timing_params *timing)
{
const struct sde_encoder_phys *phys_enc = &vid_enc->base;
enum msm_display_compression_ratio comp_ratio =
MSM_DISPLAY_COMPRESSION_RATIO_NONE;
memset(timing, 0, sizeof(*timing));
@@ -82,17 +80,12 @@ static void drm_mode_to_intf_timing_params(
*/
timing->width = mode->hdisplay; /* active width */
if (phys_enc->hw_intf->cap->type != INTF_DP &&
vid_enc->base.comp_type == MSM_DISPLAY_COMPRESSION_DSC) {
comp_ratio = vid_enc->base.comp_ratio;
if (comp_ratio == MSM_DISPLAY_COMPRESSION_RATIO_2_TO_1)
timing->width = DIV_ROUND_UP(timing->width, 2);
else
timing->width = DIV_ROUND_UP(timing->width, 3);
} else if (phys_enc->hw_intf->cap->type != INTF_DP &&
vid_enc->base.comp_type == MSM_DISPLAY_COMPRESSION_VDC) {
comp_ratio = vid_enc->base.comp_ratio;
timing->width = DIV_ROUND_UP(timing->width, comp_ratio);
if (phys_enc->hw_intf->cap->type != INTF_DP) {
if ((vid_enc->base.comp_type == MSM_DISPLAY_COMPRESSION_DSC) ||
(vid_enc->base.comp_type ==
MSM_DISPLAY_COMPRESSION_VDC))
timing->width = DIV_ROUND_UP(timing->width,
vid_enc->base.comp_ratio);
}
timing->height = mode->vdisplay; /* active height */