msm_dsc_helper.h 862 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved
  4. *
  5. * Helper methods for MSM-specific DSC calculations that are common between timing engine,
  6. * DSI, and DP.
  7. */
  8. #ifndef MSM_DSC_HELPER_H_
  9. #define MSM_DSC_HELPER_H_
  10. #include <linux/math.h>
  11. #include <drm/display/drm_dsc_helper.h>
  12. /**
  13. * msm_dsc_get_bytes_per_line() - calculate bytes per line
  14. * @dsc: Pointer to drm dsc config struct
  15. * Returns: Integer value representing bytes per line. DSI and DP need
  16. * to perform further calculations to turn this into pclk_per_intf,
  17. * such as dividing by different values depending on if widebus is enabled.
  18. */
  19. static inline u32 msm_dsc_get_bytes_per_line(const struct drm_dsc_config *dsc)
  20. {
  21. return dsc->slice_count * dsc->slice_chunk_size;
  22. }
  23. #endif /* MSM_DSC_HELPER_H_ */