22 |
{ |
{ |
23 |
local CONFIG |
local CONFIG |
24 |
local conf |
local conf |
25 |
|
local boardvendor |
26 |
|
local write_zotac_quirk |
27 |
|
|
28 |
# rebuild 25-gfxcard.conf |
# rebuild 25-gfxcard.conf |
29 |
# always clear the config |
# always clear the config |
65 |
helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen |
helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen |
66 |
addconfig 'EndSection' |
addconfig 'EndSection' |
67 |
fi |
fi |
68 |
|
|
69 |
|
# always disable hdmi port on zotac devices atm - fixme make it configurable like alx |
70 |
|
CONFIG="${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/30-fix-zotac.conf" |
71 |
|
clearconfig |
72 |
|
write_zotac_quirk=0 |
73 |
|
if [ -e /sys/devices/virtual/dmi/id/board_vendor ] |
74 |
|
then |
75 |
|
boardvendor="$(< /sys/devices/virtual/dmi/id/board_vendor)" |
76 |
|
# decapitalize |
77 |
|
boardvendor="${boardvendor,,}" |
78 |
|
case ${boardvendor} in |
79 |
|
*zotac*) write_zotac_quirk=1 ;; |
80 |
|
esac |
81 |
|
fi |
82 |
|
# some zotacs has as the board_vendor "filled by o.e.m" |
83 |
|
# so we search the whole devices subtree for zotac vendor matches |
84 |
|
# 0x19da="ZOTAC International (MCO) Ltd." |
85 |
|
if [[ -n $(cat /sys/devices/*/*/subsystem_vendor | grep 0x19da) ]] |
86 |
|
then |
87 |
|
write_zotac_quirk=1 |
88 |
|
fi |
89 |
|
|
90 |
|
if [ -f ${MCORE_CONFIG_PATH}/xorg/device/30-hdmi.conf ] |
91 |
|
then |
92 |
|
source ${MCORE_CONFIG_PATH}/xorg/device/30-hdmi.conf |
93 |
|
case "${graphic_hdmi}" in |
94 |
|
enabled) write_zotac_quirk=0 ;; |
95 |
|
disabled) write_zotac_quirk=1 ;; |
96 |
|
esac |
97 |
|
fi |
98 |
|
|
99 |
|
if [[ ${write_zotac_quirk} = 1 ]] |
100 |
|
then |
101 |
|
addconfig "# Autogenerated by mcored" |
102 |
|
addconfig "Section \"Monitor\"" |
103 |
|
addconfig " Identifier \"LVDS1\"" |
104 |
|
addconfig " Option \"Ignore\" \"True\"" |
105 |
|
addconfig "EndSection" |
106 |
|
fi |
107 |
} |
} |
108 |
|
|
109 |
help_graphic_resolution() |
help_graphic_resolution() |
136 |
mecho " Selects the graphic card driver used by Xorg." |
mecho " Selects the graphic card driver used by Xorg." |
137 |
} |
} |
138 |
|
|
139 |
|
help_graphic_hdmi() |
140 |
|
{ |
141 |
|
mecho "set graphic.hdmi [action]" |
142 |
|
mecho " Available actions:" |
143 |
|
mecho " enable - enables the hdmi port" |
144 |
|
mecho " disable - disables the hdmi port" |
145 |
|
} |
146 |
|
|
147 |
# set_graphic_resolution ${value} |
# set_graphic_resolution ${value} |
148 |
set_graphic_resolution() |
set_graphic_resolution() |
149 |
{ |
{ |
247 |
fi |
fi |
248 |
} |
} |
249 |
|
|
250 |
|
set_graphic_hdmi() |
251 |
|
{ |
252 |
|
local action="${CLASS_ARGV[0]}" |
253 |
|
local CONFIG |
254 |
|
|
255 |
|
case "${action}" in |
256 |
|
enable|disable) |
257 |
|
CONFIG="${MCORE_CONFIG_PATH}/xorg/device/30-hdmi.conf" |
258 |
|
clearconfig |
259 |
|
addconfig "graphic_hdmi=\"${action}\"" |
260 |
|
;; |
261 |
|
*) |
262 |
|
help_graphic_driver |
263 |
|
return 1 |
264 |
|
;; |
265 |
|
esac |
266 |
|
} |
267 |
|
|
268 |
get_graphic_driver() |
get_graphic_driver() |
269 |
{ |
{ |
270 |
local action="${CLASS_ARGV[0]}" |
local action="${CLASS_ARGV[0]}" |
293 |
;; |
;; |
294 |
esac |
esac |
295 |
} |
} |
296 |
|
|
297 |
|
get_graphic_hdmi() |
298 |
|
{ |
299 |
|
local CONFIG="${MCORE_CONFIG_PATH}/xorg/device/30-hdmi.conf" |
300 |
|
if [ -f ${CONFIG} ] |
301 |
|
then |
302 |
|
rvecho "$(< ${CONFIG})" |
303 |
|
fi |
304 |
|
} |