Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

mcore-src/trunk/mcore-tools/src/modules/basic-video/graphic.control.class revision 2286 by niro, Tue Jan 14 16:15:23 2014 UTC mcore-src/trunk/mcore-tools/src/modules/basic-video/graphic.control.class.in revision 2844 by niro, Fri Nov 16 13:48:00 2018 UTC
# Line 1  Line 1 
1  #!/bin/sh  # $Id$
2    
3  # set_graphic_gfxcard $serial $value  push_firstboot 10_graphic_driver
4  set_graphic_gfxcard()  push_firstboot 10_graphic_resolution
5    
6    push_config 10_graphic_driver
7    push_config 10_graphic_resolution
8    push_config 10_graphic_depth
9    #push_config 10_graphic_refresh
10    push_config 10_graphic_hdmi
11    
12    help_graphic_resolution()
13  {  {
14   local serial="$1"   local serial="${CLASS_ARGV[0]}"
15   local value="$2"   control_client "${serial}" help graphic.resolution
16    }
17    
18    help_graphic_refresh()
19    {
20     local serial="${CLASS_ARGV[0]}"
21     control_client "${serial}" help graphic.refresh
22    }
23    
24    help_graphic_depth()
25    {
26     local serial="${CLASS_ARGV[0]}"
27     control_client "${serial}" help graphic.depth
28    }
29    
30    help_graphic_driver()
31    {
32     local serial="${CLASS_ARGV[0]}"
33     control_client "${serial}" help graphic.driver
34    }
35    
36    help_graphic_hdmi()
37    {
38     local serial="${CLASS_ARGV[0]}"
39     control_client "${serial}" help graphic.hdmi
40    }
41    
42    # set_graphic_driver $serial $value
43    set_graphic_driver()
44    {
45     local serial="${CLASS_ARGV[0]}"
46     local value="${CLASS_ARGV[1]}"
47    
48   import_resource cfg_graphic "${serial}" module "${value}"   import_resource cfg_graphic "${serial}" module "${value}"
49  }  }
50    
51    control_graphic_driver()
52    {
53     local serial="${CLASS_ARGV[0]}"
54     push_config_10_graphic_driver "${serial}"
55    }
56    
57    push_config_10_graphic_driver()
58    {
59     local serial="$1"
60     local value
61    
62     value=$(mysqldo "select module from cfg_graphic where serial='${serial}'")
63     control_client "${serial}" set graphic.driver "${value}"
64    }
65    
66  # set_graphic_resolution $serial $value  # set_graphic_resolution $serial $value
67  set_graphic_resolution()  set_graphic_resolution()
68  {  {
69   local serial="$1"   local serial="${CLASS_ARGV[0]}"
70   local value="$2"   local value="${CLASS_ARGV[1]}"
71    
72   import_resource cfg_graphic "${serial}" resolution "${value}"   import_resource cfg_graphic "${serial}" resolution "${value}"
73  }  }
# Line 21  set_graphic_resolution() Line 75  set_graphic_resolution()
75  # control_graphic_resolution $serial  # control_graphic_resolution $serial
76  control_graphic_resolution()  control_graphic_resolution()
77  {  {
78     local serial="${CLASS_ARGV[0]}"
79     push_config_10_graphic_resolution "${serial}"
80    }
81    
82    push_config_10_graphic_resolution()
83    {
84   local serial="$1"   local serial="$1"
85   local value   local value
86    
# Line 31  control_graphic_resolution() Line 91  control_graphic_resolution()
91  # set_graphic_depth $serial $value  # set_graphic_depth $serial $value
92  set_graphic_depth()  set_graphic_depth()
93  {  {
94   local serial="$1"   local serial="${CLASS_ARGV[0]}"
95   local value="$2"   local value="${CLASS_ARGV[1]}"
96    
97   import_resource cfg_graphic "${serial}" depth "${value}"   import_resource cfg_graphic "${serial}" depth "${value}"
98  }  }
99    
100    control_graphic_depth()
101    {
102     local serial="${CLASS_ARGV[0]}"
103     push_config_10_graphic_depth "${serial}"
104    }
105    
106    push_config_10_graphic_depth()
107    {
108     local serial="$1"
109     local value
110    
111     value=$(mysqldo "select depth from cfg_graphic where serial='${serial}'")
112     control_client "${serial}" set graphic.depth "${value}"
113    }
114    
115  # set_graphic_refesh $serial $value  # set_graphic_refesh $serial $value
116  set_graphic_refresh()  set_graphic_refresh()
117  {  {
118   local serial="$1"   local serial="${CLASS_ARGV[0]}"
119   local value="$2"   local value="${CLASS_ARGV[1]}"
120    
121   import_resource cfg_graphic "${serial}" hz "${value}"   import_resource cfg_graphic "${serial}" refresh_rate "${value}"
122  }  }
123    
124  # control_graphic_resolution $serial  # control_graphic_resolution $serial
125  control_graphic_refresh()  control_graphic_refresh()
126  {  {
127     local serial="${CLASS_ARGV[0]}"
128     push_config_10_graphic_refresh "${serial}"
129    }
130    
131    push_config_10_graphic_refresh()
132    {
133   local serial="$1"   local serial="$1"
134   local value   local value
135    
136   value=$(mysqldo "select hz from cfg_graphic where serial='${serial}'")   value=$(mysqldo "select hz from cfg_graphic where serial='${serial}'")
137   control_client "${serial}" set graphic.resolution "${value}"   control_client "${serial}" set graphic.resolution "${value}"
138  }  }
139    
140    # set_graphic_hdmi $serial $value
141    set_graphic_hdmi()
142    {
143     local serial="${CLASS_ARGV[0]}"
144     local value="${CLASS_ARGV[1]}"
145    
146     import_resource cfg_graphic "${serial}" hdmi "${value}"
147    }
148    
149    # control_graphic_hdmi $serial
150    control_graphic_hdmi()
151    {
152     local serial="${CLASS_ARGV[0]}"
153     push_config_10_graphic_hdmi "${serial}"
154    }
155    
156    push_config_10_graphic_hdmi()
157    {
158     local serial="$1"
159     local value
160    
161     value=$(mysqldo "select hdmi from cfg_graphic where serial='${serial}'")
162     control_client "${serial}" set graphic.hdmi "${value}"
163    }
164    
165    push_firstboot_10_graphic_driver()
166    {
167     local serial="$1"
168     local graphic_driver
169    
170     if [[ ${MCORE_GRAPHIC_HWDETECT_DEEP} = 1 ]]
171     then
172     nsslsay_queue_init
173     nsslsay_queue_add "nocolors"
174     nsslsay_queue_add "get hardware.detect driver graphic"
175     graphic_driver=$(control_client "${serial}" run-queue)
176     if [[ -n ${graphic_driver} ]]
177     then
178     decho "graphic_driver='${graphic_driver}'"
179     import_resource cfg_graphic "${serial}" module "${graphic_driver}"
180     else
181     decho "no graphic_driver found"
182     fi
183     else
184     # default to runtime autodetection
185     graphic_driver="auto"
186     import_resource cfg_graphic "${serial}" module "${graphic_driver}"
187     fi
188    }
189    
190    push_firstboot_10_graphic_resolution()
191    {
192     local serial="$1"
193     local monitor_info
194     local monitor_resolution
195    
196     if [[ ${MCORE_GRAPHIC_HWDETECT_DEEP} = 1 ]]
197     then
198     nsslsay_queue_init
199     nsslsay_queue_add "nocolors"
200     nsslsay_queue_add "get hardware.detect info monitor"
201     monitor_info=$(control_client "${serial}" run-queue)
202     monitor_resolution="${monitor_info##*;}"
203     if [[ -n ${monitor_resolution} ]]
204     then
205     decho "monitor_resolution='${monitor_resolution}'"
206     import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}"
207     else
208     decho "no monitor_resolution found"
209     fi
210     else
211     monitor_resolution="auto"
212     import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}"
213     fi
214    }

Legend:
Removed from v.2286  
changed lines
  Added in v.2844