.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. |
---|
2 | | - * |
---|
3 | | - * This program is free software; you can redistribute it and/or modify |
---|
4 | | - * it under the terms of the GNU General Public License version 2 and |
---|
5 | | - * only version 2 as published by the Free Software Foundation. |
---|
6 | | - * |
---|
7 | | - * This program is distributed in the hope that it will be useful, |
---|
8 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
9 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
10 | | - * GNU General Public License for more details. |
---|
11 | 3 | */ |
---|
12 | 4 | |
---|
13 | 5 | #ifndef _DPU_HW_PINGPONG_H |
---|
.. | .. |
---|
17 | 9 | #include "dpu_hw_mdss.h" |
---|
18 | 10 | #include "dpu_hw_util.h" |
---|
19 | 11 | #include "dpu_hw_blk.h" |
---|
| 12 | + |
---|
| 13 | +#define DITHER_MATRIX_SZ 16 |
---|
20 | 14 | |
---|
21 | 15 | struct dpu_hw_pingpong; |
---|
22 | 16 | |
---|
.. | .. |
---|
40 | 34 | u32 rd_ptr_frame_count; /* num frames sent since enabling interface */ |
---|
41 | 35 | u32 rd_ptr_line_count; /* current line on panel (rd ptr) */ |
---|
42 | 36 | u32 wr_ptr_line_count; /* current line within pp fifo (wr ptr) */ |
---|
| 37 | +}; |
---|
| 38 | + |
---|
| 39 | +/** |
---|
| 40 | + * struct dpu_hw_dither_cfg - dither feature structure |
---|
| 41 | + * @flags: for customizing operations |
---|
| 42 | + * @temporal_en: temperal dither enable |
---|
| 43 | + * @c0_bitdepth: c0 component bit depth |
---|
| 44 | + * @c1_bitdepth: c1 component bit depth |
---|
| 45 | + * @c2_bitdepth: c2 component bit depth |
---|
| 46 | + * @c3_bitdepth: c2 component bit depth |
---|
| 47 | + * @matrix: dither strength matrix |
---|
| 48 | + */ |
---|
| 49 | +struct dpu_hw_dither_cfg { |
---|
| 50 | + u64 flags; |
---|
| 51 | + u32 temporal_en; |
---|
| 52 | + u32 c0_bitdepth; |
---|
| 53 | + u32 c1_bitdepth; |
---|
| 54 | + u32 c2_bitdepth; |
---|
| 55 | + u32 c3_bitdepth; |
---|
| 56 | + u32 matrix[DITHER_MATRIX_SZ]; |
---|
43 | 57 | }; |
---|
44 | 58 | |
---|
45 | 59 | /** |
---|
.. | .. |
---|
90 | 104 | * Obtain current vertical line counter |
---|
91 | 105 | */ |
---|
92 | 106 | u32 (*get_line_count)(struct dpu_hw_pingpong *pp); |
---|
| 107 | + |
---|
| 108 | + /** |
---|
| 109 | + * Setup dither matix for pingpong block |
---|
| 110 | + */ |
---|
| 111 | + void (*setup_dither)(struct dpu_hw_pingpong *pp, |
---|
| 112 | + struct dpu_hw_dither_cfg *cfg); |
---|
93 | 113 | }; |
---|
94 | 114 | |
---|
95 | 115 | struct dpu_hw_pingpong { |
---|
.. | .. |
---|
105 | 125 | }; |
---|
106 | 126 | |
---|
107 | 127 | /** |
---|
108 | | - * dpu_hw_pingpong - convert base object dpu_hw_base to container |
---|
| 128 | + * to_dpu_hw_pingpong - convert base object dpu_hw_base to container |
---|
109 | 129 | * @hw: Pointer to base hardware block |
---|
110 | 130 | * return: Pointer to hardware block container |
---|
111 | 131 | */ |
---|
.. | .. |
---|
124 | 144 | */ |
---|
125 | 145 | struct dpu_hw_pingpong *dpu_hw_pingpong_init(enum dpu_pingpong idx, |
---|
126 | 146 | void __iomem *addr, |
---|
127 | | - struct dpu_mdss_cfg *m); |
---|
| 147 | + const struct dpu_mdss_cfg *m); |
---|
128 | 148 | |
---|
129 | 149 | /** |
---|
130 | 150 | * dpu_hw_pingpong_destroy - destroys pingpong driver context |
---|