Contents of /trunk/mcore-tools/mcore-tools-1.0.0-honor-variable-hdmi-configuration.patch
Parent Directory | Revision Log
Revision 3248 -
(show annotations)
(download)
Fri Nov 16 13:51:49 2018 UTC (5 years, 10 months ago) by niro
File size: 3245 byte(s)
Fri Nov 16 13:51:49 2018 UTC (5 years, 10 months ago) by niro
File size: 3245 byte(s)
-add mcore-tools fixes
1 | ------------------------------------------------------------------------ |
2 | r2844 | niro | 2018-11-16 14:48:00 +0100 (Fr, 16. Nov 2018) | 1 Zeile |
3 | |
4 | -support variable hdmi configuration |
5 | |
6 | Index: mcore-tools/src/modules/basic-video/graphic.client.class.in |
7 | =================================================================== |
8 | --- mcore-tools/src/modules/basic-video/graphic.client.class.in (Revision 2843) |
9 | +++ mcore-tools/src/modules/basic-video/graphic.client.class.in (Revision 2844) |
10 | @@ -86,6 +86,16 @@ |
11 | then |
12 | write_zotac_quirk=1 |
13 | fi |
14 | + |
15 | + if [ -f ${MCORE_CONFIG_PATH}/xorg/device/30-hdmi.conf ] |
16 | + then |
17 | + source ${MCORE_CONFIG_PATH}/xorg/device/30-hdmi.conf |
18 | + case "${graphic_hdmi}" in |
19 | + enabled) write_zotac_quirk=0 ;; |
20 | + disabled) write_zotac_quirk=1 ;; |
21 | + esac |
22 | + fi |
23 | + |
24 | if [[ ${write_zotac_quirk} = 1 ]] |
25 | then |
26 | addconfig "# Autogenerated by mcored" |
27 | @@ -126,6 +136,14 @@ |
28 | mecho " Selects the graphic card driver used by Xorg." |
29 | } |
30 | |
31 | +help_graphic_hdmi() |
32 | +{ |
33 | + mecho "set graphic.hdmi [action]" |
34 | + mecho " Available actions:" |
35 | + mecho " enable - enables the hdmi port" |
36 | + mecho " disable - disables the hdmi port" |
37 | +} |
38 | + |
39 | # set_graphic_resolution ${value} |
40 | set_graphic_resolution() |
41 | { |
42 | @@ -229,6 +247,24 @@ |
43 | fi |
44 | } |
45 | |
46 | +set_graphic_hdmi() |
47 | +{ |
48 | + local action="${CLASS_ARGV[0]}" |
49 | + local CONFIG |
50 | + |
51 | + case "${action}" in |
52 | + enable|disable) |
53 | + CONFIG="${MCORE_CONFIG_PATH}/xorg/device/30-hdmi.conf" |
54 | + clearconfig |
55 | + addconfig "graphic_hdmi=\"${action}\"" |
56 | + ;; |
57 | + *) |
58 | + help_graphic_driver |
59 | + return 1 |
60 | + ;; |
61 | + esac |
62 | +} |
63 | + |
64 | get_graphic_driver() |
65 | { |
66 | local action="${CLASS_ARGV[0]}" |
67 | @@ -257,3 +293,12 @@ |
68 | ;; |
69 | esac |
70 | } |
71 | + |
72 | +get_graphic_hdmi() |
73 | +{ |
74 | + local CONFIG="${MCORE_CONFIG_PATH}/xorg/device/30-hdmi.conf" |
75 | + if [ -f ${CONFIG} ] |
76 | + then |
77 | + rvecho "$(< ${CONFIG})" |
78 | + fi |
79 | +} |
80 | Index: mcore-tools/src/modules/basic-video/graphic.control.class.in |
81 | =================================================================== |
82 | --- mcore-tools/src/modules/basic-video/graphic.control.class.in (Revision 2843) |
83 | +++ mcore-tools/src/modules/basic-video/graphic.control.class.in (Revision 2844) |
84 | @@ -7,6 +7,7 @@ |
85 | push_config 10_graphic_resolution |
86 | push_config 10_graphic_depth |
87 | #push_config 10_graphic_refresh |
88 | +push_config 10_graphic_hdmi |
89 | |
90 | help_graphic_resolution() |
91 | { |
92 | @@ -32,6 +33,12 @@ |
93 | control_client "${serial}" help graphic.driver |
94 | } |
95 | |
96 | +help_graphic_hdmi() |
97 | +{ |
98 | + local serial="${CLASS_ARGV[0]}" |
99 | + control_client "${serial}" help graphic.hdmi |
100 | +} |
101 | + |
102 | # set_graphic_driver $serial $value |
103 | set_graphic_driver() |
104 | { |
105 | @@ -130,6 +137,31 @@ |
106 | control_client "${serial}" set graphic.resolution "${value}" |
107 | } |
108 | |
109 | +# set_graphic_hdmi $serial $value |
110 | +set_graphic_hdmi() |
111 | +{ |
112 | + local serial="${CLASS_ARGV[0]}" |
113 | + local value="${CLASS_ARGV[1]}" |
114 | + |
115 | + import_resource cfg_graphic "${serial}" hdmi "${value}" |
116 | +} |
117 | + |
118 | +# control_graphic_hdmi $serial |
119 | +control_graphic_hdmi() |
120 | +{ |
121 | + local serial="${CLASS_ARGV[0]}" |
122 | + push_config_10_graphic_hdmi "${serial}" |
123 | +} |
124 | + |
125 | +push_config_10_graphic_hdmi() |
126 | +{ |
127 | + local serial="$1" |
128 | + local value |
129 | + |
130 | + value=$(mysqldo "select hdmi from cfg_graphic where serial='${serial}'") |
131 | + control_client "${serial}" set graphic.hdmi "${value}" |
132 | +} |
133 | + |
134 | push_firstboot_10_graphic_driver() |
135 | { |
136 | local serial="$1" |
137 | |
138 | ------------------------------------------------------------------------ |