1 /* Copyright (c) 2016-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  */
12 
13 #ifndef __DPU_VBIF_H__
14 #define __DPU_VBIF_H__
15 
16 #include "dpu_kms.h"
17 
18 struct dpu_vbif_set_ot_params {
19 	u32 xin_id;
20 	u32 num;
21 	u32 width;
22 	u32 height;
23 	u32 frame_rate;
24 	bool rd;
25 	bool is_wfd;
26 	u32 vbif_idx;
27 	u32 clk_ctrl;
28 };
29 
30 struct dpu_vbif_set_memtype_params {
31 	u32 xin_id;
32 	u32 vbif_idx;
33 	u32 clk_ctrl;
34 	bool is_cacheable;
35 };
36 
37 /**
38  * struct dpu_vbif_set_qos_params - QoS remapper parameter
39  * @vbif_idx: vbif identifier
40  * @xin_id: client interface identifier
41  * @clk_ctrl: clock control identifier of the xin
42  * @num: pipe identifier (debug only)
43  * @is_rt: true if pipe is used in real-time use case
44  */
45 struct dpu_vbif_set_qos_params {
46 	u32 vbif_idx;
47 	u32 xin_id;
48 	u32 clk_ctrl;
49 	u32 num;
50 	bool is_rt;
51 };
52 
53 /**
54  * dpu_vbif_set_ot_limit - set OT limit for vbif client
55  * @dpu_kms:	DPU handler
56  * @params:	Pointer to OT configuration parameters
57  */
58 void dpu_vbif_set_ot_limit(struct dpu_kms *dpu_kms,
59 		struct dpu_vbif_set_ot_params *params);
60 
61 /**
62  * dpu_vbif_set_qos_remap - set QoS priority level remap
63  * @dpu_kms:	DPU handler
64  * @params:	Pointer to QoS configuration parameters
65  */
66 void dpu_vbif_set_qos_remap(struct dpu_kms *dpu_kms,
67 		struct dpu_vbif_set_qos_params *params);
68 
69 /**
70  * dpu_vbif_clear_errors - clear any vbif errors
71  * @dpu_kms:	DPU handler
72  */
73 void dpu_vbif_clear_errors(struct dpu_kms *dpu_kms);
74 
75 /**
76  * dpu_vbif_init_memtypes - initialize xin memory types for vbif
77  * @dpu_kms:	DPU handler
78  */
79 void dpu_vbif_init_memtypes(struct dpu_kms *dpu_kms);
80 
81 void dpu_debugfs_vbif_init(struct dpu_kms *dpu_kms, struct dentry *debugfs_root);
82 
83 #endif /* __DPU_VBIF_H__ */
84