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 2828 by niro, Fri Aug 4 08:40:36 2017 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    
27   # rebuild 25-gfxcard.conf   # rebuild 25-gfxcard.conf
28   # always clear the config   # always clear the config
29   CONFIG="${MROOT}/etc/X11/xorg.conf.d/25-device.conf"   CONFIG="${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/25-device.conf"
30   clearconfig   clearconfig
31   addconfig "# Autogenerated by mcored"   addconfig "# Autogenerated by mcored"
32   # 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 39  helper_graphic_rebuild_xorg_conf_d()
39    
40   # rebuild 25-module.conf   # rebuild 25-module.conf
41   # always clear the config   # always clear the config
42   CONFIG="${MROOT}/etc/X11/xorg.conf.d/25-module.conf"   CONFIG="${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/25-module.conf"
43   clearconfig   clearconfig
44   addconfig "# Autogenerated by mcored"   addconfig "# Autogenerated by mcored"
45   # 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 52  helper_graphic_rebuild_xorg_conf_d()
52    
53   # rebuild 25-screen.conf   # rebuild 25-screen.conf
54   # always clear the config   # always clear the config
55   CONFIG="${MROOT}/etc/X11/xorg.conf.d/25-screen.conf"   CONFIG="${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/25-screen.conf"
56   clearconfig   clearconfig
57   addconfig "# Autogenerated by mcored"   addconfig "# Autogenerated by mcored"
58   # 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 64  helper_graphic_rebuild_xorg_conf_d()
64   helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen   helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen
65   addconfig 'EndSection'   addconfig 'EndSection'
66   fi   fi
67    
68     # always disable hdmi port on zotac devices atm - fixme make it configurable like alx
69     CONFIG="${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/30-fix-zotac.conf"
70     clearconfig
71     if [ -e /sys/devices/virtual/dmi/id/board_vendor ]
72     then
73     boardvendor="$(< /sys/devices/virtual/dmi/id/board_vendor)"
74     # decapitalize
75     boardvendor="${boardvendor,,}"
76     case ${boardvendor} in
77     *zotac*)
78     addconfig "# Autogenerated by mcored"
79     addconfig "Section \"Monitor\""
80     addconfig " Identifier \"LVDS1\""
81     addconfig " Option \"Ignore\" \"True\""
82     addconfig "EndSection"
83     ;;
84     esac
85     fi
86  }  }
87    
88  help_graphic_resolution()  help_graphic_resolution()
89  {  {
90   mecho "set graphic.resolution [resolution]"   mecho "set graphic.resolution [resolution]"
91   mecho " 800x600, 1024x768, 1280x1024 etc"   mecho " auto, 800x600, 1024x768, 1280x1024 etc"
92  }  }
93    
94  help_graphic_refresh()  help_graphic_refresh()
95  {  {
96   mecho "set graphic.refresh [refresh rate]"   mecho "set graphic.refresh [refresh rate]"
97   mecho "  60, 100 - all values are Hz"   mecho "  auto, 60, 100 - all values are Hz"
98  }  }
99    
100  help_graphic_depth()  help_graphic_depth()
101  {  {
102   mecho "set graphic.depth [color-depth]"   mecho "set graphic.depth [color-depth]"
103   mecho "  1, 4, 8, 15, 16, 24 - all values are bits"   mecho "  auto, 1, 4, 8, 15, 16, 24 - all values are bits"
104  }  }
105    
106  help_graphic_driver()  help_graphic_driver()
# Line 98  help_graphic_driver() Line 118  help_graphic_driver()
118  # set_graphic_resolution ${value}  # set_graphic_resolution ${value}
119  set_graphic_resolution()  set_graphic_resolution()
120  {  {
121   local resolution="$1"   local resolution="${CLASS_ARGV[0]}"
122   local CONFIG   local CONFIG
123   local depth   local depth
124   [[ -z ${resolution} ]] && help_graphic_resolution && return 1   [[ -z ${resolution} ]] && help_graphic_resolution && return 1
125    
126   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  
127    
128   if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]   case ${resolution} in
129   then   *x*)
130   x11runas "xrandr --size ${resolution}"   clearconfig
131   fi   # do it for all supported color depth
132     for depth in 1 4 8 15 16 24
133     do
134     addconfig ' SubSection "Display"'
135     addconfig " Depth ${depth}"
136     addconfig " Modes \"${resolution}\""
137     addconfig ' ViewPort 0 0'
138     addconfig ' EndSubSection'
139     done
140    
141     if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
142     then
143     x11runas "xrandr --size ${resolution}"
144     fi
145     ;;
146     auto) clearconfig ;;
147     esac
148    
149   helper_graphic_rebuild_xorg_conf_d   helper_graphic_rebuild_xorg_conf_d
150  }  }
# Line 126  set_graphic_resolution() Line 152  set_graphic_resolution()
152  # set_graphic_depth ${value}  # set_graphic_depth ${value}
153  set_graphic_depth()  set_graphic_depth()
154  {  {
155   local depth="$1"   local depth="${CLASS_ARGV[0]}"
156   local CONFIG   local CONFIG
157   [[ -z ${depth} ]] && help_graphic_depth && return 1   [[ -z ${depth} ]] && help_graphic_depth && return 1
158    
159     CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf"
160    
161   # do it only for supported color depths   # do it only for supported color depths
162   case "${depth}" in   case "${depth}" in
163   1|4|8|15|16|24)   1|4|8|15|16|24)
  CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf"  
164   clearconfig   clearconfig
165   addconfig " DefaultDepth ${depth}"   addconfig " DefaultDepth ${depth}"
166   ;;   ;;
167     auto) clearconfig ;;
168   *) help_graphic_depth && return 1 ;;   *) help_graphic_depth && return 1 ;;
169   esac   esac
170    
# Line 150  set_graphic_depth() Line 178  set_graphic_depth()
178  # set_graphic_refresh ${value}  # set_graphic_refresh ${value}
179  set_graphic_refresh()  set_graphic_refresh()
180  {  {
181   local value="$1"   local value="${CLASS_ARGV[0]}"
182   [[ -z ${value} ]] && help_graphic_refresh && return 1   [[ -z ${value} ]] && help_graphic_refresh && return 1
183    
184   #echo "${value}" > ${MROOT}/${MCORE_CONFIG_PATH}/xorg/refresh   #echo "${value}" > ${MROOT}/${MCORE_CONFIG_PATH}/xorg/refresh
# Line 165  set_graphic_refresh() Line 193  set_graphic_refresh()
193    
194  set_graphic_driver()  set_graphic_driver()
195  {  {
196   local driver="$1"   local driver="${CLASS_ARGV[0]}"
197   local driverdir="/usr/lib/xorg/modules/drivers"   local driverdir="@@LIBDIR@@/xorg/modules/drivers"
198   local CONFIG   local CONFIG
199   [[ -z ${driver} ]] && help_graphic_driver && return 1   [[ -z ${driver} ]] && help_graphic_driver && return 1
200    
201   if [[ -f ${MROOT}/${driverdir}/${driver}_drv.so ]]   if [[ ${driver} = auto ]]
202     then
203     decho "Using driver autodetection, doing nothing"
204     elif [[ -f ${MROOT}/${driverdir}/${driver}_drv.so ]]
205   then   then
206   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"
207   clearconfig   clearconfig
# Line 189  set_graphic_driver() Line 220  set_graphic_driver()
220    
221  get_graphic_driver()  get_graphic_driver()
222  {  {
223   local action="$1"   local action="${CLASS_ARGV[0]}"
224   local driverdir="/usr/lib/xorg/modules/drivers"   local driverdir="@@LIBDIR@@/xorg/modules/drivers"
225   local driver   local driver
226   local config="${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"   local config="${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"
227   local i   local i

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