brintos

brintos / linux-shallow public Read only

0
0
Text · 1.2 KiB · b9049fe Raw
39 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved4 *5 * Helper methods for MSM-specific DSC calculations that are common between timing engine,6 * DSI, and DP.7 */8 9#ifndef MSM_DSC_HELPER_H_10#define MSM_DSC_HELPER_H_11 12#include <linux/math.h>13#include <drm/display/drm_dsc_helper.h>14 15/**16 * msm_dsc_get_slices_per_intf() - calculate number of slices per interface17 * @dsc: Pointer to drm dsc config struct18 * @intf_width: interface width in pixels19 * Returns: Integer representing the number of slices for the given interface20 */21static inline u32 msm_dsc_get_slices_per_intf(const struct drm_dsc_config *dsc, u32 intf_width)22{23	return DIV_ROUND_UP(intf_width, dsc->slice_width);24}25 26/**27 * msm_dsc_get_bytes_per_line() - calculate bytes per line28 * @dsc: Pointer to drm dsc config struct29 * Returns: Integer value representing bytes per line. DSI and DP need30 *          to perform further calculations to turn this into pclk_per_intf,31 *          such as dividing by different values depending on if widebus is enabled.32 */33static inline u32 msm_dsc_get_bytes_per_line(const struct drm_dsc_config *dsc)34{35	return dsc->slice_count * dsc->slice_chunk_size;36}37 38#endif /* MSM_DSC_HELPER_H_ */39