FILE
dpu_hw_pingpong.h
File preview with syntax highlighting.
linux-6.19.14/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.h
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. 3 */ 4 5#ifndef _DPU_HW_PINGPONG_H 6#define _DPU_HW_PINGPONG_H 7 8#include "dpu_hw_catalog.h" 9#include "dpu_hw_mdss.h" 10#include "dpu_hw_util.h" 11 12#define DITHER_MATRIX_SZ 16 13 14struct dpu_hw_pingpong; 15 16/** 17 * struct dpu_hw_dither_cfg - dither feature structure 18 * @flags: for customizing operations 19 * @temporal_en: temperal dither enable 20 * @c0_bitdepth: c0 component bit depth 21 * @c1_bitdepth: c1 component bit depth 22 * @c2_bitdepth: c2 component bit depth 23 * @c3_bitdepth: c2 component bit depth 24 * @matrix: dither strength matrix 25 */ 26struct dpu_hw_dither_cfg { 27 u64 flags; 28 u32 temporal_en; 29 u32 c0_bitdepth; 30 u32 c1_bitdepth; 31 u32 c2_bitdepth; 32 u32 c3_bitdepth; 33 u32 matrix[DITHER_MATRIX_SZ]; 34}; 35 36/** 37 * struct dpu_hw_pingpong_ops : Interface to the pingpong Hw driver functions 38 * Assumption is these functions will be called after clocks are enabled 39 * @enable_tearcheck: program and enable tear check block 40 * @disable_tearcheck: disable able tear check block 41 * @setup_dither : function to program the dither hw block 42 * @get_line_count: obtain current vertical line counter 43 */ 44struct dpu_hw_pingpong_ops { 45 /** 46 * @enable_tearcheck: enables vysnc generation and sets up init value of 47 * read pointer and programs the tear check cofiguration 48 */ 49 int (*enable_tearcheck)(struct dpu_hw_pingpong *pp, 50 struct dpu_hw_tear_check *cfg); 51 52 /** 53 * @disable_tearcheck: disables tear check block 54 */ 55 int (*disable_tearcheck)(struct dpu_hw_pingpong *pp); 56 57 /** 58 * @connect_external_te: read, modify, write to either set or clear 59 * listening to external TE 60 * @Return: 1 if TE was originally connected, 0 if not, or -ERROR 61 */ 62 int (*connect_external_te)(struct dpu_hw_pingpong *pp, 63 bool enable_external_te); 64 65 /** 66 * @get_line_count: Obtain current vertical line counter 67 */ 68 u32 (*get_line_count)(struct dpu_hw_pingpong *pp); 69 70 /** 71 * @disable_autorefresh: Disable autorefresh if enabled 72 */ 73 void (*disable_autorefresh)(struct dpu_hw_pingpong *pp, uint32_t encoder_id, u16 vdisplay); 74 75 /** 76 * @setup_dither: Setup dither matix for pingpong block 77 */ 78 void (*setup_dither)(struct dpu_hw_pingpong *pp, 79 struct dpu_hw_dither_cfg *cfg); 80 /** 81 * @enable_dsc: Enable DSC 82 */ 83 int (*enable_dsc)(struct dpu_hw_pingpong *pp); 84 85 /** 86 * @disable_dsc: Disable DSC 87 */ 88 void (*disable_dsc)(struct dpu_hw_pingpong *pp); 89 90 /** 91 * @setup_dsc: Setup DSC 92 */ 93 int (*setup_dsc)(struct dpu_hw_pingpong *pp); 94}; 95 96struct dpu_hw_merge_3d; 97 98struct dpu_hw_pingpong { 99 struct dpu_hw_blk base; 100 struct dpu_hw_blk_reg_map hw; 101 102 /* pingpong */ 103 enum dpu_pingpong idx; 104 const struct dpu_pingpong_cfg *caps; 105 struct dpu_hw_merge_3d *merge_3d; 106 107 /* ops */ 108 struct dpu_hw_pingpong_ops ops; 109}; 110 111/** 112 * to_dpu_hw_pingpong - convert base object dpu_hw_base to container 113 * @hw: Pointer to base hardware block 114 * return: Pointer to hardware block container 115 */ 116static inline struct dpu_hw_pingpong *to_dpu_hw_pingpong(struct dpu_hw_blk *hw) 117{ 118 return container_of(hw, struct dpu_hw_pingpong, base); 119} 120 121struct dpu_hw_pingpong *dpu_hw_pingpong_init(struct drm_device *dev, 122 const struct dpu_pingpong_cfg *cfg, 123 void __iomem *addr, 124 const struct dpu_mdss_version *mdss_rev); 125 126#endif /*_DPU_HW_PINGPONG_H */
~/
Read-only file preview.