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

revision 2269 by niro, Tue Jan 14 10:34:57 2014 UTC 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
# 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 104  set_graphic_resolution() Line 124  set_graphic_resolution()
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 130  set_graphic_depth() Line 156  set_graphic_depth()
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 170  set_graphic_driver() Line 198  set_graphic_driver()
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

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