Magellan Linux

Annotation of /mcore-src/trunk/mcore-tools/src/modules/basic-video/graphic.control.class.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2815 - (hide annotations) (download)
Fri Apr 7 09:13:15 2017 UTC (7 years ago) by niro
File size: 4088 byte(s)
-use runtime graphic autodetection as default, do not run in dept hwdetection. made it configurable via MCORE_GRAPHIC_HWDETECT_DEEP variable
1 niro 2510 # $Id$
2 niro 2051
3 niro 2755 push_firstboot 10_graphic_driver
4     push_firstboot 10_graphic_resolution
5    
6 niro 2664 push_config 10_graphic_driver
7 niro 2579 push_config 10_graphic_resolution
8 niro 2636 push_config 10_graphic_depth
9 niro 2673 #push_config 10_graphic_refresh
10 niro 2561
11 niro 2510 help_graphic_resolution()
12     {
13     local serial="${CLASS_ARGV[0]}"
14     control_client "${serial}" help graphic.resolution
15     }
16    
17     help_graphic_refresh()
18     {
19     local serial="${CLASS_ARGV[0]}"
20     control_client "${serial}" help graphic.refresh
21     }
22    
23     help_graphic_depth()
24     {
25     local serial="${CLASS_ARGV[0]}"
26     control_client "${serial}" help graphic.depth
27     }
28    
29     help_graphic_driver()
30     {
31     local serial="${CLASS_ARGV[0]}"
32     control_client "${serial}" help graphic.driver
33     }
34    
35 niro 2636 # set_graphic_driver $serial $value
36     set_graphic_driver()
37 niro 2051 {
38 niro 2305 local serial="${CLASS_ARGV[0]}"
39     local value="${CLASS_ARGV[1]}"
40 niro 2051
41     import_resource cfg_graphic "${serial}" module "${value}"
42     }
43    
44 niro 2636 control_graphic_driver()
45     {
46     local serial="${CLASS_ARGV[0]}"
47     push_config_10_graphic_driver "${serial}"
48     }
49    
50     push_config_10_graphic_driver()
51     {
52     local serial="$1"
53     local value
54    
55     value=$(mysqldo "select module from cfg_graphic where serial='${serial}'")
56     control_client "${serial}" set graphic.driver "${value}"
57     }
58    
59 niro 2051 # set_graphic_resolution $serial $value
60     set_graphic_resolution()
61     {
62 niro 2305 local serial="${CLASS_ARGV[0]}"
63     local value="${CLASS_ARGV[1]}"
64 niro 2051
65     import_resource cfg_graphic "${serial}" resolution "${value}"
66     }
67    
68     # control_graphic_resolution $serial
69     control_graphic_resolution()
70     {
71 niro 2305 local serial="${CLASS_ARGV[0]}"
72 niro 2579 push_config_10_graphic_resolution "${serial}"
73 niro 2561 }
74    
75 niro 2579 push_config_10_graphic_resolution()
76 niro 2561 {
77     local serial="$1"
78 niro 2051 local value
79    
80     value=$(mysqldo "select resolution from cfg_graphic where serial='${serial}'")
81     control_client "${serial}" set graphic.resolution "${value}"
82     }
83    
84     # set_graphic_depth $serial $value
85     set_graphic_depth()
86     {
87 niro 2305 local serial="${CLASS_ARGV[0]}"
88     local value="${CLASS_ARGV[1]}"
89 niro 2051
90     import_resource cfg_graphic "${serial}" depth "${value}"
91     }
92    
93 niro 2640 control_graphic_depth()
94 niro 2636 {
95     local serial="${CLASS_ARGV[0]}"
96     push_config_10_graphic_depth "${serial}"
97     }
98    
99     push_config_10_graphic_depth()
100     {
101     local serial="$1"
102     local value
103    
104     value=$(mysqldo "select depth from cfg_graphic where serial='${serial}'")
105     control_client "${serial}" set graphic.depth "${value}"
106     }
107    
108 niro 2051 # set_graphic_refesh $serial $value
109     set_graphic_refresh()
110     {
111 niro 2305 local serial="${CLASS_ARGV[0]}"
112     local value="${CLASS_ARGV[1]}"
113 niro 2051
114 niro 2560 import_resource cfg_graphic "${serial}" refresh_rate "${value}"
115 niro 2051 }
116    
117     # control_graphic_resolution $serial
118     control_graphic_refresh()
119     {
120 niro 2305 local serial="${CLASS_ARGV[0]}"
121 niro 2636 push_config_10_graphic_refresh "${serial}"
122     }
123    
124     push_config_10_graphic_refresh()
125     {
126     local serial="$1"
127 niro 2051 local value
128    
129     value=$(mysqldo "select hz from cfg_graphic where serial='${serial}'")
130     control_client "${serial}" set graphic.resolution "${value}"
131     }
132 niro 2755
133     push_firstboot_10_graphic_driver()
134     {
135     local serial="$1"
136     local graphic_driver
137    
138 niro 2815 if [[ ${MCORE_GRAPHIC_HWDETECT_DEEP} = 1 ]]
139 niro 2755 then
140 niro 2815 nsslsay_queue_init
141     nsslsay_queue_add "nocolors"
142     nsslsay_queue_add "get hardware.detect driver graphic"
143     graphic_driver=$(control_client "${serial}" run-queue)
144     if [[ -n ${graphic_driver} ]]
145     then
146     decho "graphic_driver='${graphic_driver}'"
147     import_resource cfg_graphic "${serial}" module "${graphic_driver}"
148     else
149     decho "no graphic_driver found"
150     fi
151     else
152     # default to runtime autodetection
153     graphic_driver="auto"
154 niro 2755 import_resource cfg_graphic "${serial}" module "${graphic_driver}"
155     fi
156     }
157    
158     push_firstboot_10_graphic_resolution()
159     {
160     local serial="$1"
161     local monitor_info
162     local monitor_resolution
163    
164 niro 2815 if [[ ${MCORE_GRAPHIC_HWDETECT_DEEP} = 1 ]]
165 niro 2755 then
166 niro 2815 nsslsay_queue_init
167     nsslsay_queue_add "nocolors"
168     nsslsay_queue_add "get hardware.detect info monitor"
169     monitor_info=$(control_client "${serial}" run-queue)
170     monitor_resolution="${monitor_info##*;}"
171     if [[ -n ${monitor_resolution} ]]
172     then
173     decho "monitor_resolution='${monitor_resolution}'"
174     import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}"
175     else
176     decho "no monitor_resolution found"
177     fi
178     else
179     monitor_resolution="auto"
180 niro 2755 import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}"
181     fi
182     }