Lines Matching full:dsc

37 static int dsi_populate_dsc_params(struct msm_dsi_host *msm_host, struct drm_dsc_config *dsc);
159 struct drm_dsc_config *dsc; member
521 * @dsc: DRM DSC configuration for this DSI output
528 * - For VIDEO mode they are not compressed by DSC and are passed as is.
538 const struct drm_dsc_config *dsc) in dsi_adjust_pclk_for_compression() argument
540 int new_hdisplay = DIV_ROUND_UP(mode->hdisplay * drm_dsc_get_bpp_int(dsc), in dsi_adjust_pclk_for_compression()
541 dsc->bits_per_component * 3); in dsi_adjust_pclk_for_compression()
549 const struct drm_dsc_config *dsc, bool is_bonded_dsi) in dsi_get_pclk_rate() argument
555 if (dsc) in dsi_get_pclk_rate()
556 pclk_rate = dsi_adjust_pclk_for_compression(mode, dsc); in dsi_get_pclk_rate()
576 unsigned long pclk_rate = dsi_get_pclk_rate(mode, msm_host->dsc, is_bonded_dsi); in dsi_byte_clk_get_rate()
595 msm_host->pixel_clk_rate = dsi_get_pclk_rate(msm_host->mode, msm_host->dsc, is_bonded_dsi); in dsi_calc_pclk()
723 return msm_host->dsc && in msm_dsi_host_is_wide_bus_enabled()
851 struct drm_dsc_config *dsc = msm_host->dsc; in dsi_update_dsc_timing() local
858 /* first calculate dsc parameters and then program in dsi_update_dsc_timing()
861 slice_per_intf = msm_dsc_get_slices_per_intf(dsc, hdisplay); in dsi_update_dsc_timing()
863 total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf; in dsi_update_dsc_timing()
864 bytes_per_pkt = dsc->slice_chunk_size; /* * slice_per_pkt; */ in dsi_update_dsc_timing()
901 reg_ctrl2 |= DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH(dsc->slice_chunk_size); in dsi_update_dsc_timing()
945 if (msm_host->dsc) { in dsi_timing_setup()
946 struct drm_dsc_config *dsc = msm_host->dsc; in dsi_timing_setup() local
949 /* update dsc params with timing params */ in dsi_timing_setup()
950 if (!dsc || !mode->hdisplay || !mode->vdisplay) { in dsi_timing_setup()
956 dsc->pic_width = mode->hdisplay; in dsi_timing_setup()
957 dsc->pic_height = mode->vdisplay; in dsi_timing_setup()
958 DBG("Mode %dx%d\n", dsc->pic_width, dsc->pic_height); in dsi_timing_setup()
960 /* we do the calculations for dsc parameters here so that in dsi_timing_setup()
963 ret = dsi_populate_dsc_params(msm_host, dsc); in dsi_timing_setup()
986 hdisplay = DIV_ROUND_UP(msm_dsc_get_bytes_per_line(msm_host->dsc), bytes_per_pclk); in dsi_timing_setup()
993 if (msm_host->dsc) in dsi_timing_setup()
1014 if (msm_host->dsc) in dsi_timing_setup()
1018 if (!msm_host->dsc) in dsi_timing_setup()
1022 * When DSC is enabled, WC = slice_chunk_size * slice_per_pkt + 1. in dsi_timing_setup()
1026 * and adjust DSC math to account for slice_per_pkt. in dsi_timing_setup()
1028 wc = msm_host->dsc->slice_chunk_size + 1; in dsi_timing_setup()
1633 if (dsi->dsc) in dsi_host_attach()
1634 msm_host->dsc = dsi->dsc; in dsi_host_attach()
1761 static int dsi_populate_dsc_params(struct msm_dsi_host *msm_host, struct drm_dsc_config *dsc) in dsi_populate_dsc_params() argument
1765 if (dsc->bits_per_pixel & 0xf) { in dsi_populate_dsc_params()
1770 if (dsc->bits_per_component != 8) { in dsi_populate_dsc_params()
1775 dsc->simple_422 = 0; in dsi_populate_dsc_params()
1776 dsc->convert_rgb = 1; in dsi_populate_dsc_params()
1777 dsc->vbr_enable = 0; in dsi_populate_dsc_params()
1779 drm_dsc_set_const_params(dsc); in dsi_populate_dsc_params()
1780 drm_dsc_set_rc_buf_thresh(dsc); in dsi_populate_dsc_params()
1783 ret = drm_dsc_setup_rc_params(dsc, DRM_DSC_1_1_PRE_SCR); in dsi_populate_dsc_params()
1785 DRM_DEV_ERROR(&msm_host->pdev->dev, "could not find DSC RC parameters\n"); in dsi_populate_dsc_params()
1789 dsc->initial_scale_value = drm_dsc_initial_scale_value(dsc); in dsi_populate_dsc_params()
1790 dsc->line_buf_depth = dsc->bits_per_component + 1; in dsi_populate_dsc_params()
1792 return drm_dsc_compute_rc_parameters(dsc); in dsi_populate_dsc_params()
2485 struct drm_dsc_config *dsc = msm_host->dsc; in msm_dsi_host_check_dsc() local
2489 if (!msm_host->dsc) in msm_dsi_host_check_dsc()
2492 if (pic_width % dsc->slice_width) { in msm_dsi_host_check_dsc()
2494 pic_width, dsc->slice_width); in msm_dsi_host_check_dsc()
2498 if (pic_height % dsc->slice_height) { in msm_dsi_host_check_dsc()
2500 pic_height, dsc->slice_height); in msm_dsi_host_check_dsc()
2589 return msm_host->dsc; in msm_dsi_host_get_dsc_config()