Magellan Linux

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

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

mcore-src/trunk/mcore-tools/daemon/client/include/graphic.client.class revision 2039 by niro, Wed Apr 17 14:15:55 2013 UTC mcore-src/trunk/mcore-tools/src/modules/basic-video/graphic.client.class.in revision 2843 by niro, Fri Nov 16 13:47:13 2018 UTC
# Line 22  helper_graphic_rebuild_xorg_conf_d() Line 22  helper_graphic_rebuild_xorg_conf_d()
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
30   CONFIG="${MROOT}/etc/X11/xorg.conf.d/25-device.conf"   CONFIG="${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/25-device.conf"
31   clearconfig   clearconfig
32   addconfig "# Autogenerated by mcored"   addconfig "# Autogenerated by mcored"
33   # but only add lines if some values are found in config.d dir   # but only add lines if some values are found in config.d dir
# Line 38  helper_graphic_rebuild_xorg_conf_d() Line 40  helper_graphic_rebuild_xorg_conf_d()
40    
41   # rebuild 25-module.conf   # rebuild 25-module.conf
42   # always clear the config   # always clear the config
43   CONFIG="${MROOT}/etc/X11/xorg.conf.d/25-module.conf"   CONFIG="${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/25-module.conf"
44   clearconfig   clearconfig
45   addconfig "# Autogenerated by mcored"   addconfig "# Autogenerated by mcored"
46   # but only add lines if some values are found in config.d dir   # but only add lines if some values are found in config.d dir
# Line 51  helper_graphic_rebuild_xorg_conf_d() Line 53  helper_graphic_rebuild_xorg_conf_d()
53    
54   # rebuild 25-screen.conf   # rebuild 25-screen.conf
55   # always clear the config   # always clear the config
56   CONFIG="${MROOT}/etc/X11/xorg.conf.d/25-screen.conf"   CONFIG="${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/25-screen.conf"
57   clearconfig   clearconfig
58   addconfig "# Autogenerated by mcored"   addconfig "# Autogenerated by mcored"
59   # but only add lines if some values are found in config.d dir   # but only add lines if some values are found in config.d dir
# Line 63  helper_graphic_rebuild_xorg_conf_d() Line 65  helper_graphic_rebuild_xorg_conf_d()
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     if [[ ${write_zotac_quirk} = 1 ]]
90     then
91     addconfig "# Autogenerated by mcored"
92     addconfig "Section \"Monitor\""
93     addconfig " Identifier \"LVDS1\""
94     addconfig " Option \"Ignore\" \"True\""
95     addconfig "EndSection"
96     fi
97  }  }
98    
99  help_graphic_resolution()  help_graphic_resolution()
100  {  {
101   mecho "set graphic.resolution [resolution]"   mecho "set graphic.resolution [resolution]"
102   mecho " 800x600, 1024x768, 1280x1024 etc"   mecho " auto, 800x600, 1024x768, 1280x1024 etc"
103  }  }
104    
105  help_graphic_refresh()  help_graphic_refresh()
106  {  {
107   mecho "set graphic.refresh [refresh rate]"   mecho "set graphic.refresh [refresh rate]"
108   mecho "  60, 100 - all values are Hz"   mecho "  auto, 60, 100 - all values are Hz"
109  }  }
110    
111  help_graphic_depth()  help_graphic_depth()
112  {  {
113   mecho "set graphic.depth [color-depth]"   mecho "set graphic.depth [color-depth]"
114   mecho "  1, 4, 8, 15, 16, 24 - all values are bits"   mecho "  auto, 1, 4, 8, 15, 16, 24 - all values are bits"
115  }  }
116    
117  help_graphic_driver()  help_graphic_driver()
# Line 98  help_graphic_driver() Line 129  help_graphic_driver()
129  # set_graphic_resolution ${value}  # set_graphic_resolution ${value}
130  set_graphic_resolution()  set_graphic_resolution()
131  {  {
132   local resolution="$1"   local resolution="${CLASS_ARGV[0]}"
133   local CONFIG   local CONFIG
134   local depth   local depth
135   [[ -z ${resolution} ]] && help_graphic_resolution && return 1   [[ -z ${resolution} ]] && help_graphic_resolution && return 1
136    
137   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/20-resolution.conf"   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/20-resolution.conf"
  clearconfig  
  # do it for all supported color depth  
  for depth in 1 4 8 15 16 24  
  do  
  addconfig ' SubSection "Display"'  
  addconfig " Depth ${depth}"  
  addconfig " Modes \"${resolution}\""  
  addconfig ' ViewPort 0 0'  
  addconfig ' EndSubSection'  
  done  
138    
139   if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]   case ${resolution} in
140   then   *x*)
141   x11runas "xrandr --size ${resolution}"   clearconfig
142   fi   # do it for all supported color depth
143     for depth in 1 4 8 15 16 24
144     do
145     addconfig ' SubSection "Display"'
146     addconfig " Depth ${depth}"
147     addconfig " Modes \"${resolution}\""
148     addconfig ' ViewPort 0 0'
149     addconfig ' EndSubSection'
150     done
151    
152     if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
153     then
154     x11runas "xrandr --size ${resolution}"
155     fi
156     ;;
157     auto) clearconfig ;;
158     esac
159    
160   helper_graphic_rebuild_xorg_conf_d   helper_graphic_rebuild_xorg_conf_d
161  }  }
# Line 126  set_graphic_resolution() Line 163  set_graphic_resolution()
163  # set_graphic_depth ${value}  # set_graphic_depth ${value}
164  set_graphic_depth()  set_graphic_depth()
165  {  {
166   local depth="$1"   local depth="${CLASS_ARGV[0]}"
167   local CONFIG   local CONFIG
168   [[ -z ${depth} ]] && help_graphic_depth && return 1   [[ -z ${depth} ]] && help_graphic_depth && return 1
169    
170     CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf"
171    
172   # do it only for supported color depths   # do it only for supported color depths
173   case "${depth}" in   case "${depth}" in
174   1|4|8|15|16|24)   1|4|8|15|16|24)
  CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf"  
175   clearconfig   clearconfig
176   addconfig " DefaultDepth ${depth}"   addconfig " DefaultDepth ${depth}"
177   ;;   ;;
178     auto) clearconfig ;;
179   *) help_graphic_depth && return 1 ;;   *) help_graphic_depth && return 1 ;;
180   esac   esac
181    
# Line 150  set_graphic_depth() Line 189  set_graphic_depth()
189  # set_graphic_refresh ${value}  # set_graphic_refresh ${value}
190  set_graphic_refresh()  set_graphic_refresh()
191  {  {
192   local value="$1"   local value="${CLASS_ARGV[0]}"
193   [[ -z ${value} ]] && help_graphic_refresh && return 1   [[ -z ${value} ]] && help_graphic_refresh && return 1
194    
195   #echo "${value}" > ${MROOT}/${MCORE_CONFIG_PATH}/xorg/refresh   #echo "${value}" > ${MROOT}/${MCORE_CONFIG_PATH}/xorg/refresh
# Line 165  set_graphic_refresh() Line 204  set_graphic_refresh()
204    
205  set_graphic_driver()  set_graphic_driver()
206  {  {
207   local driver="$1"   local driver="${CLASS_ARGV[0]}"
208   local driverdir="/usr/lib/xorg/modules/drivers"   local driverdir="@@LIBDIR@@/xorg/modules/drivers"
209   local CONFIG   local CONFIG
210   [[ -z ${driver} ]] && help_graphic_driver && return 1   [[ -z ${driver} ]] && help_graphic_driver && return 1
211    
212   if [[ -f ${MROOT}/${driverdir}/${driver}_drv.so ]]   if [[ ${driver} = auto ]]
213     then
214     decho "Using driver autodetection, doing nothing"
215     elif [[ -f ${MROOT}/${driverdir}/${driver}_drv.so ]]
216   then   then
217   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"
218   clearconfig   clearconfig
# Line 189  set_graphic_driver() Line 231  set_graphic_driver()
231    
232  get_graphic_driver()  get_graphic_driver()
233  {  {
234   local action="$1"   local action="${CLASS_ARGV[0]}"
235   local driverdir="/usr/lib/xorg/modules/drivers"   local driverdir="@@LIBDIR@@/xorg/modules/drivers"
236   local driver   local driver
237   local config="${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"   local config="${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"
238   local i   local i

Legend:
Removed from v.2039  
changed lines
  Added in v.2843