• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Allwinner SoCs display driver.
3  *
4  * Copyright (C) 2016 Allwinner.
5  *
6  * This file is licensed under the terms of the GNU General Public
7  * License version 2.  This program is licensed "as is" without any
8  * warranty of any kind, whether express or implied.
9  */
10 
11 #include "disp_features.h"
12 
bsp_disp_feat_get_num_screens(void)13 int bsp_disp_feat_get_num_screens(void)
14 {
15 	return de_feat_get_num_screens();
16 }
17 
bsp_disp_feat_get_num_devices(void)18 int bsp_disp_feat_get_num_devices(void)
19 {
20 	return de_feat_get_num_devices();
21 }
22 
bsp_disp_feat_get_num_channels(unsigned int disp)23 int bsp_disp_feat_get_num_channels(unsigned int disp)
24 {
25 	return de_feat_get_num_chns(disp);
26 }
27 
bsp_disp_feat_get_num_layers(unsigned int disp)28 int bsp_disp_feat_get_num_layers(unsigned int disp)
29 {
30 	return de_feat_get_num_layers(disp);
31 }
32 
bsp_disp_feat_get_num_layers_by_chn(unsigned int disp,unsigned int chn)33 int bsp_disp_feat_get_num_layers_by_chn(unsigned int disp, unsigned int chn)
34 {
35 	return de_feat_get_num_layers_by_chn(disp, chn);
36 }
37 
38 /**
39  * Query whether specified timing controller support the output_type spcified
40  * @disp: the index of timing controller
41  * @output_type: the display output type
42  * On support, returns 1. Otherwise, returns 0.
43  */
bsp_disp_feat_is_supported_output_types(unsigned int disp,unsigned int output_type)44 int bsp_disp_feat_is_supported_output_types(unsigned int disp,
45 					    unsigned int output_type)
46 {
47 	return de_feat_is_supported_output_types(disp, output_type);
48 }
49 
bsp_disp_feat_is_support_smbl(unsigned int disp)50 int bsp_disp_feat_is_support_smbl(unsigned int disp)
51 {
52 	return de_feat_is_support_smbl(disp);
53 }
54 
bsp_disp_feat_is_support_capture(unsigned int disp)55 int bsp_disp_feat_is_support_capture(unsigned int disp)
56 {
57 	return de_feat_is_support_wb(disp);
58 }
59 
bsp_disp_feat_is_support_enhance(unsigned int disp)60 int bsp_disp_feat_is_support_enhance(unsigned int disp)
61 {
62 	return de_feat_is_support_vep(disp);
63 }
64 
disp_init_feat(struct disp_feat_init * feat_init)65 int disp_init_feat(struct disp_feat_init *feat_init)
66 {
67 #ifdef DE_VERSION_V33X
68 	struct de_feat_init de_feat;
69 	de_feat.chn_cfg_mode = feat_init->chn_cfg_mode;
70 	return de_feat_init_config(&de_feat);
71 #else
72 	return de_feat_init();
73 #endif
74 }
75 
disp_exit_feat(void)76 int disp_exit_feat(void)
77 {
78 #ifdef DE_VERSION_V33X
79 	return 0;
80 #else
81 	return de_feat_exit();
82 #endif
83 }
84 
bsp_disp_feat_get_num_vdpo(void)85 unsigned int bsp_disp_feat_get_num_vdpo(void)
86 {
87 	return de_feat_get_number_of_vdpo();
88 }
89 
disp_feat_is_using_rcq(unsigned int disp)90 int disp_feat_is_using_rcq(unsigned int disp)
91 {
92 #if defined(DE_VERSION_V33X)
93        return de_feat_is_using_rcq(disp);
94 #endif
95        return 0;
96 }
97 
disp_feat_is_using_wb_rcq(unsigned int wb)98 int disp_feat_is_using_wb_rcq(unsigned int wb)
99 {
100 #if defined(DE_VERSION_V33X)
101        return de_feat_is_using_wb_rcq(wb);
102 #endif
103        return 0;
104 }
105