summaryrefslogtreecommitdiff
path: root/xc/programs
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs')
-rw-r--r--xc/programs/Imakefile8
-rw-r--r--xc/programs/Xserver/GL/dri/Imakefile5
-rw-r--r--xc/programs/Xserver/GL/dri/dri.c4
-rw-r--r--xc/programs/Xserver/GL/glx/Imakefile16
-rw-r--r--xc/programs/Xserver/GL/glx/glxcmds.c17
-rw-r--r--xc/programs/Xserver/GL/glx/single2.c6
-rw-r--r--xc/programs/Xserver/Imakefile40
-rw-r--r--xc/programs/Xserver/Xext/shape.c28
-rw-r--r--xc/programs/Xserver/Xext/shm.c6
-rw-r--r--xc/programs/Xserver/Xext/vidmodeproc.h5
-rw-r--r--xc/programs/Xserver/Xext/xf86bigfont.c4
-rw-r--r--xc/programs/Xserver/Xext/xf86vmode.c234
-rw-r--r--xc/programs/Xserver/Xext/xvdix.h4
-rw-r--r--xc/programs/Xserver/dix/main.c5
-rw-r--r--xc/programs/Xserver/hw/darwin/Imakefile8
-rw-r--r--xc/programs/Xserver/hw/darwin/XDarwin.man50
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf66
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile19
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings4
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/info.nib15
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nibbin7656 -> 8939 bytes
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html60
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp90
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Imakefile27
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf66
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile19
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.stringsbin412 -> 0 bytes
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/info.nib15
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nibbin8235 -> 9545 bytes
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html125
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp144
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Preferences.h5
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Preferences.m48
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj52
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Xserver.h6
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/Xserver.m88
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartz.c18
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m13
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c4
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c125
-rw-r--r--xc/programs/Xserver/hw/darwin/bundle/quartzShared.h10
-rw-r--r--xc/programs/Xserver/hw/darwin/darwin.c94
-rw-r--r--xc/programs/Xserver/hw/darwin/xfIOKit.c3
-rw-r--r--xc/programs/Xserver/hw/kdrive/kinput.c4
-rw-r--r--xc/programs/Xserver/hw/sun/sunIo.c4
-rw-r--r--xc/programs/Xserver/hw/sunLynx/sunLyIo.c4
-rw-r--r--xc/programs/Xserver/hw/vfb/Imakefile9
-rw-r--r--xc/programs/Xserver/hw/vfb/InitInput.c98
-rw-r--r--xc/programs/Xserver/hw/vfb/InitOutput.c72
-rw-r--r--xc/programs/Xserver/hw/vfb/ntux_xf.c133
-rw-r--r--xc/programs/Xserver/hw/vfb/windef.h227
-rw-r--r--xc/programs/Xserver/hw/vfb/windows.h152
-rw-r--r--xc/programs/Xserver/hw/xfree86/CHANGELOG315
-rw-r--r--xc/programs/Xserver/hw/xfree86/Imakefile3
-rw-r--r--xc/programs/Xserver/hw/xfree86/Options208
-rw-r--r--xc/programs/Xserver/hw/xfree86/XF86Config.man78
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/Imakefile3
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/atKeynames.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86.h7
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Bus.c31
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Config.c11
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Configure.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Events.c7
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Globals.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Helper.c57
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Init.c11
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Mode.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Opt.h22
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Option.c30
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h8
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Priv.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86Resources.h22
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c37
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86cmap.c144
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86cmap.h22
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86fbman.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c167
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86str.h20
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86xv.c14
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86xv.h9
-rw-r--r--xc/programs/Xserver/hw/xfree86/ddc/print_edid.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c33
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/DESIGN83
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/Imakefile6
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/Install105
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/LICENSE2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/OS2.Notes2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README61
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.DECtga4
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.DRI133
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp15
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.Darwin363
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.I1282
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.LynxOS16
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.NetBSD18
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD14
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.SiS2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.apm2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.ati2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.chips200
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.cyrix2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.dps2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.fonts2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.i7402
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.i8102
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.isc2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.mouse4
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.newport2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.r1282
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.rapidaccess48
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.rendition2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/README.s3virge4
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/RELNOTES43
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/Status176
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/Versions2
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml85
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml144
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml14
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml368
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile17
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml97
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml4
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml37
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml9
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml8
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml197
-rw-r--r--xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent26
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h5
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c20
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile39
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c7
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c19
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h8
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c11
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c9
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c9
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c52
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h35
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man54
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c53
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c103
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h53
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c11
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c62
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c171
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h53
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h11
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man18
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c5
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c110
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c5
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c1061
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h149
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c9
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c211
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c114
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c31
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c19
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c22
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c18
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c89
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm345
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h41
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c20
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c545
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h15
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c12
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c15
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c37
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c13
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c1065
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c100
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c18
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c86
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c90
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c13
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c31
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c115
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h5
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c325
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c144
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile8
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c14
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c99
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man9
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c173
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c15
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c34
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile7
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c68
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c89
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c149
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h18
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c7
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c80
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man17
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c23
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c37
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c148
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c28
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h8
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c12
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h12
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c174
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h5
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c49
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c64
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c70
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c47
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c17
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c9
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c33
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c25
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c37
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c31
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c20
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile2
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c20
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c45
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile11
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h21
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c45
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c330
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h5
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c1095
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c28
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c64
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c160
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h5
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c56
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c48
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/v4l/README18
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c7
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man27
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c60
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile5
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c96
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile12
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c136
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h30
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c93
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c7
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c27
-rw-r--r--xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/Imakefile13
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh401
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/bin-excl (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-excl)2
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/bin-list2
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/dir (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/dir)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-dir (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-dir)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-list (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-list)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/fsrv-list (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/fsrv-list)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/host.def10
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/lib-excl (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-excl)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/lib-list (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-list)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/man-excl (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-excl)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/man-list (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-list)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/nest-list (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/nest-list)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prog-excl (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-excl)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prog-list (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-list)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prt-list (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prt-list)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/update-upd30
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/vfb-list (renamed from xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/vfb-list)0
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/xserv-list2
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-excl8
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-list2
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/dir1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-dir1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-list1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/fsrv-list2
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/host.def9
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-excl14
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-list2
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-excl3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-list1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/nest-list1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-excl5
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-list3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prt-list1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/quartz-list4
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/update-upd30
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/vfb-list1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/xserv-list2
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-list1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/host.def8
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/xserv-list2
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/bin-list4
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/drivers-upd20
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/update-upd42
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/bin-list7
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/drivers-upd20
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/update-upd47
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/bin-list1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/drivers-upd20
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/update-upd36
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/bin-list10
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/drivers-upd11
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/update-upd53
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/bin-list10
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/drivers-upd20
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/update-upd53
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/bin-list10
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/bin-list10
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/bin-list10
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/bin-list1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/drivers-upd20
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def5
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/update-upd47
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/bin-list4
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/drivers-upd19
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/update-upd42
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-list10
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/drivers-upd19
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/update-upd53
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-list4
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/drivers-upd19
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/update-upd42
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/bin-list2
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/bin-list7
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/drivers-upd20
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/update-upd47
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/bin-list7
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/drivers-upd20
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/update-upd47
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/bin-list7
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/drivers-upd20
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def3
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/update-upd47
-rwxr-xr-xxc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist33
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/common/docupd-upd40
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/common/extras1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/common/flat2-list1
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnon-list9
-rw-r--r--xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnts-excl5
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c5
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c89
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c23
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c5
-rw-r--r--xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c277
-rw-r--r--xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO6
-rw-r--r--xc/programs/Xserver/hw/xfree86/int10/generic.c190
-rw-r--r--xc/programs/Xserver/hw/xfree86/int10/helper_exec.c5
-rw-r--r--xc/programs/Xserver/hw/xfree86/int10/helper_mem.c107
-rw-r--r--xc/programs/Xserver/hw/xfree86/int10/pci.c12
-rw-r--r--xc/programs/Xserver/hw/xfree86/int10/stub.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/int10/xf86int10.h25
-rw-r--r--xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c5
-rw-r--r--xc/programs/Xserver/hw/xfree86/loader/elf.h48
-rw-r--r--xc/programs/Xserver/hw/xfree86/loader/elfloader.c101
-rw-r--r--xc/programs/Xserver/hw/xfree86/loader/xf86sym.c9
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c372
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c13
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h14
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h37
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_bufs.h19
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h11
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h15
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_ioctl.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h18
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c21
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810.h22
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c35
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drm.h5
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c26
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c21
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_cce.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drm.h32
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c26
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_context.c215
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_cp.c22
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.c20
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis.h50
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c221
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drm.h16
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c704
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h53
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c12
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c20
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c155
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c22
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c46
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c24
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c5
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h37
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c10
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c10
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h13
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES18
-rw-r--r--xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c30
-rw-r--r--xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h27
-rw-r--r--xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h28
-rw-r--r--xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c34
-rw-r--r--xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c12
-rw-r--r--xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c25
-rw-r--r--xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c62
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c3
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86Version.h10
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad76
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c131
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/config.h3
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/help.c10
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c48
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c132
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h60
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/options.c366
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/options.h7
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c49
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c47
-rw-r--r--xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man6
-rw-r--r--xc/programs/Xserver/hw/xwin/InitInput.c25
-rw-r--r--xc/programs/Xserver/hw/xwin/InitOutput.c129
-rw-r--r--xc/programs/Xserver/hw/xwin/win.h72
-rw-r--r--xc/programs/Xserver/hw/xwin/winallpriv.c7
-rw-r--r--xc/programs/Xserver/hw/xwin/wincmap.c115
-rw-r--r--xc/programs/Xserver/hw/xwin/wincursor.c3
-rw-r--r--xc/programs/Xserver/hw/xwin/winkeybd.c126
-rw-r--r--xc/programs/Xserver/hw/xwin/winkeymap.h400
-rw-r--r--xc/programs/Xserver/hw/xwin/winmisc.c14
-rw-r--r--xc/programs/Xserver/hw/xwin/winmouse.c216
-rw-r--r--xc/programs/Xserver/hw/xwin/winpfbdd.c150
-rw-r--r--xc/programs/Xserver/hw/xwin/winpixmap.c4
-rw-r--r--xc/programs/Xserver/hw/xwin/winscrinit.c136
-rw-r--r--xc/programs/Xserver/hw/xwin/winshaddd.c201
-rw-r--r--xc/programs/Xserver/hw/xwin/winshadddnl.c195
-rw-r--r--xc/programs/Xserver/hw/xwin/winshadgdi.c205
-rw-r--r--xc/programs/Xserver/hw/xwin/winwakeup.c3
-rw-r--r--xc/programs/Xserver/hw/xwin/winwndproc.c442
-rw-r--r--xc/programs/Xserver/include/misc.h7
-rw-r--r--xc/programs/Xserver/include/opaque.h5
-rw-r--r--xc/programs/Xserver/lbx/lbxdix.c6
-rw-r--r--xc/programs/Xserver/lbx/lbxprop.c9
-rw-r--r--xc/programs/Xserver/mi/mi.h4
-rw-r--r--xc/programs/Xserver/mi/micmap.c5
-rw-r--r--xc/programs/Xserver/mi/mieq.c7
-rw-r--r--xc/programs/Xserver/mi/miinitext.c6
-rw-r--r--xc/programs/Xserver/os/osinit.c6
-rw-r--r--xc/programs/Xserver/os/utils.c3
-rw-r--r--xc/programs/Xserver/os/xdmcp.c3
-rw-r--r--xc/programs/Xserver/render/mipict.c6
539 files changed, 15201 insertions, 9170 deletions
diff --git a/xc/programs/Imakefile b/xc/programs/Imakefile
index ac12fd324..927d1dbc1 100644
--- a/xc/programs/Imakefile
+++ b/xc/programs/Imakefile
@@ -2,7 +2,7 @@ XCOMM $Xorg: Imakefile,v 1.4 2000/08/17 19:47:01 cpqbld Exp $
-XCOMM $XFree86: xc/programs/Imakefile,v 3.44 2001/04/26 21:27:49 dawes Exp $
+XCOMM $XFree86: xc/programs/Imakefile,v 3.45 2001/05/01 17:23:26 alanh Exp $
#define IHaveSubdirs
#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)"
@@ -91,6 +91,10 @@ XINPUTCLIENTDIRS = xsetmode xsetpointer
GLXCLIENTDIRS = glxinfo glxgears
#endif
+#ifndef cygwinArchitecture
+ XLOADDIR = xload
+#endif
+
#if BuildServersOnly || !BuildClients
SUBDIRS = $(XSSRCDIR)
#else
@@ -107,7 +111,7 @@ SUBDIRS = \
xcmsdb $(XCONSOLESRCDIR) xditview $(XDMSRCDIR) xdpyinfo \
$(XF86DGASRCDIR) xedit xev xeyes xfd xfontsel $(XFSSRCDIR) xfsinfo \
$(XFINDPROXYSRCDIR) $(XFWPSRCDIR) $(XGAMMASRCDIR) xgc $(XHOSTSRCDIR) \
- $(XIECLIENTDIRS) $(XINITSRCDIR) $(XKBSRCDIRS) xkill xload xlogo \
+ $(XIECLIENTDIRS) $(XINITSRCDIR) $(XKBSRCDIRS) xkill $(XLOADDIR) xlogo \
xlsatoms \
xlsclients xlsfonts xmag xman xmessage xmh xmodmap xprop xrdb \
xrefresh $(XRXSRCDIR) xset \
diff --git a/xc/programs/Xserver/GL/dri/Imakefile b/xc/programs/Xserver/GL/dri/Imakefile
index 0bda344d3..f5331716d 100644
--- a/xc/programs/Xserver/GL/dri/Imakefile
+++ b/xc/programs/Xserver/GL/dri/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.5 2000/02/23 04:46:52 martin Exp $
+XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.6 2001/04/28 13:55:36 dawes Exp $
#define IHaveModules
#include <Server.tmpl>
@@ -11,7 +11,8 @@ MOBJ = drimodule.o
SRCS = xf86dri.c dri.c $(MSRC)
OBJS = xf86dri.o dri.o $(MOBJ)
- INCLUDES = -I$(SERVERSRC)/include -I$(XTOP)/include -I$(EXTINCSRC) \
+ INCLUDES = -I$(SERVERSRC)/include -I$(INCLUDESRC) -I $(XINCLUDESRC) \
+ -I$(EXTINCSRC) \
-I$(XF86OSSRC) -I$(XF86COMSRC) \
-I../include -I../glx -I$(LIBSRC)/GL/include \
-I$(SERVERSRC)/mi -I$(FONTINCSRC)
diff --git a/xc/programs/Xserver/GL/dri/dri.c b/xc/programs/Xserver/GL/dri/dri.c
index 790961044..fffd6a768 100644
--- a/xc/programs/Xserver/GL/dri/dri.c
+++ b/xc/programs/Xserver/GL/dri/dri.c
@@ -91,6 +91,7 @@ static void DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv);
This will make it easy to turn off some
messages later, based on verbosity
level. */
+
/*
* Since we're already referencing things from the XFree86 common layer in
* this file, we'd might as well just call xf86VDrvMsgVerb, and have
@@ -161,7 +162,7 @@ tryagain:
if (!drmWasAvailable) {
/* drmOpen loaded the kernel module, print a message to say so */
DRIDrvMsg(pScreen->myNum, X_INFO,
- "[drm] loaded kernel module \"%s\"\n",
+ "[drm] loaded kernel module for \"%s\" driver\n",
pDRIInfo->drmDriverName);
}
@@ -476,6 +477,7 @@ DRICloseScreen(ScreenPtr pScreen)
}
drmClose(pDRIPriv->drmFD);
+
xfree(pDRIPriv);
pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
}
diff --git a/xc/programs/Xserver/GL/glx/Imakefile b/xc/programs/Xserver/GL/glx/Imakefile
index 1fd28347a..2a5f17d17 100644
--- a/xc/programs/Xserver/GL/glx/Imakefile
+++ b/xc/programs/Xserver/GL/glx/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/GL/glx/Imakefile,v 1.8 2000/08/24 22:20:09 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/GL/glx/Imakefile,v 1.9 2001/04/28 13:55:36 dawes Exp $
#define IHaveModules
#include <Server.tmpl>
@@ -21,17 +21,11 @@ XCOMM $XFree86: xc/programs/Xserver/GL/glx/Imakefile,v 1.8 2000/08/24 22:20:09 t
g_render.o g_renderswap.o g_single.o g_singleswap.o \
$(MOBJS)
-#if GlxUseSGISI
- INCLUDES = -I. -I../include -I$(SERVERSRC)/include -I$(XTOP)/include \
- -I$(SERVERSRC)/mi \
+ INCLUDES = -I. -I../include -I$(SERVERSRC)/include -I$(INCLUDESRC) \
+ -I$(XINCLUDESRC) -I$(SERVERSRC)/mi \
-I$(EXTINCSRC) -I$(FONTINCSRC) -I$(LIBSRC)/GL/include \
- -I$(XF86SRC) -I$(XF86COMSRC) -I$(XF86OSSRC)
-#else
- INCLUDES = -I. -I../include -I$(SERVERSRC)/include -I$(XTOP)/include \
- -I$(SERVERSRC)/mi \
- -I$(EXTINCSRC) -I$(FONTINCSRC) -I$(LIBSRC)/GL/include \
- -I$(XF86SRC) -I../mesa/include -I../mesa/src -I../mesa/src/X
-#endif
+ -I$(XF86SRC)
+
XCOMM If you add "-DDEBUG" in DEFINES, then make sure you also
XCOMM add DEBUG to the define in ../mesa/src/X/xf86glx.c
DEFINES = $(GLX_DEFINES)
diff --git a/xc/programs/Xserver/GL/glx/glxcmds.c b/xc/programs/Xserver/GL/glx/glxcmds.c
index d495fc8eb..476ff0e60 100644
--- a/xc/programs/Xserver/GL/glx/glxcmds.c
+++ b/xc/programs/Xserver/GL/glx/glxcmds.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/GL/glx/glxcmds.c,v 1.7 2001/03/25 05:32:01 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/GL/glx/glxcmds.c,v 1.8 2001/05/02 15:06:05 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -1014,9 +1014,18 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
if (pDraw) {
__GLXdrawablePrivate *glxPriv;
- glxPriv = __glXGetDrawablePrivate(pDraw, drawId, glxc->modes);
- if (glxPriv == NULL) {
- return __glXBadDrawable;
+ if (glxc) {
+ glxPriv = __glXGetDrawablePrivate(pDraw, drawId, glxc->modes);
+ if (glxPriv == NULL) {
+ return __glXBadDrawable;
+ }
+ }
+ else {
+ glxPriv = __glXFindDrawablePrivate(drawId);
+ if (glxPriv == NULL) {
+ /* This is a window we've never seen before, do nothing */
+ return Success;
+ }
}
if ((*glxPriv->swapBuffers)(glxPriv) == GL_FALSE) {
diff --git a/xc/programs/Xserver/GL/glx/single2.c b/xc/programs/Xserver/GL/glx/single2.c
index 513827593..a4efbca92 100644
--- a/xc/programs/Xserver/GL/glx/single2.c
+++ b/xc/programs/Xserver/GL/glx/single2.c
@@ -243,6 +243,12 @@ char *__glXcombine_strings(const char *cext_string, const char *sext_string)
char *combo_string, *token, *s1;
const char *s2, *end;
+ /* safeguard to prevent potentially fatal errors in the string functions */
+ if (!cext_string)
+ cext_string = "";
+ if (!sext_string)
+ sext_string = "";
+
/*
** String can't be longer than min(cstring, sstring)
** pull tokens out of shortest string
diff --git a/xc/programs/Xserver/Imakefile b/xc/programs/Xserver/Imakefile
index 3c656e191..566010127 100644
--- a/xc/programs/Xserver/Imakefile
+++ b/xc/programs/Xserver/Imakefile
@@ -2,7 +2,7 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:01 cpqbld Exp $
/*
* Server Master Makefile
*/
-XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.226 2001/04/26 21:27:49 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.229 2001/05/18 17:48:30 torrey Exp $
#ifndef InstallXserverSetUID
#define InstallXserverSetUID NO
@@ -1121,21 +1121,21 @@ ServerTarget(Xvfb,$(XVFBDIRS),$(XVFBOBJS), \
#if XWinServer
XCOMM
-XCOMM server with DirectX framebuffer for Windows
+XCOMM X Server for MS Windows
XCOMM
-XWINDDXDIR = hw/xwin
-XWIN = $(XWINDDXDIR)/LibraryTargetName(XWin)
+FBDIR = fb
+SHADOWDIR = miext/shadow
+XWINDIR = hw/xwin
+XWIN = $(XWINDIR)/LibraryTargetName(Xwin)
XWINGDI32 = -lgdi32
XWINDDRAW = -lddraw
-/* XWINOLE32 = -lole32 */
-SHADOWDIR = miext/shadow
-DDXDIR1 = $(XWINDDXDIR)
-XWINDIRS = $(STDDIRS) $(FB) $(SHADOW) $(XWINDDXDIR) $(DEPDIRS)
+DDXDIR1 = $(XWINDIR)
+XWINDIRS = $(STDDIRS) $(FBDIR) $(SHADOWDIR) $(XWINDIR) $(DEPDIRS)
-XWINOBJSA = $(XWINDDXDIR)/stubs.o dix/main.o
+XWINOBJSA = $(XWINDIR)/stubs.o
#if BuildDPMS
-XWINOBJSB = $(XWINDDXDIR)/dpmsstubs.o
+XWINOBJSB = $(XWINDIR)/dpmsstubs.o
#endif
XWINOBJS = $(XWINOBJSA) $(XWINOBJSB)
@@ -1160,24 +1160,20 @@ ServerTarget(XWin,$(XWINDIRS),$(XWINOBJS), \
#ifndef ServerToInstall
#define ServerToInstall XWin
#endif
+
#endif /* XWinServer */
+
#if XDarwinServer
XCOMM
XCOMM X Darwin server for Mac OS X / Darwin
XCOMM
-MFBDIR = mfb
-CFB8DIR = cfb
-CFB16DIR = cfb16
-CFB32DIR = cfb32
+FBDIR = fb
DDXDIR1 = hw/darwin
DDXDIR2 = hw/darwin/bundle
-DARWINDIRS = $(STDDIRS) $(MFBDIR) \
- $(CFB8DIR) $(CFB16DIR) $(CFB32DIR) \
- $(DDXDIR1) $(DEPDIRS)
+DARWINDIRS = $(STDDIRS) $(FBDIR) $(DDXDIR1) $(DEPDIRS)
DARWINOBJS = $(DDXDIR1)/xfIOKitStartup.o
-DARWINLIBS = PreFbLibs $(DDXDIR1)/LibraryTargetName(darwin) \
- $(CFB16) $(CFB32) $(CFB8) PostFbLibs
+DARWINLIBS = PreFbLibs $(DDXDIR1)/LibraryTargetName(darwin) FbPostFbLibs
DARWINSYSLIBS = $(FONTLIBS) $(SYSLIBS) -framework IOKit
/*
@@ -1197,7 +1193,7 @@ QUARTZSYSLIBS = -framework ApplicationServices -framework Cocoa \
-framework CoreAudio -framework Carbon -ObjC
QUARTZOBJS = $(DDXDIR2)/quartzStartup.o
#if NothingOutsideProjectRoot
-XDARWINAPPDIR = $(DESTDIR)$(BINDIR)/XDarwin.app/Contents/MacOS
+XDARWINAPPDIR = $(BINDIR)/XDarwin.app/Contents/MacOS
#else
XDARWINAPPDIR = /Applications/XDarwin.app/Contents/MacOS
#endif
@@ -1210,8 +1206,8 @@ SetUIDServerTarget(XDarwinApp,$(DARWINDIRS),$(QUARTZOBJS), \
$(DARWINSYSLIBS) $(QUARTZSYSLIBS))
install::
- mkdir -p $(XDARWINAPPDIR)
- mv $(DESTDIR)$(BINDIR)/XDarwinApp $(XDARWINAPPDIR)/XDarwin
+ mkdir -p $(DESTDIR)$(XDARWINAPPDIR)
+ mv $(DESTDIR)$(BINDIR)/XDarwinApp $(DESTDIR)$(XDARWINAPPDIR)/XDarwin
-(cd $(DESTDIR)$(BINDIR); $(RM) XDarwinQuartz; \
$(LN) $(XDARWINAPPDIR)/XDarwin XDarwinQuartz)
diff --git a/xc/programs/Xserver/Xext/shape.c b/xc/programs/Xserver/Xext/shape.c
index 4f7a969ee..25485a121 100644
--- a/xc/programs/Xserver/Xext/shape.c
+++ b/xc/programs/Xserver/Xext/shape.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/shape.c,v 3.13 2001/01/17 22:13:16 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/shape.c,v 3.13.2.1 2001/05/31 16:33:38 dawes Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
@@ -206,7 +206,31 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create)
REGION_DESTROY(pScreen, srcRgn);
return Success;
}
- switch (op) {
+
+ /* May/30/2001:
+ * The shape.PS specs say if src is None, existing shape is to be
+ * removed (and so the op-code has no meaning in such removal);
+ * see shape.PS, page 3, ShapeMask.
+ */
+ if (srcRgn == NULL) {
+ if (*destRgnp != NULL) {
+ REGION_DESTROY (pScreen, *destRgnp);
+ *destRgnp = 0;
+ /* go on to remove shape and generate ShapeNotify */
+ }
+ else {
+ /* May/30/2001:
+ * The target currently has no shape in effect, so nothing to
+ * do here. The specs say that ShapeNotify is generated whenever
+ * the client region is "modified"; since no modification is done
+ * here, we do not generate that event. The specs does not say
+ * "it is an error to request removal when there is no shape in
+ * effect", so we return good status.
+ */
+ return Success;
+ }
+ }
+ else switch (op) {
case ShapeSet:
if (*destRgnp)
REGION_DESTROY(pScreen, *destRgnp);
diff --git a/xc/programs/Xserver/Xext/shm.c b/xc/programs/Xserver/Xext/shm.c
index cfc344611..5dbf87ba3 100644
--- a/xc/programs/Xserver/Xext/shm.c
+++ b/xc/programs/Xserver/Xext/shm.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.28 2001/01/17 22:13:18 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.29 2001/05/01 17:03:35 alanh Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
@@ -27,11 +27,7 @@ in this Software without prior written authorization from The Open Group.
#include <sys/types.h>
#ifndef Lynx
-#ifndef __CYGWIN__
#include <sys/ipc.h>
-#else
-#include <sys/cygipc.h>
-#endif
#include <sys/shm.h>
#else
#include <ipc.h>
diff --git a/xc/programs/Xserver/Xext/vidmodeproc.h b/xc/programs/Xserver/Xext/vidmodeproc.h
index 7f6720204..57a7872f0 100644
--- a/xc/programs/Xserver/Xext/vidmodeproc.h
+++ b/xc/programs/Xserver/Xext/vidmodeproc.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/vidmodeproc.h,v 1.4 1999/12/13 01:39:40 robin Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/vidmodeproc.h,v 1.5 2001/05/06 00:51:19 mvojkovi Exp $ */
/* Prototypes for DGA functions that the DDX must provide */
@@ -65,6 +65,9 @@ void VidModeCopyMode(pointer modefrom, pointer modeto);
int VidModeGetModeValue(pointer mode, int valtyp);
void VidModeSetModeValue(pointer mode, int valtyp, int val);
vidMonitorValue VidModeGetMonitorValue(pointer monitor, int valtyp, int indx);
+Bool VidModeSetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *);
+Bool VidModeGetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *);
+int VidModeGetGammaRampSize(int scrnIndex);
#endif
diff --git a/xc/programs/Xserver/Xext/xf86bigfont.c b/xc/programs/Xserver/Xext/xf86bigfont.c
index 779f510c1..318cab2db 100644
--- a/xc/programs/Xserver/Xext/xf86bigfont.c
+++ b/xc/programs/Xserver/Xext/xf86bigfont.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86bigfont.c,v 1.11 2001/04/06 02:16:22 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xf86bigfont.c,v 1.12 2001/05/01 17:29:59 alanh Exp $ */
/*
* BIGFONT extension for sharing font metrics between clients (if possible)
* and for transmitting font metrics to clients in a compressed form.
@@ -164,7 +164,7 @@ XFree86BigfontExtensionInit()
FontShmdescIndex = AllocateFontPrivateIndex();
-#if !defined(CSRG_BASED)
+#if !defined(CSRG_BASED) && !defined(__CYGWIN__)
pagesize = SHMLBA;
#else
# ifdef _SC_PAGESIZE
diff --git a/xc/programs/Xserver/Xext/xf86vmode.c b/xc/programs/Xserver/Xext/xf86vmode.c
index a769400c3..e7bcb3446 100644
--- a/xc/programs/Xserver/Xext/xf86vmode.c
+++ b/xc/programs/Xserver/Xext/xf86vmode.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.51 2001/01/17 22:13:19 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.52 2001/05/06 00:51:19 mvojkovi Exp $ */
/*
@@ -87,6 +87,9 @@ static DISPATCH_PROC(ProcXF86VidModeGetDotClocks);
static DISPATCH_PROC(ProcXF86VidModeSetGamma);
static DISPATCH_PROC(ProcXF86VidModeGetGamma);
static DISPATCH_PROC(ProcXF86VidModeSetClientVersion);
+static DISPATCH_PROC(ProcXF86VidModeGetGammaRamp);
+static DISPATCH_PROC(ProcXF86VidModeSetGammaRamp);
+static DISPATCH_PROC(ProcXF86VidModeGetGammaRampSize);
static DISPATCH_PROC(SProcXF86VidModeDispatch);
static DISPATCH_PROC(SProcXF86VidModeGetAllModeLines);
static DISPATCH_PROC(SProcXF86VidModeGetModeLine);
@@ -105,6 +108,9 @@ static DISPATCH_PROC(SProcXF86VidModeGetDotClocks);
static DISPATCH_PROC(SProcXF86VidModeSetGamma);
static DISPATCH_PROC(SProcXF86VidModeGetGamma);
static DISPATCH_PROC(SProcXF86VidModeSetClientVersion);
+static DISPATCH_PROC(SProcXF86VidModeGetGammaRamp);
+static DISPATCH_PROC(SProcXF86VidModeSetGammaRamp);
+static DISPATCH_PROC(SProcXF86VidModeGetGammaRampSize);
static unsigned char XF86VidModeReqCode = 0;
@@ -442,6 +448,9 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
}
rep.sequenceNumber = client->sequence;
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
return BadValue;
@@ -529,6 +538,11 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
DEBUG_P("XF86VidModeGetAllModelines");
+ REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
ver = ClientMajorVersion(client);
modecount = VidModeGetNumOfModes(stuff->screen);
@@ -538,7 +552,6 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
return BadValue;
- REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
rep.type = X_Reply;
rep.length = SIZEOF(xXF86VidModeGetAllModeLinesReply) -
SIZEOF(xGenericReply);
@@ -690,6 +703,9 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
if (len != stuff->privsize)
return BadLength;
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
if (stuff->hsyncstart < stuff->hdisplay ||
stuff->hsyncend < stuff->hsyncstart ||
stuff->htotal < stuff->hsyncend ||
@@ -830,6 +846,9 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
return BadLength;
}
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
return BadValue;
@@ -941,6 +960,9 @@ ProcXF86VidModeModModeLine(ClientPtr client)
stuff->vtotal < stuff->vsyncend)
return BadValue;
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
return BadValue;
@@ -1054,6 +1076,9 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
if (len != stuff->privsize)
return BadLength;
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
status = MODE_OK;
if (stuff->hsyncstart < stuff->hdisplay ||
@@ -1118,10 +1143,13 @@ ProcXF86VidModeSwitchMode(ClientPtr client)
DEBUG_P("XF86VidModeSwitchMode");
- VidModeZoomViewport(stuff->screen, (short)stuff->zoom);
-
REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ VidModeZoomViewport(stuff->screen, (short)stuff->zoom);
+
return (client->noClientException);
}
@@ -1178,6 +1206,9 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
if (len != stuff->privsize)
return BadLength;
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
return BadValue;
@@ -1228,6 +1259,9 @@ ProcXF86VidModeLockModeSwitch(ClientPtr client)
DEBUG_P("XF86VidModeLockModeSwitch");
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
if (!VidModeLockZoom(stuff->screen, (short)stuff->lock))
return VidModeErrorBase + XF86VidModeZoomLocked;
@@ -1246,11 +1280,13 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
DEBUG_P("XF86VidModeGetMonitor");
- if (!VidModeGetMonitor(stuff->screen, &monitor))
- return BadValue;
+ REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
- REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
+ if (!VidModeGetMonitor(stuff->screen, &monitor))
+ return BadValue;
nHsync = VidModeGetMonitorValue(monitor, VIDMODE_MON_NHSYNC, 0).i;
nVrefresh = VidModeGetMonitorValue(monitor, VIDMODE_MON_NVREFRESH, 0).i;
@@ -1329,6 +1365,10 @@ ProcXF86VidModeGetViewPort(ClientPtr client)
DEBUG_P("XF86VidModeGetViewPort");
REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -1356,6 +1396,9 @@ ProcXF86VidModeSetViewPort(ClientPtr client)
REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
if (!VidModeSetViewPort(stuff->screen, stuff->x, stuff->y))
return BadValue;
@@ -1375,9 +1418,13 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
DEBUG_P("XF86VidModeGetDotClocks");
+ REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
numClocks = VidModeGetNumOfClocks(stuff->screen, &ClockProg);
- REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
rep.type = X_Reply;
rep.length = (SIZEOF(xXF86VidModeGetDotClocksReply)
- SIZEOF(xGenericReply) + numClocks) >> 2;
@@ -1429,12 +1476,15 @@ ProcXF86VidModeSetGamma(ClientPtr client)
DEBUG_P("XF86VidModeSetGamma");
+ REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
if (!VidModeSetGamma(stuff->screen, ((float)stuff->red)/10000.,
((float)stuff->green)/10000., ((float)stuff->blue)/10000.))
return BadValue;
- REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
-
return (client->noClientException);
}
@@ -1449,6 +1499,10 @@ ProcXF86VidModeGetGamma(ClientPtr client)
DEBUG_P("XF86VidModeGetGamma");
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -1469,6 +1523,108 @@ ProcXF86VidModeGetGamma(ClientPtr client)
}
static int
+ProcXF86VidModeSetGammaRamp(ClientPtr client)
+{
+ CARD16 *r, *g, *b;
+ int length;
+ REQUEST(xXF86VidModeSetGammaRampReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if(stuff->size != VidModeGetGammaRampSize(stuff->screen))
+ return BadValue;
+
+ length = (stuff->size + 1) & ~1;
+
+ REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length * 6);
+
+ r = (CARD16*)&stuff[1];
+ g = r + length;
+ b = g + length;
+
+ if (!VidModeSetGammaRamp(stuff->screen, stuff->size, r, g, b))
+ return BadValue;
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86VidModeGetGammaRamp(ClientPtr client)
+{
+ CARD16 *ramp = NULL;
+ int n, length, i;
+ xXF86VidModeGetGammaRampReply rep;
+ REQUEST(xXF86VidModeGetGammaRampReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if(stuff->size != VidModeGetGammaRampSize(stuff->screen))
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
+
+ length = (stuff->size + 1) & ~1;
+
+ if(stuff->size) {
+ if(!(ramp = xalloc(length * 3 * sizeof(CARD16))))
+ return BadAlloc;
+
+ if (!VidModeGetGammaRamp(stuff->screen, stuff->size,
+ ramp, ramp + length, ramp + (length * 2)))
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = (length >> 1) * 3;
+ rep.sequenceNumber = client->sequence;
+ rep.size = stuff->size;
+ if(client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swaps(&rep.size, n);
+ for(i = 0; i < length * 3; i++)
+ swaps(&ramp[i],n);
+ }
+ WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *)&rep);
+
+ if(stuff->size) {
+ WriteToClient(client, rep.length << 2, (char*)ramp);
+ xfree(ramp);
+ }
+
+ return (client->noClientException);
+}
+
+
+static int
+ProcXF86VidModeGetGammaRampSize(ClientPtr client)
+{
+ xXF86VidModeGetGammaRampSizeReply rep;
+ int n;
+ REQUEST(xXF86VidModeGetGammaRampSizeReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.size = VidModeGetGammaRampSize(stuff->screen);
+ if(client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swaps(&rep.size, n);
+ }
+ WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep);
+
+ return (client->noClientException);
+}
+
+static int
ProcXF86VidModeSetClientVersion(ClientPtr client)
{
REQUEST(xXF86VidModeSetClientVersionReq);
@@ -1536,6 +1692,12 @@ ProcXF86VidModeDispatch(ClientPtr client)
return ProcXF86VidModeGetGamma(client);
case X_XF86VidModeSetClientVersion:
return ProcXF86VidModeSetClientVersion(client);
+ case X_XF86VidModeGetGammaRamp:
+ return ProcXF86VidModeGetGammaRamp(client);
+ case X_XF86VidModeSetGammaRamp:
+ return ProcXF86VidModeSetGammaRamp(client);
+ case X_XF86VidModeGetGammaRampSize:
+ return ProcXF86VidModeGetGammaRampSize(client);
default:
return BadRequest;
}
@@ -1874,6 +2036,52 @@ SProcXF86VidModeGetGamma(ClientPtr client)
}
static int
+SProcXF86VidModeSetGammaRamp(ClientPtr client)
+{
+ CARD16 *ramp;
+ int length, n;
+ REQUEST(xXF86VidModeSetGammaRampReq);
+ swaps(&stuff->length, n);
+ REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq);
+ swaps(&stuff->size, n);
+ swaps(&stuff->screen, n);
+ length = ((stuff->size + 1) & ~1) * 6;
+ REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length);
+ ramp = (CARD16*)&stuff[1];
+ while(length--) {
+ swaps(ramp, n);
+ ramp++;
+ }
+ return ProcXF86VidModeSetGammaRamp(client);
+}
+
+static int
+SProcXF86VidModeGetGammaRamp(ClientPtr client)
+{
+ int n;
+ REQUEST(xXF86VidModeGetGammaRampReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
+ swaps(&stuff->size, n);
+ swaps(&stuff->screen, n);
+ return ProcXF86VidModeGetGammaRamp(client);
+}
+
+static int
+SProcXF86VidModeGetGammaRampSize(ClientPtr client)
+{
+ int n;
+ REQUEST(xXF86VidModeGetGammaRampSizeReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
+ swaps(&stuff->screen, n);
+ return ProcXF86VidModeGetGammaRampSize(client);
+}
+
+
+
+
+static int
SProcXF86VidModeDispatch(ClientPtr client)
{
REQUEST(xReq);
@@ -1918,6 +2126,12 @@ SProcXF86VidModeDispatch(ClientPtr client)
return SProcXF86VidModeGetGamma(client);
case X_XF86VidModeSetClientVersion:
return SProcXF86VidModeSetClientVersion(client);
+ case X_XF86VidModeGetGammaRamp:
+ return SProcXF86VidModeGetGammaRamp(client);
+ case X_XF86VidModeSetGammaRamp:
+ return SProcXF86VidModeSetGammaRamp(client);
+ case X_XF86VidModeGetGammaRampSize:
+ return SProcXF86VidModeGetGammaRampSize(client);
default:
return BadRequest;
}
diff --git a/xc/programs/Xserver/Xext/xvdix.h b/xc/programs/Xserver/Xext/xvdix.h
index d1bd6e20f..c7bdeef9c 100644
--- a/xc/programs/Xserver/Xext/xvdix.h
+++ b/xc/programs/Xserver/Xext/xvdix.h
@@ -21,7 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/xvdix.h,v 1.6 2000/01/18 16:35:39 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xvdix.h,v 1.7 2001/05/07 21:37:51 tsi Exp $ */
#ifndef XVDIX_H
#define XVDIX_H
@@ -53,7 +53,7 @@ SOFTWARE.
**
*/
-#include "pixmap.h"
+#include "scrnintstr.h"
#include "Xvproto.h"
extern int XvScreenIndex;
diff --git a/xc/programs/Xserver/dix/main.c b/xc/programs/Xserver/dix/main.c
index 80d977c71..f38a86182 100644
--- a/xc/programs/Xserver/dix/main.c
+++ b/xc/programs/Xserver/dix/main.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.34 2001/03/04 17:40:04 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.35 2001/04/28 20:42:17 torrey Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -261,6 +261,8 @@ main(argc, argv, envp)
char *xauthfile;
HWEventQueueType alwaysCheckForInput[2];
+ display = "0";
+
/* Quartz support on Mac OS X requires that the Cocoa event loop be in
* the main thread. This allows the X server main to be called again
* from another thread. */
@@ -290,7 +292,6 @@ main(argc, argv, envp)
* can't be passed argc, argv as parameters */
argcGlobal = argc;
argvGlobal = argv;
- display = "0";
/* prep X authority file from environment; this can be overriden by a
* command line option */
xauthfile = getenv("XAUTHORITY");
diff --git a/xc/programs/Xserver/hw/darwin/Imakefile b/xc/programs/Xserver/hw/darwin/Imakefile
index b5fb675b0..a64fea603 100644
--- a/xc/programs/Xserver/hw/darwin/Imakefile
+++ b/xc/programs/Xserver/hw/darwin/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.10 2001/03/24 23:08:53 torrey Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.11 2001/05/18 17:48:32 torrey Exp $
#include <Server.tmpl>
#define IHaveSubdirs
@@ -13,9 +13,9 @@ OBJS = darwin.o \
xfIOKit.o \
xfIOKitCursor.o
-INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/mfb -I$(SERVERSRC)/cfb \
- -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(SERVERSRC)/os \
- -I$(INCLUDESRC) -I$(FONTINCSRC)
+INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(EXTINCSRC) \
+ -I$(SERVERSRC)/render -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+ -I$(SERVERSRC)/os -I$(INCLUDESRC) -I$(FONTINCSRC)
#if defined(XFree86CustomVersion)
CUSTOMVERSION = XFree86CustomVersion
diff --git a/xc/programs/Xserver/hw/darwin/XDarwin.man b/xc/programs/Xserver/hw/darwin/XDarwin.man
index f72aee3c8..e5979cc75 100644
--- a/xc/programs/Xserver/hw/darwin/XDarwin.man
+++ b/xc/programs/Xserver/hw/darwin/XDarwin.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/darwin/XDarwin.man,v 1.1 2001/03/28 08:28:55 torrey Exp $
+.\" $XFree86: xc/programs/Xserver/hw/darwin/XDarwin.man,v 1.1.2.1 2001/05/21 04:56:06 torrey Exp $
.\"
.TH XDARWIN 1 __vendorversion__
.SH NAME
@@ -13,7 +13,7 @@ is the window server for Version 11 of the X window system on the Darwin
operating system.
.I XDarwin
can be started from the Darwin text console, or while running the Mac OS X
-Quartz window server.
+Aqua GUI.
.PP
When running from the console,
.I XDarwin
@@ -23,20 +23,20 @@ mouse and keyboard and to provide a layer of hardware abstraction. In console mo
will normally be started by the \fIxdm(1)\fP display manager or by a script
that runs the program \fIxinit(1)\fP.
.PP
-When running with the Mac OS X Quartz window server,
+When running with the Mac OS X Aqua GUI,
.I XDarwin
-will normally be started with the Xmaster application. This application acts an
-agent for
+will normally be started by launching it from the Finder, but it may also be started from the command line with the \fB\-quartz\fP option. The
.I XDarwin
-to receive events and allows easy switching between the Mac OS X and X window
-desktops. In this mode, CoreGraphics is used to capture and draw to the screen.
+application allows easy switching between the Mac OS X and X window
+desktops. CoreGraphics is used to capture and draw to the screen. Note that the defaults for various command line options are set by the application preferences in this mode.
#else
.I XDarwin
is the window server for Version 11 of the X window system on the Darwin
operating system. This version of
.I XDarwin
-can only be started from the Darwin text console. The Mac OS X Quartz window
-server, if present, must be shut down. It uses IOKit services to accesss the display
+can only be started from the Darwin text console. The Mac OS X Aqua GUI, if present, must be shut down.
+.I XDarwin
+uses IOKit services to accesss the display
framebuffer, mouse and keyboard and to provide a layer of hardware abstraction.
.I XDarwin
will normally be started by the \fIxdm(1)\fP display manager or by a script
@@ -54,6 +54,9 @@ button 2. Holding down Option will simulate button 3.
.TP 8
.B \-nofakebuttons
Do not emulate a 3 button mouse. This is the default.
+.TP 8
+.B "\-keymap \fIfile\fP"
+On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap. With this option the keymapping is read from a file instead of the kernel. If the file's path is not specified, it will be searched for in Library/Keyboards/ underneath the following directories (in order): ~, /, /Network, /System.
#ifdef DARWIN_WITH_QUARTZ
.TP 8
.B "\-size \fIwidth\fP \fIheight\fP"
@@ -69,8 +72,11 @@ This option is ignored if \fB\-quartz\fP is specified.
Gives the refresh rate to use in Hz. For LCD displays this should be 0.
This option is ignored if \fB\-quartz\fP is specified.
.TP 8
+.B "\-screen \fIscreenum\fP"
+Specifies which screen number the X server should run on. Screen number 0 is the default. This option is ignored if \fB\-quartz\fP is specified.
+.TP 8
.B \-quartz
-Run in parallel with the Mac OS X Quartz window server.
+Run in parallel with the Mac OS X Aqua GUI.
#else
.TP 8
.B "\-size \fIwidth\fP \fIheight\fP"
@@ -82,6 +88,9 @@ per pixel are supported.
.TP 8
.B "\-refresh \fIrate\fP"
Gives the refresh rate to use in Hz. For LCD displays this should be 0.
+.TP 8
+.B "\-screen \fIscreenum\fP"
+Specifies which screen number the X server should run on. Screen number 0 is the default.
#endif
.TP 8
.B \-showconfig
@@ -97,18 +106,27 @@ X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1)
and this man page still have many limitations. Some of the more obvious
ones are:
.br
+- There is no rootless mode with Aqua.
+.br
- Only one display is supported.
.br
- The display mode can not be changed once the X server has started.
.br
- A screen saver is not supported.
-.br
-- The key repeat rate can not be changed.
.PP
.SH AUTHORS
-Original Port to Mac OS X Server - John Carmack
+XFree86 was originally ported to Mac OS X Server by John Carmack. Dave Zarzycki used this as the basis of his port of XFree86 4.0 to Darwin 1.0. Torrey T. Lyons improved and integrated this code into the XFree86 Project's mainline for the 4.0.2 release.
+.PP
+The following members of the XonX Team contributed to the XFree86 4.1 release:
+.PP
+Rob Braun - Darwin x86 support
+.br
+Torrey T. Lyons - Project Lead
+.br
+Andreas Monitzer - Cocoa version of XDarwin front end
+.br
+Gregory Robert Parker - Original Quartz implementation
.br
-Port to Darwin 1.0 - Dave Zarzycki
+Christoph Pfisterer - Dynamic shared X libraries
.br
-Improvements and bug fixes - Torrey T. Lyons
-
+Toshimitsu Tanaka - Japanese localization
diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf
index a823101ac..d93cfaef1 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf
+++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf
@@ -1,10 +1,62 @@
-{\rtf1\mac\ansicpg10000{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
{\colortbl;\red255\green255\blue255;}
-\paperw9240\paperh9000
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Gregory Robert Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\f0\fs24 \cf0 John Carmack - Original XFree86 port to Mac OS X Server\
-Dave Zarzycki - XFree86 4.0 port to Darwin 1.0\
-Torrey T. Lyons - Improvements and bug fixes\
-Gregory Robert Parker - Original Quartz implementation\
-Andreas Monitzer - Cocoa version of Xmaster}
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile
new file mode 100644
index 000000000..267e0a3d6
--- /dev/null
+++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile
@@ -0,0 +1,19 @@
+XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile,v 1.1.2.1 2001/05/21 04:56:07 torrey Exp $
+
+#include <Server.tmpl>
+
+INCLUDES = -I$(SERVERSRC)/include
+
+VERS = XFree86VersionString
+DATE = XFree86DateString
+XF86_DEFS = $(INCLUDES) -DXF86_VERSION=$(VERS) -DXF86_REL_DATE=$(DATE) \
+ -DXF86_COPYRIGHT='"XFree86 $(VERS)\nCopyright 2001 XFree86 Project, Inc."'
+
+AllTarget(XDarwinHelp.html)
+CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(XF86_DEFS), \
+ NullParameter)
+
+AllTarget(InfoPlist.strings)
+CppFileTarget(InfoPlist.strings,InfoPlist.strings.cpp,$(XF86_DEFS), \
+ NullParameter)
+
diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings
deleted file mode 100644
index 52b64973d..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings
+++ /dev/null
@@ -1,4 +0,0 @@
-/* English localized versions of Info.plist keys. */
-/* Most of these are set in the target application settings. */
-
-NSHumanReadableCopyright = "XFree86 Version 4.0.2 / X Window System";
diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp
new file mode 100644
index 000000000..2fd4b6aec
--- /dev/null
+++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp
@@ -0,0 +1,5 @@
+/* English localized versions of Info.plist keys. */
+/* Most of these are set in the target application settings. */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp,v 1.1.2.1 2001/05/21 04:56:07 torrey Exp $ */
+
+NSHumanReadableCopyright = XF86_COPYRIGHT
diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
index b5583719f..51353d155 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
+++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
@@ -12,6 +12,7 @@
LANGUAGE = ObjC;
OUTLETS = {
displayNumber = id;
+ dockSwitchButton = id;
fakeButton = id;
keyField = id;
keymapFileField = id;
@@ -31,10 +32,10 @@
SUPERCLASS = NSApplication;
},
{
- ACTIONS = {applicationWillResignActive = id; closeHelpAndShow = id; };
+ ACTIONS = {applicationWillResignActive = id; closeHelpAndShow = id; showAction = id; };
CLASS = Xserver;
LANGUAGE = ObjC;
- OUTLETS = {helpWindow = id; startupHelpButton = id; };
+ OUTLETS = {helpWindow = id; startupHelpButton = id; switchWindow = id; };
SUPERCLASS = NSObject;
}
);
diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/info.nib b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/info.nib
index 21d75f060..773a28359 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/info.nib
+++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/info.nib
@@ -3,19 +3,26 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
- <string>20 4 367 304 0 4 800 574 </string>
+ <string>20 11 367 304 0 4 800 574 </string>
<key>IBMainMenuLocation</key>
- <string>19 268 220 44 0 4 800 574 </string>
+ <string>20 320 285 44 0 4 800 574 </string>
<key>IBUserGuides</key>
<dict>
- <key>HelpPanel</key>
+ <key>Help Window</key>
<dict>
<key>guideLocations</key>
<array/>
<key>guidesLocked</key>
<string>NO</string>
</dict>
- <key>PrefPanel</key>
+ <key>Pref Window</key>
+ <dict>
+ <key>guideLocations</key>
+ <array/>
+ <key>guidesLocked</key>
+ <string>NO</string>
+ </dict>
+ <key>X Panel</key>
<dict>
<key>guideLocations</key>
<array/>
diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
index 39fec4b7a..ecda1a0cf 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
+++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html
deleted file mode 100644
index 9b4024ec7..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<html>
-<head>
-<title>XFree86 for Mac OS X</title>
-</head>
-<body>
-<center>
- <h1>XFree86 on Darwin and Mac OS X</h1>
-</center>
-<h2>Contents</h2>
-<ol>
- <li><A HREF="#notice">Important Notice</A></li>
- <li><A HREF="#usage">Usage</A></li>
- <li><A HREF="#path">Setting Your Path</A></li>
- <li><A HREF="#license">License</A></li>
-</ol>
-<center>
- <h2><a NAME="notice">Important Notice</a></h2>
-</center>
-<blockquote>This is a pre-release version of XFree86, and is not supported in any way. This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>.</blockquote>
-<h2><a NAME="usage">Usage</a></h2>
-<p>XFree86 runs on Mac OS X in full screen mode. When the X window desktop is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. (This key combination can be changed in the user preferences.) From the Mac OS X desktop, just click on the XDarwin icon in the dock to switch back to the X window desktop.</p>
-<h3>Multi-Button Mouse Emulation</h3>
-<p>Many X11 applications rely on the use of a 3-button mouse. To emulate a 3-button mouse with a single button, select "Enable emulation of multiple mouse buttons" in the Preferences. This will take effect the next time the X server is started. When emulating a 3-button mouse, holding down the left command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the left option key and clicking will simulate the third button.</p>
-<p>Notes:</p>
-<ul>
- <li>With most keyboards the left and right command and option keys are not differentiated so either will work.
- <li>Even with command and/or option keys mapped to some other key with xmodmap, you still must use the original command and option keys for multibutton mouse emulation.
- <li>The only way to simulate holding down the left command key and clicking the second mouse button is to map some other key to be the left command key. The same is true for simulating holding down the left option key and clicking the third mouse button.
-</ul>
-<h2><a NAME="path">Setting Your Path</a></h2>
-<p>The X11 binaries are located in /usr/X11R6/bin, which you may need to add to your path. Your path is the list of directories to be searched for executable commands. The way to do this depends on the shell you are using. With tcsh, you can check your path by typing "printenv PATH". You should see /usr/X11R6/bin listed as one of the directories. If not, you should add it to your default path. To do so, you can add the following line to a file in your home directory called .cshrc: (Create this file if you don't have one yet.)</p>
-<blockquote>setenv PATH "${PATH}:/usr/X11R6/bin"</blockquote>
-<p>Note that you will need to start a new Terminal window for any changes you make in .cshrc to take effect. You may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in /usr/X11R6/man and the MANPATH environment variable contains the list of directories to search.</p>
-<h2><a NAME="license">License</a></h2>
-The XFree86 Project is commited to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which doesn't impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
-License page</A>.
-<H3><A NAME="3"></A>X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute,
-sublicense, and/or sell copies of the Software, and to permit persons to
-whom the Software is furnished to do so, subject to the following conditions:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..d5ebf697d
--- /dev/null
+++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,90 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.1.2.1 2001/05/21 04:56:07 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<title>XFree86 for Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 on Darwin and Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>Contents</h2>
+<ol>
+ <li><A HREF="#notice">Important Notice</A></li>
+ <li><A HREF="#usage">Usage</A></li>
+ <li><A HREF="#path">Setting Your Path</A></li>
+ <li><A HREF="#prefs">User Preferences</A></li>
+ <li><A HREF="#license">License</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Important Notice</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+This is a pre-release version of XFree86, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>.
+#else
+If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
+#endif
+</blockquote>
+<blockquote>
+This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
+<h2><a NAME="usage">Usage</a></h2>
+<p>XFree86 is a freely redistributable open-source implementation of the <a HREF
+="http://www.x.org/">X Window System</a> produced by the <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> XFree86 runs on Mac OS X in full screen mode. When the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, just click on the XDarwin icon in the floating switch window to switch back to the X window system. You can change this behavior in the user preferences so that clicking on the XDarwin icon in the Dock switches as well.</p>
+<h3>Multi-Button Mouse Emulation</h3>
+<p>Many X11 applications rely on the use of a 3-button mouse. To emulate a 3-button mouse with a single button, select "Enable emulation of multiple mouse buttons" in the Preferences. When emulating a 3-button mouse, holding down the left command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the left option key and clicking will simulate the third button.</p>
+<p>Notes:</p>
+<ul>
+ <li>With most keyboards the left and right command and option keys are not differentiated so either will work.
+ <li>Even with command and/or option keys mapped to some other key with xmodmap, you still must use the original command and option keys for multibutton mouse emulation.
+ <li>The only way to simulate holding down the left command key and clicking the second mouse button is to map some other key to be the left command key. The same is true for simulating holding down the left option key and clicking the third mouse button.
+</ul>
+<h2><a NAME="path">Setting Your Path</a></h2>
+<p>The X11 binaries are located in /usr/X11R6/bin, which you may need to add to your path. Your path is the list of directories to be searched for executable commands. The way to do this depends on the shell you are using. The following directions are for tcsh, which is the default shell on Darwin and Mac OS X.</p>
+<p>You can check your path by typing "printenv PATH". You should see /usr/X11R6/bin listed as one of the directories. If not, you should add it to your default path. To do so, you can add the following line to the file ~/Library/init/tcsh/path: (You may need to create this file and directory path if it does not exist already.)</p>
+<blockquote>setenv PATH "${PATH}:/usr/X11R6/bin"</blockquote>
+<p>Note that if you have created a .cshrc or .tcshrc file, these files will override your settings in ~/Library/init/tcsh/ and you will need to change one of these files instead. These changes will not take effect until you open a new Terminal window. You may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in /usr/X11R6/man and the MANPATH environment variable contains the list of directories to search.</p>
+<h2><a NAME="prefs">User Preferences</a></h2>
+<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed under Startup Options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
+<ul>
+ <li>Key combination button: Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
+ <li>Use System beep for X11: When enabled the standard Mac OS X alert sound is used as X11 bell. When disabled (default) a simple tone is used.</li>
+ <li>Click on icon in Dock switches to X11: Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
+ <li>Show help on startup: This will show the introductory splash screen when XDarwin is launched.</li>
+ <li>Display number: This sets what X display number XDarwin should assign to the display. Note that XDarwin always takes over the main display when showing X11.</li>
+ <li>Keymapping: By default, XDarwin loads the keymapping from the Darwin kernel on startup. On portables, this keymapping is sometimes empty so that the keyboard will appear to be dead in X11. If "Load from file" is selected, XDarwin will load the keymapping from the specified file instead.</li>
+</ul>
+<h2><a NAME="license">License</a></h2>
+The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which doesn't impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
+License page</A>.
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the following conditions:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Imakefile b/xc/programs/Xserver/hw/darwin/bundle/Imakefile
index aaeed48a7..42dd7b6e2 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/Imakefile
+++ b/xc/programs/Xserver/hw/darwin/bundle/Imakefile
@@ -1,6 +1,7 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/Imakefile,v 1.9 2001/04/18 20:28:52 torrey Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/Imakefile,v 1.10.2.1 2001/05/21 04:56:06 torrey Exp $
#include <Server.tmpl>
+#define IHaveSubdirs
SRCS = Preferences.m \
XApplication.m \
@@ -28,13 +29,24 @@ CUSTOMVERSION = XFree86CustomVersion
CUSTOMVERDEF = -DXF86_CUSTOM_VERSION='$(CUSTOMVERSION)'
#endif
-DEFINES = $(CUSTOMVERDEF) -DXBINDIR=$(DESTDIR)$(BINDIR) -DXINITDIR=$(XINITDIR)
+DEFINES = $(CUSTOMVERDEF) -DXBINDIR=$(BINDIR) -DXINITDIR=$(XINITDIR)
#if NothingOutsideProjectRoot
-XDARWINROOT = $(DESTDIR)$(BINDIR)
+XDARWINROOT = $(BINDIR)
#else
XDARWINROOT = /Applications
#endif
+#if XFree86Devel
+PBXBUILDSTYLE = -buildstyle Development
+#else
+PBXBUILDSTYLE = -buildstyle Deployment
+#endif
+
+SUBDIRS = English.lproj Japanese.lproj
+
+MakeSubdirs($(SUBDIRS))
+DependSubdirs($(SUBDIRS))
+
NormalLibraryObjectRule()
NormalLibraryTarget(XQuartz,$(OBJS))
@@ -43,19 +55,20 @@ AllTarget(quartzStartup.o)
AllTarget(XDarwinStartup)
NormalProgramTarget(XDarwinStartup,XDarwinStartup.o,NullParameter, \
NullParameter,NullParameter)
-InstallProgram(XDarwinStartup,$(DESTDIR)$(BINDIR))
+InstallProgram(XDarwinStartup,$(BINDIR))
install::
-(cd $(DESTDIR)$(BINDIR); $(RM) X; $(LN) XDarwinStartup X)
AllTarget(XDarwin)
XDarwin:
- pbxbuild -target XDarwin
+ pbxbuild -target XDarwin $(PBXBUILDSTYLE)
install::
- pbxbuild install -target XDarwin DSTROOT=$(XDARWINROOT)
+ pbxbuild install -target XDarwin $(PBXBUILDSTYLE) \
+ DSTROOT=$(DESTDIR)$(XDARWINROOT)
clean::
- pbxbuild "clean" -target XDarwin
+ pbxbuild "clean" -target XDarwin $(PBXBUILDSTYLE)
DependTarget()
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf
index 452a4a044..d93cfaef1 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf
+++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf
@@ -1,10 +1,62 @@
-{\rtf1\mac\ansicpg10000{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Gregory Robert Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
-\f0\fs24 \cf0 John Carmack - Original XFree86 port to Mac OS X Server\
-Dave Zarzycki - XFree86 4.0 port to Darwin 1.0\
-Torrey T. Lyons - Improvements and bug fixes\
-Gregory Robert Parker - Original Quartz implementation\
-Andreas Monitzer - Cocoa version of Xmaster\
-Toshimitsu Tanaka - Japanese translation}
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile
new file mode 100644
index 000000000..df873408d
--- /dev/null
+++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile
@@ -0,0 +1,19 @@
+XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile,v 1.1.2.1 2001/05/21 04:56:07 torrey Exp $
+
+#include <Server.tmpl>
+
+INCLUDES = -I$(SERVERSRC)/include
+
+VERS = XFree86VersionString
+DATE = XFree86DateString
+XF86_DEFS = $(INCLUDES) -DXF86_VERSION=$(VERS) -DXF86_REL_DATE=$(DATE) \
+ -DXF86_COPYRIGHT='"XFree86 $(VERS)\nCopyright 2001 XFree86 Project, Inc."'
+
+AllTarget(XDarwinHelp.html)
+CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(XF86_DEFS), \
+ NullParameter)
+
+AllTarget(InfoPlist.strings)
+CppFileTarget(InfoPlist.strings,InfoPlist.strings.cpp,$(XF86_DEFS), \
+ NullParameter)
+
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings
deleted file mode 100644
index 600065eb8..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp
new file mode 100644
index 000000000..6a2e760d8
--- /dev/null
+++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp
@@ -0,0 +1,5 @@
+/* Japanese localized versions of Info.plist keys. */
+/* Most of these are set in the target application settings. */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp,v 1.1.2.1 2001/05/21 04:56:07 torrey Exp $ */
+
+NSHumanReadableCopyright = XF86_COPYRIGHT
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib
index b5583719f..51353d155 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib
+++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib
@@ -12,6 +12,7 @@
LANGUAGE = ObjC;
OUTLETS = {
displayNumber = id;
+ dockSwitchButton = id;
fakeButton = id;
keyField = id;
keymapFileField = id;
@@ -31,10 +32,10 @@
SUPERCLASS = NSApplication;
},
{
- ACTIONS = {applicationWillResignActive = id; closeHelpAndShow = id; };
+ ACTIONS = {applicationWillResignActive = id; closeHelpAndShow = id; showAction = id; };
CLASS = Xserver;
LANGUAGE = ObjC;
- OUTLETS = {helpWindow = id; startupHelpButton = id; };
+ OUTLETS = {helpWindow = id; startupHelpButton = id; switchWindow = id; };
SUPERCLASS = NSObject;
}
);
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/info.nib b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/info.nib
index babc232fe..e73a41b09 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/info.nib
+++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/info.nib
@@ -3,19 +3,26 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
- <string>451 75 367 304 0 67 1024 679 </string>
+ <string>29 444 369 278 0 64 1024 682 </string>
<key>IBMainMenuLocation</key>
- <string>78 473 262 44 0 4 800 574 </string>
+ <string>44 386 343 44 0 71 1024 675 </string>
<key>IBUserGuides</key>
<dict>
- <key>HelpPanel</key>
+ <key>Help Window</key>
<dict>
<key>guideLocations</key>
<array/>
<key>guidesLocked</key>
<string>NO</string>
</dict>
- <key>PrefPanel</key>
+ <key>Pref Window</key>
+ <dict>
+ <key>guideLocations</key>
+ <array/>
+ <key>guidesLocked</key>
+ <string>NO</string>
+ </dict>
+ <key>X Panel</key>
<dict>
<key>guideLocations</key>
<array/>
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib
index 0c990727b..b8574b1c5 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib
+++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html
deleted file mode 100644
index ff20e7208..000000000
--- a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html
+++ /dev/null
@@ -1,125 +0,0 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
-<title>
-XFree86 for Mac OS X</title></head>
-<body>
-<center>
-<h1>
-XFree86 on Darwin and Mac OS X
-</h1>
-</center>
-<h2>
-Ìܼ¡
-</h2>
-<ol>
-<li>
-<A HREF="#notice">Ãí°Õ»ö¹à</A>
-</li>
-<li>
-<A HREF="#usage">»ÈÍÑË¡</A>
-</li>
-<li>
-<A HREF="#path">¥Ñ¥¹¤ÎÀßÄê</A>
-</li>
-<li>
-<A HREF="#license">¥é¥¤¥»¥ó¥¹</A>
-</li>
-</ol>
-<center>
-<h2>
-<a NAME="notice">Ãí°Õ»ö¹à</a>
-</h2>
-</center>
-<blockquote>
-¤³¤ì¤Ï¡¤XFree86 ¤Î¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¤¤¤¤«¤Ê¤ë¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó¡£
-ËÜ¥½¥Õ¥È¥¦¥§¥¢¤Ï¡¤<A HREF="#license">MIT X11/X Consortium License</A> ¤Î¾ò·ï¤Ë´ð¤Å¤­¡¤ÌµÊݾڤǡ¤¡Ö¤½¤Î¤Þ¤Þ¡×¤Î·Á¤Ç¶¡µë¤µ¤ì¤Þ¤¹¡£
-¤´»ÈÍѤˤʤëÁ°¤Ë¡¤<A HREF="#license">¥é¥¤¥»¥ó¥¹¾ò·ï</A>¤ò¤ªÆÉ¤ß²¼¤µ¤¤¡£
-¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Î¥Ð¥°¤òÊó¹ð¤¹¤ëÁ°¤Ë¡¤<A HREF="http://sourceforge.net/projects/xonx/">XonX</A> ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸¤Þ¤¿¤Ï <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS ¥ê¥Ý¥¸¥È¥ê</A>¤ÇºÇ¿·ÈǤΥÁ¥§¥Ã¥¯¤ò¤·¤Æ²¼¤µ¤¤¡£
-</blockquote>
-<h2>
-<a NAME="usage">»ÈÍÑË¡</a>
-</h2>
-<p>
-Mac OS X ¾å¤Ç¡¤XFree86 ¤Ï¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Çưºî¤·¤Þ¤¹¡£
-X Window ¥Ç¥¹¥¯¥È¥Ã¥×¤¬¥¢¥¯¥Æ¥£¥Ö¤Ê»þ¡¤¤½¤ì¤ÏÁ´²èÌ̤òÀêÍ­¤·¤Þ¤¹¡£
-¤¢¤Ê¤¿¤Ï¡¤Command-Option-A ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤ØÀÚ¤êÂØ¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¡Ê¤³¤Î¥­¡¼¤ÎÁȤ߹ç¤ï¤»¤Ï¡¤´Ä¶­ÀßÄê¤ÇÊѹ¹²Äǽ¤Ç¤¹¡Ë
-Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤«¤é¡¤X Window ¥Ç¥¹¥¯¥È¥Ã¥×¤ØÀÚ¤êÂØ¤¨¤ë¾ì¹ç¤Ï¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£
-</p>
-<h3>
-Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó
-</h3>
-<p>
-¿¤¯¤Î X11 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¤3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤òɬÍפȤ·¤Þ¤¹¡£
-1 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤Ç 3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤ò¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤¹¤ë¤Ë¤Ï¡¤´Ä¶­ÀßÄê¤Ç¡ÖÊ£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¡×¤òÁªÂò¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¡¤¼¡²ó¤Î X ¥µ¡¼¥Ð¡¼¤Îµ¯Æ°»þ¤è¤êÍ­¸ú¤È¤Ê¤ê¤Þ¤¹¡£
-
-3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤ò¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤¹¤ë»þ¡¤º¸¤Î¥³¥Þ¥ó¥É¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 2 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£º¸¤Î¥ª¥×¥·¥ç¥ó¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 3 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£
-</p>
-<p>
-Ãí¡§
-</p>
-<ul>
-<li>
-¿¤¯¤Î¥­¡¼¥Ü¡¼¥É¤Ç¤Ï¡¤º¸±¦¤Î¥³¥Þ¥ó¥É¥­¡¼¤È¥ª¥×¥·¥ç¥ó¥­¡¼¤Ï¶èÊ̤µ¤ì¤º¡¤Æ±¤¸Æ°ºî¤ò¤·¤Þ¤¹¡£
-<li>
-xmodmap ¤Ç¥³¥Þ¥ó¥É¥­¡¼¤ä¥ª¥×¥·¥ç¥ó¥­¡¼¤ò¾¤Î¥­¡¼¤Ë³ä¤êÅö¤Æ¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¡¤Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ç¤ÏËÜÍè¤Î¥³¥Þ¥ó¥É¥­¡¼¤ä¥ª¥×¥·¥ç¥ó¥­¡¼¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-<li>
-º¸¤Î¥³¥Þ¥ó¥É¥­¡¼¤ò²¡¤·¤Ê¤¬¤éÂè 2 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¤º¸¤Î¥³¥Þ¥ó¥É¥­¡¼¤ò¾¤Î¥­¡¼¤Ë³ä¤êÅö¤Æ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£º¸¤Î¥ª¥×¥·¥ç¥ó¥­¡¼¤ò²¡¤·¤Ê¤¬¤éÂè 3 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¾ì¹ç¤âƱÍͤǤ¹¡£
-</ul>
-<h2>
-<a NAME="path">¥Ñ¥¹¤ÎÀßÄê</a>
-</h2>
-<p>
-X11 ¥Ð¥¤¥Ê¥ê¤Ï¡¤/usr/X11R6/bin ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤½¤ì¤ò¥Ñ¥¹¤Ë²Ã¤¨¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¥Ñ¥¹¤Ï¡¤ ¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¤ò¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤Ç¤¹¡£
-¤³¤ì¤ò³Îǧ¤¹¤ëÊýË¡¤Ï¡¤»ÈÍѤ·¤Æ¤¤¤ë¥·¥§¥ë¤Ë°Í¸¤·¤Þ¤¹¡£
-tcsh ¤Ç¤Ï¡¤¡Öprintenv PATH¡×¤È¥¿¥¤¥×¤¹¤ë¤³¤È¤Ç¥Ñ¥¹¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¥Ñ¥¹¤ò¥Á¥§¥Ã¥¯¤·¤¿»þ¡¤/usr/X11R6/bin ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¤Ò¤È¤Ä¤È¤·¤ÆÉ½¼¨¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤â¤·¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¤¤¢¤Ê¤¿¤Ï¤½¤ì¤ò¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤ËÄɲ乤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-¤½¤Î¤¿¤á¤Ë¡¤¤¢¤Ê¤¿¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¡Ö.cshrc¡×¤È¤¤¤¦Ì¾¾Î¤Î¥Õ¥¡¥¤¥ë¤Ë¼¡¤Î¹Ô¤òÄɲ䷤Ʋ¼¤µ¤¤¡£
-¡Ê¤â¤·¤³¤Î¥Õ¥¡¥¤¥ë¤¬¤Þ¤À̵¤±¤ì¤ÐºîÀ®¤·¤Æ²¼¤µ¤¤¡Ë
-</p>
-<blockquote>
-setenv PATH "${PATH}:/usr/X11R6/bin"
-</blockquote>
-<p>
-¡Ö.cshrc¡×¥Õ¥¡¥¤¥ë¤Ø¤ÎÊѹ¹¤òÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¤¿·¤¿¤Ë Terminal ¥¦¥£¥ó¥É¥¦¤ò³«»Ï¤¹¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£
-¤Þ¤¿¡¤¤¢¤Ê¤¿¤Ï¥É¥­¥å¥á¥ó¥È¤òõ¤·¤Æ¤¤¤ë»þ¡¤XFree86 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤µ¤ì¤ë¥Ú¡¼¥¸¤Î¥ê¥¹¥È¤ËÄɲä·¤¿¤¤¤È»×¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-X11 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï /usr/X11R6/man ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤½¤·¤Æ MANPATH ´Ä¶­ÊÑ¿ô¤Ï¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£
-</p>
-<h2>
-<a NAME="license">¥é¥¤¥»¥ó¥¹</a>
-</h2>
-XFree86 Project ¤Ï¡¤¼«Í³¤ËºÆÇÛÉÛ²Äǽ¤Ê¥Ð¥¤¥Ê¥ê¤È¥½¡¼¥¹¥³¡¼¥É¤òÄ󶡤¹¤ë¤³¤È¤Ë¥³¥ß¥Ã¥È¤·¤Æ¤¤¤Þ¤¹¡£
-»ä¤¿¤Á¤¬»ÈÍѤ¹¤ë¼ç¤Ê¥é¥¤¥»¥ó¥¹¤Ï¡¤ÅÁÅýŪ¤Ê MIT X11/X Consortium License ¤Ë´ð¤Å¤¯¤â¤Î¤Ç¤¹¡£
-¤½¤·¤Æ¡¤¤½¤ì¤Ï½¤Àµ¤Þ¤¿¤ÏºÆÇÛÉÛ¤µ¤ì¤ë¥½¡¼¥¹¥³¡¼¥É¤Þ¤¿¤Ï¥Ð¥¤¥Ê¥ê¤Ë¡¤¤½¤Î Copyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤¬¤½¤Î¤Þ¤Þ»Ä¤µ¤ì¤ë¤³¤È¤òÍ׵᤹¤ë°Ê³°¤Î¾ò·ï¤ò¶¯À©¤·¤Þ¤»¤ó¡£
-¤è¤ê¿¤¯¤Î¾ðÊó¤È¡¤¥³¡¼¥É¤Î°ìÉô¤ò¥«¥Ð¡¼¤¹¤ëÄɲäΠCopyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤Î¤¿¤á¤Ë¡¤<A HREF="http://www.xfree86.org/legal/licence.html">XFree86 ¤Î License ¥Ú¡¼¥¸</A>¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£
-<H3>
-<A NAME="3"></A>
-X Consortium License</H3>
-<p>Copyright (C) 1996 X Consortium</p>
-<p>Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute,
-sublicense, and/or sell copies of the Software, and to permit persons to
-whom the Software is furnished to do so, subject to the following conditions:</p>
-<p>The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.</p>
-<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.</p>
-<p>Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization from
-the X Consortium.</p>
-<p>X Window System is a trademark of X Consortium, Inc.</p>
-</body>
-</html>
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..e2139645e
--- /dev/null
+++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,144 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp,v 1.1.2.2 2001/05/22 03:36:53 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
+<title>
+XFree86 for Mac OS X</title></head>
+<body>
+<center>
+ <h1>XFree86 on Darwin and Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>Ìܼ¡</h2>
+<ol>
+ <li><A HREF="#notice">Ãí°Õ»ö¹à</A></li>
+ <li><A HREF="#usage">»ÈÍÑË¡</A></li>
+ <li><A HREF="#path">¥Ñ¥¹¤ÎÀßÄê</A></li>
+ <li><A HREF="#prefs">´Ä¶­ÀßÄê</A></li>
+ <li><A HREF="#license">¥é¥¤¥»¥ó¥¹</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Ãí°Õ»ö¹à</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+¤³¤ì¤Ï¡¤XFree86 ¤Î¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¤¤¤¤«¤Ê¤ë¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó¡£
+¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
+¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Î¥Ð¥°¤òÊó¹ð¤¹¤ëÁ°¤Ë¡¤<A HREF="http://sourceforge.net/projects/xonx/">XonX</A> ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸¤Þ¤¿¤Ï <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS ¥ê¥Ý¥¸¥È¥ê</A>¤ÇºÇ¿·ÈǤΥÁ¥§¥Ã¥¯¤ò¤·¤Æ²¼¤µ¤¤¡£
+</blockquote>
+#else
+¤â¤·¡¤¥µ¡¼¥Ð¡¼¤¬ 6 -12 ¥ö·î°Ê¾åÁ°¤Î¤â¤Î¤«¡¤¤Þ¤¿¤Ï¤¢¤Ê¤¿¤Î¥Ï¡¼¥É¥¦¥§¥¢¤¬¾åµ­¤ÎÆüÉÕ¤è¤ê¤â¿·¤·¤¤¤â¤Î¤Ê¤é¤Ð¡¤ÌäÂê¤òÊó¹ð¤¹¤ëÁ°¤Ë¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤òõ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
+¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
+#endif
+</blockquote>
+<blockquote>
+ËÜ¥½¥Õ¥È¥¦¥§¥¢¤Ï¡¤<A HREF="#license">MIT X11/X Consortium License</A> ¤Î¾ò·ï¤Ë´ð¤Å¤­¡¤ÌµÊݾڤǡ¤¡Ö¤½¤Î¤Þ¤Þ¡×¤Î·Á¤Ç¶¡µë¤µ¤ì¤Þ¤¹¡£
+¤´»ÈÍѤˤʤëÁ°¤Ë¡¤<A HREF="#license">¥é¥¤¥»¥ó¥¹¾ò·ï</A>¤ò¤ªÆÉ¤ß²¼¤µ¤¤¡£
+</blockquote>
+
+<h2><a NAME="usage">»ÈÍÑË¡</a></h2>
+<p>
+XFree86 ¤Ï¡¤<a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a>¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¡¤ºÆÇÛÉÛ²Äǽ¤Ê¥ª¡¼¥×¥ó¥½¡¼¥¹¤Î <a HREF="http://www.x.org/">X Window System</a> ¤Î¼ÂÁõ¤Ç¤¹¡£
+Mac OS X ¾å¤Ç¡¤XFree86 ¤Ï¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Çưºî¤·¤Þ¤¹¡£X Window System ¤¬¥¢¥¯¥Æ¥£¥Ö¤Ê»þ¡¤¤½¤ì¤ÏÁ´²èÌ̤òÀêÍ­¤·¤Þ¤¹¡£
+¤¢¤Ê¤¿¤Ï¡¤Command-Option-A ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤ØÀÚ¤êÂØ¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¥­¡¼¤ÎÁȤ߹ç¤ï¤»¤Ï¡¤´Ä¶­ÀßÄê¤ÇÊѹ¹²Äǽ¤Ç¤¹¡£
+Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤«¤éX Window System ¤ØÀÚ¤êÂØ¤¨¤ë¾ì¹ç¤Ï¡¤¥Õ¥í¡¼¥Æ¥£¥ó¥°¡¦¥¦¥£¥ó¥É¥¦¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
+¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X Window System ¤ØÀÚ¤êÂØ¤ï¤ë¤è¤¦¤Ë¡¤´Ä¶­ÀßÄê¤Çưºî¤òÊѹ¹¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
+</p>
+
+<h3>Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó</h3>
+<p>
+¿¤¯¤Î X11 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¤3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤òɬÍפȤ·¤Þ¤¹¡£
+1 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤Ç 3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤ò¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤¹¤ë¤Ë¤Ï¡¤´Ä¶­ÀßÄê¤Ç¡ÖÊ£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¡×¤òÁªÂò¤·¤Þ¤¹¡£
+¤³¤ì¤Ï¡¤¼¡²ó¤Î X ¥µ¡¼¥Ð¡¼¤Îµ¯Æ°»þ¤è¤êÍ­¸ú¤È¤Ê¤ê¤Þ¤¹¡£
+
+3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤ò¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤¹¤ë»þ¡¤º¸¤Î¥³¥Þ¥ó¥É¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 2 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£º¸¤Î¥ª¥×¥·¥ç¥ó¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 3 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£
+</p>
+<p>Ãí¡§</p>
+<ul>
+ <li>¿¤¯¤Î¥­¡¼¥Ü¡¼¥É¤Ç¤Ï¡¤º¸±¦¤Î¥³¥Þ¥ó¥É¥­¡¼¤È¥ª¥×¥·¥ç¥ó¥­¡¼¤Ï¶èÊ̤µ¤ì¤º¡¤Æ±¤¸Æ°ºî¤ò¤·¤Þ¤¹¡£
+ <li>xmodmap ¤Ç¥³¥Þ¥ó¥É¥­¡¼¤ä¥ª¥×¥·¥ç¥ó¥­¡¼¤ò¾¤Î¥­¡¼¤Ë³ä¤êÅö¤Æ¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¡¤Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ç¤ÏËÜÍè¤Î¥³¥Þ¥ó¥É¥­¡¼¤ä¥ª¥×¥·¥ç¥ó¥­¡¼¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
+ <li>º¸¤Î¥³¥Þ¥ó¥É¥­¡¼¤ò²¡¤·¤Ê¤¬¤éÂè 2 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¤º¸¤Î¥³¥Þ¥ó¥É¥­¡¼¤ò¾¤Î¥­¡¼¤Ë³ä¤êÅö¤Æ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£º¸¤Î¥ª¥×¥·¥ç¥ó¥­¡¼¤ò²¡¤·¤Ê¤¬¤éÂè 3 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¾ì¹ç¤âƱÍͤǤ¹¡£
+</ul>
+<h2>
+<a NAME="path">¥Ñ¥¹¤ÎÀßÄê</a>
+</h2>
+<p>
+X11 ¥Ð¥¤¥Ê¥ê¤Ï¡¤/usr/X11R6/bin ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤½¤ì¤ò¥Ñ¥¹¤Ë²Ã¤¨¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
+¥Ñ¥¹¤Ï¡¤ ¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¤ò¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤Ç¤¹¡£
+¤³¤ì¤ò³Îǧ¤¹¤ëÊýË¡¤Ï¡¤»ÈÍѤ·¤Æ¤¤¤ë¥·¥§¥ë¤Ë°Í¸¤·¤Þ¤¹¡£
+tcsh ¤Ç¤Ï¡¤¡Öprintenv PATH¡×¤È¥¿¥¤¥×¤¹¤ë¤³¤È¤Ç¥Ñ¥¹¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+¥Ñ¥¹¤ò¥Á¥§¥Ã¥¯¤·¤¿»þ¡¤/usr/X11R6/bin ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¤Ò¤È¤Ä¤È¤·¤ÆÉ½¼¨¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
+¤â¤·¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¤¤¢¤Ê¤¿¤Ï¤½¤ì¤ò¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤ËÄɲ乤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
+¤½¤Î¤¿¤á¤Ë¡¤~/Library/init/tcsh/path ¥Õ¥¡¥¤¥ë¤Ë¼¡¤Î¹Ô¤òÄɲ䷤Ʋ¼¤µ¤¤¡£
+¡Ê¤â¤·¤³¤Î¥Õ¥¡¥¤¥ë¤¬Ìµ¤±¤ì¤ÐºîÀ®¤·¤Æ²¼¤µ¤¤¡Ë
+</p>
+<blockquote>
+setenv PATH "${PATH}:/usr/X11R6/bin"
+</blockquote>
+<p>
+¤â¤·¡¤¤¢¤Ê¤¿¤¬ .cshrc ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï .tcshrc ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¤Ê¤é¤Ð¡¤¤½¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï ~/Library/init/tcsh/path ¥Õ¥¡¥¤¥ë¤ÎÀßÄêÃͤò¾å½ñ¤­¤·¤Þ¤¹¡£
+¤½¤·¤Æ¡¤¤¢¤Ê¤¿¤Ï¤½¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î¤¦¤Á¤Î°ì¤Ä¤À¤±¤òÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£
+¤³¤ì¤é¤ÎÊѹ¹¤Ï¡¤¤¢¤Ê¤¿¤¬¿·¤¿¤Ê Terminal ¥¦¥£¥ó¥É¥¦¤ò³«»Ï¤¹¤ë¤Þ¤ÇÍ­¸ú¤È¤Ê¤ê¤Þ¤»¤ó¡£
+¤Þ¤¿¡¤¤¢¤Ê¤¿¤Ï¥É¥­¥å¥á¥ó¥È¤òõ¤·¤Æ¤¤¤ë»þ¡¤XFree86 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤µ¤ì¤ë¥Ú¡¼¥¸¤Î¥ê¥¹¥È¤ËÄɲä·¤¿¤¤¤È»×¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£
+X11 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï /usr/X11R6/man ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤½¤·¤Æ MANPATH ´Ä¶­ÊÑ¿ô¤Ï¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£
+</p>
+
+<h2><a NAME="prefs">´Ä¶­ÀßÄê</a></h2>
+<p>¡ÖXDarwin¡×¥á¥Ë¥å¡¼¤Î¡Ö´Ä¶­ÀßÄê...¡×¥á¥Ë¥å¡¼¹àÌܤ«¤é¡¤¤¤¤¯¤Ä¤«¤ÎÀßÄê¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+¡Öµ¯Æ°¥ª¥×¥·¥ç¥ó¡×¤ÎÆâÍÆ¤Ï¡¤XDarwin ¤òºÆµ¯Æ°¤¹¤ë¤Þ¤ÇÍ­¸ú¤È¤Ê¤ê¤Þ¤»¤ó¡£
+¾¤ÎÁ´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ÎÆâÍÆ¤Ï¡¤Ä¾¤Á¤ËÍ­¸ú¤È¤Ê¤ê¤Þ¤¹¡£
+°Ê²¼¡¤¤½¤ì¤¾¤ì¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹:</p>
+<ul>
+ <li>¥­¡¼ÀßÄê¥Ü¥¿¥ó: X11 ¤È Aqua ¤òÀÚ¤êÂØ¤¨¤ë¤¿¤á¤Î¥­¡¼¤ÎÁȤ߹ç¤ï¤»¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë¡¤¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¡¤¤¤¤¯¤Ä¤«¤Î½¤¾þ¥­¡¼¤Ë³¤¤¤ÆÄ̾ï¤Î¥­¡¼¤ò²¡¤·¤Þ¤¹¡£</li>
+ <li>X11 ¤Ç¥·¥¹¥Æ¥à¤Î¥Ó¡¼¥×²»¤ò»ÈÍѤ¹¤ë: ¥ª¥ó¤Î¾ì¹ç¡¤Mac OS X ¤Î¥Ó¡¼¥×²»¤¬ X11 ¤Î¥Ù¥ë¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£¥ª¥Õ¤Î¾ì¹ç¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¡¤¥·¥ó¥×¥ë ¥È¡¼¥ó¤¬»È¤ï¤ì¤Þ¤¹¡£</li>
+ <li>¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤ËÌá¤ë: ¥ª¥ó¤Î¾ì¹ç¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤Ø¤ÎÀÚ¤êÂØ¤¨¤¬²Äǽ¤È¤Ê¤ê¤Þ¤¹¡£
+ Mac OS X ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï¡¤¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç²èÌ̤òÀÚ¤êÂØ¤¨¤ë¤È¡¤Aqua ¤ËÌá¤Ã¤¿»þ¤Ë¥«¡¼¥½¥ë¤¬¾Ã¼º¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£</li>
+ <li>µ¯Æ°»þ¤Ë¥Ø¥ë¥×¤òɽ¼¨¤¹¤ë: XDarwin ¤Îµ¯Æ°»þ¤Ë¡¤¥¹¥×¥é¥Ã¥·¥å ¥¹¥¯¥ê¡¼¥ó¤òɽ¼¨¤·¤Þ¤¹¡£</li>
+ <li>¥Ç¥£¥¹¥×¥ì¥¤ÈÖ¹æ: XDarwin ¤¬¥Ç¥£¥¹¥×¥ì¥¤¤Ë³ä¤êÅö¤Æ¤ë X ¤Î Display Number ¤ò»ØÄꤷ¤Þ¤¹¡£
+ X11 ¤òɽ¼¨¤¹¤ë¤È¤­¡¤XDarwin ¤Ï¾ï¤Ë¥á¥¤¥ó¥Ç¥£¥¹¥×¥ì¥¤¤ò°ú¤­·Ñ¤°¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£</li>
+ <li>¥­¡¼¥Þ¥Ã¥Ô¥ó¥°: ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤XDarwin ¤Ï Darwin ¥«¡¼¥Í¥ë¤«¤é¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¤ò¥í¡¼¥É¤·¤Þ¤¹¡£
+ ¥Ý¡¼¥¿¥Ö¥ëµ¡¼ï¤Ç¤Ï¡¤»þ¡¹¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¤¬¶õ¤È¤Ê¤ê¡¤X11 ¤Ç¥­¡¼¥Ü¡¼¥É¤¬Æ°ºî¤·¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
+ ¡Ö¥Õ¥¡¥¤¥ë¤«¤é¥í¡¼¥É¤¹¤ë¡×¤òÁªÂò¤¹¤ë¤È¡¤XDarwin ¤Ï»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤«¤é¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¤ò¥í¡¼¥É¤·¤Þ¤¹¡£<br>
+ ¡ÊÌõÃí¡§¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¤Ç Japanese ¤òÁªÂò¤¹¤ë¤È¡¤ÉÔ¶ñ¹ç¤¬À¸¤¸¤Þ¤¹¡£USA ¤òÁªÂò¤·¤¿¾å¤Ç ~/.Xmodmap ¤òŬÍѤ·¤Æ²¼¤µ¤¤¡£¡Ë</li>
+</ul>
+
+<h2>
+<a NAME="license">¥é¥¤¥»¥ó¥¹</a>
+</h2>
+XFree86 Project ¤Ï¡¤¼«Í³¤ËºÆÇÛÉÛ²Äǽ¤Ê¥Ð¥¤¥Ê¥ê¤È¥½¡¼¥¹¥³¡¼¥É¤òÄ󶡤¹¤ë¤³¤È¤Ë¥³¥ß¥Ã¥È¤·¤Æ¤¤¤Þ¤¹¡£
+»ä¤¿¤Á¤¬»ÈÍѤ¹¤ë¼ç¤Ê¥é¥¤¥»¥ó¥¹¤Ï¡¤ÅÁÅýŪ¤Ê MIT X11/X Consortium License ¤Ë´ð¤Å¤¯¤â¤Î¤Ç¤¹¡£
+¤½¤·¤Æ¡¤¤½¤ì¤Ï½¤Àµ¤Þ¤¿¤ÏºÆÇÛÉÛ¤µ¤ì¤ë¥½¡¼¥¹¥³¡¼¥É¤Þ¤¿¤Ï¥Ð¥¤¥Ê¥ê¤Ë¡¤¤½¤Î Copyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤¬¤½¤Î¤Þ¤Þ»Ä¤µ¤ì¤ë¤³¤È¤òÍ׵᤹¤ë°Ê³°¤Î¾ò·ï¤ò¶¯À©¤·¤Þ¤»¤ó¡£
+¤è¤ê¿¤¯¤Î¾ðÊó¤È¡¤¥³¡¼¥É¤Î°ìÉô¤ò¥«¥Ð¡¼¤¹¤ëÄɲäΠCopyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤Î¤¿¤á¤Ë¡¤<A HREF="http://www.xfree86.org/legal/licence.html">XFree86 ¤Î License ¥Ú¡¼¥¸</A>¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£
+<H3>
+<A NAME="3"></A>
+X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the following conditions:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Preferences.h b/xc/programs/Xserver/hw/darwin/bundle/Preferences.h
index dd89f82aa..469b758b6 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/Preferences.h
+++ b/xc/programs/Xserver/hw/darwin/bundle/Preferences.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Preferences.h,v 1.4 2001/04/25 02:23:47 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Preferences.h,v 1.5 2001/05/09 07:16:19 torrey Exp $ */
#import <Cocoa/Cocoa.h>
@@ -6,6 +6,7 @@
{
IBOutlet NSPanel *window;
IBOutlet id displayNumber;
+ IBOutlet id dockSwitchButton;
IBOutlet id fakeButton;
IBOutlet id keyField;
IBOutlet id keymapFileField;
@@ -35,6 +36,7 @@
+ (void)setKeyCode:(int)newKeyCode;
+ (void)setModifiers:(int)newModifiers;
+ (void)setDisplay:(int)newDisplay;
++ (void)setDockSwitch:(BOOL)newDockSwitch;
+ (void)setFakeButtons:(BOOL)newFakeButtons;
+ (void)setStartupHelp:(BOOL)newStartupHelp;
+ (void)setSystemBeep:(BOOL)newSystemBeep;
@@ -46,6 +48,7 @@
+ (unsigned int)keyCode;
+ (unsigned int)modifiers;
+ (int)display;
++ (BOOL)dockSwitch;
+ (BOOL)fakeButtons;
+ (BOOL)startupHelp;
+ (BOOL)systemBeep;
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Preferences.m b/xc/programs/Xserver/hw/darwin/bundle/Preferences.m
index f923b2224..4e9f1c8c2 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/Preferences.m
+++ b/xc/programs/Xserver/hw/darwin/bundle/Preferences.m
@@ -3,13 +3,31 @@
//
// This class keeps track of the user preferences.
//
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Preferences.m,v 1.4 2001/04/25 02:23:47 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Preferences.m,v 1.6 2001/05/09 07:16:19 torrey Exp $ */
#import "Preferences.h"
#import "quartzShared.h"
@implementation Preferences
++ (void)initialize {
+ // Provide user defaults if needed
+ NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithInt:0], @"Display",
+ @"YES", @"FakeButtons",
+ @"/System/Library/Keyboards/USA.keymapping", @"KeymappingFile",
+ @"NO", @"UseKeymappingFile",
+ @"Cmd-Opt-a", @"SwitchString",
+ @"YES", @"ShowStartupHelp",
+ [NSNumber numberWithInt:0], @"SwitchKeyCode",
+ [NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)],
+ @"SwitchModifiers", @"NO", @"UseSystemBeep",
+ @"NO", @"DockSwitch", nil];
+
+ [super initialize];
+ [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
+}
+
// Initialize internal state info of switch key button
- (void)initSwitchKey {
keyCode = [Preferences keyCode];
@@ -18,26 +36,10 @@
}
- (id)init {
- self=[super init];
+ self = [super init];
isGettingKeyCode=NO;
switchString=[[NSMutableString alloc] init];
-
- // Provide user defaults if needed
- if ([[NSUserDefaults standardUserDefaults] stringForKey:@"SwitchKeyCode"] == nil) {
- [Preferences setKeyCode:0];
- [Preferences setModifiers:(NSCommandKeyMask | NSAlternateKeyMask)];
- [Preferences setSwitchString:@"Cmd-Opt-a"];
- [Preferences setDisplay:0];
- [Preferences setFakeButtons:YES];
- [Preferences setStartupHelp:YES];
- [Preferences setSystemBeep:NO];
- }
- if ([[NSUserDefaults standardUserDefaults] stringForKey:@"UseKeymappingFile"] == nil) {
- [Preferences setUseKeymapFile:NO];
- [Preferences setKeymapFile:@"/System/Library/Keyboards/USA.keymapping"];
- }
-
[self initSwitchKey];
return self;
@@ -58,6 +60,7 @@
[keyField setTitle:[Preferences switchString]];
[displayNumber setIntValue:[Preferences display]];
+ [dockSwitchButton setIntValue:[Preferences dockSwitch]];
[fakeButton setIntValue:[Preferences fakeButtons]];
[startupHelpButton setIntValue:[Preferences startupHelp]];
[systemBeepButton setIntValue:[Preferences systemBeep]];
@@ -99,6 +102,7 @@
[Preferences setKeymapFile:[keymapFileField stringValue]];
[Preferences setUseKeymapFile:[loadKeymapFileButton intValue]];
[Preferences setDisplay:[displayNumber intValue]];
+ [Preferences setDockSwitch:[dockSwitchButton intValue]];
[Preferences setFakeButtons:[fakeButton intValue]];
[Preferences setStartupHelp:[startupHelpButton intValue]];
[Preferences setSystemBeep:[systemBeepButton intValue]];
@@ -170,6 +174,10 @@
[[NSUserDefaults standardUserDefaults] setInteger:newDisplay forKey:@"Display"];
}
++ (void)setDockSwitch:(BOOL)newDockSwitch {
+ [[NSUserDefaults standardUserDefaults] setBool:newDockSwitch forKey:@"DockSwitch"];
+}
+
+ (void)setFakeButtons:(BOOL)newFakeButtons {
[[NSUserDefaults standardUserDefaults] setBool:newFakeButtons forKey:@"FakeButtons"];
// Update the setting used by the X server thread
@@ -214,6 +222,10 @@
return [[NSUserDefaults standardUserDefaults] integerForKey:@"Display"];
}
++ (BOOL)dockSwitch {
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"DockSwitch"];
+}
+
+ (BOOL)fakeButtons {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"FakeButtons"];
}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj b/xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj
index 4848d9c01..43707155d 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj
+++ b/xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj
@@ -341,7 +341,7 @@
<key>CFBundleExecutable</key>
<string>XDarwin</string>
<key>CFBundleGetInfoString</key>
- <string>XFree86 Version 4.1</string>
+ <string>XDarwin 1.0, ©2001 XFree86 Project, Inc.</string>
<key>CFBundleIconFile</key>
<string>XDarwin.icns</string>
<key>CFBundleIdentifier</key>
@@ -353,11 +353,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>XDarwin (v0.5)</string>
+ <string>XDarwin 1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>0.5</string>
+ <string></string>
<key>NSHelpFile</key>
<string>XDarwinHelp.html</string>
<key>NSMainNibFile</key>
@@ -518,6 +518,50 @@
name = Products;
refType = 4;
};
+ 1BD8DE4200B8A3567F000001 = {
+ children = (
+ 1BD8DE4300B8A3567F000001,
+ 1BD8DE4700B8A3C77F000001,
+ );
+ isa = PBXVariantGroup;
+ name = InfoPlist.strings.cpp;
+ path = "";
+ refType = 4;
+ };
+ 1BD8DE4300B8A3567F000001 = {
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ 1BD8DE4400B8A38E7F000001 = {
+ children = (
+ 1BD8DE4500B8A38E7F000001,
+ 1BD8DE4800B8A4167F000001,
+ );
+ isa = PBXVariantGroup;
+ name = XDarwinHelp.html.cpp;
+ path = "";
+ refType = 4;
+ };
+ 1BD8DE4500B8A38E7F000001 = {
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ 1BD8DE4700B8A3C77F000001 = {
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ 1BD8DE4800B8A4167F000001 = {
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
1BE4F84D0006C9890A000002 = {
isa = PBXFrameworkReference;
name = Carbon.framework;
@@ -598,9 +642,11 @@
children = (
29B97318FDCFA39411CA2CEA,
089C165CFE840E0CC02AAC07,
+ 1BD8DE4200B8A3567F000001,
1220774300712D2D416877C2,
0157A37D002CF6D7CE6F79C2,
02E03CA000348209CE6F79C2,
+ 1BD8DE4400B8A38E7F000001,
015698ED003DF345CE6F79C2,
);
isa = PBXGroup;
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Xserver.h b/xc/programs/Xserver/hw/darwin/bundle/Xserver.h
index 0e0ce6961..6a5442293 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/Xserver.h
+++ b/xc/programs/Xserver/hw/darwin/bundle/Xserver.h
@@ -3,7 +3,7 @@
//
// Created by Andreas Monitzer on January 6, 2001.
//
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Xserver.h,v 1.6 2001/04/25 02:23:47 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Xserver.h,v 1.8 2001/05/16 06:10:08 torrey Exp $ */
#import <Cocoa/Cocoa.h>
@@ -17,7 +17,6 @@
NSLock *serverLock;
NSTask *clientTask;
NSPort *signalPort;
- NSPortMessage *signalMessage;
BOOL serverVisible;
BOOL appQuitting;
UInt32 mouseState;
@@ -28,6 +27,7 @@
// Aqua interface
IBOutlet NSPanel *helpWindow;
IBOutlet id startupHelpButton;
+ IBOutlet NSPanel *switchWindow;
}
- (id)init;
@@ -48,7 +48,9 @@
- (void)sendNXEvent:(NXEvent*)ev;
- (void)sendShowHide:(BOOL)show;
+// Aqua interface actions
- (IBAction)closeHelpAndShow:(id)sender;
+- (IBAction)showAction:(id)sender;
// NSApplication delegate
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
diff --git a/xc/programs/Xserver/hw/darwin/bundle/Xserver.m b/xc/programs/Xserver/hw/darwin/bundle/Xserver.m
index d047b53dd..405e91250 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/Xserver.m
+++ b/xc/programs/Xserver/hw/darwin/bundle/Xserver.m
@@ -6,7 +6,7 @@
//
// Created by Andreas Monitzer on January 6, 2001.
//
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Xserver.m,v 1.14 2001/04/25 02:23:47 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Xserver.m,v 1.18 2001/05/16 06:10:08 torrey Exp $ */
#import "Xserver.h"
#import "Preferences.h"
@@ -27,6 +27,8 @@ extern int main(int argc, char *argv[], char *envp[]);
extern void HideMenuBar(void);
extern void ShowMenuBar(void);
+static NSPortMessage *signalMessage;
+
@implementation Xserver
- (id)init {
@@ -105,13 +107,15 @@ extern void ShowMenuBar(void);
break;
case NSLeftMouseDragged:
case NSRightMouseDragged:
- case 27: // undocumented high button MouseDragged event
+ case 27: // undocumented high button MouseDragged event
ev.type=NSMouseMoved;
break;
case NSSystemDefined:
- if(([anEvent subtype]==7) && ([anEvent data1] & 1))
+ if (![anEvent subtype]==7)
+ return NO; // we only use multibutton mouse events
+ if ([anEvent data1] & 1)
return NO; // skip mouse button 1 events
- if(mouseState==[anEvent data2])
+ if (mouseState==[anEvent data2])
return NO; // ignore double events
ev.data.compound.subType=[anEvent subtype];
ev.data.compound.misc.L[0]=[anEvent data1];
@@ -128,6 +132,10 @@ extern void ShowMenuBar(void);
case NSFlagsChanged:
ev.data.key.keyCode = [anEvent keyCode];
break;
+ case 25: // undocumented MouseDown
+ case 26: // undocumented MouseUp
+ // Hide these from AppKit to avoid its log messages
+ return YES;
default:
return NO;
}
@@ -164,7 +172,7 @@ extern void ShowMenuBar(void);
char xinitrcbuf[PATH_MAX];
NSString *path = [NSString stringWithCString:XPATH(xinit)];
NSString *server = [NSString stringWithCString:XPATH(XDarwinStartup)];
- NSString *client;
+ NSString *client, *displayName;
BOOL hasClient = YES;
NSArray *args;
@@ -185,6 +193,9 @@ extern void ShowMenuBar(void);
[Xserver append:@":" toEnv:@"PATH"];
[Xserver append:@XSTRPATH(XBINDIR) toEnv:@"PATH"];
+ displayName = [NSString localizedStringWithFormat:@":%d",
+ [Preferences display]];
+
// Find the client init file to use
snprintf(xinitrcbuf, PATH_MAX, "%s/.xinitrc", home);
if (access(xinitrcbuf, F_OK)) {
@@ -195,9 +206,11 @@ extern void ShowMenuBar(void);
}
if (hasClient) {
client = [NSString stringWithCString:xinitrcbuf];
- args = [NSArray arrayWithObjects:client, @"--", server, @"-idle", nil];
+ args = [NSArray arrayWithObjects:client, @"--", server,
+ displayName, @"-idle", nil];
} else {
- args = [NSArray arrayWithObjects:@"--", server, @"-idle", nil];
+ args = [NSArray arrayWithObjects:@"--", server, displayName,
+ @"-idle", nil];
}
// Launch a new task to run start X clients
@@ -207,12 +220,16 @@ extern void ShowMenuBar(void);
// Make sure the menu bar gets drawn
[NSApp setWindowsNeedUpdate:YES];
+ // Show the X switch window if not using dock icon switching
+ if (![Preferences dockSwitch])
+ [switchWindow orderFront:nil];
+
// Display the help splash screen or show the X server
if ([Preferences startupHelp]) {
- [helpWindow makeKeyAndOrderFront:self];
+ [helpWindow makeKeyAndOrderFront:nil];
} else {
ShowMenuBar();
- [self closeHelpAndShow:self];
+ [self closeHelpAndShow:nil];
}
}
@@ -225,7 +242,7 @@ extern void ShowMenuBar(void);
serverVisible = NO;
[serverLock unlock];
[pool release];
- [signalMessage sendBeforeDate:[NSDate distantPast]];
+ QuartzMessageMainThread(kQuartzServerDied);
}
// Close the help splash screen and show the X server
@@ -243,6 +260,11 @@ extern void ShowMenuBar(void);
[NSApp activateIgnoringOtherApps:YES];
}
+// Show the X server when sent message from GUI
+- (IBAction)showAction:(id)sender {
+ [self sendShowHide:YES];
+}
+
// Show or hide the X server
- (void)toggle {
if (serverVisible)
@@ -286,9 +308,10 @@ extern void ShowMenuBar(void);
ev.type = NX_APPDEFINED;
if (show) {
+ QuartzCapture();
+ HideMenuBar();
ev.data.compound.subType = kXDarwinShow;
[self sendNXEvent:&ev];
- HideMenuBar();
// inform the X server of the current modifier state
ev.flags = [[NSApp currentEvent] modifierFlags];
@@ -336,16 +359,29 @@ extern void ShowMenuBar(void);
// FIXME: handle bad writes better?
}
-// Handle message that X server thread is finished
+// Handle messages from the X server thread
- (void)handlePortMessage:(NSPortMessage *)portMessage {
- if (appQuitting) {
- // If we quit before the clients start, they may sit and wait
- // for the X server to start. Kill them instead.
- if ([clientTask isRunning])
- [clientTask terminate];
- [NSApp replyToApplicationShouldTerminate:YES];
- } else {
- [NSApp terminate:nil]; // quit if we aren't already
+ unsigned msg = [portMessage msgid];
+
+ switch(msg) {
+ case kQuartzServerHidden:
+ // FIXME: This hack is necessary (but not completely effective)
+ // since Mac OS X 10.0.2
+ [NSCursor unhide];
+ break;
+ case kQuartzServerDied:
+ if (appQuitting) {
+ // If we quit before the clients start, they may sit and wait
+ // for the X server to start. Kill them instead.
+ if ([clientTask isRunning])
+ [clientTask terminate];
+ [NSApp replyToApplicationShouldTerminate:YES];
+ } else {
+ [NSApp terminate:nil]; // quit if we aren't already
+ }
+ break;
+ default:
+ NSLog(@"Unknown message from server thread.");
}
}
@@ -365,7 +401,9 @@ extern void ShowMenuBar(void);
// Called when the user clicks the application icon, but not when Cmd-Tab is used
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag {
- [self show];
+ if ([Preferences dockSwitch]) {
+ [self show];
+ }
return NO;
}
@@ -378,3 +416,11 @@ extern void ShowMenuBar(void);
}
@end
+
+// Send a message to the main thread, which calls handlePortMessage in
+// response. Must only be called from the X server thread because
+// NSPort is not thread safe.
+void QuartzMessageMainThread(unsigned msg) {
+ [signalMessage setMsgid:msg];
+ [signalMessage sendBeforeDate:[NSDate distantPast]];
+}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartz.c b/xc/programs/Xserver/hw/darwin/bundle/quartz.c
index 080937288..3aacf6e69 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/quartz.c
+++ b/xc/programs/Xserver/hw/darwin/bundle/quartz.c
@@ -5,7 +5,7 @@
* By Gregory Robert Parker
*
**************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartz.c,v 1.7 2001/04/16 06:51:48 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartz.c,v 1.9 2001/05/16 06:10:08 torrey Exp $ */
// X headers
#include "scrnintstr.h"
@@ -115,7 +115,7 @@ Bool QuartzAddScreen(ScreenPtr pScreen)
* QuartzCapture
* Capture the screen so we can draw.
*/
-static void QuartzCapture(void)
+void QuartzCapture(void)
{
if (! CGDisplayIsCaptured(kCGDirectMainDisplay)) {
CGDisplayCapture(kCGDirectMainDisplay);
@@ -132,6 +132,7 @@ static void QuartzRelease(void)
if (CGDisplayIsCaptured(kCGDirectMainDisplay)) {
CGDisplayRelease(kCGDirectMainDisplay);
}
+ QuartzMessageMainThread(kQuartzServerHidden);
}
@@ -182,8 +183,7 @@ void QuartzOsVendorInit(void)
/*
* QuartzShow
* Show the X server on screen. Does nothing if already shown.
- * Recapture the screen, restore the X clip regions, and restore
- * the X server cursor state.
+ * Restore the X clip regions the X server cursor state.
*/
void QuartzShow(
int x, // cursor location
@@ -191,7 +191,6 @@ void QuartzShow(
{
int i;
- QuartzCapture();
if (xhidden) {
for (i = 0; i < darwinNumScreens; i++) {
if (darwinScreens[i]) {
@@ -230,10 +229,17 @@ void QuartzHide(void)
/*
* QuartzGiveUp
* Cleanup before X server shutdown
- * Release the screen
+ * Release the screen and restore the Aqua cursor.
*/
void QuartzGiveUp(void)
{
+ int i;
+
+ for (i = 0; i < darwinNumScreens; i++) {
+ if (darwinScreens[i]) {
+ QuartzSuspendXCursor(darwinScreens[i]);
+ }
+ }
QuartzRelease();
}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m b/xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m
index c7b108646..d19f25ecc 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m
+++ b/xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m
@@ -7,7 +7,7 @@
* that use X include files to avoid symbol collisions.
*
**************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m,v 1.4 2001/04/25 02:23:47 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m,v 1.5 2001/04/28 20:42:19 torrey Exp $ */
#include <Cocoa/Cocoa.h>
@@ -15,6 +15,7 @@
#include "quartzShared.h"
extern void FatalError(const char *, ...);
+extern char *display;
// Read the user preferences from the Cocoa front end
void QuartzReadPreferences(void)
@@ -23,13 +24,19 @@ void QuartzReadPreferences(void)
darwinFakeButtons = [Preferences fakeButtons];
quartzUseSysBeep = [Preferences systemBeep];
+
if ([Preferences useKeymapFile]) {
- fileString = [[Preferences keymapFile] lossyCString];
+ fileString = (char *) [[Preferences keymapFile] lossyCString];
darwinKeymapFile = (char *) malloc(strlen(fileString)+1);
if (! darwinKeymapFile)
FatalError("malloc failed in QuartzReadPreferences()!\n");
strcpy(darwinKeymapFile, fileString);
}
+
+ display = (char *) malloc(8);
+ if (! display)
+ FatalError("malloc failed in QuartzReadPreferences()!\n");
+ snprintf(display, 8, "%i", [Preferences display]);
}
// Write text to the Mac OS X pasteboard.
@@ -70,7 +77,7 @@ char *QuartzReadCocoaPasteboard(void)
char *buffer;
if (! string) return NULL;
- buffer = [string lossyCString];
+ buffer = (char *) [string lossyCString];
text = (char *) malloc(strlen(buffer)+1);
if (text)
strcpy(text, buffer);
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c b/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c
index d53cea982..a7d59a5db 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c
+++ b/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c
@@ -3,7 +3,7 @@
* Support for using the Quartz Window Manager cursor
*
**************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c,v 1.3 2001/04/13 20:55:26 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c,v 1.4 2001/05/09 07:16:19 torrey Exp $ */
#include "mi.h"
#include "scrnintstr.h"
@@ -39,7 +39,7 @@ static QD_Cursor gQDArrow; // QuickDraw arrow cursor
#define HIDE_QD_CURSOR(display, visible) \
if (visible) { CGDisplayHideCursor(display); visible = FALSE; }
#define SHOW_QD_CURSOR(display, visible) \
- if (! visible) { CGDisplayShowCursor(display); visible = TRUE; }
+ CGDisplayShowCursor(display); visible = TRUE;
/*
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c b/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c
index d387d8a73..bde35ef6e 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c
+++ b/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c
@@ -4,53 +4,122 @@
* Aqua pasteboard <-> X cut buffer
* Greg Parker gparker@cs.stanford.edu March 8, 2001
**************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c,v 1.1 2001/03/15 22:24:27 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c,v 1.2 2001/05/02 01:03:40 torrey Exp $ */
#include "quartzPasteboard.h"
#include "Xatom.h"
#include "windowstr.h"
#include "propertyst.h"
+#include "scrnintstr.h"
+#include "selection.h"
-// fixme is there a GetRootWindow() anywhere?
-// fixme wrong for multiple screens
extern WindowPtr *WindowTable;
+extern Selection *CurrentSelections;
+extern int NumCurrentSelections;
-// Write X cut buffer to Mac OS X pasteboard
-// Called by ProcessInputEvents() in response to request from X server thread.
-void QuartzWritePasteboard(void)
+
+// Helper function to read the X11 cut buffer
+// FIXME: What about multiple screens? Currently, this reads the first
+// CUT_BUFFER0 from the first screen where the buffer content is a string.
+// Returns a string on the heap that the caller must free.
+// Returns NULL if there is no cut text or there is not enough memory.
+static char * QuartzReadCutBuffer(void)
{
- PropertyPtr pProp;
+ int i;
char *text = NULL;
- pProp = wUserProps (WindowTable[0]);
- while (pProp) {
- if (pProp->propertyName == XA_CUT_BUFFER0)
- break;
- pProp = pProp->next;
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ PropertyPtr pProp;
+
+ pProp = wUserProps (WindowTable[pScreen->myNum]);
+ while (pProp && pProp->propertyName != XA_CUT_BUFFER0) {
+ pProp = pProp->next;
+ }
+ if (! pProp) continue;
+ if (pProp->type != XA_STRING) continue;
+ if (pProp->format != 8) continue;
+
+ text = xalloc(1 + pProp->size);
+ if (! text) continue;
+ memcpy(text, pProp->data, pProp->size);
+ text[pProp->size] = '\0';
+ return text;
}
- if (! pProp) return;
- if (pProp->type != XA_STRING) return;
- if (pProp->format != 8) return;
-
- text = xalloc(1 + pProp->size);
- if (! text) return;
- memcpy(text, pProp->data, pProp->size);
- text[pProp->size] = '\0';
- QuartzWriteCocoaPasteboard(text);
- free(text);
+
+ // didn't find any text
+ return NULL;
}
+// Write X cut buffer to Mac OS X pasteboard
+// Called by ProcessInputEvents() in response to request from X server thread.
+void QuartzWritePasteboard(void)
+{
+ char *text;
+ text = QuartzReadCutBuffer();
+ if (text) {
+ QuartzWriteCocoaPasteboard(text);
+ free(text);
+ }
+}
+
+#define strequal(a, b) (0 == strcmp((a), (b)))
// Read Mac OS X pasteboard into X cut buffer
// Called by ProcessInputEvents() in response to request from X server thread.
-void QuartzReadPasteboard(void)
+void QuartzReadPasteboard(void)
{
+ char *oldText = QuartzReadCutBuffer();
char *text = QuartzReadCocoaPasteboard();
- if (text) {
- ChangeWindowProperty(WindowTable[0], XA_CUT_BUFFER0, XA_STRING, 8,
- PropModeReplace, strlen(text), (pointer)text,TRUE);
- free(text);
- // fixme erase any current X selections
+
+ // Compare text with current cut buffer contents.
+ // Change the buffer if both exist and are different
+ // OR if there is new text but no old text.
+ // Otherwise, don't clear the selection unnecessarily.
+
+ if ((text && oldText && !strequal(text, oldText)) ||
+ (text && !oldText)) {
+ int scrn, sel;
+
+ for (scrn = 0; scrn < screenInfo.numScreens; scrn++) {
+ ScreenPtr pScreen = screenInfo.screens[scrn];
+ // Set the cut buffers on each screen
+ // fixme really on each screen?
+ ChangeWindowProperty(WindowTable[pScreen->myNum], XA_CUT_BUFFER0,
+ XA_STRING, 8, PropModeReplace,
+ strlen(text), (pointer)text, TRUE);
+ }
+
+ // Undo any current X selection (similar to code in dispatch.c)
+ // FIXME: what about secondary selection?
+ // FIXME: only touch first XA_PRIMARY selection?
+ sel = 0;
+ while ((sel < NumCurrentSelections) &&
+ CurrentSelections[sel].selection != XA_PRIMARY)
+ sel++;
+ if (sel < NumCurrentSelections) {
+ // Notify client if necessary
+ if (CurrentSelections[sel].client) {
+ xEvent event;
+
+ event.u.u.type = SelectionClear;
+ event.u.selectionClear.time = GetTimeInMillis();
+ event.u.selectionClear.window = CurrentSelections[sel].window;
+ event.u.selectionClear.atom = CurrentSelections[sel].selection;
+ TryClientEvents(CurrentSelections[sel].client, &event, 1,
+ NoEventMask, NoEventMask /*CantBeFiltered*/,
+ NullGrab);
+ }
+
+ // Erase it
+ // FIXME: need to erase .selection too? dispatch.c doesn't
+ CurrentSelections[sel].pWin = NullWindow;
+ CurrentSelections[sel].window = None;
+ CurrentSelections[sel].client = NullClient;
+ }
}
+
+ if (text) free(text);
+ if (oldText) free(oldText);
}
diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzShared.h b/xc/programs/Xserver/hw/darwin/bundle/quartzShared.h
index 3813f4f17..4a64b6430 100644
--- a/xc/programs/Xserver/hw/darwin/bundle/quartzShared.h
+++ b/xc/programs/Xserver/hw/darwin/bundle/quartzShared.h
@@ -2,7 +2,7 @@
* Shared definitions between the Darwin X Server
* and the Cocoa front end.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzShared.h,v 1.4 2001/04/25 02:23:47 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzShared.h,v 1.5 2001/05/16 06:10:08 torrey Exp $ */
#ifndef _QUARTZSHARED_H
#define _QUARTZSHARED_H
@@ -16,7 +16,9 @@ extern int quartzUseSysBeep;
extern int darwinFakeButtons;
extern char *darwinKeymapFile;
+void QuartzCapture(void);
void QuartzReadPreferences(void);
+void QuartzMessageMainThread(unsigned msg);
// NX_APPDEFINED event subtypes for special commands to the X server
// update modifiers: update all modifier keys
@@ -35,5 +37,11 @@ enum {
kXDarwinWritePasteboard
};
+// Messages that can be sent to the main thread.
+enum {
+ kQuartzServerHidden,
+ kQuartzServerDied
+};
+
#endif /* _QUARTZSHARED_H */
diff --git a/xc/programs/Xserver/hw/darwin/darwin.c b/xc/programs/Xserver/hw/darwin/darwin.c
index 10def7319..80299c505 100644
--- a/xc/programs/Xserver/hw/darwin/darwin.c
+++ b/xc/programs/Xserver/hw/darwin/darwin.c
@@ -4,7 +4,7 @@
* running with Quartz or the IOKit
*
**************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.21 2001/04/25 02:23:47 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.23.2.2 2001/06/01 06:36:12 torrey Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -12,10 +12,10 @@
#include "servermd.h"
#include "inputstr.h"
#include "scrnintstr.h"
-#include "mi.h"
-#include "mibstore.h"
-#include "mipointer.h"
-#include "micmap.h"
+#include "mibstore.h" // mi backing store implementation
+#include "mipointer.h" // mi software cursor
+#include "micmap.h" // mi colormap code
+#include "fb.h" // fb framebuffer code
#include "site.h"
#include "globals.h"
#include "xf86Version.h"
@@ -69,7 +69,8 @@ static PixmapFormatRec formats[] = {
{ 8, 8, BITMAP_SCANLINE_PAD },
{ 15, 16, BITMAP_SCANLINE_PAD },
{ 16, 16, BITMAP_SCANLINE_PAD },
- { 24, 32, BITMAP_SCANLINE_PAD }
+ { 24, 32, BITMAP_SCANLINE_PAD },
+ { 32, 32, BITMAP_SCANLINE_PAD }
};
const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
@@ -171,37 +172,23 @@ static Bool DarwinAddScreen(
return FALSE;
}
+ miSetPixmapDepths();
+
// machine independent screen init
// setup _Screen structure in pScreen
if (monitorResolution)
dpi = monitorResolution;
else
dpi = 75;
- if ( dfb.bitsPerPixel == 32 ) {
- if (!cfb32ScreenInit(pScreen,
- dfb.framebuffer,
- dfb.width, dfb.height,
- dpi, dpi,
- dfb.pitch / (dfb.bitsPerPixel/8))) {
- return FALSE;
- }
- } else if ( dfb.bitsPerPixel == 16 ) {
- if (!cfb16ScreenInit(pScreen,
- dfb.framebuffer,
- dfb.width, dfb.height,
- dpi, dpi,
- dfb.pitch / (dfb.bitsPerPixel/8))) {
- return FALSE;
- }
- } else if ( dfb.bitsPerPixel == 8 ) {
- if (!cfbScreenInit(pScreen,
- dfb.framebuffer,
- dfb.width, dfb.height,
- dpi, dpi,
- dfb.pitch / (dfb.bitsPerPixel/8))) {
- return FALSE;
- }
- } else {
+
+ // initialize fb
+ if (! fbScreenInit(pScreen,
+ dfb.framebuffer, // pointer to screen bitmap
+ dfb.width, dfb.height, // screen size in pixels
+ dpi, dpi, // dots per inch
+ dfb.pitch/(dfb.bitsPerPixel/8), // pixel width of framebuffer
+ dfb.bitsPerPixel)) // bits per pixel for screen
+ {
return FALSE;
}
@@ -226,6 +213,10 @@ static Bool DarwinAddScreen(
}
}
+#ifdef RENDER
+ fbPictureInit(pScreen, 0, 0);
+#endif
+
#ifdef MITSHM
ShmRegisterFbFuncs(pScreen);
#endif
@@ -305,17 +296,16 @@ static int DarwinMouseProc(
int what )
{
char map[6];
-
+
switch (what) {
-
+
case DEVICE_INIT:
pPointer->public.on = FALSE;
- // Set button map. Darwin uses 2 for right and 3 for center.
- // Reverse these to correspond to typical X usage.
+ // Set button map.
map[1] = 1;
- map[2] = 3;
- map[3] = 2;
+ map[2] = 2;
+ map[3] = 3;
map[4] = 4;
map[5] = 5;
InitPointerDeviceStruct( (DevicePtr)pPointer,
@@ -530,11 +520,12 @@ void ProcessInputEvents(void)
int r;
struct timeval tv;
struct timezone tz;
- static int startsec = 0;
- static Bool gotread = false;
static int old_state = 0;
-#if defined(DARWIN_WITH_QUARTZ) && defined(QUARTZ_SAFETY_DELAY)
+#if defined(DARWIN_WITH_QUARTZ) && defined(QUARTZ_SAFETY_DELAY)
+ static Bool gotread = false;
+ static int startsec = 0;
+
// Quartz safety quit. Bail if we don't get any events from the event pipe.
// If the event writer fails to find us, we will have captured the screen
// but not be seeing any events and be unkillable from the console.
@@ -567,8 +558,10 @@ void ProcessInputEvents(void)
ErrorF( "Only read %i bytes from event pipe!\n", r );
break;
}
-
+
+#if defined(DARWIN_WITH_QUARTZ) && defined(QUARTZ_SAFETY_DELAY)
gotread = true;
+#endif
gettimeofday(&tv, &tz);
// translate it to an X event and post it
@@ -719,9 +712,17 @@ void ProcessInputEvents(void)
long hwButtons = ev.data.compound.misc.L[1];
int i;
- for (i = 1; i < 4; i++) {
+ for (i = 1; i < 5; i++) {
if (hwDelta & (1 << i)) {
- xe.u.u.detail = i + 1;
+ // IOKit and X have different numbering for the
+ // middle and right mouse buttons.
+ if (i == 1) {
+ xe.u.u.detail = 3;
+ } else if (i == 2) {
+ xe.u.u.detail = 2;
+ } else {
+ xe.u.u.detail = i + 1;
+ }
if (hwButtons & (1 << i)) {
#ifdef __i386__
xe.u.u.type = ButtonRelease;
@@ -1045,8 +1046,7 @@ void ddxUseMsg( void )
*/
void ddxGiveUp( void )
{
- ErrorF( " ddxGiveUp\n" );
- close(darwinEventFD);
+ ErrorF( "Quitting XDarwin...\n" );
if (quartz) {
QuartzGiveUp();
@@ -1102,8 +1102,8 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable)
WindowPtr pWin = WindowTable[pScreen->myNum];
WindowPtr pChild;
Bool WasViewable = (Bool)(pWin->viewable);
- Bool anyMarked;
- RegionPtr pOldClip, bsExposed;
+ Bool anyMarked = TRUE;
+ RegionPtr pOldClip = NULL, bsExposed;
#ifdef DO_SAVE_UNDERS
Bool dosave = FALSE;
#endif
diff --git a/xc/programs/Xserver/hw/darwin/xfIOKit.c b/xc/programs/Xserver/hw/darwin/xfIOKit.c
index 121c40ba3..10c0043ec 100644
--- a/xc/programs/Xserver/hw/darwin/xfIOKit.c
+++ b/xc/programs/Xserver/hw/darwin/xfIOKit.c
@@ -8,7 +8,7 @@
* Significantly rewritten for XFree86 4.0.1 by Torrey Lyons
*
**************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/xfIOKit.c,v 1.7 2001/04/16 06:51:48 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/xfIOKit.c,v 1.8 2001/04/30 16:26:01 torrey Exp $ */
#define NDEBUG 1
@@ -215,6 +215,7 @@ static void SetupFBandHID(void)
// find the requested screen
assert(service = IOIteratorNext(iter));
for (i = 0; i < darwinScreenNumber; i++) {
+ IOObjectRelease( service );
service = IOIteratorNext(iter);
if (service == 0)
FatalError("Could not find the requested screen number %i.\n",
diff --git a/xc/programs/Xserver/hw/kdrive/kinput.c b/xc/programs/Xserver/hw/kdrive/kinput.c
index 4582b5ca7..887efcbc9 100644
--- a/xc/programs/Xserver/hw/kdrive/kinput.c
+++ b/xc/programs/Xserver/hw/kdrive/kinput.c
@@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.13 2001/03/30 02:15:20 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.13.2.1 2001/05/25 18:50:08 dawes Exp $ */
#include "kdrive.h"
#include "inputstr.h"
@@ -1452,7 +1452,7 @@ miPointerScreenFuncRec kdPointerScreenFuncs =
void
ProcessInputEvents ()
{
- (void)mieqProcessInputEvents();
+ mieqProcessInputEvents();
miPointerUpdate();
if (kdSwitchPending)
KdProcessSwitch ();
diff --git a/xc/programs/Xserver/hw/sun/sunIo.c b/xc/programs/Xserver/hw/sun/sunIo.c
index 4821902b4..e3abdb336 100644
--- a/xc/programs/Xserver/hw/sun/sunIo.c
+++ b/xc/programs/Xserver/hw/sun/sunIo.c
@@ -15,7 +15,7 @@
*
*
*/
-/* $XFree86: xc/programs/Xserver/hw/sun/sunIo.c,v 3.5 2001/01/17 22:36:50 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/sun/sunIo.c,v 3.5.2.1 2001/05/25 18:50:08 dawes Exp $ */
/************************************************************
Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
@@ -67,7 +67,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
void
ProcessInputEvents ()
{
- (void) mieqProcessInputEvents ();
+ mieqProcessInputEvents ();
miPointerUpdate ();
}
diff --git a/xc/programs/Xserver/hw/sunLynx/sunLyIo.c b/xc/programs/Xserver/hw/sunLynx/sunLyIo.c
index c5c7b7e76..e2dc496ae 100644
--- a/xc/programs/Xserver/hw/sunLynx/sunLyIo.c
+++ b/xc/programs/Xserver/hw/sunLynx/sunLyIo.c
@@ -22,7 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
-/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyIo.c,v 3.4 2001/01/17 22:36:53 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyIo.c,v 3.4.2.1 2001/05/25 18:50:08 dawes Exp $ */
/*
*
@@ -90,7 +90,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
void
ProcessInputEvents ()
{
- (void) mieqProcessInputEvents ();
+ mieqProcessInputEvents ();
miPointerUpdate ();
}
diff --git a/xc/programs/Xserver/hw/vfb/Imakefile b/xc/programs/Xserver/hw/vfb/Imakefile
index 6e689896e..d868c86a7 100644
--- a/xc/programs/Xserver/hw/vfb/Imakefile
+++ b/xc/programs/Xserver/hw/vfb/Imakefile
@@ -3,7 +3,7 @@ XCOMM $Xorg: Imakefile,v 1.5 2000/08/17 19:48:38 cpqbld Exp $
-XCOMM $XFree86: xc/programs/Xserver/hw/vfb/Imakefile,v 3.28 2001/04/25 19:44:01 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/vfb/Imakefile,v 3.29.2.1 2001/05/31 16:14:18 dawes Exp $
#include <Server.tmpl>
@@ -27,11 +27,6 @@ SRCS1 = os2_stubs.c
OBJS1 = os2_stubs.o
#endif
-#ifdef cygwinArchitecture
-SRCS2 = ntux_xf.c
-OBJS2 = ntux_xf.o
-#endif
-
SRCSA = InitInput.c InitOutput.c stubs.c $(SRCS1) miinitext.c $(SRCS2)
OBJSA = InitInput.o InitOutput.o stubs.o $(OBJS1) miinitext.o $(OBJS2)
@@ -63,7 +58,7 @@ LinkSourceFile(stubs.c,../../Xi)
SpecialCObjectRule(InitInput,$(ICONFIGFILES),$(EXT_DEFINES))
LinkSourceFile(miinitext.c,$(SERVERSRC)/mi)
-SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES) $(PAN_DEFINES) -DNO_HW_ONLY_EXTS -DNO_MODULE_EXTS $(EXT_MODULE_DEFINES) -UXFree86LOADER)
+SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES) $(PAN_DEFINES) -DNO_HW_ONLY_EXTS -DNO_MODULE_EXTS $(EXT_MODULE_DEFINES) -UXFree86LOADER -UXF86DRI)
#if BuildDPMS
LinkSourceFile(dpmsstubs.c,$(SERVERSRC)/Xext)
diff --git a/xc/programs/Xserver/hw/vfb/InitInput.c b/xc/programs/Xserver/hw/vfb/InitInput.c
index c76f70c07..592facc09 100644
--- a/xc/programs/Xserver/hw/vfb/InitInput.c
+++ b/xc/programs/Xserver/hw/vfb/InitInput.c
@@ -22,10 +22,11 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.6 2001/01/17 22:36:54 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.7 2001/05/16 08:01:09 alanh Exp $ */
#include "X11/X.h"
#define NEED_EVENTS
+#include "mi.h"
#include "X11/Xproto.h"
#include "scrnintstr.h"
#include "inputstr.h"
@@ -43,30 +44,6 @@ from The Open Group.
*/
int xf86bpp = 8;
#endif
-
-#ifdef __CYGWIN__
-extern void init_mouse( );
-extern void init_keyboard( );
-extern void term_mouse( );
-extern void term_keyboard( );
-extern void get_WinMappings( char *pKeySyms, unsigned char *p_modMap );
-
-
-CARD32 lastEventTime = 0;
-
-int TimeSinceLastInputEvent()
-{
- if (lastEventTime == 0)
- lastEventTime = GetTimeInMillis();
- return GetTimeInMillis() - lastEventTime;
-}
-
-void SetTimeSinceLastInputEvent()
-{
- lastEventTime = GetTimeInMillis();
-}
-#endif
-
Bool
LegalModifier(key, pDev)
@@ -284,74 +261,6 @@ GetLK201Mappings(pKeySyms, pModMap)
#undef INDEX
}
-#ifdef __CYGWIN__
-static int
-winKeybdProc(pDevice, onoff)
- DeviceIntPtr pDevice;
- int onoff;
-{
- KeySymsRec keySyms;
- CARD8 modMap[MAP_LENGTH];
- int i;
- DevicePtr pDev = (DevicePtr)pDevice;
-
- switch (onoff)
- {
- case DEVICE_INIT:
- get_WinMappings(&keySyms, modMap);
- InitKeyboardDeviceStruct(pDev, &keySyms, modMap,
- (BellProcPtr)NoopDDA, (KbdCtrlProcPtr)NoopDDA);
- init_keyboard();
- break;
- case DEVICE_ON:
- pDev->on = TRUE;
- break;
- case DEVICE_OFF:
- pDev->on = FALSE;
- break;
- case DEVICE_CLOSE:
- term_keyboard();
- break;
- }
- return Success;
-}
-
-static int
-winMouseProc(pDevice, onoff)
- DeviceIntPtr pDevice;
- int onoff;
-{
- BYTE map[4];
- DevicePtr pDev = (DevicePtr)pDevice;
-
- switch (onoff)
- {
- case DEVICE_INIT:
- map[1] = 1;
- map[2] = 2;
- map[3] = 3;
- InitPointerDeviceStruct(pDev, map, 3, miPointerGetMotionEvents,
- (PtrCtrlProcPtr)NoopDDA, miPointerGetMotionBufferSize());
- init_mouse();
- break;
-
- case DEVICE_ON:
- pDev->on = TRUE;
- break;
-
- case DEVICE_OFF:
- pDev->on = FALSE;
- break;
-
- case DEVICE_CLOSE:
- term_mouse();
- break;
- }
- return Success;
-}
-#endif /* __CYGWIN__ */
-
-
static int
vfbKeybdProc(pDevice, onoff)
DeviceIntPtr pDevice;
@@ -359,7 +268,6 @@ vfbKeybdProc(pDevice, onoff)
{
KeySymsRec keySyms;
CARD8 modMap[MAP_LENGTH];
- int i;
DevicePtr pDev = (DevicePtr)pDevice;
switch (onoff)
@@ -424,7 +332,7 @@ InitInput(argc, argv)
RegisterPointerDevice(p);
RegisterKeyboardDevice(k);
miRegisterPointerDevice(screenInfo.screens[0], p);
- (void)mieqInit (k, p);
+ (void)mieqInit ((DevicePtr) k, (DevicePtr) p);
}
#ifdef XTESTEXT1
diff --git a/xc/programs/Xserver/hw/vfb/InitOutput.c b/xc/programs/Xserver/hw/vfb/InitOutput.c
index f42d86587..3cd93b6db 100644
--- a/xc/programs/Xserver/hw/vfb/InitOutput.c
+++ b/xc/programs/Xserver/hw/vfb/InitOutput.c
@@ -22,9 +22,9 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.16 2001/03/04 17:40:10 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.19 2001/05/16 14:06:28 alanh Exp $ */
-#if defined(WIN32) && !defined(__CYGWIN__)
+#if defined(WIN32)
#include <X11/Xwinsock.h>
#endif
#include <stdio.h>
@@ -55,28 +55,12 @@ from The Open Group.
#endif
#include <X11/XWDFile.h>
#ifdef HAS_SHM
-#ifndef __CYGWIN__
#include <sys/ipc.h>
-#else
-#include <sys/cygipc.h>
-#endif
#include <sys/shm.h>
#endif /* HAS_SHM */
#include "dix.h"
#include "miline.h"
-
-#ifdef __CYGWIN__
-/*
- * NT UX defines/includes
- */
-#include <sys/mman.h>
-
-#define HAS_MMAP 1
-
-extern char *get_surf( unsigned long size );
-extern char *get_framebuf( unsigned long size );
-extern int enable_ntux_xf( );
-#endif /* __CYGWIN__ */
+#include "mfb.h"
extern char *display;
@@ -118,16 +102,14 @@ typedef struct
static int vfbNumScreens;
static vfbScreenInfo vfbScreens[MAXSCREENS];
static Bool vfbPixmapDepths[33];
+#ifdef HAS_MMAP
static char *pfbdir = NULL;
+#endif
typedef enum { NORMAL_MEMORY_FB, SHARED_MEMORY_FB, MMAPPED_FILE_FB } fbMemType;
static fbMemType fbmemtype = NORMAL_MEMORY_FB;
static char needswap = 0;
static int lastScreen = -1;
-#ifdef __CYGWIN__
-static int b_video_memory = 0;
-#endif
-
#define swapcopy16(_dst, _src) \
if (needswap) { CARD16 _s = _src; cpswaps(_s, _dst); } \
else _dst = _src;
@@ -196,6 +178,9 @@ ddxGiveUp()
}
}
break;
+#else /* HAS_MMAP */
+ case MMAPPED_FILE_FB:
+ break;
#endif /* HAS_MMAP */
#ifdef HAS_SHM
@@ -209,14 +194,14 @@ ddxGiveUp()
}
}
break;
+#else /* HAS_SHM */
+ case SHARED_MEMORY_FB:
+ break;
#endif /* HAS_SHM */
case NORMAL_MEMORY_FB:
for (i = 0; i < vfbNumScreens; i++)
{
-#ifdef __CYGWIN__
- if (!b_video_memory)
-#endif
Xfree(vfbScreens[i].pXWDHeader);
}
break;
@@ -571,21 +556,32 @@ vfbStoreColors(pmap, ndef, pdefs)
XWDColor *pXWDCmap;
int i;
- if (pmap != InstalledMaps[pmap->pScreen->myNum]) return;
+ if (pmap != InstalledMaps[pmap->pScreen->myNum])
+ {
+ return;
+ }
pXWDCmap = vfbScreens[pmap->pScreen->myNum].pXWDCmap;
if ((pmap->pVisual->class | DynamicClass) == DirectColor)
+ {
return;
+ }
for (i = 0; i < ndef; i++)
{
if (pdefs[i].flags & DoRed)
+ {
swapcopy16(pXWDCmap[pdefs[i].pixel].red, pdefs[i].red);
+ }
if (pdefs[i].flags & DoGreen)
+ {
swapcopy16(pXWDCmap[pdefs[i].pixel].green, pdefs[i].green);
+ }
if (pdefs[i].flags & DoBlue)
+ {
swapcopy16(pXWDCmap[pdefs[i].pixel].blue, pdefs[i].blue);
+ }
}
}
@@ -760,10 +756,14 @@ vfbAllocateFramebufferMemory(pvfb)
{
#ifdef HAS_MMAP
case MMAPPED_FILE_FB: vfbAllocateMmappedFramebuffer(pvfb); break;
+#else
+ case MMAPPED_FILE_FB: break;
#endif
#ifdef HAS_SHM
case SHARED_MEMORY_FB: vfbAllocateSharedMemoryFramebuffer(pvfb); break;
+#else
+ case SHARED_MEMORY_FB: break;
#endif
case NORMAL_MEMORY_FB:
@@ -775,17 +775,8 @@ vfbAllocateFramebufferMemory(pvfb)
{
pvfb->pXWDCmap = (XWDColor *)((char *)pvfb->pXWDHeader
+ SIZEOF(XWDheader) + XWD_WINDOW_NAME_LEN);
-#ifndef __CYGWIN__
pvfb->pfbMemory = (char *)(pvfb->pXWDCmap + pvfb->ncolors);
-#else
- pvfb->pfbMemory =
- (char *)get_framebuf((unsigned long)
- pvfb->paddedWidth * pvfb->height);
- if (pvfb->pfbMemory)
- b_video_memory = 1;
- else
- pvfb->pfbMemory = (char *)(pvfb->pXWDCmap + pvfb->ncolors);
-#endif
+
return pvfb->pfbMemory;
}
else
@@ -800,7 +791,6 @@ vfbWriteXWDFileHeader(pScreen)
vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
XWDFileHeader *pXWDHeader = pvfb->pXWDHeader;
char hostname[XWD_WINDOW_NAME_LEN];
- VisualPtr pVisual;
unsigned long swaptest = 1;
int i;
@@ -974,12 +964,6 @@ InitOutput(screenInfo, argc, argv)
{
int i;
int NumFormats = 0;
- FILE *pf = stderr;
-
-
-#ifdef __CYGWIN__
- enable_ntux_xf();
-#endif
/* initialize pixmap formats */
diff --git a/xc/programs/Xserver/hw/vfb/ntux_xf.c b/xc/programs/Xserver/hw/vfb/ntux_xf.c
deleted file mode 100644
index de0ba128b..000000000
--- a/xc/programs/Xserver/hw/vfb/ntux_xf.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
-* Copyright 2000 (C) Peter Busch
-* All rights reserved.
-NO WARRANTY; NO LIABILITY FOR DAMAGES: THE MATERIALS ARE PROVIDED "AS IS"
-WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING WARRANTIES
-OF SATISFACTORY QUALITY, MERCHANTABILITY, NONINFRINGEMENT OF THIRD-PARTY
-INTELLECTUAL PROPERTY, OR FITNESS FOR ANY PARTICULAR PURPOSE.
-IN NO EVENT SHALL Peter Busch BE LIABLE FOR ANY DAMAGES WHATSOEVER
-(INCLUDING, WITHOUT LIMITATION, DIRECT OR INDIRECT DAMAGES, DAMAGES FOR
-LOSS OF PROFITS, BUSINESS INTERRUPTION, LOSS OF INFORMATION) ARISING OUT
-OF THE USE OF OR INABILITY TO USE THE MATERIALS, EVEN IF
-Peter Busch HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-Without limiting the generality of the foregoing, no warranty is made
-that the enclosed software will generate computer programs with the
-characteristics or specifications desired by you or that the demo
-software will be error-free.
-THESE DISCLAIMERS OF WARRANTY CONSTITUTE AN ESSENTIAL PART OF THIS
-AGREEMENT.
-*/
-/* $XFree86: xc/programs/Xserver/hw/vfb/ntux_xf.c,v 3.2 2001/04/18 17:14:01 dawes Exp $ */
-
-/*
-* ntux_xf.c
-* support code for the output enabled X vfb server
-* contains the interface between the vfb source files and the ntux_ddx library
-* Copyright (C) Peter Busch
-* All rights reserved.
-* The above copyright notice and this permission notice shall be included in
-* all copies or substantial portions of the Software.
-* This code is BETA and will be part of the CYGWIN/XFREE Project.
-* It may not be used for purposes other than to contribute to the
-* CYGWIN/XFree project without prior written notice from the
-* author.
-* Any commercial use of this code will be permitted
-* provided you contact Peter Busch at pbusch@dfki.de
-*/
-
-
-
-#include "windows.h"
-#include <stdio.h>
-#include "keysym.h"
-
-
-typedef char * (* _get_surface)( unsigned long size );
-typedef int (* _init_input)( void );
-typedef void (* _init_mouse)( );
-typedef void (* _init_keyboard)( );
-typedef void (* _term_mouse)( );
-typedef void (* _term_keyboard)( );
-typedef void (* _get_WinMap)( char *pKeySyms, unsigned char *p_modMap );
-
-
-HINSTANCE h_ntux_ddx = NULL;
-
-_get_surface ntux_surface = NULL;
-_init_input init_input = NULL;
-_init_mouse ntux_init_mouse = NULL;
-_init_keyboard ntux_init_keyboard = NULL;
-_term_mouse ntux_term_mouse = NULL;
-_term_keyboard ntux_term_keyboard = NULL;
-_get_WinMap ntux_getWinMap = NULL;
-
-int enable_ntux_xf( )
-{
- h_ntux_ddx = LoadLibrary( "ntux_ddx.dll" );
- if( h_ntux_ddx == NULL )
- return 0;
-
- ntux_surface = (_get_surface)GetProcAddress( h_ntux_ddx, "get_surface" );
- init_input = (_init_input)GetProcAddress( h_ntux_ddx, "init_input" );
- ntux_init_mouse = (_init_mouse)GetProcAddress( h_ntux_ddx, "init_mouse" );
- ntux_init_keyboard = (_init_keyboard)GetProcAddress( h_ntux_ddx, "init_keyboard" );
- ntux_term_mouse = (_term_mouse)GetProcAddress( h_ntux_ddx, "term_mouse" );
- ntux_term_keyboard = (_term_keyboard)GetProcAddress( h_ntux_ddx, "term_keyboard" );
- ntux_getWinMap = (_get_WinMap)GetProcAddress( h_ntux_ddx, "get_WinMap" );
-
- OutputDebugString( "\nntux_ddx successfully loaded\n\n" );
- return 1;
-}
-
-
-char *get_framebuf( unsigned long size )
-{
- char msg[256];
- if( ntux_surface != NULL )
- {
- fprintf( stderr, "get_framebuf : calling %08x with size = %08x\n",
- ntux_surface, size
- );
- return ntux_surface( size );
- }
- return NULL;
-}
-
-
-void init_mouse( )
-{
- if( ntux_init_mouse != NULL )
- return ntux_init_mouse();
- return ;
-}
-
-void init_keyboard( )
-{
- if( ntux_init_keyboard != NULL )
- return ntux_init_keyboard();
- return ;
-}
-
-void term_mouse( )
-{
- if( ntux_term_mouse != NULL )
- return ntux_term_mouse();
- return ;
-}
-
-void term_keyboard( )
-{
- if( ntux_term_keyboard != NULL )
- return ntux_term_keyboard();
- return ;
-}
-
-void get_WinMappings( char *pKeySyms, unsigned char *p_modMap )
-{
- if( ntux_getWinMap != NULL )
- return ntux_getWinMap( pKeySyms, p_modMap );
- return ;
-}
-
-
-
diff --git a/xc/programs/Xserver/hw/vfb/windef.h b/xc/programs/Xserver/hw/vfb/windef.h
deleted file mode 100644
index eb1b39cf3..000000000
--- a/xc/programs/Xserver/hw/vfb/windef.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/vfb/windef.h,v 1.2 2001/04/27 12:58:28 dawes Exp $ */
-
-#ifndef _WINDEF_H
-#define _WINDEF_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef WINVER
-#define WINVER 0x0400
-#endif
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT WINVER
-#endif
-#ifndef WIN32
-#define WIN32
-#endif
-#ifndef _WIN32
-#define _WIN32
-#endif
-#define FAR
-#define far
-#define NEAR
-#define near
-#ifndef CONST
-#define CONST const
-#endif
-#undef MAX_PATH
-#define MAX_PATH 260
-
-#ifndef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL ((void*)0)
-#endif
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-#define IN
-#define OUT
-#ifndef OPTIONAL
-#define OPTIONAL
-#endif
-
-#ifdef __GNUC__
-#define PACKED __attribute__((packed))
-#ifndef _stdcall
-#define _stdcall __attribute__((stdcall))
-#endif
-#ifndef __stdcall
-#define __stdcall __attribute__((stdcall))
-#endif
-#ifndef _cdecl
-#define _cdecl __attribute__((cdecl))
-#endif
-#ifndef __cdecl
-#define __cdecl __attribute__((cdecl))
-#endif
-#ifndef __declspec
-#define __declspec(e) __attribute__((e))
-#endif
-#ifndef _declspec
-#define _declspec(e) __attribute__((e))
-#endif
-#else
-#define PACKED
-#define _cdecl
-#define __cdecl
-#endif
-
-#undef pascal
-#undef _pascal
-#undef __pascal
-#define pascal __stdcall
-#define _pascal __stdcall
-#define __pascal __stdcall
-#define PASCAL _pascal
-#define CDECL _cdecl
-#define STDCALL __stdcall
-#define WINAPI __stdcall
-#define WINAPIV __cdecl
-#define APIENTRY __stdcall
-#define CALLBACK __stdcall
-#define APIPRIVATE __stdcall
-
-#define DECLSPEC_IMPORT __declspec(dllimport)
-#define DECLSPEC_EXPORT __declspec(dllexport)
-#define DECLSPEC_NORETURN __declspec(noreturn)
-#define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
-#define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
-#define LOWORD(l) ((WORD)((DWORD)(l)))
-#define HIWORD(l) ((WORD)(((DWORD)(l)>>16)&0xFFFF))
-#define LOBYTE(w) ((BYTE)(w))
-#define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
-
-#ifndef _export
-#define _export
-#endif
-#ifndef __export
-#define __export
-#endif
-
-#ifndef NOMINMAX
-#ifndef max
-#define max(a,b) ((a)>(b)?(a):(b))
-#endif
-#ifndef min
-#define min(a,b) ((a)<(b)?(a):(b))
-#endif
-#endif
-
-#define UNREFERENCED_PARAMETER(P) {(P)=(P);}
-#define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
-#define DBG_UNREFERENCED_PARAMETER(P)
-#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
-
-typedef unsigned long DWORD;
-typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
-/* FIXME: Is there a good solution to this? */
-#ifndef __OBJC__
-typedef WINBOOL BOOL;
-#else
-#define BOOL WINBOOL
-#endif
-typedef unsigned char BYTE;
-typedef BOOL *PBOOL, *LPBOOL;
-typedef unsigned short WORD;
-typedef float FLOAT;
-typedef FLOAT *PFLOAT;
-typedef BYTE *PBYTE,*LPBYTE;
-typedef int *PINT,*LPINT;
-typedef WORD *PWORD,*LPWORD;
-typedef long *LPLONG;
-typedef DWORD *PDWORD,*LPDWORD;
-typedef void *PVOID,*LPVOID;
-typedef CONST void *PCVOID,*LPCVOID;
-typedef int INT;
-typedef unsigned int UINT,*PUINT,*LPUINT;
-
-#include <winnt.h>
-
-typedef UINT WPARAM;
-typedef LONG LPARAM;
-typedef LONG LRESULT;
-#ifndef _HRESULT_DEFINED
-typedef LONG HRESULT;
-#define _HRESULT_DEFINED
-#endif
-typedef WORD ATOM;
-typedef HANDLE HGLOBAL;
-typedef HANDLE HLOCAL;
-typedef HANDLE GLOBALHANDLE;
-typedef HANDLE LOCALHANDLE;
-typedef void *HGDIOBJ;
-DECLARE_HANDLE(HACCEL);
-DECLARE_HANDLE(HBITMAP);
-DECLARE_HANDLE(HBRUSH);
-DECLARE_HANDLE(HCOLORSPACE);
-DECLARE_HANDLE(HDC);
-DECLARE_HANDLE(HGLRC);
-DECLARE_HANDLE(HDESK);
-DECLARE_HANDLE(HENHMETAFILE);
-DECLARE_HANDLE(HFONT);
-DECLARE_HANDLE(HICON);
-DECLARE_HANDLE(HKEY);
-/* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
-/* #if (WINVER >= 0x0500) */
-DECLARE_HANDLE(HMONITOR);
-DECLARE_HANDLE(HTERMINAL);
-DECLARE_HANDLE(HWINEVENTHOOK);
-/* #endif */
-typedef HKEY *PHKEY;
-DECLARE_HANDLE(HMENU);
-DECLARE_HANDLE(HMETAFILE);
-DECLARE_HANDLE(HINSTANCE);
-typedef HINSTANCE HMODULE;
-DECLARE_HANDLE(HPALETTE);
-DECLARE_HANDLE(HPEN);
-DECLARE_HANDLE(HRGN);
-DECLARE_HANDLE(HRSRC);
-DECLARE_HANDLE(HSTR);
-DECLARE_HANDLE(HTASK);
-DECLARE_HANDLE(HWND);
-DECLARE_HANDLE(HWINSTA);
-DECLARE_HANDLE(HKL);
-typedef int HFILE;
-typedef HICON HCURSOR;
-typedef DWORD COLORREF;
-typedef int (WINAPI *FARPROC)();
-typedef int (WINAPI *NEARPROC)();
-typedef int (WINAPI *PROC)();
-typedef struct tagRECT {
- LONG left;
- LONG top;
- LONG right;
- LONG bottom;
-} RECT,*PRECT,*LPRECT;
-typedef const RECT *LPCRECT;
-typedef struct tagRECTL {
- LONG left;
- LONG top;
- LONG right;
- LONG bottom;
-} RECTL,*PRECTL,*LPRECTL;
-typedef const RECTL *LPCRECTL;
-typedef struct tagPOINT {
- LONG x;
- LONG y;
-} POINT,POINTL,*PPOINT,*LPPOINT,*PPOINTL,*LPPOINTL;
-typedef struct tagSIZE {
- LONG cx;
- LONG cy;
-} SIZE,SIZEL,*PSIZE,*LPSIZE,*PSIZEL,*LPSIZEL;
-typedef struct tagPOINTS {
- SHORT x;
- SHORT y;
-} POINTS,*PPOINTS,*LPPOINTS;
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/xc/programs/Xserver/hw/vfb/windows.h b/xc/programs/Xserver/hw/vfb/windows.h
deleted file mode 100644
index 33c4db61a..000000000
--- a/xc/programs/Xserver/hw/vfb/windows.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/vfb/windows.h,v 1.2 2001/04/27 12:58:28 dawes Exp $ */
-/*
- windows.h - main header file for the Win32 API
-
- Written by Anders Norlander <anorland@hem2.passagen.se>
-
- This file is part of a free library for the Win32 API.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-*/
-#ifndef _WINDOWS_H
-#define _WINDOWS_H
-/* translate GCC target defines to MS equivalents. Keep this synchronized
- with winnt.h. */
-#if defined(__i686__) && !defined(_M_IX86)
-#define _M_IX86 600
-#elif defined(__i586__) && !defined(_M_IX86)
-#define _M_IX86 500
-#elif defined(__i486__) && !defined(_M_IX86)
-#define _M_IX86 400
-#elif defined(__i386__) && !defined(_M_IX86)
-#define _M_IX86 300
-#endif
-#if defined(_M_IX86) && !defined(_X86_)
-#define _X86_
-#elif defined(_M_ALPHA) && !defined(_ALPHA_)
-#define _ALPHA_
-#elif defined(_M_PPC) && !defined(_PPC_)
-#define _PPC_
-#elif defined(_M_MRX000) && !defined(_MIPS_)
-#define _MIPS_
-#elif defined(_M_M68K) && !defined(_68K_)
-#define _68K_
-#endif
-
-#ifdef RC_INVOKED
-/* winresrc.h includes the necessary headers */
-#include <winresrc.h>
-#else
-
-#ifdef __GNUC__
-#ifndef NONAMELESSUNION
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-#define _ANONYMOUS_UNION
-#define _ANONYMOUS_STRUCT
-#else
-#if defined(__cplusplus)
-#define _ANONYMOUS_UNION
-#endif
-#endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
-#endif /* NONAMELESSUNION */
-#endif /* __GNUC__ */
-
-#ifndef _ANONYMOUS_UNION
-#define _UNION_NAME(x) x
-#define DUMMYUNIONNAME u
-#define DUMMYUNIONNAME2 u2
-#define DUMMYUNIONNAME3 u3
-#define DUMMYUNIONNAME4 u4
-#define DUMMYUNIONNAME5 u5
-#define DUMMYUNIONNAME6 u6
-#define DUMMYUNIONNAME7 u7
-#define DUMMYUNIONNAME8 u8
-#else
-#define _UNION_NAME(x)
-#define DUMMYUNIONNAME
-#define DUMMYUNIONNAME2
-#define DUMMYUNIONNAME3
-#define DUMMYUNIONNAME4
-#define DUMMYUNIONNAME5
-#define DUMMYUNIONNAME6
-#define DUMMYUNIONNAME7
-#define DUMMYUNIONNAME8
-#endif
-#ifndef _ANONYMOUS_STRUCT
-#define _STRUCT_NAME(x) x
-#define DUMMYSTRUCTNAME s
-#define DUMMYSTRUCTNAME2 s2
-#define DUMMYSTRUCTNAME3 s3
-#else
-#define _STRUCT_NAME(x)
-#define DUMMYSTRUCTNAME
-#define DUMMYSTRUCTNAME2
-#define DUMMYSTRUCTNAME3
-#endif
-
-#ifndef NO_STRICT
-#ifndef STRICT
-#define STRICT 1
-#endif
-#endif
-
-#include <stdarg.h>
-#include "windef.h"
-#include <wincon.h>
-#include <basetyps.h>
-#include <excpt.h>
-#include <winbase.h>
-#ifndef _WINGDI_H
-#include <wingdi.h>
-#endif
-#ifndef _WINUSER_H
-#include <winuser.h>
-#endif
-#ifndef _WINNLS_H
-#include <winnls.h>
-#endif
-#ifndef _WINVER_H
-#include <winver.h>
-#endif
-#ifndef _WINNETWK_H
-#include <winnetwk.h>
-#endif
-#ifndef _WINREG_H
-#include <winreg.h>
-#endif
-#ifndef _WINSVC_H
-#include <winsvc.h>
-#endif
-
-#ifndef WIN32_LEAN_AND_MEAN
-#include <commdlg.h>
-#include <cderr.h>
-#include <dde.h>
-#include <ddeml.h>
-#include <dlgs.h>
-#include <lzexpand.h>
-#include <mmsystem.h>
-#include <nb30.h>
-#include <rpc.h>
-#include <shellapi.h>
-#include <winperf.h>
-#include <winspool.h>
-#if defined(Win32_Winsock) || !(defined(__INSIDE_CYGWIN__) || defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(_UWIN))
-#include <winsock.h>
-#endif
-#endif /* WIN32_LEAN_AND_MEAN */
-
-#endif /* RC_INVOKED */
-
-#ifdef __OBJC__
-/* FIXME: Not undefining BOOL here causes all BOOLs to be WINBOOL (int),
- but undefining it causes trouble as well if a file is included after
- windows.h
-*/
-#undef BOOL
-#endif
-
-#endif
diff --git a/xc/programs/Xserver/hw/xfree86/CHANGELOG b/xc/programs/Xserver/hw/xfree86/CHANGELOG
index fd4d0babe..313871a9f 100644
--- a/xc/programs/Xserver/hw/xfree86/CHANGELOG
+++ b/xc/programs/Xserver/hw/xfree86/CHANGELOG
@@ -1,4 +1,317 @@
+XFree86 4.1.0 (2 June 2001)
+ 619. Disable PCI resource conflict checking for Linux/Alpha (Jay Estabrook).
+
+XFree86 4.0.99.902 (1 June 2001)
+ 618. Fix Linux xf86GetPciSizeFromOS() parsing when the kernel is 64 bit
+ and any base or size is larger than 32 bits in magnitude (#4732,
+ David S. Miller).
+ 617. Make XDarwin ddx pass up proper right and middle mouse button numbers
+ and fix mouse button 5 (Christoph Pfisterer and Torrey T. Lyons).
+ 616. Restore backwards compatibility from 4.0.[2,3] to 4.1.0 for
+ the i810, r128 and radeon DRI drivers (Gareth Hughes).
+ 615. Fix a problem when using patterns of horizontal lines with the mga
+ video overlay (#A.442, Ewald Snel).
+ 614. Xinstall.sh updates and bug fixes (David Dawes).
+ 613. Remove duplicate XineramaLibrary section in X11.tmpl (#4731,
+ Mike Harris).
+ 612. Enable building DRI for Linux/ppc, and fix a drm-related bug
+ for Linux/ppc (#4728, 4730, Michel Dänzer).
+ 611. Document Options for the r128 and fbdev drivers (#4727, 4729,
+ Michel Dänzer).
+ 610. Add a BuildBindist switch which causes a file containing the XFree86
+ version number to be installed in ProjectRoot, include this in
+ the Xbin bindist tarballs, and turn on this switch in the bindist
+ host.def files. The purpose is to allow the installer script to
+ easily identify which version the bindist tarballs are (David Dawes).
+ 609. Resync bindist and Xinstall.sh with changes made for 4.0.3 (David Dawes).
+ 608. Fix the Shape extension's XShapeCombineMask to handle cases where
+ src_mask is None according to the spec. This reportedly fixes an
+ X server crash (#4715, Huver).
+ 607. Make sure -UXF86DRI is after -DXF86DRI when compiling vfb/miinitext.c
+ (#4714, Frederic Lepied).
+ 606. Fix ATI Radeon driver on Alpha. Seems as though the BIOS doesn't
+ like Re-POSTing and memory setup gets confused. (Jay Estabrook, Jeff
+ Weidemeier)
+ 605. Fix build for Cygwin/XFree86 (#4711,#4713 Harold Hunt).
+ 604. Fix problem with Xinstall.sh on Darwin 1.3.x (#A.431, Stefan Pantos).
+ 603. Update Xinstall.sh and Darwin bindist directories to optionally
+ install Quartz support and to add an x86 distribution (Torrey T. Lyons).
+
+XFree86 4.0.99.901 (29 May 2001)
+ 602. Add missing return value for miSetPixmapDepths() (#4708,
+ ISHIKAWA Mutsumi).
+ 601. Fill in the v4l man page template with some useful information (#4707,
+ Gerd Knorr).
+ 600. Fix FFB OpenGL SwapBuffers (#4705, David S. Miller).
+ 599. Work around a problem building the rstart specs doc with a symlinked
+ build tree (David Dawes).
+ 598. Remove SPARC-specific byte-swapping code that would not work on older
+ SPARC CPUs (part of #4653, David S. Miller).
+ 597. NULLify mapVidMem() and remove DEV_MEM #define for Linux/SPARC
+ (#4651, David S. Miller).
+ 596. Fix Glint 300SX+Delta support. Add faster 500TX text acceleration
+ based on other code (Alan Hourihane).
+ 595. Fixing MTRR split code (hopefully) (Egbert Eich).
+ 594. Fixing coredump when doing vbeFree() twice: S3 Virge and C&T
+ (Egbert Eich).
+ 593. Fixing HWCursor for mga driver in fbdev mode (Egbert Eich).
+ 592. Fix xmh's use of XtNewString() with getenv (#4694, Tim Waugh).
+ 591. Xdm/PAM fixes: leave it to PAM to observe whether or not an account
+ is locked, and reinitialize credentials after calling initgroups(),
+ because sometimes the credentials pam_setcred() gives are in the
+ form of group membership (#4693, Mike Harris).
+ 590. Add an encodings file for standard box drawing characters for
+ VT100-compatible terminals (#4691, Juliusz Chroboczek).
+ 589. Fix warnings when building mieq.c (#4689, Adam Sulmicki).
+ 588. Fix some bugs in the cz and sk entried in XKB's keymap/xfree86 file
+ (#4692, Ivan Pascal).
+ 587. Add 'hr' entries to XKB's keymap/xfree86 and rules/xfree86.lst files
+ (#4687, Nerijus Baliunas).
+ 586. Include <X11/Xutil.h> in shape.h to get Region typedef (#4686,
+ Adam Sulmicki).
+ 585. Acceleration fixes for GLINT Permedia1 (Alan Hourihane).
+ 584. Ensure glint driver chips don't exceed the specified virtual sizes.
+ (Alan Hourihane).
+ 583. Remove all VGA'isms from the glint driver, it doesn't need them
+ (Alan Hourihane).
+ 582. Support the Delta in the glint driver, needed for boards that have
+ the Delta connected to the rasterizer, as it acts as an arbiter for
+ the bus. Resolves acceleration troubles. (Alan Hourihane).
+ 581. Add an lv entry to XKB's keymap/xfree86 file (#4685, Nerijus Baliunas).
+ 580. Fix some typos in XKB's xfree86.lst file (#4684, Nerijus Baliunas).
+ 579. Add DDXOSVERRORF ifdefs to the XFree86 ddx code that make use of the
+ OsVendorVErrorFProc feature (#4678, Michel Dänzer).
+ 578. Convert the r128 driver's "UseBIOSDisplay" option into a more general
+ "Display" option (#4678, Michel Dänzer).
+ 577. Treat GL_POINT like GL_POINTS and GL_LINE like GL_LINES in the sunffb
+ DRI driver (#4677, David S. Miller)
+ 576. Fix bsdLib.rules and bsdLib.tmpl problems that show up when
+ X11ProjectRoot is defined (#4676, Johnny C. Lam).
+ 575. Fix Trident XVideo colorkey at depth 15, 24 (Alan Hourihane).
+ 574. Fix a typo in the lv XKB description, and fix things so that it gets
+ installed (#4675, 4679, Andris Pavenis).
+ 573. Fix some apm driver bugs, including one that prevented acceleration
+ from working (#4674, Loïc Grenié).
+ 572. Fix 555 (depth 15) palette handling in the i810 driver (#4673,
+ Andrew C. Aitchison).
+ 571. [SECURITY] Fix authentication issues with mmap() on drm devices
+ (Jeff Hartmann).
+ 570. Add euro locales and some other missing locales to locale.alias and
+ locale.dir (#4662, 4665, 4667, Mike Harris).
+ 569. Fix Romanian XKB map (#4664, Mike Harris).
+ 568. Spell Portuguese correctly in XKB lst files (#4663, Mike Harris).
+ 567. Fix new ioperm calls in lnx_video.c for Alpha that are not needed
+ (Jay Estabrook).
+ 566. Fix problems with assembler file dependencies when using gccmakedep
+ with the build (Frederic Lepied).
+ 565. Finish DRI resync, including tdfx driver updates for textured video
+ support (VA Linux Systems).
+ 564. Fix formatting of max clock reported by DDC (Marc La France).
+ 563. Update Japanese localization of XDarwin help file (Toshimitsu Tanaka).
+ 562. Update XDarwin man pages, help files, and version info. Add option to
+ build XDarwin.app bundle for deployment (Torrey Lyons).
+
+XFree86 4.0.99.900 (18 May 2001)
+ 561. Add an XKB description for Latvian (lv) keyboards (#A.411, Ilya Ketris).
+ 560. Resync with DRI CVS trunk (VA Linux Systems).
+ 559. Savage driver updates, including compiler warning fixes, document
+ the "ShadowStatus" option in the man page, and fix an argument
+ mismatch between ShadowWait and SavageWaitQueue (#4661, Tim Roberts).
+ 558. Update the wacom driver to add a "ScreenNo" option to allow a tablet
+ to be attached to a screen in a multi-head setup, and to add auto-
+ detection of USB line and max parameters of USB tablets (#4640,
+ Frederic Lepied).
+ 557. Add a README file that has information about enabling the extra buttons
+ on the IBM Rapid Access keyboard (#4639, Dennis Bjorklund).
+ 556. Fix some Slovene/Slovak confusion in locale.dir/locale.alias files
+ (#4638, Kamil Toman).
+ 555. New XKB keymaps for cz and sk (#4634, 4637, Kamil Toman).
+ 554. Updates for the iso8859-2 Compose file (#4634, Kamil Toman).
+ 553. Check V_CSYNC in the r128 driver, and fix building with R128_DEBUG
+ enabled (#4631, Michel Dänzer).
+ 552. Mesa 3.4.2 (and later) import.
+ 551. More build & warning fixes (Marc La France).
+ 550. Fix bug that caused hardware cursors to be temporarily moved during mode
+ switches (Marc La France).
+ 549. Optimise HARDWARE_CURSOR_AND_SOURCE_WITH_MASK case (Marc La France).
+ 548. Move xf86CursorScreenRec definition into xf86CursorPriv.h
+ (Marc La France).
+ 547. Fix BIOS retrievals in MGA driver (Marc La France).
+ 546. Fix ATIProbe() for newer Rage128 and Radeon chips (Marc La France).
+ 545. Add temporary workaround in ATI driver for interrupts that occur on
+ PowerPC's upon PCI master-aborts (Marc La France).
+ 544. Update XDarwin to use fb and support Render (Torrey Lyons).
+ 543. Back out sunleo conversion to fb. This driver is too heavily dependent
+ on cfb32 for a simple fb conversion (Marc La France).
+ 542. Miscellaneous build/warning fixes (Marc La France).
+ 541. More prep work for SunOS (Marc La France).
+ 540. Fix libXft build on SunOS (Marc La France).
+ 539. Another makedepend bug fix (Marc La France).
+ 538. Fix use of xftcache utility during !UseInstalled builds (Marc La France).
+ 537. Adds #XFree86LOADER define to wrap ModuleInfo related functions
+ (#4654, Harold Hunt).
+ 536. Add an option to the SiS driver to turn off Xvideo support
+ (Ademar de Souza Reis Jr.)
+ 535. Fix FreeType bug, use MAXFONTNAMELEN (#4652, Janusz Gorycki,
+ Juliusz Chroboczek).
+ 534. Fix hw/vfb for compilation on Cygwin/XFree86 (#4655, Harold Hunt).
+ 533. Fix some Sparc platform issues with Pci resources and the glint
+ driver (#4641-4641,4644-4648 David S. Miller).
+ 532. Update glide, imstt, newport, rendition, suncg14, suncg3, suncg6,
+ sunleo, suntcx, vga and vmware to use fb and support Render
+ (Keith Packard).
+ 531. XDarwin fixes:
+ - Turn off building non-functional RENDER support.
+ - Reduce disappearing cursor problems when switching with Dock.
+ - Top of X display is no longer occasionally drawn black when
+ switching from Aqua.
+ (Torrey Lyons).
+ 530. Update freetype2 bits to 2.0.2 version (Keith Packard).
+ 529. Re-fix the Trident Video scaler support for Blade series chips
+ (Alan Hourihane).
+ 528. Fixed lbx to handle endian swapping without core dump (Egbert Eich).
+ 527. Fixed MTRR region splitting (Egbert Eich).
+ 526. Cleaned up option handling in int10 code (Egbert Eich).
+ 525. Added options to specify the Video BIOS to use for POSTing a
+ chipset (Egbert Eich).
+ 524. Trident driver: added call to BIOS to enable unstretched mode when
+ display is stretched. This should make the option "CyberShadow"
+ obsolete. (Egbert Eich).
+ 523. Attempt to fix video Support on Trident driver (Egbert Eich).
+ 522. Added VBE DDC support to SiS driver (Egbert Eich).
+ 521. Fixed Silicon Motion to unblank the display when driver fails
+ in PreInit() (Egbert Eich).
+ 520. Cleaned up handling of 'shadow status' in Savage driver
+ (Egbert Eich).
+ 519. Savage driver: fixed lockups for Savage4 when loading colormap,
+ manipulating the HW cursor, doing certain blit operations
+ 518. Cleanded up DDC code in mga driver (Egbert Eich).
+ 517. Fixed KGA handling in i740 driver (Egbert Eich).
+ 516. Converted i740 and Silicon Motion drivers to fb (Egbert Eich).
+ 515. Added calls to vbeFree() or xf86FreeInt10() to C&T, glint,
+ mga, neomagic, nv, s3v, tdfx and trident drivers to clean up
+ shared memory segments (Egbert Eich).
+ 514. Reworked video support in C&T driver, cleaned up block handler
+ (Egbert Eich).
+ 513. C&T driver: introduced a delay when setting the cursor image for
+ the first time after a mode change (Egbert Eich).
+ 512. Fixed R128CCE_RESET in r128 driver to do a reset only when dri
+ is enabled (Egbert Eich).
+ 511. Rewrote readPciBIOS() and getValidBIOSBase() (Egbert Eich).
+ 510. Fixed xf86Info structure in xf86Globals.c to match prototype
+ (Egbert Eich).
+ 509. -
+ 508. Fix XDarwin install problems with DESTDIR handling and with soft links
+ to the XtAppAddTimeOut manpage (Christoph Pfisterer).
+ 507. Add Error message output in Cygwin/XFree86 (#4632, Harold Hunt).
+ 506. Fix xdm when HasPam defined, and enable Pam support on Solaris 2.6 and
+ later (#A.401, #A.402, #A.403, Rainer Orth).
+ 505. Add Croatian keyboard for xkbcomp from Slovenian keyboard layout
+ (#A.405, Vlatko Kosturjak).
+ 504. Fix XvQueryAdaptors when there is no adaptors found
+ (#A.394, Jamie Strachan).
+ 503. Remove a stray INCLUDES in Xmuu/Imakefile when snprintf isn't used.
+ Set the Permedia2 DAC Mask to 0xFF.
+ PCI ROM space address access patch for LynxOS PPC.
+ Change limit of motoppcBusAddrToHostAddr for LynxOS PPC.
+ Include <sys/wait.h> for LynxOS in os/osinit.c.
+ Define CBAUD, when it's missing in xterm, on LynxOS.
+ (#A.387, Stuart Lissaman).
+ 502. Add SiS 86C204 to xf86PciInfo.h (#A.382, Carlos Manuel Duclos Vergara).
+ 501. Fix mga font corruption problems introduced with the recent addition
+ of big-endian support (#4629, Andrew C. Aitchison).
+ 500. Update for the mga driver's man page (#4628, Andy Isaacson).
+ 499. Add more drivers to the default build on Linux/mips (#4623,
+ Guido Guenther).
+ 498. Move the vgahw module load/init after the PROBD_DETECT handling
+ in the i810 driver's PreInit(), which fixes a segv when using
+ the X server's -configure option (#A.378, Leandro Martelli).
+ 497. Fix a problem with Radeon VE cards failing to enable its video output
+ (#A.376, Paul Stewart).
+ 496. Fix some DRI-related build dependency problems (David Dawes).
+ 495. Fix some drivers (including tdfx, r128, radeon, ark, imstt) that weren't
+ respecting the Virtual resolution requested in the config file
+ (David Dawes).
+ 494. Fix some offscreen memory calculation/allocation problems in the
+ tdfx driver (David Dawes).
+ 493. Fix a bug in localResizeOffscreenLinear when checking widths
+ (Alan Hourihane).
+ 492. Update Japanese localization for XDarwin Dock related fixes
+ (Toshimitsu Tanaka).
+ 491. Fix restoring of text mode fonts on Permedia3 (Alan Hourihane).
+ 490. Provide workaround for an apparent bug in Mac OS X 10.0.2 that causes
+ XDarwin to lose the cursor when switching to X using the Dock icon.
+ Fix "Application not responding" message in XDarwin's popup Dock menu
+ (Torrey Lyons).
+ 489. Hardware cursor documentation update (Marc La France).
+ 488. XVideo extension support in ATI driver for generic (e.g. v4l) adapters
+ (based on a patch by Ignacio Garcia Etxebarria).
+ 487. Fix ATI driver bug that caused the hardware cursor to move after mode
+ switches (Marc La France).
+ 486. Fix off-by-one error in screen positioning after a mode switch
+ (Marc La France).
+ 485. Backout part of 479 and implement a proper fix in the ATI driver
+ (Marc La France).
+ 484. Fix palette problem on NVIDIA Riva128 in DGA mode (Mark Vojkovich).
+ 483. setxkbmap patch that:
+ - fixes bug in comand line parser
+ - makes debug output more comprehensive
+ - prevent to use 'variant' from previous call if 'layout' name changed.
+ (#4627, Ivan Pascal)
+ 482. Documents Xaa specific options in the XF86Config manual page
+ (#4616, Branden Robinson)
+ 481. Add Mouse 3 Button emulation to Cygwin/XFree86 (#4626, Harold Hunt,
+ Alexander Gottwald).
+ 480. V4L documentation fix (Marc La France).
+ 479. Fix bug in generic hardware cursor RealizeCursor entry
+ (Marc La France).
+ 478. Extend the XFree86-VidModeExtension to accept gamma ramps from the
+ client rather than just rgb gamma values (Mark Vojkovich).
+ 477. More Xv updates for the Permedia3 (#4625, Sven Luther).
+ 476. Build Cygwin/XFree86 with -ansi -pedantic (Alan Hourihane).
+ 475. Limit the number of PCI buses to 128 on ix86 (Marc La France).
+ 474. More fixes for the handling of unassigned PCI bases (Marc La France).
+ 473. Fix option handling in most drivers so that per-screen options work
+ correctly (David Dawes).
+ 472. Resync with DRI CVS trunk (VA Linux Systems).
+ 471. Import latest Mesa 3.4.x branch.
+ 470. Add a PIOOffset value plus readEnable and writeEnable function pointers
+ to the vgahw rec. The former allows vgahw to be used for VGA registers
+ that are shadowed in I/O space. The latter allow the VGA_ENABLE
+ register to be accessed in similar way to most other VGA registers.
+ Add vgaHWEnable() and vgaHWDisable() functions (David Dawes).
+ 469. Disable HWcursor for CyberBladeXP chips (Alan Hourihane).
+ 468. Fix a Trident Cyber9388 setup issue (Alan Hourihane).
+ 467. Fix man page building and installing on Darwin. To be safe we assume
+ the Darwin file system is case insensitive since one common variety is,
+ ie. HFS+ (Torrey Lyons).
+ 466. Improve interoperability between Aqua pasteboard and X cut buffer with
+ XDarwin (Gregory Parker).
+ 465. Updates for Cygwin/XFree86 (Harold Hunt).
+ 464. Provide more robust default preferences for XDarwin (Torrey Lyons).
+ 463. Remove map84 keyboard map from Cygwin/XFree86 build (#4621, Harold Hunt).
+ 462. Disable xload on Cygwin/XFree86 (Alan Hourihane).
+ 461. Remove an errorneous i++ from os/xdmcp.c with -class (Alexander Gottwald).
+ 460. Allow Cygwin/XFree86 to build with cygipc support (Alan Hourihane).
+ 459. Small XDarwin fixes:
+ - Don't leak IOService objects when searching for desired screen.
+ - Eliminate chance of SIGPIPE while shutting down.
+ - Revert to Aqua cursor when quit by exiting main client.
+ - Stop console error messages when using mouse button 3.
+ (Torrey Lyons and Christoph Pfisterer).
+ 458. At Linus' request, make linux/int10 module deal with shmat() errors
+ (Marc La France).
+ 457. Fix makedepend's integer value parsing and make it understand GCC's
+ #include_next directive as found in glibc & libc5 (Marc La France).
+ 456. Xterm patch #156 (Thomas Dickey): change preference of types for
+ selection-target between UTF8_STRING and STRING (Juliusz Chroboczek),
+ fixes for configure script and documentation (report by Adam
+ <adam@cfar.umd.edu>).
+ 455. Fix XDarwin so display number preference is followed (Torrey Lyons).
+ 454. Fix Xserver/Imakefile for Cygwin/XFree86 (Harold Hunt, Alan Hourihane).
+
XFree86 4.0.99.3 (26 April 2001)
+ 453. Loader fixups for Sparc's (Marc La France).
452. Fix dependencies for libGLU on Cygwin/XFree86 (Alan Hourihane).
451. Make xdm & xfs compile on Cygwin/XFree86 (Alan Hourihane).
450. Update Japanese localization of XDarwin.app's Preferences window
@@ -13104,4 +13417,4 @@ XFree86 3.0a (28 April 1994)
XFree86 3.0 (26 April 1994)
-$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.1724 2001/04/27 11:47:10 alanh Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.1785.2.32 2001/06/02 15:27:50 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/Imakefile b/xc/programs/Xserver/hw/xfree86/Imakefile
index dbf721499..8d9b504ec 100644
--- a/xc/programs/Xserver/hw/xfree86/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/Imakefile
@@ -3,7 +3,7 @@ XCOMM $XConsortium: Imakefile /main/12 1996/12/16 12:31:46 rws $
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/Imakefile,v 3.75 2001/04/20 16:00:47 alanh Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/Imakefile,v 3.76 2001/05/15 18:22:20 paulo Exp $
#include <Server.tmpl>
#define IHaveSubdirs
@@ -200,6 +200,7 @@ InstallGenManPage(XF86Config,$(FILEMANDIR),$(FILEMANSUFFIX))
InstallNamedNonExec($(XF86CONFIG),XF86Config.eg,$(LIBDIR))
InstallNamedNonExec($(XF98CONFIG),XF86Config.98,$(LIBDIR))
+InstallNamedNonExec(Options,Options,$(LIBDIR))
InstallDriverSDKNamedNonExec($(XF86CONFIG),XF86Config.eg,$(DRIVERSDKDIR))
diff --git a/xc/programs/Xserver/hw/xfree86/Options b/xc/programs/Xserver/hw/xfree86/Options
new file mode 100644
index 000000000..c1b360b59
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/Options
@@ -0,0 +1,208 @@
+!!
+!! Copyright (c) 2001 by The XFree86 Project, Inc.
+!!
+!! Permission is hereby granted, free of charge, to any person obtaining a
+!! copy of this software and associated documentation files (the "Software"),
+!! to deal in the Software without restriction, including without limitation
+!! the rights to use, copy, modify, merge, publish, distribute, sublicense,
+!! and/or sell copies of the Software, and to permit persons to whom the
+!! Software is furnished to do so, subject to the following conditions:
+!!
+!! The above copyright notice and this permission notice shall be included in
+!! all copies or substantial portions of the Software.
+!!
+!! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+!! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+!! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+!! THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+!! WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+!! OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+!! SOFTWARE.
+!!
+!! Except as contained in this notice, the name of the XFree86 Project shall
+!! not be used in advertising or otherwise to promote the sale, use or other
+!! dealings in this Software without prior written authorization from the
+!! XFree86 Project.
+!!
+!! $XFree86: xc/programs/Xserver/hw/xfree86/Options,v 1.1.2.2 2001/06/01 02:24:16 dawes Exp $
+
+!! XAA options
+xaa.XaaNoCPUToScreenColorExpandFill:\
+Disables accelerated rectangular expansion blits from source patterns \
+stored in system memory (using a memory-mapped aperture).
+
+xaa.XaaNoColor8x8PatternFillRect:\
+Disables accelerated fills of a rectangular region with a full-color pattern.
+
+xaa.XaaNoColor8x8PatternFillTrap:\
+Disables accelerated fills of a trapezoidal region with a full-color pattern.
+
+xaa.XaaNoDashedBresenhamLine:\
+Disables accelerated dashed Bresenham line draws.
+
+xaa.XaaNoDashedTwoPointLine:\
+Disables accelerated dashed line draws between two arbitrary points.
+
+xaa.XaaNoImageWriteRect:\
+Disables acclerated transfers of full-color rectangular patterns from \
+system memory to video memory (using a memory-mapped aperture).
+
+xaa.XaaNoMono8x8PatternFillRect:\
+Disables accelerated fills of a rectangular region with a monochrome pattern.
+
+xaa.XaaNoMono8x8PatternFillTrap:\
+Disables accelerated fills of a trapezoidal region with a monochrome pattern.
+
+xaa.XaaNoOffscreenPixmaps:\
+Disables accelerated draws into pixmaps stored in offscreen video memory.
+
+xaa.XaaNoPixmapCache:\
+Disables caching of patterns in offscreen video memory.
+
+xaa.XaaNoScanlineCPUToScreenColorExpandFill:\
+Disables accelerated rectangular expansion blits from source patterns \
+stored in system memory (one scan line at a time).
+
+xaa.XaaNoScanlineImageWriteRect:\
+Disables acclerated transfers of full-color rectangular patterns from \
+system memory to video memory (one scan line at a time).
+
+xaa.XaaNoScreenToScreenColorExpandFill:\
+Disables accelerated rectangular expansion blits from source patterns \
+stored in offscreen video memory.
+
+xaa.XaaNoScreenToScreenCopy:\
+Disables accelerated copies of rectangular regions from one part of video \
+memory to another part of video memory.
+
+xaa.XaaNoSolidBresenhamLine:\
+Disables accelerated solid Bresenham line draws.
+
+xaa.XaaNoSolidFillRect:\
+Disables accelerated solid-color fills of rectangles.
+
+xaa.XaaNoSolidFillTrap:\
+Disables accelerated solid-color fills of Bresenham trapezoids.
+
+xaa.XaaNoSolidHorVertLine:\
+Disables accelerated solid horizontal and vertical line draws.
+
+xaa.XaaNoSolidTwoPointLine:\
+Disables accelerated solid line draws between two arbitrary points.
+
+
+!! FBDev options
+fbdev.fbdev:\
+The framebuffer device to use. \
+Default: /dev/fb0.
+
+fbdev.ShadowFB:\
+Enable or disable use of the shadow framebuffer layer. \
+Default: on.
+
+
+!! MGA options
+mga.ColorKey:\
+Set the colormap index used for the transparency key for the depth 8 plane \
+when operating in 8+24 overlay mode. The value must be in the range 2-255. \
+Default: 255.
+
+mga.HWcursor:\
+Enable or disable the HW cursor. Default: on.
+
+mga.MGASDRAM:\
+Specify whether G100, G200 or G400 cards have SDRAM. The driver attempts to \
+auto-detect this based on the card's PCI subsystem ID. This option may be \
+used to override that auto-detection. The mga driver is not able to \
+auto-detect the presence of of SDRAM on secondary heads in multihead \
+configurations so this option will often need to be specified in multihead \
+configurations. Default: autodetected.
+
+mga.NoAccel:\
+Disable or enable acceleration. Default: acceleration is enabled.
+
+mga.OverclockMem:\
+Set clocks to values used by some commercial X-Servers (G100, G200 and \
+G400 only). Default: off.
+
+mga.Overlay:\
+Enable 8+24 overlay mode. Only appropriate for depth 24. (Note: the G100 is \
+unaccelerated in the 8+24 overlay mode due to a missing hardware feature). \
+Default: off.
+
+mga.PciRetry:\
+Enable or disable PCI retries. Default: off.
+
+mga.Rotate:\
+Rotate the display clockwise or counterclockwise. This mode is unaccelerated. \
+Default: no rotation.
+
+mga.ShadowFB:\
+Enable or disable use of the shadow framebuffer layer. See shadowfb(4) for \
+further information. Default: off.
+
+mga.SyncOnGreen:\
+Enable or disable combining the sync signals with the green signal. \
+Default: off.
+
+mga.UseFBDev:\
+Enable or disable use of on OS-specific fb interface (and is not supported \
+on all OSs). See fbdevhw(4) for further information. Default: off.
+
+mga.VideoKey:\
+This sets the default pixel value for the YUV video overlay key. \
+Default: undefined.
+
+mga.TexturedVideo:\
+This has XvImage support use the texture engine rather than the video \
+overlay. This option is only supported by the G200 and G400, and only in \
+16 and 32 bits per pixel. Default: off.
+
+
+!! R128 options
+
+r128.SWcursor: \
+Selects software cursor. \
+Default: off.
+
+r128.NoAccel:\
+Enables or disables all hardware acceleration. \
+Default: on.
+
+r128.Dac6Bit:\
+Enables or disables the use of 6 bits per color component when in 8 bpp \
+mode (emulates VGA mode). \
+Default: off.
+
+r128.VideoKey:\
+This overrides the default pixel value for the YUV video overlay key. \
+Default: undefined.
+
+r128.Display:\
+Select display mode for devices which support flat panels. Supported\
+modes are "FP", "CRT", "Mirror", "BIOS". \
+Default: "FP".
+
+r128.ProgramFPRegs:\
+Enable or disable programming of the flat panel registers.\
+Beware that this may damage your panel, so use at your own risk. \
+Default: device dependant.
+
+r128.PanelWidth:\
+Override flat panel width in pixels. \
+Default: determined using BIOS.
+
+r128.PanelHeight:\
+Override flat panel height in pixels. \
+Default: determined using BIOS.
+
+r128.UseFBDev:\
+Enable or disable use of on OS-specific fb interface (and is not supported \
+on all OSs). See fbdevhw(4) for further information. Default: off.
+
+
+!! Vesa options
+vesa.ShadowFB:\
+Enable or disable use of the shadow framebuffer layer. See shadowfb(4)\
+for further information. Default: on.
+
diff --git a/xc/programs/Xserver/hw/xfree86/XF86Config.man b/xc/programs/Xserver/hw/xfree86/XF86Config.man
index b37bece20..8bfc1c64f 100644
--- a/xc/programs/Xserver/hw/xfree86/XF86Config.man
+++ b/xc/programs/Xserver/hw/xfree86/XF86Config.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Config.man,v 1.4 2001/04/05 19:29:41 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Config.man,v 1.5 2001/05/08 21:53:08 paulo Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH XF86Config __filemansuffix__ __vendorversion__
@@ -1214,6 +1214,82 @@ flags may be specified in the
section. Some are driver-specific and are described in the driver
documentation. Others are driver-independent, and will eventually be
described here.
+.TP 7
+.BI "Option \*qAccel\*q"
+Enables XAA (X Acceleration Architecture), a mechanism that makes video
+cards' 2D hardware acceleration available to the X server. This option is
+on by default, but it may be necessary to turn it off if there are bugs in
+the driver. There are many options to disable specific acclerated
+operations, listed below. Note that disabling an operation will have no
+effect if the operation is not accelerated (whether due to lack of support
+in the hardware or in the driver).
+.TP 7
+.BI "Option \*qXaaNoCPUToScreenColorExpandFill\*q"
+Disables accelerated rectangular expansion blits from source patterns
+stored in system memory (using a memory-mapped aperture).
+.TP 7
+.BI "Option \*qXaaNoColor8x8PatternFillRect\*q"
+Disables accelerated fills of a rectangular region with a full-color
+pattern.
+.TP 7
+.BI "Option \*qXaaNoColor8x8PatternFillTrap\*q"
+Disables accelerated fills of a trapezoidal region with a full-color
+pattern.
+.TP 7
+.BI "Option \*qXaaNoDashedBresenhamLine\*q"
+Disables accelerated dashed Bresenham line draws.
+.TP 7
+.BI "Option \*qXaaNoDashedTwoPointLine\*q"
+Disables accelerated dashed line draws between two arbitrary points.
+.TP 7
+.BI "Option \*qXaaNoImageWriteRect\*q"
+Disables acclerated transfers of full-color rectangular patterns from
+system memory to video memory (using a memory-mapped aperture).
+.TP 7
+.BI "Option \*qXaaNoMono8x8PatternFillRect\*q"
+Disables accelerated fills of a rectangular region with a monochrome
+pattern.
+.TP 7
+.BI "Option \*qXaaNoMono8x8PatternFillTrap\*q"
+Disables accelerated fills of a trapezoidal region with a monochrome
+pattern.
+.TP 7
+.BI "Option \*qXaaNoOffscreenPixmaps\*q"
+Disables accelerated draws into pixmaps stored in offscreen video memory.
+.TP 7
+.BI "Option \*qXaaNoPixmapCache\*q"
+Disables caching of patterns in offscreen video memory.
+.TP 7
+.BI "Option \*qXaaNoScanlineCPUToScreenColorExpandFill\*q"
+Disables accelerated rectangular expansion blits from source patterns
+stored in system memory (one scan line at a time).
+.TP 7
+.BI "Option \*qXaaNoScanlineImageWriteRect\*q"
+Disables acclerated transfers of full-color rectangular patterns from
+system memory to video memory (one scan line at a time).
+.TP 7
+.BI "Option \*qXaaNoScreenToScreenColorExpandFill\*q"
+Disables accelerated rectangular expansion blits from source patterns
+stored in offscreen video memory.
+.TP 7
+.BI "Option \*qXaaNoScreenToScreenCopy\*q"
+Disables accelerated copies of rectangular regions from one part of video
+memory to another part of video memory.
+.TP 7
+.BI "Option \*qXaaNoSolidBresenhamLine\*q"
+Disables accelerated solid Bresenham line draws.
+.TP 7
+.BI "Option \*qXaaNoSolidFillRect\*q"
+Disables accelerated solid-color fills of rectangles.
+.TP 7
+.BI "Option \*qXaaNoSolidFillTrap\*q"
+Disables accelerated solid-color fills of Bresenham trapezoids.
+.TP 7
+.BI "Option \*qXaaNoSolidHorVertLine\*q"
+Disables accelerated solid horizontal and vertical line draws.
+.TP 7
+.BI "Option \*qXaaNoSolidTwoPointLine\*q"
+Disables accelerated solid line draws between two arbitrary points.
.PP
Each
.B Screen
diff --git a/xc/programs/Xserver/hw/xfree86/common/Imakefile b/xc/programs/Xserver/hw/xfree86/common/Imakefile
index 13fd279ee..f35a8de43 100644
--- a/xc/programs/Xserver/hw/xfree86/common/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/common/Imakefile
@@ -4,7 +4,7 @@ XCOMM $XConsortium: Imakefile /main/34 1996/10/27 11:05:08 kaleb $
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/common/Imakefile,v 3.133 2001/04/21 20:08:06 herrb Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/common/Imakefile,v 3.134 2001/05/07 21:42:31 tsi Exp $
@@ -256,3 +256,4 @@ InstallDriverSDKNonExecFile(xf86cmap.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(xf86fbman.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(xf86str.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(xf86xv.h,$(DRIVERSDKINCLUDEDIR))
+InstallDriverSDKNonExecFile(xf86xvmc.h,$(DRIVERSDKINCLUDEDIR))
diff --git a/xc/programs/Xserver/hw/xfree86/common/atKeynames.h b/xc/programs/Xserver/hw/xfree86/common/atKeynames.h
index bfaa57499..a1a703795 100644
--- a/xc/programs/Xserver/hw/xfree86/common/atKeynames.h
+++ b/xc/programs/Xserver/hw/xfree86/common/atKeynames.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.16 2001/03/07 19:53:16 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.17 2001/05/18 16:03:10 tsi Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@@ -198,7 +198,7 @@
#define KEY_NFER /* No Kanji Transfer 0x7b */ 123
#define KEY_Yen /* Yen 0x7d */ 125
-/* These are for "notused" and "uknown" entries in translation maps. */
+/* These are for "notused" and "unknown" entries in translation maps. */
#define KEY_NOTUSED 0
#define KEY_UNKNOWN 255
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86.h b/xc/programs/Xserver/hw/xfree86/common/xf86.h
index 0835d874c..484433741 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.150 2001/04/05 17:42:31 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.152 2001/05/16 20:08:35 paulo Exp $ */
/*
* Copyright (c) 1997 by The XFree86 Project, Inc.
@@ -312,6 +312,11 @@ int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
pointer value);
Bool xf86IsUnblank(int mode);
+#ifdef XFree86LOADER
+void xf86AddModuleInfo(ModuleInfoPtr info, pointer module);
+void xf86DeleteModuleInfo(int idx);
+#endif
+
/* xf86Debug.c */
#ifdef BUILDDEBUG
void xf86Break1(void);
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c b/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c
index 3533bb7d4..c747e9216 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.61 2001/04/01 14:00:07 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.61.2.2 2001/06/02 15:27:54 dawes Exp $ */
/*
* Copyright (c) 1997-1999 by The XFree86 Project, Inc.
*/
@@ -53,16 +53,16 @@ resPtr osRes = NULL;
resPtr ResRange = NULL;
/* predefined special resources */
-resRange resVgaExclusive[] = {_VGA_EXCLUSIVE, _END};
-resRange resVgaShared[] = {_VGA_SHARED, _END};
-resRange resVgaMemShared[] = {_VGA_SHARED_MEM,_END};
-resRange resVgaIoShared[] = {_VGA_SHARED_IO,_END};
-resRange resVgaUnusedExclusive[] = {_VGA_EXCLUSIVE_UNUSED, _END};
-resRange resVgaUnusedShared[] = {_VGA_SHARED_UNUSED, _END};
-resRange resVgaSparseExclusive[] = {_VGA_EXCLUSIVE_SPARSE, _END};
-resRange resVgaSparseShared[] = {_VGA_SHARED_SPARSE, _END};
-resRange res8514Exclusive[] = {_8514_EXCLUSIVE, _END};
-resRange res8514Shared[] = {_8514_SHARED, _END};
+const resRange resVgaExclusive[] = {_VGA_EXCLUSIVE, _END};
+const resRange resVgaShared[] = {_VGA_SHARED, _END};
+const resRange resVgaMemShared[] = {_VGA_SHARED_MEM,_END};
+const resRange resVgaIoShared[] = {_VGA_SHARED_IO,_END};
+const resRange resVgaUnusedExclusive[] = {_VGA_EXCLUSIVE_UNUSED, _END};
+const resRange resVgaUnusedShared[] = {_VGA_SHARED_UNUSED, _END};
+const resRange resVgaSparseExclusive[] = {_VGA_EXCLUSIVE_SPARSE, _END};
+const resRange resVgaSparseShared[] = {_VGA_SHARED_SPARSE, _END};
+const resRange res8514Exclusive[] = {_8514_EXCLUSIVE, _END};
+const resRange res8514Shared[] = {_8514_SHARED, _END};
/* Flag: do we need RAC ? */
static Bool needRAC = FALSE;
@@ -1731,9 +1731,13 @@ xf86RegisterResources(int entityIndex, resList list, int access)
range.type = (range.type & ~ResAccMask) | (access & ResAccMask);
}
range.type &= ~ResEstimated; /* Not allowed for drivers */
+#if !(defined(__alpha__) && defined(linux))
+ /* On Alpha Linux, do not check for conflicts, trust the kernel. */
if (checkConflict(&range, Acc, entityIndex, SETUP,TRUE))
res = xf86AddResToList(res,&range,entityIndex);
- else {
+ else
+#endif
+ {
Acc = xf86AddResToList(Acc,&range,entityIndex);
}
list++;
@@ -2481,7 +2485,10 @@ xf86PostProbe(void)
}
xf86FreeResList(acc);
+#if !(defined(__alpha__) && defined(linux))
+ /* No need to validate on Alpha Linux, trust the kernel. */
ValidatePci();
+#endif
xf86MsgVerb(X_INFO, 3, "resource ranges after probing:\n");
xf86PrintResList(3, Acc);
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Config.c b/xc/programs/Xserver/hw/xfree86/common/xf86Config.c
index 4f524be61..8a488eac8 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Config.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Config.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.241 2001/03/28 17:58:39 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.242 2001/05/16 20:08:35 paulo Exp $ */
/*
@@ -454,6 +454,7 @@ GenerateDriverlist(char * dirname, char * drivernames)
const char *subdirs[] = {NULL, NULL};
static const char *patlist[] = {"(.*)_drv\\.so", "(.*)_drv\\.o", NULL};
char **dlist, **clist, **dcp, **ccp;
+ int size;
subdirs[0] = dirname;
@@ -468,13 +469,16 @@ GenerateDriverlist(char * dirname, char * drivernames)
/* The resulting list cannot be longer than the module list */
for (dcp = dlist, count = 0; *dcp++; count++);
- driverlist = (char **)xnfalloc((count + 1) * sizeof(char *));
+ driverlist = (char **)xnfalloc((size = count + 1) * sizeof(char *));
/* First, add modules not in compiled-in list */
for (count = 0, dcp = dlist; *dcp; dcp++) {
for (ccp = clist; ; ccp++) {
if (!*ccp) {
driverlist[count++] = *dcp;
+ if (count >= size)
+ driverlist = (char**)
+ xnfrealloc(driverlist, ++size * sizeof(char*));
break;
}
if (!strcmp(*ccp, *dcp))
@@ -487,6 +491,9 @@ GenerateDriverlist(char * dirname, char * drivernames)
for (dcp = dlist; *dcp; dcp++) {
if (!strcmp(*ccp, *dcp)) {
driverlist[count++] = *ccp;
+ if (count >= size)
+ driverlist = (char**)
+ xnfrealloc(driverlist, ++size * sizeof(char*));
break;
}
}
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c b/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c
index 3a7369d66..3ce0592ff 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.54 2001/04/10 16:07:58 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.55 2001/05/07 21:38:51 tsi Exp $ */
/*
* Copyright 2000 by Alan Hourihane, Sychdyn, North Wales.
*
@@ -246,7 +246,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int
/* Get driver's available options */
if (xf86DriverList[CurrentDriver]->AvailableOptions)
- NewDevice.GDev.options =
+ NewDevice.GDev.options = (OptionInfoPtr)
(*xf86DriverList[CurrentDriver]->AvailableOptions)(chipset,
bus);
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c b/xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c
index cb43b9418..b727d9c12 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.28 2000/06/24 00:33:54 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.29 2001/05/09 03:12:01 tsi Exp $ */
/* $XConsortium: xf86Cursor.c /main/10 1996/10/19 17:58:23 kaleb $ */
#define NEED_EVENTS
@@ -201,7 +201,7 @@ xf86ZoomViewport (ScreenPtr pScreen, int zoom)
/*
* adjust new frame for the displaysize
*/
- pScr->frameX0 = (pScr->frameX1 + pScr->frameX0 -
+ pScr->frameX0 = (pScr->frameX1 + pScr->frameX0 + 1 -
pScr->currentMode->HDisplay) / 2;
pScr->frameX1 = pScr->frameX0 + pScr->currentMode->HDisplay - 1;
@@ -213,7 +213,7 @@ xf86ZoomViewport (ScreenPtr pScreen, int zoom)
pScr->frameX1 = pScr->frameX0 + pScr->currentMode->HDisplay - 1;
}
- pScr->frameY0 = (pScr->frameY1 + pScr->frameY0 -
+ pScr->frameY0 = (pScr->frameY1 + pScr->frameY0 + 1 -
pScr->currentMode->VDisplay) / 2;
pScr->frameY1 = pScr->frameY0 + pScr->currentMode->VDisplay - 1;
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c b/xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c
index 6072ed15f..82a4dc8f7 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.5 2000/09/19 12:46:13 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.6 2001/05/10 10:17:39 alanh Exp $ */
/*
* Copyright (c) 1997-1998 by The XFree86 Project, Inc.
@@ -49,9 +49,9 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
pDPMS->Flags = flags;
DPMSOpt = xf86FindOption(xf86Screens[pScreen->myNum]->options, "dpms");
if (DPMSOpt) {
- if (pDPMS->Enabled
+ if ((pDPMS->Enabled
= xf86SetBoolOption(xf86Screens[pScreen->myNum]->options,
- "dpms",FALSE)
+ "dpms",FALSE))
&& !DPMSDisabledSwitch)
DPMSEnabled = TRUE;
xf86MarkOptionUsed(DPMSOpt);
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Events.c b/xc/programs/Xserver/hw/xfree86/common/xf86Events.c
index 2c68e4bc3..948dcda91 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Events.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Events.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.108 2001/04/20 16:32:30 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.109 2001/05/18 16:03:10 tsi Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@@ -299,7 +299,10 @@ ProcessInputEvents ()
extern u_char SpecialServerMap[];
#endif
-#if !defined(__EMX__) && !defined(__SOL8__) && !defined(__CYGWIN__)
+#if !defined(__EMX__) && \
+ !defined(__SOL8__) && \
+ (!defined(sun) || defined(i386)) && \
+ !defined(__CYGWIN__)
void
xf86PostKbdEvent(unsigned key)
{
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Globals.c b/xc/programs/Xserver/hw/xfree86/common/xf86Globals.c
index 19a8bc4a0..3bf520503 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Globals.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Globals.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.29 2001/03/05 20:18:19 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.32 2001/05/18 16:03:11 tsi Exp $ */
/*
* Copyright (c) 1997 by The XFree86 Project, Inc.
@@ -137,9 +137,9 @@ xf86InfoRec xf86Info = {
#if defined(i386) || defined(__i386__)
FALSE, /* pc98 */
#endif
- FALSE, /* kbdCustomKeycodes */
TRUE, /* pmFlag */
- 0 /* estimateSizesAggressively */
+ 0, /* estimateSizesAggressively */
+ FALSE /* kbdCustomKeycodes */
};
const char *xf86ConfigFile = NULL;
const char *xf86ModulePath = DEFAULT_MODULE_PATH;
@@ -159,6 +159,8 @@ DriverPtr *xf86DriverList = NULL;
int xf86NumDrivers = 0;
InputDriverPtr *xf86InputDriverList = NULL;
int xf86NumInputDrivers = 0;
+ModuleInfoPtr *xf86ModuleInfoList = NULL;
+int xf86NumModuleInfos = 0;
#endif
int xf86NumScreens = 0;
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c b/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c
index fd7ce942f..abaae4a0b 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.109 2001/01/06 20:19:07 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.111.2.1 2001/05/24 19:43:39 dawes Exp $ */
/*
* Copyright (c) 1997-1998 by The XFree86 Project, Inc.
@@ -69,6 +69,7 @@ xf86DeleteDriver(int drvIndex)
&& (!xf86DriverHasEntities(xf86DriverList[drvIndex]))) {
if (xf86DriverList[drvIndex]->module)
UnloadModule(xf86DriverList[drvIndex]->module);
+ xfree(xf86DriverList[drvIndex]);
xf86DriverList[drvIndex] = NULL;
}
}
@@ -100,8 +101,39 @@ xf86DeleteInputDriver(int drvIndex)
{
if (xf86InputDriverList[drvIndex] && xf86InputDriverList[drvIndex]->module)
UnloadModule(xf86InputDriverList[drvIndex]->module);
+ xfree(xf86InputDriverList[drvIndex]);
xf86InputDriverList[drvIndex] = NULL;
}
+
+void
+xf86AddModuleInfo(ModuleInfoPtr info, pointer module)
+{
+ /* Don't add null entries */
+ if (!module)
+ return;
+
+ if (xf86ModuleInfoList == NULL)
+ xf86NumModuleInfos = 0;
+
+ xf86NumModuleInfos++;
+ xf86ModuleInfoList = xnfrealloc(xf86ModuleInfoList,
+ xf86NumModuleInfos * sizeof(ModuleInfoPtr));
+ xf86ModuleInfoList[xf86NumModuleInfos - 1] = xnfalloc(sizeof(ModuleInfoRec));
+ *xf86ModuleInfoList[xf86NumModuleInfos - 1] = *info;
+ xf86ModuleInfoList[xf86NumModuleInfos - 1]->module = module;
+ xf86ModuleInfoList[xf86NumModuleInfos - 1]->refCount = 0;
+}
+
+void
+xf86DeleteModuleInfo(int idx)
+{
+ if (xf86ModuleInfoList[idx]) {
+ if (xf86ModuleInfoList[idx]->module)
+ UnloadModule(xf86ModuleInfoList[idx]->module);
+ xfree(xf86ModuleInfoList[idx]);
+ xf86ModuleInfoList[idx] = NULL;
+ }
+}
#endif
@@ -947,8 +979,8 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable)
WindowPtr pWin = WindowTable[pScreen->myNum];
WindowPtr pChild;
Bool WasViewable = (Bool)(pWin->viewable);
- Bool anyMarked;
- RegionPtr pOldClip, bsExposed;
+ Bool anyMarked = FALSE;
+ RegionPtr pOldClip = NULL, bsExposed;
#ifdef DO_SAVE_UNDERS
Bool dosave = FALSE;
#endif
@@ -1336,8 +1368,10 @@ xf86LogInit()
if ((logfile = fopen(xf86LogFile, "w")) == NULL)
FatalError("Cannot open log file \"%s\"\n", xf86LogFile);
setvbuf(logfile, NULL, _IONBF, 0);
+#ifdef DDXOSVERRORF
if (!OsVendorVErrorFProc)
OsVendorVErrorFProc = OsVendorVErrorF;
+#endif
/* Flush saved log information */
if (saveBuffer && size > 0) {
@@ -2000,7 +2034,6 @@ xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
{
register int status = vertsyncreg;
unsigned long i, cnt, rcnt, sync;
- int saved_nice;
/* First save registers that get written on */
(*ClockFunc)(pScrn, CLK_REG_SAVE);
@@ -2389,21 +2422,20 @@ typedef enum {
OPTION_BACKING_STORE
} BSOpts;
-static OptionInfoRec BSOptions[] = {
+static const OptionInfoRec BSOptions[] = {
{ OPTION_BACKING_STORE, "BackingStore", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
-#define nBSOptions (sizeof(BSOptions) / sizeof(BSOptions[0]))
-
void
xf86SetBackingStore(ScreenPtr pScreen)
{
Bool useBS = FALSE;
MessageType from = X_DEFAULT;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- OptionInfoRec options[nBSOptions];
+ OptionInfoPtr options;
+ options = xnfalloc(sizeof(BSOptions));
(void)memcpy(options, BSOptions, sizeof(BSOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
@@ -2418,6 +2450,7 @@ xf86SetBackingStore(ScreenPtr pScreen)
if (xf86GetOptValBool(options, OPTION_BACKING_STORE, &useBS))
from = X_CONFIG;
}
+ xfree(options);
pScreen->backingStoreSupport = useBS ? Always : NotUseful;
if (serverGeneration == 1)
xf86DrvMsg(pScreen->myNum, from, "Backing store %s\n",
@@ -2429,21 +2462,20 @@ typedef enum {
OPTION_SILKEN_MOUSE
} SMOpts;
-static OptionInfoRec SMOptions[] = {
+static const OptionInfoRec SMOptions[] = {
{ OPTION_SILKEN_MOUSE, "SilkenMouse", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
-#define nSMOptions (sizeof(SMOptions) / sizeof(SMOptions[0]))
-
void
xf86SetSilkenMouse (ScreenPtr pScreen)
{
Bool useSM = TRUE;
MessageType from = X_DEFAULT;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- OptionInfoRec options[nSMOptions];
+ OptionInfoPtr options;
+ options = xnfalloc(sizeof(SMOptions));
(void)memcpy(options, SMOptions, sizeof(SMOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
@@ -2462,6 +2494,7 @@ xf86SetSilkenMouse (ScreenPtr pScreen)
if (xf86GetOptValBool(options, OPTION_SILKEN_MOUSE, &useSM))
from = X_CONFIG;
}
+ xfree(options);
/*
* XXX quick hack to report correctly for OSs that can't do SilkenMouse
* yet. Should handle this differently so that alternate async methods
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Init.c b/xc/programs/Xserver/hw/xfree86/common/xf86Init.c
index 687366e66..857c2d59a 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Init.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Init.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.175 2001/02/08 23:36:26 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.176.2.1 2001/05/24 19:43:39 dawes Exp $ */
/*
* Copyright 1991-1999 by The XFree86 Project, Inc.
@@ -1146,6 +1146,7 @@ ddxProcessArgument(int argc, char **argv, int i)
* yet. Use malloc/free instead.
*/
+#ifdef DDXOSVERRORF
static Bool beenHere = FALSE;
if (!beenHere) {
@@ -1156,6 +1157,7 @@ ddxProcessArgument(int argc, char **argv, int i)
OsVendorVErrorFProc = OsVendorVErrorF;
beenHere = TRUE;
}
+#endif
/* First the options that are only allowed for root */
if (getuid() == 0)
@@ -1574,6 +1576,11 @@ xf86PrintBanner()
ErrorF(".%d", XF86_VERSION_SNAP);
#endif
+#if XF86_VERSION_SNAP >= 900
+ ErrorF(" (%d.%d.0 RC %d)", XF86_VERSION_MAJOR, XF86_VERSION_MINOR + 1,
+ XF86_VERSION_SNAP - 900);
+#endif
+
#ifdef XF86_CUSTOM_VERSION
ErrorF(" (%s)", XF86_CUSTOM_VERSION);
#endif
@@ -1584,7 +1591,7 @@ xf86PrintBanner()
ErrorF("\tIf the server is older than 6-12 months, or if your card is\n"
"\tnewer than the above date, look for a newer version before\n"
"\treporting problems. (See http://www.XFree86.Org/FAQ)\n");
- ErrorF("Operating System:%s%s\n", OSNAME, OSVENDOR);
+ ErrorF("Build Operating System:%s%s\n", OSNAME, OSVENDOR);
#if defined(BUILDERSTRING)
ErrorF("%s \n",BUILDERSTRING);
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h b/xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h
index 71883403b..11a750494 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.14 2001/03/08 23:23:32 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.15 2001/05/01 22:31:30 alanh Exp $ */
/*
*
* For Scancodes see notes in atKeynames.h !!!!
@@ -138,7 +138,7 @@ static KeySym map[NUM_KEYCODES * GLYPHS_PER_KEY] = {
/* 0x7f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
};
-#if !defined(Lynx) && !defined(AMOEBA) && !defined(MINIX) && !defined(__OSF__) && !defined(__EMX__) && !defined(__mips__) && !defined(linux) && !defined(CSRG_BASED)
+#if !defined(Lynx) && !defined(AMOEBA) && !defined(MINIX) && !defined(__OSF__) && !defined(__EMX__) && !defined(__mips__) && !defined(linux) && !defined(CSRG_BASED) && !defined(__CYGWIN__)
static KeySym map84[NUM_KEYCODES * GLYPHS_PER_KEY] = {
/* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
/* 0x01 */ XK_Escape, NoSymbol, NoSymbol, NoSymbol,
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c b/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c
index a16bed340..c431e6b06 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.39 2001/03/22 03:51:39 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.40 2001/05/10 10:17:39 alanh Exp $ */
/*
* Copyright (c) 1997,1998 by The XFree86 Project, Inc.
@@ -1718,7 +1718,7 @@ void
xf86PrintModes(ScrnInfoPtr scrp)
{
DisplayModePtr p;
- float hsync, refresh;
+ float hsync, refresh = 0;
char *desc, *desc2, *prefix;
if (scrp == NULL)
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h b/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h
index 85c47b5ba..dc5c2ca67 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.11 2001/03/13 16:03:36 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.12 2001/05/04 19:05:30 dawes Exp $ */
/* Option handling things that ModuleSetup procs can use */
@@ -63,17 +63,17 @@ Bool xf86CheckIfOptionUsed(pointer option);
Bool xf86CheckIfOptionUsedByName(pointer options, const char *name);
void xf86ShowUnusedOptions(int scrnIndex, pointer options);
void xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo);
-OptionInfoPtr xf86TokenToOptinfo(OptionInfoPtr table, int token);
-const char *xf86TokenToOptName(OptionInfoPtr table, int token);
-Bool xf86IsOptionSet(OptionInfoPtr table, int token);
-char *xf86GetOptValString(OptionInfoPtr table, int token);
-Bool xf86GetOptValInteger(OptionInfoPtr table, int token, int *value);
-Bool xf86GetOptValULong(OptionInfoPtr table, int token, unsigned long *value);
-Bool xf86GetOptValReal(OptionInfoPtr table, int token, double *value);
-Bool xf86GetOptValFreq(OptionInfoPtr table, int token,
+OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token);
+const char *xf86TokenToOptName(const OptionInfoRec *table, int token);
+Bool xf86IsOptionSet(const OptionInfoRec *table, int token);
+char *xf86GetOptValString(const OptionInfoRec *table, int token);
+Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value);
+Bool xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value);
+Bool xf86GetOptValReal(const OptionInfoRec *table, int token, double *value);
+Bool xf86GetOptValFreq(const OptionInfoRec *table, int token,
OptFreqUnits expectedUnits, double *value);
-Bool xf86GetOptValBool(OptionInfoPtr table, int token, Bool *value);
-Bool xf86ReturnOptValBool(OptionInfoPtr table, int token, Bool def);
+Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value);
+Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def);
int xf86NameCmp(const char *s1, const char *s2);
char *xf86NormalizeName(const char *s);
pointer xf86ReplaceIntOption(pointer optlist, char *name, int val);
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Option.c b/xc/programs/Xserver/hw/xfree86/common/xf86Option.c
index 4944d8062..aa30b70ae 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Option.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Option.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.22 2001/03/13 16:03:36 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.23 2001/05/04 19:05:30 dawes Exp $ */
/*
* Copyright (c) 1998 by The XFree86 Project, Inc.
@@ -573,9 +573,9 @@ xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo)
OptionInfoPtr
-xf86TokenToOptinfo(OptionInfoPtr table, int token)
+xf86TokenToOptinfo(const OptionInfoRec *table, int token)
{
- OptionInfoPtr p;
+ const OptionInfoRec *p;
for (p = table; p->token >= 0 && p->token != token; p++)
;
@@ -583,14 +583,14 @@ xf86TokenToOptinfo(OptionInfoPtr table, int token)
if (p->token < 0)
return NULL;
else
- return p;
+ return (OptionInfoPtr)p;
}
const char *
-xf86TokenToOptName(OptionInfoPtr table, int token)
+xf86TokenToOptName(const OptionInfoRec *table, int token)
{
- OptionInfoPtr p;
+ const OptionInfoRec *p;
p = xf86TokenToOptinfo(table, token);
return p->name;
@@ -598,7 +598,7 @@ xf86TokenToOptName(OptionInfoPtr table, int token)
Bool
-xf86IsOptionSet(OptionInfoPtr table, int token)
+xf86IsOptionSet(const OptionInfoRec *table, int token)
{
OptionInfoPtr p;
@@ -608,7 +608,7 @@ xf86IsOptionSet(OptionInfoPtr table, int token)
char *
-xf86GetOptValString(OptionInfoPtr table, int token)
+xf86GetOptValString(const OptionInfoRec *table, int token)
{
OptionInfoPtr p;
@@ -621,7 +621,7 @@ xf86GetOptValString(OptionInfoPtr table, int token)
Bool
-xf86GetOptValInteger(OptionInfoPtr table, int token, int *value)
+xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value)
{
OptionInfoPtr p;
@@ -635,7 +635,7 @@ xf86GetOptValInteger(OptionInfoPtr table, int token, int *value)
Bool
-xf86GetOptValULong(OptionInfoPtr table, int token, unsigned long *value)
+xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value)
{
OptionInfoPtr p;
@@ -649,7 +649,7 @@ xf86GetOptValULong(OptionInfoPtr table, int token, unsigned long *value)
Bool
-xf86GetOptValReal(OptionInfoPtr table, int token, double *value)
+xf86GetOptValReal(const OptionInfoRec *table, int token, double *value)
{
OptionInfoPtr p;
@@ -663,8 +663,8 @@ xf86GetOptValReal(OptionInfoPtr table, int token, double *value)
Bool
-xf86GetOptValFreq(OptionInfoPtr table, int token, OptFreqUnits expectedUnits,
- double *value)
+xf86GetOptValFreq(const OptionInfoRec *table, int token,
+ OptFreqUnits expectedUnits, double *value)
{
OptionInfoPtr p;
@@ -711,7 +711,7 @@ xf86GetOptValFreq(OptionInfoPtr table, int token, OptFreqUnits expectedUnits,
Bool
-xf86GetOptValBool(OptionInfoPtr table, int token, Bool *value)
+xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value)
{
OptionInfoPtr p;
@@ -725,7 +725,7 @@ xf86GetOptValBool(OptionInfoPtr table, int token, Bool *value)
Bool
-xf86ReturnOptValBool(OptionInfoPtr table, int token, Bool def)
+xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def)
{
OptionInfoPtr p;
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h b/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h
index fce49fa81..6cd064971 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.95 2001/04/17 20:46:39 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.98 2001/05/11 07:56:10 alanh Exp $ */
/*
* PCI Probe
*
@@ -239,6 +239,7 @@
#define PCI_CHIP_RADEON_QE 0x5145
#define PCI_CHIP_RADEON_QF 0x5146
#define PCI_CHIP_RADEON_QG 0x5147
+#define PCI_CHIP_RADEON_VE 0x5159
#define PCI_CHIP_RAGE128RE 0x5245
#define PCI_CHIP_RAGE128RF 0x5246
#define PCI_CHIP_RAGE128RG 0x5247
@@ -408,7 +409,8 @@
#define PCI_CHIP_SIS300 0x0300
#define PCI_CHIP_SIS630 0x6300
#define PCI_CHIP_SIS540 0x5300
-
+/* Agregado por Carlos Duclos & Manuel Jander */
+#define PCI_CHIP_SIS82C204 0x0204
/* HP */
#define PCI_CHIP_J2585A 0x1030
#define PCI_CHIP_J2585B 0x1031
@@ -830,6 +832,7 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{PCI_CHIP_RADEON_QE, "Radeon QE",0},
{PCI_CHIP_RADEON_QF, "Radeon QF",0},
{PCI_CHIP_RADEON_QG, "Radeon QG",0},
+ {PCI_CHIP_RADEON_VE, "Radeon VE",0},
{PCI_CHIP_RAGE128RE, "Rage 128 RE",0},
{PCI_CHIP_RAGE128RF, "Rage 128 RF",0},
{PCI_CHIP_RAGE128RK, "Rage 128 RK",0},
@@ -997,6 +1000,7 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = {
{PCI_CHIP_SIS300, "300",0},
{PCI_CHIP_SIS630, "630",0},
{PCI_CHIP_SIS540, "540",0},
+ {PCI_CHIP_SIS82C204, "82C204",0},
{0x0000, NULL,0}}},
#ifdef VENDOR_INCLUDE_NONVIDEO
{PCI_VENDOR_HP, {
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h b/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h
index 8a8d22ea2..eb1639617 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.70 2001/04/05 17:42:32 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.72 2001/05/15 18:22:21 paulo Exp $ */
/*
* Copyright (c) 1997 by The XFree86 Project, Inc.
@@ -70,6 +70,8 @@ extern int xf86NumMouseTypes;
#ifdef XFree86LOADER
extern DriverPtr *xf86DriverList;
+extern ModuleInfoPtr *xf86ModuleInfoList;
+extern int xf86NumModuleInfos;
#else
extern DriverPtr xf86DriverList[];
#endif
@@ -125,7 +127,7 @@ void xf86ClearEntityListForScreen(int scrnIndex);
void xf86AddDevToEntity(int entityIndex, GDevPtr dev);
extern void xf86PostPreInit(void);
extern void xf86PostScreenInit(void);
-extern memType getValidBIOSBase(PCITAG tag, int *num);
+extern memType getValidBIOSBase(PCITAG tag, int num);
extern int pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag);
/* xf86Config.c */
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h b/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h
index 578ec9ce7..6e3f63388 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.24 2001/04/20 16:32:30 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.25 2001/05/18 16:03:11 tsi Exp $ */
/*
* Copyright (c) 1997,1998 by The XFree86 Project, Inc.
@@ -12,8 +12,8 @@
#ifndef _XF86PRIVSTR_H
#define _XF86PRIVSTR_H
-#include "Xproto.h"
#include "xf86Pci.h"
+#include "xf86str.h"
/* PCI probe flags */
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Resources.h b/xc/programs/Xserver/hw/xfree86/common/xf86Resources.h
index ebc288393..9d37f2c26 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86Resources.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86Resources.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.11 2000/07/11 16:14:57 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.11.4.1 2001/05/28 14:23:37 eich Exp $ */
#ifndef _XF86_RESOURCES_H
@@ -80,16 +80,16 @@
{ResShrIoSparse | ResBios | ResBus, 0x02E8, 0x03F8}
/* predefined resources */
-extern resRange resVgaExclusive[];
-extern resRange resVgaShared[];
-extern resRange resVgaIoShared[];
-extern resRange resVgaMemShared[];
-extern resRange resVgaUnusedExclusive[];
-extern resRange resVgaUnusedShared[];
-extern resRange resVgaSparseExclusive[];
-extern resRange resVgaSparseShared[];
-extern resRange res8514Exclusive[];
-extern resRange res8514Shared[];
+extern const resRange resVgaExclusive[];
+extern const resRange resVgaShared[];
+extern const resRange resVgaIoShared[];
+extern const resRange resVgaMemShared[];
+extern const resRange resVgaUnusedExclusive[];
+extern const resRange resVgaUnusedShared[];
+extern const resRange resVgaSparseExclusive[];
+extern const resRange resVgaSparseShared[];
+extern const resRange res8514Exclusive[];
+extern const resRange res8514Shared[];
/* Less misleading aliases for xf86SetOpratingState() */
#define resVgaMem resVgaMemShared
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c b/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c
index fc5f79c4b..71cb0052f 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 1999 by The XFree86 Project, Inc.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.10 2001/02/15 20:31:52 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.12 2001/05/06 21:59:07 mvojkovi Exp $ */
/*
* This file contains the VidMode functions required by the extension.
@@ -544,6 +544,41 @@ VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue)
return TRUE;
}
+Bool
+VidModeSetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b)
+{
+ ScrnInfoPtr pScrn;
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ xf86ChangeGammaRamp(pScrn->pScreen, size, r, g, b);
+ return TRUE;
+}
+
+Bool
+VidModeGetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b)
+{
+ ScrnInfoPtr pScrn;
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ xf86GetGammaRamp(pScrn->pScreen, size, r, g, b);
+ return TRUE;
+}
+
+int
+VidModeGetGammaRampSize(int scrnIndex)
+{
+ if (!VidModeAvailable(scrnIndex))
+ return 0;
+
+ return xf86GetGammaRampSize(xf86Screens[scrnIndex]->pScreen);
+}
+
pointer
VidModeCreateMode(void)
{
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86cmap.c b/xc/programs/Xserver/hw/xfree86/common/xf86cmap.c
index 46b54e697..3b9596982 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86cmap.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86cmap.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.20 2001/02/15 20:31:53 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.22 2001/05/06 21:59:07 mvojkovi Exp $ */
#ifdef _XOPEN_SOURCE
#include <math.h>
@@ -925,6 +925,148 @@ CMapChangeGamma(
}
+static void
+ComputeGammaRamp (
+ CMapScreenPtr priv,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+){
+ int elements = priv->gammaElements;
+ LOCO *entry = priv->gamma;
+ int shift = 16 - priv->sigRGBbits;
+
+ while(elements--) {
+ entry->red = *(red++) >> shift;
+ entry->green = *(green++) >> shift;
+ entry->blue = *(blue++) >> shift;
+ entry++;
+ }
+}
+
+int
+xf86ChangeGammaRamp(
+ ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ CMapColormapPtr pColPriv;
+ CMapScreenPtr pScreenPriv;
+ CMapLinkPtr pLink;
+
+ if(CMapScreenIndex == -1)
+ return BadImplementation;
+
+ pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
+ if(!pScreenPriv)
+ return BadImplementation;
+
+ if(pScreenPriv->gammaElements != size)
+ return BadValue;
+
+ ComputeGammaRamp(pScreenPriv, red, green, blue);
+
+ /* mark all colormaps on this screen */
+ pLink = pScreenPriv->maps;
+ while(pLink) {
+ pColPriv =
+ (CMapColormapPtr) pLink->cmap->devPrivates[CMapColormapIndex].ptr;
+ pColPriv->recalculate = TRUE;
+ pLink = pLink->next;
+ }
+
+ if(miInstalledMaps[pScreen->myNum] &&
+ ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) ||
+ pScrn->vtSema || pScreenPriv->isDGAmode)) {
+ ColormapPtr pMap = miInstalledMaps[pScreen->myNum];
+
+ if(!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
+ (pMap->pVisual->class == TrueColor) &&
+ ((1 << pMap->pVisual->nplanes) > pScreenPriv->maxColors)) {
+
+ /* if the current map doesn't have a palette look
+ for another map to change the gamma on. */
+
+ pLink = pScreenPriv->maps;
+ while(pLink) {
+ if(pLink->cmap->pVisual->class == PseudoColor)
+ break;
+ pLink = pLink->next;
+ }
+
+ if(pLink) {
+ /* need to trick CMapRefreshColors() into thinking
+ this is the currently installed map */
+ miInstalledMaps[pScreen->myNum] = pLink->cmap;
+ CMapReinstallMap(pLink->cmap);
+ miInstalledMaps[pScreen->myNum] = pMap;
+ }
+ } else
+ CMapReinstallMap(pMap);
+ }
+
+ return Success;
+}
+
+int
+xf86GetGammaRampSize(ScreenPtr pScreen)
+{
+ CMapScreenPtr pScreenPriv;
+
+ if(CMapScreenIndex == -1) return 0;
+
+ pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
+ if(!pScreenPriv) return 0;
+
+ return pScreenPriv->gammaElements;
+}
+
+int
+xf86GetGammaRamp(
+ ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+){
+ CMapScreenPtr pScreenPriv;
+ LOCO *entry;
+ int shift, sigbits;
+
+ if(CMapScreenIndex == -1)
+ return BadImplementation;
+
+ pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
+ if(!pScreenPriv)
+ return BadImplementation;
+
+ if(size > pScreenPriv->gammaElements)
+ return BadValue;
+
+ entry = pScreenPriv->gamma;
+ sigbits = pScreenPriv->sigRGBbits;
+
+ while(size--) {
+ *red = entry->red << (16 - sigbits);
+ *green = entry->green << (16 - sigbits);
+ *blue = entry->blue << (16 - sigbits);
+ shift = sigbits;
+ while(shift < 16) {
+ *red |= *red >> shift;
+ *green |= *green >> shift;
+ *blue |= *blue >> shift;
+ shift += sigbits;
+ }
+ red++; green++; blue++;
+ entry++;
+ }
+
+ return Success;
+}
+
int
xf86ChangeGamma(
ScreenPtr pScreen,
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86cmap.h b/xc/programs/Xserver/hw/xfree86/common/xf86cmap.h
index 8dd5986e2..b871d6762 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86cmap.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86cmap.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.6 2000/05/11 18:14:28 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.7 2001/05/06 00:49:12 mvojkovi Exp $ */
#ifndef _XF86CMAP_H
#define _XF86CMAP_H
@@ -38,5 +38,25 @@ xf86ChangeGamma(
Gamma newGamma
);
+int
+xf86ChangeGammaRamp(
+ ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+);
+
+int xf86GetGammaRampSize(ScreenPtr pScreen);
+
+int
+xf86GetGammaRamp(
+ ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+);
+
#endif /* _XF86CMAP_H */
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86fbman.c b/xc/programs/Xserver/hw/xfree86/common/xf86fbman.c
index ab039b51b..253c9aba9 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86fbman.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86fbman.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.21 2001/02/15 20:31:53 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.22 2001/05/10 10:17:39 alanh Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -917,7 +917,7 @@ localResizeOffscreenLinear(FBLinearPtr resize, int length)
extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
pitch = extents->x2 - extents->x1;
- if(length < w) { /* special case */
+ if(length < pitch) { /* special case */
w = length;
h = 1;
} else {
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c b/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c
index f74d0d8b3..9b1e3f000 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.39 2001/04/01 14:00:08 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.42 2001/05/16 07:56:06 alanh Exp $ */
/*
* Copyright (c) 1997-1999 by The XFree86 Project, Inc.
@@ -406,7 +406,8 @@ FindPCIVideoInfo(void)
xf86ErrorF("unknown chipset (0x%04x) ", info->chipType);
xf86ErrorF("rev %d", info->chipRev);
for (i = 0; i < 6; i++) {
- if (info->memBase[i]) {
+ if (info->memBase[i] &&
+ (info->memBase[i] < (memType)(-1 << info->size[i]))) {
if (!memdone) {
xf86ErrorF(", Mem @ ");
memdone = TRUE;
@@ -416,7 +417,8 @@ FindPCIVideoInfo(void)
}
}
for (i = 0; i < 6; i++) {
- if (info->ioBase[i]) {
+ if (info->ioBase[i] &&
+ (info->ioBase[i] < (memType)(-1 << info->size[i]))) {
if (!iodone) {
xf86ErrorF(", I/O @ ");
iodone = TRUE;
@@ -425,6 +427,10 @@ FindPCIVideoInfo(void)
xf86ErrorF("0x%04x/%d", info->ioBase[i], info->size[i]);
}
}
+ if (info->biosBase &&
+ (info->biosBase < (memType)(-1 << info->biosSize)))
+ xf86ErrorF(", BIOS @ 0x%08x/%d",
+ info->biosBase, info->biosSize);
xf86ErrorF("\n");
}
}
@@ -819,12 +825,14 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
resMisc |= ResEstimated;
for (i = 0; i < 6; i++) {
- if (pvp->ioBase[i]) {
+ if (pvp->ioBase[i] &&
+ (pvp->ioBase[i] < (memType)(-1 << pvp->size[i]))) {
PV_I_RANGE(range,pvp,i,ResExcIoBlock | resMisc);
tmp = xf86AddResToList(NULL, &range, -1);
removeOverlapsWithBridges(pvp->bus,tmp);
*res = xf86JoinResLists(tmp,*res);
- } else if (pvp->memBase[i]) {
+ } else if (pvp->memBase[i] &&
+ (pvp->memBase[i] < (memType)(-1 << pvp->size[i]))) {
PV_M_RANGE(range, pvp,i, ResExcMemBlock | resMisc);
tmp = xf86AddResToList(NULL, &range, -1);
removeOverlapsWithBridges(pvp->bus,tmp);
@@ -834,7 +842,8 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
/* FIXME!!!: Don't use BIOS resources for overlap
* checking but reserve them!
*/
- if (pvp->biosBase) {
+ if (pvp->biosBase &&
+ (pvp->biosBase < (memType)(-1 << pvp->biosSize))) {
PV_B_RANGE(range, pvp, ResExcMemBlock | resMisc);
tmp = xf86AddResToList(NULL, &range, -1);
removeOverlapsWithBridges(pvp->bus,tmp);
@@ -1185,13 +1194,12 @@ fixPciResource(int prt, memType alignment, pciVideoPtr pvp, long type)
xf86FreeResList(w_2nd);
xf86FreeResList(avoid);
return TRUE;
- } else {
+ }
#ifdef DEBUG
- ErrorF("removing old resource\n");
+ ErrorF("removing old resource\n");
#endif
- orgAcc = Acc;
- Acc = AccTmp;
- }
+ orgAcc = Acc;
+ Acc = AccTmp;
#else
orgAcc = xf86DupResList(Acc);
pAcc = &Acc;
@@ -1374,7 +1382,127 @@ xf86ReallocatePciResources(int entityIndex, resPtr pRes)
/*
* BIOS releated
*/
+memType
+getValidBIOSBase(PCITAG tag, int num)
+{
+ pciVideoPtr pvp = NULL;
+ PciBusPtr pbp, pbp1;
+ resPtr m = NULL;
+ resPtr tmp, avoid;
+ resRange range;
+ memType ret;
+ int n = 0;
+ CARD32 biosSize, alignment;
+
+ if (!xf86PciVideoInfo) return 0;
+
+ while ((pvp = xf86PciVideoInfo[n++])) {
+ if (pciTag(pvp->bus,pvp->device,pvp->func) == tag)
+ break;
+ }
+ if (!pvp) return 0;
+
+ biosSize = pvp->biosSize;
+ alignment = (1 << biosSize) - 1;
+ if (biosSize > 24)
+ biosSize = 24;
+
+ switch ((romBaseSource)num) {
+ case ROM_BASE_PRESET:
+ return 0; /* This should not happen */
+ case ROM_BASE_BIOS:
+ /* In some cases the BIOS base register contains the size mask */
+ if ((memType)(-1 << biosSize) == PCIGETROM(pvp->biosBase))
+ return 0;
+ P_M_RANGE(range, TAG(pvp),pvp->biosBase,biosSize,ResExcMemBlock);
+ ret = pvp->biosBase;
+ break;
+ case ROM_BASE_MEM0:
+ case ROM_BASE_MEM1:
+ case ROM_BASE_MEM2:
+ case ROM_BASE_MEM3:
+ case ROM_BASE_MEM4:
+ case ROM_BASE_MEM5:
+ if (!pvp->memBase[num] || (pvp->size[n] < biosSize))
+ return 0;
+ P_M_RANGE(range, TAG(pvp),pvp->memBase[num],biosSize,
+ ResExcMemBlock);
+ ret = pvp->memBase[num];
+ break;
+ case ROM_BASE_FIND:
+ ret = 0;
+ break;
+ default:
+ return 0; /* This should not happen */
+ }
+
+ /* Now find the ranges for validation */
+ avoid = xf86DupResList(pciAvoidRes);
+ pbp = pbp1 = xf86PciBus;
+ while (pbp) {
+ if (pbp->secondary == pvp->bus) {
+ if (pbp->preferred_pmem)
+ tmp = xf86DupResList(pbp->preferred_pmem);
+ else
+ tmp = xf86DupResList(pbp->pmem);
+ m = xf86JoinResLists(m,tmp);
+ if (pbp->preferred_mem)
+ tmp = xf86DupResList(pbp->preferred_mem);
+ else
+ tmp = xf86DupResList(pbp->mem);
+ m = xf86JoinResLists(m,tmp);
+ tmp = m;
+ while (tmp) {
+ tmp->block_end = MIN(tmp->block_end,PCI_MEM32_LENGTH_MAX);
+ tmp = tmp->next;
+ }
+ }
+ while (pbp1) {
+ if (pbp1->primary == pvp->bus) {
+ tmp = xf86DupResList(pbp1->preferred_pmem);
+ avoid = xf86JoinResLists(avoid,tmp);
+ tmp = xf86DupResList(pbp1->pmem);
+ avoid = xf86JoinResLists(avoid,tmp);
+ tmp = xf86DupResList(pbp1->preferred_mem);
+ avoid = xf86JoinResLists(avoid,tmp);
+ tmp = xf86DupResList(pbp1->mem);
+ avoid = xf86JoinResLists(avoid,tmp);
+ }
+ pbp1 = pbp1->next;
+ }
+ pbp = pbp->next;
+ }
+ pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid);
+
+ if (!ret) {
+ /*
+ * Return a possible window. Note that this doesn't deal with
+ * host bridges yet. But the fix for that belongs elsewhere.
+ */
+ while (m) {
+ range = xf86GetBlock(ResExcMemBlock,
+ PCI_SIZE(ResMem, TAG(pvp), 1 << biosSize),
+ m->block_begin, m->block_end,
+ PCI_SIZE(ResMem, TAG(pvp), alignment),
+ avoid);
+ if (range.type != ResEnd) {
+ ret = M2B(TAG(pvp), range.rBase);
+ break;
+ }
+ m = m->next;
+ }
+ } else {
+ if (!xf86IsSubsetOf(range, m) ||
+ ChkConflict(&range, avoid, SETUP))
+ ret = 0;
+ }
+
+ xf86FreeResList(avoid);
+ xf86FreeResList(m);
+ return ret;
+}
+#if 0
memType
getValidBIOSBase(PCITAG tag, int *num)
{
@@ -1436,7 +1564,9 @@ getValidBIOSBase(PCITAG tag, int *num)
}
pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid);
- if (pvp->biosBase) { /* try biosBase first */
+ if (pvp->biosBase &&
+ (pvp->biosBase < (memType)(-1 << pvp->biosSize))) {
+ /* try biosBase first */
P_M_RANGE(range, TAG(pvp),pvp->biosBase,biosSize,ResExcMemBlock);
if (xf86IsSubsetOf(range,m) && ! ChkConflict(&range,avoid,SETUP)) {
xf86FreeResList(avoid);
@@ -1498,6 +1628,7 @@ getValidBIOSBase(PCITAG tag, int *num)
return 0;
}
+#endif
/*
* xf86Bus.c interface
@@ -1566,24 +1697,24 @@ get_sun_apb_ranges(PciBusPtr PciBus, pciConfigPtr pcrp)
iomap = pciReadByte(pcrp->tag, APB_IO_ADDRESS_MAP);
memmap = pciReadByte(pcrp->tag, APB_MEM_ADDRESS_MAP);
- /* if (pcrp->pci_command & PCI_CMD_IO_ENABLE) */ { /* ??? */
+ if (pcrp->pci_command & PCI_CMD_IO_ENABLE) {
for (i = 0; i < 8; i++) {
if ((iomap & (1 << i)) != 0) {
PCI_I_RANGE(range, pcrp->tag,
(i << 21), (i << 21) + ((1 << 21) - 1),
ResIo | ResBlock | ResExclusive);
- PciBus->io = xf86AddResToList(PciBus->io, &range, -1);
+ PciBus->preferred_io = xf86AddResToList(PciBus->preferred_io, &range, -1);
}
}
}
- /* if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) */ { /* ??? */
+ if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) {
for (i = 0; i < 8; i++) {
if ((memmap & (1 << i)) != 0) {
PCI_M_RANGE(range, pcrp->tag,
(i << 29), (i << 29) + ((1 << 29) - 1),
ResMem | ResBlock | ResExclusive);
- PciBus->mem = xf86AddResToList(PciBus->mem, &range, -1);
+ PciBus->preferred_mem = xf86AddResToList(PciBus->preferred_mem, &range, -1);
}
}
}
@@ -1923,6 +2054,10 @@ ValidatePci(void)
Sys = xf86AddResToList(Sys, &range, -1);
}
}
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3,"Sys:\n");
+ xf86PrintResList(3,Sys);
+#endif
/*
* The order the video devices are listed in is
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86str.h b/xc/programs/Xserver/hw/xfree86/common/xf86str.h
index b5739aa60..23c873391 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86str.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86str.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.76 2001/04/10 16:07:58 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.79 2001/05/18 23:35:31 dawes Exp $ */
/*
* Copyright (c) 1997-2000 by The XFree86 Project, Inc.
@@ -218,11 +218,27 @@ typedef struct _DriverRec {
char * driverName;
void (*Identify)(int flags);
Bool (*Probe)(struct _DriverRec *drv, int flags);
- OptionInfoPtr (*AvailableOptions)(int chipid, int bustype);
+ const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
pointer module;
int refCount;
} DriverRec, *DriverPtr;
+#ifdef XFree86LOADER
+/*
+ * The optional module list struct. This allows modules exporting helping
+ * functions to configuration tools, the Xserver, or any other
+ * application/module interested in such information.
+ */
+typedef struct _ModuleInfoRec {
+ int moduleVersion;
+ char * moduleName;
+ pointer module;
+ int refCount;
+ const OptionInfoRec * (*AvailableOptions)(void *unused);
+ pointer unused[8]; /* leave some space for more fields */
+} ModuleInfoRec, *ModuleInfoPtr;
+#endif
+
/*
* These are the private bus types. New types can be added here. Types
* required for the public interface should be added to xf86str.h, with
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86xv.c b/xc/programs/Xserver/hw/xfree86/common/xf86xv.c
index 70d5aa482..d029c872c 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86xv.c
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86xv.c
@@ -6,7 +6,7 @@
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.28 2000/08/05 03:32:37 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.29 2001/05/07 21:59:05 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -176,10 +176,14 @@ xf86XVScreenInit(
XF86VideoAdaptorPtr *adaptors,
int num
){
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ScrnInfoPtr pScrn;
XF86XVScreenPtr ScreenPriv;
XvScreenPtr pxvs;
+ if(num <= 0 ||
+ !XvGetScreenIndexProc || !XvGetRTPortProc || !XvScreenInitProc)
+ return FALSE;
+
if(XF86XVGeneration != serverGeneration) {
if((XF86XVWindowIndex = AllocateWindowPrivateIndex()) < 0)
return FALSE;
@@ -189,9 +193,6 @@ xf86XVScreenInit(
if(!AllocateWindowPrivate(pScreen,XF86XVWindowIndex,sizeof(XF86XVWindowRec)))
return FALSE;
- if(!XvGetScreenIndexProc || !XvGetRTPortProc || !XvScreenInitProc)
- return FALSE;
-
if(Success != (*XvScreenInitProc)(pScreen)) return FALSE;
XF86XvScreenIndex = (*XvGetScreenIndexProc)();
@@ -199,7 +200,6 @@ xf86XVScreenInit(
pxvs = GET_XV_SCREEN(pScreen);
-
/* Anyone initializing the Xv layer must provide these two.
The Xv di layer calls them without even checking if they exist! */
@@ -216,6 +216,7 @@ xf86XVScreenInit(
if(!ScreenPriv) return FALSE;
+ pScrn = xf86Screens[pScreen->myNum];
ScreenPriv->CreateWindow = pScreen->CreateWindow;
ScreenPriv->DestroyWindow = pScreen->DestroyWindow;
@@ -225,7 +226,6 @@ xf86XVScreenInit(
ScreenPriv->LeaveVT = pScrn->LeaveVT;
ScreenPriv->AdjustFrame = pScrn->AdjustFrame;
-
pScreen->CreateWindow = xf86XVCreateWindow;
pScreen->DestroyWindow = xf86XVDestroyWindow;
pScreen->WindowExposures = xf86XVWindowExposures;
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86xv.h b/xc/programs/Xserver/hw/xfree86/common/xf86xv.h
index 45fd72540..3756ea91d 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86xv.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86xv.h
@@ -1,7 +1,7 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.20 2001/03/05 04:48:22 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.21 2001/05/07 21:59:06 tsi Exp $ */
-#ifndef _XVDIX_H_
-#define _XVDIX_H_
+#ifndef _XF86XV_H_
+#define _XF86XV_H_
#include "xvdix.h"
#include "xf86str.h"
@@ -254,5 +254,4 @@ typedef struct _XF86XVWindowRec{
struct _XF86XVWindowRec *next;
} XF86XVWindowRec, *XF86XVWindowPtr;
-#endif /* _XVDIX_H_ */
-
+#endif /* _XF86XV_H_ */
diff --git a/xc/programs/Xserver/hw/xfree86/ddc/print_edid.c b/xc/programs/Xserver/hw/xfree86/ddc/print_edid.c
index 02309aeb8..e5e5a22b8 100644
--- a/xc/programs/Xserver/hw/xfree86/ddc/print_edid.c
+++ b/xc/programs/Xserver/hw/xfree86/ddc/print_edid.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.14 2000/07/13 21:31:38 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.14.4.1 2001/05/22 17:02:36 tsi Exp $ */
/* print_edid.c: print out all information retrieved from display device
*
@@ -232,7 +232,7 @@ print_detailed_monitor_section(int scrnIndex,
m[i].section.ranges.min_v, m[i].section.ranges.max_v,
m[i].section.ranges.min_h, m[i].section.ranges.max_h);
if (m[i].section.ranges.max_clock != 0)
- xf86ErrorF(" PixClock max %i kHz\n",m[i].section.ranges.max_clock);
+ xf86ErrorF(" PixClock max %i MHz\n",m[i].section.ranges.max_clock);
else
xf86DrvMsg(scrnIndex,X_INFO,"\n");
break;
diff --git a/xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c b/xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c
index 816a3cb56..fd4e98579 100644
--- a/xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c
+++ b/xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.19 2000/11/16 19:44:55 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.20.2.1 2001/05/25 21:45:00 paulo Exp $ */
/* xf86DDC.c
*
@@ -10,6 +10,8 @@
#include "xf86_OSproc.h"
#include "xf86DDC.h"
+static const OptionInfoRec *DDCAvailableOptions(void *unused);
+
const char *i2cSymbols[] = {
"xf86CreateI2CDevRec",
"xf86I2CDevInit",
@@ -38,6 +40,14 @@ static XF86ModuleVersionInfo ddcVersRec =
XF86ModuleData ddcModuleData = { &ddcVersRec, ddcSetup, NULL };
+ModuleInfoRec DDC = {
+ 1,
+ "DDC",
+ NULL,
+ 0,
+ DDCAvailableOptions,
+};
+
static pointer
ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin)
{
@@ -45,6 +55,10 @@ ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin)
if (!setupDone) {
setupDone = TRUE;
+#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
+ if (xf86LoaderCheckSymbol("xf86AddModuleInfo"))
+#endif
+ xf86AddModuleInfo(&DDC, module);
/*
* Tell the loader about symbols from other modules that this module
* might refer to.
@@ -112,14 +126,19 @@ typedef enum {
DDCOPT_NODDC
} DDCOpts;
-static OptionInfoRec DDCOptions[] = {
+static const OptionInfoRec DDCOptions[] = {
{ DDCOPT_NODDC1, "NoDDC1", OPTV_BOOLEAN, {0}, FALSE },
{ DDCOPT_NODDC2, "NoDDC2", OPTV_BOOLEAN, {0}, FALSE },
{ DDCOPT_NODDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE },
};
-#define nDDCOptions (sizeof(DDCOptions) / sizeof(DDCOptions[0]))
+/*ARGSUSED*/
+static const OptionInfoRec *
+DDCAvailableOptions(void *unused)
+{
+ return (DDCOptions);
+}
xf86MonPtr
xf86DoEDID_DDC1(
@@ -133,13 +152,15 @@ xf86DoEDID_DDC1(
int sigio;
/* Default DDC and DDC1 to enabled. */
Bool noddc = FALSE, noddc1 = FALSE;
- OptionInfoRec options[nDDCOptions];
+ OptionInfoPtr options;
+ options = xnfalloc(sizeof(DDCOptions));
(void)memcpy(options, DDCOptions, sizeof(DDCOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
xf86GetOptValBool(options, DDCOPT_NODDC, &noddc);
xf86GetOptValBool(options, DDCOPT_NODDC1, &noddc1);
+ xfree(options);
if (noddc || noddc1)
return NULL;
@@ -168,13 +189,15 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
xf86MonPtr tmp = NULL;
/* Default DDC and DDC2 to enabled. */
Bool noddc = FALSE, noddc2 = FALSE;
- OptionInfoRec options[nDDCOptions];
+ OptionInfoPtr options;
+ options = xnfalloc(sizeof(DDCOptions));
(void)memcpy(options, DDCOptions, sizeof(DDCOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
xf86GetOptValBool(options, DDCOPT_NODDC, &noddc);
xf86GetOptValBool(options, DDCOPT_NODDC2, &noddc2);
+ xfree(options);
if (noddc || noddc2)
return NULL;
diff --git a/xc/programs/Xserver/hw/xfree86/doc/DESIGN b/xc/programs/Xserver/hw/xfree86/doc/DESIGN
index 9bd7e9cee..72f4c8755 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/DESIGN
+++ b/xc/programs/Xserver/hw/xfree86/doc/DESIGN
@@ -2,7 +2,7 @@
The XFree86 Project, Inc
- Last modified 2 December 2000
+ Last modified 1 May 2001
NOTE: This is a DRAFT document, and the interfaces described here are subject
to change without notice.
@@ -2100,13 +2100,14 @@ Next, the higher level functions that most drivers would use.
ScreenInit() function, but only when
serverGeneration == 1.
- OptionInfoPtr xf86TokenToOptinfo(OptionInfoPtr table, int token)
+ OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int
+ token)
Returns a pointer to the OptionInfoRec in table with a
token field matching token. Returns NULL if no match is
found.
- Bool xf86IsOptionSet(OptionInfoPtr table, int token)
+ Bool xf86IsOptionSet(const OptionInfoRec *table, int token)
Returns the found field of the OptionInfoRec in table
with a token field matching token. This can be used for
@@ -2115,13 +2116,13 @@ Next, the higher level functions that most drivers would use.
mine the value of the option. Returns FALSE if no match
is found.
- char *xf86GetOptValString(OptionInfoPtr table, int token)
+ char *xf86GetOptValString(const OptionInfoRec *table, int token)
Returns the value.str field of the OptionInfoRec in table
with a token field matching token. Returns NULL if no
match is found.
- Bool xf86GetOptValInteger(OptionInfoPtr table, int token,
+ Bool xf86GetOptValInteger(const OptionInfoRec *table, int token,
int *value)
@@ -2132,21 +2133,21 @@ Next, the higher level functions that most drivers would use.
tion. The function return value is as for xf86IsOption-
Set().
- Bool xf86GetOptValULong(OptionInfoPtr table, int token,
+ Bool xf86GetOptValULong(const OptionInfoRec *table, int token,
unsigned long *value)
Like xf86GetOptValInteger(), except the value is treated
as an unsigned long.
- Bool xf86GetOptValReal(OptionInfoPtr table, int token,
+ Bool xf86GetOptValReal(const OptionInfoRec *table, int token,
double *value)
Like xf86GetOptValInteger(), except that value.realnum is
used.
- Bool xf86GetOptValFreq(OptionInfoPtr table, int token,
+ Bool xf86GetOptValFreq(const OptionInfoRec *table, int token,
OptFreqUnits expectedUnits, double *value)
@@ -2161,7 +2162,8 @@ Next, the higher level functions that most drivers would use.
"10000" and expectedUnits is OPTUNITS_MHZ, the value
returned is 10.
- Bool xf86GetOptValBool(OptionInfoPtr table, int token, Bool *value)
+ Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool
+ *value)
This function is used to check boolean options
(OPTV_BOOLEAN). If the function return value is FALSE,
@@ -2176,7 +2178,8 @@ Next, the higher level functions that most drivers would use.
present. It should normally be set to a default value
before calling this function.
- Bool xf86ReturnOptValBool(OptionInfoPtr table, int token, Bool def)
+ Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token,
+ Bool def)
This function is used to check boolean options
(OPTV_BOOLEAN). If the option is set, its value is
@@ -4905,7 +4908,15 @@ WRec. They are defined in vgaHW.h.
fields of hwp with the standard VGA set of functions.
This is called by vgaHWGetHWRec(), so there is usually no
need to call this explicitly. The register access func-
- tions are described below.
+ tions are described below. If the registers are shadowed
+ in some other port I/O space (for example a PCI I/O
+ region), these functions can be used to access the shad-
+ owed registers if hwp->PIOOffset is initialised with off-
+ set, calculated in such a way that when the standard VGA
+ I/O port value is added to it the correct offset into the
+ PIO area results. This value is initialised to zero in
+ vgaHWGetHWRec(). (Note: the PIOOffset functionality is
+ present in XFree86 4.1.0 and later.)
void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset)
@@ -4977,6 +4988,16 @@ WRec. They are defined in vgaHW.h.
vgahw module is not loaded (for example, in the Chip-
Probe() function).
+ void vgaHWEnable(vgaHWPtr hwp)
+
+ This function enables the VGA subsystem. (Note, this
+ function is present in XFree86 4.1.0 and later.).
+
+ void vgaHWDisable(vgaHWPtr hwp)
+
+ This function disables the VGA subsystem. (Note, this
+ function is present in XFree86 4.1.0 and later.).
+
void vgaHWSave(ScrnInfoPtr pScrn, vgaRegPtr save, int flags)
This function saves the VGA state. The state is written
@@ -5236,6 +5257,17 @@ VGA access. The access functions are described here.
Return the value read from the DAC Data register.
+ CARD8 readEnable(vgaHWptr hwp)
+
+ Return the value read from the VGA Enable register.
+ (Note: This function is present in XFree86 4.1.0 and
+ later.)
+
+ void writeEnable(vgaHWPtr hwp, CARD8 value)
+
+ Write value to the VGA Enable register. (Note: This
+ function is present in XFree86 4.1.0 and later.)
+
20. Some notes about writing a driver
NOTE: some parts of this are not up to date
@@ -5433,6 +5465,7 @@ Drivers must NOT include the following:
Bool noAccel;
Bool hwCursor;
CloseScreenProcPtr CloseScreen;
+ OptionInfoPtr Options;
...
} ZZZRec, *ZZZPtr;
@@ -5447,7 +5480,7 @@ Drivers must NOT include the following:
OPTION_NOACCEL
} ZZZOpts;
- static OptionInfoRec ZZZOptions[] = {
+ static const OptionInfoRec ZZZOptions[] = {
{ OPTION_FOO_HACK, "FooHack", OPTV_INTEGER, {0}, FALSE },
{ OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
@@ -5455,8 +5488,6 @@ Drivers must NOT include the following:
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
- #define nZZZOptions (sizeof(ZZZOptions) / sizeof(ZZZOptions[0]))
-
20.3 Functions
20.3.1 SetupProc
@@ -5704,8 +5735,6 @@ NOTES:
static Bool
ZZZPreInit(ScrnInfoPtr pScrn, int flags)
{
- OptionInfoRec options[nZZZOptions];
-
/* Fill in the monitor field */
pScrn->monitor = pScrn->confScreen->monitor;
@@ -5784,10 +5813,14 @@ NOTES:
/*
* Process the options based on the information in ZZZOptions.
- * The results are written to options.
+ * The results are written to pZzz->Options. If all of the options
+ * processing is done within this function a local variable "options"
+ * can be used instead of pZzz->Options.
*/
- (void)memcpy(options, ZZZOptions, sizeof(ZZZOptions));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
+ if (!(pZzz->Options = xalloc(sizeof(ZZZOptions))))
+ return FALSE;
+ (void)memcpy(pZzz->Options, ZZZOptions, sizeof(ZZZOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pZzz->Options);
/*
* Set various fields of ScrnInfoRec and/or ZZZRec based on
@@ -5795,25 +5828,25 @@ NOTES:
*/
from = X_DEFAULT;
pZzz->hwCursor = FALSE;
- if (xf86IsOptionSet(options, OPTION_HW_CURSOR)) {
+ if (xf86IsOptionSet(pZzz->Options, OPTION_HW_CURSOR)) {
from = X_CONFIG;
pZzz->hwCursor = TRUE;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pZzz->hwCursor ? "HW" : "SW");
- if (xf86IsOptionSet(options, OPTION_NOACCEL)) {
+ if (xf86IsOptionSet(pZzz->Options, OPTION_NOACCEL)) {
pZzz->noAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Acceleration disabled\n");
} else {
pZzz->noAccel = FALSE;
}
- if (xf86IsOptionSet(options, OPTION_PCI_RETRY)) {
+ if (xf86IsOptionSet(pZzz->Options, OPTION_PCI_RETRY)) {
pZzz->UsePCIRetry = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n");
}
pZzz->fooHack = 0;
- if (xf86GetOptValInteger(options, OPTION_FOO_HACK,
+ if (xf86GetOptValInteger(pZzz->Options, OPTION_FOO_HACK,
&pZzz->fooHack)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Foo Hack set to %d\n",
pZzz->fooHack);
@@ -6302,7 +6335,7 @@ eScreen() function.
ZZZFreeRec(xf86Screens[scrnIndex]);
}
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.40 2000/12/27 04:57:08 dawes Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.44 2001/05/19 00:40:30 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/DESIGN,v 1.35 2001/01/21 21:53:25 tsi Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/DESIGN,v 1.36.2.1 2001/06/01 18:26:42 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/Imakefile b/xc/programs/Xserver/hw/xfree86/doc/Imakefile
index a0ffbbf17..8c0b4350f 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/doc/Imakefile
@@ -4,7 +4,7 @@ XCOMM $XConsortium: Imakefile /main/33 1996/10/28 05:12:24 kaleb $
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/Imakefile,v 3.75 2001/03/02 02:45:37 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/Imakefile,v 3.76.2.1 2001/06/01 18:09:46 dawes Exp $
#include <Server.tmpl>
#include <lnxdoc.rules>
@@ -76,7 +76,7 @@ HWREADME = \
/*ReadmeFile(WstDig)*/ \
$(_NULLENTRY_)
-MAINDOCS = LICENSE README /*ReadmeFile(Config)*/ /*BUILD*/ RELNOTES \
+MAINDOCS = LICENSE README /*ReadmeFile(Config)*/ /*BUILD*/ /*RELNOTES*/ \
Install Status DESIGN Versions
OTHERDOCS = /*VideoModes.doc*/ /*QuickStart.doc*/ /*xinput*/ \
@@ -85,7 +85,7 @@ OTHERDOCS = /*VideoModes.doc*/ /*QuickStart.doc*/ /*xinput*/ \
#endif
MISCDOCS = ServersOnly /*LbxproxyOnly*/ $(REPORTFORM) ReadmeFile(DGA) \
- VideoBoard98
+ VideoBoard98 ReadmeFile(rapidaccess)
DATABASE = /* modeDB.txt */ /* AccelCards Monitors Devices */
diff --git a/xc/programs/Xserver/hw/xfree86/doc/Install b/xc/programs/Xserver/hw/xfree86/doc/Install
index 7846ad0f2..fc1a90ca9 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/Install
+++ b/xc/programs/Xserver/hw/xfree86/doc/Install
@@ -1,8 +1,8 @@
- Installation Details for XFree86[tm] 4.0.2
+ Installation Details for XFree86[tm] 4.1.0
The XFree86 Project, Inc
- 15 December 2000
+ 1 June 2001
Abstract
@@ -20,10 +20,10 @@ vide a customized version of the GNU tar utility called "extract" and an
installation script. We recommend that these be used to install the bina-
ries.
-2. Downloading the XFree86 4.0.2 binaries
+2. Downloading the XFree86 4.1.0 binaries
-We provide XFree86 4.0.2 binaries for a range of operating systems at our ftp
-site <URL:ftp://ftp.xfree86.org/pub/XFree86/4.0.2/binaries/>. Often during
+We provide XFree86 4.1.0 binaries for a range of operating systems at our ftp
+site <URL:ftp://ftp.xfree86.org/pub/XFree86/4.1.0/binaries/>. Often during
releases our ftp site is heavily loaded. Instead of downloading directly
from us we recommend that instead you use one of our mirror sites. Another
advantage of using our mirror sites is that some of them support http access
@@ -43,31 +43,46 @@ The output of this utility tells you which is the correct set of binaries for
you to download. If you are careful with this step you will save yourself a
lot time and trouble from NOT downloading an incompatible distribution.
-NOTE: the Xinstall.sh script must be downloaded in binary mode, otherwise it
-won't run correctly. If you get lots of "command not found" messages when
-you try to run it, then it is most likely because the script wasn't down-
-loaded in binary mode. Some web browsers won't do this for files of that
-name, so we also have a copy of it called "Xinstall.bin", and most browsers
-should download that correctly. When downloading it under this name, select
-"save as" on your browser, and save the file under the name "Xinstall.sh".
+NOTES:
+
+ o The Xinstall.sh script must be downloaded in binary mode, otherwise it
+ won't run correctly. If you get lots of "command not found" messages
+ when you try to run it, then it is most likely because the script wasn't
+ downloaded in binary mode. Some web browsers won't do this for files of
+ that name, so we also have a copy of it called "Xinstall.bin", and most
+ browsers should download that correctly. When downloading it under this
+ name, select "save as" on your browser, and save the file under the name
+ "Xinstall.sh".
+
+ o The Xinstall.sh script requires some system commands and utilities to
+ function correctly. While most systems will have these, some Linux
+ installations may not. If you find that the script is failing because
+ of some missing system command, you will need to install it before you
+ can continue. If you don't know how to do this, then we recommend that
+ you obtain this version of XFree86 from your Operating System distribu-
+ tor.
+
+ o Always use the version of the Xinstall.sh script that's provided with
+ the release you're installing. Older versions of the script may not
+ install newer releases correctly.
Once you're run the Xinstall.sh script and found which binary distribution is
suitable for your system, download the necessary files. The twelve (12)
mandatory files for all installations are listed below. If you have not
downloaded all of the files, the installer script will complain.
- 1. Xinstall.sh The installer script
- 2. extract The utility for extracting tarballs
- 3. Xbin.tgz X clients/utilities and run-time libraries
- 4. Xlib.tgz Some data files required at run-time
- 5. Xman.tgz Manual pages
- 6. Xdoc.tgz XFree86 documentation
- 7. Xfnts.tgz Base set of fonts
- 8. Xfenc.tgz Base set of font encoding data
- 9. Xetc.tgz Run-time configuration files
- 10. Xvar.tgz Run-time data
- 11. Xxserv.tgz XFree86 X server
- 12. Xmod.tgz XFree86 X server modules
+ 1. Xinstall.sh The installer script
+ 2. extract The utility for extracting tarballs
+ 3. Xbin.tgz X clients/utilities and run-time libraries
+ 4. Xlib.tgz Some data files required at run-time
+ 5. Xman.tgz Manual pages
+ 6. Xdoc.tgz XFree86 documentation
+ 7. Xfnts.tgz Base set of fonts
+ 8. Xfenc.tgz Base set of font encoding data
+ 9. Xetc.tgz Run-time configuration files
+ 10. Xvar.tgz Run-time data
+ 11. Xxserv.tgz XFree86 X server
+ 12. Xmod.tgz XFree86 X server modules
NOTES:
@@ -86,22 +101,20 @@ NOTES:
o Some distributions may have additional mandatory tarballs. While rare,
the installer script will tell you if any are missing.
-The following thirteen (13) tarballs are optional. You should download the
+The following eleven (11) tarballs are optional. You should download the
ones you want to install.
- 1. Xfsrv.tgz Font server
- 2. Xnest.tgz Nested X server
- 3. Xprog.tgz X header files, config files and compile-time libs
- 4. Xprt.tgz X Print server
- 5. Xvfb.tgz Virtual framebuffer X server
- 6. Xf100.tgz 100dpi fonts
- 7. Xfcyr.tgz Cyrillic fonts
- 8. Xflat2.tgz Latin-2 fonts
- 9. Xfnon.tgz Some large bitmap fonts
- 10. Xfscl.tgz Scalable fonts (Speedo and Type1)
- 11. Xhtml.tgz HTML version of the documentation
- 12. Xps.tgz PostScript version of the documentation
- 13. Xjdoc.tgz Documentation in Japanese
+ 1. Xfsrv.tgz Font server
+ 2. Xnest.tgz Nested X server
+ 3. Xprog.tgz X header files, config files and compile-time libs
+ 4. Xprt.tgz X Print server
+ 5. Xvfb.tgz Virtual framebuffer X server
+ 6. Xf100.tgz 100dpi fonts
+ 7. Xfcyr.tgz Cyrillic fonts
+ 8. Xfscl.tgz Scalable fonts (Speedo and Type1)
+ 9. Xhtml.tgz HTML version of the documentation
+ 10. Xps.tgz PostScript version of the documentation
+ 11. Xjdoc.tgz Documentation in Japanese
NOTES:
@@ -110,9 +123,9 @@ NOTES:
If you miss some and want to install them later, go to the Manual Installa-
tion (section 4., page 1) section.
-3. Installing XFree86 4.0.2 using the Xinstall.sh script
+3. Installing XFree86 4.1.0 using the Xinstall.sh script
-We strongly recommend that our XFree86 4.0.2 binaries be installed using the
+We strongly recommend that our XFree86 4.1.0 binaries be installed using the
Xinstall.sh script that we provide. There are a lot of steps in the manual
installation process, and those steps can vary according to the platform and
hardware setup. There is a description of the manual installation process
@@ -229,7 +242,7 @@ later that you need it, you can create it easily by running:
The next step is to configure the X server. That is covered in detail in an
as-yet unwritten document :-(. In the meantime, there are three ways to cre-
-ate a basic X server configuration file for XFree86 4.0.2. One is to run the
+ate a basic X server configuration file for XFree86 4.1.0. One is to run the
xf86config utility. Another is to run the xf86cfg utility. The third option
is to use the new -configure X server option:
@@ -248,9 +261,9 @@ old XF86_* and/or XF98_* X server binaries from /usr/X11R6/bin.
After the X server configuration is done, it may be advisable to reboot,
especially if you run xdm (or equivalent) or the font server (xfs).
-4. Installing XFree86 4.0.2 manually
+4. Installing XFree86 4.1.0 manually
-This section describes how to manually install the XFree86 4.0.2 binary dis-
+This section describes how to manually install the XFree86 4.1.0 binary dis-
tributions. You should only use this method if you know what you're doing.
The information here covers some common cases, but not every possible case.
@@ -288,6 +301,7 @@ tion procedure for this case is as follows:
ln -s /etc/X11/xinit /usr/X11R6/lib/X11
ln -s /etc/X11/xsm /usr/X11R6/lib/X11
ln -s /etc/X11/xserver /usr/X11R6/lib/X11
+ chmod ug-w /usr/X11R6/lib # Make sure the permissions are OK
/sbin/ldconfig /usr/X11R6/lib # For Linux
/sbin/ldconfig -m /usr/X11R6/lib # For FreeBSD, NetBSD, OpenBSD
/usr/X11R6/bin/mkfontdir /usr/X11R6/lib/X11/fonts/misc
@@ -347,11 +361,12 @@ Once that's done, the main part of the installation can be done:
./extract -C /usr/X11R6 `pwd`/X[a-df-uw-z]*.tgz
./extract -C /usr/X11R6 Xvfb.tgz # If you are installing Xvfb
./extract -C /var Xvar.tgz
+ chmod ug-w /usr/X11R6/lib # Make sure the permissions are OK
/sbin/ldconfig /usr/X11R6/lib # For Linux
/sbin/ldconfig -m /usr/X11R6/lib # For FreeBSD, NetBSD, OpenBSD
/usr/X11R6/bin/mkfontdir /usr/X11R6/lib/X11/fonts/misc
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.11 2001/03/02 17:40:48 dawes Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.11.2.2 2001/06/01 18:09:48 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/Install,v 1.11 2001/03/02 17:47:52 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/Install,v 1.11.2.1 2001/06/01 18:26:43 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/LICENSE b/xc/programs/Xserver/hw/xfree86/doc/LICENSE
index c6890edc3..993d4d700 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/LICENSE
+++ b/xc/programs/Xserver/hw/xfree86/doc/LICENSE
@@ -595,4 +595,4 @@ For further information, contact:
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LICENSE.sgml,v 1.8 2001/03/16 22:13:19 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/LICENSE,v 1.12 2001/03/25 05:42:43 tsi Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/LICENSE,v 1.12.2.1 2001/06/01 18:26:43 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/OS2.Notes b/xc/programs/Xserver/hw/xfree86/doc/OS2.Notes
index b39511bee..d28e99232 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/OS2.Notes
+++ b/xc/programs/Xserver/hw/xfree86/doc/OS2.Notes
@@ -226,4 +226,4 @@ Well, you see, this was quite easy :-)
$XConsortium: OS2note.sgml /main/1 1996/02/24 10:08:59 kaleb $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/OS2.Notes,v 3.17 2000/12/01 19:47:45 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/OS2.Notes,v 3.17.4.1 2001/06/01 18:26:43 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README b/xc/programs/Xserver/hw/xfree86/doc/README
index ffc669ceb..76ac496f1 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README
+++ b/xc/programs/Xserver/hw/xfree86/doc/README
@@ -1,8 +1,8 @@
- README for XFree86[tm] 4.0.2
+ README for XFree86[tm] 4.1.0
The XFree86 Project, Inc
- 15 December 2000
+ 2 June 2001
Abstract
@@ -10,9 +10,9 @@
supports several UNIX(R) and UNIX-like (such as Linux, the BSDs and
Solaris x86) operating systems on Intel and other platforms.
-1. What is XFree86 4.0.2?
+1. What is XFree86 4.1.0?
-XFree86 4.0.2 is the third full release in the new XFree86 4 series.
+XFree86 4.1.0 is the fourth full release in the XFree86 4 series.
XFree86 release 4 is a major re-design of the basic architectural underpin-
nings of XFree86's implementation of the original X Consortium's X Server.
@@ -25,7 +25,7 @@ installing the new driver module and updating the configuration file.
The road to XFree86 release 4 began as an architectural concept in mid 1997,
with the serious framework being implemented in code the beginning of 1998.
There were several snapshots on the road to 4.0 which are now part of the 4.0
-base release. The 4.0.2 version is an upgrade to 4.0.1, which include more
+base release. The 4.1.0 version is an upgrade to 4.0.3, which include more
hardware ports, code enhancements and bug fixes.
Release 4 also included the long-awaited integration of the DRI (Direct Ren-
@@ -38,8 +38,6 @@ converted over to the 4.x series, those required for most modern video hard-
ware are available. Please check the Driver Status document first to see
whether your hardware is supported before upgrading to the 4.x series.
-Specific release enhancements can be viewed in the Release Notes.
-
The XFree86 version numbering system has had some changes as of the 4.0.2
release. Information about this can be found in the Versions Document.
@@ -116,38 +114,47 @@ Once your work is finished (coded, debugged and documented) please send your
fix to <fixes@XFree86.org>. This will ensure that they are included in
future releases. And thanks! You make this truly an Open group.
-4. How to get XFree86 4.0.2
+4. How to get XFree86 4.1.0
-XFree86 4.0.2 can be found at the XFree86 ftp server
-<URL:ftp://ftp.xfree86.org/pub/XFree86/4.0.2/>, and at mirrors of this
+XFree86 4.1.0 can be found at the XFree86 ftp server
+<URL:ftp://ftp.xfree86.org/pub/XFree86/4.1.0/>, and at mirrors of this
server. Information about obtaining and installing binary distributions of
this release can be found in the Installation Document. Information about
obtaining the release in source form is given below.
-The source for version 4.0.2 is split into three tarballs: X402src-1.tgz,
-X402src-2.tgz, X402src-3.tgz. The first contains everything except the fonts
-and general X11 documentation. It is sufficient for building XFree86 is you
+The source for version 4.1.0 is split into three tarballs: X410src-1.tgz,
+X410src-2.tgz, X410src-3.tgz. The first contains everything except the fonts
+and general X11 documentation. It is sufficient for building XFree86 if you
already have a set of fonts. The second contains the fonts and the source
for the general X11 documentation. The third contains the general X11 docu-
mentation in hardcopy format.
-A source patch relative to version 4.0.1 is also available. Because of its
-size, it is split into four parts. The patch files are 4.0.1-4.0.2.diff1.gz,
-4.0.1-4.0.2.diff2.gz, 4.0.1-4.0.2.diff3.gz and 4.0.1-4.0.2.diff4.gz. There
+A source patch relative to version 4.0.2 is also available. Because of its
+size, it is split into four parts. The patch files are 4.0.2-4.1.0.diff1.gz,
+4.0.2-4.1.0.diff2.gz, 4.0.2-4.1.0.diff3.gz and 4.0.2-4.1.0.diff4.gz. There
is also a tarball that contains some files that have components that can't be
-included in a diff. It is 4.0.2.tgz. These patches should be applied to a
-clean 4.0.1 source tree, working from the directory containing the xc/ direc-
+included in a diff. It is 4.1.0.tgz. These patches should be applied to a
+clean 4.0.2 source tree, working from the directory containing the xc/ direc-
tory. The patches should be applied by running:
- gzip -d < 4.0.1-4.0.2.diff1.gz | patch -p0 -E
- gzip -d < 4.0.1-4.0.2.diff2.gz | patch -p0 -E
- gzip -d < 4.0.1-4.0.2.diff3.gz | patch -p0 -E
- gzip -d < 4.0.1-4.0.2.diff4.gz | patch -p0 -E
+ gzip -d < 4.0.2-4.1.0.diff1.gz | patch -p0 -E
+ gzip -d < 4.0.2-4.1.0.diff2.gz | patch -p0 -E
+ gzip -d < 4.0.2-4.1.0.diff3.gz | patch -p0 -E
+ gzip -d < 4.0.2-4.1.0.diff4.gz | patch -p0 -E
+
+ rm -f xc/programs/xieperf/images/image.012
+ rm -fr xc/fonts/bdf/latin2
+ rm -fr xc/fonts/bdf/100dpi
+ rm -fr xc/fonts/bdf/75dpi
+
+ gzip -d < 4.1.0.tgz | tar vxf -
- gzip -d < 4.0.2.tgz | tar vxf -
+Patches might also be available relative to 4.0.3. If so, the instructions
+for applying them are the same, except that you should start with a clean
+4.0.3 source tree.
-The contrib part of the distribution has been folded into the main source
-tree, so a separate contrib tarball is no longer required.
+The contrib part of the distribution was folded into the main source tree a
+while ago, so a separate contrib tarball is not required.
To format the XFree86 documentation use the latest version of our doctools
package available as doctools-1.2.tgz.
@@ -161,7 +168,7 @@ yourself, send the entire log file with your bug report but not the operating
system core dump. Do not edit the log file as our developers use it to
reproduce and debug your problem.
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.113 2001/03/16 22:13:19 dawes Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.113.2.3 2001/06/02 16:17:40 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README,v 3.111 2001/03/25 05:42:43 tsi Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README,v 3.111.2.3 2001/06/02 16:21:49 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.DECtga b/xc/programs/Xserver/hw/xfree86/doc/README.DECtga
index b48be24d2..d734dfcda 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.DECtga
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.DECtga
@@ -6,7 +6,7 @@
1. DEC 21030
- o The DEC 21030 is supported by XFree86 4.0.2. The driver is now par-
+ o The DEC 21030 is supported by XFree86 4.1.0. The driver is now par-
tially accelerated. The built-in graphics on the Multia is supported in
8-plane mode, and PCI cards with 8 or 16 MB framebuffers are supported
in 24-plane mode. TGA2 (aka PowerStorm 3D30/4D20) cards are not cur-
@@ -65,4 +65,4 @@
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DECtga.sgml,v 3.9 2000/03/06 22:59:23 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DECtga,v 3.17 2000/12/01 19:47:46 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DECtga,v 3.17.4.1 2001/06/01 18:26:43 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.DRI b/xc/programs/Xserver/hw/xfree86/doc/README.DRI
index 5509f502b..0d3f897f4 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.DRI
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.DRI
@@ -2,7 +2,7 @@
VA Linux Systems, Inc. Professional Services - Graphics.
- 15 March 2001
+ 3 May 2001
1. Preamble
@@ -114,21 +114,20 @@ graphics hardware:
o ATI Rage 128, supported on Intel x86 and AMD:
- o Rage Fury AGP
+ o Rage Fury
- o Rage Magnum AGP
+ o Rage Magnum
- o XPERT 2000 AGP
+ o XPERT 2000
- o XPERT 128 AGP
+ o XPERT 128
- o XPERT 99 AGP
+ o XPERT 99
- o All-in-Wonder 128 AGP
+ o All-in-Wonder 128
- The PCI versions of these cards also have minimal support. Note that
- there are Rage 128 Pro boards on the market but they're not yet sup-
- ported.
+ Note that both PCI and AGP versions of Rage 128 based cards are sup-
+ ported at this time.
o ATI Radeon, supported on Intel x86 and AMD:
@@ -563,7 +562,7 @@ bleshooting.
10.1 3dfx Banshee, Voodoo3, Voodoo4 and Voodoo5 Series
-10.1.1 Dependencies
+10.1.1 Requirements
The 3dfx DRI driver requires special versions of the 3dfx Glide library.
Different versions of Glide are needed for Banshee/Voodoo3 than for
@@ -659,7 +658,7 @@ A software-based accumulation buffer is available in both 16 and 32bpp modes.
acceleration is not supported in that mode. 32bpp mode is fully 3D
accelerated.
-10.1.4 Performance
+10.1.4 Performance and Features
o Normally, buffer swapping in double-buffered applications is synchro-
nized to your monitor's refresh rate. This may be overridden by setting
@@ -727,6 +726,9 @@ A software-based accumulation buffer is available in both 16 and 32bpp modes.
o The lowest mipmap level is sometimes miscolored in trilinear- sampled
polygons.
+ o The GL_EXT_texture_env_combine extension is supported on the Voodoo4 and
+ Voodoo5.
+
10.1.5 Known Problems
o The lowest mipmap level is sometimes miscolored in trilinear- sampled
@@ -745,11 +747,9 @@ A software-based accumulation buffer is available in both 16 and 32bpp modes.
10.2 Intel i810
-10.2.1 Dependencies
+10.2.1 Requirements
-A Linux kernel with AGP GART support is required. The 2.2.x kernel series
-does not have AGP GART support. The 2.4.x test kernels have AGP GART and
-have been tested with the i810.
+A kernel with AGP GART support (such as Linux 2.4.x) is needed.
10.2.2 Configuration
@@ -800,12 +800,31 @@ ules/dri/i810_dri.so. This will be automatically loaded by libGL.so.
too little memory is available for DMA buffers, back and depth buffers
and textures, direct rendering will be disabled.
+10.2.4 Performance and Features
+
+Basically all of the i810 features which can be exposed through OpenGL 1.2
+are implemented. However, the following OpenGL features are implemented in
+software and will be slow:
+
+ o Stencil buffer and accumulation buffer operations
+
+ o Blend subtract, min/max and logic op blend modes
+
+ o glColorMask when any mask is set to false
+
+ o GL_SEPARATE_SPECULAR_COLOR lighting mode
+
+ o glDrawBuffer(GL_FRONT_AND_BACK)
+
+ o Using 1D or 3D textures
+
+ o Using texture borders
+
10.3 Matrox G200 and G400
-10.3.1 Dependencies
+10.3.1 Requirements
-A Linux kernel with AGP GART support (such as the 2.4.x test kernels) is
-needed.
+A kernel with AGP GART support (such as Linux 2.4.x) is needed.
10.3.2 Configuration
@@ -855,7 +874,7 @@ by the Xserver if needed.
The DRI 3D driver for the G200/G400 should be in /usr/X11R6/lib/mod-
ules/dri/mga_dri.so. This will be automatically loaded by libGL.so.
-10.3.3 Performance
+10.3.3 Performance and Features
Software rendering will be used under any of the following conditions:
@@ -878,7 +897,7 @@ Software rendering will be used under any of the following conditions:
The AGP mode may be set to 1, 2, or 4. One is used by default. Higher AGP
speeds may result in unreliable performance depending on your motherboard.
-Compaq has funded the implementation of AGP acclerated ReadPixels and Draw-
+Compaq has funded the implementation of AGP accelerated ReadPixels and Draw-
Pixels in this driver. With this implementation, on a G400 drawing directly
from AGP memory (exported to the client), throughput of up to 1 GB/sec has
been measured.
@@ -938,10 +957,9 @@ None.
10.4 ATI Rage 128
-10.4.1 Dependencies
+10.4.1 Requirements
-A Linux kernel with AGP GART support (such as the 2.4.x test kernels) is
-needed.
+A kernel with AGP GART support (such as Linux 2.4.x) is needed.
10.4.2 Configuration
@@ -983,7 +1001,7 @@ ules/dri/r128_dri.so. This will be automatically loaded by libGL.so.
You may also set your screen depth to 32 for 32bpp mode.
-10.4.3 Performance
+10.4.3 Performance and Features
While PCI Rage 128 based cards are supported, they do not yet support PCI
GART, so they will not perform as well as their AGP counterparts.
@@ -992,6 +1010,22 @@ For AGP cards, the AGP mode may be set to 1, 2, or 4. One is used by
default. Higher AGP speeds may result in unreliable performance depending on
your motherboard.
+Note that even at 32bpp there is no alpha channel.
+
+The following OpenGL features are implemented in software and will be slow:
+
+ o Stencil buffer and accumulation buffer operations
+
+ o Blend subtract, min/max and logic op blend modes
+
+ o GL_SEPARATE_SPECULAR_COLOR lighting mode
+
+ o glDrawBuffer(GL_FRONT_AND_BACK)
+
+ o Using 1D or 3D textures
+
+ o Using texture borders
+
10.4.4 Known Problems
If you experience stability problems you may try setting the UseCCEFor2D
@@ -1000,10 +1034,9 @@ Performance will be degraded, of course.
10.5 ATI Radeon
-10.5.1 Dependencies
+10.5.1 Requirements
-A Linux kernel with AGP GART support (such as the 2.4.x test kernels) is
-needed.
+A kernel with AGP GART support (such as Linux 2.4.x) is needed.
10.5.2 Configuration
@@ -1044,7 +1077,7 @@ ules/dri/radeon_dri.so. This will be automatically loaded by libGL.so.
You may also set your screen depth to 32 for 32bpp mode.
-10.5.3 Performance
+10.5.3 Performance and Features
While this driver supports many of the features of ATI Radeon cards, we do
not yet fully support the card's TCL features. This work is progressing, but
@@ -1053,9 +1086,38 @@ is not yet ready.
The AGP mode may be set to 1, 2, or 4. One is used by default. Higher AGP
speeds may result in unreliable performance depending on your motherboard.
+The following OpenGL features are implemented in software and will be slow:
+
+ o Blend subtract, blend min/max and blend logicops
+
+ o Stencil and accumulation operations
+
+ o 1D and 3D textures
+
+ o Texture borders
+
+The GL_EXT_texture_env_combine, GL_EXT_texture_env_add and GL_EXT_tex-
+ture_env_dot3 extensions are supported (or will be soon supported in the new
+driver based on Mesa 3.5).
+
+We hope to implement support for the following features in the future:
+
+ o Vertex transformation, clipping and lighting (TCL)
+
+ o Hardware stencil buffer
+
+ o Cube map textures
+
+ o 3D textures
+
+ o Three texture units
+
10.5.4 Known Problems
-None.
+Certain (early?) revisions of the AMD Irongate chipset have AGPGART problems
+which effect Radeon, and other graphics cards. The card may work unreliably,
+or not work at all. If the DRM kernel module is not loaded, the 2D Xserver
+may work. There's hope that this can be fixed in the future.
10.6 3DLabs Oxygen GMX 2000
@@ -1069,8 +1131,8 @@ oped or supported.
The following OpenGL features are not supported at this time: overlays,
stereo, hardware-accelerated indirect rendering.
-OpenGL-like functionality is provided with the Mesa library. XFree86 4.0.2
-uses Mesa 3.4. Subsequent releases of XFree86 will use newer versions of
+OpenGL-like functionality is provided with the Mesa library. XFree86 4.1.0
+uses Mesa 3.4.2. Subsequent releases of XFree86 will use newer versions of
Mesa. When newer versions of Mesa are available, the 3D drivers can be
updated without reinstalling XFree86 or libGL.so.
@@ -1144,8 +1206,7 @@ has already been reported and perhaps fixed.
12.1 Software
A collection of useful configuration files, libraries, headers, utilities and
-demo programs is available from http://dri.source-
-forge.net/resources/resources.html
+demo programs is available from http://dri.sourceforge.net/res.phtml
12.2 Documentation
@@ -1170,7 +1231,7 @@ forge.net/resources/resources.html
o In the future there may be IHV and Linux vendor support resources for
the DRI.
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.21 2001/04/10 16:07:58 dawes Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.24 2001/05/19 00:42:22 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.15 2001/04/10 16:44:31 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.16.2.1 2001/06/01 18:26:43 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp b/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp
index c37706cf9..ae1f31e12 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp
@@ -2,7 +2,7 @@
VA Linux Systems, Inc. Professional Services - Graphics.
- 15 March 2001
+ 21 April 2001
1. Preamble
@@ -137,7 +137,8 @@ Here are the basic steps for kernel setup.
o Go to Character devices
o Disable Direct Rendering Manager (XFree86 DRI support) since we'll
- use the DRI module from the XFree86/DRI tree.
+ use the DRI code from the XFree86/DRI tree and will compile it
+ there.
o Go to /dev/agpgart (AGP Support) (EXPERIMENTAL) (NEW)
@@ -424,7 +425,7 @@ headers. This can be fixed by explicitly setting the value of TREE. If the
path to your kernel source is /usr/src/linux-2.4.x,
cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
- make TREE=/usr/src/linux-2.4
+ make TREE=/usr/src/linux-2.4.x/include
or alternatively, edit Makefile to include this change.
@@ -437,7 +438,7 @@ first.
The DRI kernel modules are in ~/DRI-CVS/build/xc/pro-
grams/Xserver/hw/xfree86/os-support/linux/drm/kernel/.
-To load the appropriate DRI module in your running kernel you can either use
+To load the appropriate DRM module in your running kernel you can either use
ismod and restart your X server or copy the kernel module to /lib/mod-
ules/2.4.x/kernel/drivers/char/drm/ then run depmod and restart your X
server.
@@ -445,6 +446,8 @@ server.
Make sure you first unload any older DRI kernel modules that might be already
loaded.
+Note that some DRM modules require that the agpgart module be loaded first.
+
9. Normal Installation and Configuration
Most users will want to install the new X server and use it instead of the
@@ -595,7 +598,7 @@ At this point your X server should be up and running with hardware-acceler-
ated direct rendering. Please read the DRI User Guide for information about
trouble shooting and how to use the DRI-enabled X server for 3D applications.
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.13 2001/04/05 19:29:42 dawes Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.14 2001/05/02 15:06:08 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.9 2001/04/10 16:44:31 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.10.2.1 2001/06/01 18:26:43 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.Darwin b/xc/programs/Xserver/hw/xfree86/doc/README.Darwin
index c3d118175..ad3950e04 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.Darwin
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.Darwin
@@ -2,7 +2,7 @@
Torrey T. Lyons
- 11 December 2000
+ 25 May 2001
1. Introduction
@@ -14,19 +14,31 @@ working on modifications to the Darwin X server, please let me know.
2. Hardware Support and Configuration
-The Darwin port of XFree86 uses the IOKit for device driver loading and dis-
-covery, rather than the XFree86 module loader. Because of this, the XFree86
-configuration file is not used on Darwin systems. The descriptions found
-elsewhere of devices supported by XFree86 for other operating systems also do
-not apply.
-
-XFree86 for Darwin will work with any video card that you have an IOKit
-driver for. If you are running Mac OS X, this typically means any card that
-has been shipped by Apple. If a card works for you with the Mac OS X GUI, it
-will work on the same machine with XFree86. If you have a pure Darwin instal-
-lation, your hardware support may be somewhat limited because Apple does not
-include all its hardware drivers with Darwin. IOKit drivers are typically
-found in /System/Library/Extensions/ or /Library/Extensions/.
+XFree86 can be run either from the console or side by side with Mac OS X's
+Aqua desktop in a full screen mode. In full screen mode with Aqua, when the X
+window system is active, it takes over the entire screen. You can switch back
+to the Mac OS X desktop by holding down Command-Option-A. This key combina-
+tion can be changed in the user preferences. From the Mac OS X desktop, just
+click on the XDarwin icon in the floating switch window to switch back to the
+X window system. You can change this behavior in the user preferences so
+that clicking on the XDarwin icon in the Dock switches as well. The full
+screen cooperative mode with Aqua is known as Quartz mode, named after the
+Quartz 2D compositing engine used by Aqua.
+
+From the console, the Darwin port of XFree86 uses the IOKit for device driver
+loading and discovery, rather than the XFree86 module loader. Because of
+this, the XFree86 configuration file is not used on Darwin or Mac OS X sys-
+tems. The descriptions found elsewhere of devices supported by XFree86 for
+other operating systems also do not apply. Running XFree86 from the text
+console is known as IOKit mode.
+
+XFree86 for Darwin or Mac OS X will work with any video card that you have an
+IOKit driver for. If you are running Mac OS X, this typically means any card
+that has been shipped by Apple. If a card works for you with the Mac OS X
+GUI, it will work on the same machine with XFree86. If you have a pure Darwin
+installation, you may need to download additional third-party drivers from
+Apple's Darwin site. IOKit drivers are typically installed in /Sys-
+tem/Library/Extensions/ or /Library/Extensions/.
Multi-button and scroll wheel mouse support works well with all USB mice that
I have tested. I have done no testing with serial mice.
@@ -35,30 +47,20 @@ I have tested. I have done no testing with serial mice.
Following are instructions for building and running your own copy of XFree86.
The procedure for getting your X server up and running on Darwin and Mac OS X
-are very similar, but it is actually somewhat more difficult on Mac OS X.
-Where there are differences I have noted them below. Both Mac OS X Develop-
-ers' Preview 4 and Mac OS X Public Beta are covered. Note that to build
-XFree86 for yourself on Mac OS X Beta, you will need to have the Developers'
-Tools. If you did not receive these as a member of ADC, they are available
-for download from the Apple Developer Connection.
-
-If you want to save some time, you can use the precompiled binaries provided
-by the XFree86 server at <URL:ftp://ftp.xfree86.org/pub/XFree86/4.0.2/bina-
-ries/Darwin/>. Follow the instructions in the Install document to install
-it.
-
-This will create two new directory trees, /usr/X11R6 and /private/etc/X11. If
-you have the developers' tools, you may have to run ranlib on all the
-libraries in /usr/X11R6/lib/* before trying to build other X applications.
-
-If you get the precompiled binaries you can skip ahead to the section on run-
-ning X windows (section 4., page 1)
+are very similar. Where there are differences I have noted them below. Note
+that to build XFree86 for yourself on Mac OS X, you will need to install the
+Developers' Tools.
-On the other hand, if you want to build things yourself from scratch, follow
-the directions below.
+If you don't feel the need to live on the cutting edge, you can save some
+time and effort by using the precompiled binaries available on the XFree86
+FTP server at <URL:ftp://ftp.xfree86.org/pub/XFree86/4.1.0/binaries/Darwin/>.
+Follow the instructions in the Install document to install it. This will cre-
+ate two new directory trees, /usr/X11R6 and /etc/X11 For Mac OS X Quartz sup-
+port, download the optional Xquartz.tgz tarball.
-If you want to recompile the X server on Mac OS X, you will have to make the
-header files as described below (section 3.2, page 1).
+If you get the precompiled binaries you can skip ahead to the section on run-
+ning the X window system (section 4., page 1) On the other hand, if you want
+to build things yourself from scratch, follow the directions below.
3.1 Get the Code
@@ -68,8 +70,8 @@ project.
o Setup CVS: Both Darwin and Mac OS X include CVS (Concurrent Versions
System), which is an easy way to download and keep up to date with open
source code released by XFree86 and others. You do have to setup CVS
- properly, however, to tell it where to look. Follow the instructions
- here on how to do this either via ssh or via the cvs pserver.
+ properly, however, to tell it where to look. Follow the XFree86 instruc-
+ tions on how to do this either via ssh or via the cvs pserver.
o Now make a directory in some convenient place which will serve as your
top level directory for you open source development efforts. I am going
@@ -83,22 +85,7 @@ project.
Wait for all the files to complete downloading.
-3.2 Make Header Files for Mac OS X
-
-These next steps are not necessary if you are building XFree86 on Darwin. Mac
-OS X Beta or DP4 does not include many of the 'in-progress' header files that
-are needed to successfully build XFree86. The general philosophy is that at
-any given time, Mac OS X will include only headers files that are 'ready for
-prime time' while Darwin will include a snapshot of Apple's current efforts.
-So if you have access to a Darwin system, I would suggest using this instead
-of Mac OS X to build XFree86. If you don't, read the appropriate page below
-for an outline of what you need to do:
-
- o Mac OS X Public Beta (section 6.1, page 1)
-
- o Mac OS X Developers' Preview 4 (section 6.2, page 1)
-
-3.3 Build XFree86
+3.2 Build XFree86
Once you have everything ready it is easy to build and install XFree86. From
the command line:
@@ -108,61 +95,69 @@ the command line:
(wait for several hours)
- su root
- make install >& install.log
- make install.man >& man.log
+ sudo make install >& install.log
+ sudo make install.man >& man.log
-4. Run X Windows
+4. Run the X Window System
-You will want to add the X windows executables to your path. Your path is the
+You will want to add the X window executables to your path. Your path is the
list of directories to be searched when you type a command. You will also
want to add the man pages from XFree86 to the list of pages to be searched
when you are looking for documentation. The way to do this depends on the
shell you are using. With tcsh or csh add the following two lines to a file
-in your home directory called .cshrc (create this file if you don't have one
-yet):
+named ~/Library/init/tcsh/path: (You may need to create this file and direc-
+tory path if it does not exist already.)
- setenv MANPATH "${MANPATH}:/usr/X11R6/man:/usr/local/man"
setenv PATH "${PATH}:/usr/X11R6/bin"
-
-Now type ``source ~/.cshrc;rehash'' to get these changes to take effect. On
-future logins, this file will be executed automatically.
-
-You are now ready to go. On Mac OS X, you have to do a few extra steps each
-time you want to run X windows. You can't run XFree86 with CoreGraphics run-
-ning since they both want to control the screen. So for Mac OS X you first
-need to logout. Then for Mac OS X DP4, from the login window type ``console''
-as the user name and push login. For Mac OS X Beta, type ``>console'' as the
-user name. This should shutdown CoreGraphics and bring you up with a text
-console. Login again.
-
-Now from the text console you can start X Windows in either Darwin or Mac OS
-X by typing ``startx''. After a brief wait at least one terminal window
-should pop up for you. So far it probably isn't very impressive as you might
-not even have a window manager running to allow you to move windows around.
-
-When you are ready to quit X windows type ``exit'' in the main terminal win-
-dow or quit with the window manager if you have one running. Unfortunately
-the X server won't shutdown correctly and you will get an apparently frozen
-screen with only a spinning beachball cursor on it. Nothing you type shows up
-on the screen, but in fact your keystrokes are being received by the console.
-Type ``logout'' to return to normalcy after a brief delay. With Darwin this
-should put you back at the text console login prompt. With Mac OS X, Core-
-Graphics will restart and you should be given a login window.
+ setenv MANPATH "${MANPATH}:/usr/X11R6/man"
+
+The next time you login or open a Terminal window, this file will be executed
+automatically.
+
+You are now ready to go. On Mac OS X, you can run XFree86 from the text con-
+sole or in full screen mode with Aqua. To get to the text console in Mac OS X
+you need to logout and type ``>console'' as the user name. This will shutdown
+Core Graphics and bring up the console login prompt. Login again as your
+user.
+
+From the text console you can start the X Window System by typing ``startx''.
+After a brief wait at least one terminal window should pop up for you. So
+far it probably isn't very impressive as you might not even have a window
+manager running to allow you to move windows around.
+
+When you are ready to quit XFree86 type ``exit'' in the main terminal window
+or quit with the window manager if you have one running. Unfortunately the X
+server won't shutdown correctly and you will get an apparently frozen screen
+with only a spinning beachball cursor on it. Nothing you type shows up on the
+screen, but in fact your keystrokes are being received by the console. Type
+``logout'' to return to normalcy after a brief delay. With Darwin this should
+put you back at the text console login prompt. With Mac OS X, Core Graphics
+will restart and you should be given a login window.
+
+To start XFree86 in Quartz mode you can launch the XDarwin application in the
+/Applications folder, or from the command line type ``startx -- -quartz''.
+When the X window system is active, it takes over the entire screen. You can
+switch back to the Mac OS X desktop by holding down Command-Option-A. This
+key combination can be changed in the user preferences. From the Mac OS X
+desktop, just click on the XDarwin icon in the floating switch window to
+switch back to the X window system. You can change this behavior in the user
+preferences so that clicking on the XDarwin icon in the Dock switches as
+well.
Customize X Windows
-X windows is very customizable and you will certainly want to change some
-things. There is a lot you can do to control how your windows look, how the
-windows are moved, resized, etc. You will likely want to get a better window
-manager than twm, which is included with XFree86. The .xinitrc file in your
-home directory controls what programs are run when you start X windows. You
-can find a sample .xinitrc file in /private/etc/X11/xinit/xinitrc.
+The X window system is very customizable and you will certainly want to
+change some things. There is a lot you can do to control how your windows
+look, how the windows are moved, resized, etc. You will likely want to get a
+better window manager than twm, which is included with XFree86. The .xinitrc
+file in your home directory controls what programs are run when you start the
+X window system. You can find a sample .xinitrc file in /etc/X11/xinit/xini-
+trc.
-There are several window managers that have been ported to Darwin. The best
-collection of window managers and other X windows applications is at Dar-
-winfo's ports page. Another good place to look for Darwin ports in general is
-at Stepwise's Softrak site.
+There are several window managers that have been ported to Darwin. The best
+collection of window managers and other X window clients is at Darwinfo's
+ports page. Another good place to look for Darwin ports in general is at
+Stepwise's Softrak site.
Good luck!
@@ -173,176 +168,20 @@ know if you are interested in working on any of these issues.
Things that are broken:
- o The bell is broken.
+ o The bell does not work in IOKit mode.
- o Server shutdown problem: After quitting the X server the colored beach-
- ball cursor reappears, but the screen never returns to the console dis-
- play. The console is accepting input however, so typing ``logout'' will
- return you to the login prompt.
+ o Server shutdown problem: After quitting the X server in IOKit mode, the
+ colored beachball cursor reappears, but the screen never returns to the
+ console display. The console is accepting input however, so typing
+ ``logout'' will return you to the login prompt.
o Only one display is currently supported.
- o Screen saver not supported.
-
- o Key repeat rate can not be adjusted.
-
-Things I am working on:
-
- o Allowing rootless use on Mac OS X
-
- o Correct wake from sleep behavior
-
-6. Appendix
-
-6.1 Installing IOKit Header files on Mac OS X Beta
-
-Here is what you need to do to be able to build XFree86 (or other clients of
-IOGraphics services) on Mac OS X Public Beta.
-
- 1. You need to install some more build tools that aren't included in Mac
- OS X Beta, but are included in Darwin. These are needed for the next
- step. Go to your development directory and type:
-
- cvs checkout bootstrap_cmds
- cd bootstrap_cmds
- make
-
- Now su to root and do a ``make install'' from the bootstrap_cmds direc-
- tory.
-
- 2. The IOKit framework included with Mac OS X Beta is a little on the
- wimpy side, even after installing the Developer Tools. You'll need to
- rebuild it, but to do so safely we'll take advantage of the cool direc-
- tory structure of Mac OS X and put the new version in /Library/Frame-
- works/. This will override the version in /System/Library/Frameworks/.
- Or at least, that's where you should put it using the new Mac OS X Beta
- file structure, but in fact the compiler doesn't know this and still
- looks in /Local/Library/Frameworks. (I have already filed a developer's
- bug report on this.) To start we make a copy of the original. Login as
- root and do the following:
-
- cd /Library
- mkdir -p Frameworks
- cp -R /System/Library/Frameworks/IOKit.framework Frameworks/IOKit.framework
- cd /
- mkdir -p Local
- ln -s /Library /Local/Library
-
- 3. Now you need to get a full version of the IOKit framework from the Dar-
- win repository. This comes as part of the kernel. So, in your develop-
- ment directory again:
-
- cvs checkout xnu
- cd xnu
- source SETUP/setup.csh
- make exporthdrs
- make install
-
- The "make install" will start by assembling all the headers you need,
- but then will proceed to build a new kernel. You can Control-C out of
- the build once it starts compiling things if you want. Otherwise, just
- be patient.
-
- 4. You also need to get the IOKitUser project, which contains the user
- interface to the IOKit, and merge it into the IOKit framework. From
- your development directory type:
-
- cvs checkout IOKitUser
-
- Then you need to change the Makefile so it builds on top of the new
- IOKit framework you are building. Change to the IOKitUser project
- directory and edit the Makefile. Change the following line:
-
- NEXTSTEP_BUILD_OUTPUT_DIR = /$(USER)/build/$(NAME)
-
- to:
-
- NEXTSTEP_BUILD_OUTPUT_DIR = <your xnudir>/BUILD/dst/System/Library/Frameworks
-
- Now, run ``make'' while in the IOKitUser directory. It will likely not
- finish building since the IOKitUser project relies on some stuff that
- Apple hasn't really made public yet, but it should finish populating
- the new IOKit framework with headers and start compiling. (Strangely
- enough, the headers installed in your new IOKit framework don't contain
- the real header files. They are just single line files with an #import
- of the file in your IOKitUser project. This works fine as long as you
- don't ever delete or move your IOKitUser project. I imagine that using
- ``make install'' would fix this up, but you can't do this as long as
- the project doesn't build correctly. So for now you can either move the
- header files by hand, or make sure you leave your IOKitUser project in
- place.)
-
- 5. Now put the new IOKit headers into our local copy. Change to the xnu
- project directory and do the following as root:
-
- cd BUILD/dst/System/Library/Frameworks/
- cp -R IOKit.framework/Versions/A/Headers/* \
- /Library/Frameworks/IOKit.framework/Versions/A/Headers
-
- 6. The System framework needs touching up a bit too. You need to copy the
- libkern header files from the new System.framework. As root, go to the
- xnu project directory and type: (Of course you could make a local copy
- of the System framework in /Library/Frameworks/, but the additions to
- the System framework are small.)
-
- cd BUILD/dst/System/Library/Frameworks/System.framework/Versions/B/Headers
- cp -R libkern /System/Library/Frameworks/System.framework/Headers/libkern
-
-6.2 Installing IOKit Header files on Mac OS X DP4
-
-Here is an outline of what you need to do to be able to build XFree86 (or
-other clients of IOGraphics services) on Mac OS X Developers' Preview 4.
-
- 1. Checkout, build, and install bootstrap_cmds from the CVS repository.
-
- 2. Checkout xnu from the CVS repository. Go to sandbox/xnu and do the fol-
- lowing:
-
- source SETUP/setup.csh
- make exporthdrs
-
- 3. su to root and do the following:
-
- mkdir -p /Local/Library/Frameworks
- cp -R /System/Library/Frameworks/IOKit.framework /Local/Library/Frameworks
-
- This will create a new local version of the IOKit framework that will
- override the System version without changing the original.
-
- 4. You now want to merge the IOKit headers from the xnu project into your
- local IOKit framework. I did this fairly tediously by hand, but I would
- suggest something like:
-
- cp -R sandbox/xnu/BUILD/dst/System/Library/Frameworks/IOKit.framework/Versions/A/Headers \
- /Local/Library/Frameworks/IOKit.framework/Versions/A
-
- The only problem with this is that there are a few stub header files
- included that are just a single line with an #import to the appropriate
- place in the xnu source on your disk. This is fine as long as you don't
- move your xnu project. If you do, you can copy the original file to
- replace the stub. There is probably an easier way to automatically
- build a clean version of the IOKit framework, but I didn't find it.
- (Let me know if you do.)
-
- 5. There are just a few more files you need in the IOKit framework. Check-
- out the IO project from CVS. Get the necessary header files from there
- and put them in your new local IOKit framework. You'll get errors when
- you try to build XFree86 from which you can tell which files are
- needed. I also needed to make the following patch to IOLLEvent.h. Your
- mileage may vary.
-
- 47c47
- < #include <Kernel/libkern/OSTypes.h>
- ---
- > #include <libkern/OSTypes.h>
+ o The display mode can not be changed once the X server has started.
- 6. You'll also need a few extra CoreFoundation header files. Checkout
- CoreFoundation. You can make a new local version of the CoreFoundation
- framework as above, or just add to the existing one. The files you need
- are CFMachPort.h and CFMessagePort.h in the RunLoop.subproj and CFStor-
- age.h in Collections.subproj.
+ o A screen saver is not supported.
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml,v 1.4 2000/12/12 18:54:29 dawes Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml,v 1.4.4.2 2001/06/02 04:44:37 torrey Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.Darwin,v 1.3 2000/12/12 19:04:02 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.Darwin,v 1.3.4.4 2001/06/02 16:02:08 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.I128 b/xc/programs/Xserver/hw/xfree86/doc/README.I128
index b49c54b22..74d525713 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.I128
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.I128
@@ -100,4 +100,4 @@ and special help from:
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/I128.sgml,v 1.6 2000/12/13 01:55:47 robin Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.I128,v 1.10 2000/12/14 17:12:00 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.I128,v 1.10.4.1 2001/06/01 18:26:44 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.LynxOS b/xc/programs/Xserver/hw/xfree86/doc/README.LynxOS
index 05e190d43..f352a081a 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.LynxOS
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.LynxOS
@@ -1,4 +1,4 @@
- README for XFree86 4.0.2 on LynxOS
+ README for XFree86 4.1.0 on LynxOS
Thomas Mueller
@@ -13,19 +13,19 @@ ments as well as many bug fixes.
See the Copyright Notice.
-The sources for XFree86 4.0.2 are available by anonymous ftp from:
+The sources for XFree86 4.1.0 are available by anonymous ftp from:
-ftp://ftp.XFree86.org/pub/XFree86/4.0.2
+ftp://ftp.XFree86.org/pub/XFree86/4.1.0
Binaries of XFree86 for LynxOS x86 are available from:
-ftp://ftp.XFree86.org/pub/XFree86/4.0.2/binaries/LynxOS
+ftp://ftp.XFree86.org/pub/XFree86/4.1.0/binaries/LynxOS
A list of mirror sites is provided by ftp://ftp.XFree86.org/pub/XFree86/MIR-
RORS
The binaries on the FTP site were built on the latest released LynxOS version
-at the time XFree86 4.0.2 was released. In this case it is `LynxOS x86
+at the time XFree86 4.1.0 was released. In this case it is `LynxOS x86
3.0.1'. Because of changes made to the object format they don't run on LynxOS
versions earlier than 3.0.0.
@@ -37,7 +37,7 @@ this OS release was not available long enough for serious testing `LynxOS
3.1.0' support has to be considered to be in `alpha state'. Initial tests
were performed on LynxOS x86 only!
-XFree86 4.0.2 supports LynxOS on the x86 and on the PowerPC platform. X
+XFree86 4.1.0 supports LynxOS on the x86 and on the PowerPC platform. X
servers are currently available only on the x86 platform. The X server may
work with some PowerPC platforms supported by LynxOS though this has not
(yet) been thoroughly tested.
@@ -163,7 +163,7 @@ to
3.5 X Server debug diagnostics output and other VT peculiarities
Output made by the XFree86 X on its stdout or stderr will be lost after the
-server switches to graphics mode. The XFree86 4.0.2 server stores its output
+server switches to graphics mode. The XFree86 4.1.0 server stores its output
in /usr/adm/XFree86.n.log (where n is the screen number).
When the X server is running output made to other consoles will be lost.
@@ -266,4 +266,4 @@ duplicate entries:
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LynxOS.sgml,v 3.20 2000/06/17 00:27:32 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.LynxOS,v 3.28 2000/12/01 19:47:46 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.LynxOS,v 3.28.4.1 2001/06/01 18:26:44 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD b/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD
index da9b9dafc..4a8d5709f 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD
@@ -1,4 +1,4 @@
- README for XFree86 4.0.2 on NetBSD
+ README for XFree86 4.1.0 on NetBSD
Rich Murphey, David Dawes, Marc Wandschneider, Mark Weaver, Matthieu Herrb
@@ -14,10 +14,10 @@ See the Copyright Notice.
The sources for XFree86 are available by anonymous ftp from:
-ftp://ftp.XFree86.org/pub/XFree86/4.0.2
+ftp://ftp.XFree86.org/pub/XFree86/4.1.0
Binaries for NetBSD 1.4 and later are available from:
-ftp://ftp.XFree86.org/pub/XFree86/4.0.2/binaries/NetBSD
+ftp://ftp.XFree86.org/pub/XFree86/4.1.0/binaries/NetBSD
A list of mirror sites is provided by http://www.xfree86.org/MIRRORS.shtml
@@ -33,8 +33,6 @@ if you have comments or suggestions about this file and we'll revise it.
3. New OS dependent features
-See the Release Notes for non-OS dependent new features in XFree86 4.0.2.
-
3.1 New OS dependent features in 4.0.2
o A fix for libXmu OS detection which was broken since unix isn't defined
@@ -101,7 +99,7 @@ the xvidtune utility.
5.1 About mouse configuration
-XFree86 4.0.2 has support for the mouse driver included in the wscons console
+XFree86 4.1.0 has support for the mouse driver included in the wscons console
driver introduced by NetBSD 1.4. Specify ``wsmouse'' as the protocol and
``/dev/wsmouse0'' as the device in /etc/X11/XF86Config if you're using NetBSD
1.4 or later with a PS/2 mouse.
@@ -219,14 +217,14 @@ By default NetBSD include the BSD 4.4 kernel security feature that disable
access to the /dev/mem device when in multi-users mode. But XFree86 servers
can take advantage (or require) linear access to the display memory.
-Most XFree86 4.0.2 card drivers require linear memory access. There are two
+Most XFree86 4.1.0 card drivers require linear memory access. There are two
ways to allow XFree86 to access linear memory:
The first way is to disable the kernel security feature by adding ``option
INSECURE'' in the kernel configuration file and build a new kernel.
The second way is to install the aperture driver, included in source form in
-xc/programs/Xserver/hw/xfree86/etc/apNetBSD.shar in the XFree86 4.0.2 source
+xc/programs/Xserver/hw/xfree86/etc/apNetBSD.shar in the XFree86 4.1.0 source
distribution. Unpack it in a new directory of your choice by running:
sh apNetBSD.shar
@@ -370,7 +368,7 @@ Many thanks to all people who contributed to make XFree86 work on *BSD, in
particular, David Dawes, Pace Willison, Amancio Hasty, Christoph Robitschko,
Nate Williams, Rod Grimes, Jack Velte and Michael Smith.
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.60 2001/03/04 09:47:34 herrb Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.60.2.1 2001/06/01 18:09:48 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.NetBSD,v 3.76 2001/03/04 09:48:47 herrb Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.NetBSD,v 3.76.2.1 2001/06/01 18:26:44 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD b/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD
index bc01998fe..843b8bde1 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD
@@ -1,4 +1,4 @@
- README for XFree86 4.0.2 on OpenBSD
+ README for XFree86 4.1.0 on OpenBSD
Matthieu Herrb
@@ -12,13 +12,13 @@ ing systems on Intel and other platforms.
See the Copyright Notice.
-The sources for XFree86 4.0.2 are available by anonymous ftp from:
+The sources for XFree86 4.1.0 are available by anonymous ftp from:
-ftp://ftp.XFree86.org/pub/XFree86/4.0.2
+ftp://ftp.XFree86.org/pub/XFree86/4.1.0
Binaries for OpenBSD/i386 2.8 and later are available from:
-ftp://ftp.XFree86.org/pub/XFree86/4.0.2/binaries/OpenBSD
+ftp://ftp.XFree86.org/pub/XFree86/4.1.0/binaries/OpenBSD
A list of mirror sites is provided by http://www.xfree86.org/MIRRORS.shtml
@@ -32,7 +32,7 @@ if you have comments or suggestions about this file and we'll revise it.
3. New OS dependent features
-See the Release Notes for non-OS dependent new features in XFree86 4.0.2.
+See the Release Notes for non-OS dependent new features in XFree86 4.1.0.
3.1 New OS dependent features in 4.0.3
@@ -122,7 +122,7 @@ the xvidtune utility.
5.1 About mouse configuration
-XFree86 4.0.2 has support for the mouse driver included in the new wscons
+XFree86 4.1.0 has support for the mouse driver included in the new wscons
console driver introduced by OpenBSD-current after 2.8. Specify ``wsmouse''
as the protocol and ``/dev/wsmouse0'' as the device in /etc/X11/XF86Config
if you're using OpenBSD-current with a PS/2 mouse.
@@ -335,4 +335,4 @@ Nate Williams, Rod Grimes, Jack Velte and Michael Smith.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml,v 1.17 2001/04/05 19:29:43 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD,v 1.22 2001/04/10 16:44:31 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD,v 1.22.2.1 2001/06/01 18:26:44 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.SiS b/xc/programs/Xserver/hw/xfree86/doc/README.SiS
index 339ee77c9..cf5af1b14 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.SiS
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.SiS
@@ -113,4 +113,4 @@ Document based on 3.3 version written by Xavier Ducoin.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/SiS.sgml,v 3.7 2000/03/06 22:59:24 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.SiS,v 3.16 2000/12/01 19:47:48 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.SiS,v 3.16.4.1 2001/06/01 18:26:44 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.apm b/xc/programs/Xserver/hw/xfree86/doc/README.apm
index 7c821ad7d..37ad919ea 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.apm
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.apm
@@ -111,4 +111,4 @@ be possible to add support for the 3210 chipset if someone needs it.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/apm.sgml,v 1.3 2000/03/08 05:38:43 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.apm,v 1.8 2000/12/01 19:47:48 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.apm,v 1.8.4.1 2001/06/01 18:26:44 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.ati b/xc/programs/Xserver/hw/xfree86/doc/README.ati
index af39d20db..16d0d5add 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.ati
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.ati
@@ -694,4 +694,4 @@ Intel architectures.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.37 2001/04/16 15:02:08 tsi Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.ati,v 3.56 2001/04/16 15:06:49 tsi Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.ati,v 3.56.2.1 2001/06/01 18:26:44 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.chips b/xc/programs/Xserver/hw/xfree86/doc/README.chips
index 23d8180c4..b5043af1a 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.chips
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.chips
@@ -3,11 +3,11 @@
David Bateman (<dbateman@club-internet.fr>),
Egbert Eich (<eich@xfree86.org>)
- 14th June 2000
+ 1st January 2001
1. Introduction
-With the release of XFree86 version 4.0.2, the Chips and Technologies driver
+With the release of XFree86 version 4.1.0, the Chips and Technologies driver
has been extensively rewritten and contains many new features. This driver
must be considered work in progress, and those users wanting stability are
encouraged to use the older XFree86 3.3.x versions. However this version of
@@ -260,14 +260,6 @@ Screen, Monitor, Device.
grammable clock makes this option obsolete and so it's use isn't
recommended. It is completely ignored for HiQV chipsets.
- Option "UseVclk1"
- The HiQV series of chips have three programmable clocks. The
- first two are usually loaded with 25.175 and 28.322MHz for VGA
- backward compatibility, and the third is used as a fully pro-
- grammable clock. On at least one system (the Inside 686 LCD/S
- single board computer) the third clock is unusable. This option
- forces the use of VClk1 as the programmable clock.
-
TextClockFreq 25.175
Except for the HiQV chipsets, it is impossible for the server to
read the value of the currently used frequency for the text con-
@@ -291,18 +283,29 @@ Screen, Monitor, Device.
or 32bpp LCD panel clocks, where the options above set the clocks
to 65MHz.
+ Option "CRTClkIndx" "2"
+ Option "FPClkIndx" "1"" The HiQV series of chips have three pro-
+ grammable clocks. The first two are usually loaded with 25.175
+ and 28.322MHz for VGA backward compatibility, and the third is
+ used as a fully programmable clock. On at least one system (the
+ Inside 686 LCD/S single board computer) the third clock is unus-
+ able. These options can be used to force a particular clock index
+ to be used
+
Option "MMIO"
This has a different effect depending on the hardware on which it
is used. For the 6554x machines MMIO is only used to talk to the
BitBLT engine and is only usable with PCI buses. It is enabled
by default for 65545 machines since the blitter can not be
used otherwise. The HiQV series of chipsets must use MMIO with
- their BitBLT engines, and so this is enabled by default. However
- the 690xx chipsets can use MMIO for all communications with the
+ their BitBLT engines, and so this is enabled by default.
+
+ Option "FullMMIO"
+ The 690xx chipsets can use MMIO for all communications with the
video processor. So using this option on a 690xx chipset forces
them to use MMIO for all communications. This only makes sense
when the 690xx is on a PCI bus so that normal PIO can be dis-
- abled. (WARNING!! 690xx MMIO is untested)
+ abled.
Option "SuspendHack"
This option sets the centering and stretching to the BIOS default
@@ -409,6 +412,20 @@ Screen, Monitor, Device.
255 for 8bit depth, 0 to 32,767 for 15bit depth, etc. This option
might be used if the default video overlay key causes problems.
+ Option "DualRefresh"
+ The 69030 chipset has independent display channels, that can be
+ configured to support independent refresh rates on the flat panel
+ and on the CRT. The default behaviour is to have both the flat
+ panel and the CRT use the same display channel and thus the same
+ refresh rate. This option forces the two display channels to be
+ used, giving independent refresh rates.
+
+ Option "Crt2Memory" "2048"
+ The ct69030 supports dual-head display. By default the two dis-
+ play share equally the available memory. This option forces the
+ second display to take a particular amount of memory. Please read
+ the section below about dual-head display.
+
Option "XaaNoScreenToScreenCopy",
Option "XaaNoSolidFillRect", Option "XaaNoSolidHorVertLine",
Option "XaaNoMono8x8PatternFillRect", Option "XaaNoColor8x8Pat-
@@ -499,6 +516,13 @@ you'll needed to considered several points
after a suspend/resume or LCD/CRT switch. For a complete discus-
sion on the dot clock limitations, see the next section.
+ * Dual-head display
+ Dual-head display has two effects on the modelines. Firstly, the
+ memory requirements of both heads must fit in the available mem-
+ ory. Secondly, the memory bandwidth of the video processor is
+ shared between the two heads. Hence the maximum dot-clock might
+ need to be limited.
+
The driver is capable of driving both a CRT and a flat panel display. In fact
the timing for the flat panel are dependent on the specification of the panel
itself and are independent of the particular mode chosen. For this reason it
@@ -530,7 +554,97 @@ The NEC Versa 4080 just needs the "FixPanelSize" option. To the best of my
knowledge no machine with a HiQV needs the "UseModeline" or "FixPanelSize"
options.
-5. The Full Story on Clock Limitations
+5. Dual Display Channel
+
+XFree86 releases later than 4.1.0 support dual-channel display on the
+ct69030. This support can be used to give a single display image on two
+screen with different refresh rates, or entirely different images on the two
+displays.
+
+Dual refresh rate display can be selected with the "DualRefresh" option
+described above. However to use the dual-head support is slightly more com-
+plex. Firstly, the ct69030 chipset must be installed on a PCI bus. This is a
+driver limitation that might be relaxed in the future. In addition the
+device, screen and layout sections of the "XF86Config" must be correctly con-
+figured. A sample of an incomplete "XF86Config" is given below
+
+ Section "Device"
+ Identifier "Chips and Technologies - Pipe A"
+ Driver "chips"
+ BusID "PCI:0:20:0"
+ Screen 0
+ EndSection
+
+ Section "Device"
+ Identifier "Chips and Technologies - Pipe B"
+ Driver "chips"
+ BusID "PCI:0:20:0"
+ Screen 1
+ EndSection
+
+ Section "Screen"
+ Identifier "Screen 0"
+ Device "Chips and Technologies - Pipe A"
+ Monitor "generic LCD"
+
+ SubSection "Display"
+ Depth 16
+ Modes "1024x768"
+ EndSubsection
+ EndSection
+
+ Section "Screen"
+ Identifier "Screen 1"
+ Device "Chips and Technologies - Pipe B"
+ Monitor "generic CRT"
+
+ SubSection "Display"
+ Depth 16
+ Modes "1024x768"
+ EndSubsection
+ EndSection
+
+ Section "ServerLayout"
+ Identifier "Main Layout"
+ Screen "Screen 0"
+ Screen "Screen 1" RightOf "Screen 0"
+ InputDevice "Mouse1" "CorePointer"
+ InputDevice "Keyboard1" "CoreKeyboard"
+ EndSection
+
+The device section must include the PCI BusID. This can be found from the log
+file of a working single-head installation. For instance, the line
+
+ (--) PCI:*(0:20:0) C&T 69030 rev 97, Mem @ 0xed000000/24
+
+appears for the case above. Additionally, the "Screen" option must appear in
+the device section. It should be noted that if a flat panel is used, this it
+must be allocated to "Screen 0".
+
+The server can then be started with the "+xinerama" option as follows
+
+ startx -- +xinerama
+
+For more information, read the Xinerama documentation.
+
+It should be noted that the dual channel display options of the 69030 require
+the use of additional memory bandwidth, as each display channel independently
+accesses the video memory. For this reason, the maximum colour depth and res-
+olution that can be supported in a dual channel mode will be reduced compared
+to a single display channel mode. However, as the driver does not prevent you
+from using a mode that will exceed the memory bandwidth of the 69030, but a
+warning like
+
+ (WW) Memory bandwidth requirements exceeded by dual-channel
+ (WW) mode. Display might be corrupted!!!
+
+If you see such display corruption, and you have this warning, your choices
+are to reduce the refresh rate, colour depth or resolution, or increase the
+speed of the memory clock with the the "SetMClk" option described above. Note
+that increasing the memory clock also has its own problems as described
+above.
+
+6. The Full Story on Clock Limitations
There has been much confusion about exactly what the clock limitations of the
Chips and Technologies chipsets are. Hence I hope that this section will
@@ -575,17 +689,24 @@ EDO, might not be fast enough to handle this, resulting in drawing errors on
the screen. The formula to determine the maximum usable dotclock on the HiQV
series of chips is
+ Max dotclock = min(MaxDClk, 0.70 * 8 * MemoryClk / (BytesPerPixel +
+ (isDSTN == TRUE ? 1 : 0)))
+
+if you chips is a 69030 or 69000 or
+
Max dotclock = min(MaxDClk, 0.70 * 4 * MemoryClk / (BytesPerPixel +
(isDSTN == TRUE ? 1 : 0)))
-which says that there are two limits on the dotclock. One the overall maxi-
-mum, and another due to the available memory bandwidth of the chip. For the
-memory bandwidth 4 bytes are transfered every clock cycle (Hence the 4), but
-after accounting for the RAS/CAS signaling only about 70% of the bandwidth is
-available. The whole thing is divided by the bytes per pixel, plus an extra
-byte if you are using a DSTN. The extra byte with DSTN screens is used for
-the frame buffering/acceleration in these screens. So for the various Chips
-and Technologies chips the maximum specifications are
+otherwise. This effectively means that there are two limits on the dotclock.
+One the overall maximum, and another due to the available memory bandwidth of
+the chip. The 69030 and 69000 have a 64bit memory bus and thus transfer 8
+bytes every clock thus (hence the 8), while the other HiQV chipsets are 32bit
+and transfer 4 bytes per clock cycle (hence the 4). However, after accounting
+for the RAS/CAS signaling only about 70% of the bandwidth is available. The
+whole thing is divided by the bytes per pixel, plus an extra byte if you are
+using a DSTN. The extra byte with DSTN screens is used for the frame buffer-
+ing/acceleration in these screens. So for the various Chips and Technologies
+chips the maximum specifications are
Max DClk MHz Max Mem Clk MHz
65550 rev A 3.3v 80 38
@@ -613,8 +734,8 @@ chips are
65554 94.5 77 51.33 77 51.33 38.5
65555 110 77 51.33 77 51.33 38.5
68554 110 77 51.33 77 51.33 38.5
- 69000 135 116.2 77.47 116.2 77.47 58.1
- 69030 170 140 93.33 140 93.33 70
+ 69000 135 135 135 135 135 116.2
+ 69030 170 170 170 170 170 140
If you exceed the maximum set by the memory clock, you'll get corruption on
the screen during graphics operations, as you will be starving the HW BitBlt
@@ -632,7 +753,7 @@ ticular mode to work. However use caution with these options, because there
is no guarantee that driving the video processor beyond it capabilities won't
cause damage.
-6. Troubleshooting
+7. Troubleshooting
The cursor appears as a white box, after switching modes
There is a known bug in the H/W cursor, that sometimes causes the
@@ -805,13 +926,13 @@ cause damage.
My ct69030 machine locks up when starting XFree
The ct69030 chipset introduced a new dual channel architecture.
- In its current form, XFree can not take advantage of this second
- display channel. In fact if the video BIOS on the machine sets
- the ct69030 to a dual channel mode by default, XFree will lockup
- hard at this point. The solution is to use the BIOS setup to
- change to a single display channel mode, ensuring that both the
- IOSS and MSS registers are set to a single channel mode. Work is
- underway to fix this.
+ In its current form, XFree86 can not take advantage of this sec-
+ ond display channel. In fact if the video BIOS on the machine
+ sets the ct69030 to a dual channel mode by default, XFree86 will
+ lockup hard at this point. The solution is to use the BIOS setup
+ to change to a single display channel mode, ensuring that both
+ the IOSS and MSS registers are set to a single channel mode. Work
+ is underway to fix this.
I can't start X-windows with 16, 24 or 32bpp
Firstly, is your machine capable of 16/24/32bpp with the mode
@@ -829,7 +950,7 @@ cause damage.
startx -- -depth 24 -fbbpp 32 8-8-8 RGB truecolor
- however as XFree86 version 4.0.2 allows 32bpp pixmaps to be used
+ however as XFree86 version 4.1.0 allows 32bpp pixmaps to be used
with framebuffers operating in 24bpp, this mode of operating will
cost performance for no gain in functionality.
@@ -847,7 +968,8 @@ perhaps more stable clock by simply changing the clock value slightly. For
example 65.00MHz might be unstable while 65.10MHz is not. So for unexplained
problems not addressed above, please try to alter the clock you are using
slightly, say in steps of 0.05MHz and see if the problem goes away. Alterna-
-tively, using the "UseVClk1" option with HiQV chips might also help.
+tively, using the "CRTClkIndx" or "FPClkIndx" option with HiQV chips might
+also help.
For other screen drawing related problems, try the "NoAccel" or one of the
XAA acceleration options discussed above. A useful trick for all laptop com-
@@ -860,19 +982,19 @@ tacting the XFree86 team (the current driver maintainer can be reached at
<dbateman@club-internet.fr> or <eich@xfree86.org>), or post in the Usenet
newsgroup "comp.windows.x.i386unix".
-7. Disclaimer
+8. Disclaimer
XFree86, allows the user to do damage to their hardware with software.
Although the authors of this software have tried to prevent this, they dis-
claim all responsibility for any damage caused by the software. Use caution,
if you think the Xserver is frying your screen, TURN THE COMPUTER OFF!!
-8. Acknowledgement
+9. Acknowledgement
The authors of this software wish to acknowledge the support supplied by
Chips and Technologies during the development of this software.
-9. Authors
+10. Authors
Major Contributors (In no particular order)
@@ -899,7 +1021,7 @@ Contributors (In no particular order)
We also thank the many people on the net who have contributed by reporting
bugs and extensively testing this server.
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml,v 3.33 2000/12/02 21:52:22 dbateman Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml,v 3.36 2001/05/19 00:35:42 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.chips,v 3.35 2000/12/04 19:47:24 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.chips,v 3.36.2.1 2001/06/01 18:26:44 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.cyrix b/xc/programs/Xserver/hw/xfree86/doc/README.cyrix
index 457e3d3f8..f480f4de1 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.cyrix
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.cyrix
@@ -50,4 +50,4 @@ lowing Cyrix CPUs with integrated graphics:
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/cyrix.sgml,v 1.3 2000/03/08 05:38:43 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.cyrix,v 1.8 2000/12/01 19:47:49 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.cyrix,v 1.8.4.1 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.dps b/xc/programs/Xserver/hw/xfree86/doc/README.dps
index da1bf9fdc..25b300daf 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.dps
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.dps
@@ -167,4 +167,4 @@ Developers. 15 April 1993.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/dps.sgml,v 1.1 2001/03/02 02:45:37 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.dps,v 1.2 2001/03/02 17:47:53 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.dps,v 1.2.2.1 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.fonts b/xc/programs/Xserver/hw/xfree86/doc/README.fonts
index 9a3b84b26..fb30c0aa2 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.fonts
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.fonts
@@ -1013,4 +1013,4 @@ favourite is RFC 373.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.13 2001/03/01 00:37:09 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.16 2001/03/02 17:47:53 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.16.2.1 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.i740 b/xc/programs/Xserver/hw/xfree86/doc/README.i740
index bf790fdd8..12bfdf00d 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.i740
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.i740
@@ -178,4 +178,4 @@ http://www.precisioninsight.com
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/i740.sgml,v 1.3 2000/03/04 00:26:30 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.i740,v 1.8 2000/12/01 19:47:49 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.i740,v 1.8.4.1 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.i810 b/xc/programs/Xserver/hw/xfree86/doc/README.i810
index cee453c26..38e255969 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.i810
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.i810
@@ -109,4 +109,4 @@ http://www.precisioninsight.com
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/i810.sgml,v 1.3 2001/04/04 01:34:18 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.i810,v 1.6 2001/04/10 16:44:32 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.i810,v 1.6.2.1 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.isc b/xc/programs/Xserver/hw/xfree86/doc/README.isc
index 83627198d..6151da7c9 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.isc
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.isc
@@ -489,4 +489,4 @@ tribute to this excellent piece of free software.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/isc.sgml,v 3.24 2000/03/06 22:59:25 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.isc,v 3.39 2000/12/01 19:47:50 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.isc,v 3.39.4.1 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.mouse b/xc/programs/Xserver/hw/xfree86/doc/README.mouse
index 89dadc30f..a3e3527f3 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.mouse
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.mouse
@@ -6,7 +6,7 @@
1. Introduction
-This document describes mouse support in XFree86 4.0.2.
+This document describes mouse support in XFree86 4.1.0.
Mouse configuration has often been mysterious task for novice users. How-
ever, once you learn several basics, it is straightforward to write the mouse
@@ -928,4 +928,4 @@ wheel's movement will be reported as the buttons 6 and 7.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/mouse.sgml,v 1.11 2000/03/01 00:25:23 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.mouse,v 1.11 2000/12/01 19:47:50 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.mouse,v 1.11.4.1 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.newport b/xc/programs/Xserver/hw/xfree86/doc/README.newport
index 647969cdc..9ef0f4d10 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.newport
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.newport
@@ -41,4 +41,4 @@ The following Section "Device" options are supported by the newport driver:
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/newport.sgml,v 1.2 2000/12/12 18:54:29 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.newport,v 1.2 2000/12/12 19:04:03 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.newport,v 1.2.4.1 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.r128 b/xc/programs/Xserver/hw/xfree86/doc/README.r128
index a666b3035..b6cfc6f48 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.r128
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.r128
@@ -119,4 +119,4 @@ http://www.suse.com
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/r128.sgml,v 1.8 2000/06/14 00:16:09 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.r128,v 1.13 2000/12/01 19:47:51 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.r128,v 1.13.4.1 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.rapidaccess b/xc/programs/Xserver/hw/xfree86/doc/README.rapidaccess
new file mode 100644
index 000000000..a78dfb9bc
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.rapidaccess
@@ -0,0 +1,48 @@
+The IBM Rapid Access keyboard have some extra buttons
+on it to launch programs, control a cd-player and so on.
+
+These buttons is not functional when the computer is turned
+on but have to be activated by sending the codes 0xea 0x71
+to it.
+
+I've written the following hack to send codes to the keyboard:
+
+--------------------------------------------------------------
+/* gcc -O2 -s -Wall -osend_to_keyboard send_to_keyboard.c */
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/io.h>
+
+int main( int argc, char *argv[] )
+{
+ int i;
+
+ ioperm( 0x60, 3, 1 );
+
+ for( i = 1; i < argc; i++ ) {
+ int x = strtol( argv[i], 0, 16 );
+
+ usleep( 300 );
+ outb( x, 0x60 );
+ }
+
+ return 0;
+}
+--------------------------------------------------------------
+
+As root you can then call this program (in your boot scripts)
+as "send_to_keyboard ea 71" to turn on the extra buttons.
+
+It's not a good idea to run several instances of this program
+at the same time. It is a hack but it works. If you try to
+send other codes to the keyboard it probably will lock up.
+For other codes see:
+
+http://www.win.tue.nl/~aeb/linux/kbd/scancodes-2.html#ss2.22
+
+--
+Dennis Björklund <db@zigo.dhs.org>
+
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.rapidaccess,v 1.1 2001/05/18 23:35:32 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.rendition b/xc/programs/Xserver/hw/xfree86/doc/README.rendition
index bc9db34bd..70cc35a00 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.rendition
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.rendition
@@ -145,4 +145,4 @@ on the list of features to be included.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/rendition.sgml,v 1.12 2000/06/17 02:30:33 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.rendition,v 1.12 2000/12/01 19:47:51 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.rendition,v 1.12.4.1 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.s3virge b/xc/programs/Xserver/hw/xfree86/doc/README.s3virge
index 8b878827e..6b71b8f22 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/README.s3virge
+++ b/xc/programs/Xserver/hw/xfree86/doc/README.s3virge
@@ -6,7 +6,7 @@
1. Supported hardware
-The s3virge driver in XFree86 4.0.2 supports the S3 ViRGE, ViRGE DX, GX, MX,
+The s3virge driver in XFree86 4.1.0 supports the S3 ViRGE, ViRGE DX, GX, MX,
MX+, and VX chipsets. A majority of testing is done on ViRGE DX chips, mak-
ing them the most stable to date. This release has improved support for
ViRGE GX2 stability, XVideo support for ViRGE DX (tested) and ViRGE
@@ -63,4 +63,4 @@ tact our support email address <XFree86@Xfree86.org>
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/s3virge.sgml,v 1.3 2000/11/28 20:59:17 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.s3virge,v 1.6 2000/12/01 19:47:51 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.s3virge,v 1.6.4.1 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/RELNOTES b/xc/programs/Xserver/hw/xfree86/doc/RELNOTES
index a1dd1afdb..eb39ead36 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/RELNOTES
+++ b/xc/programs/Xserver/hw/xfree86/doc/RELNOTES
@@ -1,4 +1,4 @@
- Release Notes for XFree86[tm] 4.0.2
+ Release Notes for XFree86[tm] 4.1.0
The XFree86 Project, Inc
@@ -7,17 +7,17 @@
Abstract
This document contains some information about the features present
- in XFree86 4.0.2 and their status.
+ in XFree86 4.1.0 and their status.
1. Introduction to the 4.x Release Series
XFree86 4.0 was the first official release of the new XFree86 4 series. The
-current release (4.0.2) is the latest in that series. XFree86 4 represents a
+current release (4.1.0) is the latest in that series. XFree86 4 represents a
significant redesign of the XFree86 X server. Not all of the hardware
drivers from 3.3.x have been ported to 4.x yet, but conversely, 4.x has some
hardware support not present in 3.3.x. Our Driver Status document summarizes
-how the hardware driver support compares between 3.3.6 and 4.0.2. Please
-check there first before downloading 4.0.2.
+how the hardware driver support compares between 3.3.6 and 4.1.0. Please
+check there first before downloading 4.1.0.
The 4.0.1 release introduced a new graphical configuration tool, "xf86cfg",
and a text mode interface was added to it for the 4.0.2 release. It is work
@@ -28,7 +28,7 @@ built-in to the X server. It is included in the release, and it works well
for some hardware. To try it out, just run (as root) "XFree86 -configure".
Each of these configuration options will give you a reasonable starting point
for a suitable configuration file. We've put some effort into documenting
-the 4.0.2 config file format, and you can find that information in the
+the 4.1.0 config file format, and you can find that information in the
XF86Config manual page. Check that, the driver manual pages and the related
documentation for further information.
@@ -37,17 +37,18 @@ release, please have a quick read through the Installation Document. It may
save you some time and help you figure out which of the binary releases you
need.
-The next section describes what is new in the latest version (4.0.2). The
+The next section describes what is new in the latest version (4.1.0). The
other sections below describe some of the new features and changes between
3.3.x and 4.0. There are lot's of new features, and we definitely don't have
enough space to cover them all here.
-2. Summary of new features in 4.0.2.
+2. Summary of new features in 4.1.0.
2.1 X server
- o Darwin/Mac OS X is now supported and the X server runs on PowerPC. The
- X server for this platform is called "Xdarwin", and its installation and
+ o Darwin/Mac OS X is now supported on PowerPC and Intel/x86. The X server
+ runs from the console or in cooperation with the Mac OS X Aqua GUI. The
+ X server for this platform is called "XDarwin", and its installation and
configuration is different from the "XFree86" server used on other plat-
forms. Please read the XFree86 on Darwin and Mac OS X document for fur-
ther information.
@@ -289,7 +290,7 @@ enough space to cover them all here.
3.1 Video Drivers
-XFree86 4.0.2 includes the following video drivers:
+XFree86 4.1.0 includes the following video drivers:
+--------------+--------------------------+----------------------------------+
|Driver Name | Description | Further Information |
@@ -341,7 +342,7 @@ Drivers marked with (-) are for Linux/mips only.
Darwin/Mac OS X uses IOKit drivers and does not use the module loader drivers
listed above. Further information can be found in README.Darwin.
-XFree86 4.0.2 includes the following input drivers:
+XFree86 4.1.0 includes the following input drivers:
3.2 Input Drivers
@@ -367,12 +368,12 @@ XFree86 4.0.2 includes the following input drivers:
4. Summary of XFree86 4.
Unlike XFree86 3.3.x where there are multiple X server binaries, each of
-which drive different hardware, XFree86 4.0.2 has a single X server binary
+which drive different hardware, XFree86 4.1.0 has a single X server binary
called XFree86. This binary can either have one or more video drivers linked
in statically, or, more usually, dynamically load the video drivers and other
modules that are needed.
-XFree86 4.0.2 has X server support for most UNIX(R) and UNIX-like operating
+XFree86 4.1.0 has X server support for most UNIX(R) and UNIX-like operating
systems on Intel/x86 platforms, plus support for Linux on Alpha, PowerPC,
IA-64, Sparc, and Mips platforms, and for Darwin on PowerPC. Work on support
for additional architectures and operating systems is in progress, and is
@@ -394,7 +395,7 @@ they do not need to be recompiled for every different operating system. In
the future we plan to take advantage of this to provide more frequent driver
module updates in between major releases.
-The loader in version 4.0.2 has support for Intel (x86), Alpha and PowerPC
+The loader in version 4.1.0 has support for Intel (x86), Alpha and PowerPC
platforms. It also has preliminary support for Sparc platforms.
The X server makes use of modules for video drivers, X server extensions,
@@ -733,7 +734,7 @@ Known problems:
4.7 DGA version 2
-DGA 2.0 is included in 4.0.2, but is not implemented by all drivers. Prelim-
+DGA 2.0 is included in 4.1.0, but is not implemented by all drivers. Prelim-
inary documentation for the client libraries can be found in the README.DGA
document. A good degree of backwards compatibility with version 1.0 is pro-
vided.
@@ -801,7 +802,7 @@ anti-aliased text and geometric objects as well as perform translucent image
overlays and other image operations not possible with the core X rendering
system.
-XFree86 4.0.2 provides a partial implementation of Render sufficient for
+XFree86 4.1.0 provides a partial implementation of Render sufficient for
drawing anti-aliased text and image composition. Still to be implemented are
geometric primitives and affine transformation of images.
@@ -836,10 +837,10 @@ the Xft man page.
4.11.2 FreeType support in Xft
-XFree86 4.0.2 includes sources for FreeType version 2.0.1, and, by default,
+XFree86 4.1.0 includes sources for FreeType version 2.0.1, and, by default,
they are built and installed automatically.
-If you prefer, you can configure XFree86 4.0.2 to use an existing Freetype2
+If you prefer, you can configure XFree86 4.1.0 to use an existing Freetype2
installation by telling XFree86 not to build the internal copy and indicating
where that external version has been installed. Edit (or create) con-
fig/cf/host.def to include:
@@ -856,7 +857,7 @@ the FreeType release.
4.11.3 Application Support For Anti-Aliased Text
-Only three applications have been modified in XFree86 4.0.2 to work with the
+Only three applications have been modified in XFree86 4.1.0 to work with the
Render extension and the Xft and FreeType libraries to provide anti-aliased
text. Xterm, xditview and x11perf. Migration of other applications may
occur in future releases.
@@ -1085,4 +1086,4 @@ symbolic links in the old location.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.60 2001/03/02 17:40:48 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/RELNOTES,v 3.97 2001/03/02 17:47:53 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/RELNOTES,v 3.97.2.2 2001/06/02 04:44:36 torrey Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/Status b/xc/programs/Xserver/hw/xfree86/doc/Status
index bc8b7fa42..8280311b9 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/Status
+++ b/xc/programs/Xserver/hw/xfree86/doc/Status
@@ -1,24 +1,24 @@
- Driver Status for XFree86[tm] 4.0.2
+ Driver Status for XFree86[tm] 4.1.0
The XFree86 Project, Inc
- 4 December 2000
+ 1 June 2001
Abstract
This document provides information about the status of the driver
- and hardware support in XFree86 4.0.2 compared with that in XFree86
+ and hardware support in XFree86 4.1.0 compared with that in XFree86
3.3.6. Please send updates for this document to
<fixes@xfree86.org>. Please do not send requests for information
- or support to that address.
+ or support to that address (they will not be answered).
1. Introduction
This document contains one section per vendor (organised alphabetically) for
-each chipset family that is supported in XFree86 3.3.6 or XFree86 4.0.2. It
+each chipset family that is supported in XFree86 3.3.6 or XFree86 4.1.0. It
includes information about the status of the drivers and the hardware they
support, including a comparison of the level of support between versions
-3.3.6 and 4.0.2. Unless otherwise stated, hardware is classified as "sup-
+3.3.6 and 4.1.0. Unless otherwise stated, hardware is classified as "sup-
ported" if its driver provides basic 2D support. Support for additional fea-
tures may or may not be present.
@@ -27,9 +27,9 @@ XF86_SVGA server, which has a set of driver modules that are built into it at
compile time. In other cases, X servers for specific chips (or families of
chips) are provided (such as XF86_AGX, XF86_Mach64, etc.).
-In XFree86 4.0.2, there is only one X server, called "XFree86", which can
+In XFree86 4.1.0, there is only one X server, called "XFree86", which can
load driver modules at runtime. Thus there is no specific mention of a
-server binary when 4.0.2 is discussed; only the XFree86 server is used.
+server binary when 4.1.0 is discussed; only the XFree86 server is used.
Third-party vendors (often the manufacturers of various video chipsets) may
provide their own drivers for the XFree86 server, but these third-party mod-
ules are beyond the scope of this document.
@@ -45,7 +45,7 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Support (including acceleration) for Voodoo Banshee and Voodoo3
cards is provided by the XF86_SVGA server with the tdfx driver.
- 4.0.2:
+ 4.1.0:
Support for Voodoo Graphics and Voodoo 2 chips is available on
platforms where Glide is available (Linux and FreeBSD(?)) and is
provided by the "glide" driver (requires version 2.x of the Glide
@@ -55,7 +55,7 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Voodoo4, and Voodoo5 is provided by the "tdfx" driver.
Summary:
- All hardware supported in 3.3.6 is also supported in 4.0.2.
+ All hardware supported in 3.3.6 is also supported in 4.1.0.
3. 3Dlabs
@@ -65,14 +65,14 @@ architectures known to work on (e.g., Alpha, PPC), etc.
ramdacs), Permedia with IBM RGB526 RAMDAC, and Permedia 2, 2a, 2v
is provided by the XF86_3DLabs server.
- 4.0.2:
+ 4.1.0:
Support (including acceleration) for Permedia, Permedia 2, 2v,
(and 2a?), Permedia 3, GLINT 500TX, GLINT MX, GLINT Gamma, and
GLINT Delta coproc is provided by the "glint" driver.
Summary:
- All hardware supported in 3.3.6 is also supported in 4.0.2. The
- Permedia 3 is only supported in 4.0.2.
+ All hardware supported in 3.3.6 is also supported in 4.1.0. The
+ Permedia 3 is only supported in 4.1.0.
4. Alliance
@@ -80,14 +80,14 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Support (including acceleration) for the AT24, AP6422, AT3D.
Support is provided by the XF86_SVGA server with the apm driver.
- 4.0.2:
+ 4.1.0:
Support (including acceleration?) for the AT24, AT25 and AT3D.
This support is provided by the "apm" driver. This driver cur-
rently has only incomplete support for the AP6422.
Summary:
- The AP6422 is supported in 3.3.6 but not fully in 4.0.2. The
- AT25 is supported in 4.0.2 but not in 3.3.6.
+ The AP6422 is supported in 3.3.6 but not fully in 4.1.0. The
+ AT25 is supported in 4.1.0 but not in 3.3.6.
5. ARK Logic
@@ -96,12 +96,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
and ARK2000MT. Support is provided by the XF86_SVGA server with
the ark driver.
- 4.0.2:
+ 4.1.0:
Support (including acceleration) for the ARK1000PV, ARK2000PV,
and ARK2000MT. Support is provided by the "ark" driver.
Summary:
- All hardware supported in 3.3.6 is also supported in 4.0.2.
+ All hardware supported in 3.3.6 is also supported in 4.1.0.
6. ATI
@@ -119,17 +119,17 @@ architectures known to work on (e.g., Alpha, PPC), etc.
driver. Accelerated support is provided for the Rage 128 chips
by the XF86_SVGA server with the r128 driver.
- 4.0.2:
+ 4.1.0:
Accelerated support is provided for Mach64, Rage, Rage 128 and
Radeon chips. Unaccelerated support is provided for all of the
others except the Mach8 and some early Mach32 chips by the "ati"
driver.
Summary:
- All chips supported in 3.3.6 are supported in 4.0.2 except for
- Mach8 and some old Mach32 chips. The support in 4.0.2 is, how-
- ever, unaccelerated for all chips except the Mach64, Rage and
- Rage 128 variants.
+ All chips supported in 3.3.6 are supported in 4.1.0 except for
+ Mach8 and some old Mach32 chips. The support in 4.1.0 is, how-
+ ever, unaccelerated for all chips except the Mach64, Rage, Rage
+ 128 and Radeon variants.
7. Avance Logic
@@ -140,12 +140,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
the others. These drivers reportedly work, but they have no
maintainer.
- 4.0.2:
+ 4.1.0:
No native support for these chipsets, because the old drivers
have not been ported.
Summary:
- No Avance Logic chips are supported in 4.0.2.
+ No Avance Logic chips are supported in 4.1.0.
8. Chips and Technologies
@@ -155,13 +155,13 @@ architectures known to work on (e.g., Alpha, PPC), etc.
64300. This support is provided by the XF86_SVGA server with the
chips driver.
- 4.0.2:
+ 4.1.0:
Support (accelerated) for the 65520, 65525, 65530, 65535, 65540,
65545, 65546, 65548, 65550, 65554, 65555, 68554, 69000, 64200 and
64300. This support is provided by the "chips" driver.
Summary:
- All hardware supported in 3.3.6 is also supported in 4.0.2.
+ All hardware supported in 3.3.6 is also supported in 4.1.0.
9. Cirrus Logic
@@ -173,13 +173,13 @@ architectures known to work on (e.g., Alpha, PPC), etc.
7541, 7542, 7543, 7548, 7555 and 7556 is provided by the
XF86_SVGA server with the cirrus driver.
- 4.0.2:
+ 4.1.0:
Support (accelerated) for the Alpine (5430, 5434, 5436, 5446,
5480, 7548), and Laguna (5462, 5464, 5465) chips is provided by
the "cirrus" driver.
Summary:
- The following chips are supported in 3.3.6 but not in 4.0.2:
+ The following chips are supported in 3.3.6 but not in 4.1.0:
6410, 6412, 6420, 6440, 5420, 5422, 5424, 5426, 5428, 5429, 6205,
6215, 6225, 6235, 7541, 7542, 7543, 7555 and 7556.
@@ -195,7 +195,7 @@ architectures known to work on (e.g., Alpha, PPC), etc.
24 plane 3D chips (on Alpha platforms) is provided by the
XF86_TGA server.
- 4.0.2:
+ 4.1.0:
No support for the Compaq AVGA (driver hasn't been ported).
Support (accelerated) for the DEC 21030 TGA 8 plane, 24 plane and
@@ -203,8 +203,8 @@ architectures known to work on (e.g., Alpha, PPC), etc.
the "tga" driver.
Summary:
- No Compaq AVGA support in 4.0.2. DEC TGA support is equivalent
- in both 3.3.6 and 4.0.2.
+ No Compaq AVGA support in 4.1.0. DEC TGA support is equivalent
+ in both 3.3.6 and 4.1.0.
11. Cyrix
@@ -212,12 +212,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Support (accelerated) for the Cyrix MediaGX is provided by the
XF86_SVGA server with the cyrix driver.
- 4.0.2:
- The 3.3.6 driver has been ported to 4.0.2, including accelera-
+ 4.1.0:
+ The 3.3.6 driver has been ported to 4.1.0, including accelera-
tion, but feedback is needed.
Summary:
- Cyrix MediaGX users are encouraged to test its support in 4.0.2.
+ Cyrix MediaGX users are encouraged to test its support in 4.1.0.
12. Epson
@@ -225,12 +225,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Support (accelerated) for the Epson SPC8110 is provided by the
XF86_SVGA server with the spc8100 driver.
- 4.0.2:
+ 4.1.0:
No native support for this chipset, because the old driver has
not been ported.
Summary:
- No Epson chips are supported in 4.0.2.
+ No Epson chips are supported in 4.1.0.
13. Genoa
@@ -240,12 +240,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
because we don't have any recent test reports, and this driver
has no maintainer.
- 4.0.2:
+ 4.1.0:
No native support for this chipset, because the old driver has
not been ported.
Summary:
- No Genoa chips are supported in 4.0.2.
+ No Genoa chips are supported in 4.1.0.
14. IBM
@@ -260,7 +260,7 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Support for the IBM XGA-2 chip is provided by the XF86_AGX
server.
- 4.0.2:
+ 4.1.0:
Support for the standard IBM VGA chip (and compatibles) is pro-
vided by the "vga" driver.
@@ -269,7 +269,7 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Summary:
The standard VGA core is supported in both versions, but there is
- no support for the 8514/A or XGA-2 in 4.0.2.
+ no support for the 8514/A or XGA-2 in 4.1.0.
15. IIT
@@ -277,12 +277,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Support (accelerated) for the AGX-016, AGX-015 and AGX-014 is
provided by the XF86_AGX server.
- 4.0.2:
+ 4.1.0:
No native support for these chipsets, because the old driver has
not been ported.
Summary:
- No IIT chips are supported in 4.0.2.
+ No IIT chips are supported in 4.1.0.
16. Integrated Micro Solutions (IMS)
@@ -290,12 +290,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Support (accelerated) for the IMS Twin Turbo 128 is provided by
the XF86_SVGA server with the imstt driver.
- 4.0.2:
+ 4.1.0:
Support (accelerated) for the IMS Twin Turbo 128 is provided by
the "imstt" driver.
Summary:
- All hardware supported in 3.3.6 is also supported in 4.0.2.
+ All hardware supported in 3.3.6 is also supported in 4.1.0.
17. Intel
@@ -306,7 +306,7 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Linux, and requires the agpgart.o kernel module in order to use
modes that require more than 1MB of video memory.
- 4.0.2:
+ 4.1.0:
Support (accelerated) for the Intel i740 is provided by the
"i740" driver, and support for the Intel i810 (including
i810-dc100 and i810e) and i815 is provided by the "i810" driver.
@@ -325,13 +325,13 @@ architectures known to work on (e.g., Alpha, PPC), etc.
(Mystique), MGA2164W (Millennium II) (PCI and AGP), G100, G200
and G400 is provided by the XF86_SVGA server with the mga driver.
- 4.0.2:
+ 4.1.0:
Support (accelerated) for the MGA2064W (Millennium I), MGA1064SG
(Mystique), MGA2164W (Millennium II) (PCI and AGP), G100, G200
and G400 is provided by the "mga" driver.
Summary:
- All hardware supported in 3.3.6 is also supported in 4.0.2.
+ All hardware supported in 3.3.6 is also supported in 4.1.0.
19. MX (???)
@@ -341,12 +341,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
is unknown because we don't have any recent test reports, and
this driver has no maintainer.
- 4.0.2:
+ 4.1.0:
No native support for this chipset, because the old driver has
not been ported.
Summary:
- No MX (???) chips are supported in 4.0.2.
+ No MX (???) chips are supported in 4.1.0.
20. NCR
@@ -355,12 +355,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
XF86_SVGA server and the ncr77c22 driver. The status of this
support is unknown because we don't have any recent test reports.
- 4.0.2:
+ 4.1.0:
No native support for this chipset, because the old driver has
not been ported.
Summary:
- No NCR chips are supported in 4.0.2.
+ No NCR chips are supported in 4.1.0.
21. NeoMagic
@@ -369,14 +369,14 @@ architectures known to work on (e.g., Alpha, PPC), etc.
NM2097, NM2160 and NM2200 chipsets is provided by the XF86_SVGA
server with the neo driver.
- 4.0.2:
+ 4.1.0:
Support (accelerated) for the NeoMagic NM2070, NM2090, NM2093,
NM2097, NM2160, NM2200, NM2230, NM2360 and NM2380 chipsets is
provided by the "neomagic" driver.
Summary:
- All hardware supported in 3.3.6 is also supported in 4.0.2. The
- NM2230 and later chips are only supported in 4.0.2.
+ All hardware supported in 3.3.6 is also supported in 4.1.0. The
+ NM2230 and later chips are only supported in 4.1.0.
22. NVIDIA
@@ -385,15 +385,15 @@ architectures known to work on (e.g., Alpha, PPC), etc.
(Ultra, Vanta, M64), GeForce (DDR, 256) and Quadro is provided by
the XF86_SVGA server and the nv driver.
- 4.0.2:
+ 4.1.0:
Support (accelerated) for the Riva 128, 128ZX, TNT, TNT2 (Ultra,
Vanta, M64), GeForce (DDR, 256), GeForce2 (GTS, Ultra, MX),
Quadro, and Quadro2 is provided by the "nv" driver.
Summary:
All chipsets supported in 3.3.6 except the NV1 are also supported
- in 4.0.2. Support for the newer chips (GeForce2 and later) is
- only available in 4.0.2.
+ in 4.1.0. Support for the newer chips (GeForce2 and later) is
+ only available in 4.1.0.
23. Number Nine
@@ -401,12 +401,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Support (accelerated) for the Imagine 128, Ticket 2 Ride, Revolu-
tion 3D and Revolution IV is provided by the XF86_I128 server.
- 4.0.2:
+ 4.1.0:
Support (accelerated) for the Imagine 128, Ticket 2 Ride, Revolu-
tion 3D and Revolution IV is provided by the "i128" driver.
Summary:
- All hardware supported in 3.3.6 is also supported in 4.0.2.
+ All hardware supported in 3.3.6 is also supported in 4.1.0.
24. Oak Technologies, Inc.
@@ -415,12 +415,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
acceleration) is provided by the XF86_SVGA server and the oak
driver.
- 4.0.2:
+ 4.1.0:
No native support for these chipsets, because the old driver has
not been ported.
Summary:
- No Oak chips are supported in 4.0.2.
+ No Oak chips are supported in 4.1.0.
25. Paradise/Western Digital
@@ -431,12 +431,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
port for some of these chipsets is uncertain because we don't
have any recent test reports, and this driver has no maintainer.
- 4.0.2:
+ 4.1.0:
No native support for these chipsets, because the old driver has
not been ported.
Summary:
- No Paradise/Western Digital chips are supported in 4.0.2.
+ No Paradise/Western Digital chips are supported in 4.1.0.
26. RealTek
@@ -446,12 +446,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
unknown because we don't have any recent test reports, and this
driver has no maintainer.
- 4.0.2:
+ 4.1.0:
No native support for these chipsets, because the old driver has
not been ported.
Summary:
- No RealTek chips are supported in 4.0.2.
+ No RealTek chips are supported in 4.1.0.
27. Rendition/Micron
@@ -459,12 +459,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Support for the Verite 1000, 2100 and 2200 is provided by the
XF86_SVGA server with the rendition driver.
- 4.0.2:
+ 4.1.0:
Support for the Verite 1000, 2100 and 2200 is provided by the
"rendition" driver.
Summary:
- All hardware supported in 3.3.6 is also supported in 4.0.2.
+ All hardware supported in 3.3.6 is also supported in 4.1.0.
28. S3
@@ -481,7 +481,7 @@ architectures known to work on (e.g., Alpha, PPC), etc.
age2000, is provided by the XF86_SVGA server with the s3_savage
driver on some OSes (Linux, *BSD).
- 4.0.2:
+ 4.1.0:
Support (accelerated) for the ViRGE, ViRGE/VX, ViRGE/DX,
ViRGE/GX, ViRGE/GX2, ViRGE/MX, ViRGE/MX+, Trio3D and Trio3D/2X is
provided by the "s3virge" driver. Support (accelerated) for the
@@ -491,19 +491,19 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Summary:
Only the ViRGE, Trio3D and Savage chipsets are supported in
- 4.0.2. All of the other chipsets are only supported in 3.3.6.
+ 4.1.0. All of the other chipsets are only supported in 3.3.6.
29. Silicon Graphics, Inc. (SGI)
3.3.6:
No SGI hardware is supported in 3.3.6.
- 4.0.2:
+ 4.1.0:
Unaccelerated support for the SGI Indy's Newport cards is pro-
vided by the "newport" driver.
Summary:
- SGI hardware is supported only in 4.0.2.
+ SGI hardware is supported only in 4.1.0.
30. Silicon Integrated Systems (SiS)
@@ -512,7 +512,7 @@ architectures known to work on (e.g., Alpha, PPC), etc.
86C225, 5597, 5598, 6326, 530, 620, 300, 630 and 540 is provided
by the XF86_SVGA server with the sis driver.
- 4.0.2:
+ 4.1.0:
Support (accelerated) for the SiS
530, 620, 6326 is provided by the "sis" driver. The 630, 300,
and 540 are also supported, but this code is new and there are
@@ -529,20 +529,20 @@ architectures known to work on (e.g., Alpha, PPC), etc.
LynxEM+ and Lynx3DM chips is provided by the XF86_SVGA server
with the smi driver.
- 4.0.2:
+ 4.1.0:
Support (accelerated) for the Lynx, LynxE, Lynx3D, LynxEM,
LynxEM+ and Lynx3DM chips is provided by the "siliconmotion"
driver.
Summary:
- All hardware supported in 3.3.6 is also supported in 4.0.2.
+ All hardware supported in 3.3.6 is also supported in 4.1.0.
32. Sun Microsystems
3.3.6:
No Sun hardware is supported in 3.3.6.
- 4.0.2:
+ 4.1.0:
Sun BW2 framebuffers are supported by the "sunbw2" driver. Sun
CG3 framebuffers are supported by the "suncg3" driver. Sun CG6
framebuffers are supported by the "suncg6" driver. Sun CG14
@@ -552,7 +552,7 @@ architectures known to work on (e.g., Alpha, PPC), etc.
framebuffers are supported by the "suntcx" driver.
Summary:
- Sun hardware is supported only in 4.0.2.
+ Sun hardware is supported only in 4.1.0.
33. Trident Microsystems
@@ -567,7 +567,7 @@ architectures known to work on (e.g., Alpha, PPC), etc.
CyberBlade/DSTN/i7 and CyberBlade/i1 is provided by the XF86_SVGA
server with the tvga8900 driver.
- 4.0.2:
+ 4.1.0:
Support (accelerated where the chip supports it) for the
TVGA8900D, TGUI9440AGi, TGUI9660, TGUI9680, ProVidia 9682, Pro-
Vidia 9685, Cyber9320, Cyber9382, Cyber9385, Cyber9388,
@@ -579,10 +579,10 @@ architectures known to work on (e.g., Alpha, PPC), etc.
Summary:
The following (older) chipsets that are supported in 3.3.6 are
- not supported in 4.0.2: TVGA8200LX, TVGA8800CS, TVGA8900B,
+ not supported in 4.1.0: TVGA8200LX, TVGA8800CS, TVGA8900B,
TVGA8900C, TVGA8900CL, TVGA9000, TVGA9000i, TVGA9100B,
TVGA9200CXr, TGUI9400CXi, TGUI9420, TGUI9430DGi. The remaining
- listed chipsets are supported in 4.0.2.
+ listed chipsets are supported in 4.1.0.
34. Tseng Labs
@@ -594,13 +594,13 @@ architectures known to work on (e.g., Alpha, PPC), etc.
driver. Support (accelerated) for the ET4000/W32 series and the
ET6000 is also provided by the deprecated XF86_W32 server.
- 4.0.2:
+ 4.1.0:
Support for the ET4000AX, and accelerated support for the
ET4000/W32, ET4000/W32i, ET4000/W32p, ET6000 and ET6100 is pro-
vided by the "tseng" driver.
Summary:
- All cards supported by 3.3.6 are also supported by 4.0.2 except
+ All cards supported by 3.3.6 are also supported by 4.1.0 except
for the old ET3000.
35. Video 7
@@ -611,12 +611,12 @@ architectures known to work on (e.g., Alpha, PPC), etc.
unknown because we don't have any recent test reports, and this
driver has no maintainer.
- 4.0.2:
+ 4.1.0:
No native support for these chipsets, because the old driver has
not been ported.
Summary:
- No Video 7 chips are supported in 4.0.2.
+ No Video 7 chips are supported in 4.1.0.
36. Weitek
@@ -625,14 +625,14 @@ architectures known to work on (e.g., Alpha, PPC), etc.
server and accelerated support for the P9100 is provided by the
XF86_SVGA server with the p9x00 driver.
- 4.0.2:
+ 4.1.0:
No native support for these chipsets, because the old drivers
have not been ported.
Summary:
- No Weitek chips are supported in 4.0.2.
+ No Weitek chips are supported in 4.1.0.
- Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.29 2001/04/04 01:34:18 dawes Exp $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.29.2.2 2001/06/01 18:09:49 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/Status,v 1.23 2001/04/10 16:44:32 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/Status,v 1.23.2.2 2001/06/01 18:26:45 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/Versions b/xc/programs/Xserver/hw/xfree86/doc/Versions
index d681c5f75..feedad8e3 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/Versions
+++ b/xc/programs/Xserver/hw/xfree86/doc/Versions
@@ -298,4 +298,4 @@ and any other 4.0.x releases will continue with the Mmnn scheme.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Versions.sgml,v 1.1 2001/02/07 18:49:31 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/Versions,v 1.1 2001/02/07 18:52:28 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/Versions,v 1.1.4.1 2001/06/01 18:26:46 dawes Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml
index a9ca6d546..b4d541442 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml
@@ -27,7 +27,7 @@
<title>XFree86 X server ``New Design'' (DRAFT)
<author>The XFree86 Project, Inc
-<date>Last modified 2 December 2000
+<date>Last modified 1 May 2001
@@ -36,7 +36,7 @@
<ident>
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.40 2000/12/27 04:57:08 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.44 2001/05/19 00:40:30 dawes Exp $
</ident>
@@ -2561,7 +2561,7 @@ Next, the higher level functions that most drivers would use.
</quote>
- &s.code;OptionInfoPtr xf86TokenToOptinfo(OptionInfoPtr table, int token)&e.code;
+ &s.code;OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token)&e.code;
<quote><p>
Returns a pointer to the &s.code;OptionInfoRec&e.code; in
&s.code;table&e.code; with a token field matching
@@ -2570,7 +2570,7 @@ Next, the higher level functions that most drivers would use.
</quote>
- &s.code;Bool xf86IsOptionSet(OptionInfoPtr table, int token)&e.code;
+ &s.code;Bool xf86IsOptionSet(const OptionInfoRec *table, int token)&e.code;
<quote><p>
Returns the &s.code;found&e.code; field of the
&s.code;OptionInfoRec&e.code; in &s.code;table&e.code; with a
@@ -2582,7 +2582,7 @@ Next, the higher level functions that most drivers would use.
</quote>
- &s.code;char *xf86GetOptValString(OptionInfoPtr table, int token)&e.code;
+ &s.code;char *xf86GetOptValString(const OptionInfoRec *table, int token)&e.code;
<quote><p>
Returns the &s.code;value.str&e.code; field of the
&s.code;OptionInfoRec&e.code; in &s.code;table&e.code; with a
@@ -2591,7 +2591,7 @@ Next, the higher level functions that most drivers would use.
</quote>
- &s.code;Bool xf86GetOptValInteger(OptionInfoPtr table, int token,
+ &s.code;Bool xf86GetOptValInteger(const OptionInfoRec *table, int token,
&f.indent;int *value)&e.code;
<quote><p>
Returns via &s.code;*value&e.code; the &s.code;value.num&e.code;
@@ -2604,7 +2604,7 @@ Next, the higher level functions that most drivers would use.
</quote>
- &s.code;Bool xf86GetOptValULong(OptionInfoPtr table, int token,
+ &s.code;Bool xf86GetOptValULong(const OptionInfoRec *table, int token,
&f.indent;unsigned long *value)&e.code;
<quote><p>
Like &s.code;xf86GetOptValInteger()&e.code;, except the value is
@@ -2612,7 +2612,7 @@ Next, the higher level functions that most drivers would use.
</quote>
- &s.code;Bool xf86GetOptValReal(OptionInfoPtr table, int token,
+ &s.code;Bool xf86GetOptValReal(const OptionInfoRec *table, int token,
&f.indent;double *value)&e.code;
<quote><p>
Like &s.code;xf86GetOptValInteger()&e.code;, except that
@@ -2620,7 +2620,7 @@ Next, the higher level functions that most drivers would use.
</quote>
- &s.code;Bool xf86GetOptValFreq(OptionInfoPtr table, int token,
+ &s.code;Bool xf86GetOptValFreq(const OptionInfoRec *table, int token,
&f.indent;OptFreqUnits expectedUnits, double *value)&e.code;
<quote><p>
Like &s.code;xf86GetOptValInteger()&e.code;, except that the
@@ -2636,7 +2636,7 @@ Next, the higher level functions that most drivers would use.
</quote>
- &s.code;Bool xf86GetOptValBool(OptionInfoPtr table, int token, Bool *value)&e.code;
+ &s.code;Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value)&e.code;
<quote><p>
This function is used to check boolean options
(&s.code;OPTV_BOOLEAN&e.code;). If the function return value is
@@ -2654,7 +2654,7 @@ Next, the higher level functions that most drivers would use.
</quote>
- &s.code;Bool xf86ReturnOptValBool(OptionInfoPtr table, int token, Bool def)&e.code;
+ &s.code;Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def)&e.code;
<quote><p>
This function is used to check boolean options
(&s.code;OPTV_BOOLEAN&e.code;). If the option is set, its value
@@ -5774,7 +5774,15 @@ programming the standard VGA registers, and for handling VGA colourmaps.
&s.code;hwp&e.code; with the standard VGA set of functions. This
is called by &s.code;vgaHWGetHWRec()&e.code;, so there is usually
no need to call this explicitly. The register access functions
- are described below.
+ are described below. If the registers are shadowed in some other
+ port I/O space (for example a PCI I/O region), these functions
+ can be used to access the shadowed registers if
+ &s.code;hwp-&gt;PIOOffset&e.code; is initialised with
+ &s.code;offset&e.code;, calculated in such a way that when the
+ standard VGA I/O port value is added to it the correct offset into
+ the PIO area results. This value is initialised to zero in
+ &s.code;vgaHWGetHWRec()&e.code;. (Note: the PIOOffset functionality
+ is present in XFree86 4.1.0 and later.)
</quote>
@@ -5861,6 +5869,20 @@ programming the standard VGA registers, and for handling VGA colourmaps.
</quote>
+ &s.code;void vgaHWEnable(vgaHWPtr hwp)&e.code;
+ <quote><p>
+ This function enables the VGA subsystem. (Note, this function is
+ present in XFree86 4.1.0 and later.).
+
+ </quote>
+
+ &s.code;void vgaHWDisable(vgaHWPtr hwp)&e.code;
+ <quote><p>
+ This function disables the VGA subsystem. (Note, this function is
+ present in XFree86 4.1.0 and later.).
+
+ </quote>
+
&s.code;void vgaHWSave(ScrnInfoPtr pScrn, vgaRegPtr save, int flags)&e.code;
<quote><p>
This function saves the VGA state. The state is written to the
@@ -6188,6 +6210,20 @@ programming the standard VGA registers, and for handling VGA colourmaps.
Return the value read from the DAC Data register.
</quote>
+
+ &s.code;CARD8 readEnable(vgaHWptr hwp)&e.code;
+ <quote><p>
+ Return the value read from the VGA Enable register. (Note: This
+ function is present in XFree86 4.1.0 and later.)
+
+ </quote>
+
+ &s.code;void writeEnable(vgaHWPtr hwp, CARD8 value)&e.code;
+ <quote><p>
+ Write &s.code;value&e.code; to the VGA Enable register. (Note: This
+ function is present in XFree86 4.1.0 and later.)
+
+ </quote>
</quote>
<sect>Some notes about writing a driver<label id="sample">
@@ -6409,6 +6445,7 @@ typedef struct {
Bool noAccel;
Bool hwCursor;
CloseScreenProcPtr CloseScreen;
+ OptionInfoPtr Options;
...
} ZZZRec, *ZZZPtr;
</code>
@@ -6425,15 +6462,13 @@ typedef enum {
OPTION_NOACCEL
} ZZZOpts;
-static OptionInfoRec ZZZOptions[] = {
+static const OptionInfoRec ZZZOptions[] = {
{ OPTION_FOO_HACK, "FooHack", OPTV_INTEGER, {0}, FALSE },
{ OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
-
-#define nZZZOptions (sizeof(ZZZOptions) / sizeof(ZZZOptions[0]))
</code>
<p>
</itemize>
@@ -6721,8 +6756,6 @@ ZZZProbe(DriverPtr drv, int flags)
static Bool
ZZZPreInit(ScrnInfoPtr pScrn, int flags)
{
- OptionInfoRec options[nZZZOptions];
-
/* Fill in the monitor field */
pScrn->monitor = pScrn->confScreen->monitor;
@@ -6801,10 +6834,14 @@ ZZZPreInit(ScrnInfoPtr pScrn, int flags)
/*
* Process the options based on the information in ZZZOptions.
- * The results are written to options.
+ * The results are written to pZzz->Options. If all of the options
+ * processing is done within this function a local variable "options"
+ * can be used instead of pZzz->Options.
*/
- (void)memcpy(options, ZZZOptions, sizeof(ZZZOptions));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
+ if (!(pZzz->Options = xalloc(sizeof(ZZZOptions))))
+ return FALSE;
+ (void)memcpy(pZzz->Options, ZZZOptions, sizeof(ZZZOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pZzz->Options);
/*
* Set various fields of ScrnInfoRec and/or ZZZRec based on
@@ -6812,25 +6849,25 @@ ZZZPreInit(ScrnInfoPtr pScrn, int flags)
*/
from = X_DEFAULT;
pZzz->hwCursor = FALSE;
- if (xf86IsOptionSet(options, OPTION_HW_CURSOR)) {
+ if (xf86IsOptionSet(pZzz->Options, OPTION_HW_CURSOR)) {
from = X_CONFIG;
pZzz->hwCursor = TRUE;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pZzz->hwCursor ? "HW" : "SW");
- if (xf86IsOptionSet(options, OPTION_NOACCEL)) {
+ if (xf86IsOptionSet(pZzz->Options, OPTION_NOACCEL)) {
pZzz->noAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Acceleration disabled\n");
} else {
pZzz->noAccel = FALSE;
}
- if (xf86IsOptionSet(options, OPTION_PCI_RETRY)) {
+ if (xf86IsOptionSet(pZzz->Options, OPTION_PCI_RETRY)) {
pZzz->UsePCIRetry = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n");
}
pZzz->fooHack = 0;
- if (xf86GetOptValInteger(options, OPTION_FOO_HACK,
+ if (xf86GetOptValInteger(pZzz->Options, OPTION_FOO_HACK,
&amp;pZzz->fooHack)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Foo Hack set to %d\n",
pZzz->fooHack);
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml
index 392439d35..2630b2336 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml
@@ -10,10 +10,10 @@
<author>
<htmlurl url="http://www.valinux.com/"
name="VA Linux Systems, Inc."> Professional Services - Graphics.
- <date>15 March 2001
+ <date>15 June 2001
<ident>
- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.21 2001/04/10 16:07:58 dawes Exp $
+ $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.24 2001/05/19 00:42:22 dawes Exp $
</ident>
<toc>
@@ -129,22 +129,23 @@
<item>i810-dc100
<item>i810e
</itemize>
- <item>ATI Rage 128, supported on Intel x86 and AMD:
+ <item>ATI Rage 128, supported on Intel x86, AMD and Alpha:
<itemize>
- <item>Rage Fury AGP
- <item>Rage Magnum AGP
- <item>XPERT 2000 AGP
- <item>XPERT 128 AGP
- <item>XPERT 99 AGP
- <item>All-in-Wonder 128 AGP
+ <item>Rage Fury
+ <item>Rage Magnum
+ <item>XPERT 2000
+ <item>XPERT 128
+ <item>XPERT 99
+ <item>All-in-Wonder 128
+ <item>Rage 128 PCI (Alpha-based systems)
</itemize>
- The PCI versions of these cards also have minimal support.
- Note that there are Rage 128 Pro boards on the market but they're
- not yet supported.
- <item>ATI Radeon, supported on Intel x86 and AMD:
+ Note that both PCI and AGP versions of Rage 128 based cards
+ are supported at this time.
+ <item>ATI Radeon, supported on Intel x86, AMD and Alpha:
<itemize>
<item>Radeon SDR AGP
<item>Radeon DDR AGP
+ <item>Radeon 32MB SDR PCI (Alpha-based systems)
</itemize>
<item>3Dlabs, supported on Intel x86 and AMD:
<itemize>
@@ -678,7 +679,7 @@
<sect1>3dfx Banshee, Voodoo3, Voodoo4 and Voodoo5 Series
<p>
- <sect2>Dependencies
+ <sect2>Requirements
<p>
The 3dfx DRI driver requires special versions of the 3dfx Glide
library.
@@ -792,7 +793,7 @@
32bpp mode is fully 3D accelerated.
</itemize>
- <sect2>Performance
+ <sect2>Performance and Features
<p>
<itemize>
<item>
@@ -874,6 +875,9 @@
<item>
The lowest mipmap level is sometimes miscolored in trilinear-
sampled polygons.
+ <item>
+ The GL_EXT_texture_env_combine extension is supported on the
+ Voodoo4 and Voodoo5.
</itemize>
<sect2>Known Problems
@@ -900,13 +904,10 @@
<sect1>Intel i810
<p>
- <sect2>Dependencies
+ <sect2>Requirements
+<p>
+ A kernel with AGP GART support (such as Linux 2.4.x) is needed.
<p>
- A Linux kernel with AGP GART support is required.
- The 2.2.x kernel series does not have AGP GART support.
- The 2.4.x test kernels have AGP GART and have been tested
- with the i810.
- <p>
<sect2>Configuration
<p>
@@ -966,15 +967,29 @@
rendering will be disabled.
</itemize>
+ <sect2>Performance and Features
+<p>
+ Basically all of the i810 features which can be exposed through
+ OpenGL 1.2 are implemented.
+ However, the following OpenGL features are implemented in software
+ and will be slow:
+ <itemize>
+ <item>Stencil buffer and accumulation buffer operations
+ <item>Blend subtract, min/max and logic op blend modes
+ <item>glColorMask when any mask is set to false
+ <item>GL_SEPARATE_SPECULAR_COLOR lighting mode
+ <item>glDrawBuffer(GL_FRONT_AND_BACK)
+ <item>Using 1D or 3D textures
+ <item>Using texture borders
+ </itemize>
<p>
<sect1>Matrox G200 and G400
<p>
- <sect2>Dependencies
+ <sect2>Requirements
+<p>
+ A kernel with AGP GART support (such as Linux 2.4.x) is needed.
<p>
- A Linux kernel with AGP GART support (such as the 2.4.x test
- kernels) is needed.
- <p>
<sect2>Configuration
<p>
Your XF86Config file's device section must specify the
@@ -1028,7 +1043,7 @@
<tt>/usr/X11R6/lib/modules/dri/mga_dri.so</tt>.
This will be automatically loaded by libGL.so.
- <sect2>Performance
+ <sect2>Performance and Features
<p>
Software rendering will be used under any of the
following conditions:
@@ -1048,7 +1063,7 @@
on your motherboard.
<p>
- Compaq has funded the implementation of AGP acclerated
+ Compaq has funded the implementation of AGP accelerated
ReadPixels and DrawPixels in this driver. With this
implementation, on a G400 drawing directly from AGP memory
(exported to the client), throughput of up to 1 GB/sec has
@@ -1126,11 +1141,10 @@
<sect1>ATI Rage 128
<p>
- <sect2>Dependencies
+ <sect2>Requirements
+<p>
+ A kernel with AGP GART support (such as Linux 2.4.x) is needed.
<p>
- A Linux kernel with AGP GART support (such as the 2.4.x test
- kernels) is needed.
- <p>
<sect2>Configuration
<p>
Your XF86Config file's device section must specify the
@@ -1175,7 +1189,7 @@
You may also set your screen depth to 32 for 32bpp mode.
<p>
- <sect2>Performance
+ <sect2>Performance and Features
<p>
While PCI Rage 128 based cards are supported, they do not yet
support PCI GART, so they will not perform as well as their
@@ -1185,7 +1199,20 @@
used by default.
Higher AGP speeds may result in unreliable performance depending
on your motherboard.
-
+<p>
+ Note that even at 32bpp there is no alpha channel.
+<p>
+ The following OpenGL features are implemented in software and
+ will be slow:
+ <itemize>
+ <item>Stencil buffer and accumulation buffer operations
+ <item>Blend subtract, min/max and logic op blend modes
+ <item>GL_SEPARATE_SPECULAR_COLOR lighting mode
+ <item>glDrawBuffer(GL_FRONT_AND_BACK)
+ <item>Using 1D or 3D textures
+ <item>Using texture borders
+ </itemize>
+<p>
<sect2>Known Problems
<p>
If you experience stability problems you may try setting the
@@ -1197,11 +1224,10 @@
<sect1>ATI Radeon
<p>
- <sect2>Dependencies
+ <sect2>Requirements
+<p>
+ A kernel with AGP GART support (such as Linux 2.4.x) is needed.
<p>
- A Linux kernel with AGP GART support (such as the 2.4.x test
- kernels) is needed.
- <p>
<sect2>Configuration
<p>
Your XF86Config file's device section must specify the
@@ -1245,7 +1271,7 @@
You may also set your screen depth to 32 for 32bpp mode.
<p>
- <sect2>Performance
+ <sect2>Performance and Features
<p>
While this driver supports many of the features of ATI Radeon
cards, we do not <em/yet/ fully support the card's TCL
@@ -1254,11 +1280,38 @@
The AGP mode may be set to 1, 2, or 4. One is used by default.
Higher AGP speeds may result in unreliable performance depending
on your motherboard.
-
+<p>
+ The following OpenGL features are implemented in software and will
+ be slow:
+ <itemize>
+ <item>Blend subtract, blend min/max and blend logicops
+ <item>Stencil and accumulation operations
+ <item>1D and 3D textures
+ <item>Texture borders
+ </itemize>
+<p>
+ The GL_EXT_texture_env_combine, GL_EXT_texture_env_add and
+ GL_EXT_texture_env_dot3 extensions are supported (or will be
+ soon supported in the new driver based on Mesa 3.5).
+<p>
+ We hope to implement support for the following features in the
+ future:
+ <itemize>
+ <item>Vertex transformation, clipping and lighting (TCL)
+ <item>Hardware stencil buffer
+ <item>Cube map textures
+ <item>3D textures
+ <item>Three texture units
+ </itemize>
+<p>
<sect2>Known Problems
<p>
- None.
-
+ Certain (early?) revisions of the AMD Irongate chipset have
+ AGPGART problems which effect Radeon, and other graphics cards.
+ The card may work unreliably, or not work at all. If the DRM
+ kernel module is not loaded, the 2D Xserver may work. There's
+ hope that this can be fixed in the future.
+<p>
<sect1>3DLabs Oxygen GMX 2000
<p>
@@ -1274,7 +1327,7 @@
overlays, stereo, hardware-accelerated indirect rendering.
<p>
OpenGL-like functionality is provided with the Mesa library.
- XFree86 4.0.2 uses Mesa 3.4.
+ XFree86 4.1.0 uses Mesa 3.4.2.
Subsequent releases of XFree86 will use newer versions of Mesa.
When newer versions of Mesa are available, the 3D drivers can
be updated without reinstalling XFree86 or libGL.so.
@@ -1369,8 +1422,8 @@
<p>
A collection of useful configuration files, libraries, headers,
utilities and demo programs is available from
- <htmlurl url="http://dri.sourceforge.net/resources/resources.html"
- name="http://dri.sourceforge.net/resources/resources.html">
+ <htmlurl url="http://dri.sourceforge.net/res.phtml"
+ name="http://dri.sourceforge.net/res.phtml">
<sect1>Documentation
<p>
@@ -1385,7 +1438,8 @@
<item>Visit the <htmlurl url="http://dri.sourceforge.net"
name="DRI project on SourceForge.net"> for the latest development
news about the DRI and 3D drivers.
- <item>The <htmlurl url="http://dri.sourceforge.net/DRIcompile.html"
+ <item>The <htmlurl
+ url="http://dri.sourceforge.net/doc/DRIcompile.html"
name="DRI Compilation Guide"> explains how to download, compile
and install the DRI for yourself.
</itemize>
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml
index f77dce508..75dc89bd9 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml
@@ -10,10 +10,10 @@
<author>
<htmlurl url="http://www.valinux.com/"
name="VA Linux Systems, Inc."> Professional Services - Graphics.
- <date>15 March 2001
+ <date>21 April 2001
<ident>
- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.13 2001/04/05 19:29:42 dawes Exp $
+ $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.14 2001/05/02 15:06:08 dawes Exp $
</ident>
<toc>
@@ -175,7 +175,8 @@
<item>hit ESC to return to the top-level menu
<item>Go to <em>Character devices</em>
<item>Disable <em>Direct Rendering Manager (XFree86 DRI support)</em>
- since we'll use the DRI module from the XFree86/DRI tree.
+ since we'll use the DRI code from the XFree86/DRI tree and will
+ compile it there.
<item>Go to <em>/dev/agpgart (AGP Support) (EXPERIMENTAL) (NEW)</em>
<item>Hit SPACE twice to build AGP support into the kernel
<item>Enable all chipsets' support for AGP
@@ -503,7 +504,7 @@
<tt>/usr/src/linux-2.4.x</tt>,
<verb>
cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
- make TREE=/usr/src/linux-2.4
+ make TREE=/usr/src/linux-2.4.x/include
</verb>
or alternatively, edit Makefile to include this change.
<p>
@@ -516,7 +517,7 @@
The DRI kernel modules are in
<tt>~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/</tt>.
<p>
- To load the appropriate DRI module in your running kernel you can
+ To load the appropriate DRM module in your running kernel you can
either use ismod and restart your X server or copy the kernel module
to <tt>/lib/modules/2.4.x/kernel/drivers/char/drm/</tt> then run
depmod and restart your X server.
@@ -524,6 +525,9 @@
Make sure you first unload any older DRI kernel modules that might
be already loaded.
<p>
+ Note that some DRM modules require that the <tt>agpgart</tt> module
+ be loaded first.
+ <p>
<sect>Normal Installation and Configuration <p>
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml
index 17003440d..1659fc89b 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml
@@ -5,10 +5,10 @@
<article>
<title>XFree86 on Darwin and Mac OS X
<author>Torrey T. Lyons
-<date>11 December 2000
+<date>25 May 2001
<ident>
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml,v 1.4 2000/12/12 18:54:29 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml,v 1.4.4.2 2001/06/02 04:44:37 torrey Exp $
</ident>
<toc>
@@ -19,8 +19,7 @@ $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml,v 1.4 2000/12/12 1
implementation of X Windows, has been ported to <htmlurl
url="http://www.publicsource.apple.com/projects/darwin/" name="Darwin">
and <htmlurl url="http://www.apple.com/macosx/" name="Mac OS X">. This
-document is
-a collection of information for anyone
+document is a collection of information for anyone
experimenting with running X Windows on Apple's next generation operating
system. Please send any comments on this page to
<email/torrey@mrcla.com/. If you are also
@@ -28,21 +27,36 @@ working on modifications to the Darwin X server, please let me know.
<sect>Hardware Support and Configuration
<p>
-The Darwin port of XFree86 uses the IOKit for device driver loading
-and discovery, rather than the XFree86 module loader. Because of this,
-the XFree86 configuration file is not used on Darwin systems. The
-descriptions found elsewhere of devices supported by XFree86 for other
-operating systems also do not apply.
-
-<p>
-XFree86 for Darwin will work with any video card that you have an
-IOKit driver for. If you are running Mac OS X, this typically means
-any card that has been shipped by Apple. If a card works for you with
-the Mac OS X GUI, it will work on the same machine with XFree86. If
-you have a pure Darwin installation, your hardware support may be
-somewhat limited because Apple does not include all its hardware
-drivers with Darwin. IOKit drivers are typically found in
-/System/Library/Extensions/ or /Library/Extensions/.
+XFree86 can be run either from the console or side by side with
+Mac OS&nbsp;X's Aqua desktop in a full screen mode. In full screen mode
+with Aqua, when the X window system is active, it takes over the entire
+screen. You can switch back to the Mac OS&nbsp;X desktop by holding down
+Command-Option-A. This key combination can be changed in the user
+preferences. From the Mac OS&nbsp;X desktop, just click on the XDarwin
+icon in the floating switch window to switch back to the X window system.
+You can change this behavior in the user preferences so that clicking on
+the XDarwin icon in the Dock switches as well. The full screen cooperative
+mode with Aqua is known as Quartz mode, named after the Quartz 2D
+compositing engine used by Aqua.
+
+<p>
+From the console, the Darwin port of XFree86 uses the IOKit for device
+driver loading and discovery, rather than the XFree86 module loader.
+Because of this, the XFree86 configuration file is not used on Darwin
+or Mac OS&nbsp;X systems. The descriptions found elsewhere of devices
+supported by XFree86 for other operating systems also do not apply.
+Running XFree86 from the text console is known as IOKit mode.
+
+<p>
+XFree86 for Darwin or Mac OS&nbsp;X will work with any video card that
+you have an IOKit driver for. If you are running Mac OS&nbsp;X, this
+typically means any card that has been shipped by Apple. If a card works
+for you with the Mac OS&nbsp;X GUI, it will work on the same machine with
+XFree86. If you have a pure Darwin installation, you may need to download
+additional third-party drivers from
+<htmlurl url="http://www.publicsource.apple.com/projects/darwin/"
+name="Apple's Darwin site">. IOKit drivers are typically installed in
+<tt>/System/Library/Extensions/</tt> or <tt>/Library/Extensions/</tt>.
<p>
Multi-button and scroll wheel mouse support works well with all
@@ -53,42 +67,27 @@ mice.
<p>
Following are instructions for building and running your own copy of
XFree86. The procedure for getting your X server up and running on
-Darwin and Mac OS X are very similar, but it is actually somewhat more
-difficult on Mac OS X. Where there are differences I have noted them
-below. Both Mac OS&nbsp;X Developers' Preview 4 and Mac OS&nbsp;X
-Public Beta are covered. Note that to build XFree86 for yourself on
-Mac OS&nbsp;X Beta, you will need to have the Developers' Tools. If
-you did not receive these as a member of ADC, they are available for
-download from the <htmlurl url="http://www.apple.com/developer/"
-name="Apple Developer Connection">.
+Darwin and Mac OS&nbsp;X are very similar. Where there are differences
+I have noted them below. Note that to build XFree86 for yourself on
+Mac OS&nbsp;X, you will need to install the Developers' Tools.
<p>
-If you want to save some time, you can use the precompiled binaries
-provided by the XFree86 server at <url
+If you don't feel the need to live on the cutting edge, you can save
+some time and effort by using the precompiled binaries available on
+the XFree86 FTP server at <url
url="ftp://ftp.xfree86.org/pub/XFree86/&relvers;/binaries/Darwin/">.
Follow the instructions in the <htmlurl
url="http://www.xfree86.org/&relvers;/Install.html" name="Install">
-document to install it.
-
-<p>
-This will create two new directory trees, <tt>/usr/X11R6</tt> and
-<tt>/private/etc/X11</tt>. If you have the developers' tools, you may
-have to run ranlib on all the libraries in <tt>/usr/X11R6/lib/*</tt>
-before trying to build other X applications.
+document to install it. This will create two new directory trees,
+<tt>/usr/X11R6</tt> and <tt>/etc/X11</tt> For Mac OS&nbsp;X Quartz
+support, download the optional Xquartz.tgz tarball.
<p>
If you get the precompiled binaries you can skip ahead to the section
-on <ref id="running" name="running X windows">
-
-<p>
-On the other hand, if you want to build things yourself from scratch,
+on <ref id="running" name="running the X window system"> On the other hand,
+if you want to build things yourself from scratch,
follow the directions below.
-<p>
-If you want to recompile the X server on Mac OS X, you will have to
-make the header files as described <ref id="makeHeaders"
-name="below">.
-
<sect1> Get the Code
<p>
@@ -96,11 +95,11 @@ The first thing you need to do is to get the source code from the
XFree86 project.
<itemize>
-<item> Setup CVS: Both Darwin and Mac OS X include CVS (Concurrent
+<item> Setup CVS: Both Darwin and Mac OS&nbsp;X include CVS (Concurrent
Versions System), which is an easy way to download and keep up to date
with open source code released by XFree86 and others. You do have to
setup CVS properly, however, to tell it where to look. Follow the
-instructions <htmlurl url="http://www.xfree86.org/cvs/" name="here"> on
+<htmlurl url="http://www.xfree86.org/cvs/" name="XFree86 instructions"> on
how to do this either via ssh or via the cvs pserver.
<item> Now make a directory in some convenient place which will serve
@@ -117,24 +116,6 @@ Wait for all the files to complete downloading.
</itemize>
-<sect1>Make Header Files for Mac OS X<label id="makeHeaders">
-<p>
-
-These next steps are not necessary if you are building XFree86 on
-Darwin. Mac OS X Beta or DP4 does not include many of the
-&quot;in-progress&quot; header files that are needed to successfully
-build XFree86. The general philosophy is that at any given time, Mac
-OS X will include only headers files that are &quot;ready for prime
-time&quot; while Darwin will include a snapshot of Apple's current
-efforts. So if you have access to a Darwin system, I would suggest
-using this instead of Mac OS X to build XFree86. If you don't, read
-the appropriate page below for an outline of what you need to do:
-
-<itemize>
-<item><ref id="headersXBeta" name="Mac OS&nbsp;X Public Beta">
-<item><ref id="headersXDP4" name="Mac OS&nbsp;X Developers' Preview 4">
-</itemize>
-
<sect1> Build XFree86
<p>
Once you have everything ready it is easy to build and install
@@ -146,47 +127,43 @@ make World >& world.log
(wait for several hours)
-su root
-make install >& install.log
-make install.man >& man.log
+sudo make install >& install.log
+sudo make install.man >& man.log
</verb></tscreen>
-<sect>Run X Windows<label id="running">
+<sect>Run the X Window System<label id="running">
<p>
-You will want to add the X windows executables to your path. Your path
+You will want to add the X window executables to your path. Your path
is the list of directories to be searched when you type a command. You
will also want to add the man pages from XFree86 to the list of pages
to be searched when you are looking for documentation. The way to do
this depends on the shell you are using. With tcsh or csh add the
-following two lines to a file in your home directory called <tt/.cshrc/
-(create this file if you don't have one yet):
+following two lines to a file named
+<tt>~/Library/init/tcsh/path</tt>: (You may need to create this file and
+directory path if it does not exist already.)
+
<tscreen><verb>
-setenv MANPATH "${MANPATH}:/usr/X11R6/man:/usr/local/man"
setenv PATH "${PATH}:/usr/X11R6/bin"
+setenv MANPATH "${MANPATH}:/usr/X11R6/man"
</verb></tscreen>
-Now type ``<tt>source ~/.cshrc;rehash</tt>'' to
-get these changes to take effect. On future logins, this file will be
+The next time you login or open a Terminal window, this file will be
executed automatically.
<p>
-You are now ready to go. On Mac OS X, you have to do a few extra steps
-each time you want to run X windows. You can't run XFree86 with
-CoreGraphics running since they both want to control the screen. So
-for Mac OS X you first need to logout. Then for Mac OS X DP4, from the
-login window type ``console'' as the user name and push
-login. For Mac OS X Beta, type ``&gt;console'' as the user
-name. This should shutdown CoreGraphics and bring you up with a text
-console. Login again.
+You are now ready to go. On Mac OS&nbsp;X, you can run XFree86 from the
+text console or in full screen mode with Aqua. To get to the text
+console in Mac OS&nbsp;X you need to logout and type ``&gt;console'' as
+the user name. This will shutdown Core Graphics and
+bring up the console login prompt. Login again as your user.
<p>
-Now from the text console you can start X Windows in either Darwin or
-Mac OS X by typing ``startx''. After a brief wait at least one terminal
-window should pop up for you. So far it probably isn't very impressive
-as you might not even have a window manager running to allow you to
-move windows around.
+From the text console you can start the X Window System by typing ``startx''.
+After a brief wait at least one terminal window should pop up for you.
+So far it probably isn't very impressive as you might not even have a
+window manager running to allow you to move windows around.
<p>
-When you are ready to quit X windows type ``exit'' in the main
+When you are ready to quit XFree86 type ``exit'' in the main
terminal window or quit with the window manager if you have one
running. Unfortunately the X server won't shutdown correctly and you
will get an apparently frozen screen with only a spinning beachball
@@ -194,25 +171,36 @@ cursor on it. Nothing you type shows up on the screen, but in fact
your keystrokes are being received by the console. Type
``logout'' to return to normalcy after a brief delay. With
Darwin this should put you back at the text console login prompt. With
-Mac OS X, CoreGraphics will restart and you should be given a login
+Mac OS&nbsp;X, Core Graphics will restart and you should be given a login
window.
<p>
+To start XFree86 in Quartz mode you can launch the XDarwin application
+in the <tt>/Applications</tt> folder, or from the command line type
+``startx -- -quartz''. When the X window system is active, it takes over
+the entire screen. You can switch back to the Mac OS&nbsp;X desktop by
+holding down Command-Option-A. This key combination can be changed in
+the user preferences. From the Mac OS&nbsp;X desktop, just click on the
+XDarwin icon in the floating switch window to switch back to the X window
+system. You can change this behavior in the user preferences so that
+clicking on the XDarwin icon in the Dock switches as well.
+
+<p>
<bf/Customize X Windows/
<p>
-X windows is very customizable and you will certainly want to change
-some things. There is a lot you can do to control how your windows
+The X window system is very customizable and you will certainly want to
+change some things. There is a lot you can do to control how your windows
look, how the windows are moved, resized, etc. You will likely want to
get a better window manager than twm, which is included with
XFree86. The <tt>.xinitrc</tt> file in your home directory controls what
-programs are run when you start X windows. You can find a sample
-<tt>.xinitrc</tt> file in <tt>/private/etc/X11/xinit/xinitrc</tt>.
+programs are run when you start the X window system. You can find a sample
+<tt>.xinitrc</tt> file in <tt>/etc/X11/xinit/xinitrc</tt>.
<p>
-There are several
-window managers that have been ported to Darwin. The best collection
-of window managers and other X windows applications is at <htmlurl
+There are several window managers that have been ported to Darwin.
+The best collection of window managers and other X window clients
+is at <htmlurl
url="http://www.darwinfo.org/ports.shtml#X Windows" name="Darwinfo's ports
page">. Another good place to look for Darwin ports in general is at
<htmlurl
@@ -230,195 +218,21 @@ let me know if you are interested in working on any of these issues.
<bf/Things that are broken:/
<itemize>
-<item>The bell is broken.
+<item>The bell does not work in IOKit mode.
-<item>Server shutdown problem: After quitting the X server the colored
-beachball cursor reappears, but the screen never returns to the
+<item>Server shutdown problem: After quitting the X server in IOKit mode,
+the colored beachball cursor reappears, but the screen never returns to the
console display. The console is accepting input however, so typing
``logout'' will return you to the login prompt.
<item>Only one display is currently supported.
-<item>Screen saver not supported.
+<item>The display mode can not be changed once the X server
+has started.
-<item>Key repeat rate can not be adjusted.
-</itemize>
+<item>A screen saver is not supported.
-<bf/Things I am working on:/
-<itemize>
-<item> Allowing rootless use on Mac OS X
-<item> Correct wake from sleep behavior
</itemize>
-<sect>Appendix
-
-<sect1>Installing IOKit Header files on Mac OS X Beta<label
- id="headersXBeta">
-<p>
-Here is what you need to do to be able to build XFree86 (or other
-clients of IOGraphics services) on Mac OS X Public Beta.
-<enum>
-
-<item>You need to install some more build tools that aren't included
-in Mac OS X Beta, but are included in Darwin. These are needed for the
-next step. Go to your development directory and type:
-<tscreen><verb>
-cvs checkout bootstrap_cmds
-cd bootstrap_cmds
-make
-</verb></tscreen>
-Now su to root and do a ``make install'' from the bootstrap_cmds
-directory.
-
-<item>
-The IOKit framework included with Mac OS X Beta is a little on the
-wimpy side, even after installing the Developer Tools. You'll need to
-rebuild it, but to do so safely we'll take advantage of the cool
-directory structure of Mac OS X and put the new version in
-/Library/Frameworks/. This will override the version in
-/System/Library/Frameworks/. Or at least, that's where you should put
-it using the new Mac OS X Beta file structure, but in fact the
-compiler doesn't know this and still looks in
-/Local/Library/Frameworks. (I have already filed a developer's bug
-report on this.) To start we make a copy of the original. Login as
-root and do the following:
-<tscreen><verb>
-cd /Library
-mkdir -p Frameworks
-cp -R /System/Library/Frameworks/IOKit.framework Frameworks/IOKit.framework
-cd /
-mkdir -p Local
-ln -s /Library /Local/Library
-</verb></tscreen>
-
-<item>Now you need to get a full version of the IOKit framework from
-the Darwin repository. This comes as part of the kernel. So, in your
-development directory again:
-
-<tscreen><verb>
-cvs checkout xnu
-cd xnu
-source SETUP/setup.csh
-make exporthdrs
-make install
-</verb></tscreen>
-
-The "make install" will start by assembling all the headers you need,
-but then will proceed to build a new kernel. You can Control-C out of
-the build once it starts compiling things if you want. Otherwise, just
-be patient.
-
-<item>
-You also need to get the IOKitUser project, which contains the user
-interface to the IOKit, and merge it into the IOKit framework. From
-your development directory type:
-<tscreen><verb>
-cvs checkout IOKitUser
-</verb></tscreen>
-Then you need to change the Makefile so it builds on top of the new
-IOKit framework you are building. Change to the IOKitUser project
-directory and edit the Makefile. Change the following line:
-<tscreen><verb>
-NEXTSTEP_BUILD_OUTPUT_DIR = /$(USER)/build/$(NAME)
-</verb></tscreen>
-to:
-<tscreen><verb>
-NEXTSTEP_BUILD_OUTPUT_DIR = <your xnudir>/BUILD/dst/System/Library/Frameworks
-</verb></tscreen>
-
-Now, run ``make'' while in the IOKitUser directory. It will likely not
-finish building since the IOKitUser project relies on some stuff that
-Apple hasn't really made public yet, but it should finish populating
-the new IOKit framework with headers and start compiling. (Strangely
-enough, the headers installed in your new IOKit framework don't contain
-the real header files. They are just single line files with an #import
-of the file in your IOKitUser project. This works fine as long as you
-don't ever delete or move your IOKitUser project. I imagine that using
-``make install'' would fix this up, but you can't do this as long as the
-project doesn't build correctly. So for now you can either move the
-header files by hand, or make sure you leave your IOKitUser project in
-place.)
-
-<item>
-Now put the new IOKit headers into our local copy. Change to the xnu
-project directory and do the following as root:
-<tscreen><verb>
-cd BUILD/dst/System/Library/Frameworks/
-cp -R IOKit.framework/Versions/A/Headers/* \
- /Library/Frameworks/IOKit.framework/Versions/A/Headers
-</verb></tscreen>
-
-<item>
-The System framework needs touching up a bit too. You need to copy the
-libkern header files from the new System.framework. As root, go to the
-xnu project directory and type: (Of course you could make a local copy
-of the System framework in /Library/Frameworks/, but the additions to
-the System framework are small.)
-<tscreen><verb>
-cd BUILD/dst/System/Library/Frameworks/System.framework/Versions/B/Headers
-cp -R libkern /System/Library/Frameworks/System.framework/Headers/libkern
-</verb></tscreen>
-</enum>
-
-<sect1>Installing IOKit Header files on Mac OS X DP4<label
-id="headersXDP4">
-<p>
-Here is an outline of what you need to do to be able to build XFree86
-(or other clients of IOGraphics services) on Mac OS X Developers'
-Preview 4.
-
-<enum>
-
-<item>Checkout, build, and install bootstrap_cmds from the CVS
-repository.
-<item>Checkout xnu from the CVS repository. Go to sandbox/xnu and do
-the following:
-<tscreen><verb>
-source SETUP/setup.csh
-make exporthdrs
-</verb></tscreen>
-<item>su to root and do the following:
-<tscreen><verb>
-mkdir -p /Local/Library/Frameworks
-cp -R /System/Library/Frameworks/IOKit.framework /Local/Library/Frameworks
-</verb></tscreen>
-This will create a new local version of the IOKit framework that will
-override the System version without changing the original.
-
-<item>You now want to merge the IOKit headers from the xnu project
-into your local IOKit framework. I did this fairly tediously by hand,
-but I would suggest something like:
-<tscreen><verb>
-cp -R sandbox/xnu/BUILD/dst/System/Library/Frameworks/IOKit.framework/Versions/A/Headers \
-/Local/Library/Frameworks/IOKit.framework/Versions/A
-</verb></tscreen>
-The only problem with this is that there are a few stub header files
-included that are just a single line with an #import to the
-appropriate place in the xnu source on your disk. This is fine as long
-as you don't move your xnu project. If you do, you can copy the
-original file to replace the stub. There is probably an easier way to
-automatically build a clean version of the IOKit framework, but I
-didn't find it. (Let me know if you do.)
-
-<item>There are just a few more files you need in the IOKit
-framework. Checkout the IO project from CVS. Get the necessary header
-files from there and put them in your new local IOKit
-framework. You'll get errors when you try to build XFree86 from which
-you can tell which files are needed. I also needed to make the
-following patch to IOLLEvent.h. Your mileage may vary.
-<tscreen><verb>
-47c47
-< #include <Kernel/libkern/OSTypes.h>
----
-> #include <libkern/OSTypes.h>
-</verb></tscreen>
-
-<item>You'll also need a few extra CoreFoundation header
-files. Checkout CoreFoundation. You can make a new local version of
-the CoreFoundation framework as above, or just add to the existing
-one. The files you need are CFMachPort.h and CFMessagePort.h in the
-RunLoop.subproj and CFStorage.h in Collections.subproj.
-</enum>
-
</article>
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile b/xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile
index c9b0477bb..334b798a9 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile
@@ -3,14 +3,23 @@ XCOMM $XConsortium: Imakefile /main/16 1996/10/28 05:13:04 kaleb $
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile,v 3.71 2001/03/02 02:45:37 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile,v 3.71.2.1 2001/06/01 18:09:48 dawes Exp $
#include <Server.tmpl>
#include <lnxdoc.rules>
+/* Set this to YES if the RELNOTES file is up to date */
+#ifndef BuildRelnotes
+#define BuildRelnotes NO
+#endif
+
+#if BuildRelnotes
+RELNOTES=RELNOTES.sgml
+#endif
+
SGMLDEPENDS = defs.ent
MANSGMLDEPENDS = mdefs.ent
- INDEXLIST = README.sgml RELNOTES.sgml Status.sgml LICENSE.sgml Install.sgml \
+ INDEXLIST = README.sgml $(RELNOTES) Status.sgml LICENSE.sgml Install.sgml \
DESIGN.sgml Versions.sgml \
mouse.sgml fonts.sgml DRI.sgml DRIcomp.sgml dps.sgml \
Darwin.sgml isc.sgml LynxOS.sgml NetBSD.sgml OpenBSD.sgml \
@@ -105,7 +114,9 @@ LinuxDocTarget(LICENSE)
LinuxDocTargetLong(QStart.sgml,QuickStart.doc,QuickStart)
#endif
LinuxDocTarget(README)
+#if BuildRelnotes
LinuxDocTarget(RELNOTES)
+#endif
LinuxDocTarget(Status)
/* Other docs */
@@ -149,6 +160,8 @@ clean::
FORMATTEDDIR = ..
+#if BuildRelnotes
/* Update RELNOTES at top level */
UpdateFormattedDoc(RELNOTES,$(TOP))
+#endif
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml
index c4b02d73d..97b5da3e3 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml
@@ -6,10 +6,10 @@
<title>Installation Details for XFree86&trade; &relvers;
<author>The XFree86 Project, Inc
-<date>15 December 2000
+<date>1 June 2001
<ident>
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.11 2001/03/02 17:40:48 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.11.2.2 2001/06/01 18:09:48 dawes Exp $
</ident>
<abstract>
@@ -80,14 +80,31 @@ for you to download. If you are careful with this step you will save
yourself a lot time and trouble from NOT downloading an incompatible
distribution.
-<bf>NOTE</bf>: the Xinstall.sh script must be downloaded in binary mode,
-otherwise it won't run correctly. If you get lots of "command not found"
-messages when you try to run it, then it is most likely because the
-script wasn't downloaded in binary mode. Some web browsers won't do
-this for files of that name, so we also have a copy of it called
-"<tt>Xinstall.bin</tt>", and most browsers should download that correctly.
-When downloading it under this name, select "save as" on your browser,
-and save the file under the name "<tt>Xinstall.sh</tt>".
+<bf>NOTES</bf>:
+
+<itemize>
+ <item>The Xinstall.sh script must be downloaded in binary mode,
+ otherwise it won't run correctly. If you get lots of "command
+ not found" messages when you try to run it, then it is most
+ likely because the script wasn't downloaded in binary mode.
+ Some web browsers won't do this for files of that name, so we
+ also have a copy of it called "<tt>Xinstall.bin</tt>", and most
+ browsers should download that correctly. When downloading it
+ under this name, select "save as" on your browser, and save the
+ file under the name "<tt>Xinstall.sh</tt>".
+
+ <item>The Xinstall.sh script requires some system commands and
+ utilities to function correctly. While most systems will have
+ these, some Linux installations may not. If you find that the
+ script is failing because of some missing system command, you
+ will need to install it before you can continue. If you don't
+ know how to do this, then we recommend that you obtain this
+ version of XFree86 from your Operating System distributor.
+
+ <item>Always use the version of the Xinstall.sh script that's provided
+ with the release you're installing. Older versions of the script
+ may not install newer releases correctly.
+</itemize>
Once you're run the <tt>Xinstall.sh</tt> script and found which binary
<![ %updaterel; [update ]]>distribution is suitable for your system,
@@ -98,27 +115,27 @@ will complain.
<![ %fullrel [
<quote><verb>
-1. Xinstall.sh The installer script
-2. extract The utility for extracting tarballs
-3. Xbin.tgz X clients/utilities and run-time libraries
-4. Xlib.tgz Some data files required at run-time
-5. Xman.tgz Manual pages
-6. Xdoc.tgz XFree86 documentation
-7. Xfnts.tgz Base set of fonts
-8. Xfenc.tgz Base set of font encoding data
-9. Xetc.tgz Run-time configuration files
-10. Xvar.tgz Run-time data
-11. Xxserv.tgz XFree86 X server
-12. Xmod.tgz XFree86 X server modules
+1. Xinstall.sh The installer script
+2. extract The utility for extracting tarballs
+3. Xbin.tgz X clients/utilities and run-time libraries
+4. Xlib.tgz Some data files required at run-time
+5. Xman.tgz Manual pages
+6. Xdoc.tgz XFree86 documentation
+7. Xfnts.tgz Base set of fonts
+8. Xfenc.tgz Base set of font encoding data
+9. Xetc.tgz Run-time configuration files
+10. Xvar.tgz Run-time data
+11. Xxserv.tgz XFree86 X server
+12. Xmod.tgz XFree86 X server modules
</verb></quote>
]]>
<![ %updaterel [
<quote><verb>
-1. Xinstall.sh The installer script
-2. extract The utility for extracting tarballs
-3. Xupdate.tgz Updated files except X server drivers
-4. Xdrivers.tgz Updated X server drivers
+1. Xinstall.sh The installer script
+2. extract The utility for extracting tarballs
+3. Xupdate.tgz Updated files except X server drivers
+4. Xdrivers.tgz Updated X server drivers
</verb></quote>
]]>
@@ -145,23 +162,21 @@ NOTES:
</itemize>
<![ %fullrel [
-The following thirteen (13) tarballs are optional. You should download
+The following eleven (11) tarballs are optional. You should download
the ones you want to install.
<quote><verb>
-1. Xfsrv.tgz Font server
-2. Xnest.tgz Nested X server
-3. Xprog.tgz X header files, config files and compile-time libs
-4. Xprt.tgz X Print server
-5. Xvfb.tgz Virtual framebuffer X server
-6. Xf100.tgz 100dpi fonts
-7. Xfcyr.tgz Cyrillic fonts
-8. Xflat2.tgz Latin-2 fonts
-9. Xfnon.tgz Some large bitmap fonts
-10. Xfscl.tgz Scalable fonts (Speedo and Type1)
-11. Xhtml.tgz HTML version of the documentation
-12. Xps.tgz PostScript version of the documentation
-13. Xjdoc.tgz Documentation in Japanese
+1. Xfsrv.tgz Font server
+2. Xnest.tgz Nested X server
+3. Xprog.tgz X header files, config files and compile-time libs
+4. Xprt.tgz X Print server
+5. Xvfb.tgz Virtual framebuffer X server
+6. Xf100.tgz 100dpi fonts
+7. Xfcyr.tgz Cyrillic fonts
+8. Xfscl.tgz Scalable fonts (Speedo and Type1)
+9. Xhtml.tgz HTML version of the documentation
+10. Xps.tgz PostScript version of the documentation
+11. Xjdoc.tgz Documentation in Japanese
</verb></quote>
NOTES:
@@ -383,6 +398,7 @@ ln -s /etc/X11/xdm /usr/X11R6/lib/X11
ln -s /etc/X11/xinit /usr/X11R6/lib/X11
ln -s /etc/X11/xsm /usr/X11R6/lib/X11
ln -s /etc/X11/xserver /usr/X11R6/lib/X11
+chmod ug-w /usr/X11R6/lib # Make sure the permissions are OK
/sbin/ldconfig /usr/X11R6/lib # For Linux
/sbin/ldconfig -m /usr/X11R6/lib # For FreeBSD, NetBSD, OpenBSD
/usr/X11R6/bin/mkfontdir /usr/X11R6/lib/X11/fonts/misc
@@ -461,6 +477,7 @@ Once that's done, the main part of the installation can be done:
./extract -C /usr/X11R6 `pwd`/X[a-df-uw-z]*.tgz
./extract -C /usr/X11R6 Xvfb.tgz # If you are installing Xvfb
./extract -C /var Xvar.tgz
+chmod ug-w /usr/X11R6/lib # Make sure the permissions are OK
/sbin/ldconfig /usr/X11R6/lib # For Linux
/sbin/ldconfig -m /usr/X11R6/lib # For FreeBSD, NetBSD, OpenBSD
/usr/X11R6/bin/mkfontdir /usr/X11R6/lib/X11/fonts/misc
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml
index 47f9d66d4..08618a679 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml
@@ -12,7 +12,7 @@ Matthieu Herrb
<Date>Last modified on: 3 March 2001
<ident>
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.60 2001/03/04 09:47:34 herrb Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.60.2.1 2001/06/01 18:09:48 dawes Exp $
</ident>
<toc>
@@ -56,8 +56,10 @@ this file and we'll revise it.
<sect>New OS dependent features
<p>
+<![ %haverelnotes [
See the <htmlurl url="RELNOTES.html" name="Release Notes"> for
non-OS dependent new features in XFree86 &relvers;.
+]]>
<sect1>New OS dependent features in 4.0.2
<p>
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml
index 55b0f8198..c476cedf1 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml
@@ -5,6 +5,7 @@
<!ENTITY % threediffs 'IGNORE'> <!-- patch is split into three diff files -->
<!ENTITY % fourdiffs 'INCLUDE'> <!-- patch is split into four diff files -->
<!ENTITY % difftar 'INCLUDE'> <!-- patch also contains a tarball -->
+<!ENTITY % removefiles 'INCLUDE'> <!-- patching requires removing some files -->
]>
@@ -12,10 +13,10 @@
<title>README for XFree86&tm; &relvers;
<author>The XFree86 Project, Inc
-<date>15 December 2000
+<date>2 June 2001
<ident>
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.113 2001/03/16 22:13:19 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.113.2.3 2001/06/02 16:17:40 dawes Exp $
</ident>
<abstract>
@@ -33,8 +34,9 @@ operating systems on Intel and other platforms.
<![ %updaterel [
XFree86 &relvers; is the &whichupdaterel; update to &fullrelvers;,
-the &whichfullrel; full release in the <![ %earlyrel; [new]]> XFree86
-4 series.
+the &whichfullrel; full release in the
+<![ %earlyrel; [new]]>
+XFree86 4 series.
Update releases are taken from a stable/maintenance branch. They are
designed to be installed on top of the full release that they are
@@ -44,8 +46,9 @@ stability.
]]>
<![ %fullrel [
-XFree86 &relvers; is the &whichfullrel; full release in the <![ %earlyrel;
-[new]]> XFree86 4 series.
+XFree86 &relvers; is the &whichfullrel; full release in the
+<![ %earlyrel; [new]]>
+XFree86 4 series.
]]>
<p>
@@ -77,8 +80,10 @@ video hardware are available. Please check the <htmlurl name="Driver
Status document" url="Status.html"> first to see whether your hardware
is supported before upgrading to the 4.x series.
+<![ %haverelnotes [
Specific release enhancements can be viewed in the
<htmlurl name="Release Notes" url="RELNOTES.html">.
+]]>
The XFree86 version numbering system has had some changes as of the
4.0.2 release. Information about this can be found in the
@@ -238,7 +243,7 @@ The source for version &fullrelvers; is split into three tarballs:
<tt>X&fullsrcvers;src-1.tgz</tt>, <tt>X&fullsrcvers;src-2.tgz</tt>,
<tt>X&fullsrcvers;src-3.tgz</tt>. The first contains everything except the
fonts and general X11 documentation. It is sufficient for building
-XFree86 is you already have a set of fonts. The second contains the
+XFree86 if you already have a set of fonts. The second contains the
fonts and the source for the general X11 documentation. The third
contains the general X11 documentation in hardcopy format.
@@ -339,14 +344,28 @@ gzip -d &lt; &prevfullrelvers;-&fullrelvers;.diff3.gz | patch -p0 -E
gzip -d &lt; &prevfullrelvers;-&fullrelvers;.diff4.gz | patch -p0 -E
</verb></tscreen>
<![ %difftar; [
+<![ %removefiles; [
+<tscreen><verb>
+rm -f xc/programs/xieperf/images/image.012
+rm -fr xc/fonts/bdf/latin2
+rm -fr xc/fonts/bdf/100dpi
+rm -fr xc/fonts/bdf/75dpi
+</verb></tscreen>
+]]>
<tscreen><verb>
gzip -d &lt; &fullrelvers;.tgz | tar vxf -
</verb></tscreen>
]]>
]]>
-The contrib part of the distribution has been folded into the main
-source tree, so a separate contrib tarball is no longer required.
+<![ %prevrelwasupdate; [
+Patches might also be available relative to &prevrelvers;. If so, the
+instructions for applying them are the same, except that you should start
+with a clean &prevrelvers; source tree.
+]]>
+
+The contrib part of the distribution was folded into the main source
+tree a while ago, so a separate contrib tarball is not required.
To format the XFree86 documentation use the latest version of our doctools
package available as <tt>doctools-&doctoolsvers;.tgz</tt>.
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml
index dbc5d5bd4..3c041e23d 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml
@@ -9,7 +9,7 @@
<date>17 December 2000
<ident>
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.60 2001/03/02 17:40:48 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.60.2.1 2001/06/02 16:28:25 torrey Exp $
</ident>
<abstract>
@@ -92,9 +92,10 @@ don't have enough space to cover them all here.
<sect1>X server
<p>
<itemize>
- <item>Darwin/Mac OS X is now supported and the X server runs on PowerPC.
- The X server for this platform is called "Xdarwin", and its
- installation and configuration is different from the "XFree86"
+ <item>Darwin/Mac OS X is now supported on PowerPC and Intel/x86. The X
+ server runs from the console or in cooperation with the Mac OS X
+ Aqua GUI. The X server for this platform is called "XDarwin", and
+ its installation and configuration is different from the "XFree86"
server used on other platforms. Please read the <htmlurl
url="Darwin.html" name="XFree86 on Darwin and Mac OS X"> document
for further information.
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml
index 61b42d3c2..6f91321b3 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml
@@ -6,10 +6,10 @@
<title>Driver Status for XFree86&trade; &relvers;
<author>The XFree86 Project, Inc
-<date>4 December 2000
+<date>1 June 2001
<ident>
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.29 2001/04/04 01:34:18 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.29.2.2 2001/06/01 18:09:49 dawes Exp $
</ident>
<abstract>
@@ -18,7 +18,7 @@ This document provides information about the status of the driver and
hardware support in XFree86 &relvers; compared with that in XFree86
&legacyvers;. Please send updates for this document to
<email>fixes@xfree86.org</email>. Please do not send requests for
-information or support to that address.
+information or support to that address (they will not be answered).
</abstract>
@@ -157,7 +157,7 @@ other architectures known to work on (e.g., Alpha, PPC), etc.
All chips supported in &legacyvers; are supported in &relvers;
except for Mach8 and some old Mach32 chips. The support in
&relvers; is, however, unaccelerated for all chips except the
- Mach64, Rage and Rage 128 variants.
+ Mach64, Rage, Rage 128 and Radeon variants.
</descrip>
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml
index 2cdc21479..3e10a52a6 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml
@@ -8,10 +8,10 @@
<title> Information for Chips and Technologies Users
<author> David Bateman (<email>dbateman@club-internet.fr</email>),
Egbert Eich (<email>eich@xfree86.org</email>)
-<date> 14th June 2000
+<date> 1st January 2001
<ident>
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml,v 3.33 2000/12/02 21:52:22 dbateman Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml,v 3.36 2001/05/19 00:35:42 dawes Exp $
</ident>
<!-- Table of contents -->
@@ -276,15 +276,6 @@ Option "HWclocks"
programmable clock makes this option obsolete and so it's use
isn't recommended. It is completely ignored for HiQV chipsets.
<tag>
-Option "UseVclk1"
-</tag>
- The HiQV series of chips have three programmable clocks. The
- first two are usually loaded with 25.175 and 28.322MHz for
- VGA backward compatibility, and the third is used as a fully
- programmable clock. On at least one system (the Inside 686 LCD/S
- single board computer) the third clock is unusable. This option
- forces the use of VClk1 as the programmable clock.
-<tag>
TextClockFreq 25.175
</tag>
Except for the HiQV chipsets, it is impossible for the server to read
@@ -311,6 +302,16 @@ Option "FPClock32" "65.0MHz"
less, 16, 24 or 32bpp LCD panel clocks, where the options above set
the clocks to 65MHz.
<tag>
+Option "CRTClkIndx" "2"
+Option "FPClkIndx" "1"
+</tag>
+ The HiQV series of chips have three programmable clocks. The
+ first two are usually loaded with 25.175 and 28.322MHz for
+ VGA backward compatibility, and the third is used as a fully
+ programmable clock. On at least one system (the Inside 686 LCD/S
+ single board computer) the third clock is unusable. These options
+ can be used to force a particular clock index to be used
+<tag>
Option "MMIO"
</tag>
This has a different effect depending on the hardware on which it
@@ -318,12 +319,14 @@ Option "MMIO"
BitBLT engine and is only usable with PCI buses. It is enabled
by default for 65545 machines since the blitter can not be used
otherwise. The HiQV series of chipsets must use MMIO with their
- BitBLT engines, and so this is enabled by default. However the
- 690xx chipsets can use MMIO for all communications with the video
- processor. So using this option on a 690xx chipset forces them
- to use MMIO for all communications. This only makes sense when
- the 690xx is on a PCI bus so that normal PIO can be disabled.
- (WARNING!! 690xx MMIO is untested)
+ BitBLT engines, and so this is enabled by default.
+<tag>
+Option "FullMMIO"
+</tag>
+ The 690xx chipsets can use MMIO for all communications with the
+ video processor. So using this option on a 690xx chipset forces
+ them to use MMIO for all communications. This only makes sense
+ when the 690xx is on a PCI bus so that normal PIO can be disabled.
<tag>
Option "SuspendHack"
</tag>
@@ -442,6 +445,22 @@ Option "VideoKey" "255"
8bit depth, 0 to 32,767 for 15bit depth, etc. This option might be used
if the default video overlay key causes problems.
<tag>
+Option "DualRefresh"
+</tag>
+ The 69030 chipset has independent display channels, that can be
+ configured to support independent refresh rates on the flat panel
+ and on the CRT. The default behaviour is to have both the flat panel
+ and the CRT use the same display channel and thus the same refresh
+ rate. This option forces the two display channels to be used, giving
+ independent refresh rates.
+<tag>
+Option "Crt2Memory" "2048"
+</tag>
+ The ct69030 supports dual-head display. By default the two display
+ share equally the available memory. This option forces the second
+ display to take a particular amount of memory. Please read the
+ section below about dual-head display.
+<tag>
Option "XaaNoScreenToScreenCopy",
Option "XaaNoSolidFillRect",
Option "XaaNoSolidHorVertLine",
@@ -532,6 +551,12 @@ driver you'll needed to considered several points
they specified after a suspend/resume or LCD/CRT switch. For a
complete discussion on the dot clock limitations, see the next
section.
+<tag> * Dual-head display </tag>
+ Dual-head display has two effects on the modelines. Firstly,
+ the memory requirements of both heads must fit in the available
+ memory. Secondly, the memory bandwidth of the video processor is
+ shared between the two heads. Hence the maximum dot-clock might
+ need to be limited.
</descrip>
The driver is capable of driving both a CRT and a flat panel
@@ -572,6 +597,105 @@ The NEC Versa 4080 just needs the "FixPanelSize" option. To the best of my
knowledge no machine with a HiQV needs the "UseModeline" or "FixPanelSize"
options.
+<sect> Dual Display Channel<p>
+
+XFree86 releases later than 4.1.0 support dual-channel display on the ct69030.
+This support can be used to give a single display image on two screen with
+different refresh rates, or entirely different images on the two displays.
+
+Dual refresh rate display can be selected with the "<tt>DualRefresh</tt>"
+option described above. However to use the dual-head support is slightly
+more complex. Firstly, the ct69030 chipset must be installed on a PCI bus. This
+is a driver limitation that might be relaxed in the future. In addition the
+device, screen and layout sections of the "<tt>XF86Config</tt>" must be
+correctly configured. A sample of an incomplete "<tt>XF86Config</tt>" is
+given below
+
+<quote><verb>
+Section "Device"
+ Identifier "Chips and Technologies - Pipe A"
+ Driver "chips"
+ BusID "PCI:0:20:0"
+ Screen 0
+EndSection
+
+Section "Device"
+ Identifier "Chips and Technologies - Pipe B"
+ Driver "chips"
+ BusID "PCI:0:20:0"
+ Screen 1
+EndSection
+
+Section "Screen"
+ Identifier "Screen 0"
+ Device "Chips and Technologies - Pipe A"
+ Monitor "generic LCD"
+
+ SubSection "Display"
+ Depth 16
+ Modes "1024x768"
+ EndSubsection
+EndSection
+
+Section "Screen"
+ Identifier "Screen 1"
+ Device "Chips and Technologies - Pipe B"
+ Monitor "generic CRT"
+
+ SubSection "Display"
+ Depth 16
+ Modes "1024x768"
+ EndSubsection
+EndSection
+
+Section "ServerLayout"
+ Identifier "Main Layout"
+ Screen "Screen 0"
+ Screen "Screen 1" RightOf "Screen 0"
+ InputDevice "Mouse1" "CorePointer"
+ InputDevice "Keyboard1" "CoreKeyboard"
+EndSection
+</verb></quote>
+
+The device section must include the PCI BusID. This can be found from the
+log file of a working single-head installation. For instance, the line
+
+<quote><verb>
+(--) PCI:*(0:20:0) C&amp;T 69030 rev 97, Mem @ 0xed000000/24
+</verb></quote>
+
+appears for the case above. Additionally, the "<tt>Screen</tt>" option
+must appear in the device section. It should be noted that if a flat
+panel is used, this it must be allocated to "<tt>Screen 0</tt>".
+
+The server can then be started with the "<tt>+xinerama</tt>" option
+as follows
+
+<quote><verb>
+startx -- +xinerama
+</verb></quote>
+
+For more information, read the Xinerama documentation.
+
+It should be noted that the dual channel display options of the 69030
+require the use of additional memory bandwidth, as each display channel
+independently accesses the video memory. For this reason, the maximum
+colour depth and resolution that can be supported in a dual channel mode
+will be reduced compared to a single display channel mode. However, as
+the driver does not prevent you from using a mode that will exceed the
+memory bandwidth of the 69030, but a warning like
+
+<quote><verb>
+(WW) Memory bandwidth requirements exceeded by dual-channel
+(WW) mode. Display might be corrupted!!!
+</verb></quote>
+
+If you see such display corruption, and you have this warning, your choices
+are to reduce the refresh rate, colour depth or resolution, or increase the
+speed of the memory clock with the the "<tt>SetMClk</tt>" option described
+above. Note that increasing the memory clock also has its own problems as
+described above.
+
<sect> The Full Story on Clock Limitations <p>
There has been much confusion about exactly what the clock limitations
@@ -623,19 +747,29 @@ resulting in drawing errors on the screen. The formula to determine the
maximum usable dotclock on the HiQV series of chips is
<verb>
+Max dotclock = min(MaxDClk, 0.70 * 8 * MemoryClk / (BytesPerPixel +
+ (isDSTN == TRUE ? 1 : 0)))
+</verb>
+
+if you chips is a 69030 or 69000 or
+
+<verb>
Max dotclock = min(MaxDClk, 0.70 * 4 * MemoryClk / (BytesPerPixel +
(isDSTN == TRUE ? 1 : 0)))
</verb>
-which says that there are two limits on the dotclock. One the overall
-maximum, and another due to the available memory bandwidth of the chip.
-For the memory bandwidth 4 bytes are transfered every clock cycle (Hence
-the 4), but after accounting for the RAS/CAS signaling only about 70%
-of the bandwidth is available. The whole thing is divided by the bytes
-per pixel, plus an extra byte if you are using a DSTN. The extra byte
-with DSTN screens is used for the frame buffering/acceleration in these
-screens. So for the various Chips and Technologies chips the maximum
-specifications are
+
+otherwise. This effectively means that there are two limits on the
+dotclock. One the overall maximum, and another due to the available
+memory bandwidth of the chip. The 69030 and 69000 have a 64bit memory
+bus and thus transfer 8 bytes every clock thus (hence the 8), while
+the other HiQV chipsets are 32bit and transfer 4 bytes per clock cycle
+(hence the 4). However, after accounting for the RAS/CAS signaling
+only about 70% of the bandwidth is available. The whole thing is
+divided by the bytes per pixel, plus an extra byte if you are using a
+DSTN. The extra byte with DSTN screens is used for the frame
+buffering/acceleration in these screens. So for the various Chips and
+Technologies chips the maximum specifications are
<verb>
Max DClk MHz Max Mem Clk MHz
@@ -666,8 +800,8 @@ clocks for the chips are
65554 94.5 77 51.33 77 51.33 38.5
65555 110 77 51.33 77 51.33 38.5
68554 110 77 51.33 77 51.33 38.5
-69000 135 116.2 77.47 116.2 77.47 58.1
-69030 170 140 93.33 140 93.33 70
+69000 135 135 135 135 135 116.2
+69030 170 170 170 170 170 140
</verb>
If you exceed the maximum set by the memory clock, you'll get corruption
@@ -841,9 +975,9 @@ video processor beyond it capabilities won't cause damage.
However, 8 and 24 bit colour depths seem to work fine.
<tag> My ct69030 machine locks up when starting XFree</tag>
The ct69030 chipset introduced a new dual channel architecture. In its
- current form, XFree can not take advantage of this second display
+ current form, XFree86 can not take advantage of this second display
channel. In fact if the video BIOS on the machine sets the ct69030
- to a dual channel mode by default, XFree will lockup hard at this
+ to a dual channel mode by default, XFree86 will lockup hard at this
point. The solution is to use the BIOS setup to change to a single
display channel mode, ensuring that both the IOSS and MSS registers
are set to a single channel mode. Work is underway to fix this.
@@ -885,7 +1019,8 @@ video processor beyond it capabilities won't cause damage.
65.10MHz is not. So for unexplained problems not addressed above, please
try to alter the clock you are using slightly, say in steps of 0.05MHz
and see if the problem goes away. Alternatively, using the
- "<tt>UseVClk1</tt>" option with HiQV chips might also help.
+ "<tt>CRTClkIndx</tt>" or "<tt>FPClkIndx</tt>" option with HiQV chips might
+ also help.
For other screen drawing related problems, try the "<tt>NoAccel</tt>" or
diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent b/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent
index f8a787438..cf77e69b0 100644
--- a/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent
+++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent
@@ -1,17 +1,17 @@
-<!-- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent,v 1.16 2001/02/09 04:15:36 dawes Exp $ -->
+<!-- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent,v 1.16.2.3 2001/06/02 16:17:40 dawes Exp $ -->
<!-- shared entity definitions for the XFree86 documentation -->
<!-- XFree86 version string -->
-<!ENTITY relvers CDATA "4.0.2">
-<!ENTITY prevrelvers CDATA "4.0.1">
-<!ENTITY fullrelvers CDATA "4.0.2">
-<!ENTITY prevfullrelvers CDATA "4.0.1">
-<!ENTITY srcvers CDATA "402">
-<!ENTITY prevsrcvers CDATA "401">
-<!ENTITY fullsrcvers CDATA "402">
-<!ENTITY prevfullsrcvers CDATA "401">
-<!ENTITY whichfullrel CDATA "third">
+<!ENTITY relvers CDATA "4.1.0">
+<!ENTITY prevrelvers CDATA "4.0.3">
+<!ENTITY fullrelvers CDATA "4.1.0">
+<!ENTITY prevfullrelvers CDATA "4.0.2">
+<!ENTITY srcvers CDATA "410">
+<!ENTITY prevsrcvers CDATA "403">
+<!ENTITY fullsrcvers CDATA "410">
+<!ENTITY prevfullsrcvers CDATA "402">
+<!ENTITY whichfullrel CDATA "fourth">
<!ENTITY whichupdaterel CDATA "none">
<!-- Version of the most recent 3.3.x release -->
@@ -30,8 +30,12 @@
<!ENTITY % snapshot 'IGNORE'>
<!ENTITY % release 'INCLUDE'>
<!ENTITY % firstrel 'IGNORE'>
-<!ENTITY % earlyrel 'INCLUDE'>
+<!ENTITY % earlyrel 'IGNORE'>
<!ENTITY % laterrel 'INCLUDE'>
<!ENTITY % fullrel 'INCLUDE'>
<!ENTITY % updaterel 'IGNORE'>
+<!ENTITY % prevrelwasupdate 'INCLUDE'>
+
+<!-- Set this to INCLUDE when references to the RELNOTES are to be included -->
+<!ENTITY % haverelnotes 'IGNORE'>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h
index 1a5cf63dc..387d73ded 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h,v 1.16 2001/04/25 17:46:42 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h,v 1.17 2001/05/04 19:05:31 dawes Exp $ */
/* All drivers should typically include these */
@@ -175,6 +175,7 @@ typedef struct {
XF86VideoAdaptorPtr adaptor;
int timerIsOn;
Time offTime;
+ OptionInfoPtr Options;
} ApmRec, *ApmPtr;
#define curr ((unsigned char *)pApm->regcurr)
@@ -222,6 +223,8 @@ extern void ApmSetupXAAInfo(ApmPtr pApm, XAAInfoRecPtr pXAAinfo);
extern Bool ApmSwitchMode(int scrnIndex, DisplayModePtr mode,
int flags);
extern void ApmAdjustFrame(int scrnIndex, int x, int y, int flags);
+extern void ApmHWCursorReserveSpace(ApmPtr pApm);
+extern void ApmAccelReserveSpace(ApmPtr pApm);
extern int ApmPixmapIndex;
#define APM_GET_PIXMAP_PRIVATE(pix)\
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c
index cfa8b3f40..733a75ac7 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c,v 1.16 2001/04/25 17:46:42 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c,v 1.16.2.1 2001/05/23 20:21:52 dawes Exp $ */
#define COMPILER_H_EXTRAS
@@ -302,10 +302,12 @@ ApmAccelInit(ScreenPtr pScreen)
SETROP(ROP_S_xor_D);
SETROP(ROP_S);
+#if 0
if (XAAPixmapOps.CopyArea != ApmCopyAreaPixmap) {
SaveCopyAreaPixmap = XAAPixmapOps.CopyArea;
XAAPixmapOps.CopyArea = ApmCopyAreaPixmap;
}
+#endif
ApmSetupXAAInfo(pApm, pXAAinfo);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c
index 77e033cab..47130023a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c,v 1.49 2001/04/25 17:46:42 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c,v 1.50 2001/05/04 19:05:31 dawes Exp $ */
#define COMPILER_H_EXTRAS
#include "apm.h"
@@ -27,7 +27,7 @@
#define TEXT_AMOUNT 32768
/* Mandatory functions */
-static OptionInfoPtr ApmAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * ApmAvailableOptions(int chipid, int busid);
static void ApmIdentify(int flags);
static Bool ApmProbe(DriverPtr drv, int flags);
static Bool ApmPreInit(ScrnInfoPtr pScrn, int flags);
@@ -95,7 +95,7 @@ typedef enum {
OPTION_PCI_RETRY
} ApmOpts;
-static OptionInfoRec ApmOptions[] =
+static const OptionInfoRec ApmOptions[] =
{
{OPTION_SET_MCLK, "SetMclk", OPTV_FREQ,
{0}, FALSE},
@@ -294,8 +294,7 @@ ApmIdentify(int flags)
ApmChipsets);
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
ApmAvailableOptions(int chipid, int busid)
{
return ApmOptions;
@@ -612,7 +611,10 @@ ApmPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ApmOptions);
+ if (!(pApm->Options = xalloc(sizeof(ApmOptions))))
+ return FALSE;
+ memcpy(pApm->Options, ApmOptions, sizeof(ApmOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pApm->Options);
pApm->scrnIndex = pScrn->scrnIndex;
/* Set the bits per RGB for 8bpp mode */
@@ -620,16 +622,16 @@ ApmPreInit(ScrnInfoPtr pScrn, int flags)
/* Default to 8 */
pScrn->rgbBits = 8;
}
- if (xf86ReturnOptValBool(ApmOptions, OPTION_NOLINEAR, FALSE)) {
+ if (xf86ReturnOptValBool(pApm->Options, OPTION_NOLINEAR, FALSE)) {
pApm->noLinear = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "No linear framebuffer\n");
}
from = X_DEFAULT;
pApm->hwCursor = FALSE;
- if (xf86GetOptValBool(ApmOptions, OPTION_HW_CURSOR, &pApm->hwCursor))
+ if (xf86GetOptValBool(pApm->Options, OPTION_HW_CURSOR, &pApm->hwCursor))
from = X_CONFIG;
if (pApm->noLinear ||
- xf86ReturnOptValBool(ApmOptions, OPTION_SW_CURSOR, FALSE)) {
+ xf86ReturnOptValBool(pApm->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pApm->hwCursor = FALSE;
}
@@ -638,24 +640,24 @@ ApmPreInit(ScrnInfoPtr pScrn, int flags)
from = X_DEFAULT;
if (pScrn->bitsPerPixel < 8)
pApm->NoAccel = TRUE;
- if (xf86ReturnOptValBool(ApmOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pApm->Options, OPTION_NOACCEL, FALSE)) {
from = X_CONFIG;
pApm->NoAccel = TRUE;
}
if (pApm->NoAccel)
xf86DrvMsg(pScrn->scrnIndex, from, "Acceleration disabled\n");
- if (xf86GetOptValFreq(ApmOptions, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) {
+ if (xf86GetOptValFreq(pApm->Options, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MCLK used is %.1f MHz\n", real);
pApm->MemClk = (int)(real * 1000.0);
}
- if (xf86ReturnOptValBool(ApmOptions, OPTION_SHADOW_FB, FALSE)) {
+ if (xf86ReturnOptValBool(pApm->Options, OPTION_SHADOW_FB, FALSE)) {
pApm->ShadowFB = TRUE;
pApm->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Using \"Shadow Framebuffer\" - acceleration disabled\n");
}
- if (xf86ReturnOptValBool(ApmOptions, OPTION_PCI_RETRY, FALSE)) {
- if (xf86ReturnOptValBool(ApmOptions, OPTION_PCI_BURST, FALSE)) {
+ if (xf86ReturnOptValBool(pApm->Options, OPTION_PCI_RETRY, FALSE)) {
+ if (xf86ReturnOptValBool(pApm->Options, OPTION_PCI_BURST, FALSE)) {
pApm->UsePCIRetry = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n");
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c
index 5ac7e7d23..d696078f0 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c,v 1.9 2001/01/06 21:29:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c,v 1.9.2.1 2001/05/23 20:21:52 dawes Exp $ */
/*
* Copyright Loïc Grenié 1999
*/
@@ -493,8 +493,10 @@ ProcXF86RushDispatch (register ClientPtr client)
return ProcXF86RushUnlockAllPixmaps(client);
case X_XF86RushSetCopyMode:
return ProcXF86RushSetCopyMode(client);
+#if 0
case X_XF86RushSetPixelStride:
return ProcXF86RushSetPixelStride(client);
+#endif
case X_XF86RushOverlayPixmap:
return ProcXF86RushOverlayPixmap(client);
case X_XF86RushStatusRegOffset:
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c
index 15e4eedbe..a5d63c30f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c,v 1.11 2001/01/29 15:15:44 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c,v 1.14 2001/05/10 16:48:12 dawes Exp $ */
/*
* Copyright 2000 Ani Joshi <ajoshi@unixbox.com>
*
@@ -50,7 +50,7 @@
/*
* prototypes
*/
-static OptionInfoPtr ARKAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * ARKAvailableOptions(int chipid, int busid);
static void ARKIdentify(int flags);
static Bool ARKProbe(DriverPtr drv, int flags);
static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags);
@@ -107,8 +107,9 @@ typedef enum {
OPTION_NOACCEL
} ARKOpts;
-static OptionInfoRec ARKOptions[] = {
- { OPTION_NOACCEL, "noaccel", OPTV_BOOLEAN, {0}, FALSE }
+static const OptionInfoRec ARKOptions[] = {
+ { OPTION_NOACCEL, "noaccel", OPTV_BOOLEAN, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
};
static const char *fbSymbols[] = {
@@ -195,7 +196,7 @@ static void ARKFreeRec(ScrnInfoPtr pScrn)
pScrn->driverPrivate = NULL;
}
-static OptionInfoPtr ARKAvailableOptions(int chipid, int busid)
+static const OptionInfoRec * ARKAvailableOptions(int chipid, int busid)
{
return ARKOptions;
}
@@ -323,9 +324,12 @@ static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags)
pARK = ARKPTR(pScrn);
xf86CollectOptions(pScrn, NULL);
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ARKOptions);
+ if (!(pARK->Options = xalloc(sizeof(ARKOptions))))
+ return FALSE;
+ memcpy(pARK->Options, ARKOptions, sizeof(ARKOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pARK->Options);
- if (xf86ReturnOptValBool(ARKOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pARK->Options, OPTION_NOACCEL, FALSE)) {
pARK->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - acceleration disabled\n");
} else
@@ -457,7 +461,7 @@ static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags)
i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
pScrn->display->modes, clockRanges,
NULL, 256, 2048, pScrn->bitsPerPixel,
- 128, 2048, pScrn->virtualX,
+ 128, 2048, pScrn->display->virtualX,
pScrn->display->virtualY, pARK->videoRam * 1024,
LOOKUP_BEST_REFRESH);
if (i == -1) {
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
index 910a11040..dae4811c9 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile,v 1.30 2001/04/16 15:02:09 tsi Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile,v 1.32 2001/05/18 20:22:28 tsi Exp $
XCOMM
XCOMM Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
XCOMM
@@ -76,6 +76,10 @@ DRIDEFINES = $(GLX_DEFINES)
* For testing purposes, #define'ing ATIAvoidCPIO as YES is also supported on
* platforms that do, in fact, provide or emulate a PIO address space as
* described above, but this should not be the default driver configuration.
+ *
+ * Currently, ATIAvoidNonPCI needs to be set to YES for those platforms that
+ * "drop down" to firmware on accesses to allocated, but disabled, PCI space.
+ * ATIAvoidNonPCI necessarily implies ATIAvoidCPIO.
*/
#if defined(i386Architecture) || \
defined(ia64Architecture) || \
@@ -88,7 +92,26 @@ DRIDEFINES = $(GLX_DEFINES)
# define ATIAvoidCPIO YES
#endif
-#if !ATIAvoidCPIO
+#if defined(PpcArchitecture)
+# undef ATIAvoidNonPCI
+# define ATIAvoidNonPCI YES
+#elif !defined(ATIAvoidNonPCI)
+# define ATIAvoidNonPCI NO
+#endif
+
+#if ATIAvoidNonPCI
+# undef ATIAvoidCPIO
+# define ATIAvoidCPIO YES
+
+NONPCIDEFINES = -DAVOID_NON_PCI
+
+#endif
+
+#if ATIAvoidCPIO
+
+CPIODEFINES = -DAVOID_CPIO
+
+#else
CPIOSRCS1 = ativgaio.c
CPIOSRCS2 = atibank.c ativga.c atiwonder.c atiwonderio.c
@@ -96,13 +119,9 @@ CPIOSRCS2 = atibank.c ativga.c atiwonder.c atiwonderio.c
CPIOOBJS1 = ativgaio.o
CPIOOBJS2 = atibank.o ativga.o atiwonder.o atiwonderio.o
-#else
-
-CPIODEFINES = -DAVOID_CPIO
-
#endif
-DEFINES = $(CPIODEFINES) $(DRIDEFINES)
+DEFINES = $(CPIODEFINES) $(NONPCIDEFINES) $(DRIDEFINES)
SRCS1 = ati.c atiadapter.c atibus.c atichip.c atiident.c atioption.c \
atiprobe.c atividmem.c $(MODSRCS1) $(CPIOSRCS1) \
@@ -110,7 +129,7 @@ SRCS1 = ati.c atiadapter.c atibus.c atichip.c atiident.c atioption.c \
SRCS2 = atiaccel.c atiadjust.c aticlock.c aticonfig.c aticonsole.c \
aticursor.c atidac.c atidga.c atidsp.c atilock.c atimach64.c \
atimach64io.c atimode.c atipreinit.c atiprint.c atiscreen.c atiutil.c \
- ativalid.c $(MODSRCS2) $(CPIOSRCS2)
+ ativalid.c atixv.c $(MODSRCS2) $(CPIOSRCS2)
SRCS3 = r128_accel.c r128_cursor.c r128_dga.c r128_driver.c r128_video.c \
$(MODSRCS3) $(DRISRCS3)
SRCS4 = radeon_accel.c radeon_cursor.c radeon_dga.c radeon_driver.c \
@@ -122,7 +141,7 @@ OBJS1 = ati.o atiadapter.o atibus.o atichip.o atiident.o atioption.o \
OBJS2 = atiaccel.o atiadjust.o aticlock.o aticonfig.o aticonsole.o \
aticursor.o atidac.o atidga.o atidsp.o atilock.o atimach64.o \
atimach64io.o atimode.o atipreinit.o atiprint.o atiscreen.o atiutil.o \
- ativalid.o $(MODOBJS2) $(CPIOOBJS2)
+ ativalid.o atixv.o $(MODOBJS2) $(CPIOOBJS2)
OBJS3 = r128_accel.o r128_cursor.o r128_dga.o r128_driver.o r128_video.o \
$(MODOBJS3) $(DRIOBJS3)
OBJS4 = radeon_accel.o radeon_cursor.o radeon_dga.o radeon_driver.o \
@@ -248,6 +267,8 @@ InstallDriverSDKNonExecFile(atiwonder.c,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(atiwonder.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(atiwonderio.c,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(atiwonderio.h,$(DRIVERSDKDIR)/drivers/ati)
+InstallDriverSDKNonExecFile(atixv.c,$(DRIVERSDKDIR)/drivers/ati)
+InstallDriverSDKNonExecFile(atixv.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(r128.cpp,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(r128.h,$(DRIVERSDKDIR)/drivers/ati)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c
index ea431b85c..a79dbfaa7 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c,v 1.16 2001/03/25 05:32:07 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c,v 1.17 2001/05/09 03:12:02 tsi Exp $ */
/*
* Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -57,7 +57,7 @@
* Henrik Harmsen, ervhch@erv.ericsson.se
* Christian Lupien, lupien@physics.utoronto.ca
* Precision Insight Incorporated
- * Mark Vojkovich, mvojkovich@valinux.com
+ * Mark Vojkovich, mvojkovich@nvidia.com
* Huw D M Davies, h.davies1@physics.ox.ac.uk
* Andrew C Aitchison, A.C.Aitchison@dpmms.cam.ac.uk
* Ani Joshi, ajoshi@shell.unixbox.com
@@ -66,7 +66,8 @@
* David S. Miller, davem@redhat.com
* A E Lawrence, adrian.lawrence@computing-services.oxford.ac.uk
* Linus Torvalds, torvalds@transmeta.com
- * William Blew <wblew@home.com>
+ * William Blew, wblew@home.com
+ * Ignacio Garcia Etxebarria, garetxe@euskalnet.net
*
* ... and, many, many others from around the world.
*
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c
index 4308ae8ae..3eba7f1d1 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c,v 1.5 2001/04/16 15:47:56 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c,v 1.6 2001/05/07 21:59:06 tsi Exp $ */
/*
* Copyright 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -34,8 +34,8 @@
Bool
ATIInitializeAcceleration
(
- ScrnInfoPtr pScreenInfo,
ScreenPtr pScreen,
+ ScrnInfoPtr pScreenInfo,
ATIPtr pATI
)
{
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h
index d7d730313..309a9794b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h,v 1.1 2001/03/25 05:33:06 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h,v 1.2 2001/05/07 21:59:06 tsi Exp $ */
/*
* Copyright 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -21,16 +21,16 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#ifndef ___ATIMODE_H___
-#define ___ATIMODE_H___ 1
+#ifndef ___ATIACCEL_H___
+#define ___ATIACCEL_H___ 1
#include "atipriv.h"
#include "atiproto.h"
#include "xf86str.h"
-extern Bool ATIInitializeAcceleration FunctionPrototype((ScrnInfoPtr,
- ScreenPtr,
+extern Bool ATIInitializeAcceleration FunctionPrototype((ScreenPtr,
+ ScrnInfoPtr,
ATIPtr));
#endif /* ___ATIACCEL_H___ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c
index f210c1f1e..9f9315dab 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c,v 1.11 2001/02/12 03:27:03 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c,v 1.12 2001/05/09 03:12:02 tsi Exp $ */
/*
* Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -133,7 +133,7 @@ ATIAdjustFrame
{
ScrnInfoPtr pScreenInfo = xf86Screens[scrnIndex];
ATIPtr pATI = ATIPTR(pScreenInfo);
- int Base;
+ int Base, xy;
/*
* Assume the caller has already done its homework in ensuring the physical
@@ -149,6 +149,21 @@ ATIAdjustFrame
Base = ((((y * pATI->displayWidth) + x) & pATI->AdjustMask) *
pATI->AdjustDepth) >> 3;
+ if (!pATI->currentMode)
+ {
+ /*
+ * Not in DGA. This reverse-calculates pScreenInfo->frame[XY][01] so
+ * that the cursor does not move on mode switches.
+ */
+ xy = (Base << 3) / pATI->AdjustDepth;
+ pScreenInfo->frameX0 = xy % pATI->displayWidth;
+ pScreenInfo->frameY0 = xy / pATI->displayWidth;
+ pScreenInfo->frameX1 =
+ pScreenInfo->frameX0 + pScreenInfo->currentMode->HDisplay - 1;
+ pScreenInfo->frameY1 =
+ pScreenInfo->frameY0 + pScreenInfo->currentMode->VDisplay - 1;
+ }
+
/* Unlock registers */
ATIUnlock(pATI);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c
index fef2c0753..ad425fc07 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c,v 1.35 2001/04/23 17:15:57 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c,v 1.36 2001/05/09 03:12:02 tsi Exp $ */
/*
* Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -2064,6 +2064,7 @@ ATIMach64CursorInit
HARDWARE_CURSOR_INVERT_MASK |
HARDWARE_CURSOR_SHOW_TRANSPARENT |
HARDWARE_CURSOR_UPDATE_UNHIDDEN |
+ HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
#if X_BYTE_ORDER != X_LITTLE_ENDIAN
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c
index 5d74e13ad..4810c7a21 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c,v 1.16 2001/03/25 05:32:09 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c,v 1.18 2001/05/07 21:59:06 tsi Exp $ */
/*
* Copyright 1999 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -30,7 +30,7 @@
/*
* Recognised XF86Config options.
*/
-OptionInfoRec ATIPublicOptions[] =
+const OptionInfoRec ATIPublicOptions[] =
{
{
ATI_OPTION_ACCEL,
@@ -124,14 +124,14 @@ const unsigned long ATIPublicOptionSize = SizeOf(ATIPublicOptions);
*
* Return recognised options that are intended for public consumption.
*/
-OptionInfoPtr
+const OptionInfoRec *
ATIAvailableOptions
(
int ChipId,
int BusId
)
{
- OptionInfoPtr pOptions;
+ const OptionInfoRec *pOptions;
if ((pOptions = R128AvailableOptions(ChipId, BusId)))
return pOptions;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h
index 475b68144..5e6349c8d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h,v 1.6 2001/03/25 05:32:09 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h,v 1.8 2001/05/18 20:22:28 tsi Exp $ */
/*
* Copyright 1999 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -51,9 +51,9 @@ typedef enum
ATI_OPTION_SWCURSOR
} ATIPublicOptionType;
-extern OptionInfoRec ATIPublicOptions[];
-extern const unsigned long ATIPublicOptionSize;
+extern const OptionInfoRec ATIPublicOptions[];
+extern const unsigned long ATIPublicOptionSize;
-extern OptionInfoPtr ATIAvailableOptions FunctionPrototype((int, int));
+extern const OptionInfoRec * ATIAvailableOptions FunctionPrototype((int, int));
#endif /* ___ATIOPTION_H___ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c
index 9b072da5f..2c8908c3c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c,v 1.44 2001/04/01 14:00:09 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c,v 1.47.2.1 2001/05/22 15:57:03 tsi Exp $ */
/*
* Copyright 1999 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -459,6 +459,7 @@ ATIPreInit
}
ConfiguredMonitor = NULL;
+ (void)memset(BIOS, 0, SizeOf(BIOS));
if (!(flags & PROBE_DETECT))
{
@@ -579,7 +580,6 @@ ATIPreInit
* If there is an ix86-style BIOS, ensure its initialisation entry point
* has been executed, and retrieve DDC and VBE information from it.
*/
- (void)memset(BIOS, 0, SizeOf(BIOS));
if (!(pInt10Module = xf86LoadSubModule(pScreenInfo, "int10")))
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Unable to load int10 module.\n");
@@ -632,8 +632,11 @@ ATIPreInit
return TRUE;
}
- xf86PrintEDID(ConfiguredMonitor);
- xf86SetDDCproperties(pScreenInfo, ConfiguredMonitor);
+ if (ConfiguredMonitor)
+ {
+ xf86PrintEDID(ConfiguredMonitor);
+ xf86SetDDCproperties(pScreenInfo, ConfiguredMonitor);
+ }
/* DDC module is no longer needed at this point */
xf86UnloadSubModule(pDDCModule);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c
index 63a61a595..f3a7570ea 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.44 2001/04/19 14:14:05 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.45 2001/05/18 20:22:28 tsi Exp $ */
/*
* Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -1334,6 +1334,8 @@ ATIProbe
if (nATIGDev)
{
+#ifndef AVOID_NON_PCI
+
#ifdef AVOID_CPIO
/* PCI sparse I/O adapters can still be used through MMIO */
@@ -1417,6 +1419,8 @@ ATIProbe
}
+#endif /* AVOID_NON_PCI */
+
#ifndef AVOID_CPIO
/*
@@ -1720,10 +1724,13 @@ ATIProbe
case ATI_CHIP_RAGE128PROVR:
case ATI_CHIP_RAGE128MOBILITY3:
case ATI_CHIP_RAGE128MOBILITY4:
+ case ATI_CHIP_RAGE128ULTRA:
DoRage128 = TRUE;
continue;
case ATI_CHIP_RADEON:
+ case ATI_CHIP_RADEONVE:
+ case ATI_CHIP_RADEONMOBILITY:
DoRadeon = TRUE;
continue;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c
index 83c44c698..92381f2ae 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c,v 1.19 2001/03/25 05:32:09 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c,v 1.21 2001/05/09 03:12:03 tsi Exp $ */
/*
* Copyright 1999 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -27,9 +27,9 @@
#include "aticursor.h"
#include "atidac.h"
#include "atidga.h"
-#include "atimode.h"
#include "atiscreen.h"
#include "atistruct.h"
+#include "atixv.h"
#include "shadowfb.h"
#include "xf86cmap.h"
@@ -229,7 +229,7 @@ ATIScreenInit
(void)ATIDGAInit(pScreenInfo, pScreen, pATI);
/* Setup acceleration */
- if (!ATIInitializeAcceleration(pScreenInfo, pScreen, pATI))
+ if (!ATIInitializeAcceleration(pScreen, pScreenInfo, pATI))
return FALSE;
/* Initialise backing store */
@@ -271,6 +271,9 @@ ATIScreenInit
/* Initialise DPMS support */
(void)xf86DPMSInit(pScreen, ATISetDPMSMode, 0);
+ /* Initialise XVideo support */
+ (void)ATIInitializeXVideo(pScreen, pScreenInfo, pATI);
+
/* Set pScreen->SaveScreen and wrap CloseScreen vector */
pScreen->SaveScreen = ATISaveScreen;
pATI->CloseScreen = pScreen->CloseScreen;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h
index dbed4e124..631543f57 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h,v 1.36 2001/04/25 18:21:10 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h,v 1.38 2001/05/18 20:22:28 tsi Exp $ */
/*
* Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
@@ -27,11 +27,11 @@
#define ATI_NAME "ATI"
#define ATI_DRIVER_NAME "ati"
-#define ATI_VERSION_NAME "6.3.4"
+#define ATI_VERSION_NAME "6.3.6"
#define ATI_VERSION_MAJOR 6
#define ATI_VERSION_MINOR 3
-#define ATI_VERSION_PATCH 4
+#define ATI_VERSION_PATCH 6
#define ATI_VERSION_CURRENT \
((ATI_VERSION_MAJOR << 20) | (ATI_VERSION_MINOR << 10) | ATI_VERSION_PATCH)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c
new file mode 100644
index 000000000..0a67bf086
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c
@@ -0,0 +1,52 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c,v 1.1 2001/05/09 03:12:04 tsi Exp $ */
+/*
+ * Copyright 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of Marc Aurele La France not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Marc Aurele La France makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as-is" without express or implied warranty.
+ *
+ * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
+ * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "atistruct.h"
+#include "atixv.h"
+
+#include "xf86xv.h"
+
+/*
+ * ATIInitializeXVideo --
+ *
+ * This function is called to initialise XVideo extension support on a screen.
+ */
+Bool
+ATIInitializeXVideo
+(
+ ScreenPtr pScreen,
+ ScrnInfoPtr pScreenInfo,
+ ATIPtr pATI
+)
+{
+ XF86VideoAdaptorPtr *ppAdaptor;
+ int nAdaptor;
+
+ if (!(pScreenInfo->memPhysBase = pATI->LinearBase))
+ return FALSE;
+
+ pScreenInfo->fbOffset = 0;
+
+ nAdaptor = xf86XVListGenericAdaptors(pScreenInfo, &ppAdaptor);
+ return xf86XVScreenInit(pScreen, ppAdaptor, nAdaptor);
+}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h
new file mode 100644
index 000000000..6143539d7
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h
@@ -0,0 +1,35 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h,v 1.1 2001/05/09 03:12:04 tsi Exp $ */
+/*
+ * Copyright 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of Marc Aurele La France not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Marc Aurele La France makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as-is" without express or implied warranty.
+ *
+ * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
+ * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef ___ATIXV_H___
+#define ___ATIXV_H___ 1
+
+#include "atipriv.h"
+#include "atiproto.h"
+
+#include "xf86str.h"
+
+extern Bool ATIInitializeXVideo FunctionPrototype((ScreenPtr, ScrnInfoPtr,
+ ATIPtr));
+
+#endif /* ___ATIXV_H___ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h
index f4d818fd0..4e2f846d3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v 1.11 2001/04/10 16:07:58 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v 1.13 2001/05/15 10:19:36 eich Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
@@ -351,6 +351,7 @@ typedef struct {
void (*VideoTimerCallback)(ScrnInfoPtr, Time);
int videoKey;
Bool showCache;
+ OptionInfoPtr Options;
} R128InfoRec, *R128InfoPtr;
#define R128WaitForFifo(pScrn, entries) \
@@ -403,7 +404,8 @@ do { \
#define R128CCE_RESET(pScrn, info) \
do { \
- if (R128CCE_USE_RING_BUFFER(info->CCEMode)) { \
+ if (info->directRenderingEnabled \
+ && R128CCE_USE_RING_BUFFER(info->CCEMode)) { \
int _ret = drmR128ResetCCE(info->drmFD); \
if (_ret) { \
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, \
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man
index 119b63e9b..de9cd7ff7 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man,v 1.2 2001/01/27 18:20:46 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man,v 1.2.2.1 2001/06/01 02:24:17 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH R128 __drivermansuffix__ __vendorversion__
@@ -67,6 +67,58 @@ are used. The default is
This overrides the default pixel value for the YUV video overlay key.
The default value is
.B undefined.
+.TP
+.BI "Option \*qDisplay\*q \*q" string \*q
+Select display mode for devices which support flat panels. Supported modes are:
+
+.B \*qFP\*q
+- use flat panel;
+
+.B \*qCRT\*q
+- use cathode ray tube;
+
+.B \*qMirror\*q
+- use both FP and CRT;
+
+.B \*qBIOS\*q
+- use mode as configured in the BIOS.
+
+The default is
+.B FP.
+
+.PP
+The following
+.B Options
+are mostly important for non-x86 architectures:
+.TP
+.BI "Option \*qProgramFPRegs\*q \*q" boolean \*q
+Enable or disable programming of the flat panel registers.
+Beware that this may damage your panel, so use this
+.B at your own risk.
+The default depends on the device.
+.TP
+.BI "Option \*qPanelWidth\*q \*q" integer \*q
+.TP
+.BI "Option \*qPanelHeight\*q \*q" integer \*q
+Override the flat panel dimensions in pixels. They are used to program the flat panel
+registers and normally determined using the video card BIOS. If the wrong dimensions
+are used, the system may hang.
+.TP
+.BI "Option \*qUseFBDev\*q \*q" boolean \*q
+Enable or disable use of an OS-specific framebuffer device interface
+(which is not supported on all OSs). See fbdevhw(__drivermansuffix__)
+for further information.
+Default: off.
+
+.PP
+The following additional
+.B Options
+are supported:
+.TP
+.BI "Option \*qShowCache\*q \*q" boolean \*q
+Enable or disable viewing offscreen cache memory. A
+development debug option. Default: off.
+
.SH "SEE ALSO"
XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
.SH AUTHORS
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c
index e069d9100..9deb6ff94 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v 1.13 2001/04/10 16:07:59 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v 1.14 2001/05/02 15:06:08 dawes Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
@@ -80,8 +80,8 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
case 8: /* 8bpp mode is not support */
case 15: /* FIXME */
case 24: /* FIXME */
- xf86DrvMsg(pScreen->myNum, X_WARNING,
- "R128DRIScreenInit failed (depth %d not supported). "
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] R128DRIScreenInit failed (depth %d not supported). "
"Disabling DRI.\n", info->CurrentLayout.pixel_code);
return FALSE;
@@ -200,16 +200,16 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].redSize = 8;
pConfigs[i].greenSize = 8;
pConfigs[i].blueSize = 8;
- pConfigs[i].alphaSize = 8;
+ pConfigs[i].alphaSize = 0;
pConfigs[i].redMask = 0x00FF0000;
pConfigs[i].greenMask = 0x0000FF00;
pConfigs[i].blueMask = 0x000000FF;
- pConfigs[i].alphaMask = 0xFF000000;
+ pConfigs[i].alphaMask = 0x00000000;
if (accum) { /* Simulated in software */
pConfigs[i].accumRedSize = 16;
pConfigs[i].accumGreenSize = 16;
pConfigs[i].accumBlueSize = 16;
- pConfigs[i].accumAlphaSize = 16;
+ pConfigs[i].accumAlphaSize = 0;
} else {
pConfigs[i].accumRedSize = 0;
pConfigs[i].accumGreenSize = 0;
@@ -877,7 +877,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE;
if (!xf86LoaderCheckSymbol("DRIQueryVersion")) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "R128DRIScreenInit failed (libdri.a too old)\n");
+ "[dri] R128DRIScreenInit failed (libdri.a too old)\n");
return FALSE;
}
@@ -885,10 +885,10 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
DRIQueryVersion(&major, &minor, &patch);
if (major != 4 || minor < 0) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "R128DRIScreenInit failed "
- "(DRI version = %d.%d.%d, expected 4.0.x). "
- "Disabling DRI.\n",
- major, minor, patch);
+ "[dri] R128DRIScreenInit failed because of a version mismatch.\n"
+ "[dri] libDRI version is %d.%d.%d but version 4.0.x is needed.\n"
+ "[dri] Disabling the DRI.\n",
+ major, minor, patch);
return FALSE;
}
@@ -897,6 +897,9 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
/* These modes are not supported (yet). */
case 15:
case 24:
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] R128DRIScreenInit failed (depth %d not supported). "
+ "[dri] Disabling DRI.\n", info->CurrentLayout.pixel_code);
return FALSE;
/* Only 16 and 32 color depths are supports currently. */
@@ -943,7 +946,8 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
* in the SAREA header
*/
if (sizeof(XF86DRISAREARec)+sizeof(R128SAREAPriv)>SAREA_MAX) {
- ErrorF("Data does not fit in SAREA\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] Data does not fit in SAREA. Disabling DRI.\n");
return FALSE;
}
pDRIInfo->SAREASize = SAREA_MAX;
@@ -969,7 +973,8 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
pDRIInfo->createDummyCtxPriv = FALSE;
if (!DRIScreenInit(pScreen, pDRIInfo, &info->drmFD)) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "DRIScreenInit failed!\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] DRIScreenInit failed. Disabling DRI.\n");
xfree(pDRIInfo->devPrivate);
pDRIInfo->devPrivate = NULL;
DRIDestroyInfoRec(pDRIInfo);
@@ -980,16 +985,16 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
/* Check the r128 DRM version */
version = drmGetVersion(info->drmFD);
if (version) {
- if (version->version_major != 2 ||
- version->version_minor < 1) {
+ if (version->version_major != 3 ||
+ version->version_minor < 0) {
/* incompatible drm version */
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "R128DRIScreenInit failed "
- "(DRM version = %d.%d.%d, expected 2.1.x). "
- "Disabling DRI.\n",
- version->version_major,
- version->version_minor,
- version->version_patchlevel);
+ "[dri] R128DRIScreenInit failed because of a version mismatch.\n"
+ "[dri] r128.o kernel module version is %d.%d.%d but version 3.x is needed.\n"
+ "[dri] Disabling the DRI.\n",
+ version->version_major,
+ version->version_minor,
+ version->version_patchlevel);
drmFreeVersion(version);
R128DRICloseScreen(pScreen);
return FALSE;
@@ -1001,9 +1006,9 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
if (!info->IsPCI && !R128DRIAgpInit(info, pScreen)) {
info->IsPCI = TRUE;
xf86DrvMsg(pScreen->myNum, X_WARNING,
- "AGP failed to initialize -- falling back to PCI mode.\n");
+ "[agp] AGP failed to initialize -- falling back to PCI mode.\n");
xf86DrvMsg(pScreen->myNum, X_WARNING,
- "Make sure you have the agpgart kernel module loaded.\n");
+ "[agp] Make sure you have the agpgart kernel module loaded.\n");
}
/* Initialize PCIGART */
@@ -1026,7 +1031,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
R128DRICloseScreen(pScreen);
return FALSE;
}
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Visual configs initialized\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] Visual configs initialized\n");
return TRUE;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c
index 5f3f1cbf3..c8003be38 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c,v 1.26 2001/04/10 16:07:59 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c,v 1.29.2.1 2001/05/24 19:43:39 dawes Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
@@ -140,7 +140,7 @@ typedef enum {
/* FIXME: Disable CRTOnly until it is tested */
OPTION_CRT,
#endif
- OPTION_BIOS_DISPLAY,
+ OPTION_DISPLAY,
OPTION_PANEL_WIDTH,
OPTION_PANEL_HEIGHT,
OPTION_PROG_FP_REGS,
@@ -149,7 +149,7 @@ typedef enum {
OPTION_SHOW_CACHE
} R128Opts;
-OptionInfoRec R128Options[] = {
+const OptionInfoRec R128Options[] = {
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_DAC_6BIT, "Dac6Bit", OPTV_BOOLEAN, {0}, FALSE },
@@ -165,7 +165,7 @@ OptionInfoRec R128Options[] = {
{ OPTION_BUFFER_SIZE, "BufferSize", OPTV_INTEGER, {0}, FALSE },
{ OPTION_USE_CCE_2D, "UseCCEfor2D", OPTV_BOOLEAN, {0}, FALSE },
#endif
- { OPTION_BIOS_DISPLAY, "UseBIOSDisplay", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_DISPLAY, "Display", OPTV_STRING, {0}, FALSE },
{ OPTION_PANEL_WIDTH, "PanelWidth", OPTV_INTEGER, {0}, FALSE },
{ OPTION_PANEL_HEIGHT, "PanelHeight", OPTV_INTEGER, {0}, FALSE },
{ OPTION_PROG_FP_REGS, "ProgramFPRegs", OPTV_BOOLEAN, {0}, FALSE },
@@ -768,7 +768,7 @@ static Bool R128PreInitWeight(ScrnInfoPtr pScrn)
if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) return FALSE;
} else {
pScrn->rgbBits = 8;
- if (xf86ReturnOptValBool(R128Options, OPTION_DAC_6BIT, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_DAC_6BIT, FALSE)) {
pScrn->rgbBits = 6;
info->dac6bits = TRUE;
}
@@ -876,7 +876,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
}
/* Flat panel (part 1) */
- if (xf86GetOptValBool(R128Options, OPTION_PROG_FP_REGS,
+ if (xf86GetOptValBool(info->Options, OPTION_PROG_FP_REGS,
&info->HasPanelRegs)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Turned flat panel register programming %s\n",
@@ -915,15 +915,31 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
/* On non-flat panel systems, the default is to display to the CRT,
and on flat panel systems, the default is to display to the flat
- panel unless the user explicity enables displaying to the device
- initialized in the BIOS via the "UseBIOSDisplay" config file
- setting. BIOS_5_SCRATCH holds the display device on flat panel
- systems only. */
+ panel unless the user explicity chooses otherwise using the "Display"
+ config file setting. BIOS_5_SCRATCH holds the display device on flat
+ panel systems only. */
if (info->HasPanelRegs) {
- if (xf86ReturnOptValBool(R128Options, OPTION_BIOS_DISPLAY, FALSE))
- info->BIOSDisplay = INREG8(R128_BIOS_5_SCRATCH);
- else
+ char *display = xf86GetOptValString(info->Options, OPTION_DISPLAY);
+
+ if (info->FBDev)
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Option \"Display\" ignored "
+ "(framebuffer device determines display type)\n");
+ else if (!display || !xf86NameCmp(display, "FP"))
info->BIOSDisplay = R128_BIOS_DISPLAY_FP;
+ else if (!xf86NameCmp(display, "BIOS"))
+ info->BIOSDisplay = INREG8(R128_BIOS_5_SCRATCH);
+ else if (!xf86NameCmp(display, "Mirror"))
+ info->BIOSDisplay = R128_BIOS_DISPLAY_FP_CRT;
+ else if (!xf86NameCmp(display, "CRT"))
+ info->BIOSDisplay = R128_BIOS_DISPLAY_CRT;
+ else {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Unsupported type \"%s\" specified for Option \"Display\".\n"
+ "\tSupported types are: "
+ "\"BIOS\", \"Mirror\", \"CRT\" and \"FP\"\n", display);
+ return FALSE;
+ }
} else {
info->BIOSDisplay = R128_BIOS_DISPLAY_CRT;
}
@@ -987,12 +1003,12 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
/* Panel width/height overrides */
info->PanelXRes = 0;
info->PanelYRes = 0;
- if (xf86GetOptValInteger(R128Options,
+ if (xf86GetOptValInteger(info->Options,
OPTION_PANEL_WIDTH, &(info->PanelXRes))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Flat panel width: %d\n", info->PanelXRes);
}
- if (xf86GetOptValInteger(R128Options,
+ if (xf86GetOptValInteger(info->Options,
OPTION_PANEL_HEIGHT, &(info->PanelYRes))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Flat panel height: %d\n", info->PanelYRes);
@@ -1001,7 +1017,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
#ifdef XF86DRI
/* AGP/PCI */
- if (xf86ReturnOptValBool(R128Options, OPTION_IS_PCI, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_IS_PCI, FALSE)) {
info->IsPCI = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forced into PCI-only mode\n");
} else {
@@ -1096,8 +1112,8 @@ static Bool R128PreInitModes(ScrnInfoPtr pScrn)
64 * pScrn->bitsPerPixel, /* pitchInc */
128, /* minHeight */
2048, /* maxHeight */
- pScrn->virtualX,
- pScrn->virtualY,
+ pScrn->display->virtualX,
+ pScrn->display->virtualY,
info->FbMapSize,
LOOKUP_BEST_REFRESH);
@@ -1153,7 +1169,9 @@ static Bool R128PreInitModes(ScrnInfoPtr pScrn)
/* This is called by R128PreInit to initialize the hardware cursor. */
static Bool R128PreInitCursor(ScrnInfoPtr pScrn)
{
- if (!xf86ReturnOptValBool(R128Options, OPTION_SW_CURSOR, FALSE)) {
+ R128InfoPtr info = R128PTR(pScrn);
+
+ if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE;
}
return TRUE;
@@ -1162,7 +1180,9 @@ static Bool R128PreInitCursor(ScrnInfoPtr pScrn)
/* This is called by R128PreInit to initialize hardware acceleration. */
static Bool R128PreInitAccel(ScrnInfoPtr pScrn)
{
- if (!xf86ReturnOptValBool(R128Options, OPTION_NOACCEL, FALSE)) {
+ R128InfoPtr info = R128PTR(pScrn);
+
+ if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
if (!xf86LoadSubModule(pScrn, "xaa")) return FALSE;
}
return TRUE;
@@ -1186,21 +1206,21 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn)
{
R128InfoPtr info = R128PTR(pScrn);
- if (xf86ReturnOptValBool(R128Options, OPTION_CCE_PIO, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_CCE_PIO, FALSE)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing CCE into PIO mode\n");
info->CCEMode = R128_DEFAULT_CCE_PIO_MODE;
} else {
info->CCEMode = R128_DEFAULT_CCE_BM_MODE;
}
- if (xf86ReturnOptValBool(R128Options, OPTION_USE_CCE_2D, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_USE_CCE_2D, FALSE)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using CCE for 2D\n");
info->CCE2D = TRUE;
} else {
info->CCE2D = FALSE;
}
- if (xf86ReturnOptValBool(R128Options, OPTION_NO_SECURITY, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_NO_SECURITY, FALSE)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"WARNING!!! CCE Security checks disabled!!! **********\n");
info->CCESecure = FALSE;
@@ -1217,7 +1237,7 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn)
info->CCEusecTimeout = R128_DEFAULT_CCE_TIMEOUT;
if (!info->IsPCI) {
- if (xf86GetOptValInteger(R128Options,
+ if (xf86GetOptValInteger(info->Options,
OPTION_AGP_MODE, &(info->agpMode))) {
if (info->agpMode < 1 || info->agpMode > R128_AGP_MAX_MODE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1228,7 +1248,7 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn)
"Using AGP %dx mode\n", info->agpMode);
}
- if (xf86GetOptValInteger(R128Options,
+ if (xf86GetOptValInteger(info->Options,
OPTION_AGP_SIZE, (int *)&(info->agpSize))) {
switch (info->agpSize) {
case 4:
@@ -1246,7 +1266,7 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn)
}
}
- if (xf86GetOptValInteger(R128Options,
+ if (xf86GetOptValInteger(info->Options,
OPTION_RING_SIZE, &(info->ringSize))) {
if (info->ringSize < 1 || info->ringSize >= (int)info->agpSize) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1256,7 +1276,7 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn)
}
}
- if (xf86GetOptValInteger(R128Options,
+ if (xf86GetOptValInteger(info->Options,
OPTION_BUFFER_SIZE, &(info->bufSize))) {
if (info->bufSize < 1 || info->bufSize >= (int)info->agpSize) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1284,7 +1304,7 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn)
info->agpTexSize = info->agpSize - (info->ringSize + info->bufSize);
}
- if (xf86GetOptValInteger(R128Options, OPTION_USEC_TIMEOUT,
+ if (xf86GetOptValInteger(info->Options, OPTION_USEC_TIMEOUT,
&(info->CCEusecTimeout))) {
/* This option checked by the R128 DRM kernel module */
}
@@ -1379,23 +1399,25 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
/* We can't do this until we have a
pScrn->display. */
xf86CollectOptions(pScrn, NULL);
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, R128Options);
+ if (!(info->Options = xalloc(sizeof(R128Options)))) goto fail;
+ memcpy(info->Options, R128Options, sizeof(R128Options));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options);
if (!R128PreInitWeight(pScrn)) goto fail;
- if(xf86GetOptValInteger(R128Options, OPTION_VIDEO_KEY, &(info->videoKey))) {
+ if(xf86GetOptValInteger(info->Options, OPTION_VIDEO_KEY, &(info->videoKey))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
info->videoKey);
} else {
info->videoKey = 0x1E;
}
- if (xf86ReturnOptValBool(R128Options, OPTION_SHOW_CACHE, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_SHOW_CACHE, FALSE)) {
info->showCache = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n");
}
- if (xf86ReturnOptValBool(R128Options, OPTION_FBDEV, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_FBDEV, FALSE)) {
info->FBDev = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Using framebuffer device\n");
@@ -1591,7 +1613,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
info->CurrentLayout.pixel_bytes);
int maxy = info->FbMapSize / width_bytes;
- if (xf86ReturnOptValBool(R128Options, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
xf86DrvMsg(scrnIndex, X_WARNING,
"Acceleration disabled, not initializing the DRI\n");
info->directRenderingEnabled = FALSE;
@@ -1896,7 +1918,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86SetSilkenMouse(pScreen);
/* Acceleration setup */
- if (!xf86ReturnOptValBool(R128Options, OPTION_NOACCEL, FALSE)) {
+ if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
if (R128AccelInit(pScreen)) {
xf86DrvMsg(scrnIndex, X_INFO, "Acceleration enabled\n");
info->accelOn = TRUE;
@@ -1915,7 +1937,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
/* Hardware cursor setup */
- if (!xf86ReturnOptValBool(R128Options, OPTION_SW_CURSOR, FALSE)) {
+ if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
if (R128CursorInit(pScreen)) {
int width, height;
@@ -1949,7 +1971,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#endif
)) return FALSE;
- /* DPMS setup */
+ /* DPMS setup - FIXME: also for mirror mode? - Michel */
if (!info->HasPanelRegs || info->BIOSDisplay == R128_BIOS_DISPLAY_CRT)
xf86DPMSInit(pScreen, R128DisplayPowerManagementSet, 0);
@@ -2414,6 +2436,9 @@ static Bool R128InitCrtcRegisters(ScrnInfoPtr pScrn, R128SavePtr save,
: 0)
| ((mode->Flags & V_INTERLACE)
? R128_CRTC_INTERLACE_EN
+ : 0)
+ | ((mode->Flags & V_CSYNC)
+ ? R128_CRTC_CSYNC_EN
: 0));
save->crtc_ext_cntl = R128_VGA_ATI_LINEAR | R128_XCRT_CNT_EN;
@@ -2576,8 +2601,8 @@ static void R128InitFPRegisters(R128SavePtr orig, R128SavePtr save,
}
/* Define PLL registers for requested video mode. */
-static void R128InitPLLRegisters(R128SavePtr save, R128PLLPtr pll,
- double dot_clock)
+static void R128InitPLLRegisters(ScrnInfoPtr pScrn, R128SavePtr save,
+ R128PLLPtr pll, double dot_clock)
{
unsigned long freq = dot_clock * 100;
struct {
@@ -2756,7 +2781,7 @@ static Bool R128Init(ScrnInfoPtr pScrn, DisplayModePtr mode, R128SavePtr save)
if (!R128InitCrtcRegisters(pScrn, save, mode, info)) return FALSE;
if (info->HasPanelRegs)
R128InitFPRegisters(&info->SavedReg, save, mode, info);
- R128InitPLLRegisters(save, &info->pll, dot_clock);
+ R128InitPLLRegisters(pScrn, save, &info->pll, dot_clock);
if (!R128InitDDARegisters(pScrn, save, &info->pll, info))
return FALSE;
if (!info->PaletteSavedOnVT) R128InitPalette(save);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c
index 39921b245..0e2783916 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c,v 1.9 2001/04/01 14:00:09 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c,v 1.10 2001/05/04 19:05:33 dawes Exp $ */
/*
* Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
* Precision Insight, Inc., Cedar Park, Texas, and
@@ -105,7 +105,7 @@ PciChipsets R128PciChipsets[] = {
};
/* Return the options for supported chipset 'n'; NULL otherwise */
-OptionInfoPtr
+const OptionInfoRec *
R128AvailableOptions(int chipid, int busid)
{
int i;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h
index 4d5ea691e..78c81c2da 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h,v 1.3 2000/11/18 19:37:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h,v 1.5 2001/05/07 21:59:06 tsi Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -42,34 +42,35 @@
#include "xf86str.h"
/* r128_probe.c */
-extern OptionInfoPtr R128AvailableOptions
- FunctionPrototype((int, int));
-extern void R128Identify
- FunctionPrototype((int));
-extern Bool R128Probe
- FunctionPrototype((DriverPtr, int));
+extern const OptionInfoRec * R128AvailableOptions
+ FunctionPrototype((int, int));
+extern void R128Identify
+ FunctionPrototype((int));
+extern Bool R128Probe
+ FunctionPrototype((DriverPtr, int));
-extern SymTabRec R128Chipsets[];
-extern PciChipsets R128PciChipsets[];
+extern SymTabRec R128Chipsets[];
+extern PciChipsets R128PciChipsets[];
/* r128_driver.c */
-extern Bool R128PreInit
- FunctionPrototype((ScrnInfoPtr, int));
-extern Bool R128ScreenInit
- FunctionPrototype((int, ScreenPtr, int, char **));
-extern Bool R128SwitchMode
- FunctionPrototype((int, DisplayModePtr, int));
-extern void R128AdjustFrame
- FunctionPrototype((int, int, int, int));
-extern Bool R128EnterVT
- FunctionPrototype((int, int));
-extern void R128LeaveVT
- FunctionPrototype((int, int));
-extern void R128FreeScreen
- FunctionPrototype((int, int));
-extern int R128ValidMode
- FunctionPrototype((int, DisplayModePtr, Bool, int));
+extern Bool R128PreInit
+ FunctionPrototype((ScrnInfoPtr, int));
+extern Bool R128ScreenInit
+ FunctionPrototype((int, ScreenPtr, int, char **));
+extern Bool R128SwitchMode
+ FunctionPrototype((int, DisplayModePtr, int));
+extern void R128AdjustFrame
+ FunctionPrototype((int, int, int, int));
+extern Bool R128EnterVT
+ FunctionPrototype((int, int));
+extern void R128LeaveVT
+ FunctionPrototype((int, int));
+extern void R128FreeScreen
+ FunctionPrototype((int, int));
+extern int R128ValidMode
+ FunctionPrototype((int, DisplayModePtr, Bool,
+ int));
-extern OptionInfoRec R128Options[];
+extern const OptionInfoRec R128Options[];
#endif /* _R128_PROBE_H_ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h
index 4a51516f4..9b4a3e2be 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v 1.18 2001/04/16 15:02:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v 1.19 2001/05/04 19:05:33 dawes Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -376,6 +376,7 @@ typedef struct {
void (*VideoTimerCallback)(ScrnInfoPtr, Time);
int videoKey;
Bool showCache;
+ OptionInfoPtr Options;
} RADEONInfoRec, *RADEONInfoPtr;
#define RADEONWaitForFifo(pScrn, entries) \
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c
index 55c481090..023dcd3f4 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c,v 1.13 2001/03/28 20:08:22 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c,v 1.14 2001/05/02 15:06:08 dawes Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -238,8 +238,13 @@ void RADEONEngineReset(ScrnInfoPtr pScrn)
clock_cntl_index = INREG(RADEON_CLOCK_CNTL_INDEX);
mclk_cntl = INPLL(pScrn, RADEON_MCLK_CNTL);
- /* FIXME: Remove magic numbers! */
- OUTPLL(RADEON_MCLK_CNTL, (mclk_cntl | 0x003f0000));
+ OUTPLL(RADEON_MCLK_CNTL, (mclk_cntl |
+ RADEON_FORCEON_MCLKA |
+ RADEON_FORCEON_MCLKB |
+ RADEON_FORCEON_YCLKA |
+ RADEON_FORCEON_YCLKB |
+ RADEON_FORCEON_MC |
+ RADEON_FORCEON_AIC));
rbbm_soft_reset = INREG(RADEON_RBBM_SOFT_RESET);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c
index 9ce6221a8..79011ea77 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c,v 1.12 2001/04/16 15:02:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c,v 1.13 2001/05/02 15:06:08 dawes Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario,
* VA Linux Systems Inc., Fremont, California.
@@ -52,6 +52,12 @@
#include "GL/glxtokens.h"
#include "sarea.h"
+#if defined(__alpha__)
+# define PCIGART_ENABLED
+#else
+# undef PCIGART_ENABLED
+#endif
+
/* ?? HACK - for now, put this here... */
/* ?? Alpha - this may need to be a variable to handle UP1x00 vs TITAN */
#if defined(__alpha__)
@@ -78,6 +84,9 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
case 8: /* 8bpp mode is not support */
case 15: /* FIXME */
case 24: /* FIXME */
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] RADEONInitVisualConfigs failed (depth %d not supported). "
+ "Disabling DRI.\n", info->CurrentLayout.pixel_code);
return FALSE;
#define RADEON_USE_ACCUM 1
@@ -265,7 +274,7 @@ static Bool RADEONCreateContext(ScreenPtr pScreen, VisualPtr visual,
DRM_REMOVABLE,
&ctx_info->sarea_handle) < 0) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "[DRI] could not create private sarea for ctx id (%d)\n",
+ "[dri] could not create private sarea for ctx id (%d)\n",
(int)hwContext);
return FALSE;
}
@@ -273,7 +282,7 @@ static Bool RADEONCreateContext(ScreenPtr pScreen, VisualPtr visual,
if (drmAddContextPrivateMapping(info->drmFD, hwContext,
ctx_info->sarea_handle) < 0) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "[DRI] could not associate private sarea to ctx id (%d)\n",
+ "[dri] could not associate private sarea to ctx id (%d)\n",
(int)hwContext);
drmRmMap(info->drmFD, ctx_info->sarea_handle);
return FALSE;
@@ -298,7 +307,7 @@ static void RADEONDestroyContext(ScreenPtr pScreen, drmContext hwContext,
if (drmRmMap(info->drmFD, ctx_info->sarea_handle) < 0) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "[DRI] could not remove private sarea for ctx id (%d)\n",
+ "[dri] could not remove private sarea for ctx id (%d)\n",
(int)hwContext);
}
#endif
@@ -530,7 +539,7 @@ static void RADEONDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 indx)
pSAREAPriv->boxes, pSAREAPriv->nbox);
if (ret) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "DRIInitBuffers timed out, resetting engine...\n");
+ "[dri] DRIInitBuffers timed out, resetting engine...\n");
RADEONEngineReset(pScrn);
RADEONEngineRestore(pScrn);
RADEONCP_RESET(pScrn, info);
@@ -867,7 +876,7 @@ static Bool RADEONDRIAgpInit(RADEONInfoPtr info, ScreenPtr pScreen)
return TRUE;
}
-#if 0
+#if defined(PCIGART_ENABLED)
/* Initialize the PCIGART state. Request memory for use in PCI space,
and initialize the Radeon registers to point to that memory. */
static Bool RADEONDRIPciInit(RADEONInfoPtr info, ScreenPtr pScreen)
@@ -1035,7 +1044,7 @@ static Bool RADEONDRIBufInit(RADEONInfoPtr info, ScreenPtr pScreen)
{
/* Initialize vertex buffers */
if (info->IsPCI) {
-#if 1
+#if !defined(PCIGART_ENABLED)
return TRUE;
#else
info->bufNumBufs = drmAddBufs(info->drmFD,
@@ -1108,7 +1117,7 @@ static void RADEONDRISAREAInit(ScreenPtr pScreen,
break;
default:
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "RADEONDRISAREAInit failed: Unsupported depth (%d bpp)\n",
+ "[dri] RADEONDRISAREAInit failed: Unsupported depth (%d bpp). Disabling DRI.\n",
info->CurrentLayout.pixel_code);
return;
}
@@ -1292,7 +1301,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE;
if (!xf86LoaderCheckSymbol("DRIQueryVersion")) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "RADEONDRIScreenInit failed (libdri.a too old)\n");
+ "[dri] RADEONDRIScreenInit failed (libdri.a too old)\n");
return FALSE;
}
@@ -1300,18 +1309,21 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
DRIQueryVersion(&major, &minor, &patch);
if (major != 4 || minor < 0) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "RADEONDRIScreenInit failed "
- "(DRI version = %d.%d.%d, expected 4.0.x). "
- "Disabling DRI.\n",
+ "[dri] RADEONDRIScreenInit failed because of a version mismatch.\n"
+ "[dri] libDRI version is %d.%d.%d but version 4.0.x is needed.\n"
+ "[dri] Disabling DRI.\n",
major, minor, patch);
return FALSE;
}
switch (info->CurrentLayout.pixel_code) {
case 8:
- /* These modes are not supported (yet). */
case 15:
case 24:
+ /* These modes are not supported (yet). */
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] RADEONInitVisualConfigs failed (depth %d not supported). "
+ "Disabling DRI.\n", info->CurrentLayout.pixel_code);
return FALSE;
/* Only 16 and 32 color depths are supports currently. */
@@ -1389,7 +1401,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
pDRIInfo->createDummyCtxPriv = FALSE;
if (!DRIScreenInit(pScreen, pDRIInfo, &info->drmFD)) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "DRIScreenInit failed!\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] DRIScreenInit failed. Disabling DRI.\n");
xfree(pDRIInfo->devPrivate);
pDRIInfo->devPrivate = NULL;
DRIDestroyInfoRec(pDRIInfo);
@@ -1404,12 +1416,12 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
version->version_minor < 1) {
/* incompatible drm version */
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "RADEONDRIScreenInit failed "
- "(DRM version = %d.%d.%d, expected 1.1.x). "
- "Disabling DRI.\n",
- version->version_major,
- version->version_minor,
- version->version_patchlevel);
+ "[dri] RADEONDRIScreenInit failed because of a version mismatch.\n"
+ "[dri] radeon.o kernel module version is %d.%d.%d but version 1.1.x is needed.\n"
+ "[dri] Disabling DRI.\n",
+ version->version_major,
+ version->version_minor,
+ version->version_patchlevel);
drmFreeVersion(version);
RADEONDRICloseScreen(pScreen);
return FALSE;
@@ -1417,7 +1429,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
drmFreeVersion(version);
}
-#if 1
+#if !defined(PCIGART_ENABLED)
/* Initialize AGP */
if (!info->IsPCI && !RADEONDRIAgpInit(info, pScreen)) {
RADEONDRICloseScreen(pScreen);
@@ -1426,7 +1438,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
/* Initialize PCI */
if (info->IsPCI) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "PCI cards not yet supported\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] PCI cards not yet supported. Disabling DRI.\n");
RADEONDRICloseScreen(pScreen);
return FALSE;
}
@@ -1435,9 +1447,9 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
if (!info->IsPCI && !RADEONDRIAgpInit(info, pScreen)) {
info->IsPCI = TRUE;
xf86DrvMsg(pScreen->myNum, X_WARNING,
- "AGP failed to initialize -- falling back to PCI mode.\n");
+ "[agp] AGP failed to initialize -- falling back to PCI mode.\n");
xf86DrvMsg(pScreen->myNum, X_WARNING,
- "Make sure you have the agpgart kernel module loaded.\n");
+ "[agp] Make sure you have the agpgart kernel module loaded.\n");
}
/* Initialize PCI */
@@ -1461,7 +1473,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen)
RADEONDRICloseScreen(pScreen);
return FALSE;
}
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Visual configs initialized\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] Visual configs initialized\n");
return TRUE;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c
index 400495fb2..3edf4a1e4 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.21 2001/04/27 14:40:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.25.2.2 2001/05/31 08:36:15 alanh Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -145,7 +145,7 @@ typedef enum {
OPTION_FBDEV
} RADEONOpts;
-OptionInfoRec RADEONOptions[] = {
+const OptionInfoRec RADEONOptions[] = {
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_DAC_6BIT, "Dac6Bit", OPTV_BOOLEAN, {0}, FALSE },
@@ -306,6 +306,106 @@ static const char *vbeSymbols[] = {
};
#endif
+#if !defined(__alpha__)
+# define RADEONPreInt10Save(s, r1, r2)
+# define RADEONPostInt10Check(s, r1, r2)
+#else /* __alpha__ */
+static void
+RADEONSaveRegsZapMemCntl(ScrnInfoPtr pScrn, CARD32 *MEM_CNTL, CARD32 *MEMSIZE)
+{
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ unsigned char *RADEONMMIO;
+ int mapped = 0;
+
+ /*
+ * First make sure we have the pci and mmio info and that mmio is mapped
+ */
+ if (!info->PciInfo)
+ info->PciInfo = xf86GetPciInfoForEntity(info->pEnt->index);
+ if (!info->PciTag)
+ info->PciTag = pciTag(info->PciInfo->bus, info->PciInfo->device,
+ info->PciInfo->func);
+ if (!info->MMIOAddr)
+ info->MMIOAddr = info->PciInfo->memBase[2] & 0xffffff00;
+ if (!info->MMIO) {
+ RADEONMapMMIO(pScrn);
+ mapped = 1;
+ }
+ RADEONMMIO = info->MMIO;
+
+ /*
+ * Save the values and zap MEM_CNTL
+ */
+ *MEM_CNTL = INREG(RADEON_MEM_CNTL);
+ *MEMSIZE = INREG(RADEON_CONFIG_MEMSIZE);
+ OUTREG(RADEON_MEM_CNTL, 0);
+
+ /*
+ * Unmap mmio space if we mapped it
+ */
+ if (mapped)
+ RADEONUnmapMMIO(pScrn);
+}
+
+static void
+RADEONCheckRegs(ScrnInfoPtr pScrn, CARD32 Saved_MEM_CNTL, CARD32 Saved_MEMSIZE)
+{
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ unsigned char *RADEONMMIO;
+ CARD32 MEM_CNTL;
+ int mapped = 0;
+
+ /*
+ * If we don't have a valid (non-zero) saved MEM_CNTL, get out now
+ */
+ if (!Saved_MEM_CNTL)
+ return;
+
+ /*
+ * First make sure that mmio is mapped
+ */
+ if (!info->MMIO) {
+ RADEONMapMMIO(pScrn);
+ mapped = 1;
+ }
+ RADEONMMIO = info->MMIO;
+
+ /*
+ * If either MEM_CNTL is currently zero or inconistent (configured for
+ * two channels with the two channels configured differently), restore
+ * the saved registers.
+ */
+ MEM_CNTL = INREG(RADEON_MEM_CNTL);
+ if (!MEM_CNTL ||
+ ((MEM_CNTL & 1) &&
+ (((MEM_CNTL >> 8) & 0xff) != ((MEM_CNTL >> 24) & 0xff)))) {
+ /*
+ * Restore the saved registers
+ */
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Restoring MEM_CNTL (%08x), setting to %08x\n",
+ MEM_CNTL, Saved_MEM_CNTL);
+ OUTREG(RADEON_MEM_CNTL, Saved_MEM_CNTL);
+
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Restoring CONFIG_MEMSIZE (%08x), setting to %08x\n",
+ INREG(RADEON_CONFIG_MEMSIZE), Saved_MEMSIZE);
+ OUTREG(RADEON_CONFIG_MEMSIZE, Saved_MEMSIZE);
+ }
+
+ /*
+ * Unmap mmio space if we mapped it
+ */
+ if (mapped)
+ RADEONUnmapMMIO(pScrn);
+}
+
+# define RADEONPreInt10Save(s, r1, r2) \
+ RADEONSaveRegsZapMemCntl((s), (r1), (r2))
+# define RADEONPostInt10Check(s, r1, r2) \
+ RADEONCheckRegs((s), (r1), (r2))
+#endif /* __alpha__ */
+
/* Allocate our private RADEONInfoRec. */
static Bool RADEONGetRec(ScrnInfoPtr pScrn)
{
@@ -731,7 +831,7 @@ static Bool RADEONPreInitWeight(ScrnInfoPtr pScrn)
if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) return FALSE;
} else {
pScrn->rgbBits = 8;
- if (xf86ReturnOptValBool(RADEONOptions, OPTION_DAC_6BIT, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_DAC_6BIT, FALSE)) {
pScrn->rgbBits = 6;
info->dac6bits = TRUE;
}
@@ -850,6 +950,7 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn)
case PCI_CHIP_RADEON_QE:
case PCI_CHIP_RADEON_QF:
case PCI_CHIP_RADEON_QG:
+ case PCI_CHIP_RADEON_VE:
default: info->HasPanelRegs = FALSE; break;
}
#endif
@@ -898,7 +999,7 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn)
"Using flat panel for display\n");
#else
/* Panel CRT mode override */
- if ((info->CRTOnly = xf86ReturnOptValBool(RADEONOptions,
+ if ((info->CRTOnly = xf86ReturnOptValBool(info->Options,
OPTION_CRT, FALSE))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Using external CRT instead of "
@@ -912,12 +1013,12 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn)
/* Panel width/height overrides */
info->PanelXRes = 0;
info->PanelYRes = 0;
- if (xf86GetOptValInteger(RADEONOptions,
+ if (xf86GetOptValInteger(info->Options,
OPTION_PANEL_WIDTH, &(info->PanelXRes))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Flat panel width: %d\n", info->PanelXRes);
}
- if (xf86GetOptValInteger(RADEONOptions,
+ if (xf86GetOptValInteger(info->Options,
OPTION_PANEL_HEIGHT, &(info->PanelYRes))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Flat panel height: %d\n", info->PanelYRes);
@@ -929,7 +1030,7 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn)
#ifdef XF86DRI
/* AGP/PCI */
- if (xf86ReturnOptValBool(RADEONOptions, OPTION_IS_PCI, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_IS_PCI, FALSE)) {
info->IsPCI = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forced into PCI-only mode\n");
} else {
@@ -941,6 +1042,7 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn)
case PCI_CHIP_RADEON_QE:
case PCI_CHIP_RADEON_QF:
case PCI_CHIP_RADEON_QG:
+ case PCI_CHIP_RADEON_VE:
default: info->IsPCI = FALSE; break;
}
}
@@ -1016,8 +1118,8 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn)
64 * pScrn->bitsPerPixel, /* pitchInc */
128, /* minHeight */
2048, /* maxHeight */
- pScrn->virtualX,
- pScrn->virtualY,
+ pScrn->display->virtualX,
+ pScrn->display->virtualY,
info->FbMapSize,
LOOKUP_BEST_REFRESH);
@@ -1067,7 +1169,9 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn)
/* This is called by RADEONPreInit to initialize the hardware cursor. */
static Bool RADEONPreInitCursor(ScrnInfoPtr pScrn)
{
- if (!xf86ReturnOptValBool(RADEONOptions, OPTION_SW_CURSOR, FALSE)) {
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+
+ if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE;
}
return TRUE;
@@ -1076,7 +1180,9 @@ static Bool RADEONPreInitCursor(ScrnInfoPtr pScrn)
/* This is called by RADEONPreInit to initialize hardware acceleration. */
static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn)
{
- if (!xf86ReturnOptValBool(RADEONOptions, OPTION_NOACCEL, FALSE)) {
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+
+ if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
if (!xf86LoadSubModule(pScrn, "xaa")) return FALSE;
}
return TRUE;
@@ -1098,7 +1204,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
- if (xf86ReturnOptValBool(RADEONOptions, OPTION_CP_PIO, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_CP_PIO, FALSE)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing CP into PIO mode\n");
info->CPMode = RADEON_DEFAULT_CP_PIO_MODE;
} else {
@@ -1114,7 +1220,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
info->CPusecTimeout = RADEON_DEFAULT_CP_TIMEOUT;
if (!info->IsPCI) {
- if (xf86GetOptValInteger(RADEONOptions,
+ if (xf86GetOptValInteger(info->Options,
OPTION_AGP_MODE, &(info->agpMode))) {
if (info->agpMode < 1 || info->agpMode > RADEON_AGP_MAX_MODE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1125,7 +1231,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
"Using AGP %dx mode\n", info->agpMode);
}
- if (xf86GetOptValInteger(RADEONOptions,
+ if (xf86GetOptValInteger(info->Options,
OPTION_AGP_SIZE, (int *)&(info->agpSize))) {
switch (info->agpSize) {
case 4:
@@ -1143,7 +1249,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
}
}
- if (xf86GetOptValInteger(RADEONOptions,
+ if (xf86GetOptValInteger(info->Options,
OPTION_RING_SIZE, &(info->ringSize))) {
if (info->ringSize < 1 || info->ringSize >= (int)info->agpSize) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1153,7 +1259,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
}
}
- if (xf86GetOptValInteger(RADEONOptions,
+ if (xf86GetOptValInteger(info->Options,
OPTION_BUFFER_SIZE, &(info->bufSize))) {
if (info->bufSize < 1 || info->bufSize >= (int)info->agpSize) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1181,13 +1287,13 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
info->agpTexSize = info->agpSize - (info->ringSize + info->bufSize);
}
- if (xf86GetOptValInteger(RADEONOptions, OPTION_USEC_TIMEOUT,
+ if (xf86GetOptValInteger(info->Options, OPTION_USEC_TIMEOUT,
&(info->CPusecTimeout))) {
/* This option checked by the RADEON DRM kernel module */
}
/* Depth moves are disabled by default since they are extremely slow */
- if ((info->depthMoves = xf86ReturnOptValBool(RADEONOptions,
+ if ((info->depthMoves = xf86ReturnOptValBool(info->Options,
OPTION_DEPTH_MOVE, FALSE))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Enabling depth moves\n");
} else {
@@ -1214,6 +1320,7 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
{
RADEONInfoPtr info;
xf86Int10InfoPtr pInt10 = NULL;
+ CARD32 save1, save2;
#ifdef XFree86LOADER
/*
@@ -1251,8 +1358,11 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
info->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if (info->pEnt->location.type != BUS_PCI) goto fail;
+ RADEONPreInt10Save(pScrn, &save1, &save2);
+
if (flags & PROBE_DETECT) {
RADEONProbeDDC(pScrn, info->pEnt->index);
+ RADEONPostInt10Check(pScrn, save1, save2);
return TRUE;
}
@@ -1284,11 +1394,13 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
/* We can't do this until we have a
pScrn->display. */
xf86CollectOptions(pScrn, NULL);
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, RADEONOptions);
+ if (!(info->Options = xalloc(sizeof(RADEONOptions)))) goto fail;
+ memcpy(info->Options, RADEONOptions, sizeof(RADEONOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options);
if (!RADEONPreInitWeight(pScrn)) goto fail;
- if (xf86ReturnOptValBool(RADEONOptions, OPTION_FBDEV, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_FBDEV, FALSE)) {
info->FBDev = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Using framebuffer device\n");
@@ -1309,13 +1421,18 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
if (!info->FBDev)
if (!RADEONPreInitInt10(pScrn, &pInt10)) goto fail;
+ RADEONPostInt10Check(pScrn, save1, save2);
+
if (!RADEONPreInitConfig(pScrn)) goto fail;
if (!RADEONGetBIOSParameters(pScrn, pInt10)) goto fail;
if (!RADEONGetPLLParameters(pScrn)) goto fail;
- if (!RADEONPreInitDDC(pScrn, pInt10)) goto fail;
+ /* shouldn't fail just because we can't get DDC */
+ RADEONPreInitDDC(pScrn, pInt10);
+
+ RADEONPostInt10Check(pScrn, save1, save2);
if (!RADEONPreInitGamma(pScrn)) goto fail;
@@ -1499,7 +1616,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
info->CurrentLayout.pixel_bytes);
int maxy = info->FbMapSize / width_bytes;
- if (xf86ReturnOptValBool(RADEONOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
xf86DrvMsg(scrnIndex, X_WARNING,
"Acceleration disabled, not initializing the DRI\n");
info->directRenderingEnabled = FALSE;
@@ -1779,7 +1896,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86SetSilkenMouse(pScreen);
/* Acceleration setup */
- if (!xf86ReturnOptValBool(RADEONOptions, OPTION_NOACCEL, FALSE)) {
+ if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
if (RADEONAccelInit(pScreen)) {
xf86DrvMsg(scrnIndex, X_INFO, "Acceleration enabled\n");
info->accelOn = TRUE;
@@ -1798,7 +1915,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
/* Hardware cursor setup */
- if (!xf86ReturnOptValBool(RADEONOptions, OPTION_SW_CURSOR, FALSE)) {
+ if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
if (RADEONCursorInit(pScreen)) {
int width, height;
@@ -2376,7 +2493,11 @@ static Bool RADEONInitCrtcRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save,
? RADEON_CRTC_INTERLACE_EN
: 0));
- save->crtc_ext_cntl = RADEON_VGA_ATI_LINEAR | RADEON_XCRT_CNT_EN;
+ if (info->Chipset == PCI_CHIP_RADEON_VE) {
+ save->crtc_ext_cntl = RADEON_VGA_ATI_LINEAR | RADEON_CRTC_CRT_ON;
+ } else {
+ save->crtc_ext_cntl = RADEON_VGA_ATI_LINEAR | RADEON_XCRT_CNT_EN;
+ }
save->dac_cntl = (RADEON_DAC_MASK_ALL
| RADEON_DAC_VGA_ADR_EN
| (info->dac6bits ? 0 : RADEON_DAC_8BIT_EN));
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c
index e1fdb6c87..474943ce8 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c,v 1.7 2001/04/01 14:00:10 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c,v 1.9 2001/05/04 19:05:33 dawes Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -78,6 +78,7 @@ SymTabRec RADEONChipsets[] = {
{ PCI_CHIP_RADEON_QE, "ATI Radeon QE (AGP)" },
{ PCI_CHIP_RADEON_QF, "ATI Radeon QF (AGP)" },
{ PCI_CHIP_RADEON_QG, "ATI Radeon QG (AGP)" },
+ { PCI_CHIP_RADEON_VE, "ATI Radeon VE (AGP)" },
{ -1, NULL }
};
@@ -86,11 +87,12 @@ PciChipsets RADEONPciChipsets[] = {
{ PCI_CHIP_RADEON_QE, PCI_CHIP_RADEON_QE, RES_SHARED_VGA },
{ PCI_CHIP_RADEON_QF, PCI_CHIP_RADEON_QF, RES_SHARED_VGA },
{ PCI_CHIP_RADEON_QG, PCI_CHIP_RADEON_QG, RES_SHARED_VGA },
+ { PCI_CHIP_RADEON_VE, PCI_CHIP_RADEON_VE, RES_SHARED_VGA },
{ -1, -1, RES_UNDEFINED }
};
/* Return the options for supported chipset 'n'; NULL otherwise */
-OptionInfoPtr
+const OptionInfoRec *
RADEONAvailableOptions(int chipid, int busid)
{
int i;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h
index 3ed541e7a..94f11d01e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h,v 1.3 2000/11/18 19:37:12 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h,v 1.5 2001/05/07 21:59:06 tsi Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -42,34 +42,35 @@
#include "xf86str.h"
/* radeon_probe.c */
-extern OptionInfoPtr RADEONAvailableOptions
- FunctionPrototype((int, int));
-extern void RADEONIdentify
- FunctionPrototype((int));
-extern Bool RADEONProbe
- FunctionPrototype((DriverPtr, int));
+extern const OptionInfoRec * RADEONAvailableOptions
+ FunctionPrototype((int, int));
+extern void RADEONIdentify
+ FunctionPrototype((int));
+extern Bool RADEONProbe
+ FunctionPrototype((DriverPtr, int));
-extern SymTabRec RADEONChipsets[];
-extern PciChipsets RADEONPciChipsets[];
+extern SymTabRec RADEONChipsets[];
+extern PciChipsets RADEONPciChipsets[];
/* radeon_driver.c */
-extern Bool RADEONPreInit
- FunctionPrototype((ScrnInfoPtr, int));
-extern Bool RADEONScreenInit
- FunctionPrototype((int, ScreenPtr, int, char **));
-extern Bool RADEONSwitchMode
- FunctionPrototype((int, DisplayModePtr, int));
-extern void RADEONAdjustFrame
- FunctionPrototype((int, int, int, int));
-extern Bool RADEONEnterVT
- FunctionPrototype((int, int));
-extern void RADEONLeaveVT
- FunctionPrototype((int, int));
-extern void RADEONFreeScreen
- FunctionPrototype((int, int));
-extern int RADEONValidMode
- FunctionPrototype((int, DisplayModePtr, Bool, int));
+extern Bool RADEONPreInit
+ FunctionPrototype((ScrnInfoPtr, int));
+extern Bool RADEONScreenInit
+ FunctionPrototype((int, ScreenPtr, int, char **));
+extern Bool RADEONSwitchMode
+ FunctionPrototype((int, DisplayModePtr, int));
+extern void RADEONAdjustFrame
+ FunctionPrototype((int, int, int, int));
+extern Bool RADEONEnterVT
+ FunctionPrototype((int, int));
+extern void RADEONLeaveVT
+ FunctionPrototype((int, int));
+extern void RADEONFreeScreen
+ FunctionPrototype((int, int));
+extern int RADEONValidMode
+ FunctionPrototype((int, DisplayModePtr, Bool,
+ int));
-extern OptionInfoRec RADEONOptions[];
+extern const OptionInfoRec RADEONOptions[];
#endif /* _RADEON_PROBE_H_ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h
index 0d006dfa5..68d4d2685 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h,v 1.8 2001/03/21 17:02:22 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h,v 1.9 2001/05/02 15:06:08 dawes Exp $ */
/*
* Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
* VA Linux Systems Inc., Fremont, California.
@@ -687,9 +687,12 @@
#define RADEON_MC_AGP_LOCATION 0x014c
#define RADEON_MC_FB_LOCATION 0x0148
#define RADEON_MCLK_CNTL 0x0012 /* PLL */
-# define RADEON_FORCE_GCP (1 << 16)
-# define RADEON_FORCE_PIPE3D_CP (1 << 17)
-# define RADEON_FORCE_RCP (1 << 18)
+# define RADEON_FORCEON_MCLKA (1 << 16)
+# define RADEON_FORCEON_MCLKB (1 << 17)
+# define RADEON_FORCEON_YCLKA (1 << 18)
+# define RADEON_FORCEON_YCLKB (1 << 19)
+# define RADEON_FORCEON_MC (1 << 20)
+# define RADEON_FORCEON_AIC (1 << 21)
#define RADEON_MDGPIO_A_REG 0x01ac
#define RADEON_MDGPIO_EN_REG 0x01b0
#define RADEON_MDGPIO_MASK 0x0198
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man b/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man
index 7c6a3a74a..04c35283f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man
+++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man,v 1.2 2001/01/27 18:20:47 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man,v 1.3 2001/05/09 19:57:04 dbateman Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH CHIPS __drivermansuffix__ __vendorversion__
@@ -157,6 +157,9 @@ Force the use of a particular video clock speed for use with the
flat panel at a specified depth
.TP
.BI "Option \*qMMIO\*q \*q" boolean \*q
+Force the use of memory mapped IO for acceleration registers. Default: off
+.TP
+.BI "Option \*qFullMMIO\*q \*q" boolean \*q
Force the use of memory mapped IO where it can be used. Default: off
.TP
.BI "Option \*qSuspendHack\*q \*q" boolean \*q
@@ -190,6 +193,19 @@ Default: off.
.BI "Option \*q18bitBus\*q \*q" boolean \*q
Force the driver to assume that the flat panel has an 18bit data bus.
Default: off.
+.TP
+.BI "Option \*qCrt2Memory\*q \*q" integer \*q
+In a dual-head mode (69030 only) this option selects the amount of memory
+to set aside for the second head. If not specified, half the memory is used.
+Default: off.
+.TP
+.BI "Option \*qDualRefresh\*q \*q" integer \*q
+The 69030 supports independent refresh rates on its two display channels.
+This mode of operations uses additional memory bandwidth and thus limits
+the maximum colour depth and refresh rate that can be achieved, and so is
+off by default. Using this option forces the use of an independent refresh
+rate on the two screens.
+Default: off.
.SH "SEE ALSO"
XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
.PP
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c
index 2b423086b..5c2789bdc 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c,v 1.35 2000/09/26 15:57:10 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c,v 1.36 2001/05/09 19:57:04 dbateman Exp $ */
/*
* Copyright 1996, 1997, 1998 by David Bateman <dbateman@ee.uts.edu.au>
* Modified 1997, 1998 by Nozomi Ytow
@@ -50,9 +50,6 @@
/* Drivers that use XAA need this */
#include "xf86fbman.h"
-/* The vga HW register stuff. Do we need this? */
-#include "vgaHW.h"
-
/* Our driver specific include file */
#include "ct_driver.h"
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c
index 048563e68..07d9db9c5 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c,v 1.20 2000/04/04 19:25:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c,v 1.23 2001/05/15 10:19:36 eich Exp $ */
/*
* Copyright 1994 The XFree86 Project
@@ -40,10 +40,6 @@
/* Drivers that need to access the PCI config space directly need this */
#include "xf86Pci.h"
-/* All drivers using the vgahw module need this */
-/* This driver needs to be modified to not use vgaHW for multihead operation */
-#include "vgaHW.h"
-
#include "xf86Cursor.h"
/* Driver specific headers */
@@ -74,6 +70,20 @@ CHIPSShowCursor(ScrnInfoPtr pScrn)
if (IS_HiQV(cPtr)) {
tmp = cPtr->readXR(cPtr, 0xA0);
cPtr->writeXR(cPtr, 0xA0, (tmp & 0xF8) | 5);
+ if (cPtr->UseDualChannel &&
+ (! xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned int IOSS, MSS;
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) |
+ MSS_PIPE_B));
+ tmp = cPtr->readXR(cPtr, 0xA0);
+ cPtr->writeXR(cPtr, 0xA0, (tmp & 0xF8) | 5);
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ }
} else {
if(!cPtr->UseMMIO) {
HW_DEBUG(0x8);
@@ -99,6 +109,20 @@ CHIPSHideCursor(ScrnInfoPtr pScrn)
if (IS_HiQV(cPtr)) {
tmp = cPtr->readXR(cPtr, 0xA0);
cPtr->writeXR(cPtr, 0xA0, tmp & 0xF8);
+ if (cPtr->UseDualChannel &&
+ (! xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned int IOSS, MSS;
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) |
+ MSS_PIPE_B));
+ tmp = cPtr->readXR(cPtr, 0xA0);
+ cPtr->writeXR(cPtr, 0xA0, tmp & 0xF8);
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ }
} else {
if(!cPtr->UseMMIO) {
HW_DEBUG(0x8);
@@ -133,6 +157,22 @@ CHIPSSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
cPtr->writeXR(cPtr, 0xA5, (x >> 8) & 0x87);
cPtr->writeXR(cPtr, 0xA6, y & 0xFF);
cPtr->writeXR(cPtr, 0xA7, (y >> 8) & 0x87);
+ if (cPtr->UseDualChannel &&
+ (! xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned int IOSS, MSS;
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) |
+ MSS_PIPE_B));
+ cPtr->writeXR(cPtr, 0xA4, x & 0xFF);
+ cPtr->writeXR(cPtr, 0xA5, (x >> 8) & 0x87);
+ cPtr->writeXR(cPtr, 0xA6, y & 0xFF);
+ cPtr->writeXR(cPtr, 0xA7, (y >> 8) & 0x87);
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ }
} else {
CARD32 xy;
@@ -188,6 +228,47 @@ CHIPSSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
}
/* Enable normal palette addressing */
cPtr->writeXR(cPtr, 0x80, xr80);
+
+ if (cPtr->UseDualChannel &&
+ (! xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned int IOSS, MSS;
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) |
+ MSS_PIPE_B));
+ /* Enable extended palette addressing */
+ xr80 = cPtr->readXR(cPtr, 0x80);
+ cPtr->writeXR(cPtr, 0x80, xr80 | 0x1);
+
+ /* Write the new colours to the extended VGA palette. Palette
+ * index is incremented after each write, so only write index
+ * once
+ */
+ hwp->writeDacWriteAddr(hwp, 0x04);
+ if (xr80 & 0x80) {
+ /* 8bit DAC */
+ hwp->writeDacData(hwp, (bg >> 16) & 0xFF);
+ hwp->writeDacData(hwp, (bg >> 8) & 0xFF);
+ hwp->writeDacData(hwp, bg & 0xFF);
+ hwp->writeDacData(hwp, (fg >> 16) & 0xFF);
+ hwp->writeDacData(hwp, (fg >> 8) & 0xFF);
+ hwp->writeDacData(hwp, fg & 0xFF);
+ } else {
+ /* 6bit DAC */
+ hwp->writeDacData(hwp, (bg >> 18) & 0xFF);
+ hwp->writeDacData(hwp, (bg >> 10) & 0xFF);
+ hwp->writeDacData(hwp, (bg >> 2) & 0xFF);
+ hwp->writeDacData(hwp, (fg >> 18) & 0xFF);
+ hwp->writeDacData(hwp, (fg >> 10) & 0xFF);
+ hwp->writeDacData(hwp, (fg >> 2) & 0xFF);
+ }
+ /* Enable normal palette addressing */
+ cPtr->writeXR(cPtr, 0x80, xr80);
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ }
} else if (IS_Wingine(cPtr)) {
outl(DR(0xA), (bg & 0xFFFFFF));
outl(DR(0x9), (fg & 0xFFFFFF));
@@ -215,6 +296,11 @@ CHIPSLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
CURSOR_SYNC(pScrn);
+ if (cPtr->cursorDelay) {
+ usleep(200000);
+ cPtr->cursorDelay = FALSE;
+ }
+
if (IS_Wingine(cPtr)) {
int i;
CARD32 *tmp = (CARD32 *)src;
@@ -258,6 +344,20 @@ CHIPSLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
if (IS_HiQV(cPtr)) {
cPtr->writeXR(cPtr, 0xA2, (cAcl->CursorAddress >> 8) & 0xFF);
cPtr->writeXR(cPtr, 0xA3, (cAcl->CursorAddress >> 16) & 0x3F);
+ if (cPtr->UseDualChannel &&
+ (! xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned int IOSS, MSS;
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) |
+ MSS_PIPE_B));
+ cPtr->writeXR(cPtr, 0xA2, (cAcl->CursorAddress >> 8) & 0xFF);
+ cPtr->writeXR(cPtr, 0xA3, (cAcl->CursorAddress >> 16) & 0x3F);
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ }
} else if (!IS_Wingine(cPtr)) {
if (!cPtr->UseMMIO) {
HW_DEBUG(0xC);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c
index c32a3695e..028668592 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c,v 1.7 2000/04/04 19:25:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c,v 1.8 2001/05/09 19:57:04 dbateman Exp $ */
/* All drivers should typically include these */
#include "xf86.h"
@@ -14,9 +14,6 @@
/* Drivers that need to access the PCI config space directly need this */
#include "xf86Pci.h"
-/* All drivers using the vgahw module need this */
-#include "vgaHW.h"
-
#include "ct_driver.h"
static Bool chips_TestI2C(int scrnIndex);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c
index 29bb3cbb1..55bff9a02 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c,v 1.106 2001/02/15 18:36:09 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c,v 1.110.2.1 2001/05/25 18:15:44 eich Exp $ */
/*
* Copyright 1993 by Jon Block <block@frc.com>
@@ -126,11 +126,13 @@
/* Needed for replacement LoadPalette function for Gamma Correction */
#include "xf86cmap.h"
+#include "dixstruct.h"
+
/* Driver specific headers */
#include "ct_driver.h"
/* Mandatory functions */
-static OptionInfoPtr CHIPSAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * CHIPSAvailableOptions(int chipid, int busid);
static void CHIPSIdentify(int flags);
static Bool CHIPSProbe(DriverPtr drv, int flags);
static Bool CHIPSPreInit(ScrnInfoPtr pScrn, int flags);
@@ -148,7 +150,8 @@ static Bool CHIPSSaveScreen(ScreenPtr pScreen, int mode);
static int chipsFindIsaDevice(GDevPtr dev);
static Bool chipsClockSelect(ScrnInfoPtr pScrn, int no);
Bool chipsModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
-static void chipsSave(ScrnInfoPtr pScrn);
+static void chipsSave(ScrnInfoPtr pScrn, vgaRegPtr VgaSave,
+ CHIPSRegPtr ChipsSave);
static void chipsRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg,
CHIPSRegPtr ChipsReg, Bool restoreFonts);
static void chipsLock(ScrnInfoPtr pScrn);
@@ -178,14 +181,15 @@ static int chipsVideoMode(int vgaBitsPerPixel,int displayHSize,
int displayVSize);
static void chipsDisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagementMode, int flags);
-static void chipsHWCursorOn(CHIPSPtr cPtr);
-static void chipsHWCursorOff(CHIPSPtr cPtr);
+static void chipsHWCursorOn(CHIPSPtr cPtr, ScrnInfoPtr pScrn);
+static void chipsHWCursorOff(CHIPSPtr cPtr, ScrnInfoPtr pScrn);
static void chipsFixResume(ScrnInfoPtr pScrn);
static void chipsLoadPalette(ScrnInfoPtr pScrn, int numColors,
int *indices, LOCO *colors, VisualPtr pVisual);
static void chipsLoadPalette16(ScrnInfoPtr pScrn, int numColors,
int *indices, LOCO *colors, VisualPtr pVisual);
static void chipsSetPanelType(CHIPSPtr cPtr);
+static void chipsBlockHandler(int, pointer, pointer, pointer);
/*
* This is intentionally screen-independent. It indicates the binding
@@ -193,8 +197,15 @@ static void chipsSetPanelType(CHIPSPtr cPtr);
*/
static int pix24bpp = 0;
+/*
+ * Index of Entity
+ */
+static int CHIPSEntityIndex = -1;
+
+
/* Set the non-documented SAR04 register for overlay/video */
#define SAR04
+
/*
* Initialise some arrays that are used in multiple instances of the
* acceleration code. Set them up here as its a convenient place to do it.
@@ -554,10 +565,14 @@ typedef enum {
OPTION_FP_CLOCK_32,
OPTION_SET_MCLK,
OPTION_ROTATE,
- OPTION_NO_TMED
+ OPTION_NO_TMED,
+ OPTION_CRT2_MEM,
+ OPTION_DUAL_REFRESH,
+ OPTION_CRT_CLK_INDX,
+ OPTION_FP_CLK_INDX
} CHIPSOpts;
-static OptionInfoRec Chips655xxOptions[] = {
+static const OptionInfoRec Chips655xxOptions[] = {
{ OPTION_LINEAR, "Linear", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CLKS, "HWclocks", OPTV_BOOLEAN, {0}, FALSE },
@@ -584,7 +599,7 @@ static OptionInfoRec Chips655xxOptions[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
-static OptionInfoRec ChipsWingineOptions[] = {
+static const OptionInfoRec ChipsWingineOptions[] = {
{ OPTION_LINEAR, "Linear", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CLKS, "HWclocks", OPTV_BOOLEAN, {0}, FALSE },
@@ -599,7 +614,7 @@ static OptionInfoRec ChipsWingineOptions[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
-static OptionInfoRec ChipsHiQVOptions[] = {
+static const OptionInfoRec ChipsHiQVOptions[] = {
{ OPTION_LINEAR, "Linear", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
@@ -626,6 +641,10 @@ static OptionInfoRec ChipsHiQVOptions[] = {
{ OPTION_FP_CLOCK_32, "FPClock32", OPTV_FREQ, {0}, FALSE },
{ OPTION_SET_MCLK, "SetMclk", OPTV_FREQ, {0}, FALSE },
{ OPTION_NO_TMED, "NoTMED", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_CRT2_MEM, "Crt2Memory", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_DUAL_REFRESH, "DualRefresh", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_CRT_CLK_INDX, "CrtClkIndx", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_FP_CLK_INDX, "FPClkIndx", OPTV_INTEGER, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -797,8 +816,7 @@ CHIPSIdentify(int flags)
CHIPSChipsets);
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
CHIPSAvailableOptions(int chipid, int busid)
{
int chip = chipid & 0x0000ffff;
@@ -842,6 +860,7 @@ CHIPSProbe(DriverPtr drv, int flags)
if (flags & PROBE_DETECT)
foundScreen = TRUE;
else for (i = 0; i < numUsed; i++) {
+ EntityInfoPtr pEnt;
/* Allocate a ScrnInfoRec */
ScrnInfoPtr pScrn = NULL;
if ((pScrn = xf86ConfigPciEntity(pScrn,0,usedChips[i],
@@ -861,6 +880,40 @@ CHIPSProbe(DriverPtr drv, int flags)
pScrn->ValidMode = CHIPSValidMode;
foundScreen = TRUE;
}
+
+ /*
+ * For cards that can do dual head per entity, mark the entity
+ * as sharable.
+ */
+ pEnt = xf86GetEntityInfo(usedChips[i]);
+ if (pEnt->chipset == CHIPS_CT69030) {
+ CHIPSEntPtr cPtrEnt = NULL;
+ DevUnion *pPriv;
+
+ xf86SetEntitySharable(usedChips[i]);
+ /* Allocate an entity private if necessary */
+ if (CHIPSEntityIndex < 0)
+ CHIPSEntityIndex = xf86AllocateEntityPrivateIndex();
+ pPriv = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex);
+ if (!pPriv->ptr) {
+ pPriv->ptr = xnfcalloc(sizeof(CHIPSEntRec), 1);
+ cPtrEnt = pPriv->ptr;
+ cPtrEnt->lastInstance = -1;
+ } else {
+ cPtrEnt = pPriv->ptr;
+ }
+ /*
+ * Set the entity instance for this instance of the
+ * driver. For dual head per card, instance 0 is the
+ * "master" instance, driving the primary head, and
+ * instance 1 is the "slave".
+ */
+ cPtrEnt->lastInstance++;
+ xf86SetEntityInstanceForScreen(pScrn, pScrn->entityList[0],
+ cPtrEnt->lastInstance);
+ }
+
}
xfree(usedChips);
}
@@ -994,6 +1047,7 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
int i;
CHIPSPtr cPtr;
Bool res = FALSE;
+ CHIPSEntPtr cPtrEnt = NULL;
if (flags & PROBE_DETECT) return FALSE;
@@ -1008,12 +1062,14 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
}
cPtr = CHIPSPTR(pScrn);
+ /* XXX Check the number of entities, and fail if it isn't one. */
+ if (pScrn->numEntities != 1)
+ return FALSE;
+
/* Since the capabilities are determined by the chipset the very
* first thing to do is, figure out the chipset and its capabilities
*/
- /* This driver doesn't expect more than one entity per screen */
- if (pScrn->numEntities > 1)
- return FALSE;
+
/* This is the general case */
for (i = 0; i<pScrn->numEntities; i++) {
cPtr->pEnt = xf86GetEntityInfo(pScrn->entityList[i]);
@@ -1090,6 +1146,30 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
case CHIPS_CT65520:
break;
}
+
+ /* Check for shared entities */
+ if (xf86IsEntityShared(pScrn->entityList[0])) {
+ if (!(cPtr->Flags & ChipsDualChannelSupport))
+ return FALSE;
+
+ /* Make sure entity is PCI for now, though this might not be needed. */
+ if (cPtr->pEnt->location.type != BUS_PCI)
+ return FALSE;
+
+ /* Allocate an entity private if necessary */
+ if (xf86IsEntityShared(pScrn->entityList[0])) {
+ cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
+ cPtr->entityPrivate = cPtrEnt;
+ }
+#if 0
+ /* Set cPtr->device to the relevant Device section */
+ cPtr->device = xf86GetDevFromEntity(pScrn->entityList[0],
+ pScrn->entityInstanceList[0]);
+#endif
+ }
+
+ /* Set the driver to use the PIO register functions by default */
CHIPSSetStdExtFuncs(cPtr);
/* Call the device specific PreInit */
@@ -1103,9 +1183,12 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
if (cPtr->UseFullMMIO)
chipsUnmapMem(pScrn);
- if (!res)
+ if (!res) {
+ vbeFree(cPtr->pVbe);
+ cPtr->pVbe = NULL;
return FALSE;
-
+ }
+
/*********/
/*
* Setup the ClockRanges, which describe what clock ranges are available,
@@ -1140,6 +1223,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
LOOKUP_BEST_REFRESH);
if (i == -1) {
+ vbeFree(cPtr->pVbe);
+ cPtr->pVbe = NULL;
CHIPSFreeRec(pScrn);
return FALSE;
}
@@ -1154,6 +1239,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
if (i == 0 || pScrn->modes == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
+ vbeFree(cPtr->pVbe);
+ cPtr->pVbe = NULL;
CHIPSFreeRec(pScrn);
return FALSE;
}
@@ -1181,6 +1268,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
switch (pScrn->bitsPerPixel) {
case 1:
if (xf86LoadSubModule(pScrn, "xf1bpp") == NULL) {
+ vbeFree(cPtr->pVbe);
+ cPtr->pVbe = NULL;
CHIPSFreeRec(pScrn);
return FALSE;
}
@@ -1188,6 +1277,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
break;
case 4:
if (xf86LoadSubModule(pScrn, "xf4bpp") == NULL) {
+ vbeFree(cPtr->pVbe);
+ cPtr->pVbe = NULL;
CHIPSFreeRec(pScrn);
return FALSE;
}
@@ -1196,6 +1287,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
case 16:
if (cPtr->Flags & ChipsOverlay8plus16) {
if (xf86LoadSubModule(pScrn, "xf8_16bpp") == NULL) {
+ vbeFree(cPtr->pVbe);
+ cPtr->pVbe = NULL;
CHIPSFreeRec(pScrn);
return FALSE;
}
@@ -1204,6 +1297,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
}
default:
if (xf86LoadSubModule(pScrn, "fb") == NULL) {
+ vbeFree(cPtr->pVbe);
+ cPtr->pVbe = NULL;
CHIPSFreeRec(pScrn);
return FALSE;
}
@@ -1213,6 +1308,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
if (cPtr->Flags & ChipsAccelSupport) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
+ vbeFree(cPtr->pVbe);
+ cPtr->pVbe = NULL;
CHIPSFreeRec(pScrn);
return FALSE;
}
@@ -1221,6 +1318,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
if (cPtr->Flags & ChipsShadowFB) {
if (!xf86LoadSubModule(pScrn, "shadowfb")) {
+ vbeFree(cPtr->pVbe);
+ cPtr->pVbe = NULL;
CHIPSFreeRec(pScrn);
return FALSE;
}
@@ -1229,6 +1328,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
if (cPtr->Accel.UseHWCursor) {
if (!xf86LoadSubModule(pScrn, "ramdac")) {
+ vbeFree(cPtr->pVbe);
+ cPtr->pVbe = NULL;
CHIPSFreeRec(pScrn);
return FALSE;
}
@@ -1241,7 +1342,6 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
if (cPtr->MMIOBaseVGA)
xf86SetOperatingState(RES_SHARED_VGA, cPtr->pEnt->index, ResDisableOpr);
-
return TRUE;
}
@@ -1254,11 +1354,12 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
int i;
unsigned int Probed[3], FPclkI, CRTclkI;
double real;
- int val;
+ int val, indx;
const char *s;
vgaHWPtr hwp;
CHIPSPtr cPtr = CHIPSPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = NULL;
CHIPSPanelSizePtr Size = &cPtr->PanelSize;
CHIPSMemClockPtr MemClk = &cPtr->MemClock;
CHIPSClockPtr SaveClk = &(cPtr->SavedReg.Clock);
@@ -1306,6 +1407,14 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
vgaHWGetIOBase(hwp);
/*
+ * Must allow ensure that storage for the 2nd set of vga registers is
+ * allocated for dual channel cards
+ */
+ if ((cPtr->Flags & ChipsDualChannelSupport) &&
+ (! xf86IsEntityShared(pScrn->entityList[0])))
+ vgaHWAllocDefaultRegs(&(cPtr->VgaSavedReg2));
+
+ /*
* This must happen after pScrn->display has been set because
* xf86SetWeight references it.
*/
@@ -1337,7 +1446,9 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
/* Collect all of the relevant option flags (fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- cPtr->Options = (OptionInfoPtr)ChipsHiQVOptions;
+ if (!(cPtr->Options = xalloc(sizeof(ChipsHiQVOptions))))
+ return FALSE;
+ memcpy(cPtr->Options, ChipsHiQVOptions, sizeof(ChipsHiQVOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options);
/* Set the bits per RGB */
@@ -1541,33 +1652,95 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
if ((cPtr->Flags & ChipsLinearSupport)
&& (cPtr->Flags & ChipsFullMMIOSupport)
&& (cPtr->pEnt->location.type == BUS_PCI)) {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Enabling Full MMIO\n");
- cPtr->UseFullMMIO = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Using Full MMIO\n");
-
- /* Map the linear framebuffer */
- if (!chipsMapMem(pScrn))
- return FALSE;
+
+ if (cPtr->Flags & ChipsDualChannelSupport)
+ /* !!!! Full MMIO doesn't work on the 69030 for now */
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "FULL_MMIO option ignored for Dual Channel\n");
+ else {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Enabling Full MMIO\n");
+ cPtr->UseFullMMIO = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Using Full MMIO\n");
+
+ /*
+ * We need to map the framebuffer to read/write regs.
+ * but can't do that without the FbMapSize. So need to
+ * fake value for PreInit. This isn't a problem as
+ * framebuffer isn't actually used in PreInit
+ */
+ cPtr->FbMapSize = 1024 * 1024;
+
+ /* Map the linear framebuffer */
+ if (!chipsMapMem(pScrn))
+ return FALSE;
- /* Setup the MMIO register functions */
- if (cPtr->MMIOBaseVGA) {
- CHIPSSetMmioExtFuncs(cPtr);
- CHIPSHWSetMmioFuncs(pScrn, cPtr->MMIOBaseVGA, 0x0);
+ /* Setup the MMIO register functions */
+ if (cPtr->MMIOBaseVGA) {
+ CHIPSSetMmioExtFuncs(cPtr);
+ CHIPSHWSetMmioFuncs(pScrn, cPtr->MMIOBaseVGA, 0x0);
+ }
}
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "FULL_MMIO option ignored\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "FULL_MMIO option ignored\n");
}
}
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,"Disabling MMIO: "
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,"Disabling MMIO: "
"no acceleration, no hw_cursor\n");
cPtr->UseMMIO = FALSE;
cPtr->Accel.UseHWCursor = FALSE;
cPtr->Flags &= ~ChipsAccelSupport;
}
+
+ if (cPtr->Flags & ChipsDualChannelSupport) {
+
+ if (xf86IsEntityShared(pScrn->entityList[0])) {
+ cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
+#if 1
+ /*
+ * XXX This assumes that the lower number screen is always the
+ * "master" head, and that the "master" is the first CRTC. This
+ * can result in unexpected behaviour when the config file marks
+ * the primary CRTC as the second screen.
+ */
+ if (xf86IsPrimInitDone(pScrn->entityList[0])) {
+#else
+ /*
+ * This is an alternative version that determines which is the
+ * secondary CRTC from the screen field in cPtr->pEnt->device.
+ * It doesn't currently work because there are things that assume
+ * the primary CRTC is initialised first.
+ */
+ if (cPtr->pEnt->device->screen == 1) {
+
+#endif
+ /* This is the second crtc */
+ cPtr->SecondCrtc = TRUE;
+ cPtr->UseDualChannel = TRUE;
+ } else
+ cPtr->SecondCrtc = FALSE;
+
+ } else {
+ if (xf86ReturnOptValBool(cPtr->Options,
+ OPTION_DUAL_REFRESH, FALSE)) {
+ cPtr->Flags |= ChipsDualRefresh;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Dual Refresh mode enabled\n");
+ cPtr->UseDualChannel = TRUE;
+ }
+ }
+
+ /* Store IOSS/MSS so that we can restore them */
+ cPtr->storeIOSS = cPtr->readIOSS(cPtr);
+ cPtr->storeMSS = cPtr->readMSS(cPtr);
+ DUALOPEN;
+ }
+
/* memory size */
if (cPtr->pEnt->device->videoRam != 0) {
pScrn->videoRam = cPtr->pEnt->device->videoRam;
@@ -1631,10 +1804,53 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
break;
}
}
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VideoRAM: %d kByte\n",
- pScrn->videoRam);
}
- cPtr->FbMapSize = pScrn->videoRam * 1024;
+
+
+ if ((cPtr->Flags & ChipsDualChannelSupport) &&
+ (xf86IsEntityShared(pScrn->entityList[0]))) {
+ /*
+ * This takes gives either half or the amount of memory specified
+ * with the Crt2Memory option
+ */
+ if(cPtr->SecondCrtc == FALSE) {
+ MessageType from;
+
+ int crt2mem = -1, adjust;
+
+ xf86GetOptValInteger(cPtr->Options, OPTION_CRT2_MEM, &crt2mem);
+ if (crt2mem > 0) {
+ adjust = crt2mem;
+ from = X_CONFIG;
+ } else {
+ adjust = pScrn->videoRam / 2;
+ from = X_DEFAULT;
+ }
+ xf86DrvMsg(pScrn->scrnIndex, from,
+ "CRT2 will use %dK of VideoRam\n",
+ adjust);
+
+ cPtrEnt->mastervideoRam = pScrn->videoRam - adjust;
+ pScrn->videoRam = cPtrEnt->mastervideoRam;
+ cPtrEnt->slavevideoRam = adjust;
+ cPtrEnt->masterFbAddress = cPtr->FbAddress;
+ cPtr->FbMapSize =
+ cPtrEnt->masterFbMapSize = pScrn->videoRam * 1024;
+ cPtrEnt->slaveFbMapSize = cPtrEnt->slavevideoRam * 1024;
+ } else {
+ cPtrEnt->slaveFbAddress = cPtr->FbAddress +
+ cPtrEnt->masterFbAddress;
+ cPtr->FbMapSize = cPtrEnt->slaveFbMapSize;
+ pScrn->videoRam = cPtrEnt->slavevideoRam;
+ }
+ cPtrEnt->refCount++;
+ } else {
+ /* Normal Handling of video ram etc */
+ cPtr->FbMapSize = pScrn->videoRam * 1024;
+ }
+
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VideoRAM: %d kByte\n",
+ pScrn->videoRam);
/* Store register values that might be messed up by a suspend resume */
/* Do this early as some of the other code in PreInit relies on it */
@@ -1642,6 +1858,7 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
cPtr->IOBase = (unsigned int)(cPtr->SuspendHack.vgaIOBaseFlag ?
0x3D0 : 0x3B0);
+
/*test STN / TFT */
tmp = cPtr->readFR(cPtr, 0x10);
@@ -1845,16 +2062,9 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
}
CRTclkI = (hwp->readMiscOut(hwp) >> 2) & 0x03;
if (CRTclkI == 3) CRTclkI = 2;
- if (cPtr->Flags & ChipsDualChannelSupport) {
- unsigned char IOSS, MSS;
- IOSS = cPtr->readIOSS(cPtr);
- MSS = cPtr->readMSS(cPtr);
- cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline A */
- cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8));
+ if (cPtr->Chipset == CHIPS_CT69030)
FPclkI = (cPtr->readFR(cPtr, 0x01) >> 2) & 0x3;
- cPtr->writeIOSS(cPtr,IOSS);
- cPtr->writeMSS(cPtr,MSS);
- } else
+ else
FPclkI = (cPtr->readFR(cPtr, 0x03) >> 2) & 0x3;
if (FPclkI == 3) FPclkI = 2;
for (i = 0; i < 3; i++) {
@@ -1875,6 +2085,46 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
}
cPtr->CRTclkInx = CRTclkI;
+
+ /*
+ * Some chips seem to dislike some clocks in one of the PLL's. Give
+ * the user the oppurtunity to change it
+ */
+ if (xf86GetOptValInteger(cPtr->Options, OPTION_CRT_CLK_INDX, &indx)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Force CRT Clock index to %d\n",
+ indx);
+ cPtr->CRTclkInx = indx;
+
+ if (xf86GetOptValInteger(cPtr->Options, OPTION_FP_CLK_INDX, &indx)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Force FP Clock index to %d\n", indx);
+ cPtr->FPclkInx = indx;
+ } else {
+ if (indx == cPtr->FPclkInx) {
+ if (indx == 2)
+ cPtr->FPclkInx = 1;
+ else
+ cPtr->FPclkInx = indx + 1;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "FP Clock index forced to %d\n", cPtr->FPclkInx);
+ }
+ }
+ } else if (xf86GetOptValInteger(cPtr->Options, OPTION_FP_CLK_INDX,
+ &indx)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Force FP Clock index to %d\n", indx);
+ cPtr->FPclkInx = indx;
+ if (indx == cPtr->CRTclkInx) {
+ if (indx == 2)
+ cPtr->CRTclkInx = 1;
+ else
+ cPtr->CRTclkInx = indx + 1;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "CRT Clock index forced to %d\n", cPtr->CRTclkInx);
+ }
+ }
+
+
/* Probe the memory clock currently in use */
MemClk->xrCC = cPtr->readXR(cPtr, 0xCC);
MemClk->M = (MemClk->xrCC & 0x7F) + 2;
@@ -1961,18 +2211,37 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
/* Check if maxClock is limited by the MemClk. Only 70% to allow for */
/* RAS/CAS. Extra byte per memory clock needed if framebuffer used */
/* Extra byte if the overlay plane is avtivated */
- if (cPtr->FrameBufferSize && (cPtr->PanelType & ChipsLCD))
- if (cPtr->Flags & ChipsOverlay8plus16 )
- cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 4 * 0.7 / 4);
+ /* We have a 64bit wide memory bus on the 69030 and 69000, and 32bits */
+ /* on the others. Thus multiply by a suitable factor */
+ if ((cPtr->Chipset == CHIPS_CT69030) || (cPtr->Chipset == CHIPS_CT69000)) {
+ if (cPtr->FrameBufferSize && (cPtr->PanelType & ChipsLCD))
+ if (cPtr->Flags & ChipsOverlay8plus16 )
+ cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 8 * 0.7 / 4);
+ else
+ cPtr->MaxClock = min(cPtr->MaxClock,
+ MemClk->Clk * 8 * 0.7 / (bytesPerPixel + 1));
else
- cPtr->MaxClock = min(cPtr->MaxClock,
+ if (cPtr->Flags & ChipsOverlay8plus16)
+ cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 8 * 0.7 / 3);
+ else
+ cPtr->MaxClock = min(cPtr->MaxClock,
+ MemClk->Clk * 8 * 0.7 / bytesPerPixel);
+ } else {
+ if (cPtr->FrameBufferSize && (cPtr->PanelType & ChipsLCD))
+ if (cPtr->Flags & ChipsOverlay8plus16 )
+ cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 4 * 0.7 / 4);
+ else
+ cPtr->MaxClock = min(cPtr->MaxClock,
MemClk->Clk * 4 * 0.7 / (bytesPerPixel + 1));
- else
- if (cPtr->Flags & ChipsOverlay8plus16)
- cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 4 * 0.7 / 3);
else
- cPtr->MaxClock = min(cPtr->MaxClock,
+ if (cPtr->Flags & ChipsOverlay8plus16)
+ cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 4 * 0.7 / 3);
+ else
+ cPtr->MaxClock = min(cPtr->MaxClock,
MemClk->Clk * 4 * 0.7 / bytesPerPixel);
+ }
+
+
if (cPtr->pEnt->device->dacSpeeds[0]) {
int speed = 0;
@@ -2083,6 +2352,21 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags)
chips_ddc1(pScrn);
}
+ if (cPtr->Flags & ChipsDualChannelSupport) {
+ if (xf86IsEntityShared(pScrn->entityList[0])) {
+ if (cPtr->SecondCrtc == TRUE) {
+ cPtrEnt->slaveActive = FALSE;
+ } else {
+ cPtrEnt->masterActive = FALSE;
+ }
+ }
+ /* Put IOSS/MSS back to normal */
+ cPtr->writeIOSS(cPtr, cPtr->storeIOSS);
+ cPtr->writeMSS(cPtr, cPtr->storeMSS);
+
+ xf86SetPrimInitDone(pScrn->entityList[0]);
+ }
+
return TRUE;
}
@@ -2191,7 +2475,9 @@ chipsPreInitWingine(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- cPtr->Options = (OptionInfoPtr)ChipsWingineOptions;
+ if (!(cPtr->Options = xalloc(sizeof(ChipsWingineOptions))))
+ return FALSE;
+ memcpy(cPtr->Options, ChipsWingineOptions, sizeof(ChipsWingineOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options);
/* Set the bits per RGB */
@@ -2655,7 +2941,9 @@ chipsPreInit655xx(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- cPtr->Options = (OptionInfoPtr)Chips655xxOptions;
+ if (!(cPtr->Options = xalloc(sizeof(Chips655xxOptions))))
+ return FALSE;
+ memcpy(cPtr->Options, Chips655xxOptions, sizeof(Chips655xxOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options);
/* Set the bits per RGB */
@@ -3321,6 +3609,11 @@ CHIPSEnterVT(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
CHIPSPtr cPtr = CHIPSPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
+
+ if (cPtr->Flags & ChipsDualChannelSupport)
+ DUALOPEN;
/* Should we re-save the text mode on each VT enter? */
if(!chipsModeInit(pScrn, pScrn->currentMode))
@@ -3330,8 +3623,8 @@ CHIPSEnterVT(int scrnIndex, int flags)
&& (cPtr->Flags & ChipsAccelSupport))
CHIPSResetVideo(pScrn);
- xf86UDelay(50000);
- chipsHWCursorOn(cPtr);
+ /*xf86UDelay(50000);*/
+ chipsHWCursorOn(cPtr, pScrn);
/* cursor settle delay */
xf86UDelay(50000);
CHIPSAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
@@ -3346,14 +3639,24 @@ CHIPSLeaveVT(int scrnIndex, int flags)
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
CHIPSPtr cPtr = CHIPSPTR(pScrn);
CHIPSACLPtr cAcl = CHIPSACLPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
/* Invalidate the cached acceleration registers */
cAcl->planemask = -1;
cAcl->fgColor = -1;
cAcl->bgColor = -1;
- chipsHWCursorOff(cPtr);
- chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, &cPtr->SavedReg, TRUE);
- chipsLock(pScrn);
+
+ if (cPtr->Flags & ChipsDualChannelSupport) {
+ if (cPtr->UseDualChannel)
+ DUALREOPEN;
+ DUALCLOSE;
+ } else {
+ chipsHWCursorOff(cPtr, pScrn);
+ chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, &cPtr->SavedReg,
+ TRUE);
+ chipsLock(pScrn);
+ }
}
@@ -3363,11 +3666,16 @@ chipsLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
int i, index, shift ;
shift = ((pScrn->depth == 15) &&
(!(cPtr->Flags & ChipsOverlay8plus16))) ? 3 : 0;
+ if (cPtr->UseDualChannel)
+ DUALREOPEN;
+
for (i = 0; i < numColors; i++) {
index = indices[i];
hwp->writeDacWriteAddr(hwp,index << shift);
@@ -3380,6 +3688,30 @@ chipsLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
DACDelay(hwp);
}
+ if (cPtr->UseDualChannel &&
+ (! xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned int IOSS, MSS;
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B));
+
+ for (i = 0; i < numColors; i++) {
+ index = indices[i];
+ hwp->writeDacWriteAddr(hwp,index << shift);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, colors[index].red);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, colors[index].green);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, colors[index].blue);
+ DACDelay(hwp);
+ }
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ }
+
/* This shouldn't be necessary, but we'll play safe. */
hwp->disablePalette(hwp);
}
@@ -3389,8 +3721,14 @@ chipsLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO *colors, VisualPtr pVisual)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
+ CHIPSPtr cPtr = CHIPSPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
int i, index;
+ if (cPtr->UseDualChannel)
+ DUALREOPEN;
+
for (i = 0; i < numColors; i++) {
index = indices[i];
hwp->writeDacWriteAddr(hwp, index << 2);
@@ -3403,6 +3741,32 @@ chipsLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
DACDelay(hwp);
}
+
+ if (cPtr->UseDualChannel &&
+ (! xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned int IOSS, MSS;
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B));
+
+ for (i = 0; i < numColors; i++) {
+ index = indices[i];
+ hwp->writeDacWriteAddr(hwp, index << 2);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, colors[index >> 1].red);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, colors[index].green);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, colors[index >> 1].blue);
+ DACDelay(hwp);
+ }
+
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ }
+
/* This shouldn't be necessary, but we'll play safe. */
hwp->disablePalette(hwp);
}
@@ -3411,7 +3775,7 @@ chipsLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
static Bool
CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
{
- ScrnInfoPtr pScrn;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
vgaHWPtr hwp;
CHIPSPtr cPtr;
CHIPSACLPtr cAcl;
@@ -3421,6 +3785,8 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
unsigned int racflag = 0;
unsigned char *FBStart;
int height, width, displayWidth;
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
#ifdef DEBUG
ErrorF("CHIPSScreenInit\n");
#endif
@@ -3428,7 +3794,6 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
* we need to get the ScrnInfoRec for this screen, so let's allocate
* one first thing
*/
- pScrn = xf86Screens[pScreen->myNum];
cPtr = CHIPSPTR(pScrn);
cAcl = CHIPSACLPTR(pScrn);
hwp = VGAHWPTR(pScrn);
@@ -3459,11 +3824,14 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
/* Setup the MMIO register access functions if need */
- if (cPtr->MMIOBaseVGA) {
+ if (cPtr->UseFullMMIO && cPtr->MMIOBaseVGA) {
CHIPSSetMmioExtFuncs(cPtr);
CHIPSHWSetMmioFuncs(pScrn, cPtr->MMIOBaseVGA, 0x0);
}
+ if (cPtr->Flags & ChipsDualChannelSupport)
+ DUALOPEN;
+
#if defined(__arm32__) && defined(__NetBSD__)
if (strcmp(pScrn->currentMode->name,"PAL") == 0) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using built-in PAL TV mode\n");
@@ -3483,11 +3851,28 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/*
* next we save the current state and setup the first mode
*/
- chipsSave(pScrn);
+ if ((cPtr->Flags & ChipsDualChannelSupport) &&
+ (! xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned int IOSS, MSS;
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_A));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_A));
+ chipsSave(pScrn, &hwp->SavedReg, &cPtr->SavedReg);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B));
+ chipsSave(pScrn, &cPtr->VgaSavedReg2, &cPtr->SavedReg2);
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ } else
+ chipsSave(pScrn, &hwp->SavedReg, &cPtr->SavedReg);
+
if (!chipsModeInit(pScrn,pScrn->currentMode))
return FALSE;
CHIPSSaveScreen(pScreen,SCREEN_SAVER_ON);
- CHIPSAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+ CHIPSAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
/*
* The next step is to setup the screen's visuals, and initialise the
@@ -3511,6 +3896,8 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!miSetVisualTypes(8, PseudoColorMask | GrayScaleMask,
pScrn->rgbBits, PseudoColor))
return FALSE;
+ if (!miSetVisualTypes(16, TrueColorMask, pScrn->rgbBits, TrueColor))
+ return FALSE;
} else {
if (!miSetVisualTypes(pScrn->depth,
miGetDefaultVisualMask(pScrn->depth),
@@ -3593,6 +3980,9 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86SetBlackWhitePixels(pScreen);
+ cPtr->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = chipsBlockHandler;
+
if ( (pScrn->depth >= 8))
CHIPSDGAInit(pScreen);
@@ -3693,7 +4083,11 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
freespace = allocatebase - pScrn->displayWidth *
pScrn->virtualY * (pScrn->bitsPerPixel >> 3);
- currentaddr = allocatebase;
+ if ((cPtr->Flags & ChipsDualChannelSupport) &&
+ (cPtr->SecondCrtc == TRUE))
+ currentaddr = allocatebase + cPtrEnt->masterFbMapSize;
+ else
+ currentaddr = allocatebase;
if (serverGeneration == 1)
xf86DrvMsg(scrnIndex, X_PROBED,
"%d bytes off-screen memory available\n", freespace);
@@ -3845,14 +4239,11 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if(!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, chipsLoadPalette,
NULL, CMAP_RELOAD_ON_MODE_SWITCH))
return FALSE;
- } else if ((cPtr->Flags & ChipsGammaSupport) && (pScrn->depth > 8)) {
+ } else {
if(!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits,
(pScrn->depth == 16 ? chipsLoadPalette16 : chipsLoadPalette),
NULL, CMAP_RELOAD_ON_MODE_SWITCH | CMAP_PALETTED_TRUECOLOR))
return FALSE;
- } else {
- if (!vgaHWHandleColormaps(pScreen))
- return FALSE;
}
if (pScrn->bitsPerPixel <= 8)
@@ -3879,6 +4270,13 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86DPMSInit(pScreen, (DPMSSetProcPtr)chipsDisplayPowerManagementSet,
0);
+#if 0 /* #### Shouldn't be needed */
+ /* Dual head, needs to fix framebuffer memory address */
+ if ((cPtr->Flags & ChipsDualChannelSupport) &&
+ (cPtr->SecondCrtc == TRUE))
+ pScrn->memPhysBase = cPtr->FbAddress + cPtrEnt->masterFbMapSize;
+#endif
+
/* Wrap the current CloseScreen function */
cPtr->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = CHIPSCloseScreen;
@@ -3895,7 +4293,16 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
Bool
CHIPSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ CHIPSPtr cPtr = CHIPSPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
+
ErrorF("CHIPSSwitchMode\n");
+
+ if (cPtr->UseDualChannel)
+ DUALREOPEN;
+
return chipsModeInit(xf86Screens[scrnIndex], mode);
}
@@ -3903,16 +4310,14 @@ CHIPSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
void
CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags)
{
- ScrnInfoPtr pScrn;
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ CHIPSPtr cPtr = CHIPSPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
int Base;
- CHIPSPtr cPtr;
- vgaHWPtr hwp;
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
unsigned char tmp;
- pScrn = xf86Screens[scrnIndex];
- hwp = VGAHWPTR(pScrn);
- cPtr = CHIPSPTR(pScrn);
-
if (xf86ReturnOptValBool(cPtr->Options, OPTION_SHOWCACHE, FALSE) && y) {
int lastline = cPtr->FbMapSize /
((pScrn->displayWidth * pScrn->bitsPerPixel) / 8);
@@ -3922,7 +4327,7 @@ CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags)
}
Base = y * pScrn->displayWidth + x;
-
+
/* calculate base bpp dep. */
switch (pScrn->bitsPerPixel) {
case 1:
@@ -3948,6 +4353,9 @@ CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags)
break;
}
+ if (cPtr->UseDualChannel)
+ DUALREOPEN;
+
/* write base to chip */
/*
* These are the generic starting address registers.
@@ -3964,6 +4372,25 @@ CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags)
0x030000)) >> 16) | (tmp & 0xF8));
}
+ if (cPtr->UseDualChannel &&
+ (! xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned int IOSS, MSS;
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B));
+
+ chipsFixResume(pScrn);
+ hwp->writeCrtc(hwp, 0x0C, (Base & 0xFF00) >> 8);
+ hwp->writeCrtc(hwp, 0x0D, Base & 0xFF);
+ if (((cPtr->readXR(cPtr, 0x09)) & 0x1) == 0x1)
+ hwp->writeCrtc(hwp, 0x40, ((Base & 0x0F0000) >> 16) | 0x80);
+
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ }
+
if (cPtr->Flags & ChipsOverlay8plus16) {
Base = (Base << 3) & ~(unsigned long)0xF;
@@ -3971,7 +4398,7 @@ CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags)
cPtr->writeMR(cPtr, 0x23, ((cPtr->FbOffset16 + Base) >> 8) & 0xFF);
cPtr->writeMR(cPtr, 0x24, ((cPtr->FbOffset16 + Base) >> 16) & 0xFF);
}
-
+
}
/* Mandatory */
@@ -3980,13 +4407,32 @@ CHIPSCloseScreen(int scrnIndex, ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
CHIPSPtr cPtr = CHIPSPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
if(pScrn->vtSema){ /*§§§*/
- chipsHWCursorOff(cPtr);
- chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, &cPtr->SavedReg, TRUE);
- chipsLock(pScrn);
- chipsUnmapMem(pScrn);
+ if (cPtr->Flags & ChipsDualChannelSupport) {
+ if (cPtr->UseDualChannel)
+ DUALREOPEN;
+ DUALCLOSE;
+ } else {
+ chipsHWCursorOff(cPtr, pScrn);
+ chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, &cPtr->SavedReg,
+ TRUE);
+ chipsLock(pScrn);
+ }
+ chipsUnmapMem(pScrn);
}
+
+ if (xf86IsEntityShared(pScrn->entityList[0])) {
+ DevUnion *pPriv;
+ pPriv = xf86GetEntityPrivate(pScrn->entityList[0], CHIPSEntityIndex);
+ cPtrEnt = pPriv->ptr;
+ cPtrEnt->refCount--;
+ }
+ if (cPtr->pVbe)
+ vbeFree(cPtr->pVbe);
+ cPtr->pVbe = NULL;
if (cPtr->AccelInfoRec)
XAADestroyInfoRec(cPtr->AccelInfoRec);
if (cPtr->CursorInfoRec)
@@ -3996,7 +4442,11 @@ CHIPSCloseScreen(int scrnIndex, ScreenPtr pScreen)
if (cPtr->DGAModes)
xfree(cPtr->DGAModes);
pScrn->vtSema = FALSE;
+ if(cPtr->BlockHandler)
+ pScreen->BlockHandler = cPtr->BlockHandler;
+
pScreen->CloseScreen = cPtr->CloseScreen; /*§§§*/
+ xf86ClearPrimInitDone(pScrn->entityList[0]);
return (*pScreen->CloseScreen)(scrnIndex, pScreen);/*§§§*/
}
@@ -4040,6 +4490,8 @@ chipsDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
unsigned char dpmsreg, seqreg, lcdoff, tmp;
if (!pScrn->vtSema)
@@ -4075,6 +4527,9 @@ chipsDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
return;
}
+ if (cPtr->UseDualChannel)
+ DUALREOPEN;
+
seqreg |= hwp->readSeq(hwp, 0x01) & ~0x20;
hwp->writeSeq(hwp, 0x01, seqreg);
if (IS_HiQV(cPtr)) {
@@ -4181,6 +4636,8 @@ chipsClockSave(ScrnInfoPtr pScrn, CHIPSClockPtr Clock)
unsigned char tmp;
vgaHWPtr hwp = VGAHWPTR(pScrn);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
unsigned char Type = cPtr->ClockType;
Clock->msr = hwp->readMiscOut(hwp)&0xFE; /* save standard VGA clock reg */
@@ -4188,16 +4645,12 @@ chipsClockSave(ScrnInfoPtr pScrn, CHIPSClockPtr Clock)
case HiQV_STYLE:
/* save alternate clock select reg.*/
/* The 69030 FP clock select is at FR01 instead */
- if (cPtr->Flags & ChipsDualChannelSupport) {
- unsigned char IOSS, MSS;
- IOSS = cPtr->readIOSS(cPtr);
- MSS = cPtr->readMSS(cPtr);
- cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline A */
- cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8));
+ if (cPtr->UseDualChannel)
+ DUALREOPEN;
+
+ if (cPtr->Flags & ChipsDualChannelSupport)
Clock->fr03 = cPtr->readFR(cPtr, 0x01);
- cPtr->writeIOSS(cPtr,IOSS);
- cPtr->writeMSS(cPtr,MSS);
- } else
+ else
Clock->fr03 = cPtr->readFR(cPtr, 0x03);
if (!Clock->Clock) { /* save HiQV console clock */
tmp = cPtr->CRTclkInx << 2;
@@ -4235,11 +4688,16 @@ chipsClockFind(ScrnInfoPtr pScrn, int no, CHIPSClockPtr Clock)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
unsigned char Type = cPtr->ClockType;
if (no > (pScrn->numClocks - 1))
return (FALSE);
+ if (cPtr->UseDualChannel)
+ DUALREOPEN;
+
switch (Type & GET_STYLE) {
case HiQV_STYLE:
Clock->msr = cPtr->CRTclkInx << 2;
@@ -4310,6 +4768,7 @@ chipsClockFind(ScrnInfoPtr pScrn, int no, CHIPSClockPtr Clock)
#endif
return (TRUE);
}
+
static int
chipsGetHWClock(ScrnInfoPtr pScrn)
@@ -4368,7 +4827,6 @@ chipsClockLoad(ScrnInfoPtr pScrn, CHIPSClockPtr Clock)
volatile unsigned char tmp, tmpmsr, tmpfcr, tmp02;
volatile unsigned char tmp33, tmp54, tmpf03;
unsigned char vclk[3];
- volatile unsigned char IOSS, MSS;
tmpmsr = hwp->readMiscOut(hwp); /* read msr, needed for all styles */
@@ -4377,13 +4835,7 @@ chipsClockLoad(ScrnInfoPtr pScrn, CHIPSClockPtr Clock)
/* save alternate clock select reg. */
/* The 69030 FP clock select is at FR01 instead */
if (cPtr->Flags & ChipsDualChannelSupport) {
- IOSS = cPtr->readIOSS(cPtr);
- MSS = cPtr->readMSS(cPtr);
- cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline A */
- cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8));
tmpf03 = cPtr->readFR(cPtr, 0x01);
- cPtr->writeIOSS(cPtr,IOSS);
- cPtr->writeMSS(cPtr,MSS);
} else
tmpf03 = cPtr->readFR(cPtr, 0x03);
/* select fixed clock 0 before tampering with VCLK select */
@@ -4391,11 +4843,7 @@ chipsClockLoad(ScrnInfoPtr pScrn, CHIPSClockPtr Clock)
cPtr->SuspendHack.vgaIOBaseFlag);
/* The 69030 FP clock select is at FR01 instead */
if (cPtr->Flags & ChipsDualChannelSupport) {
- cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline A */
- cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8));
cPtr->writeFR(cPtr, 0x01, (tmpf03 & ~0x0C) | 0x04);
- cPtr->writeIOSS(cPtr,IOSS);
- cPtr->writeMSS(cPtr,MSS);
} else
cPtr->writeFR(cPtr, 0x03, (tmpf03 & ~0x0C) | 0x04);
if (!Clock->Clock) { /* Hack to load saved console clock */
@@ -4438,12 +4886,8 @@ chipsClockLoad(ScrnInfoPtr pScrn, CHIPSClockPtr Clock)
usleep(10000); /* Let VCO stabilise */
/* The 69030 FP clock select is at FR01 instead */
if (cPtr->Flags & ChipsDualChannelSupport) {
- cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline A */
- cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8));
cPtr->writeFR(cPtr, 0x01, ((tmpf03 & ~0x0C) |
(Clock->fr03 & 0x0C)));
- cPtr->writeIOSS(cPtr,IOSS);
- cPtr->writeMSS(cPtr,MSS);
} else
cPtr->writeFR(cPtr, 0x03, ((tmpf03 & ~0x0C) |
(Clock->fr03 & 0x0C)));
@@ -4535,6 +4979,7 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk)
/* Hack to deal with problem of Toshiba 720CDT clock */
int M_max = (IS_HiQV(cPtr) && cPtr->Chipset != CHIPS_CT69000 &&
cPtr->Chipset != CHIPS_CT69030) ? 63 : 127;
+
/* @@@ < CHIPS_CT690x0 ?? */
/* Other parameters available on the 65548 but not the 65545, and
@@ -4574,8 +5019,8 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk)
target = Clock * 1000;
/* @@@ >= CHIPS_CT690x0 ?? */
- for (PSNx = (cPtr->Chipset == CHIPS_CT69000 ||
- cPtr->Chipset == CHIPS_CT69030) ? 1 : 0; PSNx <= 1; PSNx++) {
+ for (PSNx = ((cPtr->Chipset == CHIPS_CT69000) ||
+ (cPtr->Chipset == CHIPS_CT69030)) ? 1 : 0; PSNx <= 1; PSNx++) {
int low_N, high_N;
double Fref4PSN;
@@ -4584,7 +5029,8 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk)
low_N = 3;
high_N = 127;
- while (Fref / (PSN * low_N) > 2.0e6)
+ while (Fref / (PSN * low_N) > (((cPtr->Chipset == CHIPS_CT69000) ||
+ (cPtr->Chipset == CHIPS_CT69030)) ? 5.0e6 : 2.0e6))
low_N++;
while (Fref / (PSN * high_N) < 150.0e3)
high_N--;
@@ -4594,8 +5040,8 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk)
double tmp = Fref4PSN / N;
/* @@@ < CHIPS_CT690x0 ?? */
- for (P = (IS_HiQV(cPtr) && cPtr->Chipset != CHIPS_CT69000 &&
- cPtr->Chipset != CHIPS_CT69030) ? 1 : 0;
+ for (P = (IS_HiQV(cPtr) && (cPtr->Chipset != CHIPS_CT69000) &&
+ (cPtr->Chipset != CHIPS_CT69030)) ? 1 : 0;
P <= 5; P++) {
/* to force post divisor on Toshiba 720CDT */
double Fvco_desired = target * (1 << P);
@@ -4643,7 +5089,7 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk)
}
/* @@@ >= CHIPS_CT690x0 ?? */
vclk[0] = (bestP << (IS_HiQV(cPtr) ? 4 : 1)) +
- ((cPtr->Chipset == CHIPS_CT69000 || cPtr->Chipset == CHIPS_CT69030)
+ (((cPtr->Chipset == CHIPS_CT69000) || (cPtr->Chipset == CHIPS_CT69030))
? 0 : (bestPSN == 1));
vclk[1] = bestM - 2;
vclk[2] = bestN - 2;
@@ -4655,20 +5101,16 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk)
}
static void
-chipsSave(ScrnInfoPtr pScrn)
+chipsSave(ScrnInfoPtr pScrn, vgaRegPtr VgaSave, CHIPSRegPtr ChipsSave)
{
- vgaRegPtr VgaSave = &VGAHWPTR(pScrn)->SavedReg;
vgaHWPtr hwp = VGAHWPTR(pScrn);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
- CHIPSRegPtr ChipsSave;
int i;
unsigned char tmp;
#ifdef DEBUG
ErrorF("chipsSave\n");
#endif
- ChipsSave = &cPtr->SavedReg;
-
/* set registers that we can program the controller */
/* bank 0 */
if (IS_HiQV(cPtr)) {
@@ -4688,12 +5130,6 @@ chipsSave(ScrnInfoPtr pScrn)
/* save clock */
chipsClockSave(pScrn, &ChipsSave->Clock);
- /* Save the IOSS/MSS dual display channel registers */
- if (cPtr->Flags & ChipsDualChannelSupport) {
- ChipsSave->MSS = cPtr->readMSS(cPtr);
- ChipsSave->IOSS = cPtr->readIOSS(cPtr);
- }
-
/* save extended registers */
if (IS_HiQV(cPtr)) {
for (i = 0; i < 0xFF; i++) {
@@ -4751,6 +5187,12 @@ chipsModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
chipsUnlock(pScrn);
chipsFixResume(pScrn);
+ /*
+ * We need to delay cursor loading after resetting the video mode
+ * to give the engine a chance to recover.
+ */
+ cPtr->cursorDelay = TRUE;
+
if (IS_HiQV(cPtr))
return chipsModeInitHiQV(pScrn, mode);
else if (IS_Wingine(cPtr))
@@ -4805,6 +5247,7 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode)
ChipsNew = &cPtr->ModeReg;
ChipsStd = &hwp->ModeReg;
+
/*
* Possibly fix up the panel size, if the manufacture is stupid
* enough to set it incorrectly in text modes
@@ -4826,7 +5269,22 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode)
ErrorF("bomb 2\n");
return (FALSE);
}
-
+
+ /* Give Warning if the dual display mode will cause problems */
+ /* Note 64bit wide memory bus assumed (as in 69000 and 69030 */
+ if (cPtr->UseDualChannel && ((cPtr->SecondCrtc == TRUE) ||
+ (cPtr->Flags & ChipsDualRefresh))) {
+ if (((ChipsNew->Clock.FPClock + ChipsNew->Clock.Clock) *
+ (max(1, pScrn->bitsPerPixel >> 3) +
+ ((cPtr->FrameBufferSize && (cPtr->PanelType & ChipsLCD)) ?
+ 1 : 0)) / (8 * 0.7)) > cPtr->MemClock.Max) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Memory bandwidth requirements exceeded by dual-channel\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ " mode. Display might be corrupted!!!\n");
+ }
+ }
+
/* get C&T Specific Registers */
for (i = 0; i < 0xFF; i++) {
#ifdef SAR04
@@ -4846,14 +5304,6 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode)
ChipsNew->CR[i] = hwp->readCrtc(hwp, i);
}
- /* Read the display panel registers and force them to desired mode */
- if (cPtr->Flags & ChipsDualChannelSupport) {
- ChipsNew->MSS = cPtr->readMSS(cPtr);
- ChipsNew->IOSS = cPtr->readIOSS(cPtr);
- ChipsNew->MSS &= 0xF0 | 0x0B ;
- ChipsNew->IOSS &= 0xE0 |0x13 ;
- }
-
/*
* Here all of the other fields of 'ChipsNew' get filled in, to
* handle the SVGA extended registers. It is also allowable
@@ -4919,6 +5369,25 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode)
ChipsNew->XR[0xCE] = cPtr->MemClock.xrCE;
}
+ /* Set the 69030 dual channel settings */
+ if (cPtr->Flags & ChipsDualChannelSupport) {
+ ChipsNew->FR[0x01] &= 0xFC;
+ if ((cPtr->SecondCrtc == FALSE) && (cPtr->PanelType & ChipsLCD))
+ ChipsNew->FR[0x01] |= 0x02;
+ else
+ ChipsNew->FR[0x01] |= 0x01;
+ ChipsNew->FR[0x02] &= 0xCC;
+ if ((cPtr->SecondCrtc == TRUE) || (cPtr->Flags & ChipsDualRefresh))
+ ChipsNew->FR[0x02] |= 0x01; /* Set DAC to pipe B */
+ else
+ ChipsNew->FR[0x02] &= 0xFE; /* Set DAC to pipe A */
+
+ if (cPtr->PanelType & ChipsLCD)
+ ChipsNew->FR[0x02] |= 0x20; /* Enable the LCD output */
+ if (cPtr->PanelType & ChipsCRT)
+ ChipsNew->FR[0x02] |= 0x10; /* Enable the CRT output */
+ }
+
/* linear specific */
if (cPtr->Flags & ChipsLinearSupport) {
ChipsNew->XR[0x0A] |= 0x02; /* Linear Addressing Mode */
@@ -4993,11 +5462,13 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode)
ChipsStd->CRTC[5] = (ChipsStd->CRTC[5] & ~0x80) | ((i << 2) &0x80);
ChipsNew->CR[0x3C] = (i & 0xC0);
}
+#else
+ ChipsNew->CR[0x3C] = vgaHWHBlankKGA(mode, ChipsStd, 8,
+ KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO) << 6;
#endif
- ChipsNew->CR[0x3C] = vgaHWHBlankKGA(mode, ChipsStd, 8, 0) << 6;
} else
- vgaHWHBlankKGA(mode, ChipsStd, 6, 0);
- vgaHWVBlankKGA(mode, ChipsStd, 8, 0);
+ vgaHWHBlankKGA(mode, ChipsStd, 6, KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO);
+ vgaHWVBlankKGA(mode, ChipsStd, 8, KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO);
ChipsNew->CR[0x40] |= 0x80;
@@ -5164,21 +5635,24 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode)
if (cPtr->PanelType & ChipsLCD) {
cPtr->OverlaySkewX = (((ChipsNew->FR[0x23] & 0xFF)
- (ChipsNew->FR[0x20] & 0xFF) + 3) << 3)
- - 1;
+ - 1;
cPtr->OverlaySkewY = (ChipsNew->FR[0x33]
+ ((ChipsNew->FR[0x36] & 0xF) << 8)
- (ChipsNew->FR[0x31] & 0xF0)
- (ChipsNew->FR[0x32] & 0x0F)
- ((ChipsNew->FR[0x35] & 0xF0) << 4));
+ if (!xf86ReturnOptValBool(cPtr->Options, OPTION_LCD_STRETCH,
+ FALSE)) {
if (cPtr->PanelSize.HDisplay > mode->CrtcHDisplay)
cPtr->OverlaySkewX += (cPtr->PanelSize.HDisplay -
mode->CrtcHDisplay) / 2;
if (cPtr->PanelSize.VDisplay > mode->CrtcVDisplay)
cPtr->OverlaySkewY += (cPtr->PanelSize.VDisplay -
- mode->CrtcVDisplay) / 2;
+ mode->CrtcVDisplay) / 2;
+ }
} else {
- cPtr->OverlaySkewX = mode->CrtcHTotal - mode->CrtcHBlankStart - 1;
- cPtr->OverlaySkewY = mode->CrtcVTotal - mode->CrtcVSyncEnd;
+ cPtr->OverlaySkewX = mode->CrtcHTotal - mode->CrtcHBlankStart - 9;
+ cPtr->OverlaySkewY = mode->CrtcVTotal - mode->CrtcVSyncEnd - 2;
if (mode->Flags & V_INTERLACE) {
/*
@@ -5192,6 +5666,25 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode)
}
}
+
+ /* mask for viewport granularity */
+
+ switch (pScrn->bitsPerPixel) {
+ case 8:
+ cPtr->viewportMask = ~7U;
+ break;
+ case 16:
+ cPtr->viewportMask = ~3U;
+ break;
+ case 24:
+ cPtr->viewportMask = ~7U;
+ break;
+ case 32:
+ cPtr->viewportMask = ~0U;
+ break;
+ default:
+ cPtr->viewportMask = ~7U;
+ }
/* Turn off multimedia by default as it degrades performance */
ChipsNew->XR[0xD0] &= 0x0f;
@@ -5250,7 +5743,7 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode)
ChipsNew->MR[0x41] = 0xFF;
ChipsNew->MR[0x42] = 0x00;
} else if (cPtr->Flags & ChipsVideoSupport) {
-#if 0
+#if 0 /* if we do this even though video isn't playing we kill performance */
ChipsNew->XR[0xD0] |= 0x10; /* Force the Multimedia engine on */
#endif
#ifdef SAR04
@@ -5268,7 +5761,39 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode)
/* Program the registers */
/*vgaHWProtect(pScrn, TRUE);*/
- chipsRestore(pScrn, ChipsStd, ChipsNew, FALSE);
+
+
+ if ((cPtr->Flags & ChipsDualChannelSupport) &&
+ (!xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned char IOSS, MSS, tmpfr01;
+
+
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_A));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) |
+ MSS_PIPE_A));
+ chipsRestore(pScrn, ChipsStd, ChipsNew, FALSE);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) |
+ MSS_PIPE_B));
+ /*
+ * Hack:: Force Pipe-B on for dual refresh, and off elsewise
+ */
+ tmpfr01 = ChipsNew->FR[0x01];
+ ChipsNew->FR[0x01] &= 0xFC;
+ if (cPtr->UseDualChannel)
+ ChipsNew->FR[0x01] |= 0x01;
+ chipsRestore(pScrn, ChipsStd, ChipsNew, FALSE);
+ ChipsNew->FR[0x01] = tmpfr01;
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ } else {
+ chipsRestore(pScrn, ChipsStd, ChipsNew, FALSE);
+ }
+
/*vgaHWProtect(pScrn, FALSE);*/
usleep(100000); /* prevents cursor corruption seen on a TECRA 510 */
@@ -5994,17 +6519,16 @@ chipsRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, CHIPSRegPtr ChipsReg,
CHIPSPtr cPtr = CHIPSPTR(pScrn);
unsigned char tmp = 0;
- /* Before we do anything, if using dual channel set the IOSS/MSS regs */
- if (cPtr->Flags & ChipsDualChannelSupport) {
- cPtr->writeIOSS(cPtr,ChipsReg->IOSS);
- cPtr->writeMSS(cPtr,ChipsReg->MSS);
- }
-
/*vgaHWProtect(pScrn, TRUE);*/
/* set registers so that we can program the controller */
if (IS_HiQV(cPtr)) {
cPtr->writeXR(cPtr, 0x0E, 0x00);
+ if (cPtr->Flags & ChipsDualChannelSupport) {
+ tmp = cPtr->readFR(cPtr, 0x01); /* Disable pipeline */
+ cPtr->writeFR(cPtr, 0x01, (tmp & 0xFC));
+ cPtr->writeFR(cPtr, 0x02, 0x00); /* CRT/FP off */
+ }
} else {
cPtr->writeXR(cPtr, 0x10, 0x00);
cPtr->writeXR(cPtr, 0x11, 0x00);
@@ -6017,8 +6541,12 @@ chipsRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, CHIPSRegPtr ChipsReg,
chipsFixResume(pScrn);
- /* wait for vsync if sequencer is running - stop sequencer */
- if (cPtr->SyncResetIgn) { /* only do if sync reset is ignored */
+ /*
+ * Wait for vsync if sequencer is running - stop sequencer.
+ * Only do if sync reset is ignored. Dual pipeline capable
+ * chips have pipeline forced off here, so we don't care.
+ */
+ if ((cPtr->SyncResetIgn) && (!(cPtr->Flags & ChipsDualChannelSupport))) {
while (((hwp->readST01(hwp)) & 0x08) == 0x08); /* VSync off */
while (((hwp->readST01(hwp)) & 0x08) == 0x00); /* VSync on */
hwp->writeSeq(hwp, 0x07, 0x00); /* reset hsync - just in case... */
@@ -6033,33 +6561,23 @@ chipsRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, CHIPSRegPtr ChipsReg,
chipsRestoreExtendedRegs(pScrn, ChipsReg);
#if 0
- /*
- * If we are using the multimedia engine with the 69030, make sure only
- * pipeline A's multimedia engine is on
- */
- if (cPtr->Flags & ChipsDualChannelSupport) {
- unsigned char IOSS, MSS, tmpXRD0;
- IOSS = cPtr->readIOSS(cPtr);
- MSS = cPtr->readMSS(cPtr);
- cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline B */
- cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8));
-
- tmpXRD0 = cPtr->readXR(cPtr, 0xD0);
- cPtr->writeXR(cPtr, 0xD0, (tmpXRD0 & 0xEF));
- cPtr->writeIOSS(cPtr,IOSS);
- cPtr->writeMSS(cPtr,MSS);
- }
-#endif
-
-#if 0
/* if people complain about lock ups or blank screens -- reenable */
/* set CRTC registers - do it before sequencer restarts */
for (i=0; i<25; i++)
hwp->writeCrtc(hwp, i, VgaReg->CRTC[i]);
#endif
/* set generic registers */
- vgaHWRestore(pScrn, VgaReg,
- VGA_SR_MODE | VGA_SR_CMAP | (restoreFonts ? VGA_SR_FONTS : 0));
+ /*
+ * Enabling writing to the colourmap causes 69030's to lock.
+ * Anyone care to explain to me why ????
+ */
+ if (cPtr->Flags & ChipsDualChannelSupport) {
+ vgaHWRestore(pScrn, VgaReg, VGA_SR_MODE |
+ (restoreFonts ? VGA_SR_FONTS : 0));
+ } else {
+ vgaHWRestore(pScrn, VgaReg, VGA_SR_MODE | VGA_SR_CMAP |
+ (restoreFonts ? VGA_SR_FONTS : 0));
+ }
/* set stretching registers */
if (IS_HiQV(cPtr)) {
@@ -6100,6 +6618,13 @@ chipsRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, CHIPSRegPtr ChipsReg,
/* Fix resume again here, as Nozomi seems to need it */
chipsFixResume(pScrn);
/*vgaHWProtect(pScrn, FALSE);*/
+
+ /* Enable pipeline if needed */
+ if (cPtr->Flags & ChipsDualChannelSupport) {
+ cPtr->writeFR(cPtr, 0x01, ChipsReg->FR[0x01]);
+ cPtr->writeFR(cPtr, 0x02, ChipsReg->FR[0x02]);
+ }
+
}
static void
@@ -6152,8 +6677,18 @@ chipsRestoreExtendedRegs(ScrnInfoPtr pScrn, CHIPSRegPtr Regs)
for (i = 0; i < 0x80; i++) {
/* Don't touch alternate clock select reg. */
- if ((i == 0x01) && (cPtr->Chipset == CHIPS_CT69030))
+ if ((i == 0x01) && (cPtr->Chipset == CHIPS_CT69030)) {
+ /* restore the non clock bits */
+ tmp = cPtr->readFR(cPtr, 0x01);
+ cPtr->writeFR(cPtr, 0x01, ((Regs->FR[0x01] & 0xF0) |
+ (tmp & ~0xF0)));
continue;
+ }
+
+ if ((i == 0x02) && (cPtr->Chipset == CHIPS_CT69030))
+ /* keep pipeline disabled till we are ready */
+ continue;
+
if ((i == 0x03) && (cPtr->Chipset != CHIPS_CT69030)) {
/* restore the non clock bits */
tmp = cPtr->readFR(cPtr, 0x03);
@@ -6161,6 +6696,11 @@ chipsRestoreExtendedRegs(ScrnInfoPtr pScrn, CHIPSRegPtr Regs)
(tmp & ~0xC3)));
continue;
}
+
+ if ((i > 0x03) && (cPtr->Chipset != CHIPS_CT69030) &&
+ (cPtr->SecondCrtc == TRUE))
+ continue;
+
if ( (i == 0x40) || (i==0x48)) {
/* !! set stretching but disable compensation */
cPtr->writeFR(cPtr, i, Regs->FR[i] & 0xFE);
@@ -6316,6 +6856,8 @@ chipsMapMem(ScrnInfoPtr pScrn)
{
CHIPSPtr cPtr = CHIPSPTR(pScrn);
vgaHWPtr hwp = VGAHWPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
if (cPtr->Flags & ChipsLinearSupport) {
if (cPtr->UseMMIO) {
@@ -6341,14 +6883,27 @@ chipsMapMem(ScrnInfoPtr pScrn)
return FALSE;
}
if (cPtr->FbMapSize) {
+ unsigned long Addr = (unsigned long)cPtr->FbAddress;
+ unsigned int Map = cPtr->FbMapSize;
+
+ if ((cPtr->Flags & ChipsDualChannelSupport) &&
+ (xf86IsEntityShared(pScrn->entityList[0]))) {
+ if(cPtr->SecondCrtc == FALSE) {
+ Addr = cPtrEnt->masterFbAddress;
+ Map = cPtrEnt->masterFbMapSize;
+ } else {
+ Addr = cPtrEnt->slaveFbAddress;
+ Map = cPtrEnt->slaveFbMapSize;
+ }
+ }
+
if (cPtr->Bus == ChipsPCI)
cPtr->FbBase = xf86MapPciMem(pScrn->scrnIndex,VIDMEM_FRAMEBUFFER,
- cPtr->PciTag, (unsigned long)cPtr->FbAddress,
- cPtr->FbMapSize);
+ cPtr->PciTag, Addr, Map);
+
else
cPtr->FbBase = xf86MapVidMem(pScrn->scrnIndex,VIDMEM_FRAMEBUFFER,
- (unsigned long)cPtr->FbAddress,
- cPtr->FbMapSize);
+ Addr, Map);
if (cPtr->FbBase == NULL)
return FALSE;
@@ -6405,8 +6960,13 @@ chipsBlankScreen(ScrnInfoPtr pScrn, Bool unblank)
{
CHIPSPtr cPtr = CHIPSPTR(pScrn);
vgaHWPtr hwp = VGAHWPTR(pScrn);
+ CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0],
+ CHIPSEntityIndex)->ptr;
unsigned char scrn;
+ if (cPtr->UseDualChannel)
+ DUALREOPEN;
+
/* fix things that could be messed up by suspend/resume */
if (!IS_HiQV(cPtr))
cPtr->writeXR(cPtr, 0x15, 0x00);
@@ -6430,6 +6990,44 @@ chipsBlankScreen(ScrnInfoPtr pScrn, Bool unblank)
if (!cPtr->SyncResetIgn) {
hwp->writeSeq(hwp, 0x00, 0x03);
}
+
+ if ((cPtr->UseDualChannel) &&
+ (! xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned int IOSS, MSS;
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B));
+
+ /* fix things that could be messed up by suspend/resume */
+ if (!IS_HiQV(cPtr))
+ cPtr->writeXR(cPtr, 0x15, 0x00);
+
+ scrn = hwp->readSeq(hwp, 0x01);
+
+ if (unblank) {
+ scrn &= 0xDF; /* enable screen */
+ } else {
+ scrn |= 0x20; /* blank screen */
+ }
+
+ /* synchronous reset - stop counters */
+ if (!cPtr->SyncResetIgn) {
+ hwp->writeSeq(hwp, 0x00, 0x01);
+ }
+
+ hwp->writeSeq(hwp, 0x01, scrn); /* change mode */
+
+ /* end reset - start counters */
+ if (!cPtr->SyncResetIgn) {
+ hwp->writeSeq(hwp, 0x00, 0x03);
+ }
+
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ }
+
}
static void
@@ -6480,12 +7078,25 @@ chipsUnlock(ScrnInfoPtr pScrn)
}
static void
-chipsHWCursorOn(CHIPSPtr cPtr)
+chipsHWCursorOn(CHIPSPtr cPtr, ScrnInfoPtr pScrn)
{
/* enable HW cursor */
if (cPtr->HWCursorShown) {
if (IS_HiQV(cPtr)) {
cPtr->writeXR(cPtr, 0xA0, cPtr->HWCursorContents & 0xFF);
+ if (cPtr->UseDualChannel &&
+ (! xf86IsEntityShared(pScrn->entityList[0]))) {
+ unsigned int IOSS, MSS;
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) |
+ IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) |
+ MSS_PIPE_B));
+ cPtr->writeXR(cPtr, 0xA0, cPtr->HWCursorContents & 0xFF);
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ }
} else {
HW_DEBUG(0x8);
if (cPtr->UseMMIO) {
@@ -6498,7 +7109,7 @@ chipsHWCursorOn(CHIPSPtr cPtr)
}
static void
-chipsHWCursorOff(CHIPSPtr cPtr)
+chipsHWCursorOff(CHIPSPtr cPtr, ScrnInfoPtr pScrn)
{
/* disable HW cursor */
if (cPtr->HWCursorShown) {
@@ -6564,6 +7175,28 @@ chipsProbeMonitor(ScrnInfoPtr pScrn)
unsigned char dacdata[3];
unsigned char xr1, xr2;
int type = 2; /* no monitor */
+ unsigned char IOSS=0, MSS=0, tmpfr02=0, tmpfr01a=0, tmpfr01b=0;
+
+ /* Dual channel display, enable both pipelines */
+ if (cPtr->Flags & ChipsDualChannelSupport) {
+ IOSS = cPtr->readIOSS(cPtr);
+ MSS = cPtr->readMSS(cPtr);
+ tmpfr02 = cPtr->readFR(cPtr,0x02);
+ cPtr->writeFR(cPtr, 0x02, tmpfr02 & 0xCF); /* CRT/FP off */
+ usleep(1000);
+ cPtr->writeIOSS(cPtr, ((IOSS & IOSS_MASK) | IOSS_PIPE_A));
+ cPtr->writeMSS(cPtr, ((MSS & MSS_MASK) | MSS_PIPE_A));
+ tmpfr01a = cPtr->readFR(cPtr,0x01);
+ if ((tmpfr01a & 0x3) == 0)
+ cPtr->writeFR(cPtr, 0x01, ((tmpfr01a & 0xFC) | 0x1));
+ cPtr->writeIOSS(cPtr, ((IOSS & IOSS_MASK) | IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((MSS & MSS_MASK) | MSS_PIPE_B));
+ tmpfr01b = cPtr->readFR(cPtr,0x01);
+ if ((tmpfr01b & 0x3) == 0)
+ cPtr->writeFR(cPtr, 0x01, ((tmpfr01b & 0xFC) | 0x1));
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ }
dacmask = hwp->readDacMask(hwp); /* save registers */
hwp->writeDacMask(hwp, 0x00);
@@ -6612,6 +7245,20 @@ chipsProbeMonitor(ScrnInfoPtr pScrn)
cPtr->writeXR(cPtr,0x81,xr1);
cPtr->writeXR(cPtr,0xD0,xr2);
}
+
+ if (cPtr->Flags & ChipsDualChannelSupport) {
+ cPtr->writeIOSS(cPtr, ((IOSS & IOSS_MASK) | IOSS_PIPE_A));
+ cPtr->writeMSS(cPtr, ((MSS & MSS_MASK) | MSS_PIPE_A));
+ cPtr->writeFR(cPtr, 0x01, tmpfr01a);
+ cPtr->writeIOSS(cPtr, ((IOSS & IOSS_MASK) | IOSS_PIPE_B));
+ cPtr->writeMSS(cPtr, ((MSS & MSS_MASK) | MSS_PIPE_B));
+ cPtr->writeFR(cPtr, 0x01, tmpfr01b);
+ usleep(1000);
+ cPtr->writeIOSS(cPtr, IOSS);
+ cPtr->writeMSS(cPtr, MSS);
+ cPtr->writeFR(cPtr, 0x02, tmpfr02);
+ }
+
return type;
}
@@ -6639,17 +7286,32 @@ chipsSetPanelType(CHIPSPtr cPtr)
CARD8 tmp;
if (IS_HiQV(cPtr)) {
- /* test LCD */
- /* FR01: DISPLAY TYPE REGISTER */
- /* FR01[1:0]: Display Type, 01 = CRT, 10 = FlatPanel */
- /* LCD */
- tmp = cPtr->readFR(cPtr, 0x01);
- if ((tmp & 0x03) == 0x02) {
- cPtr->PanelType |= ChipsLCD;
- }
- tmp = cPtr->readXR(cPtr,0xD0);
- if (tmp & 0x01) {
- cPtr->PanelType |= ChipsCRT;
+ if (cPtr->Chipset == CHIPS_CT69030) {
+ tmp = cPtr->readFR(cPtr, 0x00);
+ if (tmp & 0x20) {
+ /* FR02: DISPLAY TYPE REGISTER */
+ /* FR02[4] = CRT, FR02[5] = FlatPanel */
+ tmp = cPtr->readFR(cPtr, 0x02);
+ if (tmp & 0x10)
+ cPtr->PanelType |= ChipsCRT;
+ if (tmp & 0x20)
+ cPtr->PanelType |= ChipsLCD;
+ } else {
+ cPtr->PanelType |= ChipsCRT;
+ }
+ } else {
+ /* test LCD */
+ /* FR01: DISPLAY TYPE REGISTER */
+ /* FR01[1:0]: Display Type, 01 = CRT, 10 = FlatPanel */
+ /* LCD */
+ tmp = cPtr->readFR(cPtr, 0x01);
+ if ((tmp & 0x03) == 0x02) {
+ cPtr->PanelType |= ChipsLCD;
+ }
+ tmp = cPtr->readXR(cPtr,0xD0);
+ if (tmp & 0x01) {
+ cPtr->PanelType |= ChipsCRT;
+ }
}
} else {
tmp = cPtr->readXR(cPtr, 0x51);
@@ -6665,4 +7327,23 @@ chipsSetPanelType(CHIPSPtr cPtr)
}
}
+static void
+chipsBlockHandler (
+ int i,
+ pointer blockData,
+ pointer pTimeout,
+ pointer pReadmask
+){
+ ScreenPtr pScreen = screenInfo.screens[i];
+ ScrnInfoPtr pScrn = xf86Screens[i];
+ CHIPSPtr cPtr = CHIPSPTR(pScrn);
+
+ pScreen->BlockHandler = cPtr->BlockHandler;
+ (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+ pScreen->BlockHandler = chipsBlockHandler;
+ if(cPtr->VideoTimerCallback) {
+ UpdateCurrentTime();
+ (*cPtr->VideoTimerCallback)(pScrn, currentTime.milliseconds);
+ }
+}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h
index 05aa7bfe4..b7bcfd39b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h
@@ -22,7 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h,v 1.30 2000/10/23 12:10:13 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h,v 1.32 2001/05/15 10:19:36 eich Exp $ */
#ifndef _CT_DRIVER_H_
@@ -35,6 +35,7 @@
#include "xf86i2c.h"
#include "xf86DDC.h"
#include "xf86xv.h"
+#include "vgaHW.h"
/* Supported chipsets */
typedef enum {
@@ -106,6 +107,7 @@ typedef struct {
#define ChipsGammaSupport 0x00000080
#define ChipsVideoSupport 0x00000100
#define ChipsDualChannelSupport 0x00000200
+#define ChipsDualRefresh 0x00000400
/* Options flags for the C&T chipsets */
#define ChipsHWCursor 0x00001000
@@ -152,14 +154,22 @@ typedef struct {
#define ChipsSS 0x0800
#define IS_STN(x) ((x) & 0xE00)
+/* Dual channel register enable masks */
+#define IOSS_MASK 0xE0
+#define IOSS_BOTH 0x13
+#define IOSS_PIPE_A 0x11
+#define IOSS_PIPE_B 0x1E
+#define MSS_MASK 0xF0
+#define MSS_BOTH 0x0B
+#define MSS_PIPE_A 0x02
+#define MSS_PIPE_B 0x05
+
/* Storage for the registers of the C&T chipsets */
typedef struct {
unsigned char XR[0xFF];
unsigned char CR[0x80];
unsigned char FR[0x80];
unsigned char MR[0x80];
- unsigned char MSS;
- unsigned char IOSS;
CHIPSClockReg Clock;
} CHIPSRegRec, *CHIPSRegPtr;
@@ -238,6 +248,23 @@ typedef void (*chipsWriteIOSSPtr)(CHIPSPtr cPtr, CARD8 value);
/* The privates of the C&T driver */
#define CHIPSPTR(p) ((CHIPSPtr)((p)->driverPrivate))
+
+typedef struct {
+ int lastInstance;
+ int refCount;
+ CARD32 masterFbAddress;
+ long masterFbMapSize;
+ CARD32 slaveFbAddress;
+ long slaveFbMapSize;
+ int mastervideoRam;
+ int slavevideoRam;
+ Bool masterOpen;
+ Bool slaveOpen;
+ Bool masterActive;
+ Bool slaveActive;
+} CHIPSEntRec, *CHIPSEntPtr;
+
+
typedef struct _CHIPSRec {
pciVideoPtr PciInfo;
PCITAG PciTag;
@@ -281,6 +308,8 @@ typedef struct _CHIPSRec {
CARD32 PanelType;
CHIPSRegRec ModeReg;
CHIPSRegRec SavedReg;
+ CHIPSRegRec SavedReg2;
+ vgaRegRec VgaSavedReg2;
unsigned int * Regs32;
unsigned int Flags;
CARD32 Bus;
@@ -295,12 +324,16 @@ typedef struct _CHIPSRec {
int DGAViewportStatus;
CloseScreenProcPtr CloseScreen;
ScreenBlockHandlerProcPtr BlockHandler;
+ void (*VideoTimerCallback)(ScrnInfoPtr, Time);
int videoKey;
XF86VideoAdaptorPtr adaptor;
int OverlaySkewX;
int OverlaySkewY;
int VideoZoomMax;
-
+ Bool SecondCrtc;
+ CHIPSEntPtr entityPrivate;
+ unsigned char storeMSS;
+ unsigned char storeIOSS;
#ifdef __arm32__
#ifdef __NetBSD__
int TVMode;
@@ -320,6 +353,8 @@ typedef struct _CHIPSRec {
chipsWriteMSSPtr writeMSS;
chipsReadIOSSPtr readIOSS;
chipsWriteIOSSPtr writeIOSS;
+ Bool cursorDelay;
+ unsigned int viewportMask;
} CHIPSRec;
typedef struct _CHIPSi2c {
@@ -390,6 +425,112 @@ void chipsRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void chipsPointerMoved(int index, int x, int y);
+/*
+ * Some macros for switching display channels. NOTE... It appears that we
+ * can't write to both display channels at the same time, and so the options
+ * MSS_BOTH and IOSS_BOTH should not be used. Need to get around this by set
+ * dual channel mode to pipe A by default and handling multiple channel writes
+ * in ModeInit..
+ */
+
+#define DUALOPEN \
+ { \
+ /* Set the IOSS/MSS registers to point to the right register set */ \
+ if (xf86IsEntityShared(pScrn->entityList[0])) { \
+ if (cPtr->SecondCrtc == TRUE) { \
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \
+ IOSS_PIPE_B)); \
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | \
+ MSS_PIPE_B)); \
+ cPtrEnt->slaveOpen = TRUE; \
+ cPtrEnt->slaveActive = TRUE; \
+ cPtrEnt->masterActive = FALSE; \
+ } else { \
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \
+ IOSS_PIPE_A)); \
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | \
+ MSS_PIPE_A)); \
+ cPtrEnt->masterOpen = TRUE; \
+ cPtrEnt->masterActive = TRUE; \
+ cPtrEnt->slaveActive = FALSE; \
+ } \
+ } else { \
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \
+ IOSS_PIPE_A)); \
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_A)); \
+ } \
+ }
+
+#define DUALREOPEN \
+ { \
+ if (xf86IsEntityShared(pScrn->entityList[0])) { \
+ if (cPtr->SecondCrtc == TRUE) { \
+ if (! cPtrEnt->slaveActive) { \
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \
+ IOSS_PIPE_B)); \
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | \
+ MSS_PIPE_B)); \
+ cPtrEnt->slaveOpen = TRUE; \
+ cPtrEnt->slaveActive = TRUE; \
+ cPtrEnt->masterActive = FALSE; \
+ } \
+ } else { \
+ if (! cPtrEnt->masterActive) { \
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \
+ IOSS_PIPE_A)); \
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | \
+ MSS_PIPE_A)); \
+ cPtrEnt->masterOpen = TRUE; \
+ cPtrEnt->masterActive = TRUE; \
+ cPtrEnt->slaveActive = FALSE; \
+ } \
+ } \
+ } \
+ }
+
+#define DUALCLOSE \
+ { \
+ if (! xf86IsEntityShared(pScrn->entityList[0])) { \
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \
+ IOSS_PIPE_A)); \
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_A)); \
+ chipsHWCursorOff(cPtr, pScrn); \
+ chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, \
+ &cPtr->SavedReg, TRUE); \
+ chipsLock(pScrn); \
+ cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \
+ IOSS_PIPE_B)); \
+ cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B)); \
+ chipsHWCursorOff(cPtr, pScrn); \
+ chipsRestore(pScrn, &cPtr->VgaSavedReg2, &cPtr->SavedReg2, TRUE); \
+ cPtr->writeIOSS(cPtr, cPtr->storeIOSS); \
+ cPtr->writeMSS(cPtr, cPtr->storeMSS); \
+ chipsLock(pScrn); \
+ } else { \
+ chipsHWCursorOff(cPtr, pScrn); \
+ chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, &cPtr->SavedReg,\
+ TRUE); \
+ if (cPtr->SecondCrtc == TRUE) { \
+ cPtrEnt->slaveActive = FALSE; \
+ cPtrEnt->slaveOpen = FALSE; \
+ if (! cPtrEnt->masterActive) { \
+ cPtr->writeIOSS(cPtr, cPtr->storeIOSS); \
+ cPtr->writeMSS(cPtr, cPtr->storeMSS); \
+ chipsLock(pScrn); \
+ } \
+ } else { \
+ cPtrEnt->masterActive = FALSE; \
+ cPtrEnt->masterOpen = FALSE; \
+ if (! cPtrEnt->slaveActive) { \
+ cPtr->writeIOSS(cPtr, cPtr->storeIOSS); \
+ cPtr->writeMSS(cPtr, cPtr->storeMSS); \
+ chipsLock(pScrn); \
+ } \
+ } \
+ } \
+ }
+
+
/* To aid debugging of 32 bit register access we make the following defines */
/*
#define DEBUG
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c
index 248c85624..ac98aac7a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c
@@ -19,7 +19,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c,v 1.5 2000/09/22 11:35:48 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c,v 1.6 2001/05/09 19:57:05 dbateman Exp $ */
/*
* The functions in this file are used to read/write the C&T extension register
@@ -65,9 +65,6 @@
/* This is used for module versioning */
#include "xf86Version.h"
-/* All drivers using the vgahw module need this */
-#include "vgaHW.h"
-
/* Driver specific headers */
#include "ct_driver.h"
@@ -201,8 +198,8 @@ CHIPSSetStdExtFuncs(CHIPSPtr cPtr)
* MMIO Access to the C&T extension registers
*/
-#define chipsminb(p) MMIO_IN8(cPtr->MMIOBase, (p))
-#define chipsmoutb(p,v) MMIO_OUT8(cPtr->MMIOBase, (p),(v))
+#define chipsminb(p) MMIO_IN8(cPtr->MMIOBaseVGA, (p))
+#define chipsmoutb(p,v) MMIO_OUT8(cPtr->MMIOBaseVGA, (p),(v))
static void
chipsMmioWriteXR(CHIPSPtr cPtr, CARD8 index, CARD8 value)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c
index 864b7843b..6f3e7fb8c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c,v 1.6 2001/02/15 18:36:11 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c,v 1.7 2001/05/15 10:19:36 eich Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -43,14 +43,15 @@ static int CHIPSPutImage( ScrnInfoPtr,
int, unsigned char*, short, short, Bool, RegionPtr, pointer);
static int CHIPSQueryImageAttributes(ScrnInfoPtr,
int, unsigned short *, unsigned short *, int *, int *);
+static void CHIPSVideoTimerCallback(ScrnInfoPtr pScrn, Time time);
-static void CHIPSBlockHandler(int, pointer, pointer, pointer);
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
static Atom xvColorKey;
-void CHIPSInitVideo(ScreenPtr pScreen)
+void
+CHIPSInitVideo(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
@@ -92,7 +93,8 @@ void CHIPSInitVideo(ScreenPtr pScreen)
}
/* client libraries expect an encoding */
-static XF86VideoEncodingRec DummyEncoding[1] =
+static
+XF86VideoEncodingRec DummyEncoding[1] =
{
{
0,
@@ -159,7 +161,7 @@ static XF86ImageRec Images[NUM_IMAGES] =
};
typedef struct {
- FBAreaPtr area;
+ FBLinearPtr linear;
RegionRec clip;
CARD32 colorKey;
CARD32 videoStatus;
@@ -171,7 +173,8 @@ typedef struct {
#define GET_PORT_PRIVATE(pScrn) \
(CHIPSPortPrivPtr)((CHIPSPTR(pScrn))->adaptor->pPortPrivates[0].ptr)
-void CHIPSResetVideo(ScrnInfoPtr pScrn)
+void
+CHIPSResetVideo(ScrnInfoPtr pScrn)
{
CHIPSPtr cPtr = CHIPSPTR(pScrn);
CHIPSPortPrivPtr pPriv = cPtr->adaptor->pPortPrivates[0].ptr;
@@ -319,18 +322,19 @@ RegionsEqual(RegionPtr A, RegionPtr B)
boundaries in 16.16 fixed point.
*/
-static void
+static Bool
CHIPSClipVideo(
BoxPtr dst,
INT32 *x1,
INT32 *x2,
INT32 *y1,
INT32 *y2,
- BoxPtr extents, /* extents of the clip region */
+ RegionPtr reg,
INT32 width,
INT32 height
){
INT32 vscale, hscale, delta;
+ BoxPtr extents = REGION_EXTENTS(DummyScreen, reg);
int diff;
hscale = ((*x2 - *x1) << 16) / (dst->x2 - dst->x1);
@@ -371,6 +375,8 @@ CHIPSClipVideo(
dst->x2 -= diff;
*x2 -= diff * hscale;
}
+ if(*x1 >= *x2) return FALSE;
+
if(*y1 < 0) {
diff = (- *y1 + vscale - 1)/ vscale;
dst->y1 += diff;
@@ -382,6 +388,17 @@ CHIPSClipVideo(
dst->y2 -= diff;
*y2 -= diff * vscale;
}
+ if(*y1 >= *y2) return FALSE;
+
+ if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) ||
+ (dst->y1 != extents->y1) || (dst->y2 != extents->y2))
+ {
+ RegionRec clipReg;
+ REGION_INIT(DummyScreen, &clipReg, dst, 1);
+ REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
+ REGION_UNINIT(DummyScreen, &clipReg);
+ }
+ return TRUE;
}
static void
@@ -400,18 +417,16 @@ CHIPSStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit)
tmp = cPtr->readXR(cPtr, 0xD0);
cPtr->writeXR(cPtr, 0xD0, (tmp & 0xf));
}
- if(pPriv->area) {
- xf86FreeOffscreenArea(pPriv->area);
- pPriv->area = NULL;
+ if(pPriv->linear) {
+ xf86FreeOffscreenLinear(pPriv->linear);
+ pPriv->linear = NULL;
}
pPriv->videoStatus = 0;
- pScrn->pScreen->BlockHandler = cPtr->BlockHandler;
} else {
if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
pPriv->videoStatus |= OFF_TIMER;
pPriv->offTime = currentTime.milliseconds + OFF_DELAY;
- cPtr->BlockHandler = pScrn->pScreen->BlockHandler;
- pScrn->pScreen->BlockHandler = CHIPSBlockHandler;
+ cPtr->VideoTimerCallback = CHIPSVideoTimerCallback;
}
}
}
@@ -533,13 +548,8 @@ CHIPSCopyMungedData(
for(j = 0; j < h; j++) {
for(i = 0; i < w; i++) {
-#if 1
dst[i] = src1[i << 1] | (src1[(i << 1) + 1] << 16) |
(src3[i] << 8) | (src2[i] << 24);
-#else
- dst[i] = (src1[i << 1] << 24) | (src1[(i << 1) + 1] << 8) |
- (src3[i] << 0) | (src2[i] << 16);
-#endif
}
dst += dstPitch;
src1 += srcPitch;
@@ -550,45 +560,45 @@ CHIPSCopyMungedData(
}
}
-static FBAreaPtr
+static FBLinearPtr
CHIPSAllocateMemory(
ScrnInfoPtr pScrn,
- FBAreaPtr area,
- int numlines
+ FBLinearPtr linear,
+ int size
){
ScreenPtr pScreen;
- FBAreaPtr new_area;
+ FBLinearPtr new_linear;
- if(area) {
- if((area->box.y2 - area->box.y1) >= numlines)
- return area;
+ if(linear) {
+ if(linear->size >= size)
+ return linear;
- if(xf86ResizeOffscreenArea(area, pScrn->displayWidth, numlines))
- return area;
+ if(xf86ResizeOffscreenLinear(linear, size))
+ return linear;
- xf86FreeOffscreenArea(area);
+ xf86FreeOffscreenLinear(linear);
}
pScreen = screenInfo.screens[pScrn->scrnIndex];
- new_area = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth,
- numlines, 0, NULL, NULL, NULL);
+ new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16,
+ NULL, NULL, NULL);
- if(!new_area) {
- int max_w, max_h;
+ if(!new_linear) {
+ int max_size;
- xf86QueryLargestOffscreenArea(pScreen, &max_w, &max_h, 0,
- FAVOR_WIDTH_THEN_AREA, PRIORITY_EXTREME);
+ xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16,
+ PRIORITY_EXTREME);
- if((max_w < pScrn->displayWidth) || (max_h < numlines))
+ if(max_size < size)
return NULL;
xf86PurgeUnlockedOffscreenAreas(pScreen);
- new_area = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth,
- numlines, 0, NULL, NULL, NULL);
+ new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16,
+ NULL, NULL, NULL);
}
- return new_area;
+ return new_linear;
}
static void
@@ -641,6 +651,8 @@ CHIPSDisplayVideo(
tmp &= 0xC3;
cPtr->writeMR(cPtr, 0x20, tmp);
+ offset += (x1 >> 15) & ~0x01;
+
/* Setup Pointer 1 */
cPtr->writeMR(cPtr, 0x22, (offset & 0xF8));
cPtr->writeMR(cPtr, 0x23, ((offset >> 8) & 0xFF));
@@ -686,11 +698,13 @@ CHIPSDisplayVideo(
/* Vertical Zoom */
if (drw_h > src_h) {
+#if 1
tmp = cPtr->readMR(cPtr, 0x1F);
- cPtr->writeMR(cPtr, 0x1F, (tmp | 0x80)); /* set V-interpolation */
+ cPtr->writeMR(cPtr, 0x1F, (tmp | 0xc0)); /* set V-interpolation */
+#endif
tmp = cPtr->readMR(cPtr, 0x1E);
cPtr->writeMR(cPtr, 0x1E, (tmp | 0x08));
- tmp = cPtr->VideoZoomMax * src_h / drw_h;
+ tmp = cPtr->VideoZoomMax * src_h / drw_h ;
cPtr->writeMR(cPtr, 0x33, tmp);
}
@@ -715,15 +729,12 @@ CHIPSPutImage(
CHIPSPtr cPtr = CHIPSPTR(pScrn);
INT32 x1, x2, y1, y2;
unsigned char *dst_start;
- int pitch, new_h, offset, offset2, offset3;
- int srcPitch, srcPitch2, dstPitch;
- int top, left, npixels, nlines;
+ int pitch, new_size, offset, offset2 = 0, offset3 = 0;
+ int srcPitch, srcPitch2 = 0, dstPitch;
+ int top, left, npixels, nlines, bpp;
BoxRec dstBox;
CARD32 tmp;
-
- if (pScrn->pScreen->BlockHandler == CHIPSBlockHandler)
- pScrn->pScreen->BlockHandler = cPtr->BlockHandler;
-
+
if(drw_w > 16384) drw_w = 16384;
/* Clip */
@@ -736,22 +747,20 @@ CHIPSPutImage(
dstBox.x2 = drw_x + drw_w;
dstBox.y1 = drw_y;
dstBox.y2 = drw_y + drw_h;
+
+ if (!CHIPSClipVideo(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height))
+ return Success;
- CHIPSClipVideo(&dstBox, &x1, &x2, &y1, &y2,
- REGION_EXTENTS(pScreen, clipBoxes), width, height);
-
- if((x1 >= x2) || (y1 >= y2))
- return Success;
-
- dstBox.x1 -= pScrn->frameX0;
- dstBox.x2 -= pScrn->frameX0;
+ dstBox.x1 -= pScrn->frameX0 & cPtr->viewportMask;
+ dstBox.x2 -= pScrn->frameX0 & cPtr->viewportMask;
dstBox.y1 -= pScrn->frameY0;
dstBox.y2 -= pScrn->frameY0;
- pitch = pScrn->bitsPerPixel * pScrn->displayWidth >> 3;
+ bpp = pScrn->bitsPerPixel >> 3;
+ pitch = bpp * pScrn->displayWidth;
dstPitch = ((width << 1) + 15) & ~15;
- new_h = ((dstPitch * height) + pitch - 1) / pitch;
+ new_size = ((dstPitch * height) + bpp - 1) / bpp;
switch(id) {
case FOURCC_YV12: /* YV12 */
@@ -765,16 +774,17 @@ CHIPSPutImage(
break;
}
- if(!(pPriv->area = CHIPSAllocateMemory(pScrn, pPriv->area, new_h)))
+ if(!(pPriv->linear = CHIPSAllocateMemory(pScrn, pPriv->linear, new_size)))
return BadAlloc;
+
/* copy data */
top = y1 >> 16;
left = (x1 >> 16) & ~1;
npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left;
left <<= 1;
- offset = (pPriv->area->box.y1 * pitch) + (top * dstPitch);
- dst_start = cPtr->FbBase + offset + left;
+ offset = pPriv->linear->offset * bpp;
+ dst_start = cPtr->FbBase + offset + left + (top * dstPitch);
switch(id) {
case FOURCC_YV12: /* YV12 */
@@ -802,12 +812,13 @@ CHIPSPutImage(
REGION_NUM_RECTS(clipBoxes),
REGION_RECTS(clipBoxes));
}
-
+
+offset += top * dstPitch;
CHIPSDisplayVideo(pScrn, id, offset, width, height, dstPitch,
x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h);
pPriv->videoStatus = CLIENT_VIDEO_ON;
-
+
return Success;
}
@@ -850,29 +861,17 @@ CHIPSQueryImageAttributes(
return size;
}
+
static void
-CHIPSBlockHandler (
- int i,
- pointer blockData,
- pointer pTimeout,
- pointer pReadmask
-){
- ScreenPtr pScreen = screenInfo.screens[i];
- ScrnInfoPtr pScrn = xf86Screens[i];
+CHIPSVideoTimerCallback(ScrnInfoPtr pScrn, Time time)
+{
CHIPSPtr cPtr = CHIPSPTR(pScrn);
CHIPSPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn);
unsigned char mr3c;
-
- pScreen->BlockHandler = cPtr->BlockHandler;
-
- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
-
- pScreen->BlockHandler = CHIPSBlockHandler;
if(pPriv->videoStatus & TIMER_MASK) {
- UpdateCurrentTime();
if(pPriv->videoStatus & OFF_TIMER) {
- if(pPriv->offTime < currentTime.milliseconds) {
+ if(pPriv->offTime < time) {
CHIPSHiQVSync(pScrn);
mr3c = cPtr->readMR(cPtr, 0x3C);
cPtr->writeMR(cPtr, 0x3C, (mr3c & 0xFE));
@@ -880,23 +879,24 @@ CHIPSBlockHandler (
pPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
}
} else { /* FREE_TIMER */
- if(pPriv->freeTime < currentTime.milliseconds) {
- if(pPriv->area) {
- xf86FreeOffscreenArea(pPriv->area);
- pPriv->area = NULL;
+ if(pPriv->freeTime < time) {
+ if(pPriv->linear) {
+ xf86FreeOffscreenLinear(pPriv->linear);
+ pPriv->linear = NULL;
}
pPriv->videoStatus = 0;
- pScreen->BlockHandler = cPtr->BlockHandler;
+ cPtr->VideoTimerCallback = NULL;
}
}
- }
+ } else /* shouldn't get here */
+ cPtr->VideoTimerCallback = NULL;
}
/****************** Offscreen stuff ***************/
typedef struct {
- FBAreaPtr area;
+ FBLinearPtr linear;
Bool isOn;
} OffscreenPrivRec, * OffscreenPrivPtr;
@@ -908,8 +908,8 @@ CHIPSAllocateSurface(
unsigned short h,
XF86SurfacePtr surface
){
- FBAreaPtr area;
- int pitch, fbpitch, numlines;
+ FBLinearPtr linear;
+ int pitch, fbpitch, size, bpp;
OffscreenPrivPtr pPriv;
if((w > 1024) || (h > 1024))
@@ -917,34 +917,39 @@ CHIPSAllocateSurface(
w = (w + 1) & ~1;
pitch = ((w << 1) + 15) & ~15;
- fbpitch = pScrn->bitsPerPixel * pScrn->displayWidth >> 3;
- numlines = ((pitch * h) + fbpitch - 1) / fbpitch;
+ bpp = pScrn->bitsPerPixel >> 3;
+ fbpitch = bpp * pScrn->displayWidth;
+ size = ((pitch * h) + bpp - 1) / bpp;
- if(!(area = CHIPSAllocateMemory(pScrn, NULL, numlines)))
+ if(!(linear = CHIPSAllocateMemory(pScrn, NULL, size)))
return BadAlloc;
surface->width = w;
surface->height = h;
- if(!(surface->pitches = xalloc(sizeof(int))))
+ if(!(surface->pitches = xalloc(sizeof(int)))) {
+ xf86FreeOffscreenLinear(linear);
return BadAlloc;
+ }
if(!(surface->offsets = xalloc(sizeof(int)))) {
xfree(surface->pitches);
+ xf86FreeOffscreenLinear(linear);
return BadAlloc;
}
if(!(pPriv = xalloc(sizeof(OffscreenPrivRec)))) {
xfree(surface->pitches);
xfree(surface->offsets);
+ xf86FreeOffscreenLinear(linear);
return BadAlloc;
}
- pPriv->area = area;
+ pPriv->linear = linear;
pPriv->isOn = FALSE;
surface->pScrn = pScrn;
surface->id = id;
surface->pitches[0] = pitch;
- surface->offsets[0] = area->box.y1 * fbpitch;
+ surface->offsets[0] = linear->offset * bpp;
surface->devPrivate.ptr = (pointer)pPriv;
return Success;
@@ -978,7 +983,7 @@ CHIPSFreeSurface(
if(pPriv->isOn)
CHIPSStopSurface(surface);
- xf86FreeOffscreenArea(pPriv->area);
+ xf86FreeOffscreenLinear(pPriv->linear);
xfree(surface->pitches);
xfree(surface->offsets);
xfree(surface->devPrivate.ptr);
@@ -1018,6 +1023,7 @@ CHIPSDisplaySurface(
){
OffscreenPrivPtr pPriv = (OffscreenPrivPtr)surface->devPrivate.ptr;
ScrnInfoPtr pScrn = surface->pScrn;
+ CHIPSPtr cPtr = CHIPSPTR(pScrn);
CHIPSPortPrivPtr portPriv = GET_PORT_PRIVATE(pScrn);
INT32 x1, y1, x2, y2;
BoxRec dstBox;
@@ -1032,11 +1038,8 @@ CHIPSDisplaySurface(
dstBox.y1 = drw_y;
dstBox.y2 = drw_y + drw_h;
- CHIPSClipVideo(&dstBox, &x1, &x2, &y1, &y2,
- REGION_EXTENTS(pScreen, clipBoxes),
- surface->width, surface->height);
-
- if((x1 >= x2) || (y1 >= y2))
+ if(!CHIPSClipVideo(&dstBox, &x1, &x2, &y1, &y2, clipBoxes,
+ surface->width, surface->height))
return Success;
dstBox.x1 -= pScrn->frameX0;
@@ -1044,20 +1047,22 @@ CHIPSDisplaySurface(
dstBox.y1 -= pScrn->frameY0;
dstBox.y2 -= pScrn->frameY0;
- XAAFillSolidRects(pScrn, portPriv->colorKey, GXcopy, ~0,
- REGION_NUM_RECTS(clipBoxes),
- REGION_RECTS(clipBoxes));
CHIPSDisplayVideo(pScrn, surface->id, surface->offsets[0],
surface->width, surface->height, surface->pitches[0],
x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h);
+ XAAFillSolidRects(pScrn, portPriv->colorKey, GXcopy, ~0,
+ REGION_NUM_RECTS(clipBoxes),
+ REGION_RECTS(clipBoxes));
+
pPriv->isOn = TRUE;
if(portPriv->videoStatus & CLIENT_VIDEO_ON) {
REGION_EMPTY(pScrn->pScreen, &portPriv->clip);
UpdateCurrentTime();
portPriv->videoStatus = FREE_TIMER;
portPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
+ cPtr->VideoTimerCallback = CHIPSVideoTimerCallback;
}
return Success;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c
index 1f4e9b01c..06c47a3c2 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c
@@ -4,7 +4,7 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c,v 1.6 2000/09/22 11:35:49 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c,v 1.6.4.1 2001/05/25 18:15:45 eich Exp $ */
#ifdef __NetBSD__
# include <sys/types.h>
@@ -188,7 +188,7 @@ void main(void)
storeReg = inb(0x3CE);
for(i = 0;i < 0x10;i++){
outb(0x3CE,i);
- printf("GC 0x%2.2X\t0x%X2.2\n",i,inb(0x3CF)&0xFF);
+ printf("GC 0x%2.2X\t0x%2.2X\n",i,inb(0x3CF)&0xFF);
}
outb(0x3CE,storeReg);
printf("port 0x3C4 (Sequencer)\n");
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c
index 9d5b90e83..de35bd5ec 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c,v 1.4 2000/09/22 11:35:49 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c,v 1.5 2001/05/09 19:57:06 dbateman Exp $ */
#ifdef __NetBSD__
# include <sys/types.h>
@@ -60,12 +60,39 @@
#define tolerance 0.01 /* +/- 1% */
+
+#define CT65520 0x1
+#define CT65525 0x2
+#define CT65530 0x3
+#define CT64200 0x4
+
+#define CT65535 0x11
+#define CT65540 0x12
+#define CT65545 0x13
+#define CT65546 0x14
+#define CT65548 0x15
+#define CT64300 0x16
+
+#define CT65550 0x31
+#define CT65554 0x32
+#define CT65555 0x33
+#define CT68554 0x34
+#define CT69000 0x35
+#define CT69030 0x36
+
+#define IS_Programmable(X) X&0x10
+#define IS_HiQV(X) X&0x20
+
+#define DotClk 0
+#define MemClk 1
+#define IS_MemClk(X) X&0x1
+
int compute_clock (
+ unsigned int ChipType,
double target,
double Fref,
unsigned int ClkMaxN,
unsigned int ClkMaxM,
- unsigned int PStart,
unsigned int *bestM,
unsigned int *bestN,
unsigned int *bestP,
@@ -104,7 +131,8 @@ int compute_clock (
they should be set to 0 on the 65548, and left untouched on
earlier chips. */
- for (PSNx = 0; PSNx <= 1; PSNx++) {
+ for (PSNx = ((ChipType == CT69000) || (ChipType == CT69030)) ? 1 : 0;
+ PSNx <= 1; PSNx++) {
unsigned int low_N, high_N;
double Fref4PSN;
@@ -113,7 +141,8 @@ int compute_clock (
low_N = 3;
high_N = ClkMaxN;
- while (Fref / (PSN * low_N) > 2.0e6)
+ while (Fref / (PSN * low_N) > (((ChipType == CT69000) ||
+ (ChipType == CT69030)) ? 5.0e6 : 2.0e6))
low_N++;
while (Fref / (PSN * high_N) < 150.0e3)
high_N--;
@@ -121,7 +150,9 @@ int compute_clock (
Fref4PSN = Fref * 4 / PSN;
for (N = low_N; N <= high_N; N++) {
double tmp = Fref4PSN / N;
- for (P = PStart; P <= 5; P++) {
+
+ for (P = (IS_HiQV(ChipType) && (ChipType != CT69000) &&
+ (ChipType != CT69030)) ? 1 : 0; P <= 5; P++) {
double Fvco_desired = target * (1 << P);
double M_desired = Fvco_desired / tmp;
/* Which way will M_desired be rounded? Do all three just to
@@ -139,7 +170,8 @@ int compute_clock (
for (M = M_low; M <= M_hi; M++) {
Fvco = tmp * M;
- if (Fvco <= 48.0e6)
+ if (Fvco <= ((ChipType == CT69000) || (ChipType == CT69030) ?
+ 100e6 : 48.0e6))
continue;
if (Fvco > 220.0e6)
break;
@@ -180,35 +212,10 @@ int compute_clock (
return 1;
}
-#define CT65520 0x1
-#define CT65525 0x2
-#define CT65530 0x3
-#define CT64200 0x4
-
-#define CT65535 0x11
-#define CT65540 0x12
-#define CT65545 0x13
-#define CT65546 0x14
-#define CT65548 0x15
-#define CT64300 0x16
-
-#define CT65550 0x31
-#define CT65554 0x32
-#define CT65555 0x33
-#define CT68554 0x34
-#define CT69000 0x35
-#define CT69030 0x36
-
-#define IS_Programmable(X) X&0x10
-#define IS_HiQV(X) X&0x20
-
-#define DotClk 0
-#define MemClk 1
-#define IS_MemClk(X) X&0x1
-
int set_clock(
unsigned int ChipType,
unsigned int ClockType,
+ unsigned int ProgClock,
unsigned int M,
unsigned int N,
unsigned int P,
@@ -235,18 +242,18 @@ int set_clock(
outb(0x3D6, 0xCE);
outb(0x3D7, (0x80 | (P * 16 + (PSN == 1))));
} else {
- printf ("XRC8 = 0x%02X\n", M - 2);
- printf ("XRC9 = 0x%02X\n", N - 2);
- printf ("XRCA = 0x%02X\n", 0);
- printf ("XRCB = 0x%02X\n", P * 16 + (PSN == 1));
+ printf ("XR%X = 0x%02X\n", 0xC0 + 4 * ProgClock, M - 2);
+ printf ("XR%X = 0x%02X\n", 0xC1 + 4 * ProgClock, N - 2);
+ printf ("XR%X = 0x%02X\n", 0xC2 + 4 * ProgClock, 0);
+ printf ("XR%X = 0x%02X\n", 0xC3 + 4 * ProgClock, P * 16 + (PSN == 1));
- outb(0x3D6, 0xC8);
+ outb(0x3D6, 0xC0 + 4 * ProgClock);
outb(0x3D7, (M - 2));
- outb(0x3D6, 0xC9);
+ outb(0x3D6, 0xC1 + 4 * ProgClock);
outb(0x3D7, (N - 2));
- outb(0x3D6, 0xCA);
+ outb(0x3D6, 0xC2 + 4 * ProgClock);
outb(0x3D7, 0x0);
- outb(0x3D6, 0xCB);
+ outb(0x3D6, 0xC3 + 4 * ProgClock);
outb(0x3D7, (P * 16 + (PSN == 1)));
}
} else {
@@ -355,10 +362,19 @@ unsigned int probe_chip(void) {
int main (int argc, char *argv[]) {
double target;
double Fref = 14318180;
- unsigned int M, N, P, PSN, ChipType, ClockType;
-
- if (argc != 2) {
- fprintf (stderr, "usage: %s freq\n", argv[0]);
+ unsigned int M, N, P, PSN, ChipType, ClockType, progclock;
+
+ switch (argc) {
+ case 2:
+ progclock = 2;
+ target = atof (argv[1]);
+ break;
+ case 3:
+ progclock = abs(atof (argv[1]));
+ target = atof (argv[2]);
+ break;
+ default:
+ fprintf (stderr, "usage: %s [-0|-1|-2] freq\n", argv[0]);
return 1;
}
@@ -371,8 +387,6 @@ int main (int argc, char *argv[]) {
ClockType = MemClk;
}
- target = atof (argv[1]);
-
ChipType = probe_chip();
if (!ChipType) {
return 1;
@@ -384,14 +398,14 @@ int main (int argc, char *argv[]) {
}
if (IS_HiQV(ChipType)) {
- if (! compute_clock(target, Fref, 63, 127, 1, &M, &N, &P, &PSN)) {
- return set_clock(ChipType, ClockType, M, N, P, PSN);
+ if (! compute_clock(ChipType, target, Fref, 63, 127, &M, &N, &P, &PSN)) {
+ return set_clock(ChipType, ClockType, progclock, M, N, P, PSN);
} else {
return 1;
}
} else {
- if (! compute_clock(target, Fref, 127, 127, 0, &M, &N, &P, &PSN)) {
- return set_clock(ChipType, ClockType, M, N, P, PSN);
+ if (! compute_clock(ChipType, target, Fref, 127, 127, &M, &N, &P, &PSN)) {
+ return set_clock(ChipType, ClockType, progclock, M, N, P, PSN);
} else {
return 1;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h
index 4373eabba..474cfe158 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h,v 1.6 2001/02/15 17:39:28 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h,v 1.7 2001/05/04 19:05:35 dawes Exp $ */
/* (c) Itai Nahshon */
@@ -6,7 +6,7 @@
#define ALP_H
extern ScrnInfoPtr AlpProbe(int entity);
-extern OptionInfoPtr AlpAvailableOptions(int chipid);
+extern const OptionInfoRec * AlpAvailableOptions(int chipid);
# ifdef _ALP_PRIVATE_
/* Saved registers that are not part of the core VGA */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c
index 9d68f0767..3c678f6f9 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c
@@ -11,7 +11,7 @@
* Guy DESBIEF
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v 1.19 2001/02/15 17:39:27 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v 1.20 2001/05/04 19:05:35 dawes Exp $ */
/* All drivers should typically include these */
#include "xf86.h"
@@ -127,7 +127,7 @@ typedef enum {
OPTION_MEMCFG2
} CirOpts;
-static OptionInfoRec CirOptions[] = {
+static const OptionInfoRec CirOptions[] = {
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_MMIO, "MMIO", OPTV_BOOLEAN, {0}, FALSE },
@@ -270,7 +270,7 @@ alpSetup(pointer module, pointer opts, int *errmaj, int *errmin)
#endif /* XFree86LOADER */
-OptionInfoPtr
+const OptionInfoRec *
AlpAvailableOptions(int chipid)
{
return CirOptions;
@@ -631,11 +631,14 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, CirOptions);
+ if (!(pCir->Options = xalloc(sizeof(CirOptions))))
+ return FALSE;
+ memcpy(pCir->Options, CirOptions, sizeof(CirOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pCir->Options);
if (!xf86IsPrimaryPci(pCir->PciInfo)
- && !(pInt || (xf86IsOptionSet(CirOptions,OPTION_MEMCFG1)
- && xf86IsOptionSet(CirOptions,OPTION_MEMCFG2))))
+ && !(pInt || (xf86IsOptionSet(pCir->Options,OPTION_MEMCFG1)
+ && xf86IsOptionSet(pCir->Options,OPTION_MEMCFG2))))
return FALSE;
if (pScrn->depth == 8)
@@ -643,12 +646,12 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
from = X_DEFAULT;
pCir->HWCursor = FALSE;
- if (xf86GetOptValBool(CirOptions, OPTION_HW_CURSOR, &pCir->HWCursor))
+ if (xf86GetOptValBool(pCir->Options, OPTION_HW_CURSOR, &pCir->HWCursor))
from = X_CONFIG;
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pCir->HWCursor ? "HW" : "SW");
- if (xf86ReturnOptValBool(CirOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pCir->Options, OPTION_NOACCEL, FALSE)) {
pCir->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
@@ -721,12 +724,12 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
/* User options can override the MMIO default */
#if 0
/* Will we ever support MMIO on 5446A or older? */
- if (xf86ReturnOptValBool(CirOptions, OPTION_MMIO, FALSE)) {
+ if (xf86ReturnOptValBool(pCir->Options, OPTION_MMIO, FALSE)) {
pCir->UseMMIO = TRUE;
from = X_CONFIG;
}
#endif
- if (!xf86ReturnOptValBool(CirOptions, OPTION_MMIO, TRUE)) {
+ if (!xf86ReturnOptValBool(pCir->Options, OPTION_MMIO, TRUE)) {
pCir->UseMMIO = FALSE;
from1 = X_CONFIG;
} else if (pCir->IOAddress) {
@@ -806,12 +809,12 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
/* XXX If UseMMIO == TRUE and for any reason we cannot do MMIO,
abort here */
- if (xf86GetOptValBool(CirOptions,
+ if (xf86GetOptValBool(pCir->Options,
OPTION_SHADOW_FB,&pCir->shadowFB))
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n",
pCir->shadowFB ? "enabled" : "disabled");
- if ((s = xf86GetOptValString(CirOptions, OPTION_ROTATE))) {
+ if ((s = xf86GetOptValString(pCir->Options, OPTION_ROTATE))) {
if(!xf86NameCmp(s, "CW")) {
/* accel is disabled below for shadowFB */
pCir->shadowFB = TRUE;
@@ -856,8 +859,8 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
pCir->chip.alp->sr0f = (CARD32)-1;
pCir->chip.alp->sr17 = (CARD32)-1;
- (void) xf86GetOptValULong(CirOptions, OPTION_MEMCFG1, (unsigned long *)&pCir->chip.alp->sr0f);
- (void) xf86GetOptValULong(CirOptions, OPTION_MEMCFG2, (unsigned long *)&pCir->chip.alp->sr17);
+ (void) xf86GetOptValULong(pCir->Options, OPTION_MEMCFG1, (unsigned long *)&pCir->chip.alp->sr0f);
+ (void) xf86GetOptValULong(pCir->Options, OPTION_MEMCFG2, (unsigned long *)&pCir->chip.alp->sr17);
/*
* If the user has specified the amount of memory in the XF86Config
* file, we respect that setting.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c
index 626fe3023..a4f058161 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c,v 1.4 2000/12/06 15:35:15 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c,v 1.5 2001/05/07 21:59:06 tsi Exp $ */
/* (c) Itai Nahshon */
@@ -246,7 +246,6 @@ AlpHWCursorInit(ScreenPtr pScreen, int size)
infoPtr->HideCursor = AlpHideCursor;
infoPtr->ShowCursor = AlpShowCursor;
infoPtr->UseHWCursor = AlpUseHWCursor;
- infoPtr->RealizeCursor = NULL;
#ifdef ALP_DEBUG
ErrorF("AlpHWCursorInit before xf86InitCursor\n");
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h
index fcc77b37c..354101af1 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h,v 1.18 2001/02/15 17:39:28 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h,v 1.19 2001/05/04 19:05:35 dawes Exp $ */
/* (c) Itai Nahshon */
@@ -63,6 +63,7 @@ typedef struct {
void (* InitAccel)(ScrnInfoPtr);
int offscreen_size;
int offscreen_offset;
+ OptionInfoPtr Options;
} CirRec, *CirPtr;
/* CirrusClk.c */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c
index 2a3afaa3a..ada5c7f94 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c
@@ -11,7 +11,7 @@
* Guy DESBIEF
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c,v 1.65 2001/02/15 17:39:27 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c,v 1.67 2001/05/15 10:19:37 eich Exp $ */
/* All drivers should typically include these */
#include "xf86.h"
@@ -40,7 +40,7 @@
/* Mandatory functions */
-static OptionInfoPtr CIRAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * CIRAvailableOptions(int chipid, int busid);
static void CIRIdentify(int flags);
static Bool CIRProbe(DriverPtr drv, int flags);
@@ -184,8 +184,7 @@ CIRIdentify(int flags)
xf86PrintChipsets(CIR_NAME, "driver for Cirrus chipsets", CIRChipsets);
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
CIRAvailableOptions(int chipid, int busid)
{
int chip = chipid & 0xffff;
@@ -407,5 +406,6 @@ cirProbeDDC(ScrnInfoPtr pScrn, int index)
#endif
pVbe = VBEInit(NULL,index);
ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
}
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h
index c76cca590..9d9105328 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h
@@ -10,14 +10,14 @@
* Inspired by cir.h
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h,v 1.11 2000/12/06 15:35:16 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h,v 1.12 2001/05/04 19:05:36 dawes Exp $ */
#ifndef LG_H
#define LG_H
#define LG_DEBUG
extern ScrnInfoPtr LgProbe(int entity);
-extern OptionInfoPtr LgAvailableOptions(int chipid);
+extern const OptionInfoRec * LgAvailableOptions(int chipid);
# ifdef _LG_PRIVATE_
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c
index abf511e86..5d9de934c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c
@@ -13,7 +13,7 @@
* David Dawes, Andrew E. Mileski, Leonard N. Zubkoff,
* Guy DESBIEF, Itai Nahshon.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c,v 1.36 2001/02/15 17:39:28 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c,v 1.37 2001/05/04 19:05:36 dawes Exp $ */
#define EXPERIMENTAL
@@ -119,7 +119,7 @@ typedef enum {
OPTION_NOACCEL
} LgOpts;
-static OptionInfoRec LgOptions[] = {
+static const OptionInfoRec LgOptions[] = {
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
@@ -278,7 +278,7 @@ lgSetup(pointer module, pointer opts, int *errmaj, int *errmin)
#endif /* XFree86LOADER */
-OptionInfoPtr
+const OptionInfoRec *
LgAvailableOptions(int chipid)
{
return LgOptions;
@@ -527,17 +527,20 @@ LgPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, LgOptions);
+ if (!(pCir->Options = xalloc(sizeof(LgOptions))))
+ return FALSE;
+ memcpy(pCir->Options, LgOptions, sizeof(LgOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pCir->Options);
pScrn->rgbBits = 6;
from = X_DEFAULT;
pCir->HWCursor = FALSE;
- if (xf86GetOptValBool(LgOptions, OPTION_HW_CURSOR, &pCir->HWCursor))
+ if (xf86GetOptValBool(pCir->Options, OPTION_HW_CURSOR, &pCir->HWCursor))
from = X_CONFIG;
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pCir->HWCursor ? "HW" : "SW");
- if (xf86ReturnOptValBool(LgOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pCir->Options, OPTION_NOACCEL, FALSE)) {
pCir->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
@@ -681,12 +684,12 @@ LgPreInit(ScrnInfoPtr pScrn, int flags)
if (!xf86SetGamma(pScrn, zeros))
return FALSE;
}
- if (xf86GetOptValBool(LgOptions,
+ if (xf86GetOptValBool(pCir->Options,
OPTION_SHADOW_FB,&pCir->shadowFB))
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n",
pCir->shadowFB ? "enabled" : "disabled");
- if ((s = xf86GetOptValString(LgOptions, OPTION_ROTATE))) {
+ if ((s = xf86GetOptValString(pCir->Options, OPTION_ROTATE))) {
if(!xf86NameCmp(s, "CW")) {
/* accel is disabled below for shadowFB */
pCir->shadowFB = TRUE;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c
index 4644ce593..7e30bdb03 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c
@@ -10,7 +10,7 @@
* Much of this code is inspired by the HW cursor code from XFree86
* 3.3.3.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c,v 1.4 2000/12/06 15:35:17 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c,v 1.5 2001/05/07 21:59:06 tsi Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -375,10 +375,6 @@ Bool LgHWCursorInit(ScreenPtr pScreen)
infoPtr->HideCursor = LgHideCursor;
infoPtr->ShowCursor = LgShowCursor;
infoPtr->UseHWCursor = LgUseHWCursor;
- /* RealizeCursor is how the cursor bits are converted from an infoPtr
- to the bits to slam out to the card. Can we use one of the
- pre-defined realize'rs? Look in ramdac/xf86HWCurs.c. */
- infoPtr->RealizeCursor = NULL;
#ifdef LG_CURSOR_DEBUG
ErrorF("LgHWCursorInit before xf86InitCursor\n");
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h b/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h
index ff0ba00d8..3fa584906 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h
@@ -26,7 +26,7 @@
* Dirk H. Hohndel (hohndel@suse.de),
* Portions: the GGI project & confidential CYRIX databooks.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h,v 1.2 2000/04/19 16:57:43 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h,v 1.3 2001/05/04 19:05:36 dawes Exp $ */
#ifndef _CYRIX_H_
#define _CYRIX_H_
@@ -116,6 +116,7 @@ typedef struct {
Bool IsCyber;
Bool NewClockCode;
Bool NoAccel;
+ OptionInfoPtr Options;
/* accel stuff */
int bltBufWidth;
int blitMode;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c
index a5e8604dc..92bfd836b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c
@@ -26,7 +26,7 @@
* Dirk H. Hohndel (hohndel@suse.de),
* Portions: the GGI project & confidential CYRIX databooks.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c,v 1.18 2001/02/16 01:45:45 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c,v 1.19 2001/05/04 19:05:36 dawes Exp $ */
#include "fb.h"
#include "mibank.h"
@@ -52,7 +52,7 @@
#define DPMS_SERVER
#include "extensions/dpms.h"
-static OptionInfoPtr CYRIXAvailableOptions(int chip, int busid);
+static const OptionInfoRec * CYRIXAvailableOptions(int chip, int busid);
static void CYRIXIdentify(int flags);
static Bool CYRIXProbe(DriverPtr drv, int flags);
static Bool CYRIXPreInit(ScrnInfoPtr pScrn, int flags);
@@ -133,7 +133,7 @@ typedef enum {
OPTION_NOACCEL
} CYRIXOpts;
-static OptionInfoRec CYRIXOptions[] = {
+static const OptionInfoRec CYRIXOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
@@ -282,8 +282,7 @@ CYRIXIdentify(int flags)
xf86PrintChipsets(CYRIX_NAME, "driver for Cyrix MediaGX Processors", CYRIXChipsets);
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
CYRIXAvailableOptions(int chip, int busid)
{
return CYRIXOptions;
@@ -612,7 +611,10 @@ CYRIXPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, CYRIXOptions);
+ if (!(pCyrix->Options = xalloc(sizeof(CYRIXOptions))))
+ return FALSE;
+ memcpy(pCyrix->Options, CYRIXOptions, sizeof(CYRIXOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pCyrix->Options);
/* Set the bits per RGB for 8bpp mode */
if (pScrn->depth == 8) {
@@ -620,7 +622,7 @@ CYRIXPreInit(ScrnInfoPtr pScrn, int flags)
/* Default to 8 */
pScrn->rgbBits = 8;
#if 0
- if (xf86GetOptValInteger(CYRIXOptions, OPTION_RGB_BITS,
+ if (xf86GetOptValInteger(pCyrix->Options, OPTION_RGB_BITS,
&pScrn->rgbBits)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Bits per RGB set to %d\n",
pScrn->rgbBits);
@@ -629,17 +631,17 @@ CYRIXPreInit(ScrnInfoPtr pScrn, int flags)
}
from = X_DEFAULT;
pCyrix->HWCursor = TRUE;
- if (xf86IsOptionSet(CYRIXOptions, OPTION_HW_CURSOR)) {
+ if (xf86IsOptionSet(pCyrix->Options, OPTION_HW_CURSOR)) {
from = X_CONFIG;
pCyrix->HWCursor = TRUE;
}
- if (xf86IsOptionSet(CYRIXOptions, OPTION_SW_CURSOR)) {
+ if (xf86IsOptionSet(pCyrix->Options, OPTION_SW_CURSOR)) {
from = X_CONFIG;
pCyrix->HWCursor = FALSE;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pCyrix->HWCursor ? "HW" : "SW");
- if (xf86IsOptionSet(CYRIXOptions, OPTION_NOACCEL)) {
+ if (xf86IsOptionSet(pCyrix->Options, OPTION_NOACCEL)) {
pCyrix->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c b/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c
index 82b2d2fd3..2baaf0514 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c,v 1.29 2001/04/06 18:16:30 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c,v 1.30 2001/05/04 19:05:37 dawes Exp $ */
/*
* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
@@ -48,7 +48,7 @@
/* -------------------------------------------------------------------- */
/* prototypes */
-static OptionInfoPtr FBDevAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * FBDevAvailableOptions(int chipid, int busid);
static void FBDevIdentify(int flags);
static Bool FBDevProbe(DriverPtr drv, int flags);
static Bool FBDevPreInit(ScrnInfoPtr pScrn, int flags);
@@ -113,7 +113,7 @@ typedef enum {
OPTION_FBDEV
} FBDevOpts;
-static OptionInfoRec FBDevOptions[] = {
+static const OptionInfoRec FBDevOptions[] = {
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
#if 0
{ OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE },
@@ -222,6 +222,7 @@ typedef struct {
/* DGA info */
DGAModePtr pDGAMode;
int nDGAMode;
+ OptionInfoPtr Options;
} FBDevRec, *FBDevPtr;
#define FBDEVPTR(p) ((FBDevPtr)((p)->driverPrivate))
@@ -247,7 +248,7 @@ FBDevFreeRec(ScrnInfoPtr pScrn)
/* -------------------------------------------------------------------- */
-static OptionInfoPtr
+static const OptionInfoRec *
FBDevAvailableOptions(int chipid, int busid)
{
return FBDevOptions;
@@ -438,15 +439,18 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
/* handle options */
xf86CollectOptions(pScrn, NULL);
- xf86ProcessOptions(pScrn->scrnIndex, fPtr->pEnt->device->options, FBDevOptions);
+ if (!(fPtr->Options = xalloc(sizeof(FBDevOptions))))
+ return FALSE;
+ memcpy(fPtr->Options, FBDevOptions, sizeof(FBDevOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, fPtr->pEnt->device->options, fPtr->Options);
/* use shadow framebuffer by default */
- fPtr->shadowFB = xf86ReturnOptValBool(FBDevOptions, OPTION_SHADOW_FB, TRUE);
+ fPtr->shadowFB = xf86ReturnOptValBool(fPtr->Options, OPTION_SHADOW_FB, TRUE);
#if 0
/* rotation (doesn't work yet) */
fPtr->rotate = 0;
- if ((s = xf86GetOptValString(FBDevOptions, OPTION_ROTATE)))
+ if ((s = xf86GetOptValString(fPtr->Options, OPTION_ROTATE)))
{
if(!xf86NameCmp(s, "CW"))
{
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile
index 852dc5e5c..f01a0fa6c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile
@@ -1,7 +1,7 @@
XCOMM
XCOMM This is an Imakefile for the glide driver.
XCOMM
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile,v 1.6 2001/01/24 00:06:18 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile,v 1.7 2001/05/16 06:48:08 keithp Exp $
#define IHaveModules
#include <Server.tmpl>
@@ -22,8 +22,8 @@ OBJS = glide_driver.o
INCLUDES = -I. -I../../include
#else
INCLUDES = -I. -I$(GLIDE2INCDIR) -I$(XF86COMSRC) -I$(XF86OSSRC) \
- -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \
- -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa \
+ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \
+ -I$(XF86SRC)/xaa \
-I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \
-I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \
-I$(SERVERSRC)/Xext -I$(XF86SRC)/xf8_32bpp\
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c
index 242de1d7d..e87008d5b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c
@@ -45,7 +45,7 @@
* Support static loading.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c,v 1.22 2001/01/21 21:19:25 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c,v 1.24 2001/05/16 06:48:08 keithp Exp $ */
#include "xaa.h"
#include "xf86Cursor.h"
@@ -60,11 +60,7 @@
#include "globals.h"
#define DPMS_SERVER
#include "extensions/dpms.h"
-#define PSZ 8 /* needed for cfb.h */
-#include "cfb.h"
-#undef PSZ
-#include "cfb16.h"
-#include "cfb32.h"
+#include "fb.h"
#include "xf86cmap.h"
#include "shadowfb.h"
@@ -126,6 +122,7 @@ typedef struct {
Bool OnAtExit;
Bool GlideInitiated;
EntityInfoPtr pEnt;
+ OptionInfoPtr Options;
} GLIDERec, *GLIDEPtr;
static pgrSstQueryBoards_t pgrSstQueryBoards;
@@ -140,7 +137,7 @@ static pgrLfbUnlock_t pgrLfbUnlock;
static pgrGlideShutdown_t pgrGlideShutdown;
static pgrLfbWriteRegion_t pgrLfbWriteRegion;
-static OptionInfoPtr GLIDEAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * GLIDEAvailableOptions(int chipid, int busid);
static void GLIDEIdentify(int flags);
static Bool GLIDEProbe(DriverPtr drv, int flags);
static Bool GLIDEPreInit(ScrnInfoPtr pScrn, int flags);
@@ -192,7 +189,7 @@ typedef enum {
OPTION_GLIDEDEVICE
} GLIDEOpts;
-static OptionInfoRec GLIDEOptions[] = {
+static const OptionInfoRec GLIDEOptions[] = {
{ OPTION_ON_AT_EXIT, "OnAtExit", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_GLIDEDEVICE, "GlideDevice", OPTV_INTEGER, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
@@ -214,10 +211,11 @@ static SymTabRec GLIDEChipsets[] = {
* unresolved symbols that are not required.
*/
-static const char *cfbSymbols[] = {
- "cfbScreenInit",
- "cfb16ScreenInit",
- "cfb32ScreenInit",
+static const char *fbSymbols[] = {
+ "fbScreenInit",
+#ifdef RENDER
+ "fbPictureInit",
+#endif
NULL
};
@@ -307,7 +305,7 @@ glideSetup(pointer module, pointer opts, int *errmaj, int *errmin)
* Tell the loader about symbols from other modules that this module
* might refer to.
*/
- LoaderRefSymLists(cfbSymbols, shadowSymbols, NULL);
+ LoaderRefSymLists(fbSymbols, shadowSymbols, NULL);
/*
* The return value must be non-NULL on success even though there
@@ -352,8 +350,7 @@ GLIDEFreeRec(ScrnInfoPtr pScrn)
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
GLIDEAvailableOptions(int chipid, int busid)
{
return GLIDEOptions;
@@ -456,8 +453,6 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags)
MessageType from;
int i;
ClockRangePtr clockRanges;
- char *mod = NULL;
- const char *reqSym = NULL;
int sst;
if (flags & PROBE_DETECT) return FALSE;
@@ -544,11 +539,14 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, GLIDEOptions);
+ if (!(pGlide->Options = xalloc(sizeof(GLIDEOptions))))
+ return FALSE;
+ memcpy(pGlide->Options, GLIDEOptions, sizeof(GLIDEOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pGlide->Options);
pGlide->OnAtExit = FALSE;
from = X_DEFAULT;
- if (xf86GetOptValBool(GLIDEOptions, OPTION_ON_AT_EXIT, &(pGlide->OnAtExit)))
+ if (xf86GetOptValBool(pGlide->Options, OPTION_ON_AT_EXIT, &(pGlide->OnAtExit)))
from = X_CONFIG;
xf86DrvMsg(pScrn->scrnIndex, from,
@@ -636,24 +634,14 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags)
/* Set display resolution */
xf86SetDpi(pScrn, 0, 0);
-
- /* Load bpp-specific modules */
- switch (pScrn->bitsPerPixel) {
- case 16:
- mod = "cfb16";
- reqSym = "cfb16ScreenInit";
- break;
- case 32:
- mod = "cfb32";
- reqSym = "cfb32ScreenInit";
- break;
- }
- if (mod && xf86LoadSubModule(pScrn, mod) == NULL) {
+
+ /* Load fb */
+ if (xf86LoadSubModule(pScrn, "fb") == NULL) {
GLIDEFreeRec(pScrn);
return FALSE;
}
- xf86LoaderReqSymbols(reqSym, NULL);
+ xf86LoaderReqSymLists(fbSymbols, NULL);
/* Load the shadow framebuffer */
if (!xf86LoadSubModule(pScrn, "shadowfb")) {
@@ -694,7 +682,7 @@ GLIDEScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
* function. If not, the visuals will need to be setup before calling
* a fb ScreenInit() function and fixed up after.
*
- * For most PC hardware at depths >= 8, the defaults that cfb uses
+ * For most PC hardware at depths >= 8, the defaults that fb uses
* are not appropriate. In this driver, we fixup the visuals after.
*/
@@ -707,36 +695,29 @@ GLIDEScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
+ miSetPixmapDepths ();
+
pGlide->ShadowPitch = ((pScrn->virtualX * pScrn->bitsPerPixel >> 3) + 3) & ~3L;
pGlide->ShadowPtr = xnfalloc(pGlide->ShadowPitch * pScrn->virtualY);
+
/*
* Call the framebuffer layer's ScreenInit function, and fill in other
* pScreen fields.
*/
- switch (pScrn->bitsPerPixel) {
- case 16:
- ret = cfb16ScreenInit(pScreen, pGlide->ShadowPtr,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- case 32:
- ret = cfb32ScreenInit(pScreen, pGlide->ShadowPtr,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- default:
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Internal error: invalid bpp (%d) in GLIDEScreenInit\n",
- pScrn->bitsPerPixel);
- ret = FALSE;
- break;
- }
+ ret = fbScreenInit(pScreen, pGlide->ShadowPtr,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth,
+ pScrn->bitsPerPixel);
+
if (!ret)
return FALSE;
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
+
/* Fixup RGB ordering */
visual = pScreen->visuals + pScreen->numVisuals;
while (--visual >= pScreen->visuals) {
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile
index 9d0d04db1..a23fb7820 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile,v 1.32 2001/02/24 14:29:16 alanh Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile,v 1.34.2.1 2001/05/25 11:19:31 alanh Exp $
XCOMM
XCOMM This is an Imakefile for the GLINT driver.
XCOMM
@@ -39,7 +39,7 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \
-I$(SERVERSRC)/render
#endif
-DEFINES = $(GLX_DEFINES) -DPPC_MMIO_IS_BE
+DEFINES = $(GLX_DEFINES) -DPPC_MMIO_IS_BE -DSPARC_MMIO_IS_BE
#if MakeHasPosixVariableSubstitutions
SubdirLibraryRule($(OBJS))
@@ -76,6 +76,8 @@ InstallDriverSDKNonExecFile(pm2v_dac.c,$(DRIVERSDKDIR)/drivers/glint)
InstallDriverSDKNonExecFile(pm2vramdac.c,$(DRIVERSDKDIR)/drivers/glint)
InstallDriverSDKNonExecFile(pm3_dac.c,$(DRIVERSDKDIR)/drivers/glint)
InstallDriverSDKNonExecFile(pm3_accel.c,$(DRIVERSDKDIR)/drivers/glint)
+InstallDriverSDKNonExecFile(pm3_video.c,$(DRIVERSDKDIR)/drivers/glint)
+InstallDriverSDKNonExecFile(pm3_regs.h,$(DRIVERSDKDIR)/drivers/glint)
InstallDriverSDKNonExecFile(pm_accel.c,$(DRIVERSDKDIR)/drivers/glint)
InstallDriverSDKNonExecFile(pm_dac.c,$(DRIVERSDKDIR)/drivers/glint)
InstallDriverSDKNonExecFile(tx_accel.c,$(DRIVERSDKDIR)/drivers/glint)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3 b/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3
index c8950a4bc..c4db56f6b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3,v 1.9 2001/04/18 09:24:47 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3,v 1.11 2001/05/08 19:31:22 alanh Exp $ */
-STATUS as of Fri, 13 Apr 2001 21:43:39 +0200
+STATUS as of Tue, 8 May 2001 19:01:39 +0200
Working :
* Unaccelerated : Depth 8, 15, 16 and 24 are ok. I tested them upto
@@ -24,13 +24,25 @@ Working :
- Pixmap Writes using direct FIFO writes with or without FIFO Disconnect.
* Appian J2000 second head initialization.
* Dual head : The console fonts will get trashed, but dual head works.
- * Xv : Hardware video scaler with the following attributes :
- - FILTER : None, Partial (X only) or Full filtering.
- - OVERLAY_MODE : Opaque, Blended or Color keyed Video Overlay.
- - MIRROR : X and/or Y Axis mirroring.
+ * Xv : Hardware video scaler :
+ - Needs checking on a big endian machine.
+ - Needs acceleration to work.
+ - Clipping supported trough the alpha channel in depth 15 and 24
+ and with an overlay key color in depth 8 and 16.
+ - Support both dual head and single head, trough gamma or permedia3.
+ - Attributes are :
+ - FILTER : None, Partial (X only) or Full filtering.
+ - MIRROR : X and/or Y Axis mirroring.
+ - ALPHA :
+ - 0 -> FB Only
+ - 1 -> 25% Video, 75% FB
+ - 2 -> 75% Video, 25% FB
+ - 3 -> Video Only
+ - [TODO] VIDEOKEY : Overlay Key Color for clipping in depth 8 and 16.
* DRI : Work is underway.
Not Working :
+
* [NOT POSSIBLE] 2D Accel :
- Solid & Dashed Lines are not possible on glint hardware.
- 8x8 Color Pattern Fill is almost never used.
@@ -40,19 +52,20 @@ Not Working :
- CPUToScreenTexture.
- CPUToScreenAlphaTexture.
* [NEED FIX] Xv has still some minor problems :
- - Currently it needs accel to work.
- => we could enable the offscreen memory manager, but this will crash the
- server. I guess this is because of bad timing.
- - Crashes when used with the gamma chip.
- - Clipping is not supported.
- => we could use framebuffer alpha blending or alpha channel keyed video
- overlay to simulate it, but this would need to set the framebuffer alpha
- channel as a mask, and would be very inefficient. Maybe we could use a
- second framebuffer to do this, and use it as a mask ?
+ - depth 8 does not work, but then it may be the app i am using.
+ - when using 2D accels there is some unstability in the video display. I
+ guess this is because there is then not enough bandwith to do the
+ copying of the data in time. After a time of the above, the images
+ becomes black. It will come back once stopvideo is called.
+ [FIX] i will disable VideoOverlay each 25 frames, this causes a flicker,
+ but at least it will bing the image back.
* [WORK IS UNDERWAY] DRI/OpenGL (only together with a gamma chip) :
- DRI support should be ok, but accelerated openGL is not yet supported.
- The accelerated OpenGL library supposes we are using a gamma together
with a MX rasterizer, not a Permedia3 one.
+
+Known problems :
+
* Console gets broken when using dual headed mode. The culprit seems to be
the vga graphics index & port (GraphicsIndexReg : 0x63ce, GraphicsPort :
0x3cf). I had to use IO acces for both these two, because if not, console
@@ -67,6 +80,8 @@ Not Working :
Well, this is partly fixed, but still appears under very heavy load.
* [FIXED] When moving a window around a lot quickly, the video outputs dies.
Well, this is partly fixed, but still appears under very heavy load.
+ => [NOTE] If this two still happens, try disabling the Hardware cursor, with
+ the "SWCursor" option to your device XF86Config section.
* Sometimes there are blue transparent garbage in the form of small
horizontal bands, few pixels high, and more pixels width, maybe 64pixels ?
This may be a hardware bug.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h
index 2baed5658..3db30c12d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v 1.47 2001/04/18 09:24:47 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v 1.48.2.1 2001/05/24 20:12:47 alanh Exp $ */
/*
* Copyright 1997-2001 by Alan Hourihane <alanh@fairlite.demon.co.uk>
*
@@ -46,7 +46,6 @@
#endif
#define GLINT_MAX_MULTI_DEVICES 2
-#define GLINT_VGA_MMIO_OFF 0x6000
#define VERSION 4000
#define GLINT_NAME "GLINT"
@@ -83,29 +82,28 @@ typedef struct {
int HwBpp;
int BppShift;
int pprod;
- int ForeGroundColor;
- int BackGroundColor;
+ CARD32 ForeGroundColor;
+ CARD32 BackGroundColor;
int bppalign;
- int startxdom;
- int startxsub;
- int starty;
- int count;
- int dy;
- int x;
- int y;
- int w;
- int h;
- int dxdom;
+ CARD32 startxdom;
+ CARD32 startxsub;
+ CARD32 starty;
+ CARD32 count;
+ CARD32 dy;
+ CARD32 x;
+ CARD32 y;
+ CARD32 w;
+ CARD32 h;
+ CARD32 dxdom;
int dwords;
int cpuheight;
int cpucount;
- int planemask;
+ CARD32 planemask;
int realWidth;
CARD32 IOAddress;
unsigned long FbAddress;
int irq;
unsigned char * IOBase;
- unsigned char * IOBaseVGA;
unsigned char * FbBase;
long FbMapSize;
long IOOffset;
@@ -126,7 +124,6 @@ typedef struct {
Bool UseFlatPanel;
Bool UseFireGL3000;
CARD8 VGAdata[65536];
- Bool VGAcore;
Bool STATE;
Bool ScanlineDirect;
int MXFbSize;
@@ -160,10 +157,11 @@ typedef struct {
void (*LoadCursorCallback)(ScrnInfoPtr);
void (*CursorColorCallback)(ScrnInfoPtr);
CARD32 PM3_PixelSize;
- int PM3_Config2D;
- int PM3_Render2D;
- int PM3_AreaStippleMode;
- int PM3_VideoControl;
+ CARD32 PM3_Config2D;
+ CARD32 PM3_Render2D;
+ CARD32 PM3_AreaStippleMode;
+ CARD32 PM3_VideoControl;
+ int InFifoSpace;
#ifdef XF86DRI
Bool directRenderingEnabled;
DRIInfoPtr pDRIInfo;
@@ -174,6 +172,7 @@ typedef struct {
GLINTConfigPrivPtr pVisualConfigsPriv;
GLINTRegRec DRContextRegs;
#endif
+ OptionInfoPtr Options;
} GLINTRec, *GLINTPtr;
/* Defines for PCI data */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c
index c02847088..2e2759283 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c,v 1.26 2001/04/10 16:08:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c,v 1.27 2001/05/02 15:06:09 dawes Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -345,7 +345,7 @@ GLINTDRIScreenInit(ScreenPtr pScreen)
if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE;
if (!xf86LoaderCheckSymbol("DRIQueryVersion")) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "GLINTDRIScreenInit failed (libdri.a too old)\n");
+ "[dri] GLINTDRIScreenInit failed (libdri.a too old)\n");
return FALSE;
}
@@ -355,7 +355,9 @@ GLINTDRIScreenInit(ScreenPtr pScreen)
DRIQueryVersion(&major, &minor, &patch);
if (major != 4 || minor < 0) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "GLINTDRIScreenInit failed (DRI version = %d.%d.%d, expected 4.0.x). Disabling DRI.\n",
+ "[dri] GLINTDRIScreenInit failed because of a version mismatch.\n"
+ "[dri] libDRI version is %d.%d.%d but version 4.0.x is needed.\n"
+ "[dri] Disabling DRI.\n",
major, minor, patch);
return FALSE;
}
@@ -446,10 +448,12 @@ GLINTDRIScreenInit(ScreenPtr pScreen)
version->version_minor < 0) {
/* incompatible drm version */
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "GLINTDRIScreenInit failed (DRM version = %d.%d.%d, expected 1.0.x). Disabling DRI.\n",
- version->version_major,
- version->version_minor,
- version->version_patchlevel);
+ "[dri] GLINTDRIScreenInit failed because of a version mismatch.\n"
+ "[dri] gamma.o kernel module version is %d.%d.%d but version 1.0.x is needed.\n"
+ "[dri] Disabling DRI.\n",
+ version->version_major,
+ version->version_minor,
+ version->version_patchlevel);
GLINTDRICloseScreen(pScreen);
drmFreeVersion(version);
return FALSE;
@@ -622,7 +626,7 @@ GLINTDRIScreenInit(ScreenPtr pScreen)
DRICloseScreen(pScreen);
return FALSE;
}
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "visual configs initialized\n" );
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized.\n" );
return TRUE;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c
index fe03f47b1..76f0b0620 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c
@@ -28,7 +28,7 @@
* this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen,
* Siemens Nixdorf Informationssysteme and Appian Graphics.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c,v 1.122 2001/04/19 09:28:32 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c,v 1.125.2.4 2001/05/29 11:32:22 alanh Exp $ */
#include "fb.h"
#include "cfb8_32.h"
@@ -42,7 +42,6 @@
#include "xf86cmap.h"
#include "shadowfb.h"
#include "fbdevhw.h"
-#include "vgaHW.h"
#include "xf86RAC.h"
#include "xf86Resources.h"
#include "xf86int10.h"
@@ -79,7 +78,7 @@
# define TRACE(str)
#endif
-static OptionInfoPtr GLINTAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * GLINTAvailableOptions(int chipid, int busid);
static void GLINTIdentify(int flags);
static Bool GLINTProbe(DriverPtr drv, int flags);
static Bool GLINTPreInit(ScrnInfoPtr pScrn, int flags);
@@ -158,9 +157,7 @@ static SymTabRec GLINTChipsets[] = {
{ PCI_VENDOR_3DLABS_CHIP_300SX, "300sx" },
{ PCI_VENDOR_3DLABS_CHIP_500TX, "500tx" },
{ PCI_VENDOR_3DLABS_CHIP_MX, "mx" },
-/*
{ PCI_VENDOR_3DLABS_CHIP_DELTA, "delta" },
-*/
{ -1, NULL }
};
@@ -175,9 +172,7 @@ static PciChipsets GLINTPciChipsets[] = {
{ PCI_VENDOR_3DLABS_CHIP_300SX, PCI_VENDOR_3DLABS_CHIP_300SX, NULL },
{ PCI_VENDOR_3DLABS_CHIP_500TX, PCI_VENDOR_3DLABS_CHIP_500TX, NULL },
{ PCI_VENDOR_3DLABS_CHIP_MX, PCI_VENDOR_3DLABS_CHIP_MX, NULL },
-/*
{ PCI_VENDOR_3DLABS_CHIP_DELTA, PCI_VENDOR_3DLABS_CHIP_DELTA, NULL },
-*/
{ -1, -1, RES_UNDEFINED }
};
@@ -193,7 +188,7 @@ typedef enum {
OPTION_FLATPANEL
} GLINTOpts;
-static OptionInfoRec GLINTOptions[] = {
+static const OptionInfoRec GLINTOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_RGB_BITS, "RGBbits", OPTV_INTEGER, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
@@ -219,24 +214,6 @@ static RamDacSupportedInfoRec TIRamdacs[] = {
{ -1 }
};
-static const char *vgahwSymbols[] = {
- "vgaHWGetIndex",
- "vgaHWSave",
- "vgaHWRestore",
- "vgaHWGetHWRec",
- "vgaHWUnlock",
- "vgaHWInit",
- "vgaHWProtect",
- "vgaHWSetMmioFuncs",
- "vgaHWGetIOBase",
- "vgaHWMapMem",
- "vgaHWLock",
- "vgaHWFreeHWRec",
- "vgaHWSaveScreen",
- "vgaHWddc1SetSpeed",
- NULL
-};
-
static const char *xf8_32bppSymbols[] = {
"xf86Overlay8Plus32Init",
NULL
@@ -252,6 +229,7 @@ static const char *xaaSymbols[] = {
"XAAScreenIndex",
"XAAPolyLines",
"XAAPolySegment",
+ "XAAFillSolidRects",
NULL
};
@@ -289,6 +267,7 @@ static const char *shadowSymbols[] = {
static const char *vbeSymbols[] = {
"VBEInit",
"vbeDoEDID",
+ "vbeFree",
NULL
};
@@ -387,7 +366,7 @@ glintSetup(pointer module, pointer opts, int *errmaj, int *errmin)
if (!setupDone) {
setupDone = TRUE;
xf86AddDriver(&GLINT, module, 0);
- LoaderRefSymLists(vgahwSymbols, fbSymbols, ddcSymbols, i2cSymbols,
+ LoaderRefSymLists(fbSymbols, ddcSymbols, i2cSymbols,
xaaSymbols, xf8_32bppSymbols,
shadowSymbols, fbdevHWSymbols, int10Symbols,
vbeSymbols,
@@ -493,6 +472,12 @@ GLINTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
if((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_300SX)) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_500TX)) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_MX)) ||
((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
(pGlint->MultiChip == PCI_CHIP_MX)) ) {
vtgpolarity = GLINT_READ_REG(VTGPolarity) & 0xFFFFFFF0;
@@ -528,6 +513,12 @@ GLINTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
if((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_300SX)) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_500TX)) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_MX)) ||
((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
(pGlint->MultiChip == PCI_CHIP_MX)) ) {
GLINT_SLOW_WRITE_REG(vtgpolarity, VTGPolarity);
@@ -574,7 +565,7 @@ GLINTIdentify(int flags)
xf86PrintChipsets(GLINT_NAME, "driver for 3Dlabs chipsets", GLINTChipsets);
}
-static OptionInfoPtr
+static const OptionInfoRec *
GLINTAvailableOptions(int chipid, int busid)
{
return GLINTOptions;
@@ -590,6 +581,7 @@ GLINTProbeDDC(ScrnInfoPtr pScrn, int index)
{
pVbe = VBEInit(NULL,index);
vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
}
}
@@ -744,7 +736,8 @@ GLINTProbe(DriverPtr drv, int flags)
}
} else
/* Only claim other chips when GAMMA is used */
- if (pPci->chipType == PCI_CHIP_GAMMA) {
+ if ((pPci->chipType == PCI_CHIP_GAMMA) ||
+ (pPci->chipType == PCI_CHIP_DELTA)) {
while (*checkusedPci != NULL) {
int eIndex;
/* make sure we claim all but our source device */
@@ -852,13 +845,19 @@ GetAccelPitchValues(ScrnInfoPtr pScrn)
linep = &partprod500TX[0];
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- /* When GAMMA in use, we always have MultiChip defined, even if
- * only one chip is connected to GAMMA as the entites > 1
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
+ /* When GAMMA/DELTA in use, we always have MultiChip defined, even if
+ * only one chip is connected to GAMMA/DELTA as the entities > 1
*/
switch (pGlint->MultiChip) {
case PCI_CHIP_MX:
+ case PCI_CHIP_500TX:
+ case PCI_CHIP_300SX:
linep = &partprod500TX[0];
break;
+ case PCI_CHIP_PERMEDIA:
+ linep = &partprodPermedia[0];
+ break;
}
break;
}
@@ -990,6 +989,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
pGlint->PciInfo->func);
}
+ pGlint->InFifoSpace = 0; /* Force a Read of FIFO space on first run */
pGlint->numMultiDevices = 0;
pGlint->IOOffset = 0; /* Set IO Offset for Gamma */
@@ -1001,6 +1001,9 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
pEnt = xf86GetEntityInfo(pScrn->entityList[i]);
pPci = xf86GetPciInfoForEntity(pEnt->index);
if ( (pPci->chipType == PCI_CHIP_MX) ||
+ (pPci->chipType == PCI_CHIP_PERMEDIA) ||
+ (pPci->chipType == PCI_CHIP_500TX) ||
+ (pPci->chipType == PCI_CHIP_300SX) ||
(pPci->chipType == PCI_CHIP_PERMEDIA3) ) {
pGlint->MultiChip = pPci->chipType;
if (pGlint->numMultiDevices >= GLINT_MAX_MULTI_DEVICES) {
@@ -1020,10 +1023,11 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
pciVideoPtr pPci = xf86GetPciInfoForEntity(pEnt->index);
- if ( (pPci->chipType == PCI_CHIP_GAMMA) &&
+ if ( ((pPci->chipType == PCI_CHIP_GAMMA) ||
+ (pPci->chipType == PCI_CHIP_DELTA)) &&
(pGlint->numMultiDevices == 0) ) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Gamma with ZERO connected chips, aborting\n");
+ "Gamma/Delta with ZERO connected chips, aborting\n");
return FALSE;
}
}
@@ -1032,7 +1036,8 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
pciVideoPtr pPci = xf86GetPciInfoForEntity(pEnt->index);
- if (!(pPci->chipType == PCI_CHIP_GAMMA)) {
+ if ((pPci->chipType != PCI_CHIP_GAMMA) &&
+ (pPci->chipType != PCI_CHIP_DELTA)) {
GLINTProbeDDC(pScrn, pGlint->pEnt->index);
return TRUE;
} else
@@ -1135,33 +1140,36 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, GLINTOptions);
+ if (!(pGlint->Options = xalloc(sizeof(GLINTOptions))))
+ return FALSE;
+ memcpy(pGlint->Options, GLINTOptions, sizeof(GLINTOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pGlint->Options);
/* Default to 8bits per RGB */
if (pScrn->depth == 30) pScrn->rgbBits = 10;
else pScrn->rgbBits = 8;
- if (xf86GetOptValInteger(GLINTOptions, OPTION_RGB_BITS, &pScrn->rgbBits)) {
+ if (xf86GetOptValInteger(pGlint->Options, OPTION_RGB_BITS, &pScrn->rgbBits)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Bits per RGB set to %d\n",
pScrn->rgbBits);
}
from = X_DEFAULT;
pGlint->HWCursor = TRUE; /* ON by default */
- if (xf86ReturnOptValBool(GLINTOptions, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(pGlint->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pGlint->HWCursor = FALSE;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pGlint->HWCursor ? "HW" : "SW");
- if (xf86ReturnOptValBool(GLINTOptions, OPTION_FLATPANEL, FALSE)) {
+ if (xf86ReturnOptValBool(pGlint->Options, OPTION_FLATPANEL, FALSE)) {
pGlint->UseFlatPanel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using Flat Panel Interface\n");
}
- if (xf86ReturnOptValBool(GLINTOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pGlint->Options, OPTION_NOACCEL, FALSE)) {
pGlint->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
- if (xf86ReturnOptValBool(GLINTOptions, OPTION_SHADOW_FB, FALSE)) {
+ if (xf86ReturnOptValBool(pGlint->Options, OPTION_SHADOW_FB, FALSE)) {
pGlint->ShadowFB = TRUE;
pGlint->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
@@ -1169,7 +1177,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
}
/* Check whether to use the FBDev stuff and fill in the rest of pScrn */
- if (xf86ReturnOptValBool(GLINTOptions, OPTION_FBDEV, FALSE)) {
+ if (xf86ReturnOptValBool(pGlint->Options, OPTION_FBDEV, FALSE)) {
if (!FBDevProbed && !xf86LoadSubModule(pScrn, "fbdevhw"))
{
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "couldn't load fbdevHW module!\n");
@@ -1206,7 +1214,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->overlayFlags = 0;
from = X_DEFAULT;
- if ((s = xf86GetOptValString(GLINTOptions, OPTION_OVERLAY))) {
+ if ((s = xf86GetOptValString(pGlint->Options, OPTION_OVERLAY))) {
if (!*s || !xf86NameCmp(s, "8,24") || !xf86NameCmp(s, "24,8")) {
Overlay = TRUE;
} else {
@@ -1222,7 +1230,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
}
}
- pGlint->VGAcore = FALSE;
pGlint->DoubleBuffer = FALSE;
pGlint->RamDac = NULL;
pGlint->STATE = FALSE;
@@ -1283,19 +1290,17 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
if ((pGlint->Chipset == PCI_VENDOR_TI_CHIP_PERMEDIA2) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2)) {
- if (xf86ReturnOptValBool(GLINTOptions, OPTION_BLOCK_WRITE, FALSE)) {
+ if (xf86ReturnOptValBool(pGlint->Options, OPTION_BLOCK_WRITE, FALSE)) {
pGlint->UseBlockWrite = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Block Writes enabled\n");
}
}
- if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) {
- if (xf86ReturnOptValBool(GLINTOptions, OPTION_FIREGL3000, FALSE)) {
- /* Can't we detect a Fire GL 3000 ????? and remove this ? */
- pGlint->UseFireGL3000 = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ if (xf86ReturnOptValBool(pGlint->Options, OPTION_FIREGL3000, FALSE)) {
+ /* Can't we detect a Fire GL 3000 ????? and remove this ? */
+ pGlint->UseFireGL3000 = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Diamond FireGL3000 mode enabled\n");
- }
}
if (!FBDevProbed) {
@@ -1394,6 +1399,65 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
break;
}
break;
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
+ /* Delta has a bug, we need to fix it here */
+ {
+ int basecopro =
+ pGlint->MultiPciInfo[0]->memBase[0] & 0xFFFFC000;
+ int basedelta = pGlint->PciInfo->memBase[0] & 0xFFFFC000;
+ int glintdelta = pGlint->PciTag;
+ int glintcopro = pciTag(pGlint->MultiPciInfo[0]->bus,
+ pGlint->MultiPciInfo[0]->device,
+ pGlint->MultiPciInfo[0]->func);
+ int temp, base3copro, offset;
+
+ if( (basedelta & 0x20000) ^ (basecopro & 0x20000) ) {
+ if (pGlint->MultiChip == PCI_CHIP_PERMEDIA) {
+ offset = 0x20; /* base4 */
+ } else {
+ offset = 0x1c; /* base3 */
+ }
+ base3copro = pciReadLong(glintcopro, offset);
+ if( (basecopro & 0x20000) ^ (base3copro & 0x20000) ) {
+ /*
+ * oops, still different; we know that base3
+ * is at least 16 MB, so we just take 128k
+ * offset into it.
+ */
+ base3copro += 0x20000;
+ }
+ /*
+ * and now for the magic.
+ * read old value
+ * write fffffffff
+ * read value
+ * write new value
+ */
+ temp = pciReadLong(glintdelta, 0x10);
+ pciWriteLong(glintdelta, 0x10, 0xffffffff);
+ temp = pciReadLong(glintdelta, 0x10);
+ pciWriteLong(glintdelta, 0x10, base3copro);
+
+ /*
+ * additionally,sometimes we see the baserom which might
+ * confuse the chip, so let's make sure that is disabled
+ */
+ temp = pciReadLong(glintcopro, 0x30);
+ pciWriteLong(glintcopro, 0x30, 0xffffffff);
+ temp = pciReadLong(glintcopro, 0x30);
+ pciWriteLong(glintcopro, 0x30, 0);
+
+ /*
+ * now update our internal structure accordingly
+ */
+ pGlint->IOAddress =
+ pGlint->PciInfo->memBase[0] = base3copro;
+ xf86DrvMsg(pScrn->scrnIndex, from,
+ "Delta Bug - Changing MMIO registers to 0x%lX\n",
+ (unsigned long)pGlint->IOAddress);
+ }
+ }
+ break;
default:
break;
}
@@ -1429,8 +1493,27 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
pScrn->videoRam = Permedia3MemorySizeDetect(pScrn);
break;
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
switch (pGlint->MultiChip) {
+ case PCI_CHIP_PERMEDIA:
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Attached Rasterizer is GLINT Permedia\n");
+ pScrn->videoRam = (((GLINT_READ_REG(PMMemConfig)>>29) &
+ 0x03) + 1) * 2048;
+ break;
+ case PCI_CHIP_300SX:
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Attached Rasterizer is GLINT 300SX\n");
+ pScrn->videoRam = (1 << ((GLINT_READ_REG(FBMemoryCtl) &
+ 0xE0000000)>>29)) * 1024;
+ break;
+ case PCI_CHIP_500TX:
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Attached Rasterizer is GLINT 500TX\n");
+ pScrn->videoRam = (1 << ((GLINT_READ_REG(FBMemoryCtl) &
+ 0xE0000000)>>29)) * 1024;
+ break;
case PCI_CHIP_MX:
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"Attached Rasterizer is GLINT MX\n");
@@ -1515,7 +1598,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
maxheight = 2048;
maxwidth = 2048;
pGlint->RefClock = 14318;
- pGlint->VGAcore = TRUE; /* chip has a vga core */
pGlint->RamDacRec = RamDacCreateInfoRec();
pGlint->RamDacRec->ReadDAC = Permedia2InIndReg;
pGlint->RamDacRec->WriteDAC = Permedia2OutIndReg;
@@ -1533,7 +1615,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
maxheight = 2048;
maxwidth = 2048;
pGlint->RefClock = 14318;
- pGlint->VGAcore = TRUE; /* chip has a vga core */
pGlint->RamDacRec = RamDacCreateInfoRec();
pGlint->RamDacRec->ReadDAC = Permedia2vInIndReg;
pGlint->RamDacRec->WriteDAC = Permedia2vOutIndReg;
@@ -1551,7 +1632,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
maxheight = 4096;
maxwidth = 4096;
pGlint->RefClock = 14318;
- pGlint->VGAcore = TRUE;
pGlint->RamDacRec = RamDacCreateInfoRec();
pGlint->RamDacRec->ReadDAC = Permedia2vInIndReg;
pGlint->RamDacRec->WriteDAC = Permedia2vOutIndReg;
@@ -1566,9 +1646,9 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
break;
case PCI_VENDOR_TI_CHIP_PERMEDIA:
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA:
+ pGlint->FIFOSize = 31;
maxheight = 1024;
maxwidth = 1536;
- pGlint->VGAcore = TRUE; /* chip has a vga core */
GLINTProbeIBMramdac(pScrn);
if (pGlint->RamDac == NULL) return FALSE;
if (pGlint->RamDac->RamDacType != (IBM526DB_RAMDAC) &&
@@ -1579,7 +1659,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
case PCI_VENDOR_3DLABS_CHIP_500TX:
case PCI_VENDOR_3DLABS_CHIP_300SX:
case PCI_VENDOR_3DLABS_CHIP_MX:
- pGlint->FIFOSize = 16;
+ pGlint->FIFOSize = 15;
if (pScrn->bitsPerPixel == 24) {
xf86DrvMsg(pScrn->scrnIndex, from,
"-depth 24 -pixmap24 not supported by this chip.\n");
@@ -1610,6 +1690,50 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
if (!pGlint->RamDac)
return FALSE;
break;
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
+ pGlint->FIFOSize = 15;
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_PERMEDIA:
+ maxheight = 1024;
+ maxwidth = 1536;
+ GLINTProbeIBMramdac(pScrn);
+ if (pGlint->RamDac == NULL) return FALSE;
+ if (pGlint->RamDac->RamDacType != (IBM526DB_RAMDAC) &&
+ pGlint->RamDac->RamDacType != (IBM526_RAMDAC))
+ return FALSE;
+ pGlint->RefClock = 14318;
+ break;
+ case PCI_CHIP_500TX:
+ case PCI_CHIP_300SX:
+ case PCI_CHIP_MX:
+ if (pScrn->bitsPerPixel == 24) {
+ xf86DrvMsg(pScrn->scrnIndex, from,
+ "-depth 24 -pixmap24 not supported by this chip.\n");
+ return FALSE;
+ }
+ maxheight = 4096;
+ maxwidth = 4096;
+ /* Test for an TI ramdac */
+ if (!pGlint->RamDac) {
+ GLINTProbeTIramdac(pScrn);
+ if (pGlint->RamDac)
+ if ( (pGlint->RamDac->RamDacType == (TI3026_RAMDAC)) ||
+ (pGlint->RamDac->RamDacType == (TI3030_RAMDAC)) )
+ pGlint->RefClock = 14318;
+ }
+ /* Test for an IBM ramdac */
+ if (!pGlint->RamDac) {
+ GLINTProbeIBMramdac(pScrn);
+ if (pGlint->RamDac) {
+ if (pGlint->RamDac->RamDacType == (IBM640_RAMDAC) ||
+ pGlint->RamDac->RamDacType == (IBM526DB_RAMDAC) ||
+ pGlint->RamDac->RamDacType == (IBM526_RAMDAC))
+ pGlint->RefClock = 40000;
+ }
+ }
+ break;
+ }
+ break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
pGlint->FIFOSize = 32;
if (pScrn->bitsPerPixel == 24) {
@@ -1704,30 +1828,18 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "FIFO Size is %d DWORDS\n",
pGlint->FIFOSize);
- if (pGlint->FBDev || FBDevProbed)
- pGlint->VGAcore = FALSE;
-
- if (pGlint->VGAcore) {
- /* Initialize the card through int10 interface if needed */
+ /* Initialize the card through int10 interface if needed */
+ if (pGlint->Chipset != PCI_VENDOR_3DLABS_CHIP_GAMMA &&
+ pGlint->Chipset != PCI_VENDOR_3DLABS_CHIP_DELTA &&
+ !xf86IsPrimaryPci(pGlint->PciInfo)) {
if ( xf86LoadSubModule(pScrn, "int10")){
- xf86Int10InfoPtr pInt;
-
- xf86LoaderReqSymLists(int10Symbols, NULL);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n");
- pInt = xf86InitInt10(pGlint->pEnt->index);
- xf86FreeInt10(pInt);
- }
+ xf86Int10InfoPtr pInt;
- /* The vgahw module should be loaded here when needed */
- if (!xf86LoadSubModule(pScrn, "vgahw"))
- return FALSE;
-
- xf86LoaderReqSymLists(vgahwSymbols, NULL);
- /*
- * Allocate a vgaHWRec
- */
- if (!vgaHWGetHWRec(pScrn))
- return FALSE;
+ xf86LoaderReqSymLists(int10Symbols, NULL);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n");
+ pInt = xf86InitInt10(pGlint->pEnt->index);
+ xf86FreeInt10(pInt);
+ }
}
/* Set the min pixel clock */
@@ -1765,11 +1877,19 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
if((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX)||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_300SX)) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_500TX)) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_MX)) ||
((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
(pGlint->MultiChip == PCI_CHIP_MX)) )
pGlint->MaxClock = 220000;
if ( (pGlint->Chipset == PCI_VENDOR_TI_CHIP_PERMEDIA) ||
- (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA) ) {
+ (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_PERMEDIA)) ) {
switch (pScrn->bitsPerPixel) {
case 8:
pGlint->MaxClock = 200000;
@@ -1920,6 +2040,12 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) ||
(pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_300SX)) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_500TX)) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_MX)) ||
((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) &&
(pGlint->MultiChip == PCI_CHIP_MX)) ) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
@@ -1937,6 +2063,20 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
}
}
+ /* Check Virtual resolution */
+ if (pScrn->virtualX > maxwidth) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "GLINTModeInit: virtual width (%d) too big for hardware\n",
+ pScrn->virtualX);
+ return FALSE;
+ }
+ if (pScrn->virtualY > maxheight) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "GLINTModeInit: virtual height (%d) too big for hardware\n",
+ pScrn->virtualY);
+ return FALSE;
+ }
+
switch (pGlint->Chipset)
{ /* Now we know displaywidth, so set linepitch data */
case PCI_VENDOR_TI_CHIP_PERMEDIA2:
@@ -1954,11 +2094,18 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags)
pGlint->bppalign = 0;
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
switch (pGlint->MultiChip) {
case PCI_CHIP_MX:
+ case PCI_CHIP_500TX:
+ case PCI_CHIP_300SX:
pGlint->pprod = partprod500TX[pScrn->displayWidth >> 5];
pGlint->bppalign = 0;
break;
+ case PCI_CHIP_PERMEDIA:
+ pGlint->pprod = partprodPermedia[pScrn->displayWidth >> 5];
+ pGlint->bppalign = bppand[(pScrn->bitsPerPixel>>3)-1];
+ break;
}
break;
}
@@ -2166,12 +2313,6 @@ GLINTMapMem(ScrnInfoPtr pScrn)
pGlint->IOBase = fbdevHWMapMMIO(pScrn);
if (pGlint->IOBase == NULL)
return FALSE;
- /*
- * This does not work on Alphas ! They need VGA MMIO space
- * mapped in a special way as they cannot access it byte
- * or wordwise.
- */
- pGlint->IOBaseVGA = pGlint->IOBase + GLINT_VGA_MMIO_OFF;
TRACE_EXIT("GLINTMapMem");
return TRUE;
@@ -2183,8 +2324,6 @@ GLINTMapMem(ScrnInfoPtr pScrn)
*/
pGlint->IOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT,
pGlint->PciTag, pGlint->IOAddress, 0x20000);
- pGlint->IOBaseVGA = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
- pGlint->PciTag, pGlint->IOAddress + GLINT_VGA_MMIO_OFF, 0x2000);
if (pGlint->IOBase == NULL)
return FALSE;
@@ -2231,10 +2370,6 @@ GLINTUnmapMem(ScrnInfoPtr pScrn)
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pGlint->IOBase, 0x20000);
pGlint->IOBase = NULL;
- if (pGlint->IOBaseVGA != NULL)
- xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pGlint->IOBaseVGA, 0x2000);
- pGlint->IOBaseVGA = NULL;
-
if (pGlint->FbBase != NULL)
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pGlint->FbBase, pGlint->FbMapSize);
pGlint->FbBase = NULL;
@@ -2262,16 +2397,6 @@ GLINTSave(ScrnInfoPtr pScrn)
RAMDACreg = &pRAMDAC->SavedReg;
TRACE_ENTER("GLINTSave");
- if (pGlint->VGAcore) {
- vgaRegPtr vgaReg;
- vgaReg = &VGAHWPTR(pScrn)->SavedReg;
- if (xf86IsPrimaryPci(pGlint->PciInfo)) {
- vgaHWSave(pScrn, vgaReg, VGA_SR_MODE | VGA_SR_FONTS);
- } else {
- vgaHWSave(pScrn, vgaReg, VGA_SR_MODE);
- }
- }
-
switch (pGlint->Chipset)
{
case PCI_VENDOR_TI_CHIP_PERMEDIA2:
@@ -2296,7 +2421,10 @@ GLINTSave(ScrnInfoPtr pScrn)
(*pGlint->RamDac->Save)(pScrn, pGlint->RamDacRec, RAMDACreg);
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
switch (pGlint->MultiChip) {
+ case PCI_CHIP_500TX:
+ case PCI_CHIP_300SX:
case PCI_CHIP_MX:
if (pGlint->numMultiDevices == 2) {
ACCESSCHIP2()
@@ -2309,6 +2437,10 @@ GLINTSave(ScrnInfoPtr pScrn)
TXSave(pScrn, glintReg);
(*pGlint->RamDac->Save)(pScrn, pGlint->RamDacRec, RAMDACreg);
break;
+ case PCI_CHIP_PERMEDIA:
+ PermediaSave(pScrn, glintReg);
+ (*pGlint->RamDac->Save)(pScrn, pGlint->RamDacRec, RAMDACreg);
+ break;
case PCI_CHIP_PERMEDIA3:
if (pGlint->numMultiDevices == 2) {
ACCESSCHIP2();
@@ -2340,15 +2472,6 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
GLINTRegPtr glintReg = &pGlint->ModeReg[0];
GLINTRegPtr glintReg2 = &pGlint->ModeReg[1];
- if (pGlint->VGAcore) {
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- vgaHWUnlock(hwp);
-
- /* Initialise the ModeReg values */
- if (!vgaHWInit(pScrn, mode))
- return FALSE;
- }
-
pScrn->vtSema = TRUE;
switch (pGlint->Chipset) {
@@ -2372,8 +2495,11 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
ret = TXInit(pScrn, mode, glintReg);
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
switch (pGlint->MultiChip) {
case PCI_CHIP_MX:
+ case PCI_CHIP_500TX:
+ case PCI_CHIP_300SX:
if (pGlint->numMultiDevices == 2) {
ACCESSCHIP2();
ret = TXInit(pScrn, mode, glintReg2);
@@ -2381,6 +2507,9 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
}
ret = TXInit(pScrn, mode, glintReg);
break;
+ case PCI_CHIP_PERMEDIA:
+ ret = PermediaInit(pScrn, mode);
+ break;
case PCI_CHIP_PERMEDIA3:
if (pGlint->numMultiDevices == 2) {
ACCESSCHIP2();
@@ -2396,14 +2525,6 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
if (!ret)
return FALSE;
- /* Program the registers */
- if (pGlint->VGAcore) {
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- vgaRegPtr vgaReg = &hwp->ModeReg;
- vgaHWProtect(pScrn, TRUE);
- vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE);
- }
-
glintReg = &pGlint->ModeReg[0];
glintReg2 = &pGlint->ModeReg[1];
RAMDACreg = &pRAMDAC->ModeReg;
@@ -2433,7 +2554,10 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
(*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
switch (pGlint->MultiChip) {
+ case PCI_CHIP_500TX:
+ case PCI_CHIP_300SX:
case PCI_CHIP_MX:
if (pGlint->numMultiDevices == 2) {
ACCESSCHIP2();
@@ -2446,6 +2570,10 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
TXRestore(pScrn, glintReg);
(*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
break;
+ case PCI_CHIP_PERMEDIA:
+ PermediaRestore(pScrn, glintReg);
+ (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
+ break;
case PCI_CHIP_PERMEDIA3:
if (pGlint->numMultiDevices == 2) {
ACCESSCHIP2();
@@ -2458,10 +2586,6 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
break;
}
- if (pGlint->VGAcore) {
- vgaHWProtect(pScrn, FALSE);
- }
-
if (xf86IsPc98())
outb(0xfac, 0x01);
@@ -2487,9 +2611,6 @@ GLINTRestore(ScrnInfoPtr pScrn)
RAMDACreg = &pRAMDAC->SavedReg;
TRACE_ENTER("GLINTRestore");
- if (pGlint->VGAcore) {
- vgaHWProtect(pScrn, TRUE);
- }
switch (pGlint->Chipset) {
case PCI_VENDOR_TI_CHIP_PERMEDIA2:
@@ -2520,8 +2641,11 @@ GLINTRestore(ScrnInfoPtr pScrn)
(*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
switch (pGlint->MultiChip) {
case PCI_CHIP_MX:
+ case PCI_CHIP_500TX:
+ case PCI_CHIP_300SX:
if (pGlint->numMultiDevices == 2) {
ACCESSCHIP2();
TXRestore(pScrn, glintReg2);
@@ -2533,6 +2657,10 @@ GLINTRestore(ScrnInfoPtr pScrn)
TXRestore(pScrn, glintReg);
(*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
break;
+ case PCI_CHIP_PERMEDIA:
+ PermediaRestore(pScrn, glintReg);
+ (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg);
+ break;
case PCI_CHIP_PERMEDIA3:
#ifdef PM3Video
TRACE("PM3Video : VideoLeaveVT");
@@ -2549,17 +2677,6 @@ GLINTRestore(ScrnInfoPtr pScrn)
break;
}
- if (pGlint->VGAcore) {
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- vgaRegPtr vgaReg = &hwp->SavedReg;
- if (xf86IsPrimaryPci(pGlint->PciInfo)) {
- vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE | VGA_SR_FONTS);
- } else {
- vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE);
- }
- vgaHWProtect(pScrn, FALSE);
- }
-
TRACE_EXIT("GLINTRestore");
}
@@ -2582,20 +2699,6 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!GLINTMapMem(pScrn))
return FALSE;
- /* Initialize the MMIO vgahw functions */
- if (pGlint->VGAcore) {
- vgaHWPtr hwp;
- hwp = VGAHWPTR(pScrn);
- if (xf86IsPrimaryPci(pGlint->PciInfo)) {
- hwp->MapSize = 0x10000; /* Standard 64k VGA window */
- if (!vgaHWMapMem(pScrn))
- return FALSE;
- }
-
- vgaHWSetMmioFuncs(hwp, pGlint->IOBaseVGA, 0);
- vgaHWGetIOBase(hwp);
- }
-
if (pGlint->FBDev) {
fbdevHWSave(pScrn);
if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) {
@@ -2742,8 +2845,10 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pGlint->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = GLINTBlockHandler;
+#if !defined(__sparc__)
if (!pGlint->ShadowFB)
GLINTDGAInit(pScreen);
+#endif
if (pScrn->bitsPerPixel > 8) {
/* Fixup RGB ordering */
@@ -2780,10 +2885,18 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
TXAccelInit(pScreen);
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
switch (pGlint->MultiChip) {
+ case PCI_CHIP_500TX:
case PCI_CHIP_MX:
TXAccelInit(pScreen);
break;
+ case PCI_CHIP_300SX:
+ SXAccelInit(pScreen);
+ break;
+ case PCI_CHIP_PERMEDIA:
+ PermediaAccelInit(pScreen);
+ break;
case PCI_CHIP_PERMEDIA3:
Permedia3AccelInit(pScreen);
break;
@@ -2968,10 +3081,18 @@ GLINTSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
SXInitializeEngine(pScrn);
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
switch (pGlint->MultiChip) {
+ case PCI_CHIP_500TX:
case PCI_CHIP_MX:
TXInitializeEngine(pScrn);
break;
+ case PCI_CHIP_300SX:
+ SXInitializeEngine(pScrn);
+ break;
+ case PCI_CHIP_PERMEDIA:
+ PermediaInitializeEngine(pScrn);
+ break;
case PCI_CHIP_PERMEDIA3:
Permedia3InitializeEngine(pScrn);
break;
@@ -3028,9 +3149,15 @@ GLINTAdjustFrame(int scrnIndex, int x, int y, int flags)
GLINT_SLOW_WRITE_REG(base, PMScreenBase);
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- if (pGlint->MultiChip == PCI_CHIP_PERMEDIA3) {
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_PERMEDIA3:
base = (y * pScrn->displayWidth + x) >> pGlint->BppShift;
GLINT_SLOW_WRITE_REG(base, PMScreenBase);
+ break;
+ case PCI_CHIP_PERMEDIA:
+ GLINT_SLOW_WRITE_REG(base, PMScreenBase);
+ break;
}
break;
}
@@ -3103,10 +3230,18 @@ GLINTEnterVT(int scrnIndex, int flags)
SXInitializeEngine(pScrn);
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
switch (pGlint->MultiChip) {
+ case PCI_CHIP_500TX:
case PCI_CHIP_MX:
TXInitializeEngine(pScrn);
break;
+ case PCI_CHIP_300SX:
+ SXInitializeEngine(pScrn);
+ break;
+ case PCI_CHIP_PERMEDIA:
+ PermediaInitializeEngine(pScrn);
+ break;
case PCI_CHIP_PERMEDIA3:
Permedia3InitializeEngine(pScrn);
break;
@@ -3137,8 +3272,6 @@ GLINTLeaveVT(int scrnIndex, int flags)
TRACE_ENTER("GLINTLeaveVT");
pGlint->STATE = TRUE;
GLINTRestore(pScrn);
- if (pGlint->VGAcore)
- vgaHWLock(VGAHWPTR(pScrn));
if (xf86IsPc98())
outb(0xfac, 0x00);
@@ -3193,8 +3326,6 @@ GLINTCloseScreen(int scrnIndex, ScreenPtr pScreen)
else {
pGlint->STATE = TRUE;
GLINTRestore(pScrn);
- if (pGlint->VGAcore)
- vgaHWLock(VGAHWPTR(pScrn));
}
GLINTUnmapMem(pScrn);
}
@@ -3234,8 +3365,6 @@ GLINTFreeScreen(int scrnIndex, int flags)
TRACE_ENTER("GLINTFreeScreen");
if (xf86LoaderCheckSymbol("fbdevHWFreeRec"))
fbdevHWFreeRec(xf86Screens[scrnIndex]);
- if (xf86LoaderCheckSymbol("vgaHWFreeHWRec"))
- vgaHWFreeHWRec(xf86Screens[scrnIndex]);
if (xf86LoaderCheckSymbol("RamDacFreeRec"))
RamDacFreeRec(xf86Screens[scrnIndex]);
GLINTFreeRec(xf86Screens[scrnIndex]);
@@ -3333,11 +3462,15 @@ GLINTSaveScreen(ScreenPtr pScreen, int mode)
case PCI_VENDOR_3DLABS_CHIP_MX:
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- if (pGlint->MultiChip == PCI_CHIP_PERMEDIA3) {
- temp = GLINT_READ_REG(PMVideoControl);
- if (unblank) temp |= 1;
- else temp &= 0xFFFFFFFE;
- GLINT_SLOW_WRITE_REG(temp, PMVideoControl);
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
+ switch (pGlint->MultiChip) {
+ case PCI_CHIP_PERMEDIA3:
+ case PCI_CHIP_PERMEDIA:
+ temp = GLINT_READ_REG(PMVideoControl);
+ if (unblank) temp |= 1;
+ else temp &= 0xFFFFFFFE;
+ GLINT_SLOW_WRITE_REG(temp, PMVideoControl);
+ break;
}
break;
}
@@ -3433,22 +3566,74 @@ void GLINT_MoveDWORDS(
#ifdef __alpha__
write_mem_barrier();
#endif
- while(dwords & ~0x03) {
- *dest = *src;
- *(dest + 1) = *(src + 1);
- *(dest + 2) = *(src + 2);
- *(dest + 3) = *(src + 3);
- src += 4;
- dest += 4;
- dwords -= 4;
- }
-
- while(dwords) {
- *dest = *src;
- src++;
- dest++;
- dwords--;
- }
+ if ((unsigned long)src & 0x3UL) {
+ unsigned char *pchar;
+ while (dwords & ~0x03) {
+ pchar = (unsigned char *)(src + 0);
+ *(dest + 0) = (((CARD32)pchar[0] << 24) |
+ ((CARD32)pchar[1] << 16) |
+ ((CARD32)pchar[2] << 8) |
+ ((CARD32)pchar[3] << 0));
+ pchar = (unsigned char *)(src + 1);
+ *(dest + 1) = (((CARD32)pchar[0] << 24) |
+ ((CARD32)pchar[1] << 16) |
+ ((CARD32)pchar[2] << 8) |
+ ((CARD32)pchar[3] << 0));
+ pchar = (unsigned char *)(src + 2);
+ *(dest + 2) = (((CARD32)pchar[0] << 24) |
+ ((CARD32)pchar[1] << 16) |
+ ((CARD32)pchar[2] << 8) |
+ ((CARD32)pchar[3] << 0));
+ pchar = (unsigned char *)(src + 3);
+ *(dest + 3) = (((CARD32)pchar[0] << 24) |
+ ((CARD32)pchar[1] << 16) |
+ ((CARD32)pchar[2] << 8) |
+ ((CARD32)pchar[3] << 0));
+ src += 4;
+ dest += 4;
+ dwords -= 4;
+ }
+ if (!dwords)
+ return;
+ pchar = (unsigned char *)(src + 0);
+ *(dest + 0) = (((CARD32)pchar[0] << 24) |
+ ((CARD32)pchar[1] << 16) |
+ ((CARD32)pchar[2] << 8) |
+ ((CARD32)pchar[3] << 0));
+ if (dwords == 1)
+ return;
+ pchar = (unsigned char *)(src + 1);
+ *(dest + 1) = (((CARD32)pchar[0] << 24) |
+ ((CARD32)pchar[1] << 16) |
+ ((CARD32)pchar[2] << 8) |
+ ((CARD32)pchar[3] << 0));
+ if (dwords == 2)
+ return;
+ pchar = (unsigned char *)(src + 2);
+ *(dest + 2) = (((CARD32)pchar[0] << 24) |
+ ((CARD32)pchar[1] << 16) |
+ ((CARD32)pchar[2] << 8) |
+ ((CARD32)pchar[3] << 0));
+ } else {
+ while (dwords & ~0x03) {
+ *dest = *src;
+ *(dest + 1) = *(src + 1);
+ *(dest + 2) = *(src + 2);
+ *(dest + 3) = *(src + 3);
+ src += 4;
+ dest += 4;
+ dwords -= 4;
+ }
+ if (!dwords)
+ return;
+ *dest = *src;
+ if (dwords == 1)
+ return;
+ *(dest + 1) = *(src + 1);
+ if (dwords == 2)
+ return;
+ *(dest + 2) = *(src + 2);
+ }
}
int
@@ -3478,7 +3663,10 @@ Shiftbpp(ScrnInfoPtr pScrn, int value)
logbytesperaccess = 3;
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
+ case PCI_VENDOR_3DLABS_CHIP_DELTA:
switch (pGlint->MultiChip) {
+ case PCI_CHIP_500TX:
+ case PCI_CHIP_300SX:
case PCI_CHIP_MX:
if ( (pGlint->RamDac->RamDacType == (IBM640_RAMDAC)) ||
(pGlint->RamDac->RamDacType == (TI3030_RAMDAC)) )
@@ -3486,6 +3674,9 @@ Shiftbpp(ScrnInfoPtr pScrn, int value)
else
logbytesperaccess = 3;
break;
+ case PCI_CHIP_PERMEDIA:
+ logbytesperaccess = 2;
+ break;
case PCI_CHIP_PERMEDIA3:
logbytesperaccess = 4;
break;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h
index a684b81b6..4690035ea 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h,v 1.26 2001/04/19 09:28:32 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h,v 1.26.2.1 2001/05/24 20:12:47 alanh Exp $ */
/*
* glint register file
@@ -1202,7 +1202,16 @@
#define GLINT_WAIT(n) \
do{ \
- while(GLINT_READ_REG(InFIFOSpace)<(n)); \
+ if (pGlint->InFifoSpace>=(n)) \
+ pGlint->InFifoSpace -= (n); \
+ else { \
+ int tmp; \
+ while((tmp=GLINT_READ_REG(InFIFOSpace))<(n)); \
+ /* Clamp value due to bugs in PM3 */ \
+ if (tmp > pGlint->FIFOSize) \
+ tmp = pGlint->FIFOSize; \
+ pGlint->InFifoSpace = tmp - (n); \
+ } \
}while(0)
#define GLINTDACDelay(x) do { \
@@ -1217,7 +1226,7 @@ do{ \
#define GLINT_SLOW_WRITE_REG(v,r) \
do{ \
mem_barrier(); \
- GLINT_WAIT(1); \
+ GLINT_WAIT(pGlint->FIFOSize); \
mem_barrier(); \
GLINT_WRITE_REG(v,r); \
}while(0)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c
index 532c56178..67c7c2b18 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c
@@ -30,7 +30,7 @@
*
* Permedia 2 accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c,v 1.29 2001/02/27 23:04:59 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c,v 1.29.2.1 2001/05/30 11:42:22 alanh Exp $ */
#include "Xarch.h"
#include "xf86.h"
@@ -336,12 +336,14 @@ Permedia2AccelInit(ScreenPtr pScreen)
infoPtr->WriteBitmap = Permedia2WriteBitmap;
- if (pScrn->bitsPerPixel == 8)
+ if (pScrn->bitsPerPixel == 8) {
infoPtr->WritePixmap = Permedia2WritePixmap8bpp;
- else
- if (pScrn->bitsPerPixel == 16)
+ infoPtr->WritePixmapFlags = NO_GXCOPY;
+ } else
+ if (pScrn->bitsPerPixel == 16) {
infoPtr->WritePixmap = Permedia2WritePixmap16bpp;
- else
+ infoPtr->WritePixmapFlags = NO_GXCOPY;
+ } else
if (pScrn->bitsPerPixel == 32)
infoPtr->WritePixmap = Permedia2WritePixmap32bpp;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c
index 4baeabf84..0f51dab4a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c
@@ -28,7 +28,7 @@
* this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and
* Siemens Nixdorf Informationssysteme
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c,v 1.22 2001/02/07 13:26:20 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c,v 1.23.2.1 2001/05/24 20:12:48 alanh Exp $ */
#include "Xarch.h"
#include "xf86.h"
@@ -211,6 +211,11 @@ Permedia2Save(ScrnInfoPtr pScrn, GLINTRegPtr glintReg)
GLINTPtr pGlint = GLINTPTR(pScrn);
int i;
+ /* We can't rely on the vgahw layer copying the font information
+ * back properly, due to problems with MMIO access to VGA space
+ * so we memcpy the information using the slow routines */
+ xf86SlowBcopy((CARD8*)pGlint->FbBase, (CARD8*)pGlint->VGAdata, 65536);
+
glintReg->glintRegs[Aperture0 >> 3] = GLINT_READ_REG(Aperture0);
glintReg->glintRegs[Aperture1 >> 3] = GLINT_READ_REG(Aperture1);
glintReg->glintRegs[PMFramebufferWriteMask >> 3] =
@@ -266,6 +271,12 @@ Permedia2Restore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg)
GLINTPtr pGlint = GLINTPTR(pScrn);
int i;
+ /* We can't rely on the vgahw layer copying the font information
+ * back properly, due to problems with MMIO access to VGA space
+ * so we memcpy the information using the slow routines */
+ if (pGlint->STATE)
+ xf86SlowBcopy((CARD8*)pGlint->VGAdata, (CARD8*)pGlint->FbBase, 65536);
+
#if 0
GLINT_SLOW_WRITE_REG(0, ResetStatus);
while(GLINT_READ_REG(ResetStatus) != 0) {
@@ -273,6 +284,8 @@ Permedia2Restore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg)
};
#endif
+ GLINT_SLOW_WRITE_REG(0xFF, PM2DACReadMask);
+
GLINT_SLOW_WRITE_REG(glintReg->glintRegs[Aperture0 >> 3], Aperture0);
GLINT_SLOW_WRITE_REG(glintReg->glintRegs[Aperture1 >> 3], Aperture1);
GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMFramebufferWriteMask >> 3],
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c
index 70a269c7e..50f8650f6 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c
@@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c,v 1.18 2001/01/31 16:14:59 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c,v 1.19 2001/05/04 19:05:38 dawes Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -211,6 +211,7 @@ typedef enum {
OPTION_EXPOSE /* obsolete, ignored */
} OptToken;
+/* XXX These should be made const, and per-screen/adaptor copies processed. */
static OptionInfoRec AdaptorOptions[] = {
{ OPTION_DEVICE, "Device", OPTV_STRING, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c
index 91b0b9419..03f5a2f2a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c
@@ -27,7 +27,7 @@
* this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and
* Siemens Nixdorf Informationssysteme
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c,v 1.25 2001/02/27 18:47:25 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c,v 1.26 2001/05/16 07:56:07 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -113,8 +113,34 @@ Permedia2VInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
GLINTRegPtr pReg = &pGlint->ModeReg[0];
CARD32 temp1, temp2, temp3, temp4;
- pReg->glintRegs[Aperture0 >> 3] = 0;
- pReg->glintRegs[Aperture1 >> 3] = 0;
+ temp1 = 0;
+ temp2 = 0;
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ switch (pGlint->HwBpp) {
+ case 8:
+ case 24:
+ temp1 = 0x00;
+ temp2 = 0x00;
+ break;
+
+ case 15:
+ case 16:
+ temp1 = 0x02;
+ temp2 = 0x02;
+ break;
+
+ case 32:
+ temp1 = 0x01;
+ temp2 = 0x01;
+ break;
+ default:
+ break;
+ };
+#endif /* BIG_ENDIAN */
+
+ pReg->glintRegs[Aperture0 >> 3] = temp1;
+ pReg->glintRegs[Aperture1 >> 3] = temp2;
+
pReg->glintRegs[PMFramebufferWriteMask >> 3] = 0xFFFFFFFF;
pReg->glintRegs[PMBypassWriteMask >> 3] = 0xFFFFFFFF;
@@ -163,7 +189,7 @@ Permedia2VInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
pReg->glintRegs[PMVTotal >> 3] -= 1; /* PMVTotal */
pReg->glintRegs[ChipConfig >> 3] = GLINT_READ_REG(ChipConfig) & 0xFFFFFFDD;
- pReg->DacRegs[PM2VDACRDDACControl] = 0x80;
+ pReg->DacRegs[PM2VDACRDDACControl] = 0x00;
{
/* Get the programmable clock values */
@@ -197,6 +223,7 @@ Permedia2VInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
pReg->DacRegs[PM2VDACRDColorFormat] = 0x2E;
break;
case 16:
+ pReg->DacRegs[PM2VDACRDMiscControl] |= 0x08;
pReg->DacRegs[PM2VDACRDPixelSize] = 0x01;
if (pScrn->depth == 15)
pReg->DacRegs[PM2VDACRDColorFormat] = 0x61;
@@ -204,10 +231,12 @@ Permedia2VInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
pReg->DacRegs[PM2VDACRDColorFormat] = 0x70;
break;
case 24:
+ pReg->DacRegs[PM2VDACRDMiscControl] |= 0x08;
pReg->DacRegs[PM2VDACRDPixelSize] = 0x04;
pReg->DacRegs[PM2VDACRDColorFormat] = 0x60;
break;
case 32:
+ pReg->DacRegs[PM2VDACRDMiscControl] |= 0x08;
pReg->DacRegs[PM2VDACRDPixelSize] = 0x02;
pReg->DacRegs[PM2VDACRDColorFormat] = 0x20;
if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c
index 29b0a7715..9e330e190 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c
@@ -26,7 +26,7 @@
* this work is sponsored by Appian Graphics.
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c,v 1.22 2001/03/20 19:08:58 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c,v 1.24 2001/05/16 07:56:07 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -331,6 +331,7 @@ Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg)
STOREDAC(PM2VDACRDColorFormat, 0x2E);
break;
case 16:
+ temp3 |= PM3RD_MiscControl_DIRECTCOLOR_ENABLE;
STOREDAC(PM2VDACRDPixelSize, 0x01);
if (pScrn->depth == 15) {
STOREDAC(PM2VDACRDColorFormat, 0x61);
@@ -339,10 +340,12 @@ Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg)
}
break;
case 24:
+ temp3 |= PM3RD_MiscControl_DIRECTCOLOR_ENABLE;
STOREDAC(PM2VDACRDPixelSize, 0x04);
STOREDAC(PM2VDACRDColorFormat, 0x60);
break;
case 32:
+ temp3 |= PM3RD_MiscControl_DIRECTCOLOR_ENABLE;
if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
temp3 |= 0x18;
STOREDAC(PM2VDACRDOverlayKey, pScrn->colorKey);
@@ -366,8 +369,8 @@ Permedia3Save(ScrnInfoPtr pScrn, GLINTRegPtr pReg)
/* We can't rely on the vgahw layer copying the font information
* back properly, due to problems with MMIO access to VGA space
- * so we memcpy the information */
- memcpy((CARD8*)pGlint->VGAdata,(CARD8*)pGlint->FbBase, 65536);
+ * so we memcpy the information using the slow routines */
+ xf86SlowBcopy((CARD8*)pGlint->FbBase, (CARD8*)pGlint->VGAdata, 65536);
if ((pGlint->numMultiDevices == 2) || (IS_J2000)) {
SAVEREG(GCSRAperture);
@@ -435,9 +438,9 @@ Permedia3Restore(ScrnInfoPtr pScrn, GLINTRegPtr pReg)
/* We can't rely on the vgahw layer copying the font information
* back properly, due to problems with MMIO access to VGA space
- * so we memcpy the information */
+ * so we memcpy the information using the slow routines */
if (pGlint->STATE)
- memcpy((CARD8*)pGlint->FbBase,(CARD8*)pGlint->VGAdata, 65536);
+ xf86SlowBcopy((CARD8*)pGlint->VGAdata, (CARD8*)pGlint->FbBase, 65536);
if ((pGlint->numMultiDevices == 2) || (IS_J2000)) {
RESTOREREG(GCSRAperture);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h
index a09ca3508..d707bee94 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h,v 1.6 2001/04/18 09:24:48 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h,v 1.7 2001/05/08 19:31:22 alanh Exp $ */
/*
* glint register file
@@ -400,8 +400,8 @@
#define PM3RD_VideoOverlayBlend 0x02c
#define PM3RD_VideoOverlayBlend_FACTOR_0_PERCENT (0<<6)
#define PM3RD_VideoOverlayBlend_FACTOR_25_PERCENT (1<<6)
- #define PM3RD_VideoOverlayBlend_FACTOR_59_PERCENT (2<<6)
- #define PM3RD_VideoOverlayBlend_FACTOR_75_PERCENT (3<<6)
+ #define PM3RD_VideoOverlayBlend_FACTOR_75_PERCENT (2<<6)
+ #define PM3RD_VideoOverlayBlend_FACTOR_100_PERCENT (3<<6)
#define PM3RD_DClkSetup1 0x1f0
#define PM3RD_DClkSetup2 0x1f1
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c
index 78c0fcad6..589eb8d5c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c
@@ -23,7 +23,7 @@
* Based on work of Michael H. Schimek <m.schimek@netway.at>
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c,v 1.3 2001/04/18 09:24:49 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c,v 1.6 2001/05/08 19:31:22 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -34,12 +34,18 @@
#include "xf86fbman.h"
#include "xf86xv.h"
#include "Xv.h"
+#include "regionstr.h"
+#include "xaa.h"
+#include "xaalocal.h"
#include "glint_regs.h"
#include "pm3_regs.h"
#include "glint.h"
#define DEBUG(x)
+#define USE_HARDWARE_COPY 1
+#define SUPPORT_CLIPPING 1
+#define BLACKNESS_WORKAROUND 1
#ifndef XvExtension
@@ -60,8 +66,6 @@ void Permedia3VideoLeaveVT(ScrnInfoPtr pScrn) {}
#define CLAMP(v, min, max) (((v) < (min)) ? (min) : MIN(v, max))
#define ENTRIES(array) (sizeof(array) / sizeof((array)[0]))
-#define MAX_BUFFERS 3
-
enum {
OVERLAY_DATA_NONE,
OVERLAY_DATA_COLORKEY,
@@ -69,22 +73,39 @@ enum {
OVERLAY_DATA_ALPHABLEND
} ;
+#define MAX_BUFFERS 3
+
typedef struct _PortPrivRec {
struct _AdaptorPrivRec * pAdaptor;
+ /* Sync function */
+ void (*Sync) (ScrnInfoPtr pScrn);
+
/* Attributes */
- char OverlayData;
+ INT32 ColorKey;
+ INT32 OverlayAlpha;
INT32 OverlayMode;
- INT32 OverlayControl;
INT32 Attribute[3];
+ /* Clipping */
+ RegionRec clip;
+
+#if 0 /* Adding this cause the server to crash if we minimize the video */
+ /* Frame counter */
+ char Frames;
+#endif
+
+ /* Ramdac save values, ... */
+ INT32 ramdac_x, ramdac_w;
+ INT32 ramdac_y, ramdac_h;
+ Bool ramdac_on;
+
/* Buffers */
- int Id, Bpp;
- int Format, Bpp_shift;
+ int Id, Format;
+ int FB_Shift, Video_Shift;
short display, copy;
- FBLinearPtr Buffer[MAX_BUFFERS];
- CARD32 BufferStride; /* bytes */
- int OverlayStride; /* pixels */
+ FBAreaPtr Buffer[MAX_BUFFERS];
+ CARD32 BufferBase[MAX_BUFFERS];
/* Buffer and Drawable size and position */
INT32 vx, vy, vw, vh; /* 12.10 fp */
@@ -103,8 +124,7 @@ typedef struct _AdaptorPrivRec {
PortPrivPtr pPort;
} AdaptorPrivRec, *AdaptorPrivPtr;
-static AdaptorPrivPtr AdaptorPriv;
-
+static AdaptorPrivPtr AdaptorPrivList = NULL;
/*
* Proprietary Attributes
@@ -114,42 +134,35 @@ static AdaptorPrivPtr AdaptorPriv;
/* We support 3 sorts of filters :
* 0 : None.
* 1 : Partial (only in the X directrion).
- * 2 : Full.
+ * 2 : Full (incompatible with X mirroring).
*/
#define XV_MIRROR "XV_MIRROR"
/* We also support mirroring of the image :
- * bit 0 : if set, will mirror in the X direction.
+ * bit 0 : if set, will mirror in the X direction
+ * (incompatible with full filtering).
* bit 1 : if set, will mirror in the Y direction.
*/
-#define XV_OVERLAY_MODE "XV_OVERLAY_MODE"
-/* We support these different overlay modes (bit 0-2) :
- * 0 : Opaque video overlay (default).
- * 1 : Color keyed overlay, framebuffer color key.
- * Data : bit 3-27 : color key in RGB 888 format.
- * 2 : Color keyed overlay, framebuffer alpha key.
- * Data : bit 3-11 : 8 bit alpha key.
- * 3 : Color keyed overlay, overlay color key.
- * Data : bit 3-27 : color key in RGB 888 format.
- * 4 : Per pixel alpha blending.
- * 5 : Constant alpha blending.
- * Data : bit 3-11 : 8 bit alpha blend factor.
- * 6-7 : Reserved.
+#define XV_ALPHA "XV_ALPHA"
+/* We support the following alpha blend factors :
+ * 0 -> 0% Video, 100% Framebuffer
+ * 1 -> 25% Video, 75% Framebuffer
+ * 2 -> 75% Video, 25% Framebuffer
+ * 3 -> 100% Video, 0% Framebuffer
*/
-
static XF86AttributeRec
ScalerAttributes[] =
{
{ XvSettable | XvGettable, 0, 2, XV_FILTER },
{ XvSettable | XvGettable, 0, 3, XV_MIRROR },
- { XvSettable | XvGettable, 0, (2<<27)-1, XV_OVERLAY_MODE },
+ { XvSettable | XvGettable, 0, 3, XV_ALPHA },
};
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
-static Atom xvFilter, xvMirror, xvOverlayMode;
+static Atom xvFilter, xvMirror, xvAlpha;
/* Scaler */
@@ -261,7 +274,7 @@ ScalerImages[] =
*/
static void
-RemoveAreaCallback(FBLinearPtr Buffer)
+RemoveBufferCallback(FBAreaPtr Buffer)
{
PortPrivPtr pPPriv = (PortPrivPtr) Buffer->devPrivate.ptr;
int i = -1;
@@ -287,9 +300,11 @@ FreeBuffers(PortPrivPtr pPPriv, Bool from_timer)
}
}
+ pPPriv->display = -1;
+ pPPriv->copy = -1;
for (i=0; i < MAX_BUFFERS; i++)
if (pPPriv->Buffer[i]) {
- xf86FreeOffscreenLinear (pPPriv->Buffer[i]);
+ xf86FreeOffscreenArea (pPPriv->Buffer[i]);
pPPriv->Buffer[i] = NULL;
}
}
@@ -313,13 +328,14 @@ TimerCallback(OsTimerPtr pTim, CARD32 now, pointer p)
}
static int
-AllocateBuffers(PortPrivPtr pPPriv,
- int w_bpp, int h)
+AllocateBuffers(PortPrivPtr pPPriv, int w_bpp, int h)
{
AdaptorPrivPtr pAPriv = pPPriv->pAdaptor;
ScrnInfoPtr pScrn = pAPriv->pScrn;
int i = -1;
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "We try to allocate a %dx%d buffer.\n", w_bpp, h));
/* we start a timer to free the buffers if they are nto used within
* 5 seconds (pPPriv->Delay * pPPriv->Instant) */
pPPriv->StopDelay = pPPriv->Delay;
@@ -328,73 +344,194 @@ AllocateBuffers(PortPrivPtr pPPriv,
TimerSet(pPPriv->Timer, 0, 80, TimerCallback, pAPriv);
}
- for (i=0; i < MAX_BUFFERS && (i == pPPriv->display || i == pPPriv->copy); i++);
+ for (i=0; i < MAX_BUFFERS
+ && (i == pPPriv->display || i == pPPriv->copy); i++);
if (pPPriv->Buffer[i]) {
- DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4,
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
"Buffer %d exists.\n", i));
- if (pPPriv->Buffer[i]->size == w_bpp * h) {
- DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4,
+ if ((pPPriv->Buffer[i]->box.x2 - pPPriv->Buffer[i]->box.x1) == w_bpp &&
+ (pPPriv->Buffer[i]->box.y2 - pPPriv->Buffer[i]->box.y1) == h) {
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
"Buffer %d is of the good size, let's use it.\n", i));
return (pPPriv->copy = i);
}
- else if (xf86ResizeOffscreenLinear (pPPriv->Buffer[i], w_bpp * h)) {
- DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4,
+ else if (xf86ResizeOffscreenArea (pPPriv->Buffer[i], w_bpp, h)) {
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
"I was able to resize buffer %d, let's use it.\n", i));
+ pPPriv->BufferBase[i] =
+ ((pPPriv->Buffer[i]->box.y1 * pScrn->displayWidth) +
+ pPPriv->Buffer[i]->box.x1)<<pPPriv->FB_Shift;
return (pPPriv->copy = i);
}
else {
- DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4,
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
"I was not able to resize buffer %d.\n", i));
- xf86FreeOffscreenLinear (pPPriv->Buffer[i]);
+ xf86FreeOffscreenArea (pPPriv->Buffer[i]);
pPPriv->Buffer[i] = NULL;
}
}
- if ((pPPriv->Buffer[i] = xf86AllocateOffscreenLinear (pScrn->pScreen,
- w_bpp * h, 0, NULL, NULL, (pointer) pPPriv))) {
- DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4,
+ if ((pPPriv->Buffer[i] = xf86AllocateOffscreenArea (pScrn->pScreen,
+ w_bpp, h, 4 >> pPPriv->FB_Shift, NULL, NULL, (pointer) pPPriv))) {
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
"Sucessfully allocated buffer %d, let's use it.\n", i));
+ pPPriv->BufferBase[i] =
+ ((pPPriv->Buffer[i]->box.y1 * pScrn->displayWidth) +
+ pPPriv->Buffer[i]->box.x1)<<pPPriv->FB_Shift;
return (pPPriv->copy = i);
}
- DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4,
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
"Unable to allocate a buffer.\n"));
return -1;
}
-#define GET_OFFSET(pScrn, offset) \
- (offset + (pScrn->virtualY*pScrn->displayWidth*pScrn->bitsPerPixel/8))
-
/*
* Xv interface
*/
+#if USE_HARDWARE_COPY
static void
-CopyYV12LE(CARD8 *Y, CARD32 *dst, int width, int height, int pitch)
+HWCopySetup(PortPrivPtr pPPriv, int x, int y, int w, int h)
{
- int Y_size = width * height;
+ AdaptorPrivPtr pAPriv = pPPriv->pAdaptor;
+ ScrnInfoPtr pScrn = pAPriv->pScrn;
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "x = %d, y = %d, w = %d, h = %d.\n", x, y, w, h));
+
+ GLINT_WAIT(4);
+ GLINT_WRITE_REG(0xffffffff, FBHardwareWriteMask);
+ GLINT_WRITE_REG(
+ PM3Config2D_ForegroundROPEnable |
+ PM3Config2D_ForegroundROP(GXcopy) |
+ PM3Config2D_FBWriteEnable,
+ PM3Config2D);
+ GLINT_WRITE_REG(
+ PM3RectanglePosition_XOffset(x) |
+ PM3RectanglePosition_YOffset(y),
+ PM3RectanglePosition);
+ GLINT_WRITE_REG(
+ PM3Render2D_SpanOperation |
+ PM3Render2D_XPositive |
+ PM3Render2D_YPositive |
+ PM3Render2D_Operation_SyncOnHostData |
+ PM3Render2D_Width(w) | PM3Render2D_Height(h),
+ PM3Render2D);
+}
+static void
+HWCopyYV12(PortPrivPtr pPPriv, CARD8 *Y, int w, int h)
+{
+ AdaptorPrivPtr pAPriv = pPPriv->pAdaptor;
+ ScrnInfoPtr pScrn = pAPriv->pScrn;
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+ int Y_size = w * h;
CARD8 *V = Y + Y_size;
CARD8 *U = V + (Y_size >> 2);
- int pad = (pitch >> 2) - (width >> 1);
- int x;
-
- width >>= 1;
-
- for (height >>= 1; height > 0; height--) {
- for (x = 0; x < width; Y += 2, x++)
- *dst++ = Y[0] + (U[x] << 8) + (Y[1] << 16) + (V[x] << 24);
- dst += pad;
- for (x = 0; x < width; Y += 2, x++)
- *dst++ = Y[0] + (U[x] << 8) + (Y[1] << 16) + (V[x] << 24);
- dst += pad;
- U += width;
- V += width;
+ CARD32 *dst;
+ int dwords, i, x;
+
+ dwords = Y_size >> 1;
+
+ x = 0;
+ while (dwords >= pGlint->FIFOSize) {
+ dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4);
+ GLINT_WAIT(pGlint->FIFOSize);
+ /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) |
+ 0x05, OutputFIFO);
+ for (i = pGlint->FIFOSize - 1; i; i--, Y += 2, U++, V++, dst++, x++) {
+ /* mmm, i don't know if this is really needed, as we perform
+ * endianess inversion as usual, let's check it before removing */
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ *dst = V[0] + (Y[1] << 8) + (U[0] << 16) + (Y[0] << 24);
+#else
+ *dst = Y[0] + (U[0] << 8) + (Y[1] << 16) + (V[0] << 24);
+#endif
+ if (x == w>>1) { U -= w>>1; V -= w>>1; }
+ if (x == w) x = 0;
+ }
+ dwords -= pGlint->FIFOSize - 1;
}
-}
-
+ if (dwords) {
+ dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4);
+ GLINT_WAIT(dwords + 1);
+ /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */
+ GLINT_WRITE_REG(((dwords - 1) << 16) | (0x15 << 4) |
+ 0x05, OutputFIFO);
+ for (i = dwords; i; i--, Y += 2, U++, V++, dst++, x++) {
+ /* mmm, i don't know if this is really needed, as we perform
+ * endianess inversion as usual, let's check it before removing */
#if X_BYTE_ORDER == X_BIG_ENDIAN
+ *dst = V[0] + (Y[1] << 8) + (U[0] << 16) + (Y[0] << 24);
+#else
+ *dst = Y[0] + (U[0] << 8) + (Y[1] << 16) + (V[0] << 24);
+#endif
+ if (x == w>>1) { U -= w>>1; V -= w>>1; }
+ if (x == w) x = 0;
+ }
+ }
+}
+static void
+HWCopyFlat(PortPrivPtr pPPriv, CARD8 *src, int w, int h)
+{
+ AdaptorPrivPtr pAPriv = pPPriv->pAdaptor;
+ ScrnInfoPtr pScrn = pAPriv->pScrn;
+ GLINTPtr pGlint = GLINTPTR(pScrn);
+ int size = w * h;
+ int pitch = pScrn->displayWidth<<pPPriv->FB_Shift;
+ CARD32 *dst;
+ CARD8 *tmp_src;
+ int dwords, i;
+ if (w == pitch) {
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "HWCopyFlat : src = %08x, w = pitch = %d, h = %d.\n",
+ src, w, h));
+ dwords = size >> pPPriv->Video_Shift;
+ while (dwords >= pGlint->FIFOSize) {
+ dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4);
+ GLINT_WAIT(pGlint->FIFOSize);
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) |
+ 0x05, OutputFIFO);
+ for (i = pGlint->FIFOSize - 1; i; i--, dst++, src++) *dst = *src;
+ dwords -= pGlint->FIFOSize - 1;
+ }
+ if (dwords) {
+ dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4);
+ GLINT_WAIT(dwords + 1);
+ GLINT_WRITE_REG(((dwords - 1) << 16) | (0x15 << 4) |
+ 0x05, OutputFIFO);
+ for (i = dwords; i; i--, dst++, src++) *dst = *src;
+ }
+ } else {
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "HWCopyFlat : src = %08x, w = %d, pitch = %d, h = %d.\n",
+ src, w, pitch, h));
+ while (h) {
+ tmp_src = src;
+ dwords = w >> pPPriv->Video_Shift;
+ while (dwords >= pGlint->FIFOSize) {
+ dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4);
+ GLINT_WAIT(pGlint->FIFOSize);
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) |
+ 0x05, OutputFIFO);
+ for (i = pGlint->FIFOSize - 1; i; i--, dst++, src++) *dst = *src;
+ dwords -= pGlint->FIFOSize - 1;
+ }
+ if (dwords) {
+ dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4);
+ GLINT_WAIT(dwords + 1);
+ GLINT_WRITE_REG(((dwords - 1) << 16) | (0x15 << 4) |
+ 0x05, OutputFIFO);
+ for (i = dwords; i; i--, dst++, src++) *dst = *src;
+ }
+ src = tmp_src + pitch;
+ }
+ }
+}
+#else
static void
-CopyYV12BE(CARD8 *Y, CARD32 *dst, int width, int height, int pitch)
+CopyYV12(CARD8 *Y, CARD32 *dst, int width, int height, int pitch)
{
int Y_size = width * height;
CARD8 *V = Y + Y_size;
@@ -406,18 +543,24 @@ CopyYV12BE(CARD8 *Y, CARD32 *dst, int width, int height, int pitch)
for (height >>= 1; height > 0; height--) {
for (x = 0; x < width; Y += 2, x++)
+#if X_BYTE_ORDER == X_BIG_ENDIAN
*dst++ = V[x] + (Y[1] << 8) + (U[x] << 16) + (Y[0] << 24);
+#else
+ *dst++ = Y[0] + (U[x] << 8) + (Y[1] << 16) + (V[x] << 24);
+#endif
dst += pad;
for (x = 0; x < width; Y += 2, x++)
+#if X_BYTE_ORDER == X_BIG_ENDIAN
*dst++ = V[x] + (Y[1] << 8) + (U[x] << 16) + (Y[0] << 24);
+#else
+ *dst++ = Y[0] + (U[x] << 8) + (Y[1] << 16) + (V[x] << 24);
+#endif
dst += pad;
U += width;
V += width;
}
}
-#endif /* X_BYTE_ORDER == X_BIG_ENDIAN */
-
static void
CopyFlat(CARD8 *src, CARD8 *dst, int width, int height, int pitch)
{
@@ -433,6 +576,7 @@ CopyFlat(CARD8 *src, CARD8 *dst, int width, int height, int pitch)
height--;
}
}
+#endif
#define FORMAT_RGB8888 PM3VideoOverlayMode_COLORFORMAT_RGB8888
#define FORMAT_RGB4444 PM3VideoOverlayMode_COLORFORMAT_RGB4444
@@ -463,6 +607,9 @@ do{ \
mem_barrier(); \
}while(0)
+#define RAMDAC_WRITE_OLD(data,index) \
+ Permedia2vOutIndReg(pScrn, index, 0x00, data)
+
/* Notice, have to check that we dont overflow the deltas here ... */
static void
compute_scale_factor(
@@ -487,33 +634,8 @@ compute_scale_factor(
}
}
-/* Some thougth about clipping :
- *
- * To support clipping, we will need to :
- * - We need to convert the clipregion to a bounding box
- * and a bitmap that is the mask associated with the clipregion.
- * - Load this bitmap to offscreen memory.
- * - Copy/expand this bitmap to the needed area, masking only the alpha
- * channel of the framebuffer.
- * - Use either the alpha blended or framebuffer alpha keyed overlay mode to
- * mask the clipped away region.
- * - If the clip region gets changed, we have to upload a new clip mask,
- * clear the old alpha mask in the framebuffer and copy the new clip mask
- * to the framebuffer again.
- * - If the position of the region get's changed (but not the clip mask) we
- * need to clear the old frambuffer clip mask in the alpha channel and
- * upload the new one.
- *
- * All this will only work if :
- *
- * 1) we are using an framebuffer format with an alpha channel, that is
- * RGBA 8888 (depth 24) and RGBA 5551 (depth 15).
- * 2) nobody else uses the alpha channel.
- *
- */
-
static void
-BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent)
+BeginOverlay(PortPrivPtr pPPriv, int display)
{
AdaptorPrivPtr pAPriv = pPPriv->pAdaptor;
ScrnInfoPtr pScrn = pAPriv->pScrn;
@@ -523,10 +645,13 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent)
unsigned int src_w = pPPriv->vw, dst_w = pPPriv->dw;
unsigned int src_h = pPPriv->vh, dst_h = pPPriv->dh;
unsigned int shrink_delta, zoom_delta;
+#if BLACKNESS_WORKAROUND
+ static int Frames = 50;
+#endif
+ unsigned int stride =
+ (pScrn->displayWidth << pPPriv->FB_Shift) >> pPPriv->Video_Shift;
- /* Let's overlay only to visible parts of the screen
- * Note : this has no place here, and will not work if
- * clipping is not supported, since Xv will not show this. */
+ /* Let's overlay only to visible parts of the screen */
if (pPPriv->dx < pScrn->frameX0) {
dst_w = dst_w - pScrn->frameX0 + dst_x;
dst_x = 0;
@@ -554,7 +679,13 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent)
* the Permedia3 overlay unit requirement, and compute the X deltas. */
compute_scale_factor(&src_w, &dst_w, &shrink_delta, &zoom_delta);
- DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "BeginOverlay\n"));
+#if BLACKNESS_WORKAROUND
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "BeginOverlay %d (buffer %d)\n", Frames, display));
+#else
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "BeginOverlay (buffer %d)\n", display));
+#endif
if (src_w != pPPriv->vw)
DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
"BeginOverlay : Padding video width to 4 pixels %d->%d.\n",
@@ -562,17 +693,45 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent)
if (dst_w != pPPriv->dw)
DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
"BeginOverlay : Scaling destination width from %d to %d.\n"
- "\tThe scaling factor is to high, and may cause problems.",
+ "\tThe scaling factor is to high, and may cause problems.\n",
pPPriv->dw, dst_w));
if (display != -1) pPPriv->display = display;
- GLINT_WAIT(12);
+
+#if BLACKNESS_WORKAROUND
+ if (++Frames>25) {
+ Frames = 0;
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "Registers (1) : %08x, %08x, %08x, %08x, %08x.\n",
+ GLINT_READ_REG(PM3VideoOverlayFifoControl),
+ GLINT_READ_REG(PM3VideoOverlayMode),
+ GLINT_READ_REG(PM3VideoOverlayBase0),
+ GLINT_READ_REG(PM3VideoOverlayBase1),
+ GLINT_READ_REG(PM3VideoOverlayBase2)));
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "Registers (2) : %08x, %08x, %08x, %08x.\n",
+ GLINT_READ_REG(PM3VideoOverlayStride),
+ GLINT_READ_REG(PM3VideoOverlayWidth),
+ GLINT_READ_REG(PM3VideoOverlayHeight),
+ GLINT_READ_REG(PM3VideoOverlayOrigin)));
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "Registers (3) : %08x, %08x, %08x, %08x.\n",
+ GLINT_READ_REG(PM3VideoOverlayYDelta),
+ GLINT_READ_REG(PM3VideoOverlayShrinkXDelta),
+ GLINT_READ_REG(PM3VideoOverlayZoomXDelta),
+ GLINT_READ_REG(PM3VideoOverlayIndex)));
+ GLINT_WAIT(8);
+ GLINT_WRITE_REG(PM3VideoOverlayMode_DISABLE,
+ PM3VideoOverlayMode);
+ } else GLINT_WAIT(7);
+#else
+ GLINT_WAIT(7);
+#endif
GLINT_WRITE_REG(3|(12<<16), PM3VideoOverlayFifoControl);
/* Updating the Video Overlay Source Image Parameters */
GLINT_WRITE_REG(
- GET_OFFSET(pScrn, pPPriv->Buffer[pPPriv->display]->offset)>>bpp_shift,
+ pPPriv->BufferBase[pPPriv->display]>>pPPriv->Video_Shift,
PM3VideoOverlayBase+(pPPriv->display*8));
- GLINT_WRITE_REG(pPPriv->display, PM3VideoOverlayIndex);
GLINT_WRITE_REG(pPPriv->Format |
PM3VideoOverlayMode_BUFFERSYNC_MANUAL |
PM3VideoOverlayMode_FLIP_VIDEO |
@@ -581,7 +740,7 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent)
PM3VideoOverlayMode_ENABLE,
PM3VideoOverlayMode);
/* Let's set the source stride. */
- GLINT_WRITE_REG(PM3VideoOverlayStride_STRIDE(pPPriv->OverlayStride),
+ GLINT_WRITE_REG(PM3VideoOverlayStride_STRIDE(stride),
PM3VideoOverlayStride);
/* Let's set the position and size of the visible part of the source. */
GLINT_WRITE_REG(PM3VideoOverlayWidth_WIDTH(src_w),
@@ -592,6 +751,8 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent)
PM3VideoOverlayOrigin_XORIGIN(src_x) |
PM3VideoOverlayOrigin_YORIGIN(src_y),
PM3VideoOverlayOrigin);
+
+ GLINT_WAIT(5);
/* Scale the source to the destinationsize */
if (src_h == dst_h) {
GLINT_WRITE_REG(
@@ -604,50 +765,150 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent)
}
GLINT_WRITE_REG(shrink_delta, PM3VideoOverlayShrinkXDelta);
GLINT_WRITE_REG(zoom_delta, PM3VideoOverlayZoomXDelta);
- /* Launch the true update at the next FrameBlank */
+ GLINT_WRITE_REG(pPPriv->display, PM3VideoOverlayIndex);
GLINT_WRITE_REG(PM3VideoOverlayUpdate_ENABLE,
PM3VideoOverlayUpdate);
- /* Setting the ramdac video overlay rgion */
- /* Begining of overlay region */
- RAMDAC_WRITE((dst_x&0xff), PM3RD_VideoOverlayXStartLow);
- RAMDAC_WRITE((dst_x&0xf00)>>8, PM3RD_VideoOverlayXStartHigh);
- RAMDAC_WRITE((dst_y&0xff), PM3RD_VideoOverlayYStartLow);
- RAMDAC_WRITE((dst_y&0xf00)>>8, PM3RD_VideoOverlayYStartHigh);
- /* End of overlay regions (+1) */
- RAMDAC_WRITE(((dst_x+dst_w)&0xff), PM3RD_VideoOverlayXEndLow);
- RAMDAC_WRITE(((dst_x+dst_w)&0xf00)>>8,PM3RD_VideoOverlayXEndHigh);
- RAMDAC_WRITE(((dst_y+dst_h)&0xff), PM3RD_VideoOverlayYEndLow);
- RAMDAC_WRITE(((dst_y+dst_h)&0xf00)>>8,PM3RD_VideoOverlayYEndHigh);
+
+
+ /* Now set the ramdac video overlay region and mode */
+ if ((pPPriv->ramdac_x != dst_x) || (pPPriv->ramdac_w != dst_w)) {
+ RAMDAC_WRITE((dst_x&0xff), PM3RD_VideoOverlayXStartLow);
+ RAMDAC_WRITE((dst_x&0xf00)>>8, PM3RD_VideoOverlayXStartHigh);
+ RAMDAC_WRITE(((dst_x+dst_w)&0xff), PM3RD_VideoOverlayXEndLow);
+ RAMDAC_WRITE(((dst_x+dst_w)&0xf00)>>8,PM3RD_VideoOverlayXEndHigh);
+ pPPriv->ramdac_x = dst_x;
+ pPPriv->ramdac_w = dst_w;
+ }
+ if ((pPPriv->ramdac_y != dst_y) || (pPPriv->ramdac_h != dst_h)) {
+ RAMDAC_WRITE((dst_y&0xff), PM3RD_VideoOverlayYStartLow);
+ RAMDAC_WRITE((dst_y&0xf00)>>8, PM3RD_VideoOverlayYStartHigh);
+ RAMDAC_WRITE(((dst_y+dst_h)&0xff), PM3RD_VideoOverlayYEndLow);
+ RAMDAC_WRITE(((dst_y+dst_h)&0xf00)>>8,PM3RD_VideoOverlayYEndHigh);
+ pPPriv->ramdac_y = dst_y;
+ pPPriv->ramdac_h = dst_h;
+ }
- switch (pPPriv->OverlayData) {
- case OVERLAY_DATA_COLORKEY :
- RAMDAC_WRITE(((pPPriv->OverlayControl>>8)&0xff),
- PM3RD_VideoOverlayKeyR);
- RAMDAC_WRITE(((pPPriv->OverlayControl>>16)&0xff),
- PM3RD_VideoOverlayKeyG);
- RAMDAC_WRITE(((pPPriv->OverlayControl>>24)&0xff),
- PM3RD_VideoOverlayKeyB);
- break;
- case OVERLAY_DATA_ALPHAKEY :
- RAMDAC_WRITE(((pPPriv->OverlayControl>>8)&0xff),
- PM3RD_VideoOverlayKeyR);
- break;
- case OVERLAY_DATA_ALPHABLEND :
- RAMDAC_WRITE(((pPPriv->OverlayControl>>8)&0xff),
- PM3RD_VideoOverlayBlend);
- break;
+ if (!pPPriv->ramdac_on) {
+ if (pPPriv->OverlayAlpha<(3<<6)) {
+ RAMDAC_WRITE(pPPriv->OverlayAlpha, PM3RD_VideoOverlayBlend);
+ RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE |
+ PM3RD_VideoOverlayControl_MODE_BLEND |
+ PM3RD_VideoOverlayControl_BLENDSRC_REGISTER,
+ PM3RD_VideoOverlayControl);
+ } else {
+#if SUPPORT_CLIPPING
+ switch (pScrn->depth) {
+ case 8:
+ case 16:
+ RAMDAC_WRITE((pPPriv->ColorKey&0xff0000)>>16,
+ PM3RD_VideoOverlayKeyR);
+ RAMDAC_WRITE((pPPriv->ColorKey&0x00ff00)>>8,
+ PM3RD_VideoOverlayKeyG);
+ RAMDAC_WRITE(pPPriv->ColorKey&0x0000ff,
+ PM3RD_VideoOverlayKeyB);
+ RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE |
+ PM3RD_VideoOverlayControl_MODE_MAINKEY |
+ PM3RD_VideoOverlayControl_KEY_COLOR,
+ PM3RD_VideoOverlayControl);
+ break;
+ case 15:
+ RAMDAC_WRITE(0x1, PM3RD_VideoOverlayKeyR);
+ RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE |
+ PM3RD_VideoOverlayControl_MODE_MAINKEY |
+ PM3RD_VideoOverlayControl_KEY_ALPHA,
+ PM3RD_VideoOverlayControl);
+ break;
+ case 24:
+ RAMDAC_WRITE(0xff, PM3RD_VideoOverlayKeyR);
+ RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE |
+ PM3RD_VideoOverlayControl_MODE_MAINKEY |
+ PM3RD_VideoOverlayControl_KEY_ALPHA,
+ PM3RD_VideoOverlayControl);
+ break;
+ }
+#else
+ RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE |
+ PM3RD_VideoOverlayControl_MODE_ALWAYS,
+ PM3RD_VideoOverlayControl);
+#endif
+ }
+ pPPriv->ramdac_on = TRUE;
}
- /* And now enable Video Overlay in the RAMDAC */
- RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE |
- /* OverlayMode attribute */
- (pPPriv->OverlayControl&0xff),
- PM3RD_VideoOverlayControl);
-
- pPPriv->Buffer[pPPriv->display]->RemoveLinearCallback =
- RemoveAreaCallback;
+
+ pPPriv->Buffer[pPPriv->display]->RemoveAreaCallback =
+ RemoveBufferCallback;
if (display != -1) pPPriv->copy = -1;
}
+#if SUPPORT_CLIPPING
+
+static Bool
+RegionsEqual(RegionPtr A, RegionPtr B)
+{
+ int *dataA, *dataB;
+ int num;
+
+ num = REGION_NUM_RECTS(A);
+ if(num != REGION_NUM_RECTS(B))
+ return FALSE;
+
+ if((A->extents.x1 != B->extents.x1) ||
+ (A->extents.x2 != B->extents.x2) ||
+ (A->extents.y1 != B->extents.y1) ||
+ (A->extents.y2 != B->extents.y2))
+ return FALSE;
+
+ dataA = (int*)REGION_RECTS(A);
+ dataB = (int*)REGION_RECTS(B);
+
+ while(num--) {
+ if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1]))
+ return FALSE;
+ dataA += 2;
+ dataB += 2;
+ }
+
+ return TRUE;
+}
+static void Clip (PortPrivPtr pPPriv, RegionPtr clipBoxes)
+{
+ AdaptorPrivPtr pAPriv = pPPriv->pAdaptor;
+ ScrnInfoPtr pScrn = pAPriv->pScrn;
+
+ /* Let's handle the clipping here. */
+ if(!RegionsEqual(&pPPriv->clip, clipBoxes)) {
+ REGION_COPY(pScrn->pScreen, &pPPriv->clip, clipBoxes);
+ if (pPPriv->OverlayAlpha<(3<<6)) {
+ XAAFillSolidRects(pScrn, pPPriv->OverlayAlpha<<24, GXcopy,
+ 0xff000000, REGION_NUM_RECTS(clipBoxes),
+ REGION_RECTS(clipBoxes));
+ } else {
+ switch (pScrn->depth) {
+ case 8: /* CI8 */
+ XAAFillSolidRects(pScrn, pPPriv->ColorKey,
+ GXcopy, 0xffffffff, REGION_NUM_RECTS(clipBoxes),
+ REGION_RECTS(clipBoxes));
+ break;
+ case 15: /* RGB5551 */
+ XAAFillSolidRects(pScrn, 0xffffffff, GXcopy, 0x80008000,
+ REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes));
+ break;
+ case 16: /* RGB565 */
+ XAAFillSolidRects(pScrn, pPPriv->ColorKey, GXcopy,
+ 0xffffffff, REGION_NUM_RECTS(clipBoxes),
+ REGION_RECTS(clipBoxes));
+ break;
+ case 24: /* RGB8888 */
+ XAAFillSolidRects(pScrn, 0xffffffff, GXcopy,
+ 0xff000000, REGION_NUM_RECTS(clipBoxes),
+ REGION_RECTS(clipBoxes));
+ break;
+ }
+ }
+ }
+}
+#endif
+
static void
StopOverlay(PortPrivPtr pPPriv, int cleanup)
{
@@ -657,38 +918,42 @@ StopOverlay(PortPrivPtr pPPriv, int cleanup)
DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "StopOverlay.\n"));
/* Stop the Video Overlay in the RAMDAC */
- RAMDAC_WRITE(PM3RD_VideoOverlayControl_DISABLE,
- PM3RD_VideoOverlayControl);
+ if (pPPriv->ramdac_on) {
+ RAMDAC_WRITE(PM3RD_VideoOverlayControl_DISABLE,
+ PM3RD_VideoOverlayControl);
+ pPPriv->ramdac_on = FALSE;
+ }
/* Stop the Video Overlay in the Video Overlay Unit */
GLINT_WAIT(1);
GLINT_WRITE_REG(PM3VideoOverlayMode_DISABLE,
PM3VideoOverlayMode);
}
-/* ReputImage may be used if only the position of the destination changes,
- * maybe while moving the window around or something such.
- */
+/* ReputImage is used if only the destination position or
+ * the clipboxes change. */
static int
Permedia3ReputImage(ScrnInfoPtr pScrn,
short drw_x, short drw_y,
RegionPtr clipBoxes, pointer data)
{
PortPrivPtr pPPriv = (PortPrivPtr) data;
- GLINTPtr pGlint = GLINTPTR(pScrn);
- BoxPtr extent;
DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
"ReputImage %d,%d.\n", drw_x, drw_y));
- /* If the buffer was freed, we cannot overlay it. */
- if (pPPriv->display == -1) {
+
+#if !SUPPORT_CLIPPING
+ /* If the clip region is not a rectangle */
+ if (REGION_SIZE(clipBoxes) != 0) {
StopOverlay (pPPriv, FALSE);
return Success;
}
- if (REGION_SIZE(clipBoxes) != 0) {
- /* We need to transform the clipBoxes into a bitmap,
- * and upload it to offscreen memory. */
+#endif
+
+ /* If the buffer was freed, we cannot overlay it. */
+ if (pPPriv->display == -1) {
StopOverlay (pPPriv, FALSE);
return Success;
}
+
/* Check that the dst area is some part of the visible screen. */
if ((drw_x + pPPriv->dw) < pScrn->frameX0 ||
(drw_y + pPPriv->dh) < pScrn->frameY0 ||
@@ -699,16 +964,13 @@ Permedia3ReputImage(ScrnInfoPtr pScrn,
pPPriv->dx = drw_x;
pPPriv->dy = drw_y;
- /* We sync the chip. */
- if (pGlint->MultiAperture) DualPermedia3Sync(pScrn);
- else Permedia3Sync(pScrn);
-
- extent = REGION_EXTENTS(pScrn, clipBoxes);
- BeginOverlay(pPPriv, -1, pPPriv->Bpp_shift, extent);
+#if SUPPORT_CLIPPING
+ /* Clipping */
+ Clip (pPPriv, clipBoxes);
+#endif
- /* We sync the chip. */
- if (pGlint->MultiAperture) DualPermedia3Sync(pScrn);
- else Permedia3Sync(pScrn);
+ /* Restart the overlay */
+ BeginOverlay(pPPriv, -1);
return Success;
}
@@ -721,10 +983,12 @@ Permedia3PutImage(ScrnInfoPtr pScrn,
Bool sync, RegionPtr clipBoxes, pointer data)
{
PortPrivPtr pPPriv = (PortPrivPtr) data;
+#if !USE_HARDWARE_COPY
GLINTPtr pGlint = GLINTPTR(pScrn);
+#endif
int copy = -1;
- BoxPtr extent;
- BoxRec ext;
+ Bool copy_flat = TRUE;
+ int w_bpp;
DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
"PutImage %d,%d,%d,%d -> %d,%d,%d,%d "
@@ -732,20 +996,27 @@ Permedia3PutImage(ScrnInfoPtr pScrn,
src_x, src_y, src_w, src_h, drw_x, drw_y, drw_w, drw_h,
id, buf, width, height, sync));
- extent = REGION_EXTENTS(pScrn, clipBoxes);
- ext = *extent;
- if (REGION_SIZE(clipBoxes) != 0) return Success;
+#if !SUPPORT_CLIPPING
+ /* If the clip region is not a rectangle */
+ if (REGION_SIZE(clipBoxes) != 0) {
+ StopOverlay (pPPriv, FALSE);
+ return Success;
+ }
+#endif
/* Check that the src area to put is included in the buffer. */
if ((src_x + src_w) > width ||
(src_y + src_h) > height ||
- src_x < 0 || src_y < 0)
+ src_x < 0 || src_y < 0) {
+ StopOverlay(pPPriv, FALSE);
return BadValue;
+ }
/* Check that the dst area is some part of the visible screen. */
if ((drw_x + drw_w) < pScrn->frameX0 ||
(drw_y + drw_h) < pScrn->frameY0 ||
drw_x > pScrn->frameX1 || drw_y > pScrn->frameY1) {
+ StopOverlay(pPPriv, FALSE);
return Success;
}
@@ -771,176 +1042,119 @@ Permedia3PutImage(ScrnInfoPtr pScrn,
if (i >= ENTRIES(ScalerImages))
return XvBadAlloc;
pPPriv->Id = id;
- pPPriv->Bpp = ScalerImages[i].bits_per_pixel;
}
- /* We sync the chip. I don't know if it is really
- * needed but X crashed when i didn't do it. */
- if (pGlint->MultiAperture) DualPermedia3Sync(pScrn);
- else Permedia3Sync(pScrn);
-
- /* Let's define the different strides values */
- pPPriv->OverlayStride = width;
- pPPriv->BufferStride = ((pPPriv->Bpp+7)>>3) * width;
+ /* Let's find the image format and Video_Shift values */
+ switch (id) {
+ case LE4CC('Y','V','1','2'):
+ pPPriv->Format = FORMAT_YUV422;
+ pPPriv->Video_Shift = 1;
+ copy_flat = FALSE;
+ break;
+ case LE4CC('Y','U','Y','2'):
+ pPPriv->Format = FORMAT_YUV422;
+ pPPriv->Video_Shift = 1;
+ break;
+ case LE4CC('U','Y','V','Y'):
+ pPPriv->Format = FORMAT_VUY422;
+ pPPriv->Video_Shift = 1;
+ break;
+ case LE4CC('Y','U','V','A'):
+ pPPriv->Format = FORMAT_YUV444;
+ pPPriv->Video_Shift = 2;
+ break;
+ case LE4CC('V','U','Y','A'):
+ pPPriv->Format = FORMAT_VUY444;
+ pPPriv->Video_Shift = 2;
+ break;
+ case 0x41: /* RGBA 8:8:8:8 */
+ pPPriv->Format = FORMAT_RGB8888;
+ pPPriv->Video_Shift = 2;
+ break;
+ case 0x42: /* RGB 5:6:5 */
+ pPPriv->Format = FORMAT_RGB565;
+ pPPriv->Video_Shift = 1;
+ break;
+ case 0x43: /* RGB 1:5:5:5 */
+ pPPriv->Format = FORMAT_RGB5551;
+ pPPriv->Video_Shift = 1;
+ break;
+ case 0x44: /* RGB 4:4:4:4 */
+ pPPriv->Format = FORMAT_RGB4444;
+ pPPriv->Video_Shift = 1;
+ break;
+ case 0x46: /* RGB 2:3:3 */
+ pPPriv->Format = FORMAT_RGB332;
+ pPPriv->Video_Shift = 0;
+ break;
+ case 0x47: /* BGRA 8:8:8:8 */
+ pPPriv->Format = FORMAT_BGR8888;
+ pPPriv->Video_Shift = 2;
+ break;
+ case 0x48: /* BGR 5:6:5 */
+ pPPriv->Format = FORMAT_BGR565;
+ pPPriv->Video_Shift = 1;
+ break;
+ case 0x49: /* BGR 1:5:5:5 */
+ pPPriv->Format = FORMAT_BGR5551;
+ pPPriv->Video_Shift = 1;
+ break;
+ case 0x4A: /* BGR 4:4:4:4 */
+ pPPriv->Format = FORMAT_BGR4444;
+ pPPriv->Video_Shift = 1;
+ break;
+ case 0x4C: /* BGR 2:3:3 */
+ pPPriv->Format = FORMAT_BGR332;
+ pPPriv->Video_Shift = 0;
+ break;
+ default:
+ return XvBadAlloc;
+ }
/* Now we allocate a buffer, if it is needed */
- if ((copy = AllocateBuffers(pPPriv, pPPriv->BufferStride, height)) == -1)
+ w_bpp = (width << pPPriv->Video_Shift) >> pPPriv->FB_Shift;
+ if ((copy = AllocateBuffers(pPPriv, w_bpp, height)) == -1)
return XvBadAlloc;
- /* Now, we can copy the image to the buffer */
- switch (id) {
- case LE4CC('Y','V','1','2'):
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- CopyYV12LE(buf,
- (CARD32 *)((CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset)),
- width, height, pPPriv->BufferStride);
+ /* Let's copy the image to the framebuffer */
+#if USE_HARDWARE_COPY
+ /* Erm, ... removing this log message will make the server crash. */
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "Hardware image upload.\n"));
+ HWCopySetup(pPPriv, pPPriv->Buffer[copy]->box.x1,
+ pPPriv->Buffer[copy]->box.y1, w_bpp, height);
+ if (copy_flat) HWCopyFlat(pPPriv, buf, width, height);
+ else HWCopyYV12(pPPriv, buf, width, height);
#else
- if (pGlint->FBDev)
- CopyYV12LE(buf,
- (CARD32 *)((CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset)),
- width, height, pPPriv->BufferStride);
- else
- CopyYV12BE(buf,
- (CARD32 *)((CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset)),
- width, height, pPPriv->BufferStride);
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "Software image upload (1).\n"));
+ pPPriv->Sync(pScrn);
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "Software image upload (2).\n"));
+ if (copy_flat) CopyFlat(buf,
+ (CARD8 *) pGlint->FbBase + pPPriv->BufferBase[copy],
+ width << pPPriv->FB_Shift, height,
+ pScrn->displayWidth << pPPriv->FB_Shift);
+ else CopyYV12(buf,
+ (CARD32 *)((CARD8 *) pGlint->FbBase + pPPriv->BufferBase[copy]),
+ width, height, pScrn->displayWidth << pPPriv->FB_Shift);
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "Software image upload (3).\n"));
+ pPPriv->Sync(pScrn);
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ "Software image upload (4).\n"));
#endif
- pPPriv->Format = FORMAT_YUV422;
- pPPriv->Bpp_shift = 1;
- break;
- case LE4CC('Y','U','Y','2'):
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 1, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_YUV422;
- pPPriv->Bpp_shift = 1;
- break;
-
- case LE4CC('U','Y','V','Y'):
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 1, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_VUY422;
- pPPriv->Bpp_shift = 1;
- break;
-
- case LE4CC('Y','U','V','A'):
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 2, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_YUV444;
- pPPriv->Bpp_shift = 2;
- break;
-
- case LE4CC('V','U','Y','A'):
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 2, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_VUY444;
- pPPriv->Bpp_shift = 2;
- break;
-
- case 0x41: /* RGBA 8:8:8:8 */
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 2, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_RGB8888;
- pPPriv->Bpp_shift = 2;
- break;
-
- case 0x42: /* RGB 5:6:5 */
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 1, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_RGB565;
- pPPriv->Bpp_shift = 1;
- break;
-
- case 0x43: /* RGB 1:5:5:5 */
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 1, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_RGB5551;
- pPPriv->Bpp_shift = 1;
- break;
-
- case 0x44: /* RGB 4:4:4:4 */
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 1, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_RGB4444;
- pPPriv->Bpp_shift = 1;
- break;
-
- case 0x46: /* RGB 2:3:3 */
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_RGB332;
- pPPriv->Bpp_shift = 0;
- break;
-
- case 0x47: /* BGRA 8:8:8:8 */
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 2, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_BGR8888;
- pPPriv->Bpp_shift = 2;
- break;
-
- case 0x48: /* BGR 5:6:5 */
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 1, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_BGR565;
- pPPriv->Bpp_shift = 1;
- break;
-
- case 0x49: /* BGR 1:5:5:5 */
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 1, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_BGR5551;
- pPPriv->Bpp_shift = 1;
- break;
-
- case 0x4A: /* BGR 4:4:4:4 */
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 1, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_BGR4444;
- pPPriv->Bpp_shift = 1;
- break;
-
- case 0x4C: /* BGR 2:3:3 */
- CopyFlat(buf, (CARD8 *) pGlint->FbBase +
- GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset),
- width << 0, height, pPPriv->BufferStride);
- pPPriv->Format = FORMAT_BGR332;
- pPPriv->Bpp_shift = 0;
- break;
- default:
- return XvBadAlloc;
- }
- /* We sync the chip. */
- if (pGlint->MultiAperture) DualPermedia3Sync(pScrn);
- else Permedia3Sync(pScrn);
- /* Don't know why we need this,
- * but the server will crash if i remove it. */
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
- "Starting the overlay.\n");
+#if SUPPORT_CLIPPING
+ /* Clipping*/
+ Clip (pPPriv, clipBoxes);
+#endif
/* We start the overlay */
- BeginOverlay(pPPriv, copy, pPPriv->Bpp_shift, extent);
+ BeginOverlay(pPPriv, copy);
- /* We sync the chip again. */
- if (sync) {
- if (pGlint->MultiAperture) DualPermedia3Sync(pScrn);
- else Permedia3Sync(pScrn);
- }
+ /* We sync the chip again (if needed). */
+ if (sync) pPPriv->Sync(pScrn);
return Success;
}
@@ -953,6 +1167,7 @@ Permedia3StopVideo(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
"StopVideo : exit=%d\n", cleanup));
+ REGION_EMPTY(pScrn->pScreen, &pPPriv->clip);
StopOverlay(pPPriv, cleanup);
if (cleanup) {
@@ -966,7 +1181,6 @@ Permedia3SetPortAttribute(ScrnInfoPtr pScrn,
{
PortPrivPtr pPPriv = (PortPrivPtr) data;
- /* Note, we could decode and store attributes directly here */
if (attribute == xvFilter) {
switch (value) {
case 0: /* No Filtering */
@@ -975,17 +1189,20 @@ Permedia3SetPortAttribute(ScrnInfoPtr pScrn,
~PM3VideoOverlayMode_FILTER_MASK) |
PM3VideoOverlayMode_FILTER_OFF;
break;
- case 1: /* No Filtering */
+ case 1: /* Partial Filtering (X axis only) */
pPPriv->OverlayMode =
(pPPriv->OverlayMode &
~PM3VideoOverlayMode_FILTER_MASK) |
PM3VideoOverlayMode_FILTER_PARTIAL;
break;
- case 2: /* No Filtering */
+ case 2: /* Full Bilinear Filtering */
+ /* We have to disable X mirroring also */
pPPriv->OverlayMode =
(pPPriv->OverlayMode &
- ~PM3VideoOverlayMode_FILTER_MASK) |
+ ~(PM3VideoOverlayMode_FILTER_MASK |
+ PM3VideoOverlayMode_MIRRORX_ON)) |
PM3VideoOverlayMode_FILTER_FULL;
+ pPPriv->Attribute[1] &= 2;
break;
default:
return BadValue;
@@ -1002,11 +1219,23 @@ Permedia3SetPortAttribute(ScrnInfoPtr pScrn,
PM3VideoOverlayMode_MIRRORY_OFF;
break;
case 1: /* X Axis Mirroring */
- pPPriv->OverlayMode =
- (pPPriv->OverlayMode &
- ~PM3VideoOverlayMode_MIRROR_MASK) |
- PM3VideoOverlayMode_MIRRORX_ON |
- PM3VideoOverlayMode_MIRRORY_OFF;
+ /* If full filtering was enabled, rever to partial. */
+ if (pPPriv->Attribute[0] == 2) {
+ pPPriv->OverlayMode =
+ (pPPriv->OverlayMode &
+ ~(PM3VideoOverlayMode_MIRROR_MASK |
+ PM3VideoOverlayMode_FILTER_MASK)) |
+ PM3VideoOverlayMode_MIRRORX_ON |
+ PM3VideoOverlayMode_MIRRORY_OFF |
+ PM3VideoOverlayMode_FILTER_PARTIAL;
+ pPPriv->Attribute[0] = 1;
+ } else {
+ pPPriv->OverlayMode =
+ (pPPriv->OverlayMode &
+ ~PM3VideoOverlayMode_MIRROR_MASK) |
+ PM3VideoOverlayMode_MIRRORX_ON |
+ PM3VideoOverlayMode_MIRRORY_OFF;
+ }
break;
case 2: /* Y Axis Mirroring */
pPPriv->OverlayMode =
@@ -1016,73 +1245,33 @@ Permedia3SetPortAttribute(ScrnInfoPtr pScrn,
PM3VideoOverlayMode_MIRRORY_ON;
break;
case 3: /* X and Y Axis Mirroring */
- pPPriv->OverlayMode =
- (pPPriv->OverlayMode &
- ~PM3VideoOverlayMode_MIRROR_MASK) |
- PM3VideoOverlayMode_MIRRORX_ON |
- PM3VideoOverlayMode_MIRRORY_ON;
+ /* If full filtering was enabled, rever to partial. */
+ if (pPPriv->Attribute[0] == 2) {
+ pPPriv->OverlayMode =
+ (pPPriv->OverlayMode &
+ ~(PM3VideoOverlayMode_MIRROR_MASK |
+ PM3VideoOverlayMode_FILTER_MASK)) |
+ PM3VideoOverlayMode_MIRRORX_ON |
+ PM3VideoOverlayMode_MIRRORY_ON |
+ PM3VideoOverlayMode_FILTER_PARTIAL;
+ pPPriv->Attribute[0] = 1;
+ } else {
+ pPPriv->OverlayMode =
+ (pPPriv->OverlayMode &
+ ~PM3VideoOverlayMode_MIRROR_MASK) |
+ PM3VideoOverlayMode_MIRRORX_ON |
+ PM3VideoOverlayMode_MIRRORY_ON;
+ }
break;
default:
return BadValue;
}
pPPriv->Attribute[1] = value;
}
- else if (attribute == xvOverlayMode) {
- pPPriv->OverlayControl =
- PM3RD_VideoOverlayControl_ENABLE;
- switch (value&&0xff) {
- case 0: /* Opaque video overlay */
- pPPriv->OverlayData =
- OVERLAY_DATA_NONE;
- pPPriv->OverlayControl =
- PM3RD_VideoOverlayControl_MODE_ALWAYS;
- break;
- case 1: /* Color keyed overlay, framebuffer color key */
- pPPriv->OverlayData =
- OVERLAY_DATA_COLORKEY;
- pPPriv->OverlayControl =
- /* color key in RGB 888 mode */
- ((value<<5)&0xffffff00) |
- PM3RD_VideoOverlayControl_MODE_MAINKEY |
- PM3RD_VideoOverlayControl_KEY_COLOR;
- break;
- case 2: /* Color keyed overlay, framebuffer alpha key */
- pPPriv->OverlayData =
- OVERLAY_DATA_ALPHAKEY;
- pPPriv->OverlayControl =
- /* 8 bit alpha key */
- ((value<<5)&0xff00) |
- PM3RD_VideoOverlayControl_MODE_MAINKEY |
- PM3RD_VideoOverlayControl_KEY_ALPHA;
- break;
- case 3: /* Color keyed overlay, overlay color key */
- pPPriv->OverlayData =
- OVERLAY_DATA_COLORKEY;
- pPPriv->OverlayControl =
- /* color key in RGB 888 mode */
- ((value<<5)&0xffffff00) |
- PM3RD_VideoOverlayControl_MODE_OVERLAYKEY;
- break;
- case 4: /* Per pixel alpha blending */
- pPPriv->OverlayData =
- OVERLAY_DATA_NONE;
- pPPriv->OverlayControl =
- PM3RD_VideoOverlayControl_MODE_BLEND |
- PM3RD_VideoOverlayControl_BLENDSRC_MAIN;
- break;
- case 5: /* Constant alpha blending */
- pPPriv->OverlayData =
- OVERLAY_DATA_ALPHABLEND;
- pPPriv->OverlayControl =
- /* 8 bit alpha blend factor
- * (only the 2 top bits are used) */
- ((value<<5)&0xff00) |
- PM3RD_VideoOverlayControl_MODE_BLEND |
- PM3RD_VideoOverlayControl_BLENDSRC_REGISTER;
- break;
- default:
- return BadValue;
- }
+ else if (attribute == xvAlpha) {
+ if (value >= 0 && value <= 3) {
+ pPPriv->OverlayAlpha = value << 6;
+ } else return BadValue;
pPPriv->Attribute[2] = value;
}
else return BadMatch;
@@ -1104,7 +1293,7 @@ Permedia3GetPortAttribute(ScrnInfoPtr pScrn,
*value = pPPriv->Attribute[0];
else if (attribute == xvMirror)
*value = pPPriv->Attribute[1];
- else if (attribute == xvOverlayMode)
+ else if (attribute == xvAlpha)
*value = pPPriv->Attribute[2];
else return BadMatch;
@@ -1204,6 +1393,7 @@ NewAdaptorPriv(ScrnInfoPtr pScrn)
{
AdaptorPrivPtr pAPriv = (AdaptorPrivPtr) xcalloc(1, sizeof(AdaptorPrivRec));
PortPrivPtr pPPriv = (PortPrivPtr) xcalloc(1, sizeof(PortPrivRec));
+ GLINTPtr pGlint = GLINTPTR(pScrn);
int i;
if (!pAPriv) return NULL;
@@ -1218,23 +1408,41 @@ NewAdaptorPriv(ScrnInfoPtr pScrn)
return NULL;
}
- /* Attributes */
pPPriv->pAdaptor = pAPriv;
- pPPriv->Attribute[0] = 0; /* Full filtering enabled */
+ /* Sync */
+ DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 2,
+ "Sync is using : %sPermedia3Sync.\n",
+ pGlint->MultiAperture?"Dual":""));
+ if (pGlint->MultiAperture) pPPriv->Sync = DualPermedia3Sync;
+ else pPPriv->Sync = Permedia3Sync;
+
+ /* Framebuffer bpp shift */
+ pPPriv->FB_Shift = pScrn->bitsPerPixel >> 4;
+
+ /* Attributes */
+ pPPriv->Attribute[0] = 2; /* Full filtering enabled */
pPPriv->Attribute[1] = 0; /* No mirroring */
- pPPriv->Attribute[2] = 0; /* Opaque overlay mode */
- pPPriv->OverlayData = 0;
+ pPPriv->Attribute[2] = 3; /* Opaque overlay mode */
+ pPPriv->ColorKey = 0;
+ pPPriv->OverlayAlpha =
+ PM3RD_VideoOverlayBlend_FACTOR_100_PERCENT;
pPPriv->OverlayMode =
PM3VideoOverlayMode_FILTER_FULL |
PM3VideoOverlayMode_MIRRORX_OFF |
PM3VideoOverlayMode_MIRRORY_OFF;
- pPPriv->OverlayControl =
- PM3RD_VideoOverlayControl_ENABLE |
- PM3RD_VideoOverlayControl_MODE_ALWAYS;
+
+ /* Clipping */
+ REGION_EMPTY(pScrn->pScreen, &pPPriv->clip);
+
+ /* RAMDAC saved values */
+ pPPriv->ramdac_x = 0;
+ pPPriv->ramdac_w = 0;
+ pPPriv->ramdac_y = 0;
+ pPPriv->ramdac_h = 0;
+ pPPriv->ramdac_on = FALSE;
/* Buffers */
pPPriv->Id = ScalerImages[0].id;
- pPPriv->Bpp = ScalerImages[0].bits_per_pixel;
pPPriv->copy = -1;
pPPriv->display = -1;
for (i = 0; i < MAX_BUFFERS; i++)
@@ -1267,10 +1475,15 @@ Permedia3VideoLeaveVT(ScrnInfoPtr pScrn)
void
Permedia3VideoUninit(ScrnInfoPtr pScrn)
{
- if (AdaptorPriv->pScrn == pScrn) {
- DeleteAdaptorPriv(AdaptorPriv);
- AdaptorPriv = NULL;
- }
+ AdaptorPrivPtr pAPriv, *ppAPriv;
+
+ for (ppAPriv = &AdaptorPrivList; (pAPriv = *ppAPriv); ppAPriv = &(pAPriv->Next))
+ if (pAPriv->pScrn == pScrn) {
+ *ppAPriv = pAPriv->Next;
+ DeleteAdaptorPriv(pAPriv);
+ break;
+ }
+
DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 2, "Xv cleanup\n"));
}
@@ -1286,9 +1499,15 @@ Permedia3VideoInit(ScreenPtr pScreen)
switch (pGlint->Chipset) {
case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3:
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 1,
+ "Using the Permedia3 chipset.\n");
break;
case PCI_VENDOR_3DLABS_CHIP_GAMMA:
- if (pGlint->MultiChip == PCI_CHIP_PERMEDIA3) break;
+ if (pGlint->MultiChip == PCI_CHIP_PERMEDIA3) {
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 1,
+ "Using the Gamma chipset.\n");
+ break;
+ }
default:
xf86DrvMsgVerb(pScrn->scrnIndex, X_ERROR, 1,
"No Xv support for chipset %d.\n", pGlint->Chipset);
@@ -1299,14 +1518,9 @@ Permedia3VideoInit(ScreenPtr pScreen)
"Initializing Permedia3 Xv driver rev. 1\n");
if (pGlint->NoAccel) {
- xf86DrvMsgVerb(pScrn->scrnIndex, X_ERROR, 1,
- "Xv : Sorry, Xv is not supported without accelerations");
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Xv initialization failed : XAA is needed\n");
return;
-#if 0 /* This works, but crashes the X server after a time. */
- xf86DrvMsgVerb(pScrn->scrnIndex, X_ERROR, 1,
- "Xv : Acceleration disabled, starting offscreen memory manager\n.");
- Permedia3EnableOffscreen (pScreen);
-#endif
}
if (!(pAPriv = NewAdaptorPriv(pScrn))) {
@@ -1321,7 +1535,7 @@ Permedia3VideoInit(ScreenPtr pScreen)
VARPtrs = &VAR;
VAR.type = XvInputMask | XvWindowMask | XvImageMask;
- VAR.flags = VIDEO_OVERLAID_IMAGES;
+ VAR.flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
VAR.name = "Permedia 3 Frontend Scaler";
VAR.nEncodings = ENTRIES(ScalerEncodings);
VAR.pEncodings = ScalerEncodings;
@@ -1349,12 +1563,15 @@ Permedia3VideoInit(ScreenPtr pScreen)
if (xf86XVScreenInit(pScreen, &VARPtrs, 1)) {
xvFilter = MAKE_ATOM(XV_FILTER);
xvMirror = MAKE_ATOM(XV_MIRROR);
- xvOverlayMode = MAKE_ATOM(XV_OVERLAY_MODE);
+ xvAlpha = MAKE_ATOM(XV_ALPHA);
- /* Add it to the AdaptatorList */
- AdaptorPriv = pAPriv;
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Xv frontend scaler enabled\n");
+#if USE_HARDWARE_COPY
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Xv frontend scaler enabled (HW)\n");
+#else
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Xv frontend scaler enabled (SW)\n");
+#endif
} else {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Xv initialization failed\n");
DeleteAdaptorPriv(pAPriv);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c
index d168c1c4b..6f54484b0 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c
@@ -28,7 +28,7 @@
*
* Permedia accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c,v 1.21 2001/01/31 16:15:02 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c,v 1.21.2.2 2001/05/29 11:32:23 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -102,8 +102,6 @@ static void PermediaPolylinesThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC,
static void PermediaPolySegmentThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC,
int nseg, xSegment *pSeg);
-#define MAX_FIFO_ENTRIES 15
-
void
PermediaInitializeEngine(ScrnInfoPtr pScrn)
{
@@ -217,8 +215,7 @@ PermediaAccelInit(ScreenPtr pScreen)
infoPtr->PolySegmentThinSolid = PermediaPolySegmentThinSolidWrapper;
infoPtr->PolylinesThinSolid = PermediaPolylinesThinSolidWrapper;
- infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY |
- ONLY_LEFT_TO_RIGHT_BITBLT;
+ infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY;
infoPtr->SetupForScreenToScreenCopy = PermediaSetupForScreenToScreenCopy;
infoPtr->SubsequentScreenToScreenCopy = PermediaSubsequentScreenToScreenCopy;
@@ -240,14 +237,14 @@ PermediaAccelInit(ScreenPtr pScreen)
#endif
BIT_ORDER_IN_BYTE_LSBFIRST;
- pGlint->XAAScanlineColorExpandBuffers[0] =
- xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
- pGlint->XAAScanlineColorExpandBuffers[1] =
- xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
-
- infoPtr->NumScanlineColorExpandBuffers = 2;
+ infoPtr->NumScanlineColorExpandBuffers = 1;
+ pGlint->ScratchBuffer = xalloc(((pScrn->virtualX+62)/32*4)
+ + (pScrn->virtualX
+ * pScrn->bitsPerPixel / 8));
infoPtr->ScanlineColorExpandBuffers =
pGlint->XAAScanlineColorExpandBuffers;
+ pGlint->XAAScanlineColorExpandBuffers[0] =
+ pGlint->IOBase + OutputFIFO + 4;
infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
PermediaSetupForScanlineCPUToScreenColorExpandFill;
@@ -256,7 +253,7 @@ PermediaAccelInit(ScreenPtr pScreen)
infoPtr->SubsequentColorExpandScanline =
PermediaSubsequentColorExpandScanline;
- infoPtr->ColorExpandRange = MAX_FIFO_ENTRIES;
+ infoPtr->ColorExpandRange = pGlint->FIFOSize;
infoPtr->WriteBitmap = PermediaWriteBitmap;
@@ -553,15 +550,11 @@ PermediaWriteBitmap(ScrnInfoPtr pScrn,
register CARD32* pattern;
int dobackground = 0;
- skipleft = 0;
-
w += skipleft;
x -= skipleft;
dwords = (w + 31) >> 5;
-#if 0
PermediaSetClippingRectangle(pScrn, x+skipleft, y, x+w, y+h);
-#endif
GLINT_WAIT(14);
DO_PLANEMASK(planemask);
@@ -620,6 +613,7 @@ PermediaWriteBitmap(ScrnInfoPtr pScrn,
srcpntr += srcwidth;
}
+ PermediaDisableClipping(pScrn);
SET_SYNC_FLAG(infoRec);
}
@@ -678,50 +672,60 @@ PermediaSubsequentScanlineCPUToScreenColorExpandFill(
PermediaSetClippingRectangle(pScrn, x+skipleft, y, x+w, y+h);
#endif
- pGlint->cpucount = y;
- pGlint->cpuheight = h;
+ pGlint->cpucount = h;
- GLINT_WAIT(6);
- PermediaLoadCoord(pScrn, x<<16, y<<16, (x+w)<<16, 1, 0, 1<<16);
+ GLINT_WAIT(8);
+ PermediaLoadCoord(pScrn, x<<16, y<<16, (x+w)<<16, h, 0, 1<<16);
+ GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask,
+ Render);
+#if defined(__alpha__)
+ if (0) /* force Alpha to use indirect always */
+#else
+ if ((pGlint->dwords*h) < pGlint->FIFOSize)
+#endif
+ {
+ /* Turn on direct for less than FIFOSize dword colour expansion */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->IOBase+OutputFIFO+4;
+ pGlint->ScanlineDirect = 1;
+ GLINT_WRITE_REG(((pGlint->dwords*h)-1)<<16 | 0x0D, OutputFIFO);
+ GLINT_WAIT(pGlint->dwords*h);
+ } else {
+ /* Use indirect for anything else */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->ScratchBuffer;
+ pGlint->ScanlineDirect = 0;
+ }
+
+ pGlint->cpucount--;
}
static void
PermediaSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
GLINTPtr pGlint = GLINTPTR(pScrn);
- CARD32 *src;
+ CARD32 *srcp = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno];
int dwords = pGlint->dwords;
- GLINT_WAIT(7);
- PermediaLoadCoord(pScrn, pGlint->startxdom, pGlint->cpucount<<16, pGlint->startxsub, 1, 0, 1<<16);
-
- GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask,
- Render);
- dwords = pGlint->dwords;
-
- src = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno];
- while (dwords >= infoRec->ColorExpandRange) {
- GLINT_WAIT(infoRec->ColorExpandRange);
- GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO);
- GLINT_MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- src, infoRec->ColorExpandRange - 1);
- dwords -= (infoRec->ColorExpandRange - 1);
- src += (infoRec->ColorExpandRange - 1);
- }
- if (dwords) {
- GLINT_WAIT(dwords);
- GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO);
- GLINT_MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- src,dwords);
+ if (!pGlint->ScanlineDirect) {
+ while(dwords >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ dwords -= pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
+ }
+ if(dwords) {
+ GLINT_WAIT(dwords + 1);
+ GLINT_WRITE_REG(((dwords - 1) << 16) | 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, dwords);
+ }
}
- pGlint->cpucount += 1;
-#if 0
- if (pGlint->cpucount == (pGlint->cpuheight + 1))
- CHECKCLIPPING;
-#endif
}
+
static void
PermediaWritePixmap8bpp(
ScrnInfoPtr pScrn,
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c
index acc329ef2..35c01c120 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c
@@ -27,7 +27,7 @@
* this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and
* Siemens Nixdorf Informationssysteme
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c,v 1.9 2001/02/07 13:26:21 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c,v 1.9.2.1 2001/05/24 20:12:48 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -55,8 +55,8 @@ PermediaInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
pReg->glintRegs[PMFramebufferWriteMask >> 3] = 0xFFFFFFFF;
pReg->glintRegs[PMBypassWriteMask >> 3] = 0xFFFFFFFF;
- pReg->glintRegs[DFIFODis >> 3] = 0;
- pReg->glintRegs[FIFODis >> 3] = 1;
+ pReg->glintRegs[DFIFODis >> 3] = 1;
+ pReg->glintRegs[FIFODis >> 3] = 3;
temp1 = mode->CrtcHSyncStart - mode->CrtcHDisplay;
temp2 = mode->CrtcVSyncStart - mode->CrtcVDisplay;
@@ -122,6 +122,7 @@ PermediaInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
ramdacReg->DacRegs[IBMRGB_misc2] |= PCLK_SEL_LCLK;
else
ramdacReg->DacRegs[IBMRGB_misc2] |= PCLK_SEL_PLL;
+ ramdacReg->DacRegs[IBMRGB_misc3] = 0;
ramdacReg->DacRegs[IBMRGB_misc_clock] = 1;
ramdacReg->DacRegs[IBMRGB_sync] = 0;
ramdacReg->DacRegs[IBMRGB_hsync_pos] = 0;
@@ -139,6 +140,11 @@ PermediaSave(ScrnInfoPtr pScrn, GLINTRegPtr glintReg)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
+ /* We can't rely on the vgahw layer copying the font information
+ * back properly, due to problems with MMIO access to VGA space
+ * so we memcpy the information using the slow routines */
+ xf86SlowBcopy((CARD8*)pGlint->FbBase, (CARD8*)pGlint->VGAdata, 65536);
+
glintReg->glintRegs[Aperture0 >> 3] = GLINT_READ_REG(Aperture0);
glintReg->glintRegs[Aperture1 >> 3] = GLINT_READ_REG(Aperture1);
glintReg->glintRegs[PMFramebufferWriteMask] =
@@ -169,6 +175,12 @@ PermediaRestore(ScrnInfoPtr pScrn, GLINTRegPtr pReg)
{
GLINTPtr pGlint = GLINTPTR(pScrn);
+ /* We can't rely on the vgahw layer copying the font information
+ * back properly, due to problems with MMIO access to VGA space
+ * so we memcpy the information using the slow routines */
+ if (pGlint->STATE)
+ xf86SlowBcopy((CARD8*)pGlint->VGAdata, (CARD8*)pGlint->FbBase, 65536);
+
RESTOREREG(ChipConfig);
RESTOREREG(DFIFODis);
RESTOREREG(FIFODis);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c
index ed833ea72..26f51107e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c
@@ -28,7 +28,7 @@
*
* GLINT 300SX accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c,v 1.6 2001/04/19 09:28:32 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c,v 1.6.2.1 2001/05/29 11:32:23 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -215,14 +215,14 @@ SXAccelInit(ScreenPtr pScreen)
TRANSPARENCY_ONLY |
BIT_ORDER_IN_BYTE_LSBFIRST;
- pGlint->XAAScanlineColorExpandBuffers[0] =
- xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
- pGlint->XAAScanlineColorExpandBuffers[1] =
- xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
-
- infoPtr->NumScanlineColorExpandBuffers = 2;
+ infoPtr->NumScanlineColorExpandBuffers = 1;
+ pGlint->ScratchBuffer = xalloc(((pScrn->virtualX+62)/32*4)
+ + (pScrn->virtualX
+ * pScrn->bitsPerPixel / 8));
infoPtr->ScanlineColorExpandBuffers =
pGlint->XAAScanlineColorExpandBuffers;
+ pGlint->XAAScanlineColorExpandBuffers[0] =
+ pGlint->IOBase + OutputFIFO + 4;
infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
SXSetupForScanlineCPUToScreenColorExpandFill;
@@ -244,6 +244,8 @@ SXAccelInit(ScreenPtr pScreen)
AvailFBArea.y2 = memory / (pScrn->displayWidth *
pScrn->bitsPerPixel / 8);
+ if (AvailFBArea.y2 > 2047) AvailFBArea.y2 = 2047;
+
xf86InitFBManager(pScreen, &AvailFBArea);
return (XAAInit(pScreen, infoPtr));
@@ -457,43 +459,57 @@ SXSubsequentScanlineCPUToScreenColorExpandFill(
pGlint->dwords = ((w + 31) >> 5); /* dwords per scanline */
- pGlint->cpucount = y;
- pGlint->cpuheight = h;
- GLINT_WAIT(6);
- SXLoadCoord(pScrn, x, pGlint->cpucount, x+w, 1, 0, 1);
+ pGlint->cpucount = h;
+
+ GLINT_WAIT(8);
+ SXLoadCoord(pScrn, x, y, x+w, 1, 0, 1);
+ GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask,
+ Render);
+#if defined(__alpha__)
+ if (0) /* force Alpha to use indirect always */
+#else
+ if ((pGlint->dwords*h) < pGlint->FIFOSize)
+#endif
+ {
+ /* Turn on direct for less than FIFOSize dword colour expansion */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->IOBase+OutputFIFO+4;
+ pGlint->ScanlineDirect = 1;
+ GLINT_WRITE_REG(((pGlint->dwords*h)-1)<<16 | 0x0D, OutputFIFO);
+ GLINT_WAIT(pGlint->dwords*h);
+ } else {
+ /* Use indirect for anything else */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->ScratchBuffer;
+ pGlint->ScanlineDirect = 0;
+ }
+
+ pGlint->cpucount--;
}
static void
SXSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
GLINTPtr pGlint = GLINTPTR(pScrn);
- CARD32 *src;
+ CARD32 *srcp = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno];
int dwords = pGlint->dwords;
- GLINT_WAIT(7);
- SXLoadCoord(pScrn, pGlint->startxdom, pGlint->cpucount, pGlint->startxsub, 1, 0, 1);
-
- GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask,
- Render);
-
- src = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno];
- while (dwords >= infoRec->ColorExpandRange) {
- GLINT_WAIT(infoRec->ColorExpandRange);
- GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO);
- GLINT_MoveDWORDS(
- (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,
- infoRec->ColorExpandRange - 1);
- dwords -= (infoRec->ColorExpandRange - 1);
- src += (infoRec->ColorExpandRange - 1);
- }
- if (dwords) {
- GLINT_WAIT(dwords);
- GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO);
- GLINT_MoveDWORDS(
- (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords);
+ if (!pGlint->ScanlineDirect) {
+ while(dwords >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ dwords -= pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
+ }
+ if(dwords) {
+ GLINT_WAIT(dwords + 1);
+ GLINT_WRITE_REG(((dwords - 1) << 16) | 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, dwords);
+ }
}
- pGlint->cpucount += 1;
}
void SXSetupForMono8x8PatternFill(
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c
index 95db91fa7..271754097 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c
@@ -28,7 +28,7 @@
*
* GLINT 500TX / MX accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c,v 1.26 2001/04/19 09:28:32 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c,v 1.26.2.2 2001/05/30 10:08:19 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -94,8 +94,6 @@ static void TXPolylinesThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC,
static void TXPolySegmentThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC,
int nseg, xSegment *pSeg);
-#define MAX_FIFO_ENTRIES 15
-
void
TXInitializeEngine(ScrnInfoPtr pScrn)
{
@@ -252,14 +250,14 @@ TXAccelInit(ScreenPtr pScreen)
TRANSPARENCY_ONLY |
BIT_ORDER_IN_BYTE_LSBFIRST;
- pGlint->XAAScanlineColorExpandBuffers[0] =
- xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
- pGlint->XAAScanlineColorExpandBuffers[1] =
- xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
-
- infoPtr->NumScanlineColorExpandBuffers = 2;
+ infoPtr->NumScanlineColorExpandBuffers = 1;
+ pGlint->ScratchBuffer = xalloc(((pScrn->virtualX+62)/32*4)
+ + (pScrn->virtualX
+ * pScrn->bitsPerPixel / 8));
infoPtr->ScanlineColorExpandBuffers =
pGlint->XAAScanlineColorExpandBuffers;
+ pGlint->XAAScanlineColorExpandBuffers[0] =
+ pGlint->IOBase + OutputFIFO + 4;
infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
TXSetupForScanlineCPUToScreenColorExpandFill;
@@ -268,7 +266,7 @@ TXAccelInit(ScreenPtr pScreen)
infoPtr->SubsequentColorExpandScanline =
TXSubsequentColorExpandScanline;
- infoPtr->ColorExpandRange = MAX_FIFO_ENTRIES;
+ infoPtr->ColorExpandRange = pGlint->FIFOSize;
infoPtr->WriteBitmap = TXWriteBitmap;
infoPtr->WritePixmap = TXWritePixmap;
@@ -280,6 +278,8 @@ TXAccelInit(ScreenPtr pScreen)
AvailFBArea.y2 = memory / (pScrn->displayWidth *
pScrn->bitsPerPixel / 8);
+ if (AvailFBArea.y2 > 4095) AvailFBArea.y2 = 4095;
+
xf86InitFBManager(pScreen, &AvailFBArea);
return (XAAInit(pScreen, infoPtr));
@@ -537,43 +537,57 @@ TXSubsequentScanlineCPUToScreenColorExpandFill(
pGlint->dwords = ((w + 31) >> 5); /* dwords per scanline */
- pGlint->cpucount = y;
- pGlint->cpuheight = h;
- GLINT_WAIT(6);
- TXLoadCoord(pScrn, x, pGlint->cpucount, x+w, 1, 0, 1);
+ pGlint->cpucount = h;
+
+ GLINT_WAIT(8);
+ TXLoadCoord(pScrn, x, y, (x+w), h, 0, 1);
+ GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask,
+ Render);
+#if defined(__alpha__)
+ if (0) /* force Alpha to use indirect always */
+#else
+ if ((pGlint->dwords*h) < pGlint->FIFOSize)
+#endif
+ {
+ /* Turn on direct for less than FIFOSize dword colour expansion */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->IOBase+OutputFIFO+4;
+ pGlint->ScanlineDirect = 1;
+ GLINT_WRITE_REG(((pGlint->dwords*h)-1)<<16 | 0x0D, OutputFIFO);
+ GLINT_WAIT(pGlint->dwords*h);
+ } else {
+ /* Use indirect for anything else */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->ScratchBuffer;
+ pGlint->ScanlineDirect = 0;
+ }
+
+ pGlint->cpucount--;
}
static void
TXSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
GLINTPtr pGlint = GLINTPTR(pScrn);
- CARD32 *src;
+ CARD32 *srcp = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno];
int dwords = pGlint->dwords;
- GLINT_WAIT(7);
- TXLoadCoord(pScrn, pGlint->startxdom, pGlint->cpucount, pGlint->startxsub, 1, 0, 1);
-
- GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask,
- Render);
-
- src = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno];
- while (dwords >= infoRec->ColorExpandRange) {
- GLINT_WAIT(infoRec->ColorExpandRange);
- GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO);
- GLINT_MoveDWORDS(
- (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,
- infoRec->ColorExpandRange - 1);
- dwords -= (infoRec->ColorExpandRange - 1);
- src += (infoRec->ColorExpandRange - 1);
- }
- if (dwords) {
- GLINT_WAIT(dwords);
- GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO);
- GLINT_MoveDWORDS(
- (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords);
+ if (!pGlint->ScanlineDirect) {
+ while(dwords >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ dwords -= pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
+ }
+ if(dwords) {
+ GLINT_WAIT(dwords + 1);
+ GLINT_WRITE_REG(((dwords - 1) << 16) | 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, dwords);
+ }
}
- pGlint->cpucount += 1;
}
void TXSetupForMono8x8PatternFill(
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c
index b33ca8ced..9cd969b0a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c
@@ -27,7 +27,7 @@
* this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and
* Siemens Nixdorf Informationssysteme
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c,v 1.13 2001/04/19 09:28:32 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c,v 1.13.2.2 2001/05/29 11:32:23 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -155,11 +155,16 @@ TXInit(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg)
STOREREG(VTGModeCtl, 0x44);
}
- if (IS_GMX2000 || IS_GLORIAXXL)
+ if (IS_GMX2000 || IS_GLORIAXXL) {
STOREREG(FBMemoryCtl, 0x800); /* Optimum memory timings */
+ } else {
+ STOREREG(FBMemoryCtl, GLINT_READ_REG(FBMemoryCtl));
+ }
/* Override FBModeSel for 300SX chip */
- if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) {
+ if ( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) ||
+ ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) &&
+ (pGlint->MultiChip == PCI_CHIP_300SX)) ) {
switch (pScrn->bitsPerPixel) {
case 8:
STOREREG(FBModeSel, 0x905);
@@ -236,7 +241,7 @@ TXInit(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg)
STORERAMDAC(RGB640_VGA_CONTROL, temp1);
STORERAMDAC(RGB640_DAC_CONTROL, IBM640_DACENBL | IBM640_SHUNT);
- STORERAMDAC(RGB640_OUTPUT_CONTROL, IBM640_WATCTL);
+ STORERAMDAC(RGB640_OUTPUT_CONTROL, IBM640_RDAI | IBM640_WATCTL);
STORERAMDAC(RGB640_SYNC_CONTROL, 0x00);
STORERAMDAC(RGB640_VRAM_MASK0, 0xFF);
STORERAMDAC(RGB640_VRAM_MASK1, 0xFF);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h
index 031111ff7..fd03ef703 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h,v 1.5 2001/04/01 14:00:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h,v 1.6 2001/05/04 19:05:39 dawes Exp $ */
/*
* Number Nine I128 functions
*
@@ -99,6 +99,8 @@ typedef struct {
unsigned int (*ddc1Read)(ScrnInfoPtr);
Bool (*i2cInit)(ScrnInfoPtr);
+ OptionInfoPtr Options;
+
} I128Rec, *I128Ptr;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c
index 91aed1167..0e158c379 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c
@@ -22,7 +22,7 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c,v 1.19 2001/04/01 14:00:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c,v 1.20 2001/05/04 19:05:39 dawes Exp $ */
/* All drivers should typically include these */
@@ -71,7 +71,7 @@
*/
/* Mandatory functions */
-static OptionInfoPtr I128AvailableOptions(int chipid, int busid);
+static const OptionInfoRec * I128AvailableOptions(int chipid, int busid);
static void I128Identify(int flags);
static Bool I128Probe(DriverPtr drv, int flags);
static Bool I128PreInit(ScrnInfoPtr pScrn, int flags);
@@ -460,7 +460,7 @@ typedef enum {
OPTION_DEBUG
} I128Opts;
-static OptionInfoRec I128Options[] = {
+static const OptionInfoRec I128Options[] = {
{ OPTION_FLATPANEL, "FlatPanel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
@@ -482,10 +482,10 @@ static OptionInfoRec I128Options[] = {
* int chipid - currently unused
* int busid - currently unused
* Returns:
- * OptionInfoPtr - all accepted options
+ * const OptionInfoRec * - all accepted options
*/
-static OptionInfoPtr
+static const OptionInfoRec *
I128AvailableOptions(int chipid, int busid)
{
return I128Options;
@@ -637,7 +637,10 @@ I128PreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, I128Options);
+ if (!(pI128->Options = xalloc(sizeof(I128Options))))
+ return FALSE;
+ memcpy(pI128->Options, I128Options, sizeof(I128Options));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pI128->Options);
if (pScrn->depth == 8)
pScrn->rgbBits = 8;
@@ -648,38 +651,38 @@ I128PreInit(ScrnInfoPtr pScrn, int flags)
*/
from = X_DEFAULT;
pI128->HWCursor = TRUE;
- if (xf86GetOptValBool(I128Options, OPTION_HW_CURSOR, &pI128->HWCursor)) {
+ if (xf86GetOptValBool(pI128->Options, OPTION_HW_CURSOR, &pI128->HWCursor)) {
from = X_CONFIG;
}
/* For compatibility, accept this too (as an override) */
- if (xf86ReturnOptValBool(I128Options, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(pI128->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pI128->HWCursor = FALSE;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pI128->HWCursor ? "HW" : "SW");
- if (xf86ReturnOptValBool(I128Options, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pI128->Options, OPTION_NOACCEL, FALSE)) {
pI128->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
} else pI128->NoAccel = FALSE;
- if (xf86ReturnOptValBool(I128Options, OPTION_SYNC_ON_GREEN, FALSE)) {
+ if (xf86ReturnOptValBool(pI128->Options, OPTION_SYNC_ON_GREEN, FALSE)) {
pI128->DACSyncOnGreen = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Sync-on-Green enabled\n");
} else pI128->DACSyncOnGreen = FALSE;
- if (xf86ReturnOptValBool(I128Options, OPTION_SHOWCACHE, FALSE)) {
+ if (xf86ReturnOptValBool(pI128->Options, OPTION_SHOWCACHE, FALSE)) {
pI128->ShowCache = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n");
} else pI128->ShowCache = FALSE;
- if (xf86ReturnOptValBool(I128Options, OPTION_DAC6BIT, FALSE)) {
+ if (xf86ReturnOptValBool(pI128->Options, OPTION_DAC6BIT, FALSE)) {
pI128->DAC8Bit = FALSE;
pScrn->rgbBits = 6;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Dac6Bit enabled\n");
} else pI128->DAC8Bit = TRUE;
- if (xf86ReturnOptValBool(I128Options, OPTION_DEBUG, FALSE)) {
+ if (xf86ReturnOptValBool(pI128->Options, OPTION_DEBUG, FALSE)) {
pI128->Debug = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Debug enabled\n");
} else pI128->Debug = FALSE;
- if (xf86ReturnOptValBool(I128Options, OPTION_FLATPANEL, FALSE)) {
+ if (xf86ReturnOptValBool(pI128->Options, OPTION_FLATPANEL, FALSE)) {
pI128->FlatPanel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "FlatPanel forced\n");
} else pI128->FlatPanel = FALSE;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile
index 2512d44e2..fa000dacc 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile,v 1.7 2001/01/24 00:06:19 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile,v 1.8 2001/05/15 10:19:38 eich Exp $
XCOMM
XCOMM This is the Imakefile for the i740 driver.
XCOMM
@@ -18,7 +18,7 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
-I$(XF86SRC)/xaa -I$(XF86SRC)/rac \
-I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \
-I$(XF86SRC)/vgahw -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \
- -I$(SERVERSRC)/Xext -I$(XF86OSSRC)/vbe \
+ -I$(SERVERSRC)/Xext -I$(XF86OSSRC)/vbe -I$(SERVERSRC)/fb\
-I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(EXTINCSRC) -I$(XF86SRC)/int10 -I$(SERVERSRC)/render
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h b/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h
index 96f33f1fd..bac445ed1 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h
@@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h,v 1.3 2000/02/23 04:47:12 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h,v 1.4 2001/05/04 19:05:39 dawes Exp $ */
/*
* Authors:
@@ -113,6 +113,7 @@ typedef struct _I740Rec {
I740ReadIndexedByteFunc readControl;
I740WriteByteFunc writeStandard;
I740ReadByteFunc readStandard;
+ OptionInfoPtr Options;
} I740Rec;
#define I740PTR(p) ((I740Ptr)((p)->driverPrivate))
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c
index 4dfb370d8..1cf9ed5b7 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c
@@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c,v 1.28 2001/01/21 21:19:27 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c,v 1.30 2001/05/15 10:19:38 eich Exp $ */
/*
* Authors:
@@ -71,6 +71,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "micmap.h"
+#define USE_FB
+
+#ifdef USE_FB
+#include "fb.h"
+#else
/* Drivers using cfb need: */
#define PSZ 8
@@ -82,6 +87,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "cfb16.h"
#include "cfb24.h"
#include "cfb32.h"
+#endif
/* The driver's own header file: */
@@ -95,7 +101,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "vbe.h"
/* Required Functions: */
-static OptionInfoPtr I740AvailableOptions(int chipid, int busid);
+static const OptionInfoRec * I740AvailableOptions(int chipid, int busid);
/* Print a driver identifying message. */
static void I740Identify(int flags);
@@ -137,6 +143,8 @@ static int I740ValidMode(int scrnIndex, DisplayModePtr mode, Bool
static void I740DisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagermentMode, int flags);
+static void I740ProbeDDC(ScrnInfoPtr pScrn, int index);
+
#define VERSION 4000
#define I740_NAME "I740"
#define I740_DRIVER_NAME "i740"
@@ -177,7 +185,7 @@ typedef enum {
OPTION_USE_PIO
} I740Opts;
-static OptionInfoRec I740Options[] = {
+static const OptionInfoRec I740Options[] = {
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SDRAM, "SDRAM", OPTV_BOOLEAN, {0}, FALSE},
@@ -205,11 +213,16 @@ static const char *vgahwSymbols[] = {
0
};
-static const char *cfbSymbols[] = {
+static const char *fbSymbols[] = {
+#ifdef USE_FB
+ "fbScreenInit",
+ "fbPictureInit",
+#else
"cfbScreenInit",
"cfb16ScreenInit",
"cfb24ScreenInit",
"cfb32ScreenInit",
+#endif
"cfb8_32ScreenInit",
"cfb24_32ScreenInit",
NULL
@@ -284,7 +297,7 @@ i740Setup(pointer module, pointer opts, int *errmaj, int *errmin)
* Tell the loader about symbols from other modules that this module
* might refer to.
*/
- LoaderRefSymLists(vgahwSymbols, cfbSymbols, xaaSymbols,
+ LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols,
xf8_32bppSymbols, ramdacSymbols, vbeSymbols,
NULL /* ddcsymbols */, NULL /* i2csymbols */, NULL /* shadowSymbols */,
NULL /* fbdevsymbols */, NULL);
@@ -325,8 +338,7 @@ I740FreeRec(ScrnInfoPtr pScrn) {
pScrn->driverPrivate=0;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
I740AvailableOptions(int chipid, int busid)
{
return I740Options;
@@ -440,7 +452,7 @@ I740Probe(DriverPtr drv, int flags) {
return foundScreen;
}
-void
+static void
I740ProbeDDC(ScrnInfoPtr pScrn, int index)
{
vbeInfoPtr pVbe;
@@ -465,7 +477,9 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) {
int i;
MessageType from;
int temp;
+#ifndef USE_FB
char *mod=0, *reqSym=0;
+#endif
int flags24;
rgb defaultWeight = {0, 0, 0};
@@ -527,7 +541,7 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) {
xf86PrintDepthBpp(pScrn);
pScrn->rgbBits=8;
- if (xf86ReturnOptValBool(I740Options, OPTION_DAC_6BIT, FALSE))
+ if (xf86ReturnOptValBool(pI740->Options, OPTION_DAC_6BIT, FALSE))
pScrn->rgbBits=6;
if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight))
return FALSE;
@@ -552,13 +566,16 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) {
/* Process the options */
xf86CollectOptions(pScrn, NULL);
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, I740Options);
+ if (!(pI740->Options = xalloc(sizeof(I740Options))))
+ return FALSE;
+ memcpy(pI740->Options, I740Options, sizeof(I740Options));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pI740->Options);
/* 6-BIT dac isn't reasonable for modes with > 8bpp */
- if (xf86ReturnOptValBool(I740Options, OPTION_DAC_6BIT, FALSE) &&
+ if (xf86ReturnOptValBool(pI740->Options, OPTION_DAC_6BIT, FALSE) &&
pScrn->bitsPerPixel>8) {
OptionInfoPtr ptr;
- ptr=xf86TokenToOptinfo(I740Options, OPTION_DAC_6BIT);
+ ptr=xf86TokenToOptinfo(pI740->Options, OPTION_DAC_6BIT);
ptr->found=FALSE;
}
@@ -637,24 +654,24 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) {
temp=pI740->readControl(pI740, XRX, DRAM_ROW_CNTL_LO);
pI740->HasSGRAM = !((temp&DRAM_RAS_TIMING)||(temp&DRAM_RAS_PRECHARGE));
- if (xf86IsOptionSet(I740Options, OPTION_SDRAM)) {
- if (xf86IsOptionSet(I740Options, OPTION_SGRAM)) {
+ if (xf86IsOptionSet(pI740->Options, OPTION_SDRAM)) {
+ if (xf86IsOptionSet(pI740->Options, OPTION_SGRAM)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"It is nonsensical to set both SDRAM and SGRAM options\n");
return FALSE;
}
- if (xf86ReturnOptValBool(I740Options, OPTION_SDRAM, FALSE)) {
+ if (xf86ReturnOptValBool(pI740->Options, OPTION_SDRAM, FALSE)) {
pI740->HasSGRAM = FALSE;
} else {
pI740->HasSGRAM = TRUE;
}
} else {
- if (xf86IsOptionSet(I740Options, OPTION_SDRAM)) {
+ if (xf86IsOptionSet(pI740->Options, OPTION_SDRAM)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"It is nonsensical to set both SDRAM and SGRAM options\n");
return FALSE;
}
- if (xf86ReturnOptValBool(I740Options, OPTION_SGRAM, FALSE)) {
+ if (xf86ReturnOptValBool(pI740->Options, OPTION_SGRAM, FALSE)) {
pI740->HasSGRAM = TRUE;
} else {
pI740->HasSGRAM = FALSE;
@@ -751,6 +768,13 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) {
xf86SetDpi(pScrn, 0, 0);
+#ifdef USE_FB
+ if (!xf86LoadSubModule(pScrn, "fb")) {
+ I740FreeRec(pScrn);
+ return FALSE;
+ }
+ xf86LoaderReqSymbols("fbScreenInit","fbPictureInit", NULL);
+#else
switch (pScrn->bitsPerPixel) {
case 8:
mod = "cfb";
@@ -774,15 +798,16 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) {
return FALSE;
}
xf86LoaderReqSymbols(reqSym, NULL);
+#endif
- if (!xf86ReturnOptValBool(I740Options, OPTION_NOACCEL, FALSE)) {
+ if (!xf86ReturnOptValBool(pI740->Options, OPTION_NOACCEL, FALSE)) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
I740FreeRec(pScrn);
return FALSE;
}
}
- if (!xf86ReturnOptValBool(I740Options, OPTION_SW_CURSOR, FALSE)) {
+ if (!xf86ReturnOptValBool(pI740->Options, OPTION_SW_CURSOR, FALSE)) {
if (!xf86LoadSubModule(pScrn, "ramdac")) {
I740FreeRec(pScrn);
return FALSE;
@@ -791,7 +816,7 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) {
}
/* We wont be using the VGA access after the probe */
- if (!xf86ReturnOptValBool(I740Options, OPTION_USE_PIO, FALSE)) {
+ if (!xf86ReturnOptValBool(pI740->Options, OPTION_USE_PIO, FALSE)) {
resRange vgaio[] = { {ResShrIoBlock,0x3B0,0x3BB},
{ResShrIoBlock,0x3C0,0x3DF},
_END };
@@ -1284,7 +1309,7 @@ I740SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) {
}
/* Turn on 8 bit dac if requested */
- if (xf86ReturnOptValBool(I740Options, OPTION_DAC_6BIT, FALSE))
+ if (xf86ReturnOptValBool(pI740->Options, OPTION_DAC_6BIT, FALSE))
i740Reg->PixelPipeCfg0 = DAC_6_BIT;
else
i740Reg->PixelPipeCfg0 = DAC_8_BIT;
@@ -1301,7 +1326,7 @@ I740SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) {
i740Reg->DisplayControl = HIRES_MODE;
/* Set the MCLK freq */
- if (xf86ReturnOptValBool(I740Options, OPTION_SLOW_RAM, FALSE))
+ if (xf86ReturnOptValBool(pI740->Options, OPTION_SLOW_RAM, FALSE))
i740Reg->PLLControl = PLL_MEMCLK__66667KHZ; /* 66 MHz */
else
i740Reg->PLLControl = PLL_MEMCLK_100000KHZ; /* 100 MHz -- use as default */
@@ -1312,7 +1337,15 @@ I740SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) {
i740Reg->ExtVertSyncStart = mode->CrtcVSyncStart >> 8;
i740Reg->ExtVertBlankStart = mode->CrtcVBlankStart >> 8;
i740Reg->ExtHorizTotal = ((mode->CrtcHTotal >> 3) - 5) >> 8;
- i740Reg->ExtHorizBlank = ((mode->CrtcHSyncEnd >> 3) & 0x40) >> 6;
+ /*
+ * the KGA fix in vgaHW.c results in the first
+ * scanline and the first character clock (8 pixels)
+ * of each scanline thereafter on display with an i740
+ * to be blank. Restoring CRTC 3, 5, & 22 to their
+ * "theoretical" values corrects the problem. KAO.
+ */
+ i740Reg->ExtHorizBlank = vgaHWHBlankKGA(mode, pVga, 7, 0) << 6;
+ vgaHWVBlankKGA(mode, pVga, 8, 0);
/* Turn on interlaced mode if necessary */
if (mode->Flags & V_INTERLACE)
@@ -1346,7 +1379,6 @@ I740ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
vgaHWPtr hwp;
I740Ptr pI740;
- vgaRegPtr pVga;
hwp = VGAHWPTR(pScrn);
pI740 = I740PTR(pScrn);
@@ -1354,18 +1386,6 @@ I740ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
vgaHWUnlock(hwp);
if (!vgaHWInit(pScrn, mode)) return FALSE;
- /*
- * the KGA fix in vgaHW.c results in the first
- * scanline and the first character clock (8 pixels)
- * of each scanline thereafter on display with an i740
- * to be blank. Restoring CRTC 3, 5, & 22 to their
- * "theoretical" values corrects the problem. KAO.
- */
- pVga = &VGAHWPTR(pScrn)->ModeReg;
- pVga->CRTC[3] = (((mode->CrtcHBlankEnd >> 3) - 1) & 0x1F) | 0x80;
- pVga->CRTC[5] = ((((mode->CrtcHBlankEnd >> 3) - 1) & 0x20) << 2)
- | (((mode->CrtcHSyncEnd >> 3)) & 0x1F);
- pVga->CRTC[22] = (mode->CrtcVBlankEnd - 1) & 0xFF;
pScrn->vtSema = TRUE;
@@ -1461,8 +1481,23 @@ I740ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth),
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
+#ifdef USE_FB
+ if (!miSetPixmapDepths ()) return FALSE;
+#endif
switch (pScrn->bitsPerPixel) {
+#ifdef USE_FB
+ case 8:
+ case 16:
+ case 24:
+ case 32:
+ if (!fbScreenInit(pScreen, pI740->FbBase,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth,pScrn->bitsPerPixel))
+ return FALSE;
+ break;
+#else
case 8:
if (!cfbScreenInit(pScreen, pI740->FbBase,
pScrn->virtualX, pScrn->virtualY,
@@ -1491,12 +1526,16 @@ I740ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
pScrn->displayWidth))
return FALSE;
break;
+#endif
default:
xf86DrvMsg(scrnIndex, X_ERROR,
"Internal error: invalid bpp (%d) in I740ScrnInit\n",
pScrn->bitsPerPixel);
return FALSE;
}
+#ifdef USE_FB
+ fbPictureInit(pScreen,0,0);
+#endif
xf86SetBlackWhitePixels(pScreen);
@@ -1556,14 +1595,14 @@ I740ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
return FALSE;
}
- if (!xf86ReturnOptValBool(I740Options, OPTION_NOACCEL, FALSE)) {
+ if (!xf86ReturnOptValBool(pI740->Options, OPTION_NOACCEL, FALSE)) {
if (!I740AccelInit(pScreen)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Hardware acceleration initialization failed\n");
}
}
- if (!xf86ReturnOptValBool(I740Options, OPTION_SW_CURSOR, FALSE)) {
+ if (!xf86ReturnOptValBool(pI740->Options, OPTION_SW_CURSOR, FALSE)) {
if (!I740CursorInit(pScreen)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Hardware cursor initialization failed\n");
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h
index 4a28dafed..52c6a7b30 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h
@@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h,v 1.19 2000/12/01 14:28:56 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h,v 1.21 2001/05/19 00:26:44 dawes Exp $ */
/*
* Authors:
@@ -136,6 +136,8 @@ typedef struct _I810Rec {
unsigned char *MMIOBase;
unsigned char *FbBase;
long FbMapSize;
+ long DepthOffset;
+ long BackOffset;
int cpp;
int MaxClock;
@@ -230,6 +232,7 @@ typedef struct _I810Rec {
Bool agpAcquired2d;
XF86VideoAdaptorPtr adaptor;
+ OptionInfoPtr Options;
} I810Rec;
#define I810PTR(p) ((I810Ptr)((p)->driverPrivate))
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c
index 7bf02f271..ea56c9ae8 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.18 2001/04/10 16:08:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.21 2001/05/19 00:26:44 dawes Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -19,18 +19,18 @@ static char I810KernelDriverName[] = "i810";
static char I810ClientDriverName[] = "i810";
static Bool I810InitVisualConfigs(ScreenPtr pScreen);
-static Bool I810CreateContext(ScreenPtr pScreen, VisualPtr visual,
+static Bool I810CreateContext(ScreenPtr pScreen, VisualPtr visual,
drmContext hwContext, void *pVisualConfigPriv,
DRIContextType contextStore);
static void I810DestroyContext(ScreenPtr pScreen, drmContext hwContext,
DRIContextType contextStore);
-static void I810DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
- DRIContextType readContextType,
+static void I810DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
+ DRIContextType readContextType,
void *readContextStore,
- DRIContextType writeContextType,
+ DRIContextType writeContextType,
void *writeContextStore);
static void I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index);
-static void I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
+static void I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
RegionPtr prgnSrc, CARD32 index);
extern void GlxSetVisualConfigs(int nconfigs,
@@ -57,10 +57,10 @@ Bool I810CleanupDma(ScrnInfoPtr pScrn)
{
I810Ptr pI810 = I810PTR(pScrn);
Bool ret_val;
-
+
ret_val = drmI810CleanupDma(pI810->drmSubFD);
if (ret_val == FALSE)
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I810 Dma Cleanup Failed\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] I810 Dma Cleanup Failed\n");
return ret_val;
}
@@ -71,9 +71,9 @@ Bool I810InitDma(ScrnInfoPtr pScrn)
I810DRIPtr pI810DRI = (I810DRIPtr) pI810->pDRIInfo->devPrivate;
drmI810Init info;
Bool ret_val;
-
+
info.start = ring->mem.Start;
- info.end = ring->mem.End;
+ info.end = ring->mem.End;
info.size = ring->mem.Size;
info.mmio_offset = (unsigned int)pI810DRI->regs;
info.buffers_offset = (unsigned int)pI810->buffer_map;
@@ -88,7 +88,10 @@ Bool I810InitDma(ScrnInfoPtr pScrn)
info.pitch_bits = pI810->auxPitchBits;
ret_val = drmI810InitDma(pI810->drmSubFD, &info);
- if(ret_val == FALSE) ErrorF("I810 Dma Initialization Failed\n");
+ if(ret_val == FALSE) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "[drm] I810 Dma Initialization failed.\n");
+ }
return ret_val;
}
@@ -129,7 +132,7 @@ I810InitVisualConfigs(ScreenPtr pScreen)
return FALSE;
}
- for (i=0; i<numConfigs; i++)
+ for (i=0; i<numConfigs; i++)
pI810ConfigPtrs[i] = &pI810Configs[i];
i = 0;
@@ -168,7 +171,7 @@ I810InitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].depthSize = 0;
if (stencil)
pConfigs[i].stencilSize = 8;
- else
+ else
pConfigs[i].stencilSize = 0;
pConfigs[i].auxBuffers = 0;
pConfigs[i].level = 0;
@@ -219,7 +222,7 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
int bufs;
int width = pScrn->displayWidth * pI810->cpp;
int i;
-
+
/* Hardware 3D rendering only implemented for 16bpp */
/* And it only works for 5:6:5 (Mark) */
if (pScrn->depth != 16)
@@ -232,17 +235,19 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE;
if (!xf86LoaderCheckSymbol("DRIQueryVersion")) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "TDFXDRIScreenInit failed (libdri.a too old)\n");
+ "[dri] I810DRIScreenInit failed (libdri.a too old)\n");
return FALSE;
}
-
+
/* Check the DRI version */
{
int major, minor, patch;
DRIQueryVersion(&major, &minor, &patch);
if (major != 4 || minor < 0) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "I810DRIScreenInit failed (DRI version = %d.%d.%d, expected 4.0.x). Disabling DRI.\n",
+ "[dri] I810DRIScreenInit failed because of a version mismatch.\n"
+ "[dri] libDRI version is %d.%d.%d bug version 4.0.x is needed.\n"
+ "[dri] Disabling DRI.\n",
major, minor, patch);
return FALSE;
}
@@ -250,7 +255,8 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
pDRIInfo = DRICreateInfoRec();
if (!pDRIInfo) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "DRICreateInfoRec failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] DRICreateInfoRec failed. Disabling DRI.\n");
return FALSE;
}
@@ -273,8 +279,8 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
pDRIInfo->ddxDriverMinorVersion = I810_MINOR_VERSION;
pDRIInfo->ddxDriverPatchVersion = I810_PATCHLEVEL;
pDRIInfo->frameBufferPhysicalAddress = pI810->LinearAddr;
- pDRIInfo->frameBufferSize = (((pScrn->displayWidth *
- pScrn->virtualY * pI810->cpp) +
+ pDRIInfo->frameBufferSize = (((pScrn->displayWidth *
+ pScrn->virtualY * pI810->cpp) +
4096 - 1) / 4096) * 4096;
pDRIInfo->frameBufferStride = pScrn->displayWidth*pI810->cpp;
@@ -289,7 +295,7 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
* in the SAREA header
*/
if (sizeof(XF86DRISAREARec)+sizeof(I810SAREARec)>SAREA_MAX) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "Data does not fit in SAREA\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] Data does not fit in SAREA\n");
return FALSE;
}
pDRIInfo->SAREASize = SAREA_MAX;
@@ -302,38 +308,41 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
pDRIInfo->devPrivate = pI810DRI;
pDRIInfo->devPrivateSize = sizeof(I810DRIRec);
pDRIInfo->contextSize = sizeof(I810DRIContextRec);
-
+
pDRIInfo->CreateContext = I810CreateContext;
pDRIInfo->DestroyContext = I810DestroyContext;
pDRIInfo->SwapContext = I810DRISwapContext;
pDRIInfo->InitBuffers = I810DRIInitBuffers;
pDRIInfo->MoveBuffers = I810DRIMoveBuffers;
pDRIInfo->bufferRequests = DRI_ALL_WINDOWS;
-
+
pDRIInfo->createDummyCtx = TRUE;
pDRIInfo->createDummyCtxPriv = FALSE;
-
+
/* This adds the framebuffer as a drm map *before* we have asked agp
* to allocate it. Scary stuff, hold on...
*/
if (!DRIScreenInit(pScreen, pDRIInfo, &pI810->drmSubFD)) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "DRIScreenInit failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] DRIScreenInit failed. Disabling DRI.\n");
xfree(pDRIInfo->devPrivate);
pDRIInfo->devPrivate=0;
DRIDestroyInfoRec(pI810->pDRIInfo);
pI810->pDRIInfo=0;
return FALSE;
}
-
+
/* Check the i810 DRM version */
{
drmVersionPtr version = drmGetVersion(pI810->drmSubFD);
if (version) {
- if (version->version_major != 1 ||
- version->version_minor < 1) {
+ if (version->version_major != 2 ||
+ version->version_minor < 0) {
/* incompatible drm version */
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "I810DRIScreenInit failed (DRM version = %d.%d.%d, expected 1.0.x). Disabling DRI.\n",
+ "[dri] I810DRIScreenInit failed because of a version mismatch.\n"
+ "[dri] i810.o kernel module version is %d.%d.%d but version 2.x is needed.\n"
+ "[dri] Disabling DRI.\n",
version->version_major,
version->version_minor,
version->version_patchlevel);
@@ -346,33 +355,33 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
}
pI810DRI->regsSize=I810_REG_SIZE;
- if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->MMIOAddr,
+ if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->MMIOAddr,
pI810DRI->regsSize, DRM_REGISTERS, 0, &pI810DRI->regs)<0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(regs) failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAddMap(regs) failed\n");
DRICloseScreen(pScreen);
return FALSE;
}
xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Registers = 0x%08lx\n",
pI810DRI->regs);
-
+
pI810->backHandle = 0;
pI810->zHandle = 0;
pI810->cursorHandle = 0;
pI810->sysmemHandle = 0;
pI810->agpAcquired = FALSE;
pI810->dcacheHandle = 0;
-
+
/* Agp Support - Need this just to get the framebuffer.
*/
if(drmAgpAcquire(pI810->drmSubFD) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAgpAquire failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] drmAgpAquire failed\n");
DRICloseScreen(pScreen);
return FALSE;
}
pI810->agpAcquired = TRUE;
-
+
if (drmAgpEnable(pI810->drmSubFD, 0) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAgpEnable failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] drmAgpEnable failed\n");
DRICloseScreen(pScreen);
return FALSE;
}
@@ -381,23 +390,23 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
memset (&pI810->BackBuffer, 0, sizeof(I810MemRange));
memset (&pI810->DepthBuffer, 0, sizeof(I810MemRange));
pI810->CursorPhysical = 0;
-
+
/* Dcache - half the speed of normal ram, but has use as a Z buffer
- * under the DRI.
+ * under the DRI.
*/
drmAgpAlloc(pI810->drmSubFD, 4096 * 1024, 1, NULL, &dcacheHandle);
pI810->dcacheHandle = dcacheHandle;
- xf86DrvMsg(pScreen->myNum, X_INFO, "dcacheHandle : %p\n", dcacheHandle);
-
+ xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] dcacheHandle : %p\n", dcacheHandle);
+
#define Elements(x) sizeof(x)/sizeof(*x)
- for (pitch_idx = 0 ; pitch_idx < Elements(i810_pitches) ; pitch_idx++)
- if (width <= i810_pitches[pitch_idx])
+ for (pitch_idx = 0 ; pitch_idx < Elements(i810_pitches) ; pitch_idx++)
+ if (width <= i810_pitches[pitch_idx])
break;
-
+
if (pitch_idx == Elements(i810_pitches)) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Couldn't find depth/back buffer pitch");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[dri] Couldn't find depth/back buffer pitch");
DRICloseScreen(pScreen);
return FALSE;
}
@@ -405,11 +414,11 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
back_size = i810_pitches[pitch_idx] * (pScrn->virtualY + 4);
back_size = ((back_size + 4096 - 1) / 4096) * 4096;
}
-
+
sysmem_size = pScrn->videoRam * 1024;
if (dcacheHandle != 0) {
if (back_size > 4*1024*1024) {
- xf86DrvMsg(pScreen->myNum, X_INFO, "Backsize is larger then 4 meg\n");
+ xf86DrvMsg(pScreen->myNum, X_INFO, "[dri] Backsize is larger then 4 meg\n");
sysmem_size = sysmem_size - 2*back_size;
drmAgpFree(pI810->drmSubFD, dcacheHandle);
pI810->dcacheHandle = dcacheHandle = 0;
@@ -422,13 +431,13 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
sysmem_size = sysmem_size - 2*back_size;
}
- if(sysmem_size > 48*1024*1024) {
- sysmem_size = 48*1024*1024;
+ if(sysmem_size > pI810->FbMapSize) {
+ sysmem_size = pI810->FbMapSize;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "User requested more memory then fits in the agp aperture\n"
- "Truncating to %d bytes of memory\n",
- sysmem_size);
+ "[dri] User requested more memory then fits in the agp"
+ " aperture\n\tTruncating to %d bytes of memory\n",
+ sysmem_size);
}
sysmem_size -= 4096; /* remove 4k for the hw cursor */
@@ -441,121 +450,119 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
pI810->SavedSysMem = pI810->SysMem;
if (dcacheHandle != 0) {
- /* The Z buffer is always aligned to the 48 mb mark in the aperture */
- if(drmAgpBind(pI810->drmSubFD, dcacheHandle, 48*1024*1024) == 0) {
+ if(drmAgpBind(pI810->drmSubFD, dcacheHandle, pI810->DepthOffset) == 0) {
memset (&pI810->DcacheMem, 0, sizeof(I810MemRange));
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "GART: Found 4096K Z buffer memory\n");
- pI810->DcacheMem.Start = 48*1024*1024;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[agp] GART: Found 4096K Z buffer memory\n");
+ pI810->DcacheMem.Start = pI810->DepthOffset;
pI810->DcacheMem.Size = 1024 * 4096;
pI810->DcacheMem.End = pI810->DcacheMem.Start + pI810->DcacheMem.Size;
- if (!I810AllocLow(&(pI810->DepthBuffer),
+ if (!I810AllocLow(&(pI810->DepthBuffer),
&(pI810->DcacheMem),
- back_size))
+ back_size))
{
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Depth buffer allocation failed\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[agp] Depth buffer allocation failed\n");
DRICloseScreen(pScreen);
return FALSE;
}
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "GART: dcache bind failed\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[agp] GART: dcache bind failed\n");
drmAgpFree(pI810->drmSubFD, dcacheHandle);
pI810->dcacheHandle = dcacheHandle = 0;
- }
+ }
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "GART: no dcache memory found\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[agp] GART: no dcache memory found\n");
}
drmAgpAlloc(pI810->drmSubFD, back_size, 0, NULL, &agpHandle);
pI810->backHandle = agpHandle;
-
+
if (agpHandle != 0) {
- /* The backbuffer is always aligned to the 56 mb mark in the aperture */
- if(drmAgpBind(pI810->drmSubFD, agpHandle, 56*1024*1024) == 0) {
+ if(drmAgpBind(pI810->drmSubFD, agpHandle, pI810->BackOffset) == 0) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Bound backbuffer memory\n");
-
- pI810->BackBuffer.Start = 56*1024*1024;
+ "[agp] Bound backbuffer memory\n");
+
+ pI810->BackBuffer.Start = pI810->BackOffset;
pI810->BackBuffer.Size = back_size;
- pI810->BackBuffer.End = (pI810->BackBuffer.Start +
+ pI810->BackBuffer.End = (pI810->BackBuffer.Start +
pI810->BackBuffer.Size);
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Unable to bind backbuffer\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[agp] Unable to bind backbuffer. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Unable to allocate backbuffer memory\n");
+ "[dri] Unable to allocate backbuffer memory. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
-
+
if(dcacheHandle == 0) {
- /* The Z buffer is always aligned to the 48 mb mark in the aperture */
drmAgpAlloc(pI810->drmSubFD, back_size, 0,
NULL, &agpHandle);
pI810->zHandle = agpHandle;
if(agpHandle != 0) {
- if(drmAgpBind(pI810->drmSubFD, agpHandle, 48*1024*1024) == 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Bound depthbuffer memory\n");
- pI810->DepthBuffer.Start = 48*1024*1024;
+ if(drmAgpBind(pI810->drmSubFD, agpHandle, pI810->DepthOffset) == 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[agp] Bound depthbuffer memory\n");
+ pI810->DepthBuffer.Start = pI810->DepthOffset;
pI810->DepthBuffer.Size = back_size;
- pI810->DepthBuffer.End = (pI810->DepthBuffer.Start +
+ pI810->DepthBuffer.End = (pI810->DepthBuffer.Start +
pI810->DepthBuffer.Size);
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Unable to bind depthbuffer\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[agp] Unable to bind depthbuffer. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Unable to allocate depthbuffer memory\n");
+ "[agp] Unable to allocate depthbuffer memory. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
- }
-
+ }
+
/* Now allocate and bind the agp space. This memory will include the
* regular framebuffer as well as texture memory.
*/
drmAgpAlloc(pI810->drmSubFD, sysmem_size, 0, NULL, &agpHandle);
if (agpHandle == 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAgpAlloc failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] drmAgpAlloc failed\n");
DRICloseScreen(pScreen);
return FALSE;
}
pI810->sysmemHandle = agpHandle;
if (drmAgpBind(pI810->drmSubFD, agpHandle, 0) != 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAgpBind failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] drmAgpBind failed\n");
DRICloseScreen(pScreen);
return FALSE;
}
-
- drmAgpAlloc(pI810->drmSubFD, 4096, 2,
- (unsigned long *)&pI810->CursorPhysical, &agpHandle);
+
+ drmAgpAlloc(pI810->drmSubFD, 4096, 2,
+ (unsigned long *)&pI810->CursorPhysical, &agpHandle);
pI810->cursorHandle = agpHandle;
if (agpHandle != 0) {
tom = sysmem_size;
- if (drmAgpBind(pI810->drmSubFD, agpHandle, tom) == 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "GART: Allocated 4K for mouse cursor image\n");
- pI810->CursorStart = tom;
+ if (drmAgpBind(pI810->drmSubFD, agpHandle, tom) == 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "[agp] GART: Allocated 4K for mouse cursor image\n");
+ pI810->CursorStart = tom;
tom += 4096;
}
else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "GART: cursor bind failed\n");
- pI810->CursorPhysical = 0;
- }
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[agp] GART: cursor bind failed\n");
+ pI810->CursorPhysical = 0;
+ }
}
else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "GART: cursor alloc failed\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[agp] GART: cursor alloc failed\n");
pI810->CursorPhysical = 0;
}
@@ -573,34 +580,36 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
pI810->DepthBuffer.Start,
i810_pitches[pitch_idx],
8*1024*1024);
-
+
I810SetTiledMemory(pScrn, 2,
pI810->BackBuffer.Start,
i810_pitches[pitch_idx],
8*1024*1024);
-
+
pI810->auxPitch = i810_pitches[pitch_idx];
pI810->auxPitchBits = i810_pitch_flags[pitch_idx];
pI810->SavedDcacheMem = pI810->DcacheMem;
pI810DRI->backbufferSize = pI810->BackBuffer.Size;
if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->BackBuffer.Start,
- pI810->BackBuffer.Size, DRM_AGP, 0,
+ pI810->BackBuffer.Size, DRM_AGP, 0,
&pI810DRI->backbuffer) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(backbuffer) failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] drmAddMap(backbuffer) failed. Disabling DRI\n");
DRICloseScreen(pScreen);
return FALSE;
}
-
+
pI810DRI->depthbufferSize = pI810->DepthBuffer.Size;
if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->DepthBuffer.Start,
- pI810->DepthBuffer.Size, DRM_AGP, 0,
+ pI810->DepthBuffer.Size, DRM_AGP, 0,
&pI810DRI->depthbuffer) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(depthbuffer) failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] drmAddMap(depthbuffer) failed. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
-
+
/* Allocate FrontBuffer etc. */
if (!I810AllocateFront(pScrn)) {
DRICloseScreen(pScreen);
@@ -608,24 +617,25 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
}
/* Allocate buffer memory */
- I810AllocHigh( &(pI810->BufferMem), &(pI810->SysMem),
+ I810AllocHigh( &(pI810->BufferMem), &(pI810->SysMem),
I810_DMA_BUF_NR * I810_DMA_BUF_SZ);
-
- xf86DrvMsg(pScreen->myNum, X_INFO, "Buffer map : %lx\n",
+
+ xf86DrvMsg(pScreen->myNum, X_INFO, "[dri] Buffer map : %lx\n",
pI810->BufferMem.Start);
-
- if (pI810->BufferMem.Start == 0 ||
- pI810->BufferMem.End - pI810->BufferMem.Start >
+
+ if (pI810->BufferMem.Start == 0 ||
+ pI810->BufferMem.End - pI810->BufferMem.Start >
I810_DMA_BUF_NR * I810_DMA_BUF_SZ) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "Not enough memory for dma buffers\n");
+ "[dri] Not enough memory for dma buffers. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->BufferMem.Start,
pI810->BufferMem.Size, DRM_AGP, 0,
&pI810->buffer_map) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(buffer_map) failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] drmAddMap(buffer_map) failed. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
@@ -636,11 +646,12 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->LpRing.mem.Start,
pI810->LpRing.mem.Size, DRM_AGP, 0,
&pI810->ring_map) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(ring_map) failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] drmAddMap(ring_map) failed. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
-
+
/* Use the rest of memory for textures. */
pI810DRI->textureSize = pI810->SysMem.Size;
@@ -653,28 +664,30 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
pI810DRI->textureSize = (pI810DRI->textureSize >> i) << i; /* truncate */
if(pI810DRI->textureSize < 512*1024) {
- ErrorF("Less then 512k for textures\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] Less then 512k memory left for textures. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
-
+
I810AllocLow( &(pI810->TexMem), &(pI810->SysMem),
pI810DRI->textureSize);
-
+
if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->TexMem.Start,
pI810->TexMem.Size, DRM_AGP, 0,
&pI810DRI->textures) < 0) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(textures) failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] drmAddMap(textures) failed. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
-
+
if((bufs = drmAddBufs(pI810->drmSubFD,
I810_DMA_BUF_NR,
I810_DMA_BUF_SZ,
DRM_AGP_BUFFER, pI810->BufferMem.Start)) <= 0) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "[drm] failure adding %d %d byte DMA buffers\n",
+ "[drm] failure adding %d %d byte DMA buffers. Disabling DRI.\n",
I810_DMA_BUF_NR,
I810_DMA_BUF_SZ);
DRICloseScreen(pScreen);
@@ -687,7 +700,7 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
xf86EnablePciBusMaster(pI810->PciInfo, TRUE);
I810InitDma(pScrn);
-
+
/* Okay now initialize the dma engine */
if (!pI810DRI->irq) {
@@ -702,7 +715,7 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"[drm] failure adding irq handler, there is a device "
"already using that irq\n Consider rearranging your "
- "PCI cards\n");
+ "PCI cards. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
@@ -711,41 +724,41 @@ Bool I810DRIScreenInit(ScreenPtr pScreen)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"[drm] dma control initialized, using IRQ %d\n",
pI810DRI->irq);
-
- pI810DRI=(I810DRIPtr)pI810->pDRIInfo->devPrivate;
+
pI810DRI->deviceID=pI810->PciInfo->chipType;
pI810DRI->width=pScrn->virtualX;
pI810DRI->height=pScrn->virtualY;
pI810DRI->mem=pScrn->videoRam*1024;
pI810DRI->cpp=pI810->cpp;
-
+
pI810DRI->fbOffset=pI810->FrontBuffer.Start;
pI810DRI->fbStride=pI810->auxPitch;
-
+
pI810DRI->bitsPerPixel = pScrn->bitsPerPixel;
-
-
+
+
pI810DRI->textureOffset=pI810->TexMem.Start;
-
+
pI810DRI->backOffset=pI810->BackBuffer.Start;
pI810DRI->depthOffset=pI810->DepthBuffer.Start;
-
+
pI810DRI->ringOffset=pI810->LpRing.mem.Start;
pI810DRI->ringSize=pI810->LpRing.mem.Size;
-
+
pI810DRI->auxPitch = pI810->auxPitch;
pI810DRI->auxPitchBits = pI810->auxPitchBits;
pI810DRI->sarea_priv_offset = sizeof(XF86DRISAREARec);
if (!(I810InitVisualConfigs(pScreen))) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "I810InitVisualConfigs failed\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] I810InitVisualConfigs failed. Disabling DRI.\n");
DRICloseScreen(pScreen);
return FALSE;
}
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "visual configs initialized\n" );
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized.\n" );
pI810->pDRIInfo->driverSwapMethod = DRI_HIDE_X_CONTEXT;
-
+
return TRUE;
}
@@ -764,7 +777,7 @@ I810DRICloseScreen(ScreenPtr pScreen)
if(pI810->sysmemHandle) drmAgpFree(pI810->drmSubFD, pI810->sysmemHandle);
if(pI810->agpAcquired == TRUE) drmAgpRelease(pI810->drmSubFD);
-
+
pI810->backHandle = 0;
pI810->zHandle = 0;
pI810->cursorHandle = 0;
@@ -772,7 +785,7 @@ I810DRICloseScreen(ScreenPtr pScreen)
pI810->agpAcquired = FALSE;
pI810->dcacheHandle = 0;
-
+
DRICloseScreen(pScreen);
if (pI810->pDRIInfo) {
@@ -788,7 +801,7 @@ I810DRICloseScreen(ScreenPtr pScreen)
}
static Bool
-I810CreateContext(ScreenPtr pScreen, VisualPtr visual,
+I810CreateContext(ScreenPtr pScreen, VisualPtr visual,
drmContext hwContext, void *pVisualConfigPriv,
DRIContextType contextStore)
{
@@ -796,7 +809,7 @@ I810CreateContext(ScreenPtr pScreen, VisualPtr visual,
}
static void
-I810DestroyContext(ScreenPtr pScreen, drmContext hwContext,
+I810DestroyContext(ScreenPtr pScreen, drmContext hwContext,
DRIContextType contextStore)
{
}
@@ -811,29 +824,29 @@ I810DRIFinishScreenInit(ScreenPtr pScreen)
}
void
-I810DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
+I810DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
DRIContextType oldContextType, void *oldContext,
DRIContextType newContextType, void *newContext)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I810Ptr pI810 = I810PTR(pScrn);
- if (syncType == DRI_3D_SYNC &&
+ if (syncType == DRI_3D_SYNC &&
oldContextType == DRI_2D_CONTEXT &&
- newContextType == DRI_2D_CONTEXT)
- {
+ newContextType == DRI_2D_CONTEXT)
+ {
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("I810DRISwapContext (in)\n");
-
+
pI810->LockHeld = 1;
I810RefreshRing( pScrn );
}
- else if (syncType == DRI_2D_SYNC &&
+ else if (syncType == DRI_2D_SYNC &&
oldContextType == DRI_NO_CONTEXT &&
- newContextType == DRI_2D_CONTEXT)
- {
+ newContextType == DRI_2D_CONTEXT)
+ {
pI810->LockHeld = 0;
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("I810DRISwapContext (out)\n");
@@ -857,7 +870,7 @@ I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
I810SetupForSolidFill(pScrn, 0, GXcopy, -1);
while (nbox--) {
I810SelectBuffer(pScrn, I810_BACK);
- I810SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1,
+ I810SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1,
pbox->x2-pbox->x1, pbox->y2-pbox->y1);
pbox++;
}
@@ -868,8 +881,8 @@ I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
nbox = REGION_NUM_RECTS(prgn);
I810SelectBuffer(pScrn, I810_DEPTH);
I810SetupForSolidFill(pScrn, 0xffff, GXcopy, -1);
- while (nbox--) {
- I810SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1,
+ while (nbox--) {
+ I810SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1,
pbox->x2-pbox->x1, pbox->y2-pbox->y1);
pbox++;
}
@@ -880,12 +893,12 @@ I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
/* This routine is a modified form of XAADoBitBlt with the calls to
* ScreenToScreenBitBlt built in. My routine has the prgnSrc as source
* instead of destination. My origin is upside down so the ydir cases
- * are reversed.
+ * are reversed.
*
* KW: can you believe that this is called even when a 2d window moves?
*/
static void
-I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
+I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
RegionPtr prgnSrc, CARD32 index)
{
ScreenPtr pScreen = pParent->drawable.pScreen;
@@ -988,21 +1001,21 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
I810EmitFlush(pScrn);
I810SetupForScreenToScreenCopy(pScrn, xdir, ydir, GXcopy, -1, -1);
for ( ; nbox-- ; pbox++ ) {
-
+
int x1 = pbox->x1;
int y1 = pbox->y1;
int destx = x1 + dx;
int desty = y1 + dy;
int w = pbox->x2 - x1 + 1;
int h = pbox->y2 - y1 + 1;
-
- if ( destx < 0 ) x1 -= destx, w += destx, destx = 0;
+
+ if ( destx < 0 ) x1 -= destx, w += destx, destx = 0;
if ( desty < 0 ) y1 -= desty, h += desty, desty = 0;
if ( destx + w > screenwidth ) w = screenwidth - destx;
if ( desty + h > screenheight ) h = screenheight - desty;
if ( w <= 0 ) continue;
if ( h <= 0 ) continue;
-
+
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF( "MoveBuffers %d,%d %dx%d dx: %d dy: %d\n",
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
index 603baf7d4..5e3ae9c45 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
@@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.46 2001/04/18 14:52:41 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.49.2.1 2001/05/23 20:21:52 dawes Exp $ */
/*
* Authors:
@@ -71,7 +71,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* Required Functions: */
static void I810Identify(int flags);
-static OptionInfoPtr I810AvailableOptions(int chipid, int busid);
+static const OptionInfoRec * I810AvailableOptions(int chipid, int busid);
static Bool I810Probe(DriverPtr drv, int flags);
static Bool I810PreInit(ScrnInfoPtr pScrn, int flags);
static Bool I810ScreenInit(int Index, ScreenPtr pScreen, int argc, char **argv);
@@ -124,7 +124,7 @@ typedef enum {
OPTION_NO_DDC
} I810Opts;
-static OptionInfoRec I810Options[] = {
+static const OptionInfoRec I810Options[] = {
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE },
@@ -355,8 +355,7 @@ I810Identify(int flags) {
xf86PrintChipsets(I810_NAME, "Driver for Intel i810 chipset", I810Chipsets);
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
I810AvailableOptions(int chipid, int busid)
{
return I810Options;
@@ -440,9 +439,10 @@ I810DoDDC(ScrnInfoPtr pScrn, int index)
{
vbeInfoPtr pVbe;
xf86MonPtr MonInfo = NULL;
+ I810Ptr pI810 = I810PTR(pScrn);
/* Honour Option "noDDC" */
- if (xf86ReturnOptValBool(I810Options, OPTION_NO_DDC, FALSE) ) {
+ if (xf86ReturnOptValBool(pI810->Options, OPTION_NO_DDC, FALSE) ) {
return MonInfo;
}
@@ -478,14 +478,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
if (pScrn->numEntities != 1) return FALSE;
- /* The vgahw module should be loaded here when needed */
- if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE;
-
- xf86LoaderReqSymLists(vgahwSymbols, NULL);
-
- /* Allocate a vgaHWRec */
- if (!vgaHWGetHWRec(pScrn)) return FALSE;
-
/* Allocate driverPrivate */
if (!I810GetRec(pScrn)) return FALSE;
@@ -499,6 +491,14 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
return TRUE;
}
+ /* The vgahw module should be loaded here when needed */
+ if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE;
+
+ xf86LoaderReqSymLists(vgahwSymbols, NULL);
+
+ /* Allocate a vgaHWRec */
+ if (!vgaHWGetHWRec(pScrn)) return FALSE;
+
pI810->PciInfo = xf86GetPciInfoForEntity(pI810->pEnt->index);
pI810->PciTag = pciTag(pI810->PciInfo->bus, pI810->PciInfo->device,
pI810->PciInfo->func);
@@ -541,10 +541,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
return FALSE;
}
- pScrn->rgbBits=8;
- if (xf86ReturnOptValBool(I810Options, OPTION_DAC_6BIT, FALSE))
- pScrn->rgbBits=6;
-
if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight))
return FALSE;
@@ -559,13 +555,20 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
/* Process the options */
xf86CollectOptions(pScrn, NULL);
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, I810Options);
+ if (!(pI810->Options = xalloc(sizeof(I810Options))))
+ return FALSE;
+ memcpy(pI810->Options, I810Options, sizeof(I810Options));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pI810->Options);
+
+ pScrn->rgbBits=8;
+ if (xf86ReturnOptValBool(pI810->Options, OPTION_DAC_6BIT, FALSE))
+ pScrn->rgbBits=6;
/* 6-BIT dac isn't reasonable for modes with > 8bpp */
- if (xf86ReturnOptValBool(I810Options, OPTION_DAC_6BIT, FALSE) &&
+ if (xf86ReturnOptValBool(pI810->Options, OPTION_DAC_6BIT, FALSE) &&
pScrn->bitsPerPixel>8) {
OptionInfoPtr ptr;
- ptr=xf86TokenToOptinfo(I810Options, OPTION_DAC_6BIT);
+ ptr=xf86TokenToOptinfo(pI810->Options, OPTION_DAC_6BIT);
ptr->found=FALSE;
}
@@ -690,9 +693,23 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
xf86DrvMsg(pScrn->scrnIndex, from, "Will alloc AGP framebuffer: %d kByte\n",
pScrn->videoRam);
- /* Since we always want write combining on first 32 mb of framebuffer
- * we pass a mapsize of 32 mb */
- pI810->FbMapSize = 32*1024*1024;
+ /* Calculate Fixed Offsets depending on graphics aperture size */
+ {
+ PCITAG bridge;
+ long smram_miscc;
+
+ bridge = pciTag(0,0,0); /* This is always the host bridge */
+ smram_miscc = pciReadLong(bridge, SMRAM_MISCC);
+ if((smram_miscc & GFX_MEM_WIN_SIZE) == GFX_MEM_WIN_32M) {
+ pI810->FbMapSize = 0x1000000;
+ pI810->DepthOffset = 0x1000000;
+ pI810->BackOffset = 0x1800000;
+ } else {
+ pI810->FbMapSize = 0x3000000;
+ pI810->DepthOffset = 0x3000000;
+ pI810->BackOffset = 0x3800000;
+ }
+ }
/*
* If the driver can do gamma correction, it should call xf86SetGamma()
@@ -786,14 +803,14 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
}
xf86LoaderReqSymbols("fbScreenInit", NULL);
- if (!xf86ReturnOptValBool(I810Options, OPTION_NOACCEL, FALSE)) {
+ if (!xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
I810FreeRec(pScrn);
return FALSE;
}
}
- if (!xf86ReturnOptValBool(I810Options, OPTION_SW_CURSOR, FALSE)) {
+ if (!xf86ReturnOptValBool(pI810->Options, OPTION_SW_CURSOR, FALSE)) {
if (!xf86LoadSubModule(pScrn, "ramdac")) {
I810FreeRec(pScrn);
return FALSE;
@@ -801,7 +818,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) {
xf86LoaderReqSymLists(ramdacSymbols, NULL);
}
- if (xf86GetOptValInteger(I810Options, OPTION_COLOR_KEY, &(pI810->colorKey)))
+ if (xf86GetOptValInteger(pI810->Options, OPTION_COLOR_KEY, &(pI810->colorKey)))
{
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video overlay key set to 0x%x\n",
pI810->colorKey);
@@ -1394,7 +1411,7 @@ I810SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
}
/* Turn on 8 bit dac if requested */
- if (xf86ReturnOptValBool(I810Options, OPTION_DAC_6BIT, FALSE))
+ if (xf86ReturnOptValBool(pI810->Options, OPTION_DAC_6BIT, FALSE))
i810Reg->PixelPipeCfg0 = DAC_6_BIT;
else
i810Reg->PixelPipeCfg0 = DAC_8_BIT;
@@ -1526,6 +1543,32 @@ I810ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
return TRUE;
}
+
+static void
+I810LoadPalette15(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
+ VisualPtr pVisual) {
+ I810Ptr pI810;
+ vgaHWPtr hwp;
+ int i, j, index;
+ unsigned char r, g, b;
+
+ pI810 = I810PTR(pScrn);
+ hwp = VGAHWPTR(pScrn);
+
+ for (i=0; i<numColors; i++) {
+ index=indices[i];
+ r=colors[index].red;
+ g=colors[index].green;
+ b=colors[index].blue;
+ for (j=0; j<8; j++) {
+ hwp->writeDacWriteAddr(hwp, (index<<3)+j);
+ hwp->writeDacData(hwp, r);
+ hwp->writeDacData(hwp, g);
+ hwp->writeDacData(hwp, b);
+ }
+ }
+}
+
static void
I810LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
VisualPtr pVisual) {
@@ -1629,7 +1672,7 @@ I810AllocateFront(ScrnInfoPtr pScrn) {
pI810->FbMemBox.y1=0;
pI810->FbMemBox.y2=pScrn->virtualY;
- xf86GetOptValInteger(I810Options, OPTION_CACHE_LINES, &cache_lines);
+ xf86GetOptValInteger(pI810->Options, OPTION_CACHE_LINES, &cache_lines);
if (cache_lines < 0) {
/* make sure there is enough for two DVD sized YUV buffers */
@@ -1637,14 +1680,25 @@ I810AllocateFront(ScrnInfoPtr pScrn) {
if (pScrn->displayWidth <= 1024)
cache_lines *= 2;
}
- /* Make sure there's enough space for cache_lines. */
+ /* Make sure there's enough space for cache_lines.
+ *
+ * Had a bug here where maxCacheLines was computed to be less than 0.
+ * Not sure why 256 was initially subtracted from videoRam in the
+ * maxCacheLines calculation, but that was causing a problem
+ * for configurations that have exactly enough Ram for the framebuffer.
+ * Common code should catch the case where there isn't enough space for
+ * framebuffer, we'll just check for no space for cache_lines. -jens
+ *
+ */
{
int maxCacheLines;
- maxCacheLines = ((pScrn->videoRam - 256) * 1024 /
+ maxCacheLines = (pScrn->videoRam * 1024 /
(pScrn->bitsPerPixel / 8) /
pScrn->displayWidth) - pScrn->virtualY;
- if (maxCacheLines >= 0 && cache_lines > maxCacheLines)
+ if (maxCacheLines < 0)
+ maxCacheLines = 0;
+ if (cache_lines > maxCacheLines)
cache_lines = maxCacheLines;
}
pI810->FbMemBox.y2 += cache_lines;
@@ -1735,8 +1789,8 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
* InitGLXVisuals call back.
*/
- if (xf86ReturnOptValBool(I810Options, OPTION_NOACCEL, FALSE) ||
- !xf86ReturnOptValBool(I810Options, OPTION_DRI, TRUE)) {
+ if (xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE) ||
+ !xf86ReturnOptValBool(pI810->Options, OPTION_DRI, TRUE)) {
pI810->directRenderingEnabled = FALSE;
driFrom = X_CONFIG;
} else {
@@ -1816,7 +1870,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
return FALSE;
}
- if (!xf86ReturnOptValBool(I810Options, OPTION_NOACCEL, FALSE)) {
+ if (!xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) {
if (pI810->LpRing.mem.Size != 0) {
I810SetRingRegs( pScrn );
@@ -1833,7 +1887,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
- if (!xf86ReturnOptValBool(I810Options, OPTION_SW_CURSOR, FALSE)) {
+ if (!xf86ReturnOptValBool(pI810->Options, OPTION_SW_CURSOR, FALSE)) {
if (!I810CursorInit(pScreen)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Hardware cursor initialization failed\n");
@@ -1844,10 +1898,17 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
/* Use driver specific palette load routines for Direct Color support. -jens */
if (pScrn->bitsPerPixel==16) {
- if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette16, 0,
- CMAP_PALETTED_TRUECOLOR|
- CMAP_RELOAD_ON_MODE_SWITCH))
+ if (pScrn->depth == 15) {
+ if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette15, 0,
+ CMAP_PALETTED_TRUECOLOR|
+ CMAP_RELOAD_ON_MODE_SWITCH))
+ return FALSE;
+ } else {
+ if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette16, 0,
+ CMAP_PALETTED_TRUECOLOR|
+ CMAP_RELOAD_ON_MODE_SWITCH))
return FALSE;
+ }
} else {
if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette24, 0,
CMAP_PALETTED_TRUECOLOR|
@@ -2043,6 +2104,11 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
pI810->DcacheMem = pI810->SavedDcacheMem;
pI810->DoneFrontAlloc = FALSE;
+ /* Need to actually close the gart fd, or the unbound memory will just sit
+ * around. Will prevent the Xserver from recycling.
+ */
+ xf86GARTCloseScreen(scrnIndex);
+
pScrn->vtSema=FALSE;
pScreen->CloseScreen = pI810->CloseScreen;
return (*pScreen->CloseScreen)(scrnIndex, pScreen);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile
index 313ed5002..cc9bdbd3b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile,v 1.4 2001/01/24 00:06:20 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile,v 1.5 2001/05/16 06:48:09 keithp Exp $
/*
*
* Copyright 2000 Ani Joshi <ajoshi@unixbox.com>
@@ -16,10 +16,10 @@ OBJS = imstt_driver.o imstt_accel.o
INCLUDES = -I. -I../../include
#else
INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
- -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \
- -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa \
+ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \
+ -I$(XF86SRC)/xaa \
-I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \
- -I$(XF86SRC)/xf24_32bpp -I$(SERVERSRC)/Xext \
+ -I$(SERVERSRC)/Xext \
-I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \
-I$(XF86SRC)/rac -I$(XF86SRC)/int10 \
-I$(XF86SRC)/fbdevhw -I$(SERVERSRC)/render \
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h
index 095dead6b..b714aafeb 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h,v 1.4 2001/04/05 21:29:14 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h,v 1.5 2001/05/16 06:48:09 keithp Exp $ */
#ifndef _IMSTT_H
#define _IMSTT_H
@@ -59,9 +59,11 @@ typedef struct _IMSTTRec {
} IMSTTRec, *IMSTTPtr;
#if 0
-#define IMSTTTRACE ErrorF
+#define IMSTTTRACE(s) ErrorF(s)
+#define IMSTTTRACE1(s,a) ErrorF(s,a)
#else
-#define IMSTTTRACE
+#define IMSTTTRACE(s)
+#define IMSTTTRACE1(s,a)
#endif
#define IMSTTPTR(p) ((IMSTTPtr)((p)->driverPrivate))
@@ -72,4 +74,6 @@ typedef struct _IMSTTRec {
#define RAMDAC_IBM 1
#define RAMDAC_TVP 2
+Bool IMSTTAccelInit(ScreenPtr pScreen);
+
#endif /* _IMSTT_H */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c
index 5eef2aa19..86dca5854 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c,v 1.5 2001/04/05 21:29:14 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c,v 1.6 2001/05/16 06:48:09 keithp Exp $ */
/*
* Copyright 2000 Ani Joshi <ajoshi@unixbox.com>
@@ -41,7 +41,7 @@
static void IMSTTSync(ScrnInfoPtr pScrn)
{
IMSTTPtr iptr = IMSTTPTR(pScrn);
- IMSTTMMIO_VARS();
+/* IMSTTMMIO_VARS(); */
while(INREG(IMSTT_SSTATUS) & 0x80);
while(INREG(IMSTT_SSTATUS) & 0x40);
@@ -54,7 +54,7 @@ static void IMSTTSetupForSolidFill(ScrnInfoPtr pScrn, int color,
int rop, unsigned int planemask)
{
IMSTTPtr iptr = IMSTTPTR(pScrn);
- IMSTTMMIO_VARS();
+/* IMSTTMMIO_VARS(); */
switch (pScrn->depth) {
case 8:
@@ -75,7 +75,7 @@ static void IMSTTSubsequentSolidFillRect(ScrnInfoPtr pScrn,
int x, int y, int w, int h)
{
IMSTTPtr iptr = IMSTTPTR(pScrn);
- IMSTTMMIO_VARS();
+/* IMSTTMMIO_VARS(); */
x *= (pScrn->bitsPerPixel >> 3);
y *= iptr->ll;
@@ -107,8 +107,8 @@ static void IMSTTSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir,
int trans_color)
{
IMSTTPtr iptr = IMSTTPTR(pScrn);
- IMSTTMMIO_VARS();
- unsigned long sp, dp, ll, cnt;
+/* IMSTTMMIO_VARS(); */
+ unsigned long sp, dp, ll;
iptr->bltctl = 0x05;
@@ -146,7 +146,7 @@ static void IMSTTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn,
int w, int h)
{
IMSTTPtr iptr = IMSTTPTR(pScrn);
- IMSTTMMIO_VARS();
+/* IMSTTMMIO_VARS(); */
unsigned long cnt;
x1 *= (pScrn->bitsPerPixel >> 3);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c
index 70d8f9c67..23631ee12 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c,v 1.11 2001/04/05 21:29:14 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c,v 1.15 2001/05/16 06:48:09 keithp Exp $ */
/*
* Copyright 2000 Ani Joshi <ajoshi@unixbox.com>
@@ -46,12 +46,7 @@
#include "mibstore.h"
#include "fbdevhw.h"
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb16.h"
-#include "cfb24.h"
-#include "cfb32.h"
+#include "fb.h"
#include "xf86cmap.h"
@@ -67,19 +62,23 @@
/*
* prototypes
*/
-static OptionInfoPtr IMSTTAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * IMSTTAvailableOptions(int chipid, int busid);
static void IMSTTIdentify(int flags);
static Bool IMSTTProbe(DriverPtr drv, int flags);
static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags);
+#if 0
static Bool IMSTTEnterVT(int scrnIndex, int flags);
static void IMSTTLeaveVT(int scrnIndex, int flags);
static void IMSTTSave(ScrnInfoPtr pScrn);
+#endif
static Bool IMSTTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc,
char **argv);
+#if 0
static int IMSTTInternalScreenInit(int scrnIndex, ScreenPtr pScreen);
static ModeStatus IMSTTValidMode(int index, DisplayModePtr mode,
Bool verbose, int flags);
+#endif
static Bool IMSTTMapMem(ScrnInfoPtr pScrn);
static void IMSTTUnmapMem(ScrnInfoPtr pScrn);
@@ -87,10 +86,11 @@ static Bool IMSTTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
static void IMSTTAdjustFrame(int scrnIndex, int x, int y, int flags);
Bool IMSTTCloseScreen(int scrnIndex, ScreenPtr pScreen);
Bool IMSTTSaveScreen(ScreenPtr pScreen, int mode);
+#if 0
static void IMSTTLoadPalette(ScrnInfoPtr pScrn, int numColors,
int *indicies, LOCO *colors,
VisualPtr pVisual);
-
+#endif
static void IMSTTGetVideoMemSize(ScrnInfoPtr pScrn);
static void IMSTTSetClock(ScrnInfoPtr pScrn, unsigned long mhz);
static void IMSTTWriteMode(ScrnInfoPtr pScrn);
@@ -137,28 +137,20 @@ typedef enum {
OPTION_FBDEV
} IMSTTOpts;
-static OptionInfoRec IMSTTOptions[] =
+static const OptionInfoRec IMSTTOptions[] =
{
{ OPTION_NOACCEL, "noaccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SWCURSOR, "swcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_INITDAC, "initdac", OPTV_BOOLEAN, {0}, FALSE },
- { OPTION_FBDEV, "UseFBDev", OPTV_BOOLEAN, {0}, FALSE }
+ { OPTION_FBDEV, "UseFBDev", OPTV_BOOLEAN, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
};
-
-static const char *cfbSymbols[] = {
- "cfbScreenInit",
- "cfb16ScreenInit",
- "cfb24ScreenInit",
- "cfb32ScreenInit",
- "cfb16BresS",
- "cfb24BresS",
- NULL
-};
-
-
static const char *fbSymbols[] = {
"fbScreenInit",
+#ifdef RENDER
+ "fbPictureInit",
+#endif
NULL
};
@@ -225,7 +217,7 @@ pointer IMSTTSetup(pointer module, pointer opts, int *errmaj,
if (!setupDone) {
setupDone = TRUE;
xf86AddDriver(&IMSTT, module, 0);
- LoaderRefSymLists(cfbSymbols, xaaSymbols, fbdevHWSymbols, NULL);
+ LoaderRefSymLists(fbSymbols, xaaSymbols, fbdevHWSymbols, NULL);
return (pointer) 1;
} else {
if (errmaj)
@@ -260,7 +252,7 @@ static void IMSTTFreeRec(ScrnInfoPtr pScrn)
}
-static OptionInfoPtr IMSTTAvailableOptions(int chipid, int busid)
+static const OptionInfoRec * IMSTTAvailableOptions(int chipid, int busid)
{
return IMSTTOptions;
}
@@ -333,11 +325,8 @@ static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags)
{
EntityInfoPtr pEnt;
IMSTTPtr iptr;
- MessageType from = X_DEFAULT;
int i;
ClockRangePtr clockRanges;
- char *mod = NULL;
- const char *reqSym = NULL;
rgb zeros = {0, 0, 0};
Gamma gzeros = {0.0, 0.0, 0.0};
@@ -387,15 +376,18 @@ static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, IMSTTOptions);
+ if (!(iptr->Options = xalloc(sizeof(IMSTTOptions))))
+ return FALSE;
+ memcpy(iptr->Options, IMSTTOptions, sizeof(IMSTTOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, iptr->Options);
- if (xf86ReturnOptValBool(IMSTTOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(iptr->Options, OPTION_NOACCEL, FALSE)) {
iptr->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - acceleration disabled\n");
} else
iptr->NoAccel = FALSE;
#if 0
- if (xf86ReturnOptValBool(IMSTTOptions, OPTION_SWCURSOR, FALSE))
+ if (xf86ReturnOptValBool(iptr->Options, OPTION_SWCURSOR, FALSE))
iptr->HWCursor = FALSE;
else
iptr->HWCursor = TRUE;
@@ -407,14 +399,14 @@ static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using %s cursor\n",
iptr->HWCursor ? "HW" : "SW");
- if (xf86ReturnOptValBool(IMSTTOptions, OPTION_INITDAC, FALSE)) {
+ if (xf86ReturnOptValBool(iptr->Options, OPTION_INITDAC, FALSE)) {
iptr->InitDAC = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: not initalizing DACn");
} else {
iptr->InitDAC = FALSE;
}
- if (xf86ReturnOptValBool(IMSTTOptions, OPTION_FBDEV, FALSE)) {
+ if (xf86ReturnOptValBool(iptr->Options, OPTION_FBDEV, FALSE)) {
iptr->FBDev = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Using framebuffer device\n");
@@ -530,7 +522,7 @@ static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags)
i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
pScrn->display->modes, clockRanges,
NULL, 256, 2048, pScrn->bitsPerPixel,
- 128, 2048, pScrn->virtualX,
+ 128, 2048, pScrn->display->virtualX,
pScrn->display->virtualY,
iptr->videoRam, LOOKUP_BEST_REFRESH);
@@ -560,7 +552,7 @@ static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags)
xf86SetDpi(pScrn, 0, 0);
xf86LoadSubModule(pScrn, "fb");
- xf86LoaderReqSymbols("fbScreenInit", NULL);
+ xf86LoaderReqSymLists(fbSymbols, NULL);
if (!xf86LoadSubModule(pScrn, "xaa"))
return FALSE;
@@ -589,7 +581,7 @@ static Bool IMSTTMapMem(ScrnInfoPtr pScrn)
return FALSE;
}
- IMSTTTRACE("Mapped MMIO @ 0x%x with size 0x1000\n", iptr->PciInfo->memBase[0] + 0x800000);
+ IMSTTTRACE1("Mapped MMIO @ 0x%x with size 0x1000\n", iptr->PciInfo->memBase[0] + 0x800000);
IMSTTGetVideoMemSize(pScrn);
@@ -655,8 +647,7 @@ static void IMSTTUnmapMem(ScrnInfoPtr pScrn)
static void IMSTTGetVideoMemSize(ScrnInfoPtr pScrn)
{
- IMSTTPtr iptr;
- IMSTTMMIO_VARS();
+ IMSTTPtr iptr = IMSTTPTR(pScrn);
unsigned long tmp;
if (iptr->FBDev) {
@@ -679,7 +670,6 @@ static Bool IMSTTScreenInit(int scrnIndex, ScreenPtr pScreen,
{
ScrnInfoPtr pScrn;
IMSTTPtr iptr;
- IMSTTMMIO_VARS();
unsigned long tmp;
VisualPtr visual;
int r = TRUE;
@@ -797,25 +787,21 @@ static Bool IMSTTScreenInit(int scrnIndex, ScreenPtr pScreen,
return FALSE;
}
- switch (pScrn->bitsPerPixel) {
- case 8:
- case 16:
- case 24:
- case 32:
- r = fbScreenInit(pScreen, iptr->FBBase, pScrn->virtualX,
- pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth, pScrn->bitsPerPixel);
- break;
- default:
- ErrorF("invalid bpp %d\n", pScrn->bitsPerPixel);
- return FALSE;
- }
+ miSetPixmapDepths ();
+
+ r = fbScreenInit(pScreen, iptr->FBBase, pScrn->virtualX,
+ pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth, pScrn->bitsPerPixel);
if (!r) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ScreenInit failed\n");
return FALSE;
}
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
+
if (pScrn->bitsPerPixel > 8) {
visual = pScreen->visuals + pScreen->numVisuals;
while (--visual >= pScreen->visuals) {
@@ -872,7 +858,6 @@ static Bool IMSTTScreenInit(int scrnIndex, ScreenPtr pScreen,
static Bool IMSTTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
IMSTTPtr iptr;
- IMSTTMMIO_VARS();
unsigned long mhz;
unsigned short hes, heb, veb, htp, vtp;
@@ -1115,9 +1100,8 @@ static void IMSTTWriteMode(ScrnInfoPtr pScrn)
{
IMSTTPtr iptr;
unsigned char pixformat;
- unsigned long ctl, pitch, byteswap, scr;
- unsigned char tcc, mxc, lckl_n, mic, mlc, lckl_p;
- IMSTTMMIO_VARS();
+ unsigned long ctl = 0, pitch = 0, byteswap = 0, scr = 0;
+ unsigned char tcc = 0, mxc = 0, lckl_n = 0, mic, mlc = 0, lckl_p = 0;
iptr = IMSTTPTR(pScrn);
@@ -1288,7 +1272,6 @@ static void IMSTTAdjustFrame(int scrnIndex, int x, int y, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
IMSTTPtr iptr;
- IMSTTMMIO_VARS();
unsigned long offset;
iptr = IMSTTPTR(pScrn);
@@ -1316,7 +1299,5 @@ Bool IMSTTCloseScreen(int scrnIndex, ScreenPtr pScreen)
Bool IMSTTSaveScreen(ScreenPtr pScreen, int mode)
{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-
return TRUE;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h
index fd24a1a61..c2ec1e39c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.74 2001/04/18 15:29:18 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.75 2001/05/04 19:05:41 dawes Exp $ */
/*
* MGA Millennium (MGA2064W) functions
*
@@ -372,6 +372,7 @@ typedef struct {
#ifdef USEMGAHAL
Bool HALLoaded;
#endif
+ OptionInfoPtr Options;
} MGARec, *MGAPtr;
extern CARD32 MGAAtype[16];
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man
index 7246cf563..aa6733c49 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man,v 1.2 2001/01/27 18:20:51 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man,v 1.3 2001/05/10 21:53:48 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH MGA __drivermansuffix__ __vendorversion__
@@ -20,7 +20,10 @@ accelerated, and provides support for the following framebuffer depths:
visual types are supported for depth 8, and both TrueColor and DirectColor
visuals are supported for the other depths except 8+24 mode which supports
PseudoColor, GrayScale and TrueColor. Multi-head configurations
-are supported.
+are supported. XVideo is supported on G200 and newer systems, with
+either
+.B TexturedVideo
+or video overlay.
.SH SUPPORTED HARDWARE
The
.B mga
@@ -97,7 +100,7 @@ only). Default: off.
Enable 8+24 overlay mode. Only appropriate for depth 24.
.RB ( Note:
the G100 is unaccelerated in the 8+24 overlay mode due to a missing
-hardware feature) Default: off.
+hardware feature.) Default: off.
.TP
.BI "Option \*qPciRetry\*q \*q" boolean \*q
Enable or disable PCI retries. Default: off.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c
index 83154198f..9b01d1d8b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.20 2001/04/10 16:08:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.21 2001/05/02 15:06:09 dawes Exp $ */
/*
* Copyright 2000 VA Linux Systems Inc., Fremont, California.
@@ -355,7 +355,7 @@ static void MGAWaitForIdleDMA( ScrnInfoPtr pScrn )
return;
xf86DrvMsg( pScrn->scrnIndex, X_ERROR,
- "Idle timed out, resetting engine...\n" );
+ "[dri] Idle timed out, resetting engine...\n" );
drmMGAEngineReset( pMga->drmFD );
}
@@ -919,7 +919,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
if ( !xf86LoaderCheckSymbol( "drmAvailable" ) ) return FALSE;
if ( !xf86LoaderCheckSymbol( "DRIQueryVersion" ) ) {
xf86DrvMsg( pScreen->myNum, X_ERROR,
- "MGADRIScreenInit failed (libdri.a too old)\n" );
+ "[dri] MGADRIScreenInit failed (libdri.a too old)\n" );
return FALSE;
}
@@ -927,11 +927,11 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
{
int major, minor, patch;
DRIQueryVersion( &major, &minor, &patch );
- if ( major != 4 || minor < 0) {
+ if ( major != 4 || minor < 0 ) {
xf86DrvMsg( pScreen->myNum, X_ERROR,
- "[drm] MGADRIScreenInit failed "
- "(DRI version = %d.%d.%d, expected 4.0.x). "
- "Disabling DRI.\n",
+ "[dri] MGADRIScreenInit failed because of a version mismatch.\n"
+ "[dri] libDRI version = %d.%d.%d but version 4.0.x is needed.\n"
+ "[dri] Disabling the DRI.\n",
major, minor, patch );
return FALSE;
}
@@ -944,14 +944,14 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
if ( (pScrn->bitsPerPixel / 8) != 2 &&
(pScrn->bitsPerPixel / 8) != 4 ) {
xf86DrvMsg( pScreen->myNum, X_ERROR,
- "[drm] Direct rendering only supported in 16 and 32 bpp modes\n" );
+ "[dri] Direct rendering only supported in 16 and 32 bpp modes\n" );
return FALSE;
}
pDRIInfo = DRICreateInfoRec();
if ( !pDRIInfo ) {
xf86DrvMsg( pScreen->myNum, X_ERROR,
- "[drm] DRICreateInfoRec() failed\n" );
+ "[dri] DRICreateInfoRec() failed\n" );
return FALSE;
}
pMga->pDRIInfo = pDRIInfo;
@@ -1059,7 +1059,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
DRIDestroyInfoRec( pMga->pDRIInfo );
pMga->pDRIInfo = 0;
xf86DrvMsg( pScreen->myNum, X_ERROR,
- "[drm] DRIScreenInit Failed\n" );
+ "[drm] DRIScreenInit failed. Disabling DRI.\n" );
return FALSE;
}
@@ -1068,12 +1068,12 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
drmVersionPtr version = drmGetVersion(pMga->drmFD);
if ( version ) {
if ( version->version_major != 3 ||
- version->version_minor < 0) {
+ version->version_minor < 0 ) {
/* incompatible drm version */
xf86DrvMsg( pScreen->myNum, X_ERROR,
- "[drm] MGADRIScreenInit failed "
- "(DRM version = %d.%d.%d, expected 3.0.x). "
- "Disabling DRI.\n",
+ "[dri] MGADRIScreenInit failed because of a version mismatch.\n"
+ "[dri] mga.o kernel module version is %d.%d.%d but version 3.0.x is needed.\n"
+ "[dri] Disabling DRI.\n",
version->version_major,
version->version_minor,
version->version_patchlevel );
@@ -1117,7 +1117,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
DRICloseScreen( pScreen );
return FALSE;
}
- xf86DrvMsg( pScrn->scrnIndex, X_INFO, "visual configs initialized\n" );
+ xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized\n" );
return TRUE;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c
index c1bf3ef23..ebb885bcc 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c
@@ -45,7 +45,7 @@
* Added digital screen option for first head
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.199 2001/04/27 05:14:04 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.202.2.2 2001/05/28 14:23:38 eich Exp $ */
/*
* This is a first cut at a non-accelerated version to work with the
@@ -103,7 +103,7 @@
*/
/* Mandatory functions */
-static OptionInfoPtr MGAAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * MGAAvailableOptions(int chipid, int busid);
static void MGAIdentify(int flags);
static Bool MGAProbe(DriverPtr drv, int flags);
static Bool MGAPreInit(ScrnInfoPtr pScrn, int flags);
@@ -221,7 +221,7 @@ typedef enum {
OPTION_DRI
} MGAOpts;
-static OptionInfoRec MGAOptions[] = {
+static const OptionInfoRec MGAOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE },
@@ -547,8 +547,7 @@ MGAFreeRec(ScrnInfoPtr pScrn)
pScrn->driverPrivate = NULL;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
MGAAvailableOptions(int chipid, int busid)
{
return MGAOptions;
@@ -737,7 +736,7 @@ MGAProbe(DriverPtr drv, int flags)
static void
MGAReadBios(ScrnInfoPtr pScrn)
{
- CARD8 tmp[ 64 ];
+ CARD8 BIOS[0x10000];
CARD16 offset;
CARD8 chksum;
CARD8 *pPINSInfo;
@@ -745,6 +744,7 @@ MGAReadBios(ScrnInfoPtr pScrn)
MGABiosInfo *pBios;
MGABios2Info *pBios2;
Bool pciBIOS = TRUE;
+ int rlen;
pMga = MGAPTR(pScrn);
pBios = &pMga->Bios;
@@ -760,32 +760,36 @@ MGAReadBios(ScrnInfoPtr pScrn)
else if (pMga->BiosFrom == X_CONFIG && pMga->BiosAddress < 0x100000)
pciBIOS = TRUE;
-#define MGADoBIOSRead(offset, buf, len) \
- (pciBIOS ? \
- xf86ReadPciBIOS(offset, pMga->PciTag, pMga->FbBaseReg, buf, len) : \
- xf86ReadBIOS(pMga->BiosAddress, offset, buf, len))
-
- MGADoBIOSRead(0, tmp, sizeof( tmp ));
- if (
- tmp[ 0 ] != 0x55
- || tmp[ 1 ] != 0xaa
- || strncmp(( char * )( tmp + 45 ), "MATROX", 6 )
- ) {
+ if (pciBIOS)
+ rlen = xf86ReadPciBIOS(0, pMga->PciTag, pMga->FbBaseReg,
+ BIOS, sizeof(BIOS));
+ else
+ rlen = xf86ReadBIOS(pMga->BiosAddress, 0, BIOS, sizeof(BIOS));
+
+ if (rlen < (BIOS[2] << 9)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Could not retrieve video BIOS!\n");
+ return;
+ }
+
+ if (strncmp((char *)(&BIOS[45]), "MATROX", 6)) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Video BIOS info block not detected!\n");
return;
}
/* Get the info block offset */
- MGADoBIOSRead(0x7ffc, ( CARD8 * ) & offset, sizeof( offset ));
-
+ offset = (BIOS[0x7ffd] << 8) | BIOS[0x7ffc];
/* Let the world know what we are up to */
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"Video BIOS info block at offset 0x%05lX\n",
(long)(offset));
+#define MGADoBIOSRead(offset, buf, len) memcpy(buf, &BIOS[offset], len)
+
/* Copy the info block */
+ /* XXX What about big-endianness? */
switch (pMga->Chipset){
case PCI_CHIP_MGA2064:
MGADoBIOSRead(offset,
@@ -796,7 +800,6 @@ MGAReadBios(ScrnInfoPtr pScrn)
( CARD8 * ) & pBios2->PinID, sizeof( MGABios2Info ));
}
-
/* matrox millennium-2 and mystique pins info */
if ( pBios2->PinID == 0x412e ) {
int i;
@@ -847,7 +850,6 @@ MGAReadBios(ScrnInfoPtr pScrn)
ErrorF("Pins[0x%02x] is 0x%02x\n", i,
((unsigned char *)pBios2)[i]);
#endif
- return;
} else {
/* Set default MCLK values (scaled by 10 kHz) */
if ( pBios->ClkBase == 0 )
@@ -857,7 +859,6 @@ MGAReadBios(ScrnInfoPtr pScrn)
if ( pBios->Clk8MB == 0 )
pBios->Clk8MB = pBios->Clk4MB;
pBios2->PinID = 0; /* not in use */
- return;
}
}
@@ -1016,6 +1017,36 @@ MGAdoDDC(ScrnInfoPtr pScrn)
pMga = MGAPTR(pScrn);
MGAdac = &pMga->Dac;
+ /* Load DDC if we have the code to use it */
+ /* This gives us DDC1 */
+ if (pMga->ddc1Read || pMga->i2cInit) {
+ if (xf86LoadSubModule(pScrn, "ddc")) {
+ xf86LoaderReqSymLists(ddcSymbols, NULL);
+ } else {
+ /* ddc module not found, we can do without it */
+ pMga->ddc1Read = NULL;
+
+ /* Without DDC, we have no use for the I2C bus */
+ pMga->i2cInit = NULL;
+ return NULL;
+ }
+ } else
+ return NULL;
+
+#if MGAuseI2C
+ /* - DDC can use I2C bus */
+ /* Load I2C if we have the code to use it */
+ if (pMga->i2cInit) {
+ if ( xf86LoadSubModule(pScrn, "i2c") ) {
+ xf86LoaderReqSymLists(i2cSymbols,NULL);
+ } else {
+ /* i2c module not found, we can do without it */
+ pMga->i2cInit = NULL;
+ pMga->I2C = NULL;
+ }
+ }
+#endif /* MGAuseI2C */
+
/* Map the MGA memory and MMIO areas */
if (!MGAMapMem(pScrn))
return NULL;
@@ -1147,6 +1178,7 @@ MGAProbeDDC(ScrnInfoPtr pScrn, int index)
if (xf86LoadSubModule(pScrn, "vbe")) {
pVbe = VBEInit(NULL,index);
ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
}
}
@@ -1388,11 +1420,14 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, MGAOptions);
+ if (!(pMga->Options = xalloc(sizeof(MGAOptions))))
+ return FALSE;
+ memcpy(pMga->Options, MGAOptions, sizeof(MGAOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pMga->Options);
#if !defined(__powerpc__)
pMga->softbooted = FALSE;
- if (xf86ReturnOptValBool(MGAOptions, OPTION_INT10, FALSE) &&
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_INT10, FALSE) &&
xf86LoadSubModule(pScrn, "int10")) {
xf86Int10InfoPtr pInt;
@@ -1435,7 +1470,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
}
#ifdef USEMGAHAL
- if (HAL_CHIPSETS && !xf86ReturnOptValBool(MGAOptions, OPTION_NOHAL, FALSE)
+ if (HAL_CHIPSETS && !xf86ReturnOptValBool(pMga->Options, OPTION_NOHAL, FALSE)
&& xf86LoadSubModule(pScrn, "mga_hal")) {
xf86LoaderReqSymLists(halSymbols, NULL);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,"Matrox HAL module used\n");
@@ -1467,7 +1502,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
from = X_DEFAULT;
pMga->agpMode = MGA_DEFAULT_AGP_MODE;
- if (xf86GetOptValInteger(MGAOptions,
+ if (xf86GetOptValInteger(pMga->Options,
OPTION_AGP_MODE, &(pMga->agpMode))) {
if (pMga->agpMode < 1) {
pMga->agpMode = 1;
@@ -1488,40 +1523,40 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
* The preferred method is to use the "hw cursor" option as a tri-state
* option, with the default set above.
*/
- if (xf86GetOptValBool(MGAOptions, OPTION_HW_CURSOR, &pMga->HWCursor)) {
+ if (xf86GetOptValBool(pMga->Options, OPTION_HW_CURSOR, &pMga->HWCursor)) {
from = X_CONFIG;
}
/* For compatibility, accept this too (as an override) */
- if (xf86ReturnOptValBool(MGAOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_NOACCEL, FALSE)) {
pMga->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
- if (xf86ReturnOptValBool(MGAOptions, OPTION_PCI_RETRY, FALSE)) {
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_PCI_RETRY, FALSE)) {
pMga->UsePCIRetry = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n");
}
- if (xf86ReturnOptValBool(MGAOptions, OPTION_SYNC_ON_GREEN, FALSE)) {
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_SYNC_ON_GREEN, FALSE)) {
pMga->SyncOnGreen = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Sync-on-Green enabled\n");
}
- if (xf86ReturnOptValBool(MGAOptions, OPTION_SHOWCACHE, FALSE)) {
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_SHOWCACHE, FALSE)) {
pMga->ShowCache = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n");
}
- if (xf86ReturnOptValBool(MGAOptions, OPTION_MGA_SDRAM, FALSE)) {
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_MGA_SDRAM, FALSE)) {
pMga->HasSDRAM = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Has SDRAM\n");
}
- if (xf86GetOptValFreq(MGAOptions, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) {
+ if (xf86GetOptValFreq(pMga->Options, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) {
pMga->MemClk = (int)(real * 1000.0);
}
- if ((s = xf86GetOptValString(MGAOptions, OPTION_OVERLAY))) {
+ if ((s = xf86GetOptValString(pMga->Options, OPTION_OVERLAY))) {
if (!*s || !xf86NameCmp(s, "8,24") || !xf86NameCmp(s, "24,8")) {
if(pScrn->bitsPerPixel == 32 && pMga->SecondCrtc == FALSE) {
pMga->Overlay8Plus24 = TRUE;
if(!xf86GetOptValInteger(
- MGAOptions, OPTION_COLOR_KEY,&(pMga->colorKey)))
+ pMga->Options, OPTION_COLOR_KEY,&(pMga->colorKey)))
pMga->colorKey = TRANSPARENCY_KEY;
pScrn->colorKey = pMga->colorKey;
pScrn->overlayFlags = OVERLAY_8_32_PLANAR;
@@ -1538,7 +1573,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
}
}
- if(xf86GetOptValInteger(MGAOptions, OPTION_VIDEO_KEY, &(pMga->videoKey))) {
+ if(xf86GetOptValInteger(pMga->Options, OPTION_VIDEO_KEY, &(pMga->videoKey))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
pMga->videoKey);
} else {
@@ -1546,22 +1581,22 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
(1 << pScrn->offset.green) |
(((pScrn->mask.blue >> pScrn->offset.blue) - 1) << pScrn->offset.blue);
}
- if (xf86ReturnOptValBool(MGAOptions, OPTION_SHADOW_FB, FALSE)) {
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_SHADOW_FB, FALSE)) {
pMga->ShadowFB = TRUE;
pMga->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Using \"Shadow Framebuffer\" - acceleration disabled\n");
}
- if (xf86ReturnOptValBool(MGAOptions, OPTION_FBDEV, FALSE)) {
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_FBDEV, FALSE)) {
pMga->FBDev = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Using framebuffer device\n");
}
- if (xf86ReturnOptValBool(MGAOptions, OPTION_OVERCLOCK_MEM, FALSE)) {
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_OVERCLOCK_MEM, FALSE)) {
pMga->OverclockMem = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Overclocking memory\n");
}
- if (xf86ReturnOptValBool(MGAOptions, OPTION_TEXTURED_VIDEO, FALSE)) {
+ if (xf86ReturnOptValBool(pMga->Options, OPTION_TEXTURED_VIDEO, FALSE)) {
pMga->TexturedVideo = TRUE;
}
if (pMga->FBDev) {
@@ -1578,7 +1613,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->ValidMode = fbdevHWValidMode;
}
pMga->Rotate = 0;
- if ((s = xf86GetOptValString(MGAOptions, OPTION_ROTATE))) {
+ if ((s = xf86GetOptValString(pMga->Options, OPTION_ROTATE))) {
if(!xf86NameCmp(s, "CW")) {
pMga->ShadowFB = TRUE;
pMga->NoAccel = TRUE;
@@ -1772,11 +1807,11 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
Bool UseHalf = FALSE;
int adjust;
- xf86GetOptValBool(MGAOptions, OPTION_CRTC2HALF, &UseHalf);
+ xf86GetOptValBool(pMga->Options, OPTION_CRTC2HALF, &UseHalf);
adjust = pScrn->videoRam / 2;
if (UseHalf == TRUE ||
- xf86GetOptValInteger(MGAOptions, OPTION_CRTC2RAM, &adjust)) {
+ xf86GetOptValInteger(pMga->Options, OPTION_CRTC2RAM, &adjust)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Crtc2 will use %dK of VideoRam\n",
adjust);
@@ -1836,32 +1871,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
(*pMga->PreInit)(pScrn);
#if !defined(__powerpc__)
- /* Load DDC if we have the code to use it */
- /* This gives us DDC1 */
- if (pMga->ddc1Read || pMga->i2cInit) {
- if (xf86LoadSubModule(pScrn, "ddc")) {
- xf86LoaderReqSymLists(ddcSymbols, NULL);
- } else {
- /* ddc module not found, we can do without it */
- pMga->ddc1Read = NULL;
-
- /* Without DDC, we have no use for the I2C bus */
- pMga->i2cInit = NULL;
- }
- }
-#if MGAuseI2C
- /* - DDC can use I2C bus */
- /* Load I2C if we have the code to use it */
- if (pMga->i2cInit) {
- if ( xf86LoadSubModule(pScrn, "i2c") ) {
- xf86LoaderReqSymLists(i2cSymbols,NULL);
- } else {
- /* i2c module not found, we can do without it */
- pMga->i2cInit = NULL;
- pMga->I2C = NULL;
- }
- }
-#endif /* MGAuseI2C */
/* Read and print the Monitor DDC info */
pScrn->monitor->DDC = MGAdoDDC(pScrn);
@@ -2041,7 +2050,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
#ifdef USEMGAHAL
MGA_HAL(
swap_head
- = xf86ReturnOptValBool(MGAOptions, OPTION_SWAPPED_HEAD, FALSE);
+ = xf86ReturnOptValBool(pMga->Options, OPTION_SWAPPED_HEAD, FALSE);
if(pMga->SecondCrtc == FALSE) {
pMga->pBoard = xalloc(sizeof(CLIENTDATA) + MGAGetBOARDHANDLESize());
@@ -2557,7 +2566,7 @@ static void FillModeInfoStruct(ScrnInfoPtr pScrn, DisplayModePtr mode)
pMga->pMgaModeInfo->flSignalMode = 0x10;
/* Set TV standard */
- if ((s = xf86GetOptValString(MGAOptions, OPTION_TVSTANDARD))) {
+ if ((s = xf86GetOptValString(pMga->Options, OPTION_TVSTANDARD))) {
if (!xf86NameCmp(s, "PAL")) {
pMga->pMgaModeInfo->flSignalMode = 0x00;
pMga->pMgaModeInfo->ulRefreshRate = 50;
@@ -2572,7 +2581,7 @@ static void FillModeInfoStruct(ScrnInfoPtr pScrn, DisplayModePtr mode)
}
/* Set Cable Type */
- if ((s = xf86GetOptValString(MGAOptions, OPTION_CABLETYPE))) {
+ if ((s = xf86GetOptValString(pMga->Options, OPTION_CABLETYPE))) {
if (!xf86NameCmp(s, "SCART_RGB")) {
pMga->pMgaModeInfo->ulCableType = TV_SCART_RGB;
} else if (!xf86NameCmp(s, "SCART_COMPOSITE")) {
@@ -2623,7 +2632,7 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
Bool tv2 = FALSE;
ULONG status;
Bool swap_head
- = xf86ReturnOptValBool(MGAOptions, OPTION_SWAPPED_HEAD, FALSE);
+ = xf86ReturnOptValBool(pMga->Options, OPTION_SWAPPED_HEAD, FALSE);
if (pMga->pMgaHwInfo)
{
@@ -2933,6 +2942,22 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, 0x100, 0x000);
if (!fbdevHWModeInit(pScrn, pScrn->currentMode))
return FALSE;
+ if(pMga->SecondCrtc == FALSE && pMga->HWCursor == TRUE) {
+ switch (pMga->Chipset) {
+ case PCI_CHIP_MGA1064:
+ case PCI_CHIP_MGAG100:
+ case PCI_CHIP_MGAG100_PCI:
+ case PCI_CHIP_MGAG200:
+ case PCI_CHIP_MGAG200_PCI:
+ case PCI_CHIP_MGAG400:
+ outMGAdac(MGA1064_CURSOR_BASE_ADR_LOW, pMga->FbCursorOffset >> 10);
+ outMGAdac(MGA1064_CURSOR_BASE_ADR_HI, pMga->FbCursorOffset >> 18);
+ break;
+ default:
+ break;
+ }
+ }
+
MGAStormEngineInit(pScrn);
} else {
/* Save the current state */
@@ -3028,7 +3053,7 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
* InitGLXVisuals call back.
* The DRI does not work when textured video is enabled at this time.
*/
- if (!xf86ReturnOptValBool(MGAOptions, OPTION_DRI, TRUE)) {
+ if (!xf86ReturnOptValBool(pMga->Options, OPTION_DRI, TRUE)) {
driFrom = X_CONFIG;
} else if ( pMga->NoAccel ) {
xf86DrvMsg( pScrn->scrnIndex, X_ERROR,
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c
index c1aca3dd7..d11ab6bf0 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.88 2001/04/10 16:08:01 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.91 2001/05/10 21:53:48 dawes Exp $ */
/* All drivers should typically include these */
@@ -1007,7 +1007,11 @@ MGANAME(RestoreAccelState)(ScrnInfoPtr pScrn)
SET_FOREGROUND(tmp);
OUTREG(MGAREG_SRCORG, pMga->realSrcOrg);
OUTREG(MGAREG_DSTORG, pMga->DstOrg);
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT );
+#else
OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT | 0x10000);
+#endif
OUTREG(MGAREG_CXBNDRY, 0xFFFF0000); /* (maxX << 16) | minX */
OUTREG(MGAREG_YTOP, 0x00000000); /* minPixelPointer */
OUTREG(MGAREG_YBOT, 0x007FFFFF); /* maxPixelPointer */
@@ -1104,21 +1108,24 @@ MGAStormEngineInit(ScrnInfoPtr pScrn)
maccess |= (1 << 31);
Mga16InitSolidFillRectFuncs(pMga);
pMga->RestoreAccelState = Mga16RestoreAccelState;
- opmode |= 10000;
+ opmode |= 0x10000;
break;
case 24:
maccess |= 3;
Mga24InitSolidFillRectFuncs(pMga);
pMga->RestoreAccelState = Mga24RestoreAccelState;
+ opmode |= 0x20000;
break;
- opmode |= 20000;
case 32:
maccess |= 2;
Mga32InitSolidFillRectFuncs(pMga);
pMga->RestoreAccelState = Mga32RestoreAccelState;
- opmode |= 20000;
+ opmode |= 0x20000;
break;
}
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ opmode &= ~0x30000;
+#endif
pMga->fifoCount = 0;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c
index 2728fdf82..443099a9d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.24 2001/04/25 14:23:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.24.2.1 2001/06/01 02:24:18 dawes Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -688,8 +688,6 @@ MGADisplayVideoOverlay(
/* enable accelerated 2x horizontal zoom when pixelclock >135MHz */
hzoom = (pScrn->currentMode->Clock > 135000) ? 1 : 0;
- intrep = (((drw_w >= src_w) && !hzoom) || (drw_w == src_w) ||
- (drw_w < 2)) ? 0 : 1;
switch(id) {
case FOURCC_UYVY:
@@ -720,11 +718,13 @@ MGADisplayVideoOverlay(
OUTREG(MGAREG_BESV1WGHT, y1 & 0x0000fffc);
OUTREG(MGAREG_BESV1SRCLST, height - 1 - (y1 >> 16));
- tmp = ((src_h - 1) << 16)/drw_h;
+ intrep = ((drw_h == src_h) || (drw_h < 2)) ? 0 : 1;
+ tmp = ((src_h - intrep) << 16)/(drw_h - intrep);
if(tmp >= (32 << 16))
tmp = (32 << 16) - 1;
OUTREG(MGAREG_BESVISCAL, tmp & 0x001ffffc);
+ intrep = ((drw_w == src_w) || (drw_w < 2)) ? 0 : 1;
tmp = (((src_w - intrep) << 16)/(drw_w - intrep)) << hzoom;
if(tmp >= (32 << 16))
tmp = (32 << 16) - 1;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c
index ce7b033ea..ece710ac8 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c
@@ -22,7 +22,7 @@ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**********************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c,v 1.50 2001/02/15 17:44:24 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c,v 1.52 2001/05/15 10:19:39 eich Exp $ */
/*
* The original Precision Insight driver for
@@ -110,7 +110,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "extensions/xf86dgastr.h"
/* Mandatory functions */
-static OptionInfoPtr NEOAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * NEOAvailableOptions(int chipid, int busid);
static void NEOIdentify(int flags);
static Bool NEOProbe(DriverPtr drv, int flags);
static Bool NEOPreInit(ScrnInfoPtr pScrn, int flags);
@@ -265,7 +265,7 @@ typedef enum {
OPTION_ROTATE
} NEOOpts;
-static OptionInfoRec NEO_2070_Options[] = {
+static const OptionInfoRec NEO_2070_Options[] = {
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NO_MMIO, "noMMIO", OPTV_BOOLEAN, {0}, FALSE },
@@ -285,7 +285,7 @@ static OptionInfoRec NEO_2070_Options[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
-static OptionInfoRec NEOOptions[] = {
+static const OptionInfoRec NEOOptions[] = {
{ OPTION_NOLINEAR_MODE,"NoLinear", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
@@ -364,6 +364,8 @@ static const char *ddcSymbols[] = {
static const char *vbeSymbols[] = {
"VBEInit",
+ "vbeDoEDID",
+ "vbeFree",
NULL
};
@@ -458,8 +460,7 @@ NEOFreeRec(ScrnInfoPtr pScrn)
pScrn->driverPrivate = NULL;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
NEOAvailableOptions(int chipid, int busid)
{
int chip = (chipid & 0x0000ffff);
@@ -906,10 +907,15 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
/* Collect all of the relevant option flags (fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- if (nPtr->NeoChipset == NM2070)
- nPtr->Options = (OptionInfoPtr)NEO_2070_Options;
- else
- nPtr->Options = (OptionInfoPtr)NEOOptions;
+ if (nPtr->NeoChipset == NM2070) {
+ if (!(nPtr->Options = xalloc(sizeof(NEO_2070_Options))))
+ return FALSE;
+ memcpy(nPtr->Options, NEO_2070_Options, sizeof(NEO_2070_Options));
+ } else {
+ if (!(nPtr->Options = xalloc(sizeof(NEOOptions))))
+ return FALSE;
+ memcpy(nPtr->Options, NEOOptions, sizeof(NEOOptions));
+ }
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, nPtr->Options);
@@ -1332,7 +1338,7 @@ NEOScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
- miSetPixmapDepths ();
+ if (!miSetPixmapDepths ()) return FALSE;
/*
* Call the framebuffer layer's ScreenInit function, and fill in other
@@ -2797,7 +2803,9 @@ neoProbeDDC(ScrnInfoPtr pScrn, int index)
vbeInfoPtr pVbe;
if (xf86LoadSubModule(pScrn, "vbe")) {
- pVbe = VBEInit(NULL,index);
- ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ if ((pVbe = VBEInit(NULL,index))) {
+ ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
+ }
}
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile
index f3fc19a4b..b0e2d67af 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile,v 1.3 2001/01/24 00:06:22 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile,v 1.4 2001/05/16 06:48:09 keithp Exp $
#define IHaveModules
#include <Server.tmpl>
@@ -14,10 +14,9 @@ INCLUDES = -I. -I../../include
#else
INCLUDES = -I. \
-I$(XF86COMSRC) -I$(XF86OSSRC) \
- -I$(SERVERSRC)/mi -I$(SERVERSRC)/cfb \
- -I$(SERVERSRC)/mfb -I$(XF86SRC)/shadowfb \
+ -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb \
+ -I$(XF86SRC)/shadowfb \
-I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \
- -I$(XF86SRC)/xf24_32bpp \
-I$(EXTINCSRC) -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \
-I$(SERVERSRC)/include -I$(FONTINCSRC) -I$(XINCLUDESRC)
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h
index f6c787cc1..34e15014a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h
@@ -1,7 +1,7 @@
/*
* Id: newport.h,v 1.4 2000/11/29 20:58:10 agx Exp $
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h,v 1.2 2000/12/06 22:00:46 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h,v 1.3 2001/05/04 19:05:42 dawes Exp $ */
#ifndef __NEWPORT_H__
#define __NEWPORT_H__
@@ -50,6 +50,7 @@ typedef struct {
CARD8 txt_xmap9_cfg1; /* 1. Xmap9's control register */
CARD8 txt_xmap9_mi; /* Xmap9's mode index register */
LOCO txt_colormap[256];
+ OptionInfoPtr Options;
} NewportRec, *NewportPtr;
#define NEWPORTPTR(p) ((NewportPtr)((p)->driverPrivate))
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c
index c4b3fc455..3edac64d3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c
@@ -30,7 +30,7 @@
* Project.
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c,v 1.8 2001/04/01 14:00:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c,v 1.10 2001/05/16 06:48:09 keithp Exp $ */
/* function prototypes, common data structures & generic includes */
#include "newport.h"
@@ -42,12 +42,8 @@
/* Drivers using the mi colourmap code need: */
#include "micmap.h"
-/* Drivers using cfb need: */
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-#include "cfb24.h"
-#include "cfb24_32.h"
+/* Drivers using fb need: */
+#include "fb.h"
/* Drivers using the shadow frame buffer need: */
#include "shadowfb.h"
@@ -66,7 +62,7 @@
/* Prototypes ------------------------------------------------------- */
static void NewportIdentify(int flags);
-static OptionInfoPtr NewportAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * NewportAvailableOptions(int chipid, int busid);
static Bool NewportProbe(DriverPtr drv, int flags);
static Bool NewportPreInit(ScrnInfoPtr pScrn, int flags);
static Bool NewportScreenInit(int Index, ScreenPtr pScreen, int argc, char **argv);
@@ -104,8 +100,11 @@ static SymTabRec NewportChipsets[] = {
/* List of Symbols from other modules that this module references */
-static const char *cfbSymbols[] = {
- "cfbScreenInit",
+static const char *fbSymbols[] = {
+ "fbScreenInit",
+#ifdef RENDER
+ "fbPictureInit",
+#endif
NULL
};
@@ -153,7 +152,7 @@ newportSetup(pointer module, pointer opts, int *errmaj, int *errmin)
* might refer to.
*
*/
- LoaderRefSymLists( cfbSymbols, shadowSymbols, NULL);
+ LoaderRefSymLists( fbSymbols, shadowSymbols, NULL);
/*
@@ -175,7 +174,7 @@ typedef enum {
} NewportOpts;
/* Supported options */
-static OptionInfoRec NewportOptions [] = {
+static const OptionInfoRec NewportOptions [] = {
{ OPTION_BITPLANES, "bitplanes", OPTV_INTEGER, {0}, FALSE },
{ OPTION_BUS_ID, "BusID", OPTV_INTEGER, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
@@ -279,7 +278,6 @@ NewportPreInit(ScrnInfoPtr pScrn, int flags)
NewportPtr pNewport;
MessageType from;
ClockRangePtr clockRanges;
- char *mod=0, *reqSym=0;
if (flags & PROBE_DETECT) return FALSE;
@@ -352,7 +350,10 @@ NewportPreInit(ScrnInfoPtr pScrn, int flags)
/* Fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, NewportOptions);
+ if (!(pNewport->Options = xalloc(sizeof(NewportOptions))))
+ return FALSE;
+ memcpy(pNewport->Options, NewportOptions, sizeof(NewportOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pNewport->Options);
/* Set fields in ScreenInfoRec && NewportRec */
pScrn->videoRam = 1280 * (pScrn->bitsPerPixel >> 3);
@@ -369,7 +370,7 @@ NewportPreInit(ScrnInfoPtr pScrn, int flags)
pNewport->board_rev, pNewport->rex3_rev,
pNewport->cmap_rev, pNewport->xmap9_rev);
- if ( (xf86GetOptValInteger(NewportOptions, OPTION_BITPLANES, &pNewport->bitplanes)))
+ if ( (xf86GetOptValInteger(pNewport->Options, OPTION_BITPLANES, &pNewport->bitplanes)))
from = X_CONFIG;
xf86DrvMsg(pScrn->scrnIndex, from, "Newport has %d bitplanes\n", pNewport->bitplanes);
@@ -429,17 +430,12 @@ NewportPreInit(ScrnInfoPtr pScrn, int flags)
xf86PrintModes(pScrn);
xf86SetDpi (pScrn, 0, 0);
- switch(pScrn->bitsPerPixel) {
- case 8:
- mod = "cfb";
- reqSym = "cfbScreenInit";
- break;
- }
- if ( mod && (!xf86LoadSubModule(pScrn, mod))) {
+ /* Load FB module */
+ if (!xf86LoadSubModule (pScrn, "fb")) {
NewportFreeRec(pScrn);
return FALSE;
}
- xf86LoaderReqSymbols( reqSym, NULL);
+ xf86LoaderReqSymLists( fbSymbols, NULL);
/* Load ShadowFB module */
if (!xf86LoadSubModule(pScrn, "shadowfb")) {
@@ -476,6 +472,8 @@ NewportScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
+ miSetPixmapDepths ();
+
pNewport->Bpp = pScrn->bitsPerPixel >> 3;
/* Setup the stuff for the shadow framebuffer */
pNewport->ShadowPitch = (( pScrn->virtualX * pNewport->Bpp ) + 3) & ~3L;
@@ -484,23 +482,19 @@ NewportScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
if (!NewportModeInit(pScrn, pScrn->currentMode))
return FALSE;
- switch( pScrn->bitsPerPixel) {
- case 8:
- ret=cfbScreenInit(pScreen, pNewport->ShadowPtr,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- default:
- xf86Msg(X_ERROR,
- "Internal Error: Display depth not supported in NewportScreenInit.\n");
- ret=FALSE;
- break;
- }
+ ret = fbScreenInit(pScreen, pNewport->ShadowPtr,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth,
+ pScrn->bitsPerPixel);
if(!ret)
return FALSE;
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
+
/* we need rgb ordering if bitsPerPixel > 8 */
if (pScrn->bitsPerPixel > 8) {
for (i = 0, visual = pScreen->visuals;
@@ -622,7 +616,7 @@ NewportSaveScreen(ScreenPtr pScreen, int mode)
}
-static OptionInfoPtr
+static const OptionInfoRec *
NewportAvailableOptions(int chipid, int busid)
{
return NewportOptions;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c
index 4744100ec..24f65cc63 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c
@@ -24,7 +24,7 @@
/* Hacked together from mga driver and 3.3.4 NVIDIA driver by Jarno Paananen
<jpaana@s2.org> */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v 1.63 2001/03/28 01:17:43 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v 1.66 2001/05/15 10:19:39 eich Exp $ */
#include "nv_include.h"
@@ -40,7 +40,7 @@
* Forward definitions for the functions that make up the driver.
*/
/* Mandatory functions */
-static OptionInfoPtr NVAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * NVAvailableOptions(int chipid, int busid);
static void NVIdentify(int flags);
static Bool NVProbe(DriverPtr drv, int flags);
static Bool NVPreInit(ScrnInfoPtr pScrn, int flags);
@@ -294,11 +294,12 @@ typedef enum {
OPTION_SHADOW_FB,
OPTION_FBDEV,
OPTION_ROTATE,
- OPTION_VIDEO_KEY
+ OPTION_VIDEO_KEY,
+ OPTION_FLAT_PANEL
} NVOpts;
-static OptionInfoRec NVOptions[] = {
+static const OptionInfoRec NVOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
@@ -307,6 +308,7 @@ static OptionInfoRec NVOptions[] = {
{ OPTION_FBDEV, "UseFBDev", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE },
{ OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_FLAT_PANEL, "FlatPanel", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -403,8 +405,7 @@ nvSetup(pointer module, pointer opts, int *errmaj, int *errmin)
#endif /* XFree86LOADER */
-static
-OptionInfoPtr
+static const OptionInfoRec *
NVAvailableOptions(int chipid, int busid)
{
return NVOptions;
@@ -652,6 +653,8 @@ NVCloseScreen(int scrnIndex, ScreenPtr pScreen)
NVUnmapMem(pScrn);
vgaHWUnmapMem(pScrn);
+ if (pNv->pInt)
+ xf86FreeInt10(pNv->pInt);
if (pNv->AccelInfoRec)
XAADestroyInfoRec(pNv->AccelInfoRec);
if (pNv->CursorInfoRec)
@@ -823,6 +826,7 @@ nvProbeDDC(ScrnInfoPtr pScrn, int index)
if (xf86LoadSubModule(pScrn, "vbe")) {
pVbe = VBEInit(NULL,index);
ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
}
}
@@ -944,11 +948,13 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
if (pScrn->chipset == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"ChipID 0x%04X is not recognised\n", pNv->Chipset);
+ xf86FreeInt10(pNv->pInt);
return FALSE;
}
if (pNv->Chipset < 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Chipset \"%s\" is not recognised\n", pScrn->chipset);
+ xf86FreeInt10(pNv->pInt);
return FALSE;
}
@@ -961,6 +967,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
*/
if (!xf86SetDepthBpp(pScrn, 8, 8, 8, Support32bppFb)) {
+ xf86FreeInt10(pNv->pInt);
return FALSE;
} else {
/* Check that the returned depth is one we support */
@@ -982,6 +989,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Given depth (%d) is not supported by this driver\n",
pScrn->depth);
+ xf86FreeInt10(pNv->pInt);
return FALSE;
}
}
@@ -999,11 +1007,14 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
/* The defaults are OK for us */
rgb zeros = {0, 0, 0};
- if (!xf86SetWeight(pScrn, zeros, zeros))
+ if (!xf86SetWeight(pScrn, zeros, zeros)) {
+ xf86FreeInt10(pNv->pInt);
return FALSE;
+ }
}
if (!xf86SetDefaultVisual(pScrn, -1)) {
+ xf86FreeInt10(pNv->pInt);
return FALSE;
} else {
/* We don't currently support DirectColor at > 8bpp */
@@ -1011,6 +1022,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual"
" (%s) is not supported at depth %d\n",
xf86GetVisualName(pScrn->defaultVisual), pScrn->depth);
+ xf86FreeInt10(pNv->pInt);
return FALSE;
}
}
@@ -1018,17 +1030,21 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
bytesPerPixel = pScrn->bitsPerPixel / 8;
/* The vgahw module should be loaded here when needed */
- if (!xf86LoadSubModule(pScrn, "vgahw"))
+ if (!xf86LoadSubModule(pScrn, "vgahw")) {
+ xf86FreeInt10(pNv->pInt);
return FALSE;
-
+ }
+
xf86LoaderReqSymLists(vgahwSymbols, NULL);
/*
* Allocate a vgaHWRec
*/
- if (!vgaHWGetHWRec(pScrn))
+ if (!vgaHWGetHWRec(pScrn)) {
+ xf86FreeInt10(pNv->pInt);
return FALSE;
-
+ }
+
/* We use a programamble clock */
pScrn->progClock = TRUE;
@@ -1036,7 +1052,10 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, NVOptions);
+ if (!(pNv->Options = xalloc(sizeof(NVOptions))))
+ return FALSE;
+ memcpy(pNv->Options, NVOptions, sizeof(NVOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pNv->Options);
/* Set the bits per RGB for 8bpp mode */
if (pScrn->depth == 8)
@@ -1048,42 +1067,47 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
* The preferred method is to use the "hw cursor" option as a tri-state
* option, with the default set above.
*/
- if (xf86GetOptValBool(NVOptions, OPTION_HW_CURSOR, &pNv->HWCursor)) {
+ if (xf86GetOptValBool(pNv->Options, OPTION_HW_CURSOR, &pNv->HWCursor)) {
from = X_CONFIG;
}
/* For compatibility, accept this too (as an override) */
- if (xf86ReturnOptValBool(NVOptions, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(pNv->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pNv->HWCursor = FALSE;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pNv->HWCursor ? "HW" : "SW");
- if (xf86ReturnOptValBool(NVOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pNv->Options, OPTION_NOACCEL, FALSE)) {
pNv->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
- if (xf86ReturnOptValBool(NVOptions, OPTION_SHOWCACHE, FALSE)) {
+ if (xf86ReturnOptValBool(pNv->Options, OPTION_SHOWCACHE, FALSE)) {
pNv->ShowCache = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n");
}
- if (xf86ReturnOptValBool(NVOptions, OPTION_SHADOW_FB, FALSE)) {
+ if (xf86ReturnOptValBool(pNv->Options, OPTION_SHADOW_FB, FALSE)) {
pNv->ShadowFB = TRUE;
pNv->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Using \"Shadow Framebuffer\" - acceleration disabled\n");
}
- if (xf86ReturnOptValBool(NVOptions, OPTION_FBDEV, FALSE)) {
+ if (xf86ReturnOptValBool(pNv->Options, OPTION_FBDEV, FALSE)) {
pNv->FBDev = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Using framebuffer device\n");
}
if (pNv->FBDev) {
/* check for linux framebuffer device */
- if (!xf86LoadSubModule(pScrn, "fbdevhw"))
+ if (!xf86LoadSubModule(pScrn, "fbdevhw")) {
+ xf86FreeInt10(pNv->pInt);
return FALSE;
+ }
+
xf86LoaderReqSymLists(fbdevHWSymbols, NULL);
- if (!fbdevHWInit(pScrn, pNv->PciInfo, NULL))
+ if (!fbdevHWInit(pScrn, pNv->PciInfo, NULL)) {
+ xf86FreeInt10(pNv->pInt);
return FALSE;
+ }
pScrn->SwitchMode = fbdevHWSwitchMode;
pScrn->AdjustFrame = fbdevHWAdjustFrame;
pScrn->EnterVT = NVEnterVTFBDev;
@@ -1091,7 +1115,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->ValidMode = fbdevHWValidMode;
}
pNv->Rotate = 0;
- if ((s = xf86GetOptValString(NVOptions, OPTION_ROTATE))) {
+ if ((s = xf86GetOptValString(pNv->Options, OPTION_ROTATE))) {
if(!xf86NameCmp(s, "CW")) {
pNv->ShadowFB = TRUE;
pNv->NoAccel = TRUE;
@@ -1114,7 +1138,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
"Valid options are \"CW\" or \"CCW\"\n");
}
}
- if(xf86GetOptValInteger(NVOptions, OPTION_VIDEO_KEY, &(pNv->videoKey))) {
+ if(xf86GetOptValInteger(pNv->Options, OPTION_VIDEO_KEY, &(pNv->videoKey))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
pNv->videoKey);
} else {
@@ -1123,6 +1147,10 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
(((pScrn->mask.blue >> pScrn->offset.blue) - 1) << pScrn->offset.blue);
}
+ if (xf86ReturnOptValBool(pNv->Options, OPTION_FLAT_PANEL, FALSE)) {
+ pNv->FlatPanel = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "using flat panel\n");
+ }
if (pNv->pEnt->device->MemBase != 0) {
/* Require that the config file value matches one of the PCI values. */
@@ -1130,6 +1158,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"MemBase 0x%08lX doesn't match any PCI base register.\n",
pNv->pEnt->device->MemBase);
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1144,6 +1173,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
} else {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"No valid FB address in PCI config space\n");
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1157,6 +1187,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"IOBase 0x%08lX doesn't match any PCI base register.\n",
pNv->pEnt->device->IOBase);
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1170,6 +1201,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
} else {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"No valid MMIO address in PCI config space\n");
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1180,6 +1212,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
if (xf86RegisterResources(pNv->pEnt->index, NULL, ResExclusive)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"xf86RegisterResources() found resource conflicts\n");
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1289,6 +1322,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
Gamma zeros = {0.0, 0.0, 0.0};
if (!xf86SetGamma(pScrn, zeros)) {
+ xf86FreeInt10(pNv->pInt);
return FALSE;
}
}
@@ -1345,6 +1379,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
i = 1;
}
if (i == -1) {
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1354,6 +1389,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
if (i == 0 || pScrn->modes == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1399,9 +1435,11 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
reqSym = "cfb32ScreenInit";
break;
default:
+ xf86FreeInt10(pNv->pInt);
return FALSE;
}
if (mod && xf86LoadSubModule(pScrn, mod) == NULL) {
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1409,6 +1447,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
xf86LoaderReqSymbols(reqSym, NULL);
#else
if (xf86LoadSubModule(pScrn, "fb") == NULL) {
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1419,6 +1458,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
/* Load XAA if needed */
if (!pNv->NoAccel) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1428,6 +1468,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
/* Load ramdac if needed */
if (pNv->HWCursor) {
if (!xf86LoadSubModule(pScrn, "ramdac")) {
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1437,6 +1478,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
/* Load shadowfb if needed */
if (pNv->ShadowFB) {
if (!xf86LoadSubModule(pScrn, "shadowfb")) {
+ xf86FreeInt10(pNv->pInt);
NVFreeRec(pScrn);
return FALSE;
}
@@ -1818,8 +1860,7 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
Must follow initialization of the default colormap */
if(!xf86HandleColormaps(pScreen, 256, 8,
(pNv->FBDev ? fbdevHWLoadPalette : NVdac->LoadPalette),
- NULL, CMAP_RELOAD_ON_MODE_SWITCH |
- ((pNv->riva.Architecture != NV_ARCH_03) ? CMAP_PALETTED_TRUECOLOR : 0)))
+ NULL, CMAP_RELOAD_ON_MODE_SWITCH | CMAP_PALETTED_TRUECOLOR))
return FALSE;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Palette loaded\n"));
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h
index 4fc8107a2..6e8b4f457 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h,v 1.22 2001/03/28 01:17:43 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h,v 1.24 2001/05/09 00:39:51 mvojkovi Exp $ */
#ifndef __NV_STRUCT_H__
#define __NV_STRUCT_H__
@@ -117,6 +117,8 @@ typedef struct {
void (*VideoTimerCallback)(ScrnInfoPtr, Time);
XF86VideoAdaptorPtr overlayAdaptor;
int videoKey;
+ Bool FlatPanel;
+ OptionInfoPtr Options;
} NVRec, *NVPtr;
#define NVPTR(p) ((NVPtr)((p)->driverPrivate))
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile
index 0312c431d..77440d922 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile,v 1.18 2001/01/24 00:06:26 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile,v 1.19 2001/05/16 06:48:10 keithp Exp $
XCOMM
XCOMM This is an Imakefile for the Rendition driver.
@@ -16,14 +16,12 @@ OBJS = rendition.o vboard.o vmodes.o vramdac.o v1krisc.o vvga.o \
#if defined(XF86DriverSDK)
INCLUDES = -I. -I../../include
#else
-INCLUDES = -I. -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \
- -I$(SERVERSRC)/cfb -I$(SERVERSRC)/mfb \
+INCLUDES = -I. -I$(SERVERSRC)/fb \
-I$(SERVERSRC)/mi -I$(SERVERSRC)/cfb\
-I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(XF86SRC)/vgahw \
-I$(XF86SRC)/rac -I$(XF86SRC)/int10 -I$(XF86OSSRC)/vbe \
-I$(XF86COMSRC) -I$(XF86OSSRC) -I$(FONTINCSRC) -I$(XINCLUDESRC) \
-I$(SERVERSRC)/include -I$(XF86SRC)/xaa \
- -I$(XF86SRC)/xf24_32bpp -I$(XF86SRC)/xf8_32bpp \
-I$(XF86SRC)/ramdac -I$(SERVERSRC)/Xext \
-I$(XF86SRC)/shadowfb -I$(XF86SRC)/rac -I$(XF86SRC)/loader \
-I$(SERVERSRC)/render -I$(EXTINCSRC)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c b/xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c
index aad4fb8a7..3e48d0845 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c
@@ -3,7 +3,7 @@
*
* accelerator functions for X
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c,v 1.8 2000/06/13 02:28:33 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c,v 1.9 2001/05/16 06:48:10 keithp Exp $ */
@@ -112,7 +112,6 @@ void
RENDITIONAccelPreInit(ScrnInfoPtr pScreenInfo)
{
renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
- int c;
#ifdef DEBUG
ErrorF("RENDITION: RENDITIONAccelPreInit called\n");
@@ -140,7 +139,6 @@ RENDITIONAccelXAAInit(ScreenPtr pScreen)
XAAInfoRecPtr pXAAinfo;
BoxRec AvailFBArea;
- int c;
#ifdef DEBUG
ErrorF("RENDITION: RENDITIONAccelInit called\n");
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c
index a12d8171e..9159e7cb9 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v 1.40 2001/02/15 17:50:33 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v 1.42 2001/05/16 06:48:10 keithp Exp $ */
/*
* Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
*
@@ -82,7 +82,7 @@
* local function prototypes
*/
-static OptionInfoPtr renditionAvailableOptions(int, int);
+static const OptionInfoRec * renditionAvailableOptions(int, int);
static void renditionIdentify(int);
static Bool renditionProbe(DriverPtr, int);
static Bool renditionPreInit(ScrnInfoPtr, int);
@@ -108,7 +108,7 @@ static void renditionLoadPalette(ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
* global data
*/
-OptionInfoRec renditionOptions[]={
+OptionInfoRec const renditionOptions[]={
{ OPTION_FBWC, "FramebufferWC", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SW_Cursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
@@ -187,9 +187,10 @@ static const char *int10Symbols[] = {
static const char *fbSymbols[]={
"xf1bppScreenInit",
"xf4bppScreenInit",
- "cfbScreenInit",
- "cfb16ScreenInit",
- "cfb32ScreenInit",
+ "fbScreenInit",
+#ifdef RENDER
+ "fbPictureInit",
+#endif
NULL
};
@@ -274,7 +275,7 @@ static PciChipsets renditionPCIchipsets[] = {
* functions
*/
-static OptionInfoPtr
+static const OptionInfoRec *
renditionAvailableOptions(int chipid, int busid)
{
return renditionOptions;
@@ -466,12 +467,10 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags)
{
static ClockRange renditionClockRange = {NULL, 0, 135000, -1, FALSE, TRUE, 1, 1, 0};
MessageType From;
- int i, videoRam, Rounding, nModes = 0;
- char *Module;
- const char *Sym;
- vgaHWPtr pvgaHW;
+ int videoRam, Rounding, nModes = 0;
renditionPtr pRendition;
char *in_string;
+ vgaHWPtr pvgaHW;
#ifdef DEBUG
ErrorF("Rendition: renditionPreInit() called\n");
@@ -540,43 +539,31 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags)
if (!xf86SetDepthBpp(pScreenInfo, 8, 8, 8, Support32bppFb))
return FALSE;
- switch (pScreenInfo->depth) {
- case 8: Module = "cfb"; Sym = "cfbScreenInit"; break;
-
- case 15: if (PCI_CHIP_V1000==pRendition->PciInfo->chipType){
- Module = "cfb16"; Sym = "cfbScreenInit16"; break;
- }
- else {
- xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ if (pScreenInfo->depth == 15)
+ {
+ if (PCI_CHIP_V1000 != pRendition->PciInfo->chipType) {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
"Given depth (%d) is not supported by this chipset.\n",
pScreenInfo->depth);
- return FALSE;
- }
- case 16: Module = "cfb16"; Sym = "cfbScreenInit16"; break;
-
- case 24: Module = "cfb32"; Sym = "cfbScreenInit32"; break;
-
- default:
- xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
- "Given depth (%d) is not supported by this driver.\n",
- pScreenInfo->depth);
- return FALSE;
+ return FALSE;
+ }
}
-
-
/* collect all of the options flags and process them */
xf86CollectOptions(pScreenInfo, NULL);
+ if (!(pRendition->Options = xalloc(sizeof(renditionOptions))))
+ return FALSE;
+ memcpy(pRendition->Options, renditionOptions, sizeof(renditionOptions));
xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options,
- renditionOptions);
+ pRendition->Options);
- /* Ensure depth-specific entry points are available */
- if (!xf86LoadSubModule(pScreenInfo, Module))
+ /* Load fb */
+ if (!xf86LoadSubModule(pScreenInfo, "fb"))
return FALSE;
- xf86LoaderReqSymbols(Sym, NULL);
+ xf86LoaderReqSymbols("fbScreenInit", NULL);
/* determine colour weights */
pScreenInfo->rgbBits=8;
@@ -661,7 +648,7 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags)
/* Reserv memory and load the microcode */
/****************************************/
#if USE_ACCEL
- if (!xf86ReturnOptValBool(renditionOptions, OPTION_NOACCEL,0)) {
+ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NOACCEL,0)) {
RENDITIONAccelPreInit (pScreenInfo);
}
else
@@ -672,8 +659,6 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags)
("Skipping acceleration\n"));
#endif
- xf86MarkOptionUsedByName(renditionOptions,"NoAccel");
-
From = X_PROBED;
xf86DrvMsg(pScreenInfo->scrnIndex, From, "videoRam: %d kBytes\n", videoRam);
pScreenInfo->videoRam=videoRam;
@@ -689,7 +674,7 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags)
pRendition->board.shadowfb=TRUE;
- if ((in_string = xf86GetOptValString(renditionOptions, OPTION_ROTATE))) {
+ if ((in_string = xf86GetOptValString(pRendition->Options, OPTION_ROTATE))) {
if(!xf86NameCmp(in_string, "CW")) {
/* accel is disabled below for shadowFB */
pRendition->board.shadowfb = TRUE;
@@ -708,9 +693,8 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags)
"Valid options are \"CW\" or \"CCW\"\n");
}
}
- xf86MarkOptionUsedByName(renditionOptions,"Rotate");
- if (xf86ReturnOptValBool(renditionOptions, OPTION_SHADOW_FB,1)||
+ if (xf86ReturnOptValBool(pRendition->Options, OPTION_SHADOW_FB,1)||
pRendition->board.rotate) {
if (!xf86LoadSubModule(pScreenInfo, "shadowfb")) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
@@ -728,22 +712,20 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags)
xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
"\"Shadow Framebuffer\" disabled\n");
}
- xf86MarkOptionUsedByName(renditionOptions,"ShadowFB");
/* Load Ramdac module if needed */
- if (!xf86ReturnOptValBool(renditionOptions, OPTION_SW_CURSOR,0) &&
+ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_SW_CURSOR,0) &&
!pRendition->board.rotate){
if (!xf86LoadSubModule(pScreenInfo, "ramdac")) {
return FALSE;
}
xf86LoaderReqSymLists(ramdacSymbols, NULL);
}
- xf86MarkOptionUsedByName(renditionOptions,"SWCursor");
#if USE_ACCEL
/* Load XAA if needed */
- if (!xf86ReturnOptValBool(renditionOptions, OPTION_NOACCEL,0) &&
+ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NOACCEL,0) &&
!pRendition->board.rotate) {
if (!xf86LoadSubModule(pScreenInfo, "xaa")) {
return FALSE;
@@ -754,7 +736,7 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags)
#if 0
/* Load DDC module if needed */
- if (!xf86ReturnOptValBool(renditionOptions, OPTION_NO_DDC,0)){
+ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NO_DDC,0)){
if (!xf86LoadSubModule(pScreenInfo, "ddc")) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
("Loading of DDC library failed, skipping DDC-probe\n"));
@@ -770,7 +752,7 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags)
}
#else
/* Load DDC module if needed */
- if (!xf86ReturnOptValBool(renditionOptions, OPTION_NO_DDC,0)){
+ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NO_DDC,0)){
if (!xf86LoadSubModule(pScreenInfo, "vbe")) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
("Loading of DDC library failed, skipping DDC-probe\n"));
@@ -860,7 +842,7 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags)
if (!pScreenInfo->chipset)
pScreenInfo->chipset = (char *)renditionChipsets[0].name;
- if(!xf86ReturnOptValBool(renditionOptions, OPTION_SW_CURSOR,0)){
+ if(!xf86ReturnOptValBool(pRendition->Options, OPTION_SW_CURSOR,0)){
if(!pRendition->board.rotate)
/* Do preemtive things for HW cursor */
RenditionHWCursorPreInit(pScreenInfo);
@@ -1139,10 +1121,9 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
Bool Inited = FALSE;
unsigned char *FBBase;
VisualPtr visual;
+ vgaHWPtr pvgaHW;
int displayWidth,width,height;
- vgaHWPtr pvgaHW;
-
#ifdef DEBUG
ErrorF("RENDITION: renditionScreenInit() called\n");
sleep(1);
@@ -1167,6 +1148,8 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScreenInfo->rgbBits, pScreenInfo->defaultVisual))
return FALSE;
+ miSetPixmapDepths ();
+
if (pRendition->board.rotate) {
height = pScreenInfo->virtualX;
width = pScreenInfo->virtualY;
@@ -1187,38 +1170,18 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
displayWidth=pScreenInfo->displayWidth;
}
-
- /* initialise the framebuffer */
- switch (pScreenInfo->bitsPerPixel)
- {
- case 8:
- Inited = cfbScreenInit(pScreen, FBBase,
- width, height,
- pScreenInfo->xDpi, pScreenInfo->yDpi,
- displayWidth);
- break;
- case 16:
- Inited = cfb16ScreenInit(pScreen, FBBase,
- width, height,
- pScreenInfo->xDpi, pScreenInfo->yDpi,
- displayWidth);
- break;
- case 32:
- Inited = cfb32ScreenInit(pScreen, FBBase,
- width, height,
- pScreenInfo->xDpi, pScreenInfo->yDpi,
- displayWidth);
- break;
- default:
- xf86DrvMsg(scrnIndex, X_ERROR,
- "Internal error: invalid bpp (%d) in renditionScreenInit\n",
- pScreenInfo->bitsPerPixel);
- break;
- }
-
+ Inited = fbScreenInit(pScreen, FBBase,
+ width, height,
+ pScreenInfo->xDpi, pScreenInfo->yDpi,
+ displayWidth,
+ pScreenInfo->bitsPerPixel);
+
if (!Inited)
return FALSE;
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
if (pScreenInfo->bitsPerPixel > 8) {
/* Fixup RGB ordering */
@@ -1279,10 +1242,10 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/*********************************************************/
/* The actual setup of the driver-specific code */
- /* has to be after cfb*ScreenInit and before cursor init */
+ /* has to be after fbScreenInit and before cursor init */
/*********************************************************/
#if USE_ACCEL
- if (!xf86ReturnOptValBool(renditionOptions, OPTION_NOACCEL,0))
+ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NOACCEL,0))
RENDITIONAccelXAAInit (pScreen);
#endif
@@ -1290,7 +1253,7 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86SetSilkenMouse(pScreen);
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
- if(!xf86ReturnOptValBool(renditionOptions, OPTION_SW_CURSOR,0)&&
+ if(!xf86ReturnOptValBool(pRendition->Options, OPTION_SW_CURSOR,0)&&
!pRendition->board.rotate){
/* Initialise HW cursor */
if(!RenditionHWCursorInit(scrnIndex, pScreen)){
@@ -1335,10 +1298,9 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86DPMSInit(pScreen, renditionDPMSSet, 0);
- if (xf86ReturnOptValBool(renditionOptions, OPTION_OVERCLOCK_MEM,0)) {
+ if (xf86ReturnOptValBool(pRendition->Options, OPTION_OVERCLOCK_MEM,0)) {
RENDITIONPTR(pScreenInfo)->board.overclock_mem=TRUE;
}
- xf86MarkOptionUsedByName(renditionOptions,"Overclock_Mem");
/* Wrap the screen's CloseScreen vector and set its SaveScreen vector */
prenditionPriv->CloseScreen = pScreen->CloseScreen;
@@ -1434,15 +1396,16 @@ renditionMapMem(ScrnInfoPtr pScreenInfo)
{
Bool WriteCombine;
int mapOption;
+ renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
#ifdef DEBUG
ErrorF("Mapping ...\n");
ErrorF("%d %d %d %x %d\n", pScreenInfo->scrnIndex, VIDMEM_FRAMEBUFFER,
- RENDITIONPTR(pScreenInfo)->pcitag,
- RENDITIONPTR(pScreenInfo)->board.mem_base, pScreenInfo->videoRam);
+ pRendition->pcitag,
+ pRendition->board.mem_base, pScreenInfo->videoRam);
#endif
- if (RENDITIONPTR(pScreenInfo)->board.chip==V1000_DEVICE){
+ if (pRendition->board.chip==V1000_DEVICE){
/* Some V1000 boards are known to have problems with Write-Combining */
/* V2x00 also found to have similar problems with memcpy & WC ! */
WriteCombine = 0;
@@ -1452,7 +1415,7 @@ renditionMapMem(ScrnInfoPtr pScreenInfo)
WriteCombine = 1;
}
/* Override on users request */
- WriteCombine=xf86ReturnOptValBool(renditionOptions, OPTION_FBWC, WriteCombine);
+ WriteCombine=xf86ReturnOptValBool(pRendition->Options, OPTION_FBWC, WriteCombine);
if (WriteCombine){
xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
("Requesting Write-Combined memory access\n"));
@@ -1464,12 +1427,10 @@ renditionMapMem(ScrnInfoPtr pScreenInfo)
mapOption = VIDMEM_MMIO;
}
- xf86MarkOptionUsedByName(renditionOptions,"FramebufferWC");
-
- RENDITIONPTR(pScreenInfo)->board.vmem_base=
+ pRendition->board.vmem_base=
xf86MapPciMem(pScreenInfo->scrnIndex, mapOption,
- RENDITIONPTR(pScreenInfo)->pcitag,
- (unsigned long)RENDITIONPTR(pScreenInfo)->board.mem_base,
+ pRendition->pcitag,
+ (unsigned long)pRendition->board.mem_base,
pScreenInfo->videoRam);
return TRUE;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h
index 6a5a6e81b..3ec672636 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h,v 1.6 2000/04/04 19:25:15 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h,v 1.7 2001/05/16 06:48:10 keithp Exp $ */
#ifndef __RENDITION_H__
#define __RENDITION_H__
@@ -51,21 +51,9 @@
/* Needed for replacement LoadPalette function for Gamma Correction */
#include "xf86cmap.h"
-/* Needed for the 1 and 4 bpp framebuffers */
-#include "xf1bpp.h"
-#include "xf4bpp.h"
+/* Drivers using fb need this */
-/* Drivers using cfb need this */
-
-#undef PSZ
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
-
-/* Drivers supporting bpp 16, 24 or 32 with cfb need these */
-
-#include "cfb16.h"
-#include "cfb32.h"
+#include "fb.h"
/* Drivers using the XAA interface ... */
#include "xaa.h"
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h
index 89eb3d1df..c41db4940 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h,v 1.4 2000/03/01 00:25:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h,v 1.5 2001/05/04 19:05:42 dawes Exp $ */
#ifndef __RENDITION_OPTION_H__
#define __RENDITION_OPTION_H__
@@ -20,7 +20,7 @@ typedef enum {
/*********************************/
For reference only <DI>
-static OptionInfoRec renditionOptions[]={
+static const OptionInfoRec renditionOptions[]={
{ OPTION_FBWC, "FramebufferWC", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SW_CURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c
index 740cc07ac..aa0aa358e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c,v 1.9 2001/02/15 17:50:34 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c,v 1.10 2001/05/04 19:05:42 dawes Exp $ */
/*
* file vmodes.c
*
@@ -22,11 +22,6 @@
#undef DEBUG
-/* Options data */
-#include "rendition_options.h"
-extern OptionInfoRec renditionOptions[];
-
-
/*
* defines
*/
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c
index 2a3f0ed4b..05d6b9951 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c,v 1.12 2001/02/15 17:50:34 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c,v 1.13 2001/05/16 06:48:10 keithp Exp $ */
/*
* includes
*/
@@ -422,7 +422,6 @@ verite_setpalette(ScrnInfoPtr pScreenInfo, int numColors, int *indices,
vu16 iob=pRendition->board.io_base;
vu32 crtc_status;
int i, index;
- int c;
#ifdef DEBUG
ErrorF ("Rendition: Debug verite_setpalette called\n");
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h
index 8fd62e5e5..8a14825ae 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h,v 1.6 2000/03/31 20:13:28 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h,v 1.7 2001/05/04 19:05:42 dawes Exp $ */
#ifndef _VTYPES_H_
#define _VTYPES_H_
@@ -166,6 +166,7 @@ typedef struct _renditionRec
CloseScreenProcPtr CloseScreen; /* wrap CloseScreen */
xf86CursorInfoPtr CursorInfoRec; /* Cursor data */
XAAInfoRecPtr AccelInfoRec; /* Needed for XAA */
+ OptionInfoPtr Options;
} renditionRec, *renditionPtr;
#define RENDITIONPTR(p) ((renditionPtr)((p)->driverPrivate))
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h
index 2267c744e..8acefe9b9 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h,v 1.26 2000/11/28 20:59:17 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h,v 1.27 2001/05/04 19:05:43 dawes Exp $ */
/*
Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved.
@@ -257,6 +257,7 @@ typedef struct tagS3VRec {
/*************************/
/* ViRGE options -start- */
/*************************/
+ OptionInfoPtr Options;
/* Enable PCI burst mode for reads? */
Bool pci_burst;
/* Diasable PCI retries */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c
index 191dc9d57..85036ef74 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c,v 1.72 2001/02/09 03:23:29 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c,v 1.74.2.2 2001/05/28 08:40:10 eich Exp $ */
/*
Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved.
@@ -67,7 +67,7 @@ static void S3VDisableMmio(ScrnInfoPtr pScrn);
*/
/* Mandatory functions */
-static OptionInfoPtr S3VAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * S3VAvailableOptions(int chipid, int busid);
static void S3VIdentify(int flags);
static Bool S3VProbe(DriverPtr drv, int flags);
static Bool S3VPreInit(ScrnInfoPtr pScrn, int flags);
@@ -210,7 +210,7 @@ typedef enum {
OPTION_FB_DRAW
} S3VOpts;
-static OptionInfoRec S3VOptions[] =
+static const OptionInfoRec S3VOptions[] =
{
{ OPTION_SLOW_EDODRAM, "slow_edodram", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SLOW_DRAM, "slow_dram", OPTV_BOOLEAN, {0}, FALSE },
@@ -469,8 +469,7 @@ S3VFreeRec(ScrnInfoPtr pScrn)
pScrn->driverPrivate = NULL;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
S3VAvailableOptions(int chipid, int busid)
{
return S3VOptions;
@@ -684,10 +683,13 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
}
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, S3VOptions);
+ if (!(ps3v->Options = xalloc(sizeof(S3VOptions))))
+ return FALSE;
+ memcpy(ps3v->Options, S3VOptions, sizeof(S3VOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ps3v->Options);
- if (xf86ReturnOptValBool(S3VOptions, OPTION_PCI_BURST, FALSE)) {
+ if (xf86ReturnOptValBool(ps3v->Options, OPTION_PCI_BURST, FALSE)) {
ps3v->pci_burst = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_burst - PCI burst read enabled\n");
} else
@@ -695,8 +697,8 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
/* default */
ps3v->NoPCIRetry = 1;
/* Set option */
- if (xf86ReturnOptValBool(S3VOptions, OPTION_PCI_RETRY, FALSE)) {
- if (xf86ReturnOptValBool(S3VOptions, OPTION_PCI_BURST, FALSE)) {
+ if (xf86ReturnOptValBool(ps3v->Options, OPTION_PCI_RETRY, FALSE)) {
+ if (xf86ReturnOptValBool(ps3v->Options, OPTION_PCI_BURST, FALSE)) {
ps3v->NoPCIRetry = 0;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_retry\n");
}
@@ -705,85 +707,85 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
"\"pci_retry\" option requires \"pci_burst\".\n");
}
}
- if (xf86IsOptionSet(S3VOptions, OPTION_FIFO_CONSERV)) {
+ if (xf86IsOptionSet(ps3v->Options, OPTION_FIFO_CONSERV)) {
ps3v->fifo_conservative = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_conservative set\n");
} else
ps3v->fifo_conservative = FALSE;
- if (xf86IsOptionSet(S3VOptions, OPTION_FIFO_MODERATE)) {
+ if (xf86IsOptionSet(ps3v->Options, OPTION_FIFO_MODERATE)) {
ps3v->fifo_moderate = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_moderate set\n");
} else
ps3v->fifo_moderate = FALSE;
- if (xf86IsOptionSet(S3VOptions, OPTION_FIFO_AGGRESSIVE)) {
+ if (xf86IsOptionSet(ps3v->Options, OPTION_FIFO_AGGRESSIVE)) {
ps3v->fifo_aggressive = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_aggressive set\n");
} else
ps3v->fifo_aggressive = FALSE;
- if (xf86IsOptionSet(S3VOptions, OPTION_SLOW_EDODRAM)) {
+ if (xf86IsOptionSet(ps3v->Options, OPTION_SLOW_EDODRAM)) {
ps3v->slow_edodram = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: slow_edodram set\n");
} else
ps3v->slow_edodram = FALSE;
- if (xf86IsOptionSet(S3VOptions, OPTION_SLOW_DRAM)) {
+ if (xf86IsOptionSet(ps3v->Options, OPTION_SLOW_DRAM)) {
ps3v->slow_dram = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: slow_dram set\n");
} else
ps3v->slow_dram = FALSE;
- if (xf86IsOptionSet(S3VOptions, OPTION_FAST_DRAM)) {
+ if (xf86IsOptionSet(ps3v->Options, OPTION_FAST_DRAM)) {
ps3v->fast_dram = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fast_dram set\n");
} else
ps3v->fast_dram = FALSE;
- if (xf86IsOptionSet(S3VOptions, OPTION_FPM_VRAM)) {
+ if (xf86IsOptionSet(ps3v->Options, OPTION_FPM_VRAM)) {
ps3v->fpm_vram = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fpm_vram set\n");
} else
ps3v->fpm_vram = FALSE;
- if (xf86ReturnOptValBool(S3VOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(ps3v->Options, OPTION_NOACCEL, FALSE)) {
ps3v->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - Acceleration disabled\n");
} else
ps3v->NoAccel = FALSE;
- if (xf86ReturnOptValBool(S3VOptions, OPTION_EARLY_RAS_PRECHARGE, FALSE)) {
+ if (xf86ReturnOptValBool(ps3v->Options, OPTION_EARLY_RAS_PRECHARGE, FALSE)) {
ps3v->early_ras_precharge = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: early_ras_precharge set\n");
} else
ps3v->early_ras_precharge = FALSE;
- if (xf86ReturnOptValBool(S3VOptions, OPTION_LATE_RAS_PRECHARGE, FALSE)) {
+ if (xf86ReturnOptValBool(ps3v->Options, OPTION_LATE_RAS_PRECHARGE, FALSE)) {
ps3v->late_ras_precharge = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: late_ras_precharge set\n");
} else
ps3v->late_ras_precharge = FALSE;
- if (xf86ReturnOptValBool(S3VOptions, OPTION_LCD_CENTER, FALSE)) {
+ if (xf86ReturnOptValBool(ps3v->Options, OPTION_LCD_CENTER, FALSE)) {
ps3v->lcd_center = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: lcd_center set\n");
} else
ps3v->lcd_center = FALSE;
- if (xf86ReturnOptValBool(S3VOptions, OPTION_SHOWCACHE, FALSE)) {
+ if (xf86ReturnOptValBool(ps3v->Options, OPTION_SHOWCACHE, FALSE)) {
ps3v->ShowCache = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: show_cache set\n");
} else
ps3v->ShowCache = FALSE;
- if (xf86GetOptValInteger(S3VOptions, OPTION_LCDCLOCK, &ps3v->LCDClk)) {
+ if (xf86GetOptValInteger(ps3v->Options, OPTION_LCDCLOCK, &ps3v->LCDClk)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: lcd_setclk set to %1.3f Mhz\n",
ps3v->LCDClk / 1000.0 );
} else
ps3v->LCDClk = 0;
- if (xf86GetOptValFreq(S3VOptions, OPTION_MCLK, OPTUNITS_MHZ, &real)) {
+ if (xf86GetOptValFreq(ps3v->Options, OPTION_MCLK, OPTUNITS_MHZ, &real)) {
ps3v->MCLK = (int)(real * 1000.0);
if (ps3v->MCLK <= 100000) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: set_mclk set to %1.3f Mhz\n",
@@ -797,7 +799,7 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
} else
ps3v->MCLK = 0;
- if (xf86GetOptValFreq(S3VOptions, OPTION_REFCLK, OPTUNITS_MHZ, &real)) {
+ if (xf86GetOptValFreq(ps3v->Options, OPTION_REFCLK, OPTUNITS_MHZ, &real)) {
ps3v->REFCLK = (int)(real * 1000.0);
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: set_refclk set to %1.3f Mhz\n",
ps3v->REFCLK / 1000.0 );
@@ -806,20 +808,20 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
from = X_DEFAULT;
ps3v->hwcursor = TRUE;
- if (xf86GetOptValBool(S3VOptions, OPTION_HWCURSOR, &ps3v->hwcursor))
+ if (xf86GetOptValBool(ps3v->Options, OPTION_HWCURSOR, &ps3v->hwcursor))
from = X_CONFIG;
- if (xf86ReturnOptValBool(S3VOptions, OPTION_SWCURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(ps3v->Options, OPTION_SWCURSOR, FALSE)) {
ps3v->hwcursor = FALSE;
from = X_CONFIG;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s Cursor\n",
ps3v->hwcursor ? "HW" : "SW");
- if (xf86GetOptValBool(S3VOptions, OPTION_SHADOW_FB,&ps3v->shadowFB))
+ if (xf86GetOptValBool(ps3v->Options, OPTION_SHADOW_FB,&ps3v->shadowFB))
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n",
ps3v->shadowFB ? "enabled" : "disabled");
- if ((s = xf86GetOptValString(S3VOptions, OPTION_ROTATE))) {
+ if ((s = xf86GetOptValString(ps3v->Options, OPTION_ROTATE))) {
if(!xf86NameCmp(s, "CW")) {
/* accel is disabled below for shadowFB */
ps3v->shadowFB = TRUE;
@@ -851,9 +853,9 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
ps3v->hwcursor = FALSE;
}
- if (xf86IsOptionSet(S3VOptions, OPTION_FB_DRAW))
+ if (xf86IsOptionSet(ps3v->Options, OPTION_FB_DRAW))
{
- if (xf86GetOptValBool(S3VOptions, OPTION_FB_DRAW ,&ps3v->UseFB))
+ if (xf86GetOptValBool(ps3v->Options, OPTION_FB_DRAW ,&ps3v->UseFB))
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using %s.\n",
ps3v->UseFB ? "fb (not cfb)" : "cfb (not fb)");
}
@@ -938,11 +940,15 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
if (pScrn->chipset == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"ChipID 0x%04X is not recognised\n", ps3v->Chipset);
+ vbeFree(ps3v->pVbe);
+ ps3v->pVbe = NULL;
return FALSE;
}
if (ps3v->Chipset < 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Chipset \"%s\" is not recognised\n", pScrn->chipset);
+ vbeFree(ps3v->pVbe);
+ ps3v->pVbe = NULL;
return FALSE;
}
@@ -987,9 +993,10 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
S3Vddc2(pScrn->scrnIndex);
}
}
- if (ps3v->pVbe)
+ if (ps3v->pVbe) {
vbeFree(ps3v->pVbe);
-
+ ps3v->pVbe = NULL;
+ }
/*
* If the driver can do gamma correction, it should call xf86SetGamma()
@@ -1442,8 +1449,8 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
{
if( xf86LoadSubModule(pScrn, "fb") == NULL )
{
- S3VFreeRec(pScrn);
- return FALSE;
+ S3VFreeRec(pScrn);
+ return FALSE;
}
xf86LoaderReqSymLists(fbSymbols, NULL);
}
@@ -1473,8 +1480,8 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
break;
}
if (mod && xf86LoadSubModule(pScrn, mod) == NULL) {
- S3VFreeRec(pScrn);
- return FALSE;
+ S3VFreeRec(pScrn);
+ return FALSE;
}
xf86LoaderReqSymbols(reqSym, NULL);
@@ -3860,6 +3867,7 @@ S3VProbeDDC(ScrnInfoPtr pScrn, int index)
if (xf86LoadSubModule(pScrn, "vbe")) {
pVbe = VBEInit(NULL,index);
ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
}
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man
index aa2f9a0b4..943278ea5 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man,v 1.3 2001/02/13 21:15:19 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man,v 1.4 2001/05/18 23:35:32 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH SAVAGE __drivermansuffix__ __vendorversion__
@@ -38,6 +38,12 @@ driver supports PCI and AGP boards with the following chips:
.TP 16
.B ProSavage KM133
(8a26)
+.TP 16
+.B Twister
+(8d01)
+.TP 16
+.B TwisterK
+(8d02)
.SH CONFIGURATION DETAILS
Please refer to XF86Config(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
@@ -95,6 +101,15 @@ you would rather have the
.B savage
driver use your mode line timing exactly, turn off the UseBios option.
Default: on (use the BIOS).
+.BI "Option \*qShadowStatus\*q \q*" boolean \*q
+Enables the use of a shadow status register. There is a chip bug in the
+Savage graphics engine that can cause a bus lock when reading the engine
+status register under heavy load, such as when scrolling text or dragging
+windows. The bug affects about 4% of all Savage users. If your system
+hangs regularly while scrolling text or dragging windows, try turning this
+option on. This uses an alternate method of reading the engine status
+which is slightly more expensive, but avoids the problem. Default: off
+(use normal status register).
.SH FILES
savage_drv.o
.SH "SEE ALSO"
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c
index 37776b1cc..c97c67e27 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c,v 1.8 2001/04/19 14:09:36 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c,v 1.10 2001/05/18 23:35:32 dawes Exp $ */
/*
*
@@ -198,8 +198,12 @@ void SavageWriteBitmapCPUToScreenColorExpand (
unsigned int planemask
);
+unsigned long writedw( unsigned long addr, unsigned long value );
+unsigned long readdw( unsigned long addr );
+unsigned long readfb( unsigned long addr );
+unsigned long writefb( unsigned long addr, unsigned long value );
+void writescan( unsigned long scan, unsigned long color );
-void SavageSetGBD( ScrnInfoPtr );
/*
* This is used to cache the last known value for routines we want to
@@ -230,20 +234,7 @@ SavageInitialize2DEngine(ScrnInfoPtr pScrn)
OUTREG(0x812C, ~0); /* enable all read planes */
OUTREG16(0x8134, 0x27);
OUTREG16(0x8136, 0x07);
-
- if( psav->ShadowStatus && !psav->ShadowPhysical )
- {
- psav->ShadowPhysical =
- psav->FrameBufferBase + psav->CursorKByte*1024 + 4096 - 32;
-
- psav->ShadowVirtual = (unsigned long*)
- (psav->FBBase + psav->CursorKByte*1024 + 4096 - 32);
-
- xf86DrvMsg( pScrn->scrnIndex, X_PROBED,
- "Shadow area physical %08x, linear %08x\n",
- psav->ShadowPhysical, psav->ShadowVirtual );
- }
-
+
switch( psav->Chipset ) {
case S3_SAVAGE3D:
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c
index ecd931bc4..9449b3c5f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c,v 1.2 2001/02/13 21:15:19 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c,v 1.4 2001/05/18 23:35:32 dawes Exp $ */
/*
* Hardware cursor support for S3 Savage 4.0 driver. Taken with
@@ -22,8 +22,19 @@ static void SavageSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg);
#define inCRReg(reg) (VGAHWPTR(pScrn))->readCrtc( VGAHWPTR(pScrn), reg )
#define outCRReg(reg, val) (VGAHWPTR(pScrn))->writeCrtc( VGAHWPTR(pScrn), reg, val )
+#define inStatus1() (VGAHWPTR(pScrn))->readST01( VGAHWPTR(pScrn) )
-
+/*
+ * certain HW cursor operations seem
+ * to require a delay to prevent lockups.
+ */
+#define waitHSync(n) { \
+ int num = n; \
+ while (num--) { \
+ while ((inStatus1()) & 0x01){};\
+ while (!(inStatus1()) & 0x01){};\
+ } \
+ }
#define MAX_CURS 64
@@ -55,11 +66,12 @@ SavageHWCursorInit(ScreenPtr pScreen)
*/
if(
- ( (inCRReg(0x18) & 0x80) && (inCRReg(0x15) & 0x50) )
+ ((psav->Chipset != S3_SAVAGE4)
+ && (inCRReg(0x18) & 0x80) && (inCRReg(0x15) & 0x50) )
||
(psav->Chipset == S3_SAVAGE_MX)
- )
- infoPtr->Flags |= HARDWARE_CURSOR_TRUECOLOR_AT_8BPP;
+ )
+ infoPtr->Flags |= HARDWARE_CURSOR_TRUECOLOR_AT_8BPP;
infoPtr->SetCursorColors = SavageSetCursorColors;
infoPtr->SetCursorPosition = SavageSetCursorPosition;
@@ -87,10 +99,14 @@ SavageShowCursor(ScrnInfoPtr pScrn)
void
SavageHideCursor(ScrnInfoPtr pScrn)
{
- /* Turn cursor off. */
- outCRReg( 0x45, inCRReg(0x45) & 0xfe );
-}
+ /* Turn cursor off. */
+ if( S3_SAVAGE4_SERIES( SAVPTR(pScrn)->Chipset ) )
+ {
+ waitHSync(5);
+ }
+ outCRReg( 0x45, inCRReg(0x45) & 0xfe );
+}
static void
SavageLoadCursorImage(
@@ -115,7 +131,6 @@ SavageLoadCursorImage(
}
}
-
static void
SavageSetCursorPosition(
ScrnInfoPtr pScrn,
@@ -124,6 +139,10 @@ SavageSetCursorPosition(
{
unsigned char xoff, yoff;
+ if( S3_SAVAGE4_SERIES( SAVPTR(pScrn)->Chipset ) )
+ {
+ waitHSync(5);
+ }
/* adjust for frame buffer base address granularity */
if (pScrn->bitsPerPixel == 8)
x += ((pScrn->frameX0) & 3);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c
index cba254710..6f58409f7 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c,v 1.2 2001/04/18 15:29:19 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c,v 1.3 2001/05/18 23:35:32 dawes Exp $ */
/*
Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
@@ -38,6 +38,7 @@ in this Software without prior written authorization from the XFree86 Project.
#include "dgaproc.h"
+Bool SavageDGAInit(ScreenPtr pScreen);
static Bool Savage_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
int *, int *, int *);
static Bool Savage_SetMode(ScrnInfoPtr, DGAModePtr);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c
index 633013a49..2b2a5ef4d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c,v 1.15 2001/04/20 02:52:45 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c,v 1.19 2001/05/18 23:35:32 dawes Exp $ */
/*
* vim: sw=4 ts=8 ai ic:
*
@@ -35,7 +35,7 @@
static void SavageEnableMMIO(ScrnInfoPtr pScrn);
static void SavageDisableMMIO(ScrnInfoPtr pScrn);
-static OptionInfoPtr SavageAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * SavageAvailableOptions(int chipid, int busid);
static void SavageIdentify(int flags);
static Bool SavageProbe(DriverPtr drv, int flags);
static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags);
@@ -61,6 +61,9 @@ static Bool SavageSaveScreen(ScreenPtr pScreen, int mode);
static void SavageLoadPalette(ScrnInfoPtr pScrn, int numColors,
int *indicies, LOCO *colors,
VisualPtr pVisual);
+static void SavageLoadPaletteSavage4(ScrnInfoPtr pScrn, int numColors,
+ int *indicies, LOCO *colors,
+ VisualPtr pVisual);
static void SavageCalcClock(long freq, int min_m, int min_n1, int max_n1,
int min_n2, int max_n2, long freq_min,
long freq_max, unsigned int *mdiv,
@@ -86,7 +89,7 @@ extern ScrnInfoPtr gpScrn;
PATCHLEVEL)
-/* #define TRACEON */
+/*#define TRACEON*/
#ifdef TRACEON
#define TRACE(prms) ErrorF prms
#else
@@ -169,7 +172,7 @@ typedef enum {
} SavageOpts;
-static OptionInfoRec SavageOptions[] =
+static const OptionInfoRec SavageOptions[] =
{
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HWCURSOR, "HWCursor", OPTV_BOOLEAN, {0}, FALSE },
@@ -217,9 +220,7 @@ static const char *vbeSymbols[] = {
};
static const char *vbeOptSymbols[] = {
-#if 0
"vbeModeInit",
-#endif
"VBESetVBEMode",
NULL
};
@@ -341,19 +342,13 @@ static Bool
ShadowWait( SavagePtr psav )
{
BCI_GET_PTR;
- static int dwBCIWait2DIdle = 0;
int loop = 0;
- if( !dwBCIWait2DIdle )
- {
- if( psav->Chipset == S3_SAVAGE2000 )
- dwBCIWait2DIdle = 0xc0040000;
- else
- dwBCIWait2DIdle = 0xc0020000;
- }
+ if( !psav->NoPCIRetry )
+ return 0;
psav->ShadowCounter = (psav->ShadowCounter + 1) & 0x7fff;
- BCI_SEND( dwBCIWait2DIdle );
+ BCI_SEND( psav->dwBCIWait2DIdle );
BCI_SEND( 0x98000000 + psav->ShadowCounter );
while(
@@ -365,6 +360,13 @@ ShadowWait( SavagePtr psav )
return loop >= MAXLOOP;
}
+static Bool
+ShadowWait1( SavagePtr psav, int v )
+{
+ return ShadowWait( psav );
+}
+
+
/* Wait until "v" queue entries are free */
static int
@@ -376,7 +378,7 @@ WaitQueue3D( SavagePtr psav, int v )
mem_barrier();
if( psav->ShadowVirtual )
{
- psav->WaitIdle = ShadowWait;
+ psav->WaitQueue = ShadowWait1;
return ShadowWait(psav);
}
else
@@ -399,7 +401,7 @@ WaitQueue4( SavagePtr psav, int v )
mem_barrier();
if( psav->ShadowVirtual )
{
- psav->WaitIdle = ShadowWait;
+ psav->WaitQueue = ShadowWait1;
return ShadowWait(psav);
}
else
@@ -419,7 +421,7 @@ WaitQueue2K( SavagePtr psav, int v )
mem_barrier();
if( psav->ShadowVirtual )
{
- psav->WaitIdle = ShadowWait;
+ psav->WaitQueue = ShadowWait1;
return ShadowWait(psav);
}
else
@@ -551,7 +553,7 @@ static void SavageFreeRec(ScrnInfoPtr pScrn)
}
-static OptionInfoPtr SavageAvailableOptions(int chipid, int busid)
+static const OptionInfoRec * SavageAvailableOptions(int chipid, int busid)
{
return SavageOptions;
}
@@ -742,9 +744,12 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
if (pScrn->depth == 8)
pScrn->rgbBits = 6;
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, SavageOptions);
+ if (!(psav->Options = xalloc(sizeof(SavageOptions))))
+ return FALSE;
+ memcpy(psav->Options, SavageOptions, sizeof(SavageOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, psav->Options);
- xf86GetOptValBool(SavageOptions, OPTION_PCI_BURST, &psav->pci_burst);
+ xf86GetOptValBool(psav->Options, OPTION_PCI_BURST, &psav->pci_burst);
if (psav->pci_burst) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
@@ -752,20 +757,20 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
}
psav->NoPCIRetry = 1; /* default */
- if (xf86ReturnOptValBool(SavageOptions, OPTION_PCI_RETRY, FALSE)) {
- if (xf86ReturnOptValBool(SavageOptions, OPTION_PCI_BURST, FALSE)) {
+ if (xf86ReturnOptValBool(psav->Options, OPTION_PCI_RETRY, FALSE)) {
+ if (xf86ReturnOptValBool(psav->Options, OPTION_PCI_BURST, FALSE)) {
psav->NoPCIRetry = 0;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_retry\n");
} else
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"pci_retry\" option requires \"pci_burst\"\n");
}
- xf86GetOptValBool( SavageOptions, OPTION_SHADOW_FB, &psav->shadowFB );
+ xf86GetOptValBool( psav->Options, OPTION_SHADOW_FB, &psav->shadowFB );
if (psav->shadowFB) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: shadow FB enabled\n");
}
- if ((s = xf86GetOptValString(SavageOptions, OPTION_ROTATE))) {
+ if ((s = xf86GetOptValString(psav->Options, OPTION_ROTATE))) {
if(!xf86NameCmp(s, "CW")) {
/* accel is disabled below for shadowFB */
psav->shadowFB = TRUE;
@@ -785,7 +790,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
}
}
- if (xf86GetOptValBool(SavageOptions, OPTION_NOACCEL, &psav->NoAccel))
+ if (xf86GetOptValBool(psav->Options, OPTION_NOACCEL, &psav->NoAccel))
xf86DrvMsg( pScrn->scrnIndex, X_CONFIG,
"Option: NoAccel - Acceleration Disabled\n");
@@ -803,9 +808,9 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
from = X_DEFAULT;
psav->hwcursor = psav->shadowFB ? FALSE : TRUE;
- if (xf86GetOptValBool(SavageOptions, OPTION_HWCURSOR, &psav->hwcursor))
+ if (xf86GetOptValBool(psav->Options, OPTION_HWCURSOR, &psav->hwcursor))
from = X_CONFIG;
- if (xf86ReturnOptValBool(SavageOptions, OPTION_SWCURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(psav->Options, OPTION_SWCURSOR, FALSE)) {
psav->hwcursor = FALSE;
from = X_CONFIG;
}
@@ -814,17 +819,17 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
from = X_DEFAULT;
psav->UseBIOS = TRUE;
- if (xf86GetOptValBool(SavageOptions, OPTION_USEBIOS, &psav->UseBIOS) )
+ if (xf86GetOptValBool(psav->Options, OPTION_USEBIOS, &psav->UseBIOS) )
from = X_CONFIG;
xf86DrvMsg(pScrn->scrnIndex, from, "%ssing video BIOS to set modes\n",
psav->UseBIOS ? "U" : "Not u" );
psav->LCDClock = 0.0;
- if( xf86GetOptValFreq( SavageOptions, OPTION_LCDCLOCK, OPTUNITS_MHZ, &psav->LCDClock ) )
+ if( xf86GetOptValFreq( psav->Options, OPTION_LCDCLOCK, OPTUNITS_MHZ, &psav->LCDClock ) )
xf86DrvMsg( pScrn->scrnIndex, X_CONFIG,
"Option: LCDClock %1.2f MHz\n", psav->LCDClock );
- if( xf86GetOptValBool( SavageOptions, OPTION_SHADOW_STATUS, &psav->ShadowStatus))
+ if( xf86GetOptValBool( psav->Options, OPTION_SHADOW_STATUS, &psav->ShadowStatus))
xf86DrvMsg( pScrn->scrnIndex, X_CONFIG,
"Option: ShadowStatus enabled\n" );
@@ -1712,15 +1717,8 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
break;
}
- #if 0
- if( !psav->NoAccel )
- {
- #endif
- SavageInitialize2DEngine(pScrn);
- SavageSetGBD(pScrn);
-#if 0
- }
-#endif
+ SavageInitialize2DEngine(pScrn);
+ SavageSetGBD(pScrn);
VGAOUT16(vgaCRIndex, 0x0140);
@@ -1934,11 +1932,8 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
{
VerticalRetraceWait();
OUTREG(FIFO_CONTROL_REG, restore->MMPR0);
- psav->WaitIdle(psav);
OUTREG(MIU_CONTROL_REG, restore->MMPR1);
- psav->WaitIdle(psav);
OUTREG(STREAMS_TIMEOUT_REG, restore->MMPR2);
- psav->WaitIdle(psav);
OUTREG(MISC_TIMEOUT_REG, restore->MMPR3);
}
@@ -2096,6 +2091,28 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
if (!SavageMapFB(pScrn))
return FALSE;
+
+ if( psav->ShadowStatus ) {
+ psav->ShadowPhysical =
+ psav->FrameBufferBase + psav->CursorKByte*1024 + 4096 - 32;
+
+ psav->ShadowVirtual = (unsigned long*)
+ (psav->FBBase + psav->CursorKByte*1024 + 4096 - 32);
+
+ xf86DrvMsg( pScrn->scrnIndex, X_PROBED,
+ "Shadow area physical %08x, linear %08x\n",
+ psav->ShadowPhysical, psav->ShadowVirtual );
+
+ psav->WaitQueue = ShadowWait1;
+ psav->WaitIdle = ShadowWait;
+ psav->WaitIdleEmpty = ShadowWait;
+
+ if( psav->Chipset == S3_SAVAGE2000 )
+ psav->dwBCIWait2DIdle = 0xc0040000;
+ else
+ psav->dwBCIWait2DIdle = 0xc0020000;
+ }
+ psav->ShadowCounter = 0;
SavageSave(pScrn);
@@ -2182,9 +2199,15 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
if (!miCreateDefColormap(pScreen))
return FALSE;
- if (!xf86HandleColormaps(pScreen, 256, 6, SavageLoadPalette, NULL,
- CMAP_RELOAD_ON_MODE_SWITCH))
- return FALSE;
+ if (psav->Chipset == S3_SAVAGE4) {
+ if (!xf86HandleColormaps(pScreen, 256, 6, SavageLoadPaletteSavage4,
+ NULL, CMAP_RELOAD_ON_MODE_SWITCH))
+ return FALSE;
+ } else {
+ if (!xf86HandleColormaps(pScreen, 256, 6, SavageLoadPalette, NULL,
+ CMAP_RELOAD_ON_MODE_SWITCH))
+ return FALSE;
+ }
vgaHWBlankScreen(pScrn, FALSE);
@@ -2569,10 +2592,10 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
else
new->CR50 |= 0xc1; /* Use GBD */
- if( psav->Chipset == S3_SAVAGE2000 )
- new->CR33 = 0x08;
+ if( psav->Chipset == S3_SAVAGE_MX )
+ new->CR33 = 0x00;
else
- new->CR33 = 0x20;
+ new->CR33 = 0x08;
vganew->CRTC[0x17] = 0xeb;
@@ -2742,7 +2765,6 @@ void SavageDisableMMIO(ScrnInfoPtr pScrn)
return;
}
-
void SavageLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies,
LOCO *colors, VisualPtr pVisual)
{
@@ -2758,6 +2780,32 @@ void SavageLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies,
}
}
+#define inStatus1() (hwp->readST01( hwp ))
+
+void SavageLoadPaletteSavage4(ScrnInfoPtr pScrn, int numColors, int *indicies,
+ LOCO *colors, VisualPtr pVisual)
+{
+ SavagePtr psav = SAVPTR(pScrn);
+ int i, index;
+
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ int vgaCRIndex, vgaCRReg, vgaIOBase;
+ vgaIOBase = hwp->IOBase;
+ vgaCRIndex = vgaIOBase + 4;
+ vgaCRReg = vgaIOBase + 5;
+ VerticalRetraceWait();
+
+ for (i=0; i<numColors; i++) {
+ if (!(inStatus1()) & 0x08)
+ VerticalRetraceWait();
+ index = indicies[i];
+ VGAOUT8(0x3c8, index);
+ VGAOUT8(0x3c9, colors[index].red);
+ VGAOUT8(0x3c9, colors[index].green);
+ VGAOUT8(0x3c9, colors[index].blue);
+ }
+}
+
static void SavageCalcClock(long freq, int min_m, int min_n1, int max_n1,
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h
index f8f5abb0b..1bb0bfc5e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h,v 1.7 2001/04/27 12:58:28 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h,v 1.10 2001/05/18 23:35:32 dawes Exp $ */
#ifndef SAVAGE_VGAHWMMIO_H
#define SAVAGE_VGAHWMMIO_H
@@ -107,6 +107,7 @@ typedef struct _Savage {
/* Here are all the Options */
+ OptionInfoPtr Options;
Bool ShowCache;
Bool pci_burst;
Bool NoPCIRetry;
@@ -174,6 +175,7 @@ typedef struct _Savage {
int videoFourCC;
XF86VideoAdaptorPtr adaptor;
int VideoZoomMax;
+ int dwBCIWait2DIdle;
} SavageRec, *SavagePtr;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c
index 34a13a56b..d2a2924fb 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c
@@ -1,9 +1,35 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c,v 1.3 2001/04/18 15:29:19 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c,v 1.4 2001/05/18 23:35:32 dawes Exp $ */
#include "savage_driver.h"
#include "xaarop.h"
#include "savage_bci.h"
+void SavageSubsequentImageWriteRect (
+ ScrnInfoPtr pScrn,
+ int x,
+ int y,
+ int w,
+ int h,
+ int skipleft);
+
+void SavageSetupForImageWrite (
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned planemask,
+ int transparency_color,
+ int bpp,
+ int depth);
+
+void SavageWriteBitmapCPUToScreenColorExpand (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char * src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask);
+
#if 0
void SavageWriteBitmapScreenToScreenColorExpand(
ScrnPtr pScrn,
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h
index e1a046b01..e3c896055 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h,v 1.7 2001/04/27 12:58:28 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h,v 1.8 2001/05/15 10:19:39 eich Exp $ */
#ifndef _SAVAGE_REGS_H
#define _SAVAGE_REGS_H
@@ -173,8 +173,14 @@ enum S3CHIPTAGS {
#define MAXFIFO 0x7f00
+/*
+ * NOTE: don't remove 'VGAIN8(vgaCRIndex);'.
+ * If not present it will cause lockups on Savage4.
+ * Ask S3, why.
+ */
#define VerticalRetraceWait() \
{ \
+ VGAIN8(vgaCRIndex); \
VGAOUT8(vgaCRIndex, 0x17); \
if (VGAIN8(vgaCRReg) & 0x80) { \
while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x08) ; \
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c
index 49b60bb59..61c02ed38 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c,v 1.6 2001/04/19 14:07:05 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c,v 1.9 2001/05/19 02:05:55 dawes Exp $ */
#include "savage_driver.h"
#include "savage_vbe.h"
@@ -13,9 +13,7 @@
#endif
#define L_ADD(x) (B_O32(x) & 0xffff) + ((B_O32(x) >> 12) & 0xffff00)
-#if 0
Bool vbeModeInit( vbeInfoPtr, int );
-#endif
static void
SavageClearVM86Regs( xf86Int10InfoPtr pInt )
@@ -63,7 +61,7 @@ SavageSetVESAMode( SavagePtr psav, int n, int Refresh )
ErrorF("Set video mode failed\n");
}
}
-#if 0
+#ifdef XFree86LOADER
else
{
if( !vbeModeInit( psav->pVbe, n ) )
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c
index 221111c85..1efca5907 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c,v 1.2 2001/04/18 15:29:19 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c,v 1.3 2001/05/18 23:35:33 dawes Exp $ */
#include "Xv.h"
#include "dix.h"
@@ -22,6 +22,8 @@ void SavageInitVideo(ScreenPtr pScreen) {}
void SavageResetVideo(ScrnInfoPtr pScrn) {}
#else
+void myOUTREG( SavagePtr psav, unsigned long offset, unsigned long value );
+
static XF86VideoAdaptorPtr SavageSetupImageVideo(ScreenPtr);
static void SavageInitOffscreenImages(ScreenPtr);
static void SavageStopVideo(ScrnInfoPtr, pointer, Bool);
@@ -35,6 +37,10 @@ static int SavagePutImage( ScrnInfoPtr,
static int SavageQueryImageAttributes(ScrnInfoPtr,
int, unsigned short *, unsigned short *, int *, int *);
+void SavageStreamsOn(ScrnInfoPtr pScrn, int id);
+void SavageStreamsOff(ScrnInfoPtr pScrn);
+void SavageResetVideo(ScrnInfoPtr pScrn);
+
static void SavageInitStreamsOld(ScrnInfoPtr pScrn);
static void SavageInitStreamsNew(ScrnInfoPtr pScrn);
static void (*SavageInitStreams)(ScrnInfoPtr pScrn) = NULL;
@@ -344,9 +350,11 @@ void SavageInitStreamsOld(ScrnInfoPtr pScrn)
}
#undef OUTREG
+#if 0
#define OUTREG(a,v) myOUTREG(psav,a,v)
-#undef OUTREG
+#else
#define OUTREG(addr,val) MMIO_OUT32(psav->MapBase, addr, val)
+#endif
void SavageInitStreamsNew(ScrnInfoPtr pScrn)
{
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h
index 3061d60fa..c2b6f18c0 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h
@@ -26,11 +26,13 @@ Silicon Motion shall not be used in advertising or otherwise to promote the
sale, use or other dealings in this Software without prior written
authorization from the XFree86 Project and Silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v 1.4 2001/03/03 22:26:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v 1.6 2001/05/15 10:19:40 eich Exp $ */
#ifndef _SMI_H
#define _SMI_H
+#define USE_FB
+
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86_ansic.h"
@@ -44,11 +46,16 @@ authorization from the XFree86 Project and Silicon Motion.
#include "mipointer.h"
#include "micmap.h"
+#ifdef USE_FB
+#include "fb.h"
+#else
+
#define PSZ 8
#include "cfb.h"
#undef PSZ
#include "cfb16.h"
#include "cfb24.h"
+#endif
#include "xaa.h"
#include "xf86cmap.h"
@@ -239,7 +246,8 @@ typedef struct
void (*BlockHandler)(int i, pointer blockData, pointer pTimeout,
pointer pReadMask);
#endif
-
+ OptionInfoPtr Options;
+ CARD8 DACmask;
} SMIRec, *SMIPtr;
#define SMIPTR(p) ((SMIPtr)((p)->driverPrivate))
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c
index 9a583f336..60e1202a1 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c
@@ -26,7 +26,7 @@ Silicon Motion shall not be used in advertising or otherwise to promote the
sale, use or other dealings in this Software without prior written
authorization from The XFree86 Project or Silicon Motion.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v 1.10 2001/03/08 17:12:12 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v 1.12.2.1 2001/05/25 18:15:46 eich Exp $ */
#include "xf86Resources.h"
#include "xf86RAC.h"
@@ -51,7 +51,7 @@ static void SMI_DisableMmio(ScrnInfoPtr pScrn);
* Forward definitions for the functions that make up the driver.
*/
-static OptionInfoPtr SMI_AvailableOptions(int chipid, int busid);
+static const OptionInfoRec * SMI_AvailableOptions(int chipid, int busid);
static void SMI_Identify(int flags);
static Bool SMI_Probe(DriverPtr drv, int flags);
static Bool SMI_PreInit(ScrnInfoPtr pScrn, int flags);
@@ -65,6 +65,8 @@ static int SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen);
static void SMI_PrintRegs(ScrnInfoPtr);
static ModeStatus SMI_ValidMode(int scrnIndex, DisplayModePtr mode,
Bool verbose, int flags);
+static void SMI_DisableVideo(ScrnInfoPtr pScrn);
+static void SMI_EnableVideo(ScrnInfoPtr pScrn);
static Bool SMI_MapMem(ScrnInfoPtr pScrn);
static void SMI_UnmapMem(ScrnInfoPtr pScrn);
static Bool SMI_ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
@@ -158,7 +160,7 @@ typedef enum
} SMIOpts;
-static OptionInfoRec SMIOptions[] =
+static const OptionInfoRec SMIOptions[] =
{
{ OPTION_PCI_BURST, "pci_burst", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_FIFO_CONSERV, "fifo_conservative", OPTV_BOOLEAN, {0}, FALSE },
@@ -188,7 +190,7 @@ static OptionInfoRec SMIOptions[] =
* Note that vgahwSymbols and xaaSymbols are referenced outside the
* XFree86LOADER define in later code, so are defined outside of that
* define here also.
- * cfbSymbols and ramdacSymbols are only referenced from within the
+ * fbSymbols and ramdacSymbols are only referenced from within the
* ...LOADER define.
*/
@@ -267,10 +269,12 @@ static const char *vbeSymbols[] =
NULL
};
-#ifdef XFree86LOADER
-
-static const char *cfbSymbols[] =
+static const char *fbSymbols[] =
{
+#ifdef USE_FB
+ "fbScreenInit",
+ "fbPictureInit",
+#else
"cfbScreenInit",
"cfb16ScreenInit",
"cfb24ScreenInit",
@@ -278,9 +282,12 @@ static const char *cfbSymbols[] =
"cfb32ScreenInit",
"cfb16BresS",
"cfb24BresS",
+#endif
NULL
};
+#ifdef XFree86LOADER
+
static MODULESETUPPROTO(siliconmotionSetup);
static XF86ModuleVersionInfo SMIVersRec =
@@ -330,7 +337,7 @@ siliconmotionSetup(pointer module, pointer opts, int *errmaj, int *errmin)
* Tell the loader about symbols from other modules that this module
* might refer to.
*/
- LoaderRefSymLists(vgahwSymbols, cfbSymbols, xaaSymbols, ramdacSymbols,
+ LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, ramdacSymbols,
ddcSymbols, i2cSymbols, int10Symbols, vbeSymbols,
shadowSymbols, NULL);
@@ -385,7 +392,7 @@ SMI_FreeRec(ScrnInfoPtr pScrn)
LEAVE_PROC("SMI_FreeRec");
}
-static OptionInfoPtr
+static const OptionInfoRec *
SMI_AvailableOptions(int chipid, int busid)
{
ENTER_PROC("SMI_AvailableOptions");
@@ -489,8 +496,10 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
int i;
double real;
ClockRangePtr clockRanges;
+#ifndef USE_FB
char *mod = NULL;
const char *reqSym = NULL;
+#endif
char *s;
unsigned char config, m, n, shift;
int mclk;
@@ -618,9 +627,12 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
}
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, SMIOptions);
+ if (!(pSmi->Options = xalloc(sizeof(SMIOptions))))
+ return FALSE;
+ memcpy(pSmi->Options, SMIOptions, sizeof(SMIOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pSmi->Options);
- if (xf86ReturnOptValBool(SMIOptions, OPTION_PCI_BURST, FALSE))
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_BURST, FALSE))
{
pSmi->pci_burst = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_burst - PCI burst "
@@ -632,9 +644,9 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
}
pSmi->NoPCIRetry = TRUE;
- if (xf86ReturnOptValBool(SMIOptions, OPTION_PCI_RETRY, FALSE))
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_RETRY, FALSE))
{
- if (xf86ReturnOptValBool(SMIOptions, OPTION_PCI_BURST, FALSE))
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_BURST, FALSE))
{
pSmi->NoPCIRetry = FALSE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_retry\n");
@@ -646,7 +658,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
}
}
- if (xf86IsOptionSet(SMIOptions, OPTION_FIFO_CONSERV))
+ if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_CONSERV))
{
pSmi->fifo_conservative = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_conservative "
@@ -657,7 +669,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->fifo_conservative = FALSE;
}
- if (xf86IsOptionSet(SMIOptions, OPTION_FIFO_MODERATE))
+ if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_MODERATE))
{
pSmi->fifo_moderate = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_moderate set\n");
@@ -667,7 +679,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->fifo_moderate = FALSE;
}
- if (xf86IsOptionSet(SMIOptions, OPTION_FIFO_AGGRESSIVE))
+ if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_AGGRESSIVE))
{
pSmi->fifo_aggressive = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_aggressive set\n");
@@ -677,7 +689,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->fifo_aggressive = FALSE;
}
- if (xf86ReturnOptValBool(SMIOptions, OPTION_NOACCEL, FALSE))
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_NOACCEL, FALSE))
{
pSmi->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - Acceleration "
@@ -688,7 +700,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->NoAccel = FALSE;
}
- if (xf86ReturnOptValBool(SMIOptions, OPTION_SHOWCACHE, FALSE))
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_SHOWCACHE, FALSE))
{
pSmi->ShowCache = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: show_cache set\n");
@@ -698,7 +710,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->ShowCache = FALSE;
}
- if (xf86GetOptValFreq(SMIOptions, OPTION_MCLK, OPTUNITS_MHZ, &real))
+ if (xf86GetOptValFreq(pSmi->Options, OPTION_MCLK, OPTUNITS_MHZ, &real))
{
pSmi->MCLK = (int)(real * 1000.0);
if (pSmi->MCLK <= 120000)
@@ -721,11 +733,11 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
from = X_DEFAULT;
pSmi->hwcursor = TRUE;
- if (xf86GetOptValBool(SMIOptions, OPTION_HWCURSOR, &pSmi->hwcursor))
+ if (xf86GetOptValBool(pSmi->Options, OPTION_HWCURSOR, &pSmi->hwcursor))
{
from = X_CONFIG;
}
- if (xf86ReturnOptValBool(SMIOptions, OPTION_SWCURSOR, FALSE))
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_SWCURSOR, FALSE))
{
pSmi->hwcursor = FALSE;
from = X_CONFIG;
@@ -733,7 +745,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s Cursor\n",
pSmi->hwcursor ? "Hardware" : "Software");
- if (xf86GetOptValBool(SMIOptions, OPTION_SHADOW_FB, &pSmi->shadowFB))
+ if (xf86GetOptValBool(pSmi->Options, OPTION_SHADOW_FB, &pSmi->shadowFB))
{
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n",
pSmi->shadowFB ? "enabled" : "disabled");
@@ -742,7 +754,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
#if 1 /* PDR#932 */
if ((pScrn->depth == 8) || (pScrn->depth == 16))
#endif /* PDR#932 */
- if ((s = xf86GetOptValString(SMIOptions, OPTION_ROTATE)))
+ if ((s = xf86GetOptValString(pSmi->Options, OPTION_ROTATE)))
{
if(!xf86NameCmp(s, "CW"))
{
@@ -768,7 +780,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
}
#ifdef XvExtension
- if (xf86GetOptValInteger(SMIOptions, OPTION_VIDEOKEY, &pSmi->videoKey))
+ if (xf86GetOptValInteger(pSmi->Options, OPTION_VIDEOKEY, &pSmi->videoKey))
{
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: Video key set to "
"0x%08X\n", pSmi->videoKey);
@@ -780,7 +792,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
<< pScrn->offset.blue);
}
- if (xf86ReturnOptValBool(SMIOptions, OPTION_BYTESWAP, FALSE))
+ if (xf86ReturnOptValBool(pSmi->Options, OPTION_BYTESWAP, FALSE))
{
pSmi->ByteSwap = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ByteSwap enabled.\n");
@@ -791,7 +803,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
}
#endif
- if (xf86GetOptValBool(SMIOptions, OPTION_USEBIOS, &pSmi->useBIOS))
+ if (xf86GetOptValBool(pSmi->Options, OPTION_USEBIOS, &pSmi->useBIOS))
{
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: UseBIOS %s.\n",
pSmi->useBIOS ? "enabled" : "disabled");
@@ -802,15 +814,15 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->useBIOS = TRUE;
}
- if (xf86GetOptValBool(SMIOptions, OPTION_ZOOMONLCD, &pSmi->zoomOnLCD))
+ if (xf86GetOptValBool(pSmi->Options, OPTION_ZOOMONLCD, &pSmi->zoomOnLCD))
{
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ZoomOnLCD %s.\n",
pSmi->zoomOnLCD ? "enabled" : "disabled");
}
else
{
- /* Default to ZoomOnLCD disabled. */
- pSmi->zoomOnLCD = FALSE;
+ /* Default to ZoomOnLCD enabled. */
+ pSmi->zoomOnLCD = TRUE;
}
/* Find the PCI slot for this screen */
@@ -902,6 +914,8 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
pSmi->PciInfo->func);
SMI_MapMem(pScrn);
+ SMI_DisableVideo(pScrn);
+
hwp = VGAHWPTR(pScrn);
vgaIOBase = hwp->IOBase;
vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET;
@@ -968,6 +982,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
if (pSmi->pVbe)
{
vbeFree(pSmi->pVbe);
+ pSmi->pVbe = NULL;
}
/*
@@ -981,6 +996,8 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
if (!xf86SetGamma(pScrn, zeros))
{
LEAVE_PROC("SMI_PreInit");
+ SMI_EnableVideo(pScrn);
+ SMI_UnmapMem(pScrn);
return(FALSE);
}
}
@@ -1084,6 +1101,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected current MCLK value of "
"%1.3f MHz\n", mclk / 1000.0);
+ SMI_EnableVideo(pScrn);
SMI_UnmapMem(pScrn);
pScrn->virtualX = pScrn->display->virtualX;
@@ -1147,6 +1165,16 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
/* Set display resolution */
xf86SetDpi(pScrn, 0, 0);
+#ifdef USE_FB
+ if ((xf86LoadSubModule(pScrn, "fb") == NULL))
+ {
+ SMI_FreeRec(pScrn);
+ LEAVE_PROC("SMI_PreInit");
+ return(FALSE);
+ }
+
+ xf86LoaderReqSymLists(fbSymbols, NULL);
+#else
/* Load bpp-specific modules */
switch (pScrn->bitsPerPixel)
{
@@ -1174,7 +1202,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
}
xf86LoaderReqSymbols(reqSym, NULL);
-
+#endif
/* Load XAA if needed */
if (!pSmi->NoAccel || pSmi->hwcursor)
{
@@ -1839,7 +1867,7 @@ SMI_MapMem(ScrnInfoPtr pScrn)
pSmi->lcdHeight = 1024;
break;
}
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV, "%s Panel Size = %dx%d\n",
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s Panel Size = %dx%d\n",
(pSmi->lcd == 0) ? "OFF" : (pSmi->lcd == 1) ? "TFT" : "DSTN",
pSmi->lcdWidth, pSmi->lcdHeight);
@@ -1951,7 +1979,7 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
* support TrueColor and not DirectColor. To deal with this, call
* miSetVisualTypes with the appropriate visual mask.
*/
-
+#ifndef USE_FB
if (pScrn->bitsPerPixel > 8)
{
if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits,
@@ -1962,6 +1990,7 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
}
else
+#endif
{
if (!miSetVisualTypes(pScrn->depth,
miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits,
@@ -1971,6 +2000,9 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
return(FALSE);
}
}
+#ifdef USE_FB
+ if (!miSetPixmapDepths ()) return FALSE;
+#endif
if (!SMI_InternalScreenInit(scrnIndex, pScreen))
{
@@ -2152,28 +2184,40 @@ SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen)
pSmi->FBBase, width, height, displayWidth));
switch (pScrn->bitsPerPixel)
{
- case 8:
- ret = cfbScreenInit(pScreen, pSmi->FBBase, width, height, xDpi,
- yDpi, displayWidth);
- break;
-
- case 16:
- ret = cfb16ScreenInit(pScreen, pSmi->FBBase, width, height, xDpi,
- yDpi, displayWidth);
- break;
+#ifdef USE_FB
+ case 8:
+ case 16:
+ case 24:
+ ret = fbScreenInit(pScreen, pSmi->FBBase, width, height, xDpi,
+ yDpi, displayWidth,pScrn->bitsPerPixel);
+ break;
+#else
+ case 8:
+ ret = cfbScreenInit(pScreen, pSmi->FBBase, width, height, xDpi,
+ yDpi, displayWidth);
+ break;
- case 24:
- ret = cfb24ScreenInit(pScreen, pSmi->FBBase, width, height, xDpi,
+ case 16:
+ ret = cfb16ScreenInit(pScreen, pSmi->FBBase, width, height, xDpi,
yDpi, displayWidth);
- break;
+ break;
- default:
- xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) "
- "in SMI_InternalScreenInit\n", pScrn->bitsPerPixel);
- LEAVE_PROC("SMI_InternalScreenInit");
- return(FALSE);
+ case 24:
+ ret = cfb24ScreenInit(pScreen, pSmi->FBBase, width, height, xDpi,
+ yDpi, displayWidth);
+ break;
+#endif
+ default:
+ xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) "
+ "in SMI_InternalScreenInit\n", pScrn->bitsPerPixel);
+ LEAVE_PROC("SMI_InternalScreenInit");
+ return(FALSE);
}
-
+
+#ifdef USE_FB
+ if (ret)
+ fbPictureInit(pScreen, 0, 0);
+#endif
LEAVE_PROC("SMI_InternalScreenInit");
return(ret);
}
@@ -2184,11 +2228,13 @@ SMI_ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
SMIPtr pSmi = SMIPTR(pScrn);
+ float refresh;
ENTER_PROC("SMI_ValidMode");
-
+ refresh = (mode->VRefresh > 0) ? mode->VRefresh
+ : mode->Clock * 1000.0 / mode->VTotal / mode->HTotal;
xf86DrvMsg(scrnIndex, X_INFO, "Mode: %dx%d %d-bpp, %fHz\n", mode->HDisplay,
- mode->VDisplay, pScrn->bitsPerPixel, mode->VRefresh);
+ mode->VDisplay, pScrn->bitsPerPixel, refresh);
if (pSmi->shadowFB)
{
@@ -2759,6 +2805,27 @@ SMI_LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, LOCO *colors,
LEAVE_PROC("SMI_LoadPalette");
}
+static void
+SMI_DisableVideo(ScrnInfoPtr pScrn)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+ CARD8 tmp;
+
+ if (!(tmp = VGAIN8(pSmi, VGA_DAC_MASK)))
+ return;
+ pSmi->DACmask = tmp;
+ VGAOUT8(pSmi, VGA_DAC_MASK, 0);
+}
+
+static void
+SMI_EnableVideo(ScrnInfoPtr pScrn)
+{
+ SMIPtr pSmi = SMIPTR(pScrn);
+
+ VGAOUT8(pSmi, VGA_DAC_MASK, pSmi->DACmask);
+}
+
+
void
SMI_EnableMmio(ScrnInfoPtr pScrn)
{
@@ -2774,9 +2841,6 @@ SMI_EnableMmio(ScrnInfoPtr pScrn)
*/
vgaHWSetStdFuncs(hwp);
- /* Disable video output */
- outb(VGA_DAC_MASK, 0x00);
-
/* Enable linear mode */
outb(VGA_SEQ_INDEX, 0x18);
tmp = inb(VGA_SEQ_DATA);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile
index 5c53c6289..4764b0fea 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile,v 1.24 2001/04/19 12:40:33 alanh Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile,v 1.26 2001/05/16 13:43:17 alanh Exp $
XCOMM
XCOMM This is an Imakefile for the SIS driver.
XCOMM
@@ -32,8 +32,8 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \
-I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \
-I$(XF86SRC)/xf24_32bpp \
-I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \
- -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \
- -I$(XF86SRC)/rac \
+ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(XF86OSSRC)/vbe \
+ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \
-I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(XTOP)/include/extensions \
-I$(SERVERSRC)/render \
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h
index da25bfba9..d0c69da60 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h
@@ -25,7 +25,7 @@
* Mitani Hiroshi <hmitani@drl.mei.co.jp>
* David Thomas <davtom@dream.org.uk>.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h,v 1.20 2001/04/19 12:40:33 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h,v 1.22 2001/05/16 13:43:17 alanh Exp $ */
#ifndef _SIS_H
#define _SIS_H_
@@ -144,6 +144,7 @@ typedef struct {
Bool DGAactive;
int DGAViewportStatus;
Bool NoAccel;
+ Bool NoXvideo;
Bool HWCursor;
Bool UsePCIRetry;
Bool TurboQueue;
@@ -229,6 +230,8 @@ typedef struct {
XF86VideoAdaptorPtr adaptor;
ScreenBlockHandlerProcPtr BlockHandler;
+ OptionInfoPtr Options;
+
} SISRec, *SISPtr;
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c
index 62a6f0c75..7c7e0315e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c
@@ -25,7 +25,7 @@
* Mitani Hiroshi <hmitani@drl.mei.co.jp>
* David Thomas <davtom@dream.org.uk>.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c,v 1.4 2001/04/19 12:40:33 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c,v 1.5 2001/05/07 21:59:07 tsi Exp $ */
#include "xf86.h"
#include "xf86PciInfo.h"
@@ -249,53 +249,6 @@ SiS300UseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
return TRUE;
}
-#ifdef IMP_REALIZE_CURSOR
-static unsigned char *
-SiSRealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
- unsigned char *mem;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
- int w, h;
- int i, j;
- unsigned char *srcM, *srcS, *dst, s, m;
-
- if (!(mem=xcalloc(1,size)))
- return NULL;
- dst = mem;
-
- srcS = pCurs->bits->source;
- srcM = pCurs->bits->mask;
- h = pCurs->bits->height;
- if (h > infoPtr->MaxHeight)
- h = infoPtr->MaxHeight;
- w = (pCurs->bits->width + 31)/32*4;
- for (i=0; i<infoPtr->MaxHeight; i++, dst+=16) {
- for (j=0; j<infoPtr->MaxWidth/8; j++) {
- if (i<h && j<w) {
- s = *srcS++;
- m = *srcM++;
- s = s&m;
- m = ~m;
- dst[j*2] = ((m&0x01) << 7) | ((s&0x01) << 6) |
- ((m&0x02) << 4) | ((s&0x02) << 3) |
- ((m&0x04) << 1) | (s&0x04) |
- ((m&0x08) >> 2) | ((s&0x08) >> 3) ;
- dst[j*2+1] = ((m&0x10) << 3) | ((s&0x10)<<2) |
- (m&0x20) | ((s&0x20) >> 1) |
- ((m&0x40) >> 3) | ((s&0x40) >> 4) |
- ((m&0x80) >> 6) | ((s&0x80) >> 7) ;
- }
- else {
- dst[j*2] = 0xAA;
- dst[j*2+1] = 0xAA;
- }
- }
- }
-
- return mem;
-}
-#endif
-
Bool
SiSHWCursorInit(ScreenPtr pScreen)
{
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c
index 3dcdfb7c5..d85d09ea0 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v 1.12 2001/04/19 12:40:33 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v 1.15.2.1 2001/05/22 21:25:44 dawes Exp $ */
/* modified from tdfx_dri.c, mga_dri.c */
@@ -54,8 +54,6 @@ static void SISDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index);
static void SISDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
RegionPtr prgnSrc, CARD32 index);
-void SISLostContext(ScreenPtr pScreen);
-
static Bool
SISInitVisualConfigs(ScreenPtr pScreen)
{
@@ -80,17 +78,17 @@ SISInitVisualConfigs(ScreenPtr pScreen)
case 32:
numConfigs = (useZ16)?8:16;
- if (!(pConfigs = (__GLXvisualConfig*)xnfcalloc(sizeof(__GLXvisualConfig),
- numConfigs))) {
+ if (!(pConfigs = (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig),
+ numConfigs))) {
return FALSE;
}
- if (!(pSISConfigs = (SISConfigPrivPtr)xnfcalloc(sizeof(SISConfigPrivRec),
- numConfigs))) {
+ if (!(pSISConfigs = (SISConfigPrivPtr)xcalloc(sizeof(SISConfigPrivRec),
+ numConfigs))) {
xfree(pConfigs);
return FALSE;
}
- if (!(pSISConfigPtrs = (SISConfigPrivPtr*)xnfcalloc(sizeof(SISConfigPrivPtr),
- numConfigs))) {
+ if (!(pSISConfigPtrs = (SISConfigPrivPtr*)xcalloc(sizeof(SISConfigPrivPtr),
+ numConfigs))) {
xfree(pConfigs);
xfree(pSISConfigs);
return FALSE;
@@ -162,7 +160,7 @@ SISInitVisualConfigs(ScreenPtr pScreen)
}
if (i != numConfigs) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "[drm] Incorrect initialization of visuals\n");
+ "[dri] Incorrect initialization of visuals. Disabling DRI.\n");
return FALSE;
}
break;
@@ -182,6 +180,7 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
SISPtr pSIS = SISPTR(pScrn);
DRIInfoPtr pDRIInfo;
SISDRIPtr pSISDRI;
+ drmVersionPtr version;
/* Check that the GLX, DRI, and DRM modules have been loaded by testing
* for canonical symbols in each module. */
@@ -190,7 +189,7 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE;
if (!xf86LoaderCheckSymbol("DRIQueryVersion")) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "SISDRIScreenInit failed (libdri.a too old)\n");
+ "[dri] SISDRIScreenInit failed (libdri.a too old)\n");
return FALSE;
}
@@ -198,9 +197,11 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
{
int major, minor, patch;
DRIQueryVersion(&major, &minor, &patch);
- if (major != 3 || minor != 1 || patch < 0) {
+ if (major != 4 || minor < 0) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "[drm] SISDRIScreenInit failed (DRI version = %d.%d.%d, expected 3.1.x). Disabling DRI.\n",
+ "[dri] SISDRIScreenInit failed because of a version mismatch.\n"
+ "[dri] libDRI version is %d.%d.%d but version 4.0.x is needed.\n"
+ "[dri] Disabling DRI.\n",
major, minor, patch);
return FALSE;
}
@@ -244,13 +245,14 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
* in the SAREA header
*/
if (sizeof(XF86DRISAREARec)+sizeof(SISSAREAPriv) > SAREA_MAX) {
- ErrorF("Data does not fit in SAREA\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Data does not fit in SAREA\n");
return FALSE;
}
pDRIInfo->SAREASize = SAREA_MAX;
#endif
- if (!(pSISDRI = (SISDRIPtr)xnfcalloc(sizeof(SISDRIRec),1))) {
+ if (!(pSISDRI = (SISDRIPtr)xcalloc(sizeof(SISDRIRec),1))) {
DRIDestroyInfoRec(pSIS->pDRIInfo);
pSIS->pDRIInfo=0;
return FALSE;
@@ -267,6 +269,8 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
pDRIInfo->bufferRequests = DRI_ALL_WINDOWS;
if (!DRIScreenInit(pScreen, pDRIInfo, &pSIS->drmSubFD)) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] DRIScreenInit failed. Disabling DRI.\n");
xfree(pDRIInfo->devPrivate);
pDRIInfo->devPrivate=0;
DRIDestroyInfoRec(pSIS->pDRIInfo);
@@ -275,6 +279,28 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
return FALSE;
}
+#if 000
+ /* XXX Check DRM kernel version here */
+ version = drmGetVersion(info->drmFD);
+ if (version) {
+ if (version->version_major != 1 ||
+ version->version_minor < 0) {
+ /* incompatible drm version */
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] SISDRIScreenInit failed because of a version mismatch.\n"
+ "[dri] sis.o kernel module version is %d.%d.%d but version 1.0.x is needed.\n"
+ "[dri] Disabling the DRI.\n",
+ version->version_major,
+ version->version_minor,
+ version->version_patchlevel);
+ drmFreeVersion(version);
+ R128DRICloseScreen(pScreen);
+ return FALSE;
+ }
+ drmFreeVersion(version);
+ }
+#endif
+
pSISDRI->regs.size = SISIOMAPSIZE;
pSISDRI->regs.map = 0;
if (drmAddMap(pSIS->drmSubFD, (drmHandle)pSIS->IOAddress,
@@ -304,7 +330,7 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpEnable failed\n");
break;
}
- ErrorF("[drm] drmAgpEnabled succeeded\n");
+ xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] drmAgpEnabled succeeded\n");
if (drmAgpAlloc(pSIS->drmSubFD, AGP_SIZE, 0, NULL, &pSIS->agpHandle) < 0) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
@@ -373,7 +399,7 @@ Bool SISDRIScreenInit(ScreenPtr pScreen)
SISDRICloseScreen(pScreen);
return FALSE;
}
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "visual configs initialized\n" );
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized.\n" );
return TRUE;
}
@@ -398,9 +424,9 @@ SISDRICloseScreen(ScreenPtr pScreen)
if (pSIS->pVisualConfigsPriv) xfree(pSIS->pVisualConfigsPriv);
if(pSIS->agpSize){
- ErrorF("Freeing agp memory\n");
+ xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Freeing agp memory\n");
drmAgpFree(pSIS->drmSubFD, pSIS->agpHandle);
- ErrorF("releasing agp module\n");
+ xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Releasing agp module\n");
drmAgpRelease(pSIS->drmSubFD);
}
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h
index 5aa2edb66..55714d0d5 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h,v 1.5 2001/04/20 02:53:59 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h,v 1.6 2001/05/16 13:43:17 alanh Exp $ */
/* modified from tdfx_dri.h */
@@ -66,5 +66,4 @@ void SISDRICloseScreen(ScreenPtr pScreen);
Bool SISDRIFinishScreenInit(ScreenPtr pScreen);
#endif
-
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c
index 4c07baa7d..56accb362 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c
@@ -25,7 +25,7 @@
* Mitani Hiroshi <hmitani@drl.mei.co.jp>
* David Thomas <davtom@dream.org.uk>.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c,v 1.61 2001/04/19 14:05:55 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c,v 1.64.2.1 2001/05/22 21:25:44 dawes Exp $ */
#include "fb.h"
#include "xf1bpp.h"
@@ -43,10 +43,10 @@
#include "vgaHW.h"
#include "xf86RAC.h"
#include "shadowfb.h"
+#include "vbe.h"
#include "sis_shadow.h"
-
#include "mipointer.h"
#include "mibstore.h"
@@ -101,7 +101,7 @@ static void SISModifyModeInfo(DisplayModePtr mode);
static void SiSPreSetMode(ScrnInfoPtr pScrn);
void SiSOptions(ScrnInfoPtr pScrn);
-OptionInfoPtr SISAvailableOptions(int chipid, int busid);
+const OptionInfoRec * SISAvailableOptions(int chipid, int busid);
void SiSSetup(ScrnInfoPtr pScrn);
void SISVGAPreInit(ScrnInfoPtr pScrn);
Bool SiSAccelInit(ScreenPtr pScreen);
@@ -176,7 +176,6 @@ static PciChipsets SISPciChipsets[] = {
};
-
int sisReg32MMIO[]={0x8280,0x8284,0x8288,0x828C,0x8290,0x8294,0x8298,0x829C,
0x82A0,0x82A4,0x82A8,0x82AC};
/* Engine Register for the 2nd Generation Graphics Engine */
@@ -559,8 +558,18 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
const char *Sym = NULL;
int pix24flags;
- if (flags & PROBE_DETECT)
- return FALSE;
+ vbeInfoPtr pVbe;
+
+ if (flags & PROBE_DETECT) {
+ if (xf86LoadSubModule(pScrn, "vbe")) {
+ int index = xf86GetEntityInfo(pScrn->entityList[0])->index;
+ if ((pVbe = VBEInit(NULL,index))) {
+ ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
+ }
+ }
+ return TRUE;
+ }
/*
* Note: This function is only called once at server startup, and
@@ -1039,10 +1048,21 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
}
xf86LoaderReqSymLists(ddcSymbols, NULL);
+ {
+ Bool ret;
+ if (xf86LoadSubModule(pScrn, "vbe")) {
+ if ((pVbe = VBEInit(NULL,pSiS->pEnt->index))) {
+ ret = xf86SetDDCproperties(pScrn,
+ xf86PrintEDID(vbeDoEDID(pVbe,NULL)));
+ vbeFree(pVbe);
+ }
+ }
+ }
+
#if 0
- /* Initialize DDC1 if possible */
- if (pSiS->ddc1Read)
- xf86PrintEDID(xf86DoEDID_DDC1(pScrn->scrnIndex,vgaHWddc1SetSpeed,pSiS->ddc1Read));
+ if (!ret && pSiS->ddc1Read)
+ xf86SetDDCProperties(xf86PrintEDID(xf86DoEDID_DDC1(
+ pScrn->scrnIndex,vgaHWddc1SetSpeed,pSiS->ddc1Read )));
#endif
return TRUE;
@@ -1352,10 +1372,6 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#ifdef XF86DRI
pSiS->directRenderingEnabled = SISDRIScreenInit(pScreen);
/* Force the initialization of the context */
-#if 0
- SISLostContext(pScreen);
-#endif
-
#endif
/*
@@ -1475,14 +1491,22 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86DPMSInit(pScreen, (DPMSSetProcPtr)SISDisplayPowerManagementSet, 0);
#ifdef XvExtension
- {
- XF86VideoAdaptorPtr *ptr;
- int n;
-
- n = xf86XVListGenericAdaptors(pScrn, &ptr);
- if (n) {
- xf86XVScreenInit(pScreen, ptr, n);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "use generic Xv\n" );
+ if (!pSiS->NoXvideo) {
+ /* HW Xv for SiS630 */
+ if (pSiS->Chipset == PCI_CHIP_SIS630) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using SiS630 HW Xv\n" );
+ SISInitVideo(pScreen);
+ }
+ else { /* generic Xv */
+
+ XF86VideoAdaptorPtr *ptr;
+ int n;
+
+ n = xf86XVListGenericAdaptors(pScrn, &ptr);
+ if (n) {
+ xf86XVScreenInit(pScreen, ptr, n);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using generic Xv\n" );
+ }
}
}
#endif
@@ -1503,10 +1527,6 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
#endif
- if (pSiS->Chipset == PCI_CHIP_SIS630) {
- SISInitVideo(pScreen);
- }
-
pSiS->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = SISCloseScreen;
pScreen->SaveScreen = SISSaveScreen;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c
index a295614c2..b72e1ed91 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c,v 1.5 2001/04/19 12:40:33 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c,v 1.7 2001/05/16 13:43:17 alanh Exp $ */
#include "xf86.h"
#include "xf86PciInfo.h"
@@ -16,10 +16,11 @@ typedef enum {
OPTION_SET_MEMCLOCK,
OPTION_FORCE_CRT2TYPE,
OPTION_SHADOW_FB,
- OPTION_ROTATE
+ OPTION_ROTATE,
+ OPTION_NOXVIDEO
} SISOpts;
-static OptionInfoRec SISOptions[] = {
+static const OptionInfoRec SISOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE },
@@ -31,11 +32,12 @@ static OptionInfoRec SISOptions[] = {
{ OPTION_FORCE_CRT2TYPE, "ForceCRT2Type",OPTV_ANYSTR, {0}, FALSE },
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE },
+ { OPTION_NOXVIDEO, "NoXvideo", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
void SiSOptions(ScrnInfoPtr pScrn);
-OptionInfoPtr SISAvailableOptions(int chipid, int busid);
+const OptionInfoRec * SISAvailableOptions(int chipid, int busid);
void
SiSOptions(ScrnInfoPtr pScrn)
@@ -49,7 +51,10 @@ SiSOptions(ScrnInfoPtr pScrn)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, SISOptions);
+ if (!(pSiS->Options = xalloc(sizeof(SISOptions))))
+ return;
+ memcpy(pSiS->Options, SISOptions, sizeof(SISOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pSiS->Options);
/* initalize some defaults */
pSiS->FastVram = TRUE;
@@ -58,6 +63,7 @@ SiSOptions(ScrnInfoPtr pScrn)
pSiS->HWCursor = TRUE;
pSiS->Rotate = FALSE;
pSiS->ShadowFB = FALSE;
+ pSiS->NoXvideo = FALSE;
switch(pSiS->Chipset) {
case PCI_CHIP_SIS530:
pSiS->TurboQueue = FALSE; /* FIXME ? */
@@ -68,7 +74,7 @@ SiSOptions(ScrnInfoPtr pScrn)
#if 0 /* we only work with a depth greater or equal to 8 */
if (pScrn->depth <= 8) {
- if (xf86GetOptValInteger(SISOptions, OPTION_RGB_BITS,
+ if (xf86GetOptValInteger(pSiS->Options, OPTION_RGB_BITS,
&pScrn->rgbBits))
{
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
@@ -79,10 +85,10 @@ SiSOptions(ScrnInfoPtr pScrn)
/* sw/hw cursor */
from = X_DEFAULT;
- if (xf86GetOptValBool(SISOptions, OPTION_HW_CURSOR, &pSiS->HWCursor)) {
+ if (xf86GetOptValBool(pSiS->Options, OPTION_HW_CURSOR, &pSiS->HWCursor)) {
from = X_CONFIG;
}
- if (xf86ReturnOptValBool(SISOptions, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(pSiS->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pSiS->HWCursor = FALSE;
}
@@ -90,21 +96,21 @@ SiSOptions(ScrnInfoPtr pScrn)
pSiS->HWCursor ? "HW" : "SW");
/* Accel */
- if (xf86ReturnOptValBool(SISOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pSiS->Options, OPTION_NOACCEL, FALSE)) {
pSiS->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
/* PCI retry */
from = X_DEFAULT;
- if (xf86GetOptValBool(SISOptions, OPTION_PCI_RETRY, &pSiS->UsePCIRetry)) {
+ if (xf86GetOptValBool(pSiS->Options, OPTION_PCI_RETRY, &pSiS->UsePCIRetry)) {
from = X_CONFIG;
}
xf86DrvMsg(pScrn->scrnIndex, from, "PCI retry %s\n",
pSiS->UsePCIRetry ? "enabled" : "disabled");
/* Mem clock */
- if (xf86GetOptValFreq(SISOptions, OPTION_SET_MEMCLOCK, OPTUNITS_MHZ,
+ if (xf86GetOptValFreq(pSiS->Options, OPTION_SET_MEMCLOCK, OPTUNITS_MHZ,
&temp)) {
pSiS->MemClock = (int)(temp * 1000.0);
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
@@ -113,7 +119,7 @@ SiSOptions(ScrnInfoPtr pScrn)
/* fast VRAM */
from = X_DEFAULT;
- if (xf86GetOptValBool(SISOptions, OPTION_FAST_VRAM, &pSiS->FastVram)) {
+ if (xf86GetOptValBool(pSiS->Options, OPTION_FAST_VRAM, &pSiS->FastVram)) {
from = X_CONFIG;
}
xf86DrvMsg(pScrn->scrnIndex, from, "Fast VRAM %s\n",
@@ -121,7 +127,7 @@ SiSOptions(ScrnInfoPtr pScrn)
/* Turbo QUEUE */
from = X_DEFAULT;
- if (xf86GetOptValBool(SISOptions, OPTION_TURBOQUEUE, &pSiS->TurboQueue)) {
+ if (xf86GetOptValBool(pSiS->Options, OPTION_TURBOQUEUE, &pSiS->TurboQueue)) {
from = X_CONFIG;
}
xf86DrvMsg(pScrn->scrnIndex, from, "TurboQueue %s\n",
@@ -129,7 +135,7 @@ SiSOptions(ScrnInfoPtr pScrn)
/* CRT2 type */
pSiS->ForceCRT2Type = CRT2_DEFAULT;
- strptr = (char *)xf86GetOptValString(SISOptions, OPTION_FORCE_CRT2TYPE);
+ strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_FORCE_CRT2TYPE);
if (strptr != NULL)
{
if (!xf86strcmp(strptr,"TV"))
@@ -146,7 +152,7 @@ SiSOptions(ScrnInfoPtr pScrn)
/* ShadowFB */
from = X_DEFAULT;
- if (xf86GetOptValBool(SISOptions, OPTION_SHADOW_FB, &pSiS->ShadowFB)) {
+ if (xf86GetOptValBool(pSiS->Options, OPTION_SHADOW_FB, &pSiS->ShadowFB)) {
from = X_CONFIG;
}
if (pSiS->ShadowFB) {
@@ -156,7 +162,7 @@ SiSOptions(ScrnInfoPtr pScrn)
}
/* Rotate */
- if ((strptr = (char *)xf86GetOptValString(SISOptions, OPTION_ROTATE))) {
+ if ((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_ROTATE))) {
if(!xf86NameCmp(strptr, "CW")) {
pSiS->ShadowFB = TRUE;
pSiS->NoAccel = TRUE;
@@ -179,9 +185,16 @@ SiSOptions(ScrnInfoPtr pScrn)
"Valid options are \"CW\" or \"CCW\"\n");
}
}
+
+ /* NOXvideo */
+ if (xf86ReturnOptValBool(pSiS->Options, OPTION_NOXVIDEO, FALSE)) {
+ pSiS->NoXvideo = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "XVideo Extension Disabled\n");
+ }
+
}
-OptionInfoPtr
+const OptionInfoRec *
SISAvailableOptions(int chipid, int busid)
{
return SISOptions;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c
index 00a3ba469..13b086cc3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c
@@ -24,7 +24,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c,v 1.2 2001/04/19 12:40:33 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c,v 1.3 2001/05/16 13:43:17 alanh Exp $ */
/*
* sis_video.c: SIS Xv driver. Based on the mga Xv driver by Mark Vojkovich
@@ -212,9 +212,8 @@ void SISInitVideo(ScreenPtr pScreen)
XF86VideoAdaptorPtr newAdaptor = NULL;
int num_adaptors;
- if (pScrn->bitsPerPixel != 8)
- {
- newAdaptor = SISSetupImageVideo(pScreen);
+ if (pScrn->bitsPerPixel != 8) {
+ newAdaptor = SISSetupImageVideo(pScreen);
}
num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
@@ -224,8 +223,8 @@ void SISInitVideo(ScreenPtr pScreen)
num_adaptors = 1;
adaptors = &newAdaptor;
} else {
- newAdaptors = /* need to free this someplace */
- xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
+ /* need to free this someplace */
+ newAdaptors = xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
if(newAdaptors) {
memcpy(newAdaptors, adaptors, num_adaptors *
sizeof(XF86VideoAdaptorPtr));
@@ -337,7 +336,7 @@ typedef struct {
CARD8 contrastCtrl;
CARD8 contrastFactor;
- CARD8 lineBufSize;
+ CARD8 lineBufSize;
CARD8 (*VBlankActiveFunc)(SISPtr);
CARD32 (*GetScanLineFunc)(SISPtr pSIS);
@@ -814,7 +813,7 @@ set_colorkey(SISPtr pSIS, CARD32 colorkey)
g = (CARD8)((colorkey>>8) & 0xFF);
r = (CARD8)((colorkey>>16) & 0xFF);
- /* Activate the colorkey mode */
+ /* Activate the colorkey mode */
setvideoreg(pSIS, Index_VI_Overlay_ColorKey_Blue_Min ,(CARD8)b);
setvideoreg(pSIS, Index_VI_Overlay_ColorKey_Green_Min ,(CARD8)g);
setvideoreg(pSIS, Index_VI_Overlay_ColorKey_Red_Min ,(CARD8)r);
@@ -1134,7 +1133,7 @@ SISPutImage(
/* TODO: use xf86AllocateOffscreenLinear is better */
if(pPriv->fbAreaPtr) {
/* TODO: resize */
- xf86FreeOffscreenArea(pPriv->fbAreaPtr);
+ xf86FreeOffscreenArea(pPriv->fbAreaPtr);
}
depth = (pScrn->bitsPerPixel + 7 ) / 8;
pitch = pScrn->displayWidth * depth;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c
index 0313a249e..00b0072aa 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c
@@ -20,7 +20,7 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c,v 1.2 2000/12/02 15:30:52 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c,v 1.3 2001/05/04 19:05:45 dawes Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -34,7 +34,7 @@
#include "xf86cmap.h"
#include "bw2.h"
-static OptionInfoPtr BW2AvailableOptions(int chipid, int busid);
+static const OptionInfoRec * BW2AvailableOptions(int chipid, int busid);
static void BW2Identify(int flags);
static Bool BW2Probe(DriverPtr drv, int flags);
static Bool BW2PreInit(ScrnInfoPtr pScrn, int flags);
@@ -82,7 +82,7 @@ DriverRec SUNBW2 = {
0
};
-static OptionInfoRec BW2Options[] = {
+static const OptionInfoRec BW2Options[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -164,8 +164,7 @@ BW2FreeRec(ScrnInfoPtr pScrn)
return;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
BW2AvailableOptions(int chipid, int busid)
{
return BW2Options;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile
index 20ee055c5..b823d5c8e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile
@@ -1,7 +1,7 @@
XCOMM
XCOMM This is an Imakefile for the cg14 driver.
XCOMM
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile,v 1.2 2001/01/24 00:06:28 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile,v 1.3 2001/05/16 06:48:10 keithp Exp $
#define IHaveModules
#include <Server.tmpl>
@@ -13,8 +13,8 @@ OBJS = cg14_driver.o
INCLUDES = -I. -I../../include
#else
INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
- -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \
- -I$(SERVERSRC)/Xext -I$(SERVERSRC)/cfb \
+ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \
+ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \
-I$(XF86SRC)/ramdac \
-I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(EXTINCSRC)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h
index 8d96e3d20..d4a603420 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h
@@ -20,7 +20,7 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h,v 1.2 2001/03/03 22:41:33 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h,v 1.3 2001/05/04 19:05:45 dawes Exp $ */
#ifndef CG14_H
#define CG14_H
@@ -60,6 +60,7 @@ typedef struct {
int height;
sbusDevicePtr psdp;
CloseScreenProcPtr CloseScreen;
+ OptionInfoPtr Options;
} Cg14Rec, *Cg14Ptr;
#define GET_CG14_FROM_SCRN(p) ((Cg14Ptr)((p)->driverPrivate))
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c
index 6a2468164..565e3973f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c
@@ -20,9 +20,8 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c,v 1.2 2000/12/02 15:30:53 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c,v 1.4 2001/05/16 06:48:10 keithp Exp $ */
-#define PSZ 8
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86_ansic.h"
@@ -31,13 +30,11 @@
#include "mibstore.h"
#include "micmap.h"
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
+#include "fb.h"
#include "xf86cmap.h"
#include "cg14.h"
-static OptionInfoPtr CG14AvailableOptions(int chipid, int busid);
+static const OptionInfoRec * CG14AvailableOptions(int chipid, int busid);
static void CG14Identify(int flags);
static Bool CG14Probe(DriverPtr drv, int flags);
static Bool CG14PreInit(ScrnInfoPtr pScrn, int flags);
@@ -87,7 +84,7 @@ DriverRec SUNCG14 = {
0
};
-static OptionInfoRec CG14Options[] = {
+static const OptionInfoRec CG14Options[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -169,8 +166,7 @@ CG14FreeRec(ScrnInfoPtr pScrn)
return;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
CG14AvailableOptions(int chipid, int busid)
{
return CG14Options;
@@ -346,7 +342,10 @@ CG14PreInit(ScrnInfoPtr pScrn, int flags)
/* Collect all of the relevant option flags (fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, CG14Options);
+ if (!(pCg14->Options = xalloc(sizeof(CG14Options))))
+ return FALSE;
+ memcpy(pCg14->Options, CG14Options, sizeof(CG14Options));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pCg14->Options);
/*
* This must happen after pScrn->display has been set because
@@ -385,7 +384,7 @@ CG14PreInit(ScrnInfoPtr pScrn, int flags)
}
}
- if (xf86LoadSubModule(pScrn, "cfb32") == NULL) {
+ if (xf86LoadSubModule(pScrn, "fb") == NULL) {
CG14FreeRec(pScrn);
return FALSE;
}
@@ -465,19 +464,25 @@ CG14ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
+ miSetPixmapDepths ();
+
/*
* Call the framebuffer layer's ScreenInit function, and fill in other
* pScreen fields.
*/
CG14InitCplane24(pScrn);
- ret = cfb32ScreenInit(pScreen, pCg14->fb, pScrn->virtualX,
- pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
- pScrn->virtualX);
+ ret = fbScreenInit(pScreen, pCg14->fb, pScrn->virtualX,
+ pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
+ pScrn->virtualX, pScrn->bitsPerPixel);
if (!ret)
return FALSE;
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
+
miInitializeBackingStore(pScreen);
xf86SetBackingStore(pScreen);
xf86SetSilkenMouse(pScreen);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile
index 83df17d4c..01798e3cf 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile
@@ -1,7 +1,7 @@
XCOMM
XCOMM This is an Imakefile for the cg3 driver.
XCOMM
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile,v 1.2 2001/01/24 00:06:29 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile,v 1.3 2001/05/16 06:48:10 keithp Exp $
#define IHaveModules
#include <Server.tmpl>
@@ -13,8 +13,8 @@ OBJS = cg3_driver.o
INCLUDES = -I. -I../../include
#else
INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
- -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \
- -I$(SERVERSRC)/Xext -I$(SERVERSRC)/cfb \
+ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \
+ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \
-I$(XF86SRC)/ramdac \
-I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(EXTINCSRC)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c
index a5acd802d..12e14e6ca 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c
@@ -20,7 +20,7 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c,v 1.2 2000/12/02 15:30:54 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c,v 1.4 2001/05/16 06:48:10 keithp Exp $ */
#define PSZ 8
#include "xf86.h"
@@ -31,11 +31,11 @@
#include "mibstore.h"
#include "micmap.h"
-#include "cfb.h"
+#include "fb.h"
#include "xf86cmap.h"
#include "cg3.h"
-static OptionInfoPtr CG3AvailableOptions(int chipid, int busid);
+static const OptionInfoRec * CG3AvailableOptions(int chipid, int busid);
static void CG3Identify(int flags);
static Bool CG3Probe(DriverPtr drv, int flags);
static Bool CG3PreInit(ScrnInfoPtr pScrn, int flags);
@@ -83,7 +83,7 @@ DriverRec SUNCG3 = {
0
};
-static OptionInfoRec CG3Options[] = {
+static const OptionInfoRec CG3Options[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -165,8 +165,7 @@ CG3FreeRec(ScrnInfoPtr pScrn)
return;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
CG3AvailableOptions(int chipid, int busid)
{
return CG3Options;
@@ -356,7 +355,7 @@ CG3PreInit(ScrnInfoPtr pScrn, int flags)
/* Set the bits per RGB for 8bpp mode */
from = X_DEFAULT;
- if (xf86LoadSubModule(pScrn, "cfb") == NULL) {
+ if (xf86LoadSubModule(pScrn, "fb") == NULL) {
CG3FreeRec(pScrn);
return FALSE;
}
@@ -436,17 +435,23 @@ CG3ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
+ miSetPixmapDepths ();
+
/*
* Call the framebuffer layer's ScreenInit function, and fill in other
* pScreen fields.
*/
- ret = cfbScreenInit(pScreen, pCg3->fb, pScrn->virtualX,
- pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
- pScrn->virtualX);
+ ret = fbScreenInit(pScreen, pCg3->fb, pScrn->virtualX,
+ pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
+ pScrn->virtualX, 8);
if (!ret)
return FALSE;
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
+
miInitializeBackingStore(pScreen);
xf86SetBackingStore(pScreen);
xf86SetSilkenMouse(pScreen);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile
index a0398181a..0c9a71385 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile
@@ -1,7 +1,7 @@
XCOMM
XCOMM This is an Imakefile for the cg6 driver.
XCOMM
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile,v 1.3 2001/01/24 00:06:29 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile,v 1.4 2001/05/16 06:48:11 keithp Exp $
#define IHaveModules
#include <Server.tmpl>
@@ -13,8 +13,8 @@ OBJS = cg6_driver.o cg6_cursor.o
INCLUDES = -I. -I../../include
#else
INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
- -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \
- -I$(SERVERSRC)/Xext -I$(SERVERSRC)/cfb \
+ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \
+ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \
-I$(XF86SRC)/ramdac \
-I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(EXTINCSRC)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h
index 5945b201f..00ed5b79f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h
@@ -20,7 +20,7 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h,v 1.2 2000/06/30 17:15:15 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h,v 1.3 2001/05/04 19:05:45 dawes Exp $ */
#ifndef CG6_H
#define CG6_H
@@ -72,6 +72,7 @@ typedef struct {
unsigned int CursorXY;
int CursorBg, CursorFg;
Bool CursorEnabled;
+ OptionInfoPtr Options;
} Cg6Rec, *Cg6Ptr;
extern int Cg6ScreenPrivateIndex;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c
index 228567d3b..74284bbc3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c
@@ -20,9 +20,8 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c,v 1.4 2000/12/02 15:30:54 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c,v 1.6 2001/05/16 06:48:11 keithp Exp $ */
-#define PSZ 8
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86_ansic.h"
@@ -31,11 +30,11 @@
#include "mibstore.h"
#include "micmap.h"
-#include "cfb.h"
+#include "fb.h"
#include "xf86cmap.h"
#include "cg6.h"
-static OptionInfoPtr CG6AvailableOptions(int chipid, int busid);
+static const OptionInfoRec * CG6AvailableOptions(int chipid, int busid);
static void CG6Identify(int flags);
static Bool CG6Probe(DriverPtr drv, int flags);
static Bool CG6PreInit(ScrnInfoPtr pScrn, int flags);
@@ -89,7 +88,7 @@ typedef enum {
OPTION_NOACCEL
} CG6Opts;
-static OptionInfoRec CG6Options[] = {
+static const OptionInfoRec CG6Options[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
@@ -174,8 +173,7 @@ CG6FreeRec(ScrnInfoPtr pScrn)
return;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
CG6AvailableOptions(int chipid, int busid)
{
return CG6Options;
@@ -350,7 +348,10 @@ CG6PreInit(ScrnInfoPtr pScrn, int flags)
/* Collect all of the relevant option flags (fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, CG6Options);
+ if (!(pCg6->Options = xalloc(sizeof(CG6Options))))
+ return FALSE;
+ memcpy(pCg6->Options, CG6Options, sizeof(CG6Options));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pCg6->Options);
if (!xf86SetDefaultVisual(pScrn, -1))
return FALSE;
@@ -373,9 +374,9 @@ CG6PreInit(ScrnInfoPtr pScrn, int flags)
/* determine whether we use hardware or software cursor */
pCg6->HWCursor = TRUE;
- if (xf86GetOptValBool(CG6Options, OPTION_HW_CURSOR, &pCg6->HWCursor))
+ if (xf86GetOptValBool(pCg6->Options, OPTION_HW_CURSOR, &pCg6->HWCursor))
from = X_CONFIG;
- if (xf86ReturnOptValBool(CG6Options, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(pCg6->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pCg6->HWCursor = FALSE;
}
@@ -383,12 +384,12 @@ CG6PreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pCg6->HWCursor ? "HW" : "SW");
- if (xf86ReturnOptValBool(CG6Options, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pCg6->Options, OPTION_NOACCEL, FALSE)) {
pCg6->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
- if (xf86LoadSubModule(pScrn, "cfb") == NULL) {
+ if (xf86LoadSubModule(pScrn, "fb") == NULL) {
CG6FreeRec(pScrn);
return FALSE;
}
@@ -477,17 +478,23 @@ CG6ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
+ miSetPixmapDepths ();
+
/*
* Call the framebuffer layer's ScreenInit function, and fill in other
* pScreen fields.
*/
- ret = cfbScreenInit(pScreen, pCg6->fb, pScrn->virtualX,
- pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
- pScrn->virtualX);
+ ret = fbScreenInit(pScreen, pCg6->fb, pScrn->virtualX,
+ pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
+ pScrn->virtualX, 8);
if (!ret)
return FALSE;
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
+
miInitializeBackingStore(pScreen);
xf86SetBackingStore(pScreen);
xf86SetSilkenMouse(pScreen);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h
index 5848ecb6e..13838959b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h
@@ -24,7 +24,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h,v 1.6 2001/03/03 22:41:34 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h,v 1.7 2001/05/04 19:05:46 dawes Exp $ */
#ifndef FFB_H
#define FFB_H
@@ -212,6 +212,8 @@ typedef struct {
Bool dri_enabled;
ffb_dri_state_t *pFfbSarea;
#endif
+
+ OptionInfoPtr Options;
} FFBRec, *FFBPtr;
/* Acceleration */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c
index 8cceed85a..334bdfdbe 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c,v 1.8 2001/04/18 14:52:42 dawes Exp $
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c,v 1.9 2001/05/02 15:06:10 dawes Exp $
* Acceleration for the Creator and Creator3D framebuffer - DRI/DRM support.
*
* Copyright (C) 2000 David S. Miller (davem@redhat.com)
@@ -221,8 +221,9 @@ FFBDRIScreenInit(ScreenPtr pScreen)
DRIQueryVersion(&major, &minor, &patch);
if (major != 4 || minor < 0) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "[drm] FFBDRIScreenInit failed (DRI version = %d.%d.%d, "
- "expected 4.0.x). Disabling DRI.\n",
+ "[dri] FFBDRIScreenInit failed because of a version mismatch.\n"
+ "[dri] libDRI version is %d.%d.%d but version, 4.0.x is needed.\n"
+ "[dri] Disabling DRI.\n",
major, minor, patch);
return FALSE;
}
@@ -277,11 +278,35 @@ FFBDRIScreenInit(ScreenPtr pScreen)
pDRIInfo->createDummyCtxPriv = FALSE;
if (!DRIScreenInit(pScreen, pDRIInfo, &(pFfb->drmSubFD))) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] DRIScreenInit failed. Disabling DRI.\n");
DRIDestroyInfoRec(pFfb->pDRIInfo);
xfree(pFfbDRI);
return FALSE;
}
+#if 000 /* XXX this should be cleaned up and used */
+ /* Check the ffb DRM version */
+ version = drmGetVersion(info->drmFD);
+ if (version) {
+ if (version->version_major != 1 ||
+ version->version_minor < 0) {
+ /* incompatible drm version */
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] FFBDRIScreenInit failed because of a version mismatch.\n"
+ "[dri] ffb.o kernel module version is %d.%d.%d but version 1.0.x is needed.\n"
+ "[dri] Disabling the DRI.\n",
+ version->version_major,
+ version->version_minor,
+ version->version_patchlevel);
+ drmFreeVersion(version);
+ R128DRICloseScreen(pScreen);
+ return FALSE;
+ }
+ drmFreeVersion(version);
+ }
+#endif
+
pFfb->pFfbSarea = DRIGetSAREAPrivate(pScreen);
init_ffb_sarea(pFfb, pFfb->pFfbSarea);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c
index 689607ff3..e30e4610e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c
@@ -20,7 +20,7 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c,v 1.8 2001/04/05 17:42:33 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c,v 1.9 2001/05/04 19:05:46 dawes Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -40,7 +40,7 @@
#include "ffb.h"
-static OptionInfoPtr FFBAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * FFBAvailableOptions(int chipid, int busid);
static void FFBIdentify(int flags);
static Bool FFBProbe(DriverPtr drv, int flags);
static Bool FFBPreInit(ScrnInfoPtr pScrn, int flags);
@@ -97,7 +97,7 @@ typedef enum {
OPTION_NOACCEL
} FFBOpts;
-static OptionInfoRec FFBOptions[] = {
+static const OptionInfoRec FFBOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
@@ -182,8 +182,7 @@ FFBFreeRec(ScrnInfoPtr pScrn)
return;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
FFBAvailableOptions(int chipid, int busid)
{
return FFBOptions;
@@ -358,7 +357,10 @@ FFBPreInit(ScrnInfoPtr pScrn, int flags)
/* Collect all of the relevant option flags (fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, FFBOptions);
+ if (!(pFfb->Options = xalloc(sizeof(FFBOptions))))
+ return FALSE;
+ memcpy(pFfb->Options, FFBOptions, sizeof(FFBOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pFfb->Options);
/*
* This must happen after pScrn->display has been set because
@@ -394,9 +396,9 @@ FFBPreInit(ScrnInfoPtr pScrn, int flags)
/* determine whether we use hardware or software cursor */
pFfb->HWCursor = TRUE;
- if (xf86GetOptValBool(FFBOptions, OPTION_HW_CURSOR, &pFfb->HWCursor))
+ if (xf86GetOptValBool(pFfb->Options, OPTION_HW_CURSOR, &pFfb->HWCursor))
from = X_CONFIG;
- if (xf86ReturnOptValBool(FFBOptions, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(pFfb->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pFfb->HWCursor = FALSE;
}
@@ -404,7 +406,7 @@ FFBPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pFfb->HWCursor ? "HW" : "SW");
- if (xf86ReturnOptValBool(FFBOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pFfb->Options, OPTION_NOACCEL, FALSE)) {
pFfb->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile
index 6269e0116..2af304ae7 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile
@@ -1,7 +1,7 @@
XCOMM
XCOMM This is an Imakefile for the leo driver.
XCOMM
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile,v 1.2 2001/01/24 00:06:30 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile,v 1.4 2001/05/18 16:03:13 tsi Exp $
#define IHaveModules
#include <Server.tmpl>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h
index 70b4f808c..8df93027a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h
@@ -20,7 +20,7 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h,v 1.3 2000/12/01 00:24:35 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h,v 1.4 2001/05/04 19:05:46 dawes Exp $ */
#ifndef LEO_H
#define LEO_H
@@ -82,6 +82,7 @@ typedef struct {
xf86CursorInfoPtr CursorInfoRec;
unsigned char CursorShiftX, CursorShiftY;
unsigned char *CursorData;
+ OptionInfoPtr Options;
} LeoRec, *LeoPtr;
extern int LeoScreenPrivateIndex;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c
index 513b76a92..768461f8f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c
@@ -21,7 +21,7 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c,v 1.4 2000/12/02 15:30:56 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c,v 1.7 2001/05/18 16:03:13 tsi Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -37,7 +37,7 @@
#include "xf86cmap.h"
#include "leo.h"
-static OptionInfoPtr LeoAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * LeoAvailableOptions(int chipid, int busid);
static void LeoIdentify(int flags);
static Bool LeoProbe(DriverPtr drv, int flags);
static Bool LeoPreInit(ScrnInfoPtr pScrn, int flags);
@@ -91,7 +91,7 @@ typedef enum {
OPTION_NOACCEL
} LeoOpts;
-static OptionInfoRec LeoOptions[] = {
+static const OptionInfoRec LeoOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
@@ -176,8 +176,7 @@ LeoFreeRec(ScrnInfoPtr pScrn)
return;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
LeoAvailableOptions(int chipid, int busid)
{
return LeoOptions;
@@ -352,7 +351,10 @@ LeoPreInit(ScrnInfoPtr pScrn, int flags)
/* Collect all of the relevant option flags (fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, LeoOptions);
+ if (!(pLeo->Options = xalloc(sizeof(LeoOptions))))
+ return FALSE;
+ memcpy(pLeo->Options, LeoOptions, sizeof(LeoOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pLeo->Options);
/*
* This must happen after pScrn->display has been set because
@@ -397,9 +399,9 @@ LeoPreInit(ScrnInfoPtr pScrn, int flags)
/* determine whether we use hardware or software cursor */
pLeo->HWCursor = TRUE;
- if (xf86GetOptValBool(LeoOptions, OPTION_HW_CURSOR, &pLeo->HWCursor))
+ if (xf86GetOptValBool(pLeo->Options, OPTION_HW_CURSOR, &pLeo->HWCursor))
from = X_CONFIG;
- if (xf86ReturnOptValBool(LeoOptions, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(pLeo->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pLeo->HWCursor = FALSE;
}
@@ -407,7 +409,7 @@ LeoPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pLeo->HWCursor ? "HW" : "SW");
- if (xf86ReturnOptValBool(LeoOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pLeo->Options, OPTION_NOACCEL, FALSE)) {
pLeo->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile
index ac64a1128..1fb7df8ad 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile
@@ -1,7 +1,7 @@
XCOMM
XCOMM This is an Imakefile for the tcx driver.
XCOMM
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile,v 1.2 2001/01/24 00:06:31 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile,v 1.4 2001/05/16 12:38:10 alanh Exp $
#define IHaveModules
#include <Server.tmpl>
@@ -13,8 +13,8 @@ OBJS = tcx_driver.o tcx_cursor.o
INCLUDES = -I. -I../../include
#else
INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
- -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \
- -I$(SERVERSRC)/Xext -I$(SERVERSRC)/cfb \
+ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \
+ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \
-I$(XF86SRC)/ramdac \
-I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(EXTINCSRC)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h
index da02617a4..2528a71eb 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h
@@ -20,7 +20,7 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h,v 1.1 2000/06/30 17:15:16 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h,v 1.2 2001/05/04 19:05:46 dawes Exp $ */
#ifndef TCX_H
#define TCX_H
@@ -60,6 +60,7 @@ typedef struct {
Bool CursorEnabled;
unsigned char CursorShiftX, CursorShiftY;
unsigned char *CursorData;
+ OptionInfoPtr Options;
} TcxRec, *TcxPtr;
#define TCX_CPLANE_MODE 0x03000000
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c
index 14e689239..b2dc24dcf 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c
@@ -20,9 +20,8 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c,v 1.3 2000/12/02 15:30:57 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c,v 1.5 2001/05/16 06:48:11 keithp Exp $ */
-#define PSZ 8
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86_ansic.h"
@@ -31,13 +30,11 @@
#include "mibstore.h"
#include "micmap.h"
-#include "cfb.h"
-#undef PSZ
-#include "cfb32.h"
+#include "fb.h"
#include "xf86cmap.h"
#include "tcx.h"
-static OptionInfoPtr TCXAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * TCXAvailableOptions(int chipid, int busid);
static void TCXIdentify(int flags);
static Bool TCXProbe(DriverPtr drv, int flags);
static Bool TCXPreInit(ScrnInfoPtr pScrn, int flags);
@@ -91,7 +88,7 @@ typedef enum {
OPTION_HW_CURSOR
} TCXOpts;
-static OptionInfoRec TCXOptions[] = {
+static const OptionInfoRec TCXOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
@@ -175,8 +172,7 @@ TCXFreeRec(ScrnInfoPtr pScrn)
return;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
TCXAvailableOptions(int chipid, int busid)
{
return TCXOptions;
@@ -374,7 +370,10 @@ TCXPreInit(ScrnInfoPtr pScrn, int flags)
/* Collect all of the relevant option flags (fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, TCXOptions);
+ if (!(pTcx->Options = xalloc(sizeof(TCXOptions))))
+ return FALSE;
+ memcpy(pTcx->Options, TCXOptions, sizeof(TCXOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTcx->Options);
/*
* This must happen after pScrn->display has been set because
@@ -420,9 +419,9 @@ TCXPreInit(ScrnInfoPtr pScrn, int flags)
if (hwCursor) {
from = X_DEFAULT;
pTcx->HWCursor = TRUE;
- if (xf86GetOptValBool(TCXOptions, OPTION_HW_CURSOR, &pTcx->HWCursor))
+ if (xf86GetOptValBool(pTcx->Options, OPTION_HW_CURSOR, &pTcx->HWCursor))
from = X_CONFIG;
- if (xf86ReturnOptValBool(TCXOptions, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(pTcx->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pTcx->HWCursor = FALSE;
}
@@ -431,8 +430,7 @@ TCXPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pTcx->HWCursor ? "HW" : "SW");
- if (xf86LoadSubModule(pScrn, pScrn->depth > 8 ? "cfb32" : "cfb") ==
- NULL) {
+ if (xf86LoadSubModule(pScrn, "fb") == NULL) {
TCXFreeRec(pScrn);
return FALSE;
}
@@ -537,25 +535,26 @@ TCXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
+ miSetPixmapDepths ();
+
/*
* Call the framebuffer layer's ScreenInit function, and fill in other
* pScreen fields.
*/
- if (pScrn->depth == 8)
- ret = cfbScreenInit(pScreen, pTcx->fb, pScrn->virtualX,
- pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
- pScrn->virtualX);
- else {
+ if (pScrn->bitsPerPixel != 8)
TCXInitCplane24(pScrn);
- ret = cfb32ScreenInit(pScreen, pTcx->fb, pScrn->virtualX,
- pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
- pScrn->virtualX);
- }
+ ret = fbScreenInit(pScreen, pTcx->fb, pScrn->virtualX,
+ pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
+ pScrn->virtualX, pScrn->bitsPerPixel);
if (!ret)
return FALSE;
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
+
miInitializeBackingStore(pScreen);
xf86SetBackingStore(pScreen);
xf86SetSilkenMouse(pScreen);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile
index 24087804c..983303642 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile,v 1.20 2001/01/24 00:06:31 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile,v 1.21 2001/05/21 21:43:55 dawes Exp $
XCOMM
XCOMM This is the Imakefile for the TDFX driver.
XCOMM
@@ -17,11 +17,16 @@ DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri -I$(TOP)/include
DRIDEFINES = $(GLX_DEFINES)
#endif
+#if BuildXvExt
+XVSRCS = tdfx_video.c
+XVOBJS = tdfx_video.o
+#endif
+
SRCS = tdfx_driver.c tdfx_io.c tdfx_hwcurs.c tdfx_accel.c \
- tdfx_dga.c tdfx_priv.c tdfx_sli.c tdfx_video.c $(DRISRCS)
+ tdfx_dga.c tdfx_priv.c tdfx_sli.c $(XVSRCS) $(DRISRCS)
OBJS = tdfx_driver.o tdfx_io.o tdfx_hwcurs.o tdfx_accel.o \
- tdfx_dga.o tdfx_priv.o tdfx_sli.o tdfx_video.o $(DRIOBJS)
+ tdfx_dga.o tdfx_priv.o tdfx_sli.o $(XVOBJS) $(DRIOBJS)
#if defined(XF86DriverSDK)
INCLUDES = -I. -I../../include
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h
index 42f8f1613..1eb6d6fae 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h
@@ -5,7 +5,7 @@
Copyright: 1998,1999
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h,v 1.22 2001/04/19 19:54:50 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h,v 1.24 2001/05/21 21:43:55 dawes Exp $ */
#ifndef _TDFX_H_
#define _TDFX_H_
@@ -216,15 +216,27 @@ typedef struct _TDFXRec {
int pixmapCacheLinesMax;
FBAreaPtr reservedArea;
Bool ShowCache;
- FBLinearPtr videoScratch;
int videoKey;
void (*VideoTimerCallback)(ScrnInfoPtr, Time);
- XF86VideoAdaptorPtr adaptor;
+ FBLinearPtr overlayBuffer;
+ FBAreaPtr textureBuffer;
+ Bool TextureXvideo;
+ XF86VideoAdaptorPtr overlayAdaptor;
+ XF86VideoAdaptorPtr textureAdaptor;
ScreenBlockHandlerProcPtr BlockHandler;
- OptionInfoPtr options;
+ OptionInfoPtr Options;
} TDFXRec;
typedef struct {
+ RegionRec clip;
+ CARD32 colorKey;
+ int filterQuality;
+ CARD32 videoStatus;
+ Time offTime;
+ Time freeTime;
+} TDFXPortPrivRec, *TDFXPortPrivPtr;
+
+typedef struct {
PROPSAREADATA
int fifoOwner;
int CtxOwner;
@@ -282,5 +294,6 @@ extern void TDFXSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y,
extern void TDFXSelectBuffer(TDFXPtr pTDFX, int which);
extern void TDFXInitVideo(ScreenPtr pScreen);
+extern void TDFXCloseVideo(ScreenPtr pScreen);
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
index 320e86a31..3d137f160 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c,v 1.21 2001/04/19 19:54:50 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c,v 1.23 2001/05/21 21:43:55 dawes Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -132,7 +132,7 @@ TDFXInitVisualConfigs(ScreenPtr pScreen)
}
if (i!=numConfigs) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "Incorrect initialization of visuals\n");
+ "[dri] TDFXInitVisualConfigs: wrong number of visuals\n");
return FALSE;
}
break; /* 16bpp */
@@ -227,7 +227,7 @@ TDFXInitVisualConfigs(ScreenPtr pScreen)
}
if (i!=numConfigs) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "Incorrect initialization of visuals\n");
+ "[dri] TDFXInitVisualConfigs: wrong number of visuals\n");
return FALSE;
}
break;
@@ -279,17 +279,16 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen)
}
if (!bppOk) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "DRI not supported in %d bpp mode, disabling DRI.\n",
+ "[dri] tdfx DRI not supported in %d bpp mode, disabling DRI.\n",
(pScrn->bitsPerPixel));
if (pTDFX->ChipType <= PCI_CHIP_VOODOO3) {
xf86DrvMsg(pScreen->myNum, X_INFO,
- "To use DRI, invoke the server using 16 bpp "
- "(-depth 15 or -depth 16).\n");
+ "[dri] To use DRI, invoke the server using 16 bpp\n"
+ "\t(-depth 15 or -depth 16).\n");
} else {
xf86DrvMsg(pScreen->myNum, X_INFO,
- "To use DRI, invoke the server using 16 bpp "
- "(-depth 15 or -depth 16)\n"
- "\tor 32 bpp (-depth 24 -fbbpp 32).\n");
+ "[dri] To use DRI, invoke the server using 16 bpp\n"
+ "\t(-depth 15 or -depth 16) or 32 bpp (-depth 24 -fbbpp 32).\n");
}
return FALSE;
}
@@ -311,7 +310,9 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen)
DRIQueryVersion(&major, &minor, &patch);
if (major != 4 || minor < 0) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "TDFXDRIScreenInit failed (DRI version = %d.%d.%d, expected 4.0.x). Disabling DRI.\n",
+ "[dri] TDFXDRIScreenInit failed because of a version mismatch.\n"
+ "[dri] libDRI version is %d.%d.%d but version 4.0.x is needed.\n"
+ "[dri] Disabling the DRI.\n",
major, minor, patch);
return FALSE;
}
@@ -320,7 +321,7 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen)
pDRIInfo = DRICreateInfoRec();
if (!pDRIInfo) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "DRICreateInfoRect() failed, disabling DRI.\n");
+ "[dri] DRICreateInfoRect() failed, disabling DRI.\n");
return FALSE;
}
@@ -370,7 +371,8 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen)
#endif
if (!(pTDFXDRI = (TDFXDRIPtr)xcalloc(sizeof(TDFXDRIRec),1))) {
- xf86DrvMsg(pScreen->myNum, X_ERROR, "DRI memory allocation failed, disabling DRI.\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] DRI memory allocation failed, disabling DRI.\n");
DRIDestroyInfoRec(pTDFX->pDRIInfo);
pTDFX->pDRIInfo=0;
return FALSE;
@@ -398,7 +400,8 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen)
pDRIInfo->devPrivate=0;
DRIDestroyInfoRec(pTDFX->pDRIInfo);
pTDFX->pDRIInfo=0;
- xf86DrvMsg(pScreen->myNum, X_ERROR, "DRIScreenInit failed, disabling DRI.\n");
+ xf86DrvMsg(pScreen->myNum, X_ERROR,
+ "[dri] DRIScreenInit failed, disabling DRI.\n");
return FALSE;
}
@@ -411,7 +414,9 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen)
version->version_minor < 0) {
/* incompatible drm version */
xf86DrvMsg(pScreen->myNum, X_ERROR,
- "TDFXDRIScreenInit failed (DRM version = %d.%d.%d, expected 1.0.x). Disabling DRI.\n",
+ "[dri] TDFXDRIScreenInit failed because of a version mismatch.\n"
+ "[dri] tdfx.o kernel module version is %d.%d.%d but version 1.0.x is needed.\n"
+ "[dri] Disabling the DRI.\n",
version->version_major,
version->version_minor,
version->version_patchlevel);
@@ -619,7 +624,6 @@ TDFXDRITransitionTo2d(ScreenPtr pScreen)
xf86FreeOffscreenArea(pTDFX->reservedArea);
}
-
static void
TDFXDRITransitionTo3d(ScreenPtr pScreen)
{
@@ -627,8 +631,15 @@ TDFXDRITransitionTo3d(ScreenPtr pScreen)
TDFXPtr pTDFX = TDFXPTR(pScrn);
FBAreaPtr pArea;
- if(pTDFX->videoScratch)
- xf86FreeOffscreenLinear(pTDFX->videoScratch);
+ if(pTDFX->overlayBuffer) {
+ xf86FreeOffscreenLinear(pTDFX->overlayBuffer);
+ pTDFX->overlayBuffer = NULL;
+ }
+
+ if(pTDFX->textureBuffer) {
+ xf86FreeOffscreenArea(pTDFX->textureBuffer);
+ pTDFX->textureBuffer = NULL;
+ }
xf86PurgeUnlockedOffscreenAreas(pScreen);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
index 05b7ed29e..4c70b0bf1 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
@@ -27,7 +27,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.71 2001/04/23 16:52:22 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.83 2001/06/26 08:41:58 alanh Exp $ */
/*
* Authors:
@@ -100,7 +100,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* Required Functions: */
-static OptionInfoPtr TDFXAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * TDFXAvailableOptions(int chipid, int busid);
/* Print a driver identifying message. */
static void TDFXIdentify(int flags);
@@ -172,6 +172,7 @@ typedef enum {
OPTION_SHOWCACHE,
OPTION_VIDEO_KEY,
OPTION_NO_SLI,
+ OPTION_TEXTURED_VIDEO,
OPTION_DRI
} TDFXOpts;
@@ -182,60 +183,49 @@ static const OptionInfoRec TDFXOptions[] = {
{ OPTION_SHOWCACHE, "ShowCache", OPTV_BOOLEAN, {0}, FALSE},
{ OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE},
{ OPTION_NO_SLI, "NoSLI", OPTV_BOOLEAN, {0}, FALSE},
+ { OPTION_TEXTURED_VIDEO, "TexturedVideo", OPTV_BOOLEAN, {1}, FALSE},
{ OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, FALSE},
{ -1, NULL, OPTV_NONE, {0}, FALSE}
};
static const char *vgahwSymbols[] = {
+ "vgaHWFreeHWRec",
"vgaHWGetHWRec",
- "vgaHWSave", /* Added */
- "vgaHWRestore", /* Added */
- "vgaHWProtect",
- "vgaHWInit",
- "vgaHWMapMem",
- "vgaHWSetMmioFuncs",
"vgaHWGetIOBase",
+ "vgaHWGetIndex",
+ "vgaHWInit",
"vgaHWLock",
- "vgaHWUnlock",
- "vgaHWFreeHWRec",
+ "vgaHWMapMem",
+ "vgaHWProtect",
+ "vgaHWRestore",
+ "vgaHWSave",
"vgaHWSeqReset",
- "vgaHWHandleColormaps",
+ "vgaHWUnlock",
0
};
static const char *ramdacSymbols[] = {
- "xf86InitCursor",
"xf86CreateCursorInfoRec",
- "xf86DestroyCursorInfoRec",
+ "xf86InitCursor",
NULL
};
static const char *ddcSymbols[] = {
"xf86PrintEDID",
- "xf86DoEDID_DDC1",
+ "xf86SetDDCproperties",
NULL
};
-#ifdef XFree86LOADER
static const char *fbSymbols[] = {
- "fbScreenInit",
"fbPictureInit",
- NULL
-};
-
-static const char *xf8_32bppSymbols[] = {
- "xf86Overlay8Plus32Init",
+ "fbScreenInit",
NULL
};
static const char *xaaSymbols[] = {
- "XAADestroyInfoRec",
"XAACreateInfoRec",
+ "XAADestroyInfoRec",
"XAAInit",
- "XAAStippleScanlineFuncLSBFirst",
- "XAAOverlayFBfuncs",
- "XAACachePlanarMonoStipple",
- "XAAScreenIndex",
"XAAReverseBitOrder",
NULL
};
@@ -243,48 +233,43 @@ static const char *xaaSymbols[] = {
static const char *vbeSymbols[] = {
"VBEInit",
"vbeDoEDID",
+ "vbeFree",
+ NULL
+};
+
+static const char *int10Symbols[] = {
+ "xf86FreeInt10",
+ "xf86InitInt10",
NULL
};
#ifdef XF86DRI
static const char *drmSymbols[] = {
- "drmAddBufs",
"drmAddMap",
- "drmAvailable",
- "drmCtlAddCommand",
- "drmCtlInstHandler",
- "drmGetInterruptFromBusID",
- "drmMapBufs",
- "drmMarkBufs",
- "drmUnmapBufs",
"drmFreeVersion",
"drmGetVersion",
NULL
};
static const char *driSymbols[] = {
- "DRIGetDrawableIndex",
- "DRIFinishScreenInit",
- "DRIDestroyInfoRec",
"DRICloseScreen",
- "DRIDestroyInfoRec",
- "DRIScreenInit",
- "DRIDestroyInfoRec",
"DRICreateInfoRec",
- "DRILock",
- "DRIUnlock",
+ "DRIDestroyInfoRec",
+ "DRIFinishScreenInit",
"DRIGetSAREAPrivate",
- "DRIGetContext",
+ "DRILock",
+ "DRIMoveBuffersHelper",
"DRIQueryVersion",
- "DRIAdjustFrame",
- "DRIOpenFullScreen",
- "DRICloseFullScreen",
+ "DRIScreenInit",
+ "DRIUnlock",
"GlxSetVisualConfigs",
NULL
};
#endif
+#ifdef XFree86LOADER
+
static MODULESETUPPROTO(tdfxSetup);
static XF86ModuleVersionInfo tdfxVersRec =
@@ -324,7 +309,7 @@ tdfxSetup(pointer module, pointer opts, int *errmaj, int *errmin)
* might refer to.
*/
LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols,
- xf8_32bppSymbols, ramdacSymbols, vbeSymbols,
+ ramdacSymbols, vbeSymbols, int10Symbols,
#ifdef XF86DRI
drmSymbols, driSymbols,
#endif
@@ -378,7 +363,7 @@ TDFXIdentify(int flags) {
xf86PrintChipsets(TDFX_NAME, "Driver for 3dfx Banshee/Voodoo3 chipsets", TDFXChipsets);
}
-static OptionInfoPtr
+static const OptionInfoRec *
TDFXAvailableOptions(int chipid, int busid)
{
return (OptionInfoPtr)TDFXOptions;
@@ -392,6 +377,7 @@ TDFXProbeDDC(ScrnInfoPtr pScrn, int index)
{
pVbe = VBEInit(NULL,index);
ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
}
}
@@ -464,12 +450,12 @@ TDFXProbe(DriverPtr drv, int flags) {
static int
TDFXCountRam(ScrnInfoPtr pScrn) {
TDFXPtr pTDFX;
- int memSize;
- int memType=-1; /* SDRAM or SGRAM */
+ int vmemSize;
+ int vmemType=-1; /* SDRAM or SGRAM */
pTDFX = TDFXPTR(pScrn);
TDFXTRACE("TDFXCountRam start\n");
- memSize=0;
+ vmemSize=0;
if (pTDFX->PIOBase[0]) {
CARD32
partSize, /* size of SGRAM chips in Mbits */
@@ -481,31 +467,43 @@ TDFXCountRam(ScrnInfoPtr pScrn) {
miscInit1;
/* determine memory type: SDRAM or SGRAM */
- memType = MEM_TYPE_SGRAM;
+ vmemType = MEM_TYPE_SGRAM;
dramInit1_strap = pTDFX->readLong(pTDFX, DRAMINIT1);
dramInit1_strap &= SST_MCTL_TYPE_SDRAM;
- if (dramInit1_strap) memType = MEM_TYPE_SDRAM;
+ if (dramInit1_strap) vmemType = MEM_TYPE_SDRAM;
/* set memory interface delay values and enable refresh */
/* these apply to all RAM vendors */
dramInit1 = 0x0;
- if (pTDFX->ChipType==PCI_CHIP_BANSHEE)
- dramInit1 |= 7<<SST_SGRAM_OFLOP_DEL_ADJ_SHIFT;
- else
- dramInit1 |= 2<<SST_SGRAM_OFLOP_DEL_ADJ_SHIFT;
+ dramInit1 |= 2<<SST_SGRAM_OFLOP_DEL_ADJ_SHIFT;
dramInit1 |= SST_SGRAM_CLK_NODELAY;
dramInit1 |= SST_DRAM_REFRESH_EN;
dramInit1 |= (0x18 << SST_DRAM_REFRESH_VALUE_SHIFT) & SST_DRAM_REFRESH_VALUE;
dramInit1 &= ~SST_MCTL_TYPE_SDRAM;
dramInit1 |= dramInit1_strap;
- pTDFX->writeLong(pTDFX, DRAMINIT1, dramInit1);
+
+ /* Some information about the timing register (for later debugging) */
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "DRAMINIT1 read 0x%x, programming 0x%x (not Banshee)\n",
+ pTDFX->readLong(pTDFX, DRAMINIT1), dramInit1);
+
+ /*
+ * Here we don't whack the timing register on the Banshee boards as the
+ * BIOS has done a perfectly good job. As Banshee boards were made by
+ * different manufacturers we don't touch this, but carry on whacking it
+ * for Voodoo3 and Voodoo5 boards, as we've never had a problem with them.
+ * I guess this could be removed for all boards as we probably shouldn't
+ * be doing this to the V3/V5 boards too.
+ */
+ if (pTDFX->ChipType != PCI_CHIP_BANSHEE)
+ pTDFX->writeLong(pTDFX, DRAMINIT1, dramInit1);
/* determine memory size from strapping pins (dramInit0 and dramInit1) */
dramInit0_strap = pTDFX->readLong(pTDFX, DRAMINIT0);
if (pTDFX->ChipType<=PCI_CHIP_VOODOO3) { /* Banshee/V3 */
- if (memType == MEM_TYPE_SDRAM) {
- memSize = 16;
+ if (vmemType == MEM_TYPE_SDRAM) {
+ vmemSize = 16;
} else {
nChips = ((dramInit0_strap & SST_SGRAM_NUM_CHIPSETS) == 0) ? 4 : 8;
@@ -518,22 +516,22 @@ TDFXCountRam(ScrnInfoPtr pScrn) {
(dramInit0_strap & SST_SGRAM_TYPE) << SST_SGRAM_TYPE_SHIFT );
return 0;
}
- memSize = (nChips * partSize) / 8; /* in MBytes */
+ vmemSize = (nChips * partSize) / 8; /* in MBytes */
}
} else { /* V4, V5 */
nChips = ((dramInit0_strap & SST_SGRAM_NUM_CHIPSETS)==0) ? 4 : 8;
partSize=1<<((dramInit0_strap&0x38000000)>>28);
banks=((dramInit0_strap&BIT(30))==0) ? 2 : 4;
- memSize=nChips*partSize*banks;
+ vmemSize=nChips*partSize*banks;
}
TDFXTRACEREG("dramInit0 = %x dramInit1 = %x\n", dramInit0_strap, dramInit1_strap);
- TDFXTRACEREG("MemConfig %d chips %d size %d total\n", nChips, partSize, memSize);
+ TDFXTRACEREG("MemConfig %d chips %d size %d total\n", nChips, partSize, vmemSize);
/*
disable block writes for SDRAM
*/
miscInit1 = pTDFX->readLong(pTDFX, MISCINIT1);
- if ( memType == MEM_TYPE_SDRAM ) {
+ if ( vmemType == MEM_TYPE_SDRAM ) {
miscInit1 |= SST_DISABLE_2D_BLOCK_WRITE;
}
miscInit1|=1;
@@ -541,7 +539,7 @@ TDFXCountRam(ScrnInfoPtr pScrn) {
}
/* return # of KBytes of board memory */
- return memSize*1024;
+ return vmemSize*1024;
}
#if 0
@@ -672,6 +670,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
int flags24;
rgb defaultWeight = {0, 0, 0};
pciVideoPtr match;
+ int availableMem;
TDFXTRACE("TDFXPreInit start\n");
if (pScrn->numEntities != 1) return FALSE;
@@ -686,12 +685,14 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
pTDFX->initDone=FALSE;
pTDFX->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
-#if !defined(__powerpc__)
if (flags & PROBE_DETECT) {
+#if !defined(__powerpc__)
TDFXProbeDDC(pScrn, pTDFX->pEnt->index);
return TRUE;
- }
+#else
+ return FALSE;
#endif
+ }
if (pTDFX->pEnt->location.type != BUS_PCI) return FALSE;
@@ -707,6 +708,8 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
#if !defined(__powerpc__)
if (xf86LoadSubModule(pScrn, "int10")) {
xf86Int10InfoPtr pInt;
+
+ xf86LoaderReqSymLists(int10Symbols, NULL);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Softbooting the board (through the int10 interface).\n");
pInt = xf86InitInt10(pTDFX->pEnt->index);
@@ -810,9 +813,10 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
/* Process the options */
xf86CollectOptions(pScrn, NULL);
- pTDFX->options = xnfalloc(sizeof(TDFXOptions));
- memcpy(pTDFX->options, TDFXOptions, sizeof(TDFXOptions));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTDFX->options);
+ if (!(pTDFX->Options = xalloc(sizeof(TDFXOptions))))
+ return FALSE;
+ memcpy(pTDFX->Options, TDFXOptions, sizeof(TDFXOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTDFX->Options);
/*
* Set the Chipset and ChipRev, allowing config file entries to
@@ -959,12 +963,19 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
clockRanges->interlaceAllowed = FALSE;
clockRanges->doubleScanAllowed = TRUE;
+ /*
+ * Max memory available for the framebuffer is the total less the
+ * HW cursor space and FIFO space.
+ */
+ availableMem = pScrn->videoRam - 4096 -
+ (((255 <= CMDFIFO_PAGES) ? 255 : CMDFIFO_PAGES) << 12);
+
i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
pScrn->display->modes, clockRanges,
0, 320, 2048, 16*pScrn->bitsPerPixel,
- 200, 1536,
- pScrn->virtualX, pScrn->virtualY,
- pTDFX->FbMapSize, LOOKUP_BEST_REFRESH);
+ 200, 2047,
+ pScrn->display->virtualX, pScrn->display->virtualY,
+ availableMem, LOOKUP_BEST_REFRESH);
if (i==-1) {
TDFXFreeRec(pScrn);
@@ -991,35 +1002,35 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
TDFXFreeRec(pScrn);
return FALSE;
}
- xf86LoaderReqSymbols("fbScreenInit", "fbPictureInit", NULL);
+ xf86LoaderReqSymLists(fbSymbols, NULL);
- if (!xf86ReturnOptValBool(pTDFX->options, OPTION_NOACCEL, FALSE)) {
+ if (!xf86ReturnOptValBool(pTDFX->Options, OPTION_NOACCEL, FALSE)) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
TDFXFreeRec(pScrn);
return FALSE;
}
+ xf86LoaderReqSymLists(xaaSymbols, NULL);
}
- if (!xf86GetOptValBool(pTDFX->options, OPTION_SHOWCACHE, &(pTDFX->ShowCache))) {
+ if (!xf86GetOptValBool(pTDFX->Options, OPTION_SHOWCACHE, &(pTDFX->ShowCache))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache %s\n", pTDFX->ShowCache ? "Enabled" : "Disabled");
} else {
pTDFX->ShowCache = FALSE;
}
- if (xf86GetOptValInteger(pTDFX->options, OPTION_VIDEO_KEY, &(pTDFX->videoKey))) {
+ if (xf86GetOptValBool(pTDFX->Options, OPTION_TEXTURED_VIDEO, &(pTDFX->TextureXvideo))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Texture Xvideo Adaptor %s\n", pTDFX->TextureXvideo ? "Enabled" : "Disabled");
+ } else {
+ pTDFX->TextureXvideo = FALSE;
+ }
+
+ if (xf86GetOptValInteger(pTDFX->Options, OPTION_VIDEO_KEY, &(pTDFX->videoKey))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n", pTDFX->videoKey);
} else {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key default 0x%x\n", pTDFX->videoKey = 0x1E);
}
- if (xf86GetOptValInteger(pTDFX->options, OPTION_VIDEO_KEY, &(pTDFX->videoKey))) {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
- pTDFX->videoKey);
- } else
- pTDFX->videoKey = 0x1E;
-
-
- if (!xf86ReturnOptValBool(pTDFX->options, OPTION_SW_CURSOR, FALSE)) {
+ if (!xf86ReturnOptValBool(pTDFX->Options, OPTION_SW_CURSOR, FALSE)) {
if (!xf86LoadSubModule(pScrn, "ramdac")) {
TDFXFreeRec(pScrn);
return FALSE;
@@ -1040,13 +1051,17 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
/* Initialize DDC1 if possible */
if (xf86LoadSubModule(pScrn, "vbe")) {
xf86MonPtr pMon;
- pMon = vbeDoEDID(VBEInit(NULL,pTDFX->pEnt->index), NULL);
+ vbeInfoPtr pVbe = VBEInit(NULL,pTDFX->pEnt->index);
+
+ xf86LoaderReqSymLists(vbeSymbols, NULL);
+ pMon = vbeDoEDID(pVbe, NULL);
+ vbeFree(pVbe);
xf86SetDDCproperties(pScrn,xf86PrintEDID(pMon));
}
#endif
#endif
- if (xf86ReturnOptValBool(pTDFX->options, OPTION_USE_PIO, FALSE)) {
+ if (xf86ReturnOptValBool(pTDFX->Options, OPTION_USE_PIO, FALSE)) {
pTDFX->usePIO=TRUE;
}
@@ -1872,6 +1887,9 @@ calcBufferSize(int xres, int yres, Bool tiled, int cpp)
static void allocateMemory(ScrnInfoPtr pScrn) {
TDFXPtr pTDFX;
int memRemaining, fifoSize, screenSizeInTiles, cursorSize;
+ int fbSize;
+ int verb;
+ char *str;
pTDFX = TDFXPTR(pScrn);
@@ -1884,6 +1902,14 @@ static void allocateMemory(ScrnInfoPtr pScrn) {
screenSizeInTiles=calcBufferSize(pScrn->virtualX, pScrn->virtualY,
TRUE, 4);
}
+
+ /*
+ * Layout is:
+ * cursor, fifo, fb, tex, bb, db
+ */
+
+ fbSize = (pScrn->virtualY + pTDFX->pixmapCacheLinesMin) * pTDFX->stride;
+
memRemaining=((pScrn->videoRam<<10) - 1) &~ 0xFFF;
/* Note that a page is 4096 bytes, and a */
/* tile is 32 x 128 = 4096 bytes. So, */
@@ -1893,10 +1919,12 @@ static void allocateMemory(ScrnInfoPtr pScrn) {
pTDFX->depthOffset = (memRemaining - screenSizeInTiles) &~ 0xFFF;
if ((pTDFX->depthOffset & (0x1 << 12)) == 0) {
#if 1
+ if (pTDFX->depthOffset > 0) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Changing depth offset from 0x%08x to 0x%08x\n",
pTDFX->depthOffset,
pTDFX->depthOffset - (0x1 << 12));
+ }
#endif
pTDFX->depthOffset -= (0x1 << 12);
}
@@ -1905,65 +1933,87 @@ static void allocateMemory(ScrnInfoPtr pScrn) {
pTDFX->backOffset = (pTDFX->depthOffset - screenSizeInTiles) &~ 0xFFF;
if (pTDFX->backOffset & (0x1 << 12)) {
#if 1
+ if (pTDFX->backOffset > 0) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Changing back offset from 0x%08x to 0x%08x\n",
pTDFX->backOffset,
pTDFX->backOffset - (0x1 << 12));
+ }
#endif
pTDFX->backOffset -= (0x1 << 12);
}
/* Give the cmd fifo at least */
/* CMDFIFO_PAGES pages, but no more than */
- /* 255. We give 4096 bytes to the cursor */
- fifoSize = ((255 <= CMDFIFO_PAGES) ? 255 : CMDFIFO_PAGES) << 12;
+ /* 64. NOTE: Don't go higher than 64, as */
+ /* there is suspect code in Glide3 ! */
+ fifoSize = ((64 <= CMDFIFO_PAGES) ? 64 : CMDFIFO_PAGES) << 12;
+
+ /* We give 4096 bytes to the cursor */
cursorSize = 4096;
pTDFX->cursorOffset = 0;
+
pTDFX->fifoOffset = pTDFX->cursorOffset + cursorSize;
pTDFX->fifoSize = fifoSize;
/* Now, place the front buffer, forcing */
/* it to be on a page boundary too, just */
/* for giggles. */
pTDFX->fbOffset = pTDFX->fifoOffset + pTDFX->fifoSize;
- pTDFX->texOffset = pTDFX->fbOffset +
- ((pScrn->virtualY+pTDFX->pixmapCacheLinesMin)*pTDFX->stride);
- pTDFX->texSize = pTDFX->backOffset - pTDFX->texOffset;
- pTDFX->cursorOffset = 0;
- if (pTDFX->texSize < 0) {
- pTDFX->backOffset = -1;
+ pTDFX->texOffset = pTDFX->fbOffset + fbSize;
+ if (pTDFX->depthOffset <= pTDFX->texOffset ||
+ pTDFX->backOffset <= pTDFX->texOffset) {
+ /*
+ * pTDFX->texSize < 0 means that the DRI is disabled. pTDFX->backOffset
+ * is used to calculate the maximum amount of memory available for
+ * 2D offscreen use. With DRI disabled, set this to the top of memory.
+ */
+
+ pTDFX->texSize = -1;
+ pTDFX->backOffset = pScrn->videoRam * 1024;
pTDFX->depthOffset = -1;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No Texture Memory available, disabling DRI\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Not enough video memory available for textures and depth buffer\n"
+ "\tand/or back buffer. Disabling DRI. To use DRI try lower\n"
+ "\tresolution modes and/or a smaller virtual screen size\n");
} else {
+ pTDFX->texSize = pTDFX->backOffset - pTDFX->texOffset;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Textures Memory %0.02f MB\n",
(float)pTDFX->texSize/1024.0/1024.0);
}
-#if 1
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+/* This could be set to 2 or 3 */
+#define OFFSET_VERB 1
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, OFFSET_VERB,
"Cursor Offset: [0x%08X,0x%08X)\n",
pTDFX->cursorOffset,
pTDFX->cursorOffset + cursorSize);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, OFFSET_VERB,
"Fifo Offset: [0x%08X, 0x%08X)\n",
pTDFX->fifoOffset,
pTDFX->fifoOffset + pTDFX->fifoSize);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Texture Offset: [0x%08X, 0x%08X)\n",
- pTDFX->texOffset,
- pTDFX->texOffset + pTDFX->texSize);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, OFFSET_VERB,
"Front Buffer Offset: [0x%08X, 0x%08X)\n",
pTDFX->fbOffset,
pTDFX->fbOffset +
(pScrn->virtualY+pTDFX->pixmapCacheLinesMin)*pTDFX->stride);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "BackOffset: [0x%08X, 0x%08X)\n",
+ if (pTDFX->texSize > 0) {
+ verb = OFFSET_VERB;
+ str = "";
+ } else {
+ verb = 3;
+ str = "(NOT USED) ";
+ }
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verb,
+ "%sTexture Offset: [0x%08X, 0x%08X)\n", str,
+ pTDFX->texOffset,
+ pTDFX->texOffset + pTDFX->texSize);
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verb,
+ "%sBackOffset: [0x%08X, 0x%08X)\n", str,
pTDFX->backOffset,
pTDFX->backOffset + screenSizeInTiles);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "DepthOffset: [0x%08X, 0x%08X)\n",
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verb,
+ "%sDepthOffset: [0x%08X, 0x%08X)\n", str,
pTDFX->depthOffset,
pTDFX->depthOffset + screenSizeInTiles);
-#endif /* 0/1 */
}
static Bool
@@ -1974,6 +2024,7 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
VisualPtr visual;
BoxRec MemBox;
MessageType driFrom = X_DEFAULT;
+ int scanlines;
TDFXTRACE("TDFXScreenInit start\n");
pScrn = xf86Screens[pScreen->myNum];
@@ -1998,13 +2049,24 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
pTDFX->stride = pScrn->displayWidth*pTDFX->cpp;
/* enough to do DVD */
- pTDFX->pixmapCacheLinesMin = ((720*480*2) + pTDFX->stride - 1)/pTDFX->stride;
+ pTDFX->pixmapCacheLinesMin = ((720*480*pTDFX->cpp) +
+ pTDFX->stride - 1)/pTDFX->stride;
+
+ if (pTDFX->ChipType > PCI_CHIP_VOODOO3) {
+ if ((pTDFX->pixmapCacheLinesMin + pScrn->virtualY) > 4095)
+ pTDFX->pixmapCacheLinesMin = 4095 - pScrn->virtualY;
+ } else {
+ if ((pTDFX->pixmapCacheLinesMin + pScrn->virtualY) > 2047)
+ pTDFX->pixmapCacheLinesMin = 2047 - pScrn->virtualY;
+ }
allocateMemory(pScrn);
+ pScrn->fbOffset = pTDFX->fbOffset;
+
#if 0
if (pTDFX->numChips>1) {
- if (xf86ReturnOptValBool(pTDFX->options, OPTION_NO_SLI, FALSE)) {
+ if (xf86ReturnOptValBool(pTDFX->Options, OPTION_NO_SLI, FALSE)) {
TDFXSetupSLI(pScrn, FALSE, 0);
} else {
TDFXSetupSLI(pScrn, TRUE, 0);
@@ -2021,26 +2083,31 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
return FALSE;
}
- pTDFX->pixmapCacheLinesMax = (pTDFX->backOffset - pTDFX->fbOffset) /
- pTDFX->stride;
-
+ scanlines = (pTDFX->backOffset - pTDFX->fbOffset) / pTDFX->stride;
if(pTDFX->ChipType < PCI_CHIP_VOODOO5) {
- if(pTDFX->pixmapCacheLinesMax > 2048)
- pTDFX->pixmapCacheLinesMax = 2048;
+ if (scanlines > 2047)
+ scanlines = 2047;
} else {
/* MaxClip seems to have only 12 bits => 0->4095 */
- if(pTDFX->pixmapCacheLinesMax > 4095)
- pTDFX->pixmapCacheLinesMax = 4095;
+ if (scanlines > 4095)
+ scanlines = 4095;
}
+ pTDFX->pixmapCacheLinesMax = scanlines - pScrn->virtualY;
+
+ /*
+ * Note, pTDFX->pixmapCacheLinesMax may be smaller than
+ * pTDFX->pixmapCacheLinesMin when pTDFX->texSize < 0. DRI is disabled
+ * in that case, so pTDFX->pixmapCacheLinesMin isn't used when that's true.
+ */
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "%i lines of offscreen memory available for 2D and video\n",
- pTDFX->pixmapCacheLinesMax);
+ "Minimum %d, Maximum %d lines of offscreen memory available\n",
+ pTDFX->pixmapCacheLinesMin, pTDFX->pixmapCacheLinesMax);
MemBox.y1 = 0;
MemBox.x1 = 0;
MemBox.x2 = pScrn->displayWidth;
- MemBox.y2 = pTDFX->pixmapCacheLinesMax;
+ MemBox.y2 = scanlines;
pTDFX->maxClip = MemBox.x2 | (MemBox.y2 << 16);
@@ -2061,18 +2128,17 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) {
miSetPixmapDepths ();
- pTDFX->NoAccel=xf86ReturnOptValBool(pTDFX->options, OPTION_NOACCEL, FALSE);
+ pTDFX->NoAccel=xf86ReturnOptValBool(pTDFX->Options, OPTION_NOACCEL, FALSE);
#ifdef XF86DRI
/*
* Setup DRI after visuals have been established, but before fbScreenInit
* is called. fbScreenInit will eventually call into the drivers
* InitGLXVisuals call back.
*/
- if (!xf86ReturnOptValBool(pTDFX->options, OPTION_DRI, TRUE) || pTDFX->NoAccel) {
-ErrorF("disabling DRI here -- opt is %d, noAccel is %d\n", xf86ReturnOptValBool(pTDFX->options, OPTION_DRI, TRUE), pTDFX->NoAccel);
+ if (!xf86ReturnOptValBool(pTDFX->Options, OPTION_DRI, TRUE) || pTDFX->NoAccel) {
pTDFX->directRenderingEnabled = FALSE;
driFrom = X_CONFIG;
- } else if ((pTDFX->backOffset == -1) || (pTDFX->depthOffset == -1)) {
+ } else if (pTDFX->texSize < 0) {
pTDFX->directRenderingEnabled = FALSE;
driFrom = X_PROBED;
} else {
@@ -2132,7 +2198,7 @@ ErrorF("disabling DRI here -- opt is %d, noAccel is %d\n", xf86ReturnOptValBool(
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
- if (!xf86ReturnOptValBool(pTDFX->options, OPTION_SW_CURSOR, FALSE)) {
+ if (!xf86ReturnOptValBool(pTDFX->Options, OPTION_SW_CURSOR, FALSE)) {
if (!TDFXCursorInit(pScreen)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Hardware cursor initialization failed\n");
@@ -2302,12 +2368,12 @@ TDFXCloseScreen(int scrnIndex, ScreenPtr pScreen)
if (pTDFX->scanlineColorExpandBuffers[1])
xfree(pTDFX->scanlineColorExpandBuffers[1]);
pTDFX->scanlineColorExpandBuffers[1]=0;
-
- if (pTDFX->adaptor) {
- xfree(pTDFX->adaptor->pPortPrivates[0].ptr);
- xf86XVFreeVideoAdaptorRec(pTDFX->adaptor);
- pTDFX->adaptor = NULL;
- }
+ if (pTDFX->overlayAdaptor)
+ xfree(pTDFX->overlayAdaptor);
+ pTDFX->overlayAdaptor=0;
+ if (pTDFX->textureAdaptor)
+ xfree(pTDFX->textureAdaptor);
+ pTDFX->textureAdaptor=0;
pScrn->vtSema=FALSE;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c
index a90e130a5..c4de4ce2f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c,v 1.15 2001/04/05 21:29:17 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c,v 1.16 2001/05/21 21:43:55 dawes Exp $ */
#include "xf86.h"
@@ -51,7 +51,7 @@ static void TDFXSendNOPFifo3D(ScrnInfoPtr pScrn)
WRITE_FIFO(pTDFX, 0, 0);
}
-static void TDFXSendNOPFifo2D(ScrnInfoPtr pScrn)
+void TDFXSendNOPFifo2D(ScrnInfoPtr pScrn)
{
TDFXPtr pTDFX;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h
index 1e533baa6..28f72f32c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h,v 1.9 2001/04/05 21:29:17 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h,v 1.11 2001/06/05 15:54:15 alanh Exp $ */
#ifndef _TDFX_FIFO_H_
@@ -11,7 +11,7 @@ typedef int int32;
typedef short int16;
typedef char int8;
-#define CMDFIFO_PAGES 255
+#define CMDFIFO_PAGES 64
#define PROPSAREADATA \
volatile int fifoPtr; \
@@ -82,6 +82,7 @@ typedef volatile struct _H3CmdFifo
Bool TDFXInitFifo(ScreenPtr pScreen);
void TDFXShutdownFifo(ScreenPtr pScreen);
void TDFXAllocateSlots(TDFXPtr pTDFX, int slots);
+void TDFXSendNOPFifo2D(ScrnInfoPtr pScreen);
#define CHECK_FOR_ROOM(_n) \
if ((pTDFX->fifoSlots -= (_n)) < 0) \
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c
index 41f781c43..86823ed80 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c,v 1.10 2001/04/05 21:29:17 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c,v 1.12 2001/06/05 12:52:42 alanh Exp $ */
#include "xf86.h"
#include "tdfx.h"
@@ -7,102 +7,76 @@
#include "Xv.h"
#include "fourcc.h"
-#define OFF_DELAY 250 /* milliseconds */
-#define FREE_DELAY 15000
-
-#define OFF_TIMER 0x01
-#define FREE_TIMER 0x02
-#define CLIENT_VIDEO_ON 0x04
+static Atom xvColorKey, xvFilterQuality;
-#define TIMER_MASK (OFF_TIMER | FREE_TIMER)
+/* These should move into tdfxdefs.h with better names */
+#define YUV_Y_BASE 0xC00000
+#define YUV_U_BASE 0xD00000
+#define YUV_V_BASE 0xE00000
-#define VIDPROCCFGMASK 0xa2e3eb6c
+#define SST_2D_FORMAT_YUYV 0x8
+#define SST_2D_FORMAT_UYVY 0x9
-#ifndef XvExtension
-void TDFXInitVideo(ScreenPtr pScreen) {}
-#else
+#define YUVBASEADDR 0x80100
+#define YUVSTRIDE 0x80104
+#define VIDPROCCFGMASK 0xa2e3eb6c
-static XF86VideoAdaptorPtr TDFXSetupImageVideo(ScreenPtr);
-static int TDFXSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
-static int TDFXGetPortAttribute(ScrnInfoPtr, Atom ,INT32 *, pointer);
-static void TDFXStopVideo(ScrnInfoPtr, pointer, Bool);
-static void TDFXQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short,
- unsigned int *, unsigned int *, pointer);
-static int TDFXPutImage(ScrnInfoPtr, short, short, short, short, short,
- short, short, short, int, unsigned char*, short,
- short, Bool, RegionPtr, pointer);
-static int TDFXQueryImageAttributes(ScrnInfoPtr, int, unsigned short *,
- unsigned short *, int *, int *);
+#define OFF_DELAY 250 /* milliseconds */
+#define FREE_DELAY 15000
+#define OFF_TIMER 0x01
+#define FREE_TIMER 0x02
+#define CLIENT_VIDEO_ON 0x04
+#define TIMER_MASK (OFF_TIMER | FREE_TIMER)
-static void TDFXResetVideo(ScrnInfoPtr);
-
-static void TDFXVideoTimerCallback(ScrnInfoPtr pScrn, Time time);
+#define TDFX_MAX_OVERLAY_PORTS 1
+#define TDFX_MAX_TEXTURE_PORTS 32
+/* Doesn't matter what screen we use */
+#define DummyScreen screenInfo.screens[0]
+/* Needed for attribute atoms */
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
-static Atom xvColorKey, xvFilterQuality;
-
-
-typedef struct {
- RegionRec clip;
- CARD32 colorKey;
- int filterQuality;
- CARD32 videoStatus;
- Time offTime;
- Time freeTime;
-} TDFXPortPrivRec, *TDFXPortPrivPtr;
+/*
+ * PROTOTYPES
+ */
-void TDFXInitVideo(ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
- XF86VideoAdaptorPtr newAdaptor = NULL;
- int num_adaptors;
-
- if(pTDFX->AccelInfoRec && pTDFX->AccelInfoRec->FillSolidRects)
- newAdaptor = TDFXSetupImageVideo(pScreen);
+static FBAreaPtr TDFXAllocateMemoryArea (ScrnInfoPtr pScrn, FBAreaPtr area, int width, int height);
+static FBLinearPtr TDFXAllocateMemoryLinear (ScrnInfoPtr pScrn, FBLinearPtr linear, int size);
+static void TDFXVideoTimerCallback(ScrnInfoPtr pScrn, Time time);
- num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
+static XF86VideoAdaptorPtr TDFXSetupImageVideoTexture(ScreenPtr);
+static int TDFXSetPortAttributeTexture(ScrnInfoPtr, Atom, INT32, pointer);
+static int TDFXGetPortAttributeTexture(ScrnInfoPtr, Atom ,INT32 *, pointer);
+static int TDFXPutImageTexture(ScrnInfoPtr, short, short, short, short, short, short, short, short, int, unsigned char*, short, short, Bool, RegionPtr, pointer);
+static void TDFXStopVideoTexture(ScrnInfoPtr, pointer, Bool);
- if(newAdaptor) {
- if(!num_adaptors) {
- num_adaptors = 1;
- adaptors = &newAdaptor;
- } else {
- newAdaptors = /* need to free this someplace */
- xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
- if(newAdaptors) {
- memcpy(newAdaptors, adaptors, num_adaptors *
- sizeof(XF86VideoAdaptorPtr));
- newAdaptors[num_adaptors] = newAdaptor;
- adaptors = newAdaptors;
- num_adaptors++;
- }
- }
- }
+static XF86VideoAdaptorPtr TDFXSetupImageVideoOverlay(ScreenPtr);
+static int TDFXSetPortAttributeOverlay(ScrnInfoPtr, Atom, INT32, pointer);
+static int TDFXGetPortAttributeOverlay(ScrnInfoPtr, Atom ,INT32 *, pointer);
+static int TDFXPutImageOverlay(ScrnInfoPtr, short, short, short, short, short, short, short, short, int, unsigned char*, short, short, Bool, RegionPtr, pointer);
+static void TDFXStopVideoOverlay(ScrnInfoPtr, pointer, Bool);
+static void TDFXResetVideoOverlay(ScrnInfoPtr);
- if(num_adaptors)
- xf86XVScreenInit(pScreen, adaptors, num_adaptors);
+static void TDFXQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short, unsigned int *, unsigned int *, pointer);
+static int TDFXQueryImageAttributes(ScrnInfoPtr, int, unsigned short *, unsigned short *, int *, int *);
- if(newAdaptors)
- xfree(newAdaptors);
-}
+/*
+ * ADAPTOR INFORMATION
+ */
-/* client libraries expect an encoding */
-static XF86VideoEncodingRec DummyEncoding =
+static XF86VideoEncodingRec OverlayEncoding[] =
{
- 0,
- "XV_IMAGE",
- 2048, 2048,
- {1, 1}
+ { 0, "XV_IMAGE", 2048, 2048, {1, 1} }
};
-#define NUM_FORMATS 12
+static XF86VideoEncodingRec TextureEncoding[] =
+{
+ { 0, "XV_IMAGE", 1024, 1024, {1, 1} }
+};
-static XF86VideoFormatRec Formats[NUM_FORMATS] =
+static XF86VideoFormatRec OverlayFormats[] =
{
{8, TrueColor}, {8, DirectColor}, {8, PseudoColor},
{8, GrayScale}, {8, StaticGray}, {8, StaticColor},
@@ -110,54 +84,101 @@ static XF86VideoFormatRec Formats[NUM_FORMATS] =
{15, DirectColor}, {16, DirectColor}, {24, DirectColor}
};
+static XF86VideoFormatRec TextureFormats[] =
+{
+ {15, TrueColor}, {16, TrueColor}, {24, TrueColor}
+};
-#define NUM_ATTRIBUTES 2
+static XF86AttributeRec OverlayAttributes[] =
+{
+ {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
+ {XvSettable | XvGettable, 0, 1, "XV_FILTER_QUALITY"}
+};
-static XF86AttributeRec Attributes[NUM_ATTRIBUTES] =
+static XF86AttributeRec TextureAttributes[] =
{
{XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
{XvSettable | XvGettable, 0, 1, "XV_FILTER_QUALITY"}
};
-#define NUM_IMAGES 4
+static XF86ImageRec OverlayImages[] =
+{
+ XVIMAGE_YUY2, XVIMAGE_UYVY, XVIMAGE_YV12, XVIMAGE_I420
+};
-static XF86ImageRec Images[NUM_IMAGES] =
+static XF86ImageRec TextureImages[] =
{
- XVIMAGE_YUY2,
- XVIMAGE_UYVY,
- XVIMAGE_YV12,
- XVIMAGE_I420
+ XVIMAGE_YV12, XVIMAGE_I420
};
-static void
-TDFXResetVideo(ScrnInfoPtr pScrn)
+/*
+ * COMMON SETUP FUNCTIONS
+ */
+
+void TDFXInitVideo(ScreenPtr pScreen)
{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
+ XF86VideoAdaptorPtr newAdaptor = NULL;
TDFXPtr pTDFX = TDFXPTR(pScrn);
- TDFXPortPrivPtr pPriv = pTDFX->adaptor->pPortPrivates[0].ptr;
+ int num_adaptors;
- /* reset the video */
- pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
- pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
- pTDFX->writeLong(pTDFX, RGBMAXDELTA, 0x0080808);
- pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey);
- pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey);
+ /* The hardware can't convert YUV->8 bit color */
+ if(pTDFX->cpp == 1)
+ return;
+
+ /* Start with the generic adaptors */
+ num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
+
+ if(!pTDFX->AccelInfoRec || !pTDFX->AccelInfoRec->FillSolidRects)
+ return;
+
+ if (!pTDFX->TextureXvideo) {
+ /* Overlay adaptor */
+ newAdaptor = TDFXSetupImageVideoOverlay(pScreen);
+ } else {
+ /* Texture adaptor */
+ newAdaptor = TDFXSetupImageVideoTexture(pScreen);
+ }
+
+ /* Add the adaptor to the list */
+ if(newAdaptor) {
+ newAdaptors = xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
+ if(newAdaptors) {
+ if (num_adaptors) memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr));
+ newAdaptors[num_adaptors] = newAdaptor;
+ adaptors = newAdaptors;
+ num_adaptors++;
+ }
+ }
+
+ if(num_adaptors)
+ xf86XVScreenInit(pScreen, adaptors, num_adaptors);
+
+ if(newAdaptors)
+ xfree(newAdaptors);
+}
+
+
+void TDFXCloseVideo (ScreenPtr pScreen)
+{
}
static XF86VideoAdaptorPtr
-TDFXAllocAdaptor(ScrnInfoPtr pScrn)
+TDFXAllocAdaptor(ScrnInfoPtr pScrn, int numberPorts)
{
XF86VideoAdaptorPtr adapt;
TDFXPtr pTDFX = TDFXPTR(pScrn);
TDFXPortPrivPtr pPriv;
if(!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn)))
- return NULL;
+ return NULL;
- if(!(pPriv = xcalloc(1, sizeof(TDFXPortPrivRec) + sizeof(DevUnion))))
+ if(!(pPriv = xcalloc(1, sizeof(TDFXPortPrivRec) + (numberPorts * sizeof(DevUnion)))))
{
- xfree(adapt);
- return NULL;
+ xfree(adapt);
+ return NULL;
}
adapt->pPortPrivates = (DevUnion*)(&pPriv[1]);
@@ -169,95 +190,101 @@ TDFXAllocAdaptor(ScrnInfoPtr pScrn)
pPriv->colorKey = pTDFX->videoKey;
pPriv->videoStatus = 0;
pPriv->filterQuality = 1;
-
+
return adapt;
}
+
static XF86VideoAdaptorPtr
-TDFXSetupImageVideo(ScreenPtr pScreen)
+TDFXSetupImageVideoOverlay(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
TDFXPtr pTDFX = TDFXPTR(pScrn);
TDFXPortPrivPtr pPriv;
XF86VideoAdaptorPtr adapt;
- if(!(adapt = TDFXAllocAdaptor(pScrn)))
- return NULL;
+ if(!(adapt = TDFXAllocAdaptor(pScrn, TDFX_MAX_OVERLAY_PORTS)))
+ return NULL;
adapt->type = XvWindowMask | XvInputMask | XvImageMask;
adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
adapt->name = "3dfx Video Overlay";
- adapt->nEncodings = 1;
- adapt->pEncodings = &DummyEncoding;
- adapt->nFormats = NUM_FORMATS;
- adapt->pFormats = Formats;
- adapt->nPorts = 1;
- adapt->nAttributes = NUM_ATTRIBUTES;
- adapt->pAttributes = Attributes;
- adapt->nImages = NUM_IMAGES;
- adapt->pImages = Images;
+ adapt->nPorts = TDFX_MAX_OVERLAY_PORTS;
+ adapt->nEncodings = sizeof(OverlayEncoding) / sizeof(XF86VideoEncodingRec);
+ adapt->pEncodings = OverlayEncoding;
+ adapt->nFormats = sizeof(OverlayFormats) / sizeof(XF86VideoFormatRec);
+ adapt->pFormats = OverlayFormats;
+ adapt->nAttributes = sizeof(OverlayAttributes) / sizeof(XF86AttributeRec);
+ adapt->pAttributes = OverlayAttributes;
+ adapt->nImages = sizeof(OverlayImages) / sizeof(XF86ImageRec);
+ adapt->pImages = OverlayImages;
adapt->PutVideo = NULL;
adapt->PutStill = NULL;
adapt->GetVideo = NULL;
adapt->GetStill = NULL;
- adapt->StopVideo = TDFXStopVideo;
- adapt->SetPortAttribute = TDFXSetPortAttribute;
- adapt->GetPortAttribute = TDFXGetPortAttribute;
+ adapt->StopVideo = TDFXStopVideoOverlay;
+ adapt->SetPortAttribute = TDFXSetPortAttributeOverlay;
+ adapt->GetPortAttribute = TDFXGetPortAttributeOverlay;
adapt->QueryBestSize = TDFXQueryBestSize;
- adapt->PutImage = TDFXPutImage;
+ adapt->PutImage = TDFXPutImageOverlay;
adapt->QueryImageAttributes = TDFXQueryImageAttributes;
- pTDFX->adaptor = adapt;
+ pTDFX->overlayAdaptor = adapt;
pPriv = (TDFXPortPrivPtr)(adapt->pPortPrivates[0].ptr);
REGION_INIT(pScreen, &(pPriv->clip), NullBox, 0);
- TDFXResetVideo(pScrn);
+ TDFXResetVideoOverlay(pScrn);
return adapt;
}
-/* I really should stick this in miregion */
-static Bool
-RegionsEqual(RegionPtr A, RegionPtr B)
+static XF86VideoAdaptorPtr
+TDFXSetupImageVideoTexture(ScreenPtr pScreen)
{
- int *dataA, *dataB;
- int num;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ TDFXPtr pTDFX = TDFXPTR(pScrn);
+ XF86VideoAdaptorPtr adapt;
+ int i;
- num = REGION_NUM_RECTS(A);
- if(num != REGION_NUM_RECTS(B))
- return FALSE;
+ if(!(adapt = TDFXAllocAdaptor(pScrn, TDFX_MAX_TEXTURE_PORTS)))
+ return NULL;
- if((A->extents.x1 != B->extents.x1) ||
- (A->extents.x2 != B->extents.x2) ||
- (A->extents.y1 != B->extents.y1) ||
- (A->extents.y2 != B->extents.y2))
- return FALSE;
+ adapt->type = XvWindowMask | XvInputMask | XvImageMask;
+ adapt->flags = 0;
+ adapt->name = "3dfx Video Texture";
+ adapt->nPorts = TDFX_MAX_TEXTURE_PORTS;
+ adapt->nEncodings = sizeof(TextureEncoding) / sizeof(XF86VideoEncodingRec);
+ adapt->pEncodings = TextureEncoding;
+ adapt->nFormats = sizeof(TextureFormats) / sizeof(XF86VideoFormatRec);
+ adapt->pFormats = TextureFormats;
+ adapt->nAttributes = sizeof(TextureAttributes) / sizeof(XF86AttributeRec);
+ adapt->pAttributes = TextureAttributes;
+ adapt->nImages = sizeof(TextureImages) / sizeof(XF86ImageRec);
+ adapt->pImages = TextureImages;
+ adapt->PutVideo = NULL;
+ adapt->PutStill = NULL;
+ adapt->GetVideo = NULL;
+ adapt->GetStill = NULL;
+ adapt->StopVideo = TDFXStopVideoTexture;
+ adapt->SetPortAttribute = TDFXSetPortAttributeTexture;
+ adapt->GetPortAttribute = TDFXGetPortAttributeTexture;
+ adapt->QueryBestSize = TDFXQueryBestSize;
+ adapt->PutImage = TDFXPutImageTexture;
+ adapt->QueryImageAttributes = TDFXQueryImageAttributes;
- dataA = (int*)REGION_RECTS(A);
- dataB = (int*)REGION_RECTS(B);
+ for(i = 0; i < TDFX_MAX_TEXTURE_PORTS; i++)
+ adapt->pPortPrivates[i].val = i;
- while(num--) {
- if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1]))
- return FALSE;
- dataA += 2;
- dataB += 2;
- }
+ pTDFX->textureAdaptor = adapt;
- return TRUE;
+ return adapt;
}
-/* TDFXClipVideo -
-
- Takes the dst box in standard X BoxRec form (top and left
- edges inclusive, bottom and right exclusive). The new dst
- box is returned. The source boundaries are given (xa, ya
- inclusive, xb, yb exclusive) and returned are the new source
- boundaries in 16.16 fixed point.
-*/
-
-#define DummyScreen screenInfo.screens[0]
+/*
+ * MISCELLANEOUS ROUTINES
+ */
static Bool
TDFXClipVideo(
@@ -282,90 +309,107 @@ TDFXClipVideo(
diff = extents->x1 - dst->x1;
if(diff > 0) {
- dst->x1 = extents->x1;
- *xa += diff * hscale;
+ dst->x1 = extents->x1;
+ *xa += diff * hscale;
}
diff = dst->x2 - extents->x2;
if(diff > 0) {
- dst->x2 = extents->x2;
- *xb -= diff * hscale;
+ dst->x2 = extents->x2;
+ *xb -= diff * hscale;
}
diff = extents->y1 - dst->y1;
if(diff > 0) {
- dst->y1 = extents->y1;
- *ya += diff * vscale;
+ dst->y1 = extents->y1;
+ *ya += diff * vscale;
}
diff = dst->y2 - extents->y2;
if(diff > 0) {
- dst->y2 = extents->y2;
- *yb -= diff * vscale;
+ dst->y2 = extents->y2;
+ *yb -= diff * vscale;
}
if(*xa < 0) {
- diff = (- *xa + hscale - 1)/ hscale;
- dst->x1 += diff;
- *xa += diff * hscale;
+ diff = (- *xa + hscale - 1)/ hscale;
+ dst->x1 += diff;
+ *xa += diff * hscale;
}
delta = *xb - (width << 16);
if(delta > 0) {
- diff = (delta + hscale - 1)/ hscale;
- dst->x2 -= diff;
- *xb -= diff * hscale;
+ diff = (delta + hscale - 1)/ hscale;
+ dst->x2 -= diff;
+ *xb -= diff * hscale;
}
if(*xa >= *xb) return FALSE;
if(*ya < 0) {
- diff = (- *ya + vscale - 1)/ vscale;
- dst->y1 += diff;
- *ya += diff * vscale;
+ diff = (- *ya + vscale - 1)/ vscale;
+ dst->y1 += diff;
+ *ya += diff * vscale;
}
delta = *yb - (height << 16);
if(delta > 0) {
- diff = (delta + vscale - 1)/ vscale;
- dst->y2 -= diff;
- *yb -= diff * vscale;
+ diff = (delta + vscale - 1)/ vscale;
+ dst->y2 -= diff;
+ *yb -= diff * vscale;
}
if(*ya >= *yb) return FALSE;
if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) ||
(dst->y1 != extents->y1) || (dst->y2 != extents->y2))
{
- RegionRec clipReg;
- REGION_INIT(DummyScreen, &clipReg, dst, 1);
- REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
- REGION_UNINIT(DummyScreen, &clipReg);
+ RegionRec clipReg;
+ REGION_INIT(DummyScreen, &clipReg, dst, 1);
+ REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
+ REGION_UNINIT(DummyScreen, &clipReg);
}
return TRUE;
}
-static void
-TDFXStopVideo(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
-{
- TDFXPtr pTDFX = TDFXPTR(pScrn);
- TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data;
+static int
+TDFXQueryImageAttributes(
+ ScrnInfoPtr pScrn,
+ int id,
+ unsigned short *w, unsigned short *h,
+ int *pitches, int *offsets
+){
+ int size, tmp;
- REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
+ if(*w > 1024) *w = 1024;
+ if(*h > 1024) *h = 1024;
- if(cleanup) {
- if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
- pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
- pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
- }
- if(pTDFX->videoScratch) {
- xf86FreeOffscreenLinear(pTDFX->videoScratch);
- pTDFX->videoScratch = NULL;
- }
- pPriv->videoStatus = 0;
- } else {
- if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
- pPriv->videoStatus |= OFF_TIMER;
- pPriv->offTime = currentTime.milliseconds + OFF_DELAY;
- }
- }
+ *w = (*w + 1) & ~1;
+ if(offsets) offsets[0] = 0;
+
+ switch(id) {
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ *h = (*h + 1) & ~1;
+ size = (*w + 3) & ~3;
+ if(pitches) pitches[0] = size;
+ size *= *h;
+ if(offsets) offsets[1] = size;
+ tmp = ((*w >> 1) + 3) & ~3;
+ if(pitches) pitches[1] = pitches[2] = tmp;
+ tmp *= (*h >> 1);
+ size += tmp;
+ if(offsets) offsets[2] = size;
+ size += tmp;
+ break;
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
+ default:
+ size = *w << 1;
+ if(pitches) pitches[0] = size;
+ size *= *h;
+ break;
+ }
+
+ return size;
}
+
static int
-TDFXSetPortAttribute(
+TDFXSetPortAttributeOverlay(
ScrnInfoPtr pScrn,
Atom attribute,
INT32 value,
@@ -376,22 +420,21 @@ TDFXSetPortAttribute(
TDFXPtr pTDFX = TDFXPTR(pScrn);
if(attribute == xvColorKey) {
- pPriv->colorKey = value;
- pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey);
- pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey);
- REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
- } else
- if(attribute == xvFilterQuality) {
- if((value < 0) || (value > 1))
+ pPriv->colorKey = value;
+ pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey);
+ pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey);
+ REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
+ } else if(attribute == xvFilterQuality) {
+ if((value < 0) || (value > 1))
return BadValue;
- pPriv->filterQuality = value;
+ pPriv->filterQuality = value;
} else return BadMatch;
return Success;
}
static int
-TDFXGetPortAttribute(
+TDFXGetPortAttributeOverlay(
ScrnInfoPtr pScrn,
Atom attribute,
INT32 *value,
@@ -400,16 +443,37 @@ TDFXGetPortAttribute(
TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data;
if(attribute == xvColorKey) {
- *value = pPriv->colorKey;
- } else
- if(attribute == xvFilterQuality) {
- *value = pPriv->filterQuality;
+ *value = pPriv->colorKey;
+ } else if(attribute == xvFilterQuality) {
+ *value = pPriv->filterQuality;
} else return BadMatch;
return Success;
}
+static int
+TDFXSetPortAttributeTexture(
+ ScrnInfoPtr pScrn,
+ Atom attribute,
+ INT32 value,
+ pointer data
+) {
+ return Success;
+}
+
+
+static int
+TDFXGetPortAttributeTexture(
+ ScrnInfoPtr pScrn,
+ Atom attribute,
+ INT32 *value,
+ pointer data
+){
+ return Success;
+}
+
+
static void
TDFXQueryBestSize(
ScrnInfoPtr pScrn,
@@ -446,12 +510,12 @@ TDFXCopyData(
dst += dstPitch;
}
#else
- w <<= 1;
- while(h--) {
- memcpy(dst, src, w);
- src += srcPitch;
- dst += dstPitch;
- }
+ w <<= 1;
+ while(h--) {
+ memcpy(dst, src, w);
+ src += srcPitch;
+ dst += dstPitch;
+ }
#endif
}
@@ -474,10 +538,10 @@ TDFXCopyMungedData(
w >>= 1;
for(j = 0; j < h; j++) {
- dst = (CARD32*)dst1;
- s1 = src1; s2 = src2; s3 = src3;
- i = w;
- while(i > 4) {
+ dst = (CARD32*)dst1;
+ s1 = src1; s2 = src2; s3 = src3;
+ i = w;
+ while(i > 4) {
dst[0] = BE_WSWAP32(s1[0] | (s1[1] << 16) | (s3[0] << 8) |
(s2[0] << 24));
dst[1] = BE_WSWAP32(s1[2] | (s1[3] << 16) | (s3[1] << 8) |
@@ -486,69 +550,287 @@ TDFXCopyMungedData(
(s2[2] << 24));
dst[3] = BE_WSWAP32(s1[6] | (s1[7] << 16) | (s3[3] << 8) |
(s2[3] << 24));
- dst += 4; s2 += 4; s3 += 4; s1 += 8;
- i -= 4;
- }
- while(i--) {
+ dst += 4; s2 += 4; s3 += 4; s1 += 8;
+ i -= 4;
+ }
+ while(i--) {
dst[0] = BE_WSWAP32(s1[0] | (s1[1] << 16) | (s3[0] << 8) |
(s2[0] << 24));
- dst++; s2++; s3++;
- s1 += 2;
- }
-
- dst1 += dstPitch;
- src1 += srcPitch;
- if(j & 1) {
- src2 += srcPitch2;
- src3 += srcPitch2;
- }
+ dst++; s2++; s3++;
+ s1 += 2;
+ }
+
+ dst1 += dstPitch;
+ src1 += srcPitch;
+ if(j & 1) {
+ src2 += srcPitch2;
+ src3 += srcPitch2;
+ }
}
}
-static FBLinearPtr
-TDFXAllocateMemory(
- ScrnInfoPtr pScrn,
- FBLinearPtr linear,
- int size
-){
- ScreenPtr pScreen;
- FBLinearPtr new_linear;
+/*
+ * TEXTURE DRAWING FUNCTIONS
+ */
- if(linear) {
- if(linear->size >= size)
- return linear;
- if(xf86ResizeOffscreenLinear(linear, size))
- return linear;
+static void
+TDFXStopVideoTexture(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
+{
+ TDFXPtr pTDFX = TDFXPTR(pScrn);
+ TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data;
- xf86FreeOffscreenLinear(linear);
- }
+ REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
- pScreen = screenInfo.screens[pScrn->scrnIndex];
+ if (cleanup) {
+ if(pTDFX->textureBuffer) {
+ xf86FreeOffscreenArea(pTDFX->textureBuffer);
+ pTDFX->textureBuffer = NULL;
+ }
+ }
+}
- new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4,
- NULL, NULL, NULL);
- if(!new_linear) {
- int max_size;
+static void
+TDFXScreenToScreenYUVStretchBlit (ScrnInfoPtr pScrn,
+ short src_x1, short src_y1,
+ short src_x2, short src_y2,
+ short dst_x1, short dst_y1,
+ short dst_x2, short dst_y2)
+{
+ TDFXPtr pTDFX = TDFXPTR(pScrn);
+ /* reformulate the paramaters the way the hardware wants them */
+ INT32 src_x = src_x1 & 0x1FFF;
+ INT32 src_y = src_y1 & 0x1FFF;
+ INT32 dst_x = dst_x1 & 0x1FFF;
+ INT32 dst_y = dst_y1 & 0x1FFF;
+ INT32 src_w = (src_x2 - src_x1) & 0x1FFF;
+ INT32 src_h = (src_y2 - src_y1) & 0x1FFF;
+ INT32 dst_w = (dst_x2 - dst_x1) & 0x1FFF;
+ INT32 dst_h = (dst_y2 - dst_y1) & 0x1FFF;
+ /* Setup for blit src and dest */
+ TDFXMakeRoom(pTDFX, 4);
+ DECLARE(SSTCP_DSTSIZE|SSTCP_SRCSIZE|SSTCP_DSTXY|SSTCP_COMMAND/*|SSTCP_COMMANDEXTRA*/);
+ /* TDFXWriteLong(pTDFX, SST_2D_COMMANDEXTRA, SST_COMMANDEXTRA_VSYNC);*/
+ TDFXWriteLong(pTDFX, SST_2D_SRCSIZE, src_w | (src_h<<16));
+ TDFXWriteLong(pTDFX, SST_2D_DSTSIZE, dst_w | (dst_h<<16));
+ TDFXWriteLong(pTDFX, SST_2D_DSTXY, dst_x | (dst_y<<16));
+ TDFXWriteLong(pTDFX, SST_2D_COMMAND, SST_2D_SCRNTOSCRNSTRETCH | 0xCC000000);
+ /* Write to the launch area to start the blit */
+ TDFXMakeRoom(pTDFX, 1);
+ DECLARE_LAUNCH(1, 0);
+ TDFXWriteLong(pTDFX, SST_2D_LAUNCH, (src_x<<1) | (src_y<<16));
+ /* Wait for it to happen */
+ TDFXSendNOPFifo2D(pScrn);
+}
- xf86QueryLargestOffscreenLinear(pScreen, &max_size, 4,
- PRIORITY_EXTREME);
- if(max_size < size)
- return NULL;
+static void
+YUVPlanarToPacked (ScrnInfoPtr pScrn,
+ short src_x, short src_y,
+ short src_h, short src_w,
+ int id, unsigned char *buf,
+ short width, short height,
+ FBAreaPtr fbarea)
+{
+ TDFXPtr pTDFX = TDFXPTR(pScrn);
+ unsigned char *psrc, *pdst;
+ int count;
+ int baseaddr;
+ INT32 yuvBaseAddr, yuvStride;
+
+ /* Save these registers so I can restore them when we are done. */
+ yuvBaseAddr = TDFXReadLongMMIO(pTDFX, YUVBASEADDR);
+ yuvStride = TDFXReadLongMMIO(pTDFX, YUVSTRIDE);
+
+ /* Set yuvBaseAddress and yuvStride. */
+ baseaddr = pTDFX->fbOffset + pTDFX->cpp * fbarea->box.x1 + pTDFX->stride * fbarea->box.y1;
+ TDFXWriteLongMMIO(pTDFX, YUVSTRIDE, pTDFX->stride);
+ TDFXWriteLongMMIO(pTDFX, YUVBASEADDR, baseaddr);
+
+ /* Copy Y plane (twice as much Y as U or V) */
+ psrc = buf;
+ psrc += (src_x & ~0x1) + src_y * width;
+ pdst = pTDFX->MMIOBase[0] + YUV_Y_BASE;
+ TDFXCopyData(psrc, pdst, width, 1024, src_h, src_w + (src_x & 0x1));
+
+ /* Copy V plane */
+ psrc = buf + width * height;
+ psrc += (src_x >> 1) + (src_y >> 1) * (width >> 1);
+ pdst = pTDFX->MMIOBase[0] + YUV_V_BASE;
+ TDFXCopyData(psrc, pdst, width >> 1, 1024, src_h >> 1, src_w >> 1);
+
+ /* Copy U plane */
+ psrc = buf + width * height + (width >> 1) * (height >> 1);
+ psrc += (src_x >> 1) + (src_y >> 1) * (width >> 1);
+ pdst = pTDFX->MMIOBase[0] + YUV_U_BASE;
+ TDFXCopyData(psrc, pdst, width >> 1, 1024, src_h >> 1, src_w >> 1);
+
+ /* IDLE until the copy finished, timeout for safety */
+ for (count = 0; count < 1000; count++)
+ if (!((TDFXReadLongMMIO(pTDFX, STATUS) & SST_BUSY)))
+ break;
+
+ /* Restore trashed registers */
+ TDFXWriteLongMMIO(pTDFX, YUVBASEADDR, yuvBaseAddr);
+ TDFXWriteLongMMIO(pTDFX, YUVSTRIDE, yuvStride);
+
+ /* Wait for it to happen */
+ TDFXSendNOPFifo2D(pScrn);
+}
- xf86PurgeUnlockedOffscreenAreas(pScreen);
- new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4,
- NULL, NULL, NULL);
+
+static int
+TDFXPutImageTexture(
+ ScrnInfoPtr pScrn,
+ short src_x, short src_y,
+ short drw_x, short drw_y,
+ short src_w, short src_h,
+ short drw_w, short drw_h,
+ int id, unsigned char* buf,
+ short width, short height,
+ Bool sync,
+ RegionPtr clipBoxes, pointer data
+ )
+{
+ TDFXPtr pTDFX = TDFXPTR(pScrn);
+ BoxPtr pbox;
+ int nbox;
+ int format;
+
+ /* Check the source format */
+ if (id == FOURCC_YV12) format = SST_2D_FORMAT_YUYV;
+ else if (id == FOURCC_UYVY) format = SST_2D_FORMAT_UYVY;
+ else return BadAlloc;
+
+ /* Get a buffer to store the packed YUV data */
+ if (!(pTDFX->textureBuffer = TDFXAllocateMemoryArea(pScrn, pTDFX->textureBuffer, src_w, src_h)))
+ return BadAlloc;
+
+ /* Pack the YUV data in offscreen memory using YUV framebuffer (0x[CDE]0000) */
+ YUVPlanarToPacked (pScrn, src_x, src_y, src_h, src_w,
+ id, buf, width, height,
+ pTDFX->textureBuffer);
+
+ /* Setup source and destination pixel formats (yuv -> rgb) */
+ TDFXMakeRoom(pTDFX, 2);
+ DECLARE(SSTCP_SRCFORMAT|SSTCP_DSTFORMAT);
+ TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, pTDFX->stride|((pTDFX->cpp+1)<<16));
+ TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, pTDFX->stride|((format)<<16));
+
+ /* Blit packed YUV data from offscreen memory, respecting clips */
+#define SRC_X1 (pTDFX->textureBuffer->box.x1)
+#define SRC_Y1 (pTDFX->textureBuffer->box.y1)
+#define SCALEX(dx) ((int)(((dx) * src_w) / drw_w))
+#define SCALEY(dy) ((int)(((dy) * src_h) / drw_h))
+ for (nbox = REGION_NUM_RECTS(clipBoxes),
+ pbox = REGION_RECTS(clipBoxes); nbox > 0; nbox--, pbox++)
+ {
+ TDFXScreenToScreenYUVStretchBlit (pScrn,
+ SRC_X1 + SCALEX(pbox->x1 - drw_x),
+ SRC_Y1 + SCALEY(pbox->y1 - drw_y),
+ SRC_X1 + SCALEX(pbox->x2 - drw_x),
+ SRC_Y1 + SCALEY(pbox->y2 - drw_y),
+ pbox->x1, pbox->y1,
+ pbox->x2, pbox->y2);
}
- return new_linear;
+ /* Restore the WAX registers we trashed */
+ TDFXMakeRoom(pTDFX, 2);
+ DECLARE(SSTCP_SRCFORMAT|SSTCP_DSTFORMAT);
+ TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, pTDFX->sst2DDstFmtShadow);
+ TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, pTDFX->sst2DSrcFmtShadow);
+
+ /* Wait for it to happen */
+ TDFXSendNOPFifo2D(pScrn);
+
+ return Success;
+}
+
+
+/*
+ * COMMON DRAWING FUNCTIONS
+ */
+
+static Bool
+RegionsEqual(RegionPtr A, RegionPtr B)
+{
+ int *dataA, *dataB;
+ int num;
+
+ num = REGION_NUM_RECTS(A);
+ if(num != REGION_NUM_RECTS(B))
+ return FALSE;
+
+ if((A->extents.x1 != B->extents.x1) ||
+ (A->extents.x2 != B->extents.x2) ||
+ (A->extents.y1 != B->extents.y1) ||
+ (A->extents.y2 != B->extents.y2))
+ return FALSE;
+
+ dataA = (int*)REGION_RECTS(A);
+ dataB = (int*)REGION_RECTS(B);
+
+ while(num--) {
+ if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1]))
+ return FALSE;
+ dataA += 2;
+ dataB += 2;
+ }
+
+ return TRUE;
+}
+
+/*
+ * OVERLAY DRAWING FUNCTIONS
+ */
+
+
+static void
+TDFXResetVideoOverlay(ScrnInfoPtr pScrn)
+{
+ TDFXPtr pTDFX = TDFXPTR(pScrn);
+ TDFXPortPrivPtr pPriv = pTDFX->overlayAdaptor->pPortPrivates[0].ptr;
+
+ /* reset the video */
+ pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
+ pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
+ pTDFX->writeLong(pTDFX, RGBMAXDELTA, 0x0080808);
+ pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey);
+ pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey);
+}
+
+
+static void
+TDFXStopVideoOverlay(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
+{
+ TDFXPtr pTDFX = TDFXPTR(pScrn);
+ TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data;
+
+ REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
+
+ if(cleanup) {
+ if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
+ pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
+ pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
+ }
+ if(pTDFX->overlayBuffer) {
+ xf86FreeOffscreenLinear(pTDFX->overlayBuffer);
+ pTDFX->overlayBuffer = NULL;
+ }
+ pPriv->videoStatus = 0;
+ } else {
+ if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
+ pPriv->videoStatus |= OFF_TIMER;
+ pPriv->offTime = currentTime.milliseconds + OFF_DELAY;
+ }
+ }
}
+
static void
-TDFXDisplayVideo(
+TDFXDisplayVideoOverlay(
ScrnInfoPtr pScrn,
int id,
int offset,
@@ -560,31 +842,30 @@ TDFXDisplayVideo(
short drw_w, short drw_h
){
TDFXPtr pTDFX = TDFXPTR(pScrn);
- TDFXPortPrivPtr pPriv = pTDFX->adaptor->pPortPrivates[0].ptr;
+ TDFXPortPrivPtr pPriv = pTDFX->overlayAdaptor->pPortPrivates[0].ptr;
int dudx, dvdy;
dudx = (src_w << 20) / drw_w;
dvdy = (src_h << 20) / drw_h;
offset += ((left >> 16) & ~1) << 1;
-
left = (left & 0x0001ffff) << 3;
pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
pTDFX->ModeReg.vidcfg |= 0x00000320;
- if(drw_w != src_w) pTDFX->ModeReg.vidcfg |= (1 << 14);
- if(drw_h != src_h) pTDFX->ModeReg.vidcfg |= (1 << 15);
- if(id == FOURCC_UYVY) pTDFX->ModeReg.vidcfg |= (6 << 21);
- else pTDFX->ModeReg.vidcfg |= (5 << 21);
- if(pScrn->depth == 8) pTDFX->ModeReg.vidcfg |= (1 << 11);
- if(pPriv->filterQuality) pTDFX->ModeReg.vidcfg |= (3 << 16);
+ if(drw_w != src_w) pTDFX->ModeReg.vidcfg |= (1 << 14);
+ if(drw_h != src_h) pTDFX->ModeReg.vidcfg |= (1 << 15);
+ if(id == FOURCC_UYVY) pTDFX->ModeReg.vidcfg |= (6 << 21);
+ else pTDFX->ModeReg.vidcfg |= (5 << 21);
+ if(pScrn->depth == 8) pTDFX->ModeReg.vidcfg |= (1 << 11);
+ /* can't do bilinear filtering when in 2X mode */
+ if(pPriv->filterQuality && !(pTDFX->ModeReg.vidcfg & SST_VIDEO_2X_MODE_EN))
+ pTDFX->ModeReg.vidcfg |= (3 << 16);
pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
- pTDFX->writeLong(pTDFX, VIDOVERLAYSTARTCOORDS,
- dstBox->x1 | (dstBox->y1 << 12));
- pTDFX->writeLong(pTDFX, VIDOVERLAYENDSCREENCOORDS,
- (dstBox->x2 - 1) | ((dstBox->y2 - 1) << 12));
+ pTDFX->writeLong(pTDFX, VIDOVERLAYSTARTCOORDS, dstBox->x1 | (dstBox->y1 << 12));
+ pTDFX->writeLong(pTDFX, VIDOVERLAYENDSCREENCOORDS, (dstBox->x2 - 1) | ((dstBox->y2 - 1) << 12));
pTDFX->writeLong(pTDFX, VIDOVERLAYDUDX, dudx);
pTDFX->writeLong(pTDFX, VIDOVERLAYDUDXOFFSETSRCWIDTH, left | (src_w << 20));
pTDFX->writeLong(pTDFX, VIDOVERLAYDVDY, dvdy);
@@ -599,7 +880,7 @@ TDFXDisplayVideo(
static int
-TDFXPutImage(
+TDFXPutImageOverlay(
ScrnInfoPtr pScrn,
short src_x, short src_y,
short drw_x, short drw_y,
@@ -614,8 +895,10 @@ TDFXPutImage(
TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data;
INT32 xa, xb, ya, yb;
unsigned char *dst_start;
- int pitch, new_size, offset, s2offset, s3offset;
- int srcPitch, srcPitch2, dstPitch;
+ int pitch, new_size, offset;
+ int s2offset = 0, s3offset = 0;
+ int srcPitch = 0, srcPitch2 = 0;
+ int dstPitch;
int top, left, npixels, nlines, bpp;
BoxRec dstBox;
CARD32 tmp;
@@ -631,9 +914,6 @@ TDFXPutImage(
*
*/
- /* make the compiler happy */
- s2offset = s3offset = srcPitch2 = 0;
-
if(src_w > drw_w) drw_w = src_w;
if(src_h > drw_h) drw_h = src_h;
@@ -649,7 +929,7 @@ TDFXPutImage(
dstBox.y2 = drw_y + drw_h;
if(!TDFXClipVideo(&dstBox, &xa, &xb, &ya, &yb, clipBoxes, width, height))
- return Success;
+ return Success;
dstBox.x1 -= pScrn->frameX0;
dstBox.x2 -= pScrn->frameX0;
@@ -662,78 +942,71 @@ TDFXPutImage(
switch(id) {
case FOURCC_YV12:
case FOURCC_I420:
- dstPitch = ((width << 1) + 3) & ~3;
- new_size = ((dstPitch * height) + bpp - 1) / bpp;
- srcPitch = (width + 3) & ~3;
- s2offset = srcPitch * height;
- srcPitch2 = ((width >> 1) + 3) & ~3;
- s3offset = (srcPitch2 * (height >> 1)) + s2offset;
- break;
+ dstPitch = ((width << 1) + 3) & ~3;
+ new_size = ((dstPitch * height) + bpp - 1) / bpp;
+ srcPitch = (width + 3) & ~3;
+ s2offset = srcPitch * height;
+ srcPitch2 = ((width >> 1) + 3) & ~3;
+ s3offset = (srcPitch2 * (height >> 1)) + s2offset;
+ break;
case FOURCC_UYVY:
case FOURCC_YUY2:
default:
- dstPitch = ((width << 1) + 3) & ~3;
- new_size = ((dstPitch * height) + bpp - 1) / bpp;
- srcPitch = (width << 1);
- break;
+ dstPitch = ((width << 1) + 3) & ~3;
+ new_size = ((dstPitch * height) + bpp - 1) / bpp;
+ srcPitch = (width << 1);
+ break;
}
- if(!(pTDFX->videoScratch = TDFXAllocateMemory(pScrn, pTDFX->videoScratch,
- new_size)))
- {
- return BadAlloc;
- }
+ if(!(pTDFX->overlayBuffer = TDFXAllocateMemoryLinear(pScrn, pTDFX->overlayBuffer, new_size)))
+ return BadAlloc;
- /* copy data */
+ /* copy data */
top = ya >> 16;
left = (xa >> 16) & ~1;
npixels = ((((xb + 0xffff) >> 16) + 1) & ~1) - left;
- offset = (pTDFX->videoScratch->offset * bpp) +
- (top * dstPitch) + pTDFX->fbOffset;
+ offset = (pTDFX->overlayBuffer->offset * bpp) + (top * dstPitch) + pTDFX->fbOffset;
dst_start = pTDFX->FbBase + offset;
switch(id) {
case FOURCC_YV12:
case FOURCC_I420:
- top &= ~1;
- dst_start += left << 1;
- tmp = ((top >> 1) * srcPitch2) + (left >> 1);
- s2offset += tmp;
- s3offset += tmp;
- if(id == FOURCC_I420) {
- tmp = s2offset;
- s2offset = s3offset;
- s3offset = tmp;
- }
- nlines = ((((yb + 0xffff) >> 16) + 1) & ~1) - top;
- TDFXCopyMungedData(buf + (top * srcPitch) + left, buf + s2offset,
- buf + s3offset, dst_start, srcPitch, srcPitch2,
- dstPitch, nlines, npixels);
- break;
+ top &= ~1;
+ dst_start += left << 1;
+ tmp = ((top >> 1) * srcPitch2) + (left >> 1);
+ s2offset += tmp;
+ s3offset += tmp;
+ if(id == FOURCC_I420) {
+ tmp = s2offset;
+ s2offset = s3offset;
+ s3offset = tmp;
+ }
+ nlines = ((((yb + 0xffff) >> 16) + 1) & ~1) - top;
+ TDFXCopyMungedData(buf + (top * srcPitch) + left, buf + s2offset,
+ buf + s3offset, dst_start, srcPitch, srcPitch2,
+ dstPitch, nlines, npixels);
+ break;
case FOURCC_UYVY:
case FOURCC_YUY2:
default:
- left <<= 1;
- buf += (top * srcPitch) + left;
- nlines = ((yb + 0xffff) >> 16) - top;
- dst_start += left;
- TDFXCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels);
- break;
+ left <<= 1;
+ buf += (top * srcPitch) + left;
+ nlines = ((yb + 0xffff) >> 16) - top;
+ dst_start += left;
+ TDFXCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels);
+ break;
}
- /* update cliplist */
if(!RegionsEqual(&pPriv->clip, clipBoxes)) {
- REGION_COPY(pScreen, &pPriv->clip, clipBoxes);
- /* draw these */
- (*pTDFX->AccelInfoRec->FillSolidRects)(pScrn, pPriv->colorKey,
- GXcopy, ~0,
- REGION_NUM_RECTS(clipBoxes),
- REGION_RECTS(clipBoxes));
+ REGION_COPY(pScreen, &pPriv->clip, clipBoxes);
+ (*pTDFX->AccelInfoRec->FillSolidRects)(pScrn, pPriv->colorKey,
+ GXcopy, ~0,
+ REGION_NUM_RECTS(clipBoxes),
+ REGION_RECTS(clipBoxes));
}
- TDFXDisplayVideo(pScrn, id, offset, width, height, dstPitch,
- xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h);
+ TDFXDisplayVideoOverlay(pScrn, id, offset, width, height, dstPitch, xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h);
pPriv->videoStatus = CLIENT_VIDEO_ON;
@@ -743,75 +1016,111 @@ TDFXPutImage(
}
-static int
-TDFXQueryImageAttributes(
- ScrnInfoPtr pScrn,
- int id,
- unsigned short *w, unsigned short *h,
- int *pitches, int *offsets
-){
- int size, tmp;
-
- if(*w > 2048) *w = 2048;
- if(*h > 2048) *h = 2048;
-
- *w = (*w + 1) & ~1;
- if(offsets) offsets[0] = 0;
-
- switch(id) {
- case FOURCC_YV12:
- case FOURCC_I420:
- *h = (*h + 1) & ~1;
- size = (*w + 3) & ~3;
- if(pitches) pitches[0] = size;
- size *= *h;
- if(offsets) offsets[1] = size;
- tmp = ((*w >> 1) + 3) & ~3;
- if(pitches) pitches[1] = pitches[2] = tmp;
- tmp *= (*h >> 1);
- size += tmp;
- if(offsets) offsets[2] = size;
- size += tmp;
- break;
- case FOURCC_UYVY:
- case FOURCC_YUY2:
- default:
- size = *w << 1;
- if(pitches) pitches[0] = size;
- size *= *h;
- break;
- }
-
- return size;
-}
-
static void
TDFXVideoTimerCallback(ScrnInfoPtr pScrn, Time time)
{
TDFXPtr pTDFX = TDFXPTR(pScrn);
- TDFXPortPrivPtr pPriv = pTDFX->adaptor->pPortPrivates[0].ptr;
+ TDFXPortPrivPtr pPriv = pTDFX->overlayAdaptor->pPortPrivates[0].ptr;
if(pPriv->videoStatus & TIMER_MASK) {
- if(pPriv->videoStatus & OFF_TIMER) {
- if(pPriv->offTime < time) {
- pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
- pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
- pPriv->videoStatus = FREE_TIMER;
- pPriv->freeTime = time + FREE_DELAY;
- }
- } else { /* FREE_TIMER */
- if(pPriv->freeTime < time) {
- if(pTDFX->videoScratch) {
- xf86FreeOffscreenLinear(pTDFX->videoScratch);
- pTDFX->videoScratch = NULL;
- }
- pPriv->videoStatus = 0;
- pTDFX->VideoTimerCallback = NULL;
- }
- }
+ if(pPriv->videoStatus & OFF_TIMER) {
+ if(pPriv->offTime < time) {
+ pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK;
+ pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg);
+ pPriv->videoStatus = FREE_TIMER;
+ pPriv->freeTime = time + FREE_DELAY;
+ }
+ } else
+ if(pPriv->videoStatus & FREE_TIMER) {
+ if(pPriv->freeTime < time) {
+ if(pTDFX->overlayBuffer) {
+ xf86FreeOffscreenLinear(pTDFX->overlayBuffer);
+ pTDFX->overlayBuffer = NULL;
+ }
+ pPriv->videoStatus = 0;
+ pTDFX->VideoTimerCallback = NULL;
+ }
+ }
} else /* shouldn't get here */
- pTDFX->VideoTimerCallback = NULL;
+ pTDFX->VideoTimerCallback = NULL;
}
-#endif /* !XvExtension */
+/*
+ * MEMORY MANAGEMENT
+ */
+
+
+static FBAreaPtr
+TDFXAllocateMemoryArea (ScrnInfoPtr pScrn, FBAreaPtr area, int width, int height)
+{
+ TDFXPtr pTDFX = TDFXPTR(pScrn);
+ ScreenPtr pScreen;
+ FBAreaPtr new_area;
+
+ if (area) {
+ if ((area->box.x2 - area->box.x1 >= width) &&
+ (area->box.y2 - area->box.y1 >= height))
+ return area;
+
+ if (xf86ResizeOffscreenArea(area, width, height))
+ return area;
+
+ xf86FreeOffscreenArea(area);
+ }
+
+ pScreen = screenInfo.screens[pScrn->scrnIndex];
+
+ new_area = xf86AllocateOffscreenArea(pScreen, width, height, pTDFX->cpp, NULL, NULL, NULL);
+
+ if (!new_area) {
+ int max_width, max_height;
+
+ xf86QueryLargestOffscreenArea(pScreen, &max_width, &max_height, pTDFX->cpp, 0, PRIORITY_EXTREME);
+
+ if (max_width < width || max_height < height)
+ return NULL;
+
+ xf86PurgeUnlockedOffscreenAreas(pScreen);
+ new_area = xf86AllocateOffscreenArea(pScreen, width, height, pTDFX->cpp, NULL, NULL, NULL);
+ }
+
+ return new_area;
+}
+
+
+static FBLinearPtr
+TDFXAllocateMemoryLinear (ScrnInfoPtr pScrn, FBLinearPtr linear, int size)
+{
+ ScreenPtr pScreen;
+ FBLinearPtr new_linear;
+
+ if(linear) {
+ if(linear->size >= size)
+ return linear;
+
+ if(xf86ResizeOffscreenLinear(linear, size))
+ return linear;
+
+ xf86FreeOffscreenLinear(linear);
+ }
+
+ pScreen = screenInfo.screens[pScrn->scrnIndex];
+
+ new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4, NULL, NULL, NULL);
+
+ if(!new_linear) {
+ int max_size;
+
+ xf86QueryLargestOffscreenLinear(pScreen, &max_size, 4, PRIORITY_EXTREME);
+
+ if(max_size < size)
+ return NULL;
+
+ xf86PurgeUnlockedOffscreenAreas(pScreen);
+ new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4, NULL, NULL, NULL);
+ }
+
+ return new_linear;
+}
+
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h b/xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h
index 38aa21288..f9e7e5111 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h
@@ -21,7 +21,7 @@
*
* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h,v 1.16 2001/02/15 11:03:58 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h,v 1.17 2001/05/04 19:05:47 dawes Exp $ */
#ifndef _TGA_H_
#define _TGA_H_
@@ -90,6 +90,7 @@ typedef struct {
CARD16 line_pattern; /* for dashed lines */
int Bpp; /* bytes per pixel */
int depthflag; /* either BPP8PACKED or BPP24 */
+ OptionInfoPtr Options;
} TGARec, *TGAPtr;
/* ?? this is a hack for initial TGA2 support */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c
index b49eb7dc4..3f46b1592 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c
@@ -22,7 +22,7 @@
* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
* Matthew Grossman, <mattg@oz.net> - acceleration and misc fixes
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c,v 1.53 2001/03/19 11:00:54 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c,v 1.54 2001/05/04 19:05:47 dawes Exp $ */
/* everybody includes these */
#include "xf86.h"
@@ -74,7 +74,7 @@
#include "Xv.h"
#endif
-static OptionInfoPtr TGAAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * TGAAvailableOptions(int chipid, int busid);
static void TGAIdentify(int flags);
static Bool TGAProbe(DriverPtr drv, int flags);
static Bool TGAPreInit(ScrnInfoPtr pScrn, int flags);
@@ -158,7 +158,7 @@ typedef enum {
OPTION_NOXAAPOLYSEGMENT
} TGAOpts;
-static OptionInfoRec TGAOptions[] = {
+static const OptionInfoRec TGAOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE },
@@ -273,8 +273,7 @@ TGAFreeRec(ScrnInfoPtr pScrn)
return;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
TGAAvailableOptions(int chipid, int busid)
{
return TGAOptions;
@@ -535,23 +534,26 @@ TGAPreInit(ScrnInfoPtr pScrn, int flags)
/* Collect all of the relevant option flags (fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, TGAOptions);
- if (xf86ReturnOptValBool(TGAOptions, OPTION_PCI_RETRY, FALSE)) {
+ if (!(pTga->Options = xalloc(sizeof(TGAOptions))))
+ return FALSE;
+ memcpy(pTga->Options, TGAOptions, sizeof(TGAOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTga->Options);
+ if (xf86ReturnOptValBool(pTga->Options, OPTION_PCI_RETRY, FALSE)) {
pTga->UsePCIRetry = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n");
}
- if(xf86ReturnOptValBool(TGAOptions, OPTION_SYNC_ON_GREEN, FALSE)) {
+ if(xf86ReturnOptValBool(pTga->Options, OPTION_SYNC_ON_GREEN, FALSE)) {
pTga->SyncOnGreen = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Sync-on-Green enabled\n");
}
- if(xf86ReturnOptValBool(TGAOptions, OPTION_DAC_6_BIT, FALSE)) {
+ if(xf86ReturnOptValBool(pTga->Options, OPTION_DAC_6_BIT, FALSE)) {
pTga->Dac6Bit = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "6 bit DAC enabled\n");
}
- if(xf86ReturnOptValBool(TGAOptions, OPTION_NOXAAPOLYSEGMENT, FALSE)) {
+ if(xf86ReturnOptValBool(pTga->Options, OPTION_NOXAAPOLYSEGMENT, FALSE)) {
pTga->NoXaaPolySegment = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "XAA PolySegment() disabled\n");
}
@@ -610,9 +612,9 @@ TGAPreInit(ScrnInfoPtr pScrn, int flags)
/* determine whether we use hardware or software cursor */
pTga->HWCursor = TRUE;
- if (xf86GetOptValBool(TGAOptions, OPTION_HW_CURSOR, &pTga->HWCursor))
+ if (xf86GetOptValBool(pTga->Options, OPTION_HW_CURSOR, &pTga->HWCursor))
from = X_CONFIG;
- if (xf86ReturnOptValBool(TGAOptions, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(pTga->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pTga->HWCursor = FALSE;
}
@@ -626,7 +628,7 @@ TGAPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
pTga->HWCursor ? "HW" : "SW");
- if (xf86ReturnOptValBool(TGAOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pTga->Options, OPTION_NOACCEL, FALSE)) {
pTga->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c
index c63039ad7..90bc93a6b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c
@@ -23,7 +23,7 @@
*
* Trident 3DImage' accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c,v 1.21 2000/12/12 09:07:45 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c,v 1.21.4.1 2001/05/24 09:37:41 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -144,11 +144,13 @@ ImageAccelInit(ScreenPtr pScreen)
infoPtr->Sync = ImageSync;
+#if 0
infoPtr->SetClippingRectangle = ImageSetClippingRectangle;
infoPtr->DisableClipping = ImageDisableClipping;
infoPtr->ClippingFlags = HARDWARE_CLIP_SOLID_FILL |
HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY |
HARDWARE_CLIP_MONO_8x8_FILL;
+#endif
#if 0
infoPtr->SolidLineFlags = NO_PLANEMASK;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h
index 50bc6eff5..4b2809b7f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h
@@ -21,7 +21,7 @@
*
* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h,v 1.38 2001/04/04 12:46:35 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h,v 1.40 2001/05/15 10:19:41 eich Exp $ */
#ifndef _TRIDENT_H_
#define _TRIDENT_H_
@@ -138,6 +138,7 @@ typedef struct {
int hsync;
int vsync;
#endif
+ OptionInfoPtr Options;
} TRIDENTRec, *TRIDENTPtr;
typedef struct {
@@ -186,6 +187,7 @@ Bool TridentHWCursorInit(ScreenPtr pScreen);
int TridentFindMode(int xres, int yres, int depth);
void TGUISetClock(ScrnInfoPtr pScrn, int clock, unsigned char *a, unsigned char *b);
void TGUISetMCLK(ScrnInfoPtr pScrn, int clock, unsigned char *a, unsigned char *b);
+void tridentSetModeBIOS(ScrnInfoPtr pScrn, DisplayModePtr mode);
void TridentOutIndReg(ScrnInfoPtr pScrn,
CARD32 reg, unsigned char mask, unsigned char data);
unsigned char TridentInIndReg(ScrnInfoPtr pScrn, CARD32 reg);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c
index 95db63a9c..7d8d76131 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c
@@ -21,7 +21,7 @@
*
* Author: Alan Hourihane, alanh@fairlite.demon.co.uk
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c,v 1.42 2001/03/08 17:12:13 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c,v 1.45.2.1 2001/05/23 20:33:41 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -153,6 +153,7 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
int clock = pTrident->currentClock;
CARD8 protect;
Bool fullSize = FALSE;
+ Bool isShadow = FALSE;
vgaHWPtr hwp = VGAHWPTR(pScrn);
vgaRegPtr regp = &hwp->ModeReg;
@@ -285,6 +286,7 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|| (pReg->tridentRegs3CE[VertStretch] & 1));
pReg->tridentRegs3CE[CyberControl] |= 0x81;
xf86DrvMsgVerb(pScrn->scrnIndex,X_INFO,1,"Shadow on\n");
+ isShadow = TRUE;
} else {
pReg->tridentRegs3CE[CyberControl] &= 0x7E;
xf86DrvMsgVerb(pScrn->scrnIndex,X_INFO,1,"Shadow off\n");
@@ -293,6 +295,7 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
if (pTrident->CyberShadow) {
pReg->tridentRegs3CE[CyberControl] &= 0x7E;
+ isShadow = FALSE;
xf86DrvMsgVerb(pScrn->scrnIndex,X_INFO,1,"Forcing Shadow off\n");
}
@@ -362,8 +365,48 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
}
}
+ /* Calculate skew offsets for video overlay */
+ {
+ int HTotal, HSyncStart;
+ int VTotal, VSyncStart;
+ int h_off = 0;
+ int v_off = 0;
+
+ if (isShadow) {
+ HTotal = pReg->tridentRegs3x4[0] << 3;
+ VTotal = pReg->tridentRegs3x4[6]
+ | ((pReg->tridentRegs3x4[7] & (1<<0)) << 8)
+ | ((pReg->tridentRegs3x4[7] & (1<<5)) << 4);
+ HSyncStart = pReg->tridentRegs3x4[4] << 3;
+ VSyncStart = pReg->tridentRegs3x4[0x10]
+ | ((pReg->tridentRegs3x4[7] & (1<<2)) << 6)
+ | ((pReg->tridentRegs3x4[7] & (1<<7)) << 2);
+ if (pTrident->lcdMode != 0xff) {
+ h_off = (LCD[pTrident->lcdMode].display_x
+ - pScrn->currentMode->HDisplay) >> 1;
+ v_off = (LCD[pTrident->lcdMode].display_y
+ - pScrn->currentMode->VDisplay) >> 1;
+ }
+ } else {
+ HTotal = regp->CRTC[0] << 3;
+ VTotal = regp->CRTC[6]
+ | ((regp->CRTC[7] & (1<<0)) << 8)
+ | ((regp->CRTC[7] & (1<<5)) << 4);
+ HSyncStart = regp->CRTC[4] << 3;;
+ VSyncStart = regp->CRTC[0x10]
+ | ((regp->CRTC[7] & (1<<2)) << 6)
+ | ((regp->CRTC[7] & (1<<7)) << 2);
+ }
+ pTrident->hsync = (HTotal - HSyncStart) + 23 + h_off;
+ pTrident->vsync = (VTotal - VSyncStart) - 2 + v_off;
+ /* a little more skew for the Blade series */
+ if (pTrident->Chipset >= BLADE3D) pTrident->hsync -= 6;
+ }
+
/* Enable Chipset specific options */
switch (pTrident->Chipset) {
+ case CYBERBLADEXP:
+ case CYBERBLADEXPm:
case CYBERBLADEI7:
case CYBERBLADEI7D:
case CYBERBLADEI1:
@@ -381,6 +424,7 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
case CYBER9397:
case IMAGE975:
case IMAGE985:
+ case CYBER9388:
if (pScrn->bitsPerPixel >= 8)
pReg->tridentRegs3CE[MiscExtFunc] |= 0x10;
if (!pReg->tridentRegs3x4[PreEndControl])
@@ -389,7 +433,6 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
pReg->tridentRegs3x4[PreEndFetch] = 0xFF;
/* Fall Through */
case PROVIDIA9685:
- case CYBER9388:
case CYBER9385:
pReg->tridentRegs3x4[Enhancement0] = 0x40;
/* Fall Through */
@@ -543,6 +586,12 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
pReg->tridentRegs3x4[PCIReg] &= 0xF9;
}
}
+
+ /* Video */
+ pReg->tridentRegs3C4[SSetup] = 0x00;
+ pReg->tridentRegs3C4[SKey] = 0x00;
+ pReg->tridentRegs3C4[SPKey] = 0x00;
+
/* restore */
OUTB(0x3C4, 0x11);
OUTB(0x3C5, protect);
@@ -563,10 +612,9 @@ TridentRestore(ScrnInfoPtr pScrn, TRIDENTRegPtr tridentReg)
OUTB(0x3C4, Protection);
OUTB(0x3C5, 0x92);
}
-#ifdef NOTYET
- if (pTrident->doInit) {
+#if 0
+ if (pTrident->doInit && pTrident->Int10) {
OUTW_3CE(BiosReg);
-
}
#endif
/* Goto New Mode */
@@ -600,6 +648,9 @@ TridentRestore(ScrnInfoPtr pScrn, TRIDENTRegPtr tridentReg)
OUTW_3CE(MiscIntContReg);
OUTW_3CE(MiscExtFunc);
OUTW_3x4(Offset);
+ OUTW_3C4(SSetup);
+ OUTW_3C4(SKey);
+ OUTW_3C4(SPKey);
OUTW_3x4(PreEndControl);
OUTW_3x4(PreEndFetch);
if (pTrident->Chipset >= PROVIDIA9685) OUTW_3x4(Enhancement0);
@@ -700,6 +751,9 @@ TridentSave(ScrnInfoPtr pScrn, TRIDENTRegPtr tridentReg)
INB_3x4(GraphEngReg);
INB_3x4(PCIReg);
INB_3x4(PCIRetry);
+ INB_3C4(SSetup);
+ INB_3C4(SKey);
+ INB_3C4(SPKey);
INB_3x4(PreEndControl);
INB_3x4(PreEndFetch);
if (pTrident->Chipset >= PROVIDIA9685) INB_3x4(Enhancement0);
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c
index 8fead5426..9b10afab3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c
@@ -28,7 +28,7 @@
* Massimiliano Ghilardi, max@Linuz.sns.it, some fixes to the
* clockchip programming code.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v 1.133 2001/04/26 15:07:44 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v 1.136 2001/05/15 10:19:41 eich Exp $ */
#include "xf1bpp.h"
#include "xf4bpp.h"
@@ -68,7 +68,7 @@
#include "xf86xv.h"
#endif
-static OptionInfoPtr TRIDENTAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * TRIDENTAvailableOptions(int chipid, int busid);
static void TRIDENTIdentify(int flags);
static Bool TRIDENTProbe(DriverPtr drv, int flags);
static Bool TRIDENTPreInit(ScrnInfoPtr pScrn, int flags);
@@ -218,7 +218,7 @@ typedef enum {
OPTION_CYBER_STRETCH
} TRIDENTOpts;
-static OptionInfoRec TRIDENTOptions[] = {
+static const OptionInfoRec TRIDENTOptions[] = {
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
@@ -499,6 +499,7 @@ static const char *shadowSymbols[] = {
static const char *vbeSymbols[] = {
"VBEInit",
"vbeDoEDID",
+ "vbeFree",
NULL
};
@@ -633,8 +634,7 @@ TRIDENTBlockHandler (
}
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
TRIDENTAvailableOptions(int chipid, int busid)
{
return TRIDENTOptions;
@@ -1047,7 +1047,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
pTrident->Linear = FALSE;
}
}
-
+
if (flags & PROBE_DETECT) {
TRIDENTProbeDDC(pScrn, pTrident->pEnt->index);
return TRUE;
@@ -1124,13 +1124,6 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
vgaHWGetIOBase(VGAHWPTR(pScrn));
vgaIOBase = VGAHWPTR(pScrn)->IOBase;
- if (!xf86IsPc98()) {
- if (xf86LoadSubModule(pScrn, "int10")) {
- xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Initializing int10\n");
- pTrident->Int10 = xf86InitInt10(pTrident->pEnt->index);
- }
- }
-
xf86SetOperatingState(RES_SHARED_VGA, pTrident->pEnt->index, ResUnusedOpr);
/* The ramdac module should be loaded here when needed */
@@ -1181,7 +1174,10 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, TRIDENTOptions);
+ if (!(pTrident->Options = xalloc(sizeof(TRIDENTOptions))))
+ return FALSE;
+ memcpy(pTrident->Options, TRIDENTOptions, sizeof(TRIDENTOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTrident->Options);
/* Set the bits per RGB for 8bpp mode */
if (pScrn->depth <= 8) {
@@ -1189,7 +1185,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
/* Default to 8 */
pScrn->rgbBits = 6;
#if 0
- if (xf86GetOptValInteger(TRIDENTOptions, OPTION_RGB_BITS,
+ if (xf86GetOptValInteger(pTrident->Options, OPTION_RGB_BITS,
&pScrn->rgbBits)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Bits per RGB set to %d\n",
pScrn->rgbBits);
@@ -1198,26 +1194,24 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
}
from = X_DEFAULT;
pTrident->HWCursor = TRUE;
- if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(pTrident->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pTrident->HWCursor = FALSE;
}
- xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
- pTrident->HWCursor ? "HW" : "SW");
- if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pTrident->Options, OPTION_NOACCEL, FALSE)) {
pTrident->NoAccel = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
- if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_PCI_RETRY, FALSE)) {
+ if (xf86ReturnOptValBool(pTrident->Options, OPTION_PCI_RETRY, FALSE)) {
pTrident->UsePCIRetry = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n");
}
pTrident->UsePCIBurst = TRUE;
- if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_NOPCIBURST, FALSE)) {
+ if (xf86ReturnOptValBool(pTrident->Options, OPTION_NOPCIBURST, FALSE)) {
pTrident->UsePCIBurst = FALSE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI Burst disbled\n");
}
- if(xf86GetOptValInteger(TRIDENTOptions, OPTION_VIDEO_KEY,
+ if(xf86GetOptValInteger(pTrident->Options, OPTION_VIDEO_KEY,
&(pTrident->videoKey))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
pTrident->videoKey);
@@ -1227,11 +1221,11 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
(((pScrn->mask.blue >> pScrn->offset.blue) - 1)
<< pScrn->offset.blue);
}
- if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_NOMMIO, FALSE)) {
+ if (xf86ReturnOptValBool(pTrident->Options, OPTION_NOMMIO, FALSE)) {
pTrident->NoMMIO = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MMIO Disabled\n");
}
- if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_MMIO_ONLY, FALSE)) {
+ if (xf86ReturnOptValBool(pTrident->Options, OPTION_MMIO_ONLY, FALSE)) {
if (pTrident->NoMMIO)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "MMIO only cannot be set"
" with NoMMIO\n");
@@ -1240,22 +1234,22 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MMIO Disabled\n");
}
}
- if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_CYBER_SHADOW, FALSE)) {
+ if (xf86ReturnOptValBool(pTrident->Options, OPTION_CYBER_SHADOW, FALSE)) {
pTrident->CyberShadow = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Cyber Shadow enabled\n");
}
- if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_CYBER_STRETCH, FALSE)) {
+ if (xf86ReturnOptValBool(pTrident->Options, OPTION_CYBER_STRETCH, FALSE)) {
pTrident->CyberStretch = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Cyber Stretch enabled\n");
}
pTrident->MUXThreshold = 160000; /* 160MHz */
- if (xf86GetOptValInteger(TRIDENTOptions, OPTION_MUX_THRESHOLD,
+ if (xf86GetOptValInteger(pTrident->Options, OPTION_MUX_THRESHOLD,
&pTrident->MUXThreshold)) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MUX Threshold set to %d\n",
pTrident->MUXThreshold);
}
- if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_SHADOW_FB, FALSE)) {
+ if (xf86ReturnOptValBool(pTrident->Options, OPTION_SHADOW_FB, FALSE)) {
if (!pTrident->Linear)
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Ignoring Option SHADOW_FB"
" in non-Linear Mode\n");
@@ -1270,7 +1264,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
}
}
pTrident->Rotate = 0;
- if ((s = xf86GetOptValString(TRIDENTOptions, OPTION_ROTATE))) {
+ if ((s = xf86GetOptValString(pTrident->Options, OPTION_ROTATE))) {
if (!pTrident->Linear)
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Ignoring Option ROTATE "
"in non-Linear Mode\n");
@@ -1356,10 +1350,11 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
* PIO access will be blocked
* when MMIO is turned on!
*/
+
if (xf86LoadSubModule(pScrn, "vbe")) {
xf86MonPtr pMon;
vbeInfoPtr pVbe;
- pVbe = VBEInit(pTrident->Int10, pTrident->pEnt->index);
+ pVbe = VBEInit(NULL,pTrident->pEnt->index);
pMon = vbeDoEDID(pVbe, NULL);
vbeFree(pVbe);
if (pMon) {
@@ -1720,6 +1715,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
ramtype = "SGRAM";
pTrident->HasSGRAM = TRUE;
pTrident->NoAccel = TRUE; /* Disable acceleration */
+ pTrident->HWCursor = FALSE;
/* pTrident->IsCyber = TRUE; */
Support24bpp = TRUE;
chipset = "Cyber/BladeXP";
@@ -1731,6 +1727,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
ramtype = "SGRAM";
pTrident->HasSGRAM = TRUE;
pTrident->NoAccel = TRUE; /* Disable acceleration */
+ pTrident->HWCursor = FALSE;
pTrident->IsCyber = TRUE;
Support24bpp = TRUE;
chipset = "CyberBlade/XPm";
@@ -1738,6 +1735,8 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
pTrident->frequency = NTSC;
break;
}
+ xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
+ pTrident->HWCursor ? "HW" : "SW");
if (!pScrn->progClock) {
pScrn->numClocks = NoClocks;
@@ -1844,11 +1843,11 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
OUTB(0x3CE, FPConfig);
pTrident->lcdActive = (INB(0x3CF) & 0x10);
}
-
+
pTrident->MCLK = 0;
mclk = CalculateMCLK(pScrn);
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Memory Clock is %3.2f MHz\n", mclk);
- if (xf86GetOptValFreq(TRIDENTOptions, OPTION_SETMCLK, OPTUNITS_MHZ,
+ if (xf86GetOptValFreq(pTrident->Options, OPTION_SETMCLK, OPTUNITS_MHZ,
&real)) {
pTrident->MCLK = (int)(real * 1000.0);
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Setting new Memory Clock to %3.2f MHz\n",
@@ -2112,6 +2111,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags)
TRIDENTUnmapMem(pScrn);
}
+
pTrident->FbMapSize = pScrn->videoRam * 1024;
pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
@@ -2279,26 +2279,17 @@ TRIDENTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
break;
}
- /* Calculate skew offsets for video overlay */
- pTrident->hsync = (mode->CrtcHTotal - mode->CrtcHSyncStart) - 23;
- pTrident->vsync = (mode->CrtcVTotal - mode->CrtcVSyncStart) - 4;
-
vgaHWUnlock(hwp);
-
/* Initialise the ModeReg values */
if (!vgaHWInit(pScrn, mode))
return FALSE;
pScrn->vtSema = TRUE;
-
- /* Program the registers */
- vgaHWProtect(pScrn, TRUE);
- vgaReg = &hwp->ModeReg;
- tridentReg = &pTrident->ModeReg;
-
- vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE);
-
/*
- * TridentInit() has to modified registers
+ * We used to do this at a later time.
+ * Now since READOUT isn't defined any more
+ * we do it here.
+ * The original NOTE read:
+ * TridentInit() has to modify registers
* that have already been set by vgaHWRestore().
* So we call it _after_ vgaHWRestore() has
* programmed these registers.
@@ -2311,6 +2302,13 @@ TRIDENTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
return FALSE;
}
+ /* Program the registers */
+ vgaHWProtect(pScrn, TRUE);
+ vgaReg = &hwp->ModeReg;
+ tridentReg = &pTrident->ModeReg;
+
+ vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE);
+
if (pScrn->progClock)
TridentRestore(pScrn, tridentReg);
else
@@ -2397,6 +2395,13 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!TRIDENTMapMem(pScrn))
return FALSE;
+ if (!xf86IsPc98()) {
+ if (xf86LoadSubModule(pScrn, "int10")) {
+ xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Initializing int10\n");
+ pTrident->Int10 = xf86InitInt10(pTrident->pEnt->index);
+ }
+ }
+
hwp = VGAHWPTR(pScrn);
if (IsPciCard && UseMMIO) {
@@ -2418,7 +2423,7 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
*/
if (IsPciCard && xf86IsPc98()) {
PC98TRIDENTInit(pScrn);
- }
+ } else tridentSetModeBIOS(pScrn,pScrn->currentMode);
/* Initialise the first mode */
if (!TRIDENTModeInit(pScrn, pScrn->currentMode))
@@ -2449,8 +2454,10 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!miSetVisualTypes(pScrn->depth,
miGetDefaultVisualMask(pScrn->depth),
- pScrn->rgbBits, pScrn->defaultVisual))
+ pScrn->rgbBits, pScrn->defaultVisual)) {
+ xf86FreeInt10(pTrident->Int10);
return FALSE;
+ }
miSetPixmapDepths ();
@@ -2509,9 +2516,10 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
ret = FALSE;
break;
}
- if (!ret)
+ if (!ret) {
+ xf86FreeInt10(pTrident->Int10);
return FALSE;
-
+ }
if (pScrn->bitsPerPixel > 8) {
/* Fixup RGB ordering */
visual = pScreen->visuals + pScreen->numVisuals;
@@ -2544,9 +2552,10 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* Setup the vga banking variables */
pBankInfo = xnfcalloc(sizeof(miBankInfoRec),1);
- if (pBankInfo == NULL)
+ if (pBankInfo == NULL) {
+ xf86FreeInt10(pTrident->Int10);
return FALSE;
-
+ }
pBankInfo->pBankA = pTrident->FbBase;
pBankInfo->pBankB = pTrident->FbBase;
pBankInfo->BankSize = 0x10000;
@@ -2562,6 +2571,7 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScrn->displayWidth, pBankInfo)) {
xfree(pBankInfo);
pBankInfo = NULL;
+ xf86FreeInt10(pTrident->Int10);
return FALSE;
}
}
@@ -2599,13 +2609,15 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
/* Initialise default colourmap */
- if (!miCreateDefColormap(pScreen))
+ if (!miCreateDefColormap(pScreen)) {
+ xf86FreeInt10(pTrident->Int10);
return FALSE;
-
+ }
if(!xf86HandleColormaps(pScreen, 256, 6, TridentLoadPalette,
- TridentSetOverscan, CMAP_RELOAD_ON_MODE_SWITCH|CMAP_PALETTED_TRUECOLOR))
+ TridentSetOverscan, CMAP_RELOAD_ON_MODE_SWITCH|CMAP_PALETTED_TRUECOLOR)) {
+ xf86FreeInt10(pTrident->Int10);
return FALSE;
-
+ }
if(pTrident->ShadowFB) {
if(pTrident->Rotate) {
if (!pTrident->PointerMoved) {
@@ -2811,6 +2823,7 @@ TRIDENTCloseScreen(int scrnIndex, ScreenPtr pScreen)
if(pTrident->BlockHandler)
pScreen->BlockHandler = pTrident->BlockHandler;
+ xf86FreeInt10(pTrident->Int10);
pScreen->CloseScreen = pTrident->CloseScreen;
return (*pScreen->CloseScreen)(scrnIndex, pScreen);
}
@@ -3163,3 +3176,38 @@ PC98TRIDENT96xxDisable(ScrnInfoPtr pScrn)
outb(0x6A, 0x06);
outb(0x68, 0x0F);
}
+
+
+/*
+ * This is a terrible hack! If we are on a notebook in a stretched
+ * mode and don't want full screen we use the BIOS to set an unstreched
+ * mode.
+ */
+void
+tridentSetModeBIOS(ScrnInfoPtr pScrn, DisplayModePtr mode)
+{
+ TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+ if (pTrident->IsCyber && pTrident->lcdMode) {
+ int i = pTrident->lcdMode;
+ if ((pScrn->currentMode->HDisplay != LCD[i].display_x) /* !fullsize? */
+ || (pScrn->currentMode->VDisplay != LCD[i].display_y)) {
+ if (pTrident->lcdActive) { /* LCD Active ?*/
+ int h_str, v_str;
+
+ OUTB(0x3CE,HorStretch); h_str = INB(0x3CF) & 0x01;
+ OUTB(0x3CE,VertStretch); v_str = INB(0x3CF) & 0x01;
+ if (h_str || v_str) {
+ OUTB(0x3C4, 0x11); OUTB(0x3C5, 0x92);
+ OUTW(0x3CE, BiosReg );
+ pTrident->Int10->ax = 0x3;
+ pTrident->Int10->num = 0x10;
+ if (IsPciCard && UseMMIO)
+ TRIDENTDisableMMIO(pScrn);
+ xf86ExecX86int10(pTrident->Int10);
+ if (IsPciCard && UseMMIO)
+ TRIDENTEnableMMIO(pScrn);
+ }
+ }
+ }
+ }
+}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h
index 7c07b73ff..d38082a01 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h
@@ -21,7 +21,7 @@
*
* Author: Alan Hourihane, alanh@fairlite.demon.co.uk
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.18 2000/12/07 19:03:40 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.19 2001/05/15 11:08:40 alanh Exp $ */
#define DEBUG 1
@@ -44,6 +44,9 @@
#define MCLKHigh 0x17
#define ClockLow 0x18
#define ClockHigh 0x19
+#define SSetup 0x20
+#define SKey 0x37
+#define SPKey 0x57
/* 3x4 */
#define Offset 0x13
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c
index 6c8e301fe..5b028de07 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c
@@ -21,7 +21,7 @@
*
* Author: Alan Hourihane, alanh@fairlite.demon.co.uk
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c,v 1.2 2000/12/14 19:29:44 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c,v 1.4.2.2 2001/05/24 09:37:41 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -81,10 +81,11 @@ void TRIDENTInitVideo(ScreenPtr pScreen)
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int num_adaptors;
- if (!pTrident->NoAccel) {
- newAdaptor = TRIDENTSetupImageVideo(pScreen);
- TRIDENTInitOffscreenImages(pScreen);
- }
+ if (pTrident->NoAccel || !pTrident->AccelInfoRec->SetupForSolidFill)
+ return;
+
+ newAdaptor = TRIDENTSetupImageVideo(pScreen);
+ TRIDENTInitOffscreenImages(pScreen);
num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
@@ -224,7 +225,7 @@ void TRIDENTResetVideo(ScrnInfoPtr pScrn)
blue = (pPriv->colorKey & pScrn->mask.blue) >> pScrn->offset.blue;
switch (pScrn->depth) {
case 15:
- tmp = (red << 11) | (green << 6) | (blue);
+ tmp = (red << 10) | (green << 5) | (blue);
OUTW(0x3C4, (tmp & 0xff) << 8 | 0x50);
OUTW(0x3C4, (tmp & 0xff00) | 0x51);
OUTW(0x3C4, 0x0052);
@@ -242,9 +243,9 @@ void TRIDENTResetVideo(ScrnInfoPtr pScrn)
OUTW(0x3C4, 0x0056);
break;
case 24:
- OUTW(0x3C4, (red<<8) | 0x50);
+ OUTW(0x3C4, (blue<<8) | 0x50);
OUTW(0x3C4, (green<<8) | 0x51);
- OUTW(0x3C4, (blue<<8) | 0x52);
+ OUTW(0x3C4, (red<<8) | 0x52);
OUTW(0x3C4, 0xFF54);
OUTW(0x3C4, 0xFF55);
OUTW(0x3C4, 0xFF56);
@@ -293,10 +294,7 @@ TRIDENTSetupImageVideo(ScreenPtr pScreen)
adapt->PutImage = TRIDENTPutImage;
adapt->QueryImageAttributes = TRIDENTQueryImageAttributes;
- if ((pScrn->depth == 15) || (pScrn->depth == 24))
- pPriv->colorKey = 0; /* FIXME */
- else
- pPriv->colorKey = pTrident->videoKey;
+ pPriv->colorKey = pTrident->videoKey & ((1 << pScrn->depth) - 1);
pPriv->videoStatus = 0;
/* gotta uninit this someplace */
@@ -455,6 +453,7 @@ TRIDENTStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit)
if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
pPriv->videoStatus |= OFF_TIMER;
pPriv->offTime = currentTime.milliseconds + OFF_DELAY;
+ pTrident->VideoTimerCallback = TRIDENTVideoTimerCallback;
}
}
}
@@ -485,7 +484,7 @@ TRIDENTSetPortAttribute(
blue = (pPriv->colorKey & pScrn->mask.blue) >> pScrn->offset.blue;
switch (pScrn->depth) {
case 15:
- tmp = (red << 11) | (green << 6) | (blue);
+ tmp = (red << 10) | (green << 5) | (blue);
OUTW(0x3C4, (tmp&0xff)<<8 | 0x50);
OUTW(0x3C4, (tmp&0xff00) | 0x51);
OUTW(0x3C4, 0x0052);
@@ -497,9 +496,9 @@ TRIDENTSetPortAttribute(
OUTW(0x3C4, 0x0052);
break;
case 24:
- OUTW(0x3C4, (red<<8) | 0x50);
+ OUTW(0x3C4, (blue<<8) | 0x50);
OUTW(0x3C4, (green<<8) | 0x51);
- OUTW(0x3C4, (blue<<8) | 0x52);
+ OUTW(0x3C4, (red<<8) | 0x52);
break;
}
}
@@ -660,15 +659,11 @@ TRIDENTDisplayVideo(
OUTW(vgaIOBase + 4, 0x00BF);
break;
}
-
tx1 = dstBox->x1 + pTrident->hsync;
tx2 = dstBox->x2 + pTrident->hsync;
ty1 = dstBox->y1 + pTrident->vsync - 2;
ty2 = dstBox->y2 + pTrident->vsync + 2;
- /* Crude way to deal with off the left edge - FIXME - doesn't work well */
- tx1 -= (x1 >> 16);
-
OUTW(vgaIOBase + 4, (tx1 & 0xff) <<8 | 0x86);
OUTW(vgaIOBase + 4, (tx1 & 0xff00) | 0x87);
OUTW(vgaIOBase + 4, (ty1 & 0xff) <<8 | 0x88);
@@ -678,6 +673,8 @@ TRIDENTDisplayVideo(
OUTW(vgaIOBase + 4, (ty2 & 0xff) <<8 | 0x8C);
OUTW(vgaIOBase + 4, (ty2 & 0xff00) | 0x8D);
+ offset += (x1 >> 15) & ~0x01;
+
OUTW(vgaIOBase + 4, (((width<<1) & 0xff)<<8) | 0x90);
OUTW(vgaIOBase + 4, ((width<<1) & 0xff00) | 0x91);
OUTW(vgaIOBase + 4, ((offset>>3) & 0xff) << 8 | 0x92);
@@ -690,8 +687,13 @@ TRIDENTDisplayVideo(
OUTW(vgaIOBase + 4, 0x0081);
} else
if (drw_w > src_w) {
- zoomx1 = ((float)src_w/(float)drw_w);
- zoomx2 = ( ((float)src_w/(float)drw_w) - (int)zoomx1 ) * 1024;
+ float z;
+ if (pTrident->Chipset >= BLADE3D)
+ z = (float)src_w/(float)drw_w;
+ else
+ z = (float)drw_w/(float)src_w - 1;
+ zoomx1 = z;
+ zoomx2 = (z - (int)zoomx1 ) * 1024;
OUTW(vgaIOBase + 4, (zoomx2&0xff)<<8 | 0x80);
OUTW(vgaIOBase + 4, (zoomx1&0x0f)<<10 | (zoomx2&0x0300) | 0x81);
} else {
@@ -708,8 +710,13 @@ TRIDENTDisplayVideo(
OUTW(vgaIOBase + 4, 0x0083);
} else
if (drw_h > src_h) {
- zoomy1 = ((float)src_h/(float)drw_h);
- zoomy2 = ( ((float)src_h/(float)drw_h) - (int)zoomy1 ) * 1024;
+ float z;
+ if (pTrident->Chipset >= BLADE3D)
+ z = (float)src_h/(float)drw_h;
+ else
+ z = (float)drw_h/(float)src_h - 1;
+ zoomy1 = z;
+ zoomy2 = (z - (int)zoomy1 ) * 1024;
OUTW(vgaIOBase + 4, (zoomy2&0xff)<<8 | 0x82);
OUTW(vgaIOBase + 4, (zoomy1&0x0f)<<10 | (zoomy2&0x0300) | 0x83);
} else {
@@ -780,7 +787,6 @@ TRIDENTPutImage(
dstPitch = ((width << 1) + 15) & ~15;
new_size = ((dstPitch * height) + bpp - 1) / bpp;
-
switch(id) {
case FOURCC_YV12:
case FOURCC_I420:
@@ -849,8 +855,6 @@ TRIDENTPutImage(
pPriv->videoStatus = CLIENT_VIDEO_ON;
- pTrident->VideoTimerCallback = TRIDENTVideoTimerCallback;
-
return Success;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c
index e252f9757..35ef8732f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c
@@ -21,7 +21,7 @@
*
* Author: Alan Hourihane, alanh@fairlite.demon.co.uk
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c,v 1.17 2001/02/15 17:59:07 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c,v 1.18 2001/05/15 10:19:41 eich Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -334,3 +334,7 @@ TGUISetMCLK(ScrnInfoPtr pScrn, int clock, CARD8 *a, CARD8 *b)
}
}
}
+
+
+
+
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h
index 22b1d5649..c2959bb4d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h
@@ -1,5 +1,5 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h,v 1.35 2001/02/15 17:54:57 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h,v 1.36 2001/05/04 19:05:48 dawes Exp $ */
@@ -262,6 +262,7 @@ typedef struct {
Bool DGAactive;
DGAModePtr DGAModes;
int DGAViewportStatus;
+ OptionInfoPtr Options;
} TsengRec, *TsengPtr;
#define TsengPTR(p) ((TsengPtr)((p)->driverPrivate))
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c
index 03678251a..199082bf5 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c,v 1.16 2000/09/19 12:46:19 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c,v 1.17 2001/05/07 21:59:07 tsi Exp $ */
@@ -12,7 +12,6 @@ static void TsengSetCursorPosition(ScrnInfoPtr pScrn, int x, int y);
static Bool TsengUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs);
static void TsengSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg);
static void TsengLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *bits);
-unsigned char *TsengRealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs);
Bool
TsengHWCursorInit(ScreenPtr pScreen)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c
index 7b14751eb..d61ce10ec 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c,v 1.83 2001/04/06 16:51:19 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c,v 1.84 2001/05/04 19:05:48 dawes Exp $
*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@@ -63,7 +63,7 @@
*/
/* Mandatory functions */
-static OptionInfoPtr TsengAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * TsengAvailableOptions(int chipid, int busid);
static void TsengIdentify(int flags);
static Bool TsengProbe(DriverPtr drv, int flags);
static Bool TsengPreInit(ScrnInfoPtr pScrn, int flags);
@@ -181,7 +181,7 @@ typedef enum {
OPTION_SET_MCLK
} TsengOpts;
-static OptionInfoRec TsengOptions[] =
+static const OptionInfoRec TsengOptions[] =
{
{OPTION_HIBIT_HIGH, "hibit_high", OPTV_BOOLEAN,
{0}, FALSE},
@@ -387,8 +387,7 @@ TsengPCI2Type(ScrnInfoPtr pScrn, int ChipID)
return TRUE;
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
TsengAvailableOptions(int chipid, int busid)
{
return TsengOptions;
@@ -1206,14 +1205,14 @@ TsengProcessHibit(ScrnInfoPtr pScrn)
TsengPtr pTseng = TsengPTR(pScrn);
PDEBUG(" TsengProcessHibit\n");
- if (xf86IsOptionSet(TsengOptions, OPTION_HIBIT_HIGH)) {
- if (xf86IsOptionSet(TsengOptions, OPTION_HIBIT_LOW)) {
+ if (xf86IsOptionSet(pTseng->Options, OPTION_HIBIT_HIGH)) {
+ if (xf86IsOptionSet(pTseng->Options, OPTION_HIBIT_LOW)) {
xf86Msg(X_ERROR, "\nOptions \"hibit_high\" and \"hibit_low\" are incompatible;\n");
xf86Msg(X_ERROR, " specify only one (not both) in XFree86 configuration file\n");
return FALSE;
}
pTseng->save_divide = 0x40;
- } else if (xf86IsOptionSet(TsengOptions, OPTION_HIBIT_HIGH)) {
+ } else if (xf86IsOptionSet(pTseng->Options, OPTION_HIBIT_HIGH)) {
pTseng->save_divide = 0;
} else {
from = X_PROBED;
@@ -1249,13 +1248,16 @@ TsengProcessOptions(ScrnInfoPtr pScrn)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, TsengOptions);
+ if (!(pTseng->Options = xalloc(sizeof(TsengOptions))))
+ return FALSE;
+ memcpy(pTseng->Options, TsengOptions, sizeof(TsengOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTseng->Options);
from = X_DEFAULT;
pTseng->HWCursor = FALSE; /* default */
- if (xf86GetOptValBool(TsengOptions, OPTION_HW_CURSOR, &pTseng->HWCursor))
+ if (xf86GetOptValBool(pTseng->Options, OPTION_HW_CURSOR, &pTseng->HWCursor))
from = X_CONFIG;
- if (xf86ReturnOptValBool(TsengOptions, OPTION_SW_CURSOR, FALSE)) {
+ if (xf86ReturnOptValBool(pTseng->Options, OPTION_SW_CURSOR, FALSE)) {
from = X_CONFIG;
pTseng->HWCursor = FALSE;
}
@@ -1271,7 +1273,7 @@ TsengProcessOptions(ScrnInfoPtr pScrn)
if (pScrn->bitsPerPixel >= 8) {
if (pTseng->ChipType != TYPE_ET4000)
pTseng->UseAccel = TRUE;
- if (xf86ReturnOptValBool(TsengOptions, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pTseng->Options, OPTION_NOACCEL, FALSE)) {
pTseng->UseAccel = FALSE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n");
}
@@ -1279,30 +1281,30 @@ TsengProcessOptions(ScrnInfoPtr pScrn)
pTseng->UseAccel = FALSE; /* 1bpp and 4bpp are always non-accelerated */
pTseng->SlowDram = FALSE;
- if (xf86IsOptionSet(TsengOptions, OPTION_SLOW_DRAM)) {
+ if (xf86IsOptionSet(pTseng->Options, OPTION_SLOW_DRAM)) {
pTseng->SlowDram = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using slow DRAM access\n");
}
pTseng->MedDram = FALSE;
- if (xf86IsOptionSet(TsengOptions, OPTION_MED_DRAM)) {
+ if (xf86IsOptionSet(pTseng->Options, OPTION_MED_DRAM)) {
pTseng->MedDram = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using Medium-speed DRAM access\n");
}
pTseng->FastDram = FALSE;
- if (xf86IsOptionSet(TsengOptions, OPTION_FAST_DRAM)) {
+ if (xf86IsOptionSet(pTseng->Options, OPTION_FAST_DRAM)) {
pTseng->FastDram = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using fast DRAM access\n");
}
if ((pTseng->SetW32Interleave =
- xf86GetOptValBool(TsengOptions, OPTION_W32_INTERLEAVE, &pTseng->W32Interleave)) )
+ xf86GetOptValBool(pTseng->Options, OPTION_W32_INTERLEAVE, &pTseng->W32Interleave)) )
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing W32p memory interleave %s.\n",
pTseng->W32Interleave ? "ON" : "OFF");
if ((pTseng->SetPCIBurst =
- xf86GetOptValBool(TsengOptions, OPTION_PCI_BURST, &pTseng->PCIBurst)) )
+ xf86GetOptValBool(pTseng->Options, OPTION_PCI_BURST, &pTseng->PCIBurst)) )
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing PCI burst mode %s.\n",
pTseng->PCIBurst ? "ON" : "OFF");
from = X_CONFIG;
- if (xf86GetOptValBool(TsengOptions, OPTION_LINEAR, &pTseng->UseLinMem)) {
+ if (xf86GetOptValBool(pTseng->Options, OPTION_LINEAR, &pTseng->UseLinMem)) {
/* check if linear mode is allowed */
if (pTseng->UseLinMem) {
if (!CHIP_SUPPORTS_LINEAR) {
@@ -1327,17 +1329,17 @@ TsengProcessOptions(ScrnInfoPtr pScrn)
(pTseng->UseLinMem) ? "linear" : "banked");
pTseng->ShowCache = FALSE;
- if (xf86ReturnOptValBool(TsengOptions, OPTION_SHOWCACHE, FALSE)) {
+ if (xf86ReturnOptValBool(pTseng->Options, OPTION_SHOWCACHE, FALSE)) {
pTseng->ShowCache = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "(for debugging only:) Visible off-screen memory\n");
}
pTseng->Legend = FALSE;
- if (xf86ReturnOptValBool(TsengOptions, OPTION_LEGEND, FALSE)) {
+ if (xf86ReturnOptValBool(pTseng->Options, OPTION_LEGEND, FALSE)) {
pTseng->Legend = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using Legend pixel clock selection.\n");
}
pTseng->NoClockchip = FALSE;
- if (xf86ReturnOptValBool(TsengOptions, OPTION_NOCLOCKCHIP, FALSE)) {
+ if (xf86ReturnOptValBool(pTseng->Options, OPTION_NOCLOCKCHIP, FALSE)) {
pTseng->NoClockchip = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Disabling clockchip programming.\n");
}
@@ -1349,12 +1351,12 @@ TsengProcessOptions(ScrnInfoPtr pScrn)
pScrn->progClock = FALSE;
pTseng->UsePCIRetry = FALSE;
- if (xf86ReturnOptValBool(TsengOptions, OPTION_PCI_RETRY, FALSE)) {
+ if (xf86ReturnOptValBool(pTseng->Options, OPTION_PCI_RETRY, FALSE)) {
pTseng->UsePCIRetry = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n");
}
pTseng->MemClk = 0;
- if (xf86GetOptValFreq(TsengOptions, OPTION_SET_MCLK, OPTUNITS_MHZ, &real))
+ if (xf86GetOptValFreq(pTseng->Options, OPTION_SET_MCLK, OPTUNITS_MHZ, &real))
pTseng->MemClk = (int)(real * 1000.0);
return TRUE;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/v4l/README b/xc/programs/Xserver/hw/xfree86/drivers/v4l/README
index a3c981265..a21e915fd 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/v4l/README
+++ b/xc/programs/Xserver/hw/xfree86/drivers/v4l/README
@@ -22,18 +22,16 @@
adaptors which are usable with any target device, and initialise
them on its screens with xf86XVScreenInit() as follows...
- #ifdef XvExtension
- {
- XF86VideoAdaptorPtr *ptr;
+ {
+ XF86VideoAdaptorPtr *ptr;
- int xvexts = xf86XVListGenericAdaptors(&ptr);
+ int xvexts = xf86XVListGenericAdaptors(&ptr);
- if (xvexts) {
- xf86XVScreenInit(pScreen,ptr,v4l);
- }
- }
- #endif
+ if (xvexts) {
+ xf86XVScreenInit(pScreen, ptr, xvexts);
+ }
+ }
-$XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/README,v 1.1 1999/03/28 15:32:50 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/README,v 1.2 2001/05/07 21:59:07 tsi Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c b/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c
index 5fdfd4b8d..47fa2a2eb 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c
@@ -2,7 +2,7 @@
* video4linux Xv Driver
* based on Michael Schimek's permedia 2 driver.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c,v 1.24 2001/04/26 21:27:53 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c,v 1.25 2001/05/04 19:05:49 dawes Exp $ */
#include "videodev.h"
#include "xf86.h"
@@ -27,7 +27,7 @@
static void V4LIdentify(int flags);
static Bool V4LProbe(DriverPtr drv, int flags);
-static OptionInfoPtr V4LAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * V4LAvailableOptions(int chipid, int busid);
DriverRec V4L = {
40000,
@@ -663,8 +663,7 @@ V4lQueryBestSize(ScrnInfoPtr pScrn, Bool motion,
pPPriv->cenc,drw_w,drw_h,*p_w,*p_h));
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
V4LAvailableOptions(int chipid, int busid)
{
return NULL;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man b/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man
index 1043783aa..0e8a9cb54 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man
+++ b/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man
@@ -1,25 +1,34 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man,v 1.2 2001/01/27 18:20:55 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man,v 1.2.2.1 2001/05/29 22:28:23 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH V4L __drivermansuffix__ __vendorversion__
.SH NAME
-v4l \- Video 4 Linux driver
+v4l \- video4linux driver
.SH SYNOPSIS
.nf
-.B "Section \*qDevice\*q"
-.BI " Identifier \*q" devname \*q
-.B " Driver \*qv4l\*q"
+.B "Section \*qModule\*q"
\ \ ...
+.B " Load \*qv4l\*q"
.B EndSection
.fi
.SH DESCRIPTION
.B v4l
-is an XFree86 driver for Video 4 Linux.
-THIS MAN PAGE NEEDS TO BE FILLED IN.
+is an XFree86 driver for video4linux cards. It provides a Xvideo
+extention port for video overlay. Just add the driver to the module
+list within the module section of your XF86Config file if you want
+to use it. There are no config options.
+.P
+Note that the the extmod module is also required for the Xvideo
+support (and lots of other extentions too).
.SH SUPPORTED HARDWARE
The
.B v4l
-driver supports...
+driver works with every piece of hardware which is supported by a
+video4linux (kernel-) device driver and is able to handle video
+overlay.
+.P
+bt848/bt878-based TV cards are the most popular hardware these
+days.
.SH CONFIGURATION DETAILS
Please refer to XF86Config(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
@@ -27,4 +36,4 @@ driver.
.SH "SEE ALSO"
XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
.SH AUTHORS
-Authors include: ...
+Authors include: Gerd Knorr <kraxel@bytesex.org>
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c
index 6b7750ef4..358589096 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c
@@ -25,9 +25,9 @@
* dealings in this Software without prior written authorization from
* Conectiva Linux.
*
- * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.15 2001/04/01 14:00:12 tsi Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.16.2.2 2001/05/28 21:36:43 paulo Exp $
*/
#include "vesa.h"
@@ -43,7 +43,7 @@
#include "xf86cmap.h"
/* Mandatory functions */
-static OptionInfoPtr VESAAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * VESAAvailableOptions(int chipid, int busid);
static void VESAIdentify(int flags);
static Bool VESAProbe(DriverPtr drv, int flags);
static Bool VESAPreInit(ScrnInfoPtr pScrn, int flags);
@@ -60,6 +60,10 @@ static void VESAAdjustFrame(int scrnIndex, int x, int y, int flags);
static void VESAFreeScreen(int scrnIndex, int flags);
static void VESAFreeRec(ScrnInfoPtr pScrn);
+static void
+VESADisplayPowerManagementSet(ScrnInfoPtr pScrn, int mode,
+ int flags);
+
/* locally used functions */
static int VESAFindIsaDevice(GDevPtr dev);
static Bool VESAMapVidMem(ScrnInfoPtr pScrn);
@@ -124,7 +128,7 @@ typedef enum {
OPTION_SHADOW_FB
} VESAOpts;
-static OptionInfoRec VESAOptions[] = {
+static const OptionInfoRec VESAOptions[] = {
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -218,8 +222,7 @@ vesaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
#endif
-static
-OptionInfoPtr
+static const OptionInfoRec *
VESAAvailableOptions(int chipid, int busid)
{
return (VESAOptions);
@@ -363,7 +366,7 @@ VESAFreeRec(ScrnInfoPtr pScrn)
{
VESAPtr pVesa = VESAGetRec(pScrn);
DisplayModePtr mode = pScrn->modes;
-
+#if 0
/* I am not sure if the modes will ever get freed.
* Anyway, the data unknown to other modules is being freed here.
*/
@@ -382,6 +385,7 @@ VESAFreeRec(ScrnInfoPtr pScrn)
mode = mode->next;
} while (mode && mode != pScrn->modes);
}
+#endif
xfree(pVesa->monitor);
xfree(pVesa->vbeInfo);
xfree(pVesa->pal);
@@ -417,6 +421,11 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
pVesa->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
pVesa->device = xf86GetDevFromEntity(pScrn->entityList[0],
pScrn->entityInstanceList[0]);
+
+ /* Load vgahw module */
+ if (!xf86LoadSubModule(pScrn, "vgahw"))
+ return (FALSE);
+
/* Load vbe module */
if ((pVbeModule = xf86LoadSubModule(pScrn, "vbe")) == NULL)
return (FALSE);
@@ -753,10 +762,13 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
/* options */
xf86CollectOptions(pScrn, NULL);
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, VESAOptions);
+ if (!(pVesa->Options = xalloc(sizeof(VESAOptions))))
+ return FALSE;
+ memcpy(pVesa->Options, VESAOptions, sizeof(VESAOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pVesa->Options);
/* Use shadow by default */
- if (xf86ReturnOptValBool(VESAOptions, OPTION_SHADOW_FB, TRUE))
+ if (xf86ReturnOptValBool(pVesa->Options, OPTION_SHADOW_FB, TRUE))
pVesa->shadowFB = TRUE;
mode = ((ModeInfoData*)pScrn->modes->Private)->data;
@@ -1071,6 +1083,12 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScreen->CloseScreen = VESACloseScreen;
pScreen->SaveScreen = VESASaveScreen;
+ xf86DPMSInit(pScreen, VESADisplayPowerManagementSet, 0);
+
+ /* Report any unused options (only for the first generation) */
+ if (serverGeneration == 1)
+ xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
+
return (TRUE);
}
@@ -1093,17 +1111,20 @@ VESACloseScreen(int scrnIndex, ScreenPtr pScreen)
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
VESAPtr pVesa = VESAGetRec(pScrn);
- VESASaveRestore(xf86Screens[scrnIndex], MODE_RESTORE);
- VBESetGetPaletteData(pVesa->pVbe, TRUE, 0, 256,
- pVesa->savedPal, FALSE, TRUE);
-
- VESAUnmapVidMem(pScrn);
+ if (pScrn->vtSema) {
+ VESASaveRestore(xf86Screens[scrnIndex], MODE_RESTORE);
+ VBESetGetPaletteData(pVesa->pVbe, TRUE, 0, 256,
+ pVesa->savedPal, FALSE, TRUE);
+ VESAUnmapVidMem(pScrn);
+ }
if (pVesa->shadowPtr) {
xfree(pVesa->shadowPtr);
pVesa->shadowPtr = NULL;
}
- if (pVesa->pDGAMode)
+ if (pVesa->pDGAMode) {
xfree(pVesa->pDGAMode);
+ pVesa->pDGAMode = NULL;
+ }
pScrn->vtSema = FALSE;
pScreen->CloseScreen = pVesa->CloseScreen;
@@ -1627,6 +1648,15 @@ VESASaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function)
return (TRUE);
}
+static void
+VESADisplayPowerManagementSet(ScrnInfoPtr pScrn, int mode,
+ int flags)
+{
+ vgaHWDPMSSet(pScrn, mode, flags);
+}
+
+
+
/***********************************************************************
* DGA stuff
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h
index 1762da648..08b10a531 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h
@@ -26,7 +26,7 @@
*
* Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.8 2001/03/22 03:10:58 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.9 2001/05/04 19:05:49 dawes Exp $
*/
#ifndef _VESA_H_
@@ -113,6 +113,7 @@ typedef struct _VESARec
DGAModePtr pDGAMode;
int nDGAMode;
CloseScreenProcPtr CloseScreen;
+ OptionInfoPtr Options;
} VESARec, *VESAPtr;
typedef struct _ModeInfoData {
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile
index 43907960f..25bcd13bb 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile
@@ -4,7 +4,7 @@ XCOMM $XConsortium: Imakefile /main/6 1996/09/28 17:29:38 rws $
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile,v 1.11 2001/01/24 00:06:33 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile,v 1.12 2001/05/16 06:48:11 keithp Exp $
@@ -19,8 +19,9 @@ OBJS = generic.o
#if defined(XF86DriverSDK)
INCLUDES = -I. -I../../include
#else
-INCLUDES = -I. -I$(SERVERSRC)/cfb -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \
+INCLUDES = -I. -I$(SERVERSRC)/fb -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \
-I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi -I$(XF86SRC)/vgahw \
+ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render -I$(EXTINCSRC)\
-I$(XF86COMSRC) -I$(XF86OSSRC) \
-I$(SERVERSRC)/include -I$(FONTINCSRC) -I$(XINCLUDESRC)\
-I$(XF86SRC)/rac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c b/xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c
index 0b579128d..327c9a0ff 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c,v 1.52 2001/02/16 01:45:46 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c,v 1.54 2001/05/16 06:48:11 keithp Exp $ */
/*
* Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
*
@@ -43,10 +43,7 @@
#include "vgaHW.h"
#include "xf86PciInfo.h"
-#undef PSZ
-#define PSZ 8
-#include "cfb.h"
-#undef PSZ
+#include "fb.h"
#include "xf4bpp.h"
#include "xf1bpp.h"
@@ -74,7 +71,7 @@
/* Forward definitions */
-static OptionInfoPtr GenericAvailableOptions(int chipid, int busid);
+static const OptionInfoRec * GenericAvailableOptions(int chipid, int busid);
static void GenericIdentify(int);
static Bool GenericProbe(DriverPtr, int);
static Bool GenericPreInit(ScrnInfoPtr, int);
@@ -108,7 +105,7 @@ typedef enum {
OPTION_VGA_CLOCKS
} GenericOpts;
-static OptionInfoRec GenericOptions[] = {
+static const OptionInfoRec GenericOptions[] = {
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_VGA_CLOCKS, "VGAClocks", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
@@ -130,8 +127,10 @@ static const char *vgahwSymbols[] = {
static const char *fbSymbols[] = {
"xf1bppScreenInit",
"xf4bppScreenInit",
- "cfbScreenInit",
- "mfbScreenInit",
+ "fbScreenInit",
+#ifdef RENDER
+ "fbPictureInit",
+#endif
NULL
};
@@ -218,8 +217,7 @@ GenericIdentify(int flags)
GenericChipsets);
}
-static
-OptionInfoPtr
+static const OptionInfoRec *
GenericAvailableOptions(int chipid, int busid)
{
return GenericOptions;
@@ -380,6 +378,7 @@ typedef struct _GenericRec
CARD8 * ShadowPtr;
CARD32 ShadowPitch;
CloseScreenProcPtr CloseScreen;
+ OptionInfoPtr Options;
} GenericRec, *GenericPtr;
@@ -493,13 +492,7 @@ GenericPreInit(ScrnInfoPtr pScreenInfo, int flags)
{
case 1: Module = "xf1bpp"; Sym = "xf1bppScreenInit"; break;
case 4: Module = "xf4bpp"; Sym = "xf4bppScreenInit"; break;
- case 8: Module = "cfb"; Sym = "cfbScreenInit"; break;
-
- default:
- xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
- "Given depth (%d) is not supported by this driver.\n",
- pScreenInfo->depth);
- return FALSE;
+ default: Module = "fb"; Sym = "fbScreenInit"; break;
}
xf86PrintDepthBpp(pScreenInfo);
@@ -579,6 +572,15 @@ GenericPreInit(ScrnInfoPtr pScreenInfo, int flags)
pvgaHW->MapSize = 0x00010000; /* Standard 64kB VGA window */
vgaHWGetIOBase(pvgaHW); /* Get VGA I/O base */
+ /* Deal with options */
+ xf86CollectOptions(pScreenInfo, NULL);
+
+ if (!(pGenericPriv->Options = xalloc(sizeof(GenericOptions))))
+ return FALSE;
+ memcpy(pGenericPriv->Options, GenericOptions, sizeof(GenericOptions));
+ xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options,
+ pGenericPriv->Options);
+
#ifndef __NOT_YET__
if (pScreenInfo->depth == 8)
{
@@ -588,11 +590,6 @@ GenericPreInit(ScrnInfoPtr pScreenInfo, int flags)
}
#endif
- /* Deal with options */
- xf86CollectOptions(pScreenInfo, NULL);
- xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options,
- GenericOptions);
-
/*
* Determine clocks. Limit them to the first four because that's all that
* can be addressed.
@@ -604,7 +601,7 @@ GenericPreInit(ScrnInfoPtr pScreenInfo, int flags)
for (i = 0; i < pScreenInfo->numClocks; i++)
pScreenInfo->clock[i] = pEnt->device->clock[i];
From = X_CONFIG;
- } else if (xf86ReturnOptValBool(GenericOptions,OPTION_VGA_CLOCKS,FALSE)) {
+ } else if (xf86ReturnOptValBool(pGenericPriv->Options,OPTION_VGA_CLOCKS,FALSE)) {
pScreenInfo->numClocks = 2;
pScreenInfo->clock[0] = 25175;
pScreenInfo->clock[1] = 28322;
@@ -673,17 +670,14 @@ GenericPreInit(ScrnInfoPtr pScreenInfo, int flags)
/* Set display resolution */
xf86SetDpi(pScreenInfo, 0, 0);
- if (xf86ReturnOptValBool(GenericOptions,OPTION_SHADOW_FB,FALSE)) {
+ if (xf86ReturnOptValBool(pGenericPriv->Options,OPTION_SHADOW_FB,FALSE)) {
pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
pGenericPriv->ShadowFB = TRUE;
xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
"Using \"Shadow Framebuffer\"\n");
- switch (pScreenInfo->depth)
- {
- case 1: Module = "mfb"; Sym = "mfbScreenInit"; break;
- case 4: Module = "cfb"; Sym = "cfbScreenInit"; break;
- }
+ Module = "fb";
+ Sym = "fbScreenInit";
if (!xf86LoadSubModule(pScreenInfo, "shadowfb"))
return FALSE;
xf86LoaderReqSymLists(shadowfbSymbols, NULL);
@@ -1077,6 +1071,8 @@ GenericScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScreenInfo->rgbBits, pScreenInfo->defaultVisual))
return FALSE;
+ miSetPixmapDepths ();
+
/* Initialise the framebuffer */
switch (pScreenInfo->depth)
{
@@ -1088,11 +1084,15 @@ GenericScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScreenInfo->virtualY);
if(pGenericPriv->ShadowPtr == NULL)
return FALSE;
- Inited = mfbScreenInit(pScreen, pGenericPriv->ShadowPtr,
- pScreenInfo->virtualX,
- pScreenInfo->virtualY,
- pScreenInfo->xDpi, pScreenInfo->yDpi,
- pScreenInfo->displayWidth);
+ Inited = fbScreenInit(pScreen, pGenericPriv->ShadowPtr,
+ pScreenInfo->virtualX,
+ pScreenInfo->virtualY,
+ pScreenInfo->xDpi, pScreenInfo->yDpi,
+ pScreenInfo->displayWidth,
+ pScreenInfo->bitsPerPixel);
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
ShadowFBInit(pScreen, GenericRefreshArea1bpp);
} else {
Inited = xf1bppScreenInit(pScreen, pvgaHW->Base,
@@ -1111,11 +1111,15 @@ GenericScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScreenInfo->virtualY);
if(pGenericPriv->ShadowPtr == NULL)
return FALSE;
- Inited = cfbScreenInit(pScreen, pGenericPriv->ShadowPtr,
- pScreenInfo->virtualX,
- pScreenInfo->virtualY,
- pScreenInfo->xDpi, pScreenInfo->yDpi,
- pScreenInfo->displayWidth);
+ Inited = fbScreenInit(pScreen, pGenericPriv->ShadowPtr,
+ pScreenInfo->virtualX,
+ pScreenInfo->virtualY,
+ pScreenInfo->xDpi, pScreenInfo->yDpi,
+ pScreenInfo->displayWidth,
+ pScreenInfo->bitsPerPixel);
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
ShadowFBInit(pScreen, GenericRefreshArea4bpp);
} else {
Inited = xf4bppScreenInit(pScreen, pvgaHW->Base,
@@ -1126,10 +1130,14 @@ GenericScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
break;
case 8:
- Inited = cfbScreenInit(pScreen, pvgaHW->Base,
- pScreenInfo->virtualX, pScreenInfo->virtualY,
- pScreenInfo->xDpi, pScreenInfo->yDpi,
- pScreenInfo->displayWidth);
+ Inited = fbScreenInit(pScreen, pvgaHW->Base,
+ pScreenInfo->virtualX, pScreenInfo->virtualY,
+ pScreenInfo->xDpi, pScreenInfo->yDpi,
+ pScreenInfo->displayWidth,
+ pScreenInfo->bitsPerPixel);
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
break;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile
index df44030f8..0853a3bb5 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile,v 1.1 2001/04/05 19:29:43 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile,v 1.2 2001/05/16 06:48:12 keithp Exp $
XCOMM
XCOMM This is an Imakefile for the VMware virtual SVGA driver.
XCOMM
@@ -20,17 +20,17 @@ OBJS = vmware.o vmwaregc.o vmwarefs.o vmwarepolypnt.o vmwarepush.o \
INCLUDES = -I. -I../../include
#else
INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
- -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi -I$(XF86SRC)/int10 \
- -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \
+ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(XF86SRC)/int10 \
+ -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \
-I$(XF86SRC)/vgahw -I$(XF86SRC)/fbdevhw \
-I$(XF86SRC)/ramdac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \
- -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf8_32bpp\
+ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \
-I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
- -I$(XF86SRC)/xf24_32bpp -I$(XF86SRC)/shadowfb -I$(EXTINCSRC) \
+ -I$(XF86SRC)/shadowfb -I$(EXTINCSRC) \
-I$(XF86OSSRC)/vbe $(DRIINCLUDES)
#endif
-DEFINES = -DPSZ=8 $(DRIDEFINES)
+DEFINES = $(DRIDEFINES)
#if MakeHasPosixVariableSubstitutions
SubdirLibraryRule($(OBJS))
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c
index 04ca7f8bf..f624d5af0 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c
@@ -7,7 +7,7 @@ char rcsId_vmware[] =
"Id: vmware.c,v 1.11 2001/02/23 02:10:39 yoel Exp $";
#endif
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c,v 1.1 2001/04/05 19:29:44 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c,v 1.4 2001/05/16 06:48:12 keithp Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -23,12 +23,7 @@ char rcsId_vmware[] =
#include "mibstore.h" /* backing store */
#include "micmap.h" /* mi color map */
#include "vgaHW.h" /* VGA hardware */
-#define PSZ 8 /* 8bpp */
-#include "cfb.h"
-#undef PSZ
-#include "cfb16.h" /* 16bpp */
-#include "cfb24.h" /* 24bpp */
-#include "cfb32.h" /* 32bpp */
+#include "fb.h"
#include "xf86cmap.h" /* xf86HandleColormaps */
@@ -113,14 +108,12 @@ typedef enum {
OPTION_NOACCEL
} VMWAREOpts;
-static OptionInfoRec VMWAREOptions[] = {
+static const OptionInfoRec VMWAREOptions[] = {
{ OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
-#define nVMWAREOptions (sizeof(VMWAREOptions) / sizeof(VMWAREOptions[0]))
-
static Bool
VMWAREGetRec(ScrnInfoPtr pScrn)
{
@@ -332,7 +325,7 @@ VMWAREIdentify(int flags)
xf86PrintChipsets(VMWARE_NAME, "driver for VMware SVGA", VMWAREChipsets);
}
-static OptionInfoPtr
+static const OptionInfoRec *
VMWAREAvailableOptions(int chipid, int busid)
{
return VMWAREOptions;
@@ -343,13 +336,16 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
{
MessageType from;
VMWAREPtr pVMWARE;
- OptionInfoRec options[nVMWAREOptions];
+ OptionInfoPtr options;
int bpp24flags;
uint32 id;
int i;
- const char* mod;
ClockRange* clockRanges;
+ if (flags & PROBE_DETECT) {
+ return FALSE;
+ }
+
if (pScrn->numEntities != 1) {
return FALSE;
}
@@ -531,6 +527,8 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
#endif
xf86CollectOptions(pScrn, NULL);
+ if (!(options = xalloc(sizeof(VMWAREOptions))))
+ return FALSE;
memcpy(options, VMWAREOptions, sizeof(VMWAREOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
@@ -567,6 +565,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
}
pScrn->videoRam = pVMWARE->videoRam / 1024;
pScrn->memPhysBase = pVMWARE->memPhysBase;
+ xfree(options);
{
Gamma zeros = { 0.0, 0.0, 0.0 };
@@ -614,17 +613,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->currentMode = pScrn->modes;
xf86PrintModes(pScrn);
xf86SetDpi(pScrn, 0, 0);
- switch (pScrn->bitsPerPixel) {
- case 8: mod = "cfb"; break;
- case 16:mod = "cfb16"; break;
- case 24:mod = "cfb24"; break;
- case 32:mod = "cfb32"; break;
- default:
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unexpected bpp (%d)\n", pScrn->bitsPerPixel);
- VMWAREFreeRec(pScrn);
- return FALSE;
- }
- if (mod && !xf86LoadSubModule(pScrn, mod)) {
+ if (!xf86LoadSubModule(pScrn, "fb")) {
VMWAREFreeRec(pScrn);
return FALSE;
}
@@ -883,68 +872,25 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
}
+ miSetPixmapDepths ();
+
/*
* Initialise the framebuffer.
*/
- switch (pScrn->bitsPerPixel) {
-#if 0
- case 1:
- ret = xf1bppScreenInit(pScreen, pVMWARE->FbBase,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- case 4:
- ret = xf4bppScreenInit(pScreen, pVMWARE->FbBase,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
-#endif
- case 8:
- /*
- * In ScreenToPrivate, below, we register our own
- * CopyPlane proc (via mfbRegisterCopyPlaneProc).
- * But we can't handle all cases, so we have to stash
- * away a pointer to someone who can.
- */
- pVMWARE->pcfbCopyPlane = cfbCopyPlane;
- ret = cfbScreenInit(pScreen, pVMWARE->FbBase + pVMWARE->fbOffset,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- case 16:
- pVMWARE->pcfbCopyPlane = cfb16CopyPlane;
- ret = cfb16ScreenInit(pScreen, pVMWARE->FbBase + pVMWARE->fbOffset,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- case 24:
- pVMWARE->pcfbCopyPlane = cfb24CopyPlane;
- ret = cfb24ScreenInit(pScreen, pVMWARE->FbBase + pVMWARE->fbOffset,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- case 32:
- pVMWARE->pcfbCopyPlane = cfb32CopyPlane;
- ret = cfb32ScreenInit(pScreen, pVMWARE->FbBase + pVMWARE->fbOffset,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth);
- break;
- default:
- xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) in VMWAREScreenInit\n",
- pScrn->bitsPerPixel);
- ret = FALSE;
- break;
- }
+ ret = fbScreenInit (pScreen, pVMWARE->FbBase,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth,
+ pScrn->bitsPerPixel);
+
if (!ret)
return FALSE;
+#ifdef RENDER
+ fbPictureInit (pScreen, 0, 0);
+#endif
+
/* Override the default mask/offset settings */
if (pScrn->bitsPerPixel > 8) {
int i;
@@ -993,23 +939,8 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
}
- /* Initialise the default colourmap */
- switch (pScrn->depth) {
-#if 0
- case 1:
- if (!xf1bppCreateDefColormap(pScreen))
- return FALSE;
- break;
- case 4:
- if (!xf4bppCreateDefColormap(pScreen))
- return FALSE;
- break;
-#endif
- default:
- if (!cfbCreateDefColormap(pScreen))
- return FALSE;
- break;
- }
+ if (!fbCreateDefColormap(pScreen))
+ return FALSE;
if (!xf86HandleColormaps(pScreen, 256, 8,
VMWARELoadPalette, NULL,
@@ -1091,7 +1022,12 @@ VMWAREProbe(DriverPtr drv, int flags)
numUsed = xf86MatchPciInstances(VMWARE_NAME, PCI_VENDOR_VMWARE,
VMWAREChipsets, VMWAREPciChipsets, devSections,
numDevSections, drv, &usedChips);
- for (i = 0; i < numUsed; i++) {
+ xfree(devSections);
+ if (numUsed <= 0)
+ return FALSE;
+ if (flags & PROBE_DETECT)
+ foundScreen = TRUE;
+ else for (i = 0; i < numUsed; i++) {
ScrnInfoPtr pScrn = NULL;
VmwareLog(("Even some VMware SVGA PCI instances exists\n"));
@@ -1115,11 +1051,8 @@ VMWAREProbe(DriverPtr drv, int flags)
foundScreen = TRUE;
}
}
- if (numUsed > 0) {
- xfree(usedChips);
- }
+ xfree(usedChips);
}
- xfree(devSections);
return foundScreen;
}
@@ -1250,7 +1183,6 @@ ScreenToPrivate(ScreenPtr pScreen, ScrnInfoPtr pScrn)
#endif
- mfbRegisterCopyPlaneProc(pScreen, vmwareCopyPlane);
pScreen->PaintWindowBackground = vmwarePaintWindow;
pScreen->PaintWindowBorder = vmwarePaintWindow;
pScreen->CopyWindow = vmwareCopyWindow;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h
index ab42e10f1..7a169c728 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h
@@ -3,7 +3,7 @@
* All Rights Reserved
* Id: vmware.h,v 1.6 2001/01/30 18:13:47 bennett Exp $
* **********************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h,v 1.1 2001/04/05 19:29:44 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h,v 1.2 2001/05/16 06:48:12 keithp Exp $ */
#ifndef VMWARE_H
#define VMWARE_H
@@ -22,12 +22,7 @@
#include "mibstore.h" /* backing store */
#include "micmap.h" /* mi color map */
#include "vgaHW.h" /* VGA hardware */
-#define PSZ 8 /* 8bpp */
-#include "cfb.h"
-#undef PSZ
-#include "cfb16.h" /* 16bpp */
-#include "cfb24.h" /* 24bpp */
-#include "cfb32.h" /* 32bpp */
+#include "fb.h"
#include "xf86cmap.h" /* xf86HandleColormaps */
@@ -95,9 +90,6 @@ typedef struct {
uint16 indexReg, valueReg;
- RegionPtr (*pcfbCopyPlane) (DrawablePtr, DrawablePtr, GCPtr,
- int, int, int, int, int, int,
- unsigned long);
ScreenRec ScrnFuncs;
/* ... */
} VMWARERec, *VMWAREPtr;
@@ -631,12 +623,18 @@ void vmwarePutImage(
#endif
);
-void vmwareDoBitblt(DrawablePtr pSrc,
-#if NeedFunctionPrototypes
- DrawablePtr pDst,
- int alu, RegionPtr prgnDst, DDXPointPtr pptSrc, unsigned long planemask, unsigned long bitplane
-#endif
- );
+void
+vmwareDoBitblt(DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ BoxPtr pbox,
+ int nbox,
+ int dx,
+ int dy,
+ Bool reverse,
+ Bool upsidedown,
+ Pixel bitplane,
+ void *closure);
RegionPtr vmwareCopyArea(
#if NeedFunctionPrototypes
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c
index f081a3b31..de23b6c51 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c
@@ -7,76 +7,66 @@ char rcsId_vmwareblt[] =
"Id: vmwareblt.c,v 1.4 2001/01/27 00:28:15 bennett Exp $";
#endif
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c,v 1.1 2001/04/05 19:29:44 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c,v 1.2 2001/05/16 06:48:12 keithp Exp $ */
#include "X.h"
-#include "cfb.h"
+#include "fb.h"
#include "vmware.h"
void
-vmwareDoBitblt(DrawablePtr pSrc,
- DrawablePtr pDst,
- int alu, RegionPtr prgnDst, DDXPointPtr pptSrc, unsigned long planemask, unsigned long bitplane)
+vmwareDoBitblt(DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ BoxPtr pbox,
+ int nbox,
+ int dx,
+ int dy,
+ Bool reverse,
+ Bool upsidedown,
+ Pixel bitplane,
+ void *closure)
{
- BoxPtr pbox;
- int nbox;
BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
- DDXPointPtr pptTmp, pptNew1, pptNew2;
VMWAREPtr pVMWARE;
+ CARD8 alu;
pVMWARE = VMWAREPTR(infoFromScreen(pSrc->pScreen));
+ if (pGC)
+ alu = pGC->alu;
+ else
+ alu = GXcopy;
- pbox = REGION_RECTS(prgnDst);
- nbox = REGION_NUM_RECTS(prgnDst);
pboxNew1 = NULL;
- pptNew1 = NULL;
pboxNew2 = NULL;
- pptNew2 = NULL;
- if (pptSrc->y < pbox->y1) {
+ if (upsidedown) {
if (nbox > 1) {
/* keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
if (!pboxNew1)
return;
- pptNew1 =
- (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if (!pptNew1) {
- DEALLOCATE_LOCAL(pboxNew1);
- return;
- }
pboxBase = pboxNext = pbox + nbox - 1;
while (pboxBase >= pbox) {
while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1))
pboxNext--;
pboxTmp = pboxNext + 1;
- pptTmp = pptSrc + (pboxTmp - pbox);
while (pboxTmp <= pboxBase) {
*pboxNew1++ = *pboxTmp++;
- *pptNew1++ = *pptTmp++;
}
pboxBase = pboxNext;
}
pboxNew1 -= nbox;
pbox = pboxNew1;
- pptNew1 -= nbox;
- pptSrc = pptNew1;
}
}
- if (pptSrc->x < pbox->x1) {
+ if (reverse) {
if (nbox > 1) {
/* reverse order of rects in each band */
pboxNew2 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
- pptNew2 =
- (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
- if (!pboxNew2 || !pptNew2) {
- if (pptNew2)
- DEALLOCATE_LOCAL(pptNew2);
+ if (!pboxNew2) {
if (pboxNew2)
DEALLOCATE_LOCAL(pboxNew2);
- if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
+ if (pboxNew1)
DEALLOCATE_LOCAL(pboxNew1);
- }
return;
}
pboxBase = pboxNext = pbox;
@@ -84,38 +74,31 @@ vmwareDoBitblt(DrawablePtr pSrc,
while ((pboxNext < pbox + nbox) &&
(pboxNext->y1 == pboxBase->y1)) pboxNext++;
pboxTmp = pboxNext;
- pptTmp = pptSrc + (pboxTmp - pbox);
while (pboxTmp != pboxBase) {
*pboxNew2++ = *--pboxTmp;
- *pptNew2++ = *--pptTmp;
}
pboxBase = pboxNext;
}
pboxNew2 -= nbox;
pbox = pboxNew2;
- pptNew2 -= nbox;
- pptSrc = pptNew2;
}
}
/* Send the commands */
while (nbox--) {
vmwareWriteWordToFIFO(pVMWARE, SVGA_CMD_RECT_ROP_COPY);
- vmwareWriteWordToFIFO(pVMWARE, pptSrc->x);
- vmwareWriteWordToFIFO(pVMWARE, pptSrc->y);
+ vmwareWriteWordToFIFO(pVMWARE, pbox->x1 + dx);
+ vmwareWriteWordToFIFO(pVMWARE, pbox->y1 + dy);
vmwareWriteWordToFIFO(pVMWARE, pbox->x1);
vmwareWriteWordToFIFO(pVMWARE, pbox->y1);
vmwareWriteWordToFIFO(pVMWARE, pbox->x2 - pbox->x1);
vmwareWriteWordToFIFO(pVMWARE, pbox->y2 - pbox->y1);
- vmwareWriteWordToFIFO(pVMWARE, alu);
- pptSrc++;
+ vmwareWriteWordToFIFO(pVMWARE, pGC->alu);
pbox++;
}
if (pboxNew2) {
- DEALLOCATE_LOCAL(pptNew2);
DEALLOCATE_LOCAL(pboxNew2);
}
if (pboxNew1) {
- DEALLOCATE_LOCAL(pptNew1);
DEALLOCATE_LOCAL(pboxNew1);
}
}
@@ -134,7 +117,7 @@ GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty)
pSrcDrawable->type == DRAWABLE_WINDOW &&
pDstDrawable->type == DRAWABLE_WINDOW &&
(pGC->planemask & pVMWARE->Pmsk) == pVMWARE->Pmsk) {
- void (*doBitBlt) (DrawablePtr, DrawablePtr, int, RegionPtr, DDXPointPtr, unsigned long, unsigned long);
+ fbCopyProc doBitBlt;
BoxRec updateBB;
BoxRec mouseBB;
Bool hidden = pVMWARE->mouseHidden;
@@ -151,9 +134,8 @@ GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty)
if (!hidden) {
HIDE_CURSOR_ACCEL(pVMWARE, mouseBB);
}
- prgn =
- cfbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width,
- height, dstx, dsty, doBitBlt, 0L);
+ prgn = fbDoCopy (pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width,
+ height, dstx, dsty, doBitBlt, 0, 0);
if (!hidden) {
SHOW_CURSOR(pVMWARE, mouseBB);
}
@@ -257,10 +239,9 @@ int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long bit
HIDE_CURSOR(pVMWARE, mouseBB);
vmwareWaitForFB(pVMWARE);
pVMWARE->vmwareBBLevel++;
- prgn =
- pVMWARE->pcfbCopyPlane(pSrcDrawable,
- pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty,
- bitPlane);
+ prgn = fbCopyPlane(pSrcDrawable,
+ pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty,
+ bitPlane);
pVMWARE->vmwareBBLevel--;
if (pDstDrawable->type == DRAWABLE_WINDOW) {
vmwareSendSVGACmdUpdate(pVMWARE, &updateBB);
@@ -268,15 +249,13 @@ int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long bit
SHOW_CURSOR(pVMWARE, mouseBB);
} else {
vmwareWaitForFB(pVMWARE);
- prgn =
- pVMWARE->pcfbCopyPlane(pSrcDrawable,
- pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty,
- bitPlane);
+ prgn = fbCopyPlane(pSrcDrawable,
+ pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty,
+ bitPlane);
}
} else {
- prgn =
- pVMWARE->pcfbCopyPlane(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
+ prgn = fbCopyPlane(pSrcDrawable, pDstDrawable,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
}
return prgn;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c
index cad0109e6..ea23e10b0 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c
@@ -7,13 +7,10 @@ char rcsId_vmwaregc[] =
"Id: vmwaregc.c,v 1.2 2001/01/26 23:32:16 yoel Exp $";
#endif
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c,v 1.1 2001/04/05 19:29:44 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c,v 1.2 2001/05/16 06:48:12 keithp Exp $ */
#include "X.h"
-#include "cfb.h"
-#include "cfb16.h"
-#include "cfb24.h"
-#include "cfb32.h"
+#include "fb.h"
#include "mi.h"
#include "migc.h"
#include "vmware.h"
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c
index 00a9517e7..1ae60ab36 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c
@@ -7,10 +7,10 @@ char rcsId_vmwarerect[] =
"Id: vmwarerect.c,v 1.2 2001/01/26 23:32:16 yoel Exp $";
#endif
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c,v 1.1 2001/04/05 19:29:44 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c,v 1.2 2001/05/16 06:48:12 keithp Exp $ */
#include "X.h"
-#include "cfb.h"
+#include "fb.h"
#include "vmware.h"
static void
@@ -93,13 +93,11 @@ accelPolyFillRect(VMWAREPtr pVMWARE, DrawablePtr pDrawable,
BoxPtr pboxClippedBase;
BoxPtr pextent;
BoxRec stackRects[NUM_STACK_RECTS];
- cfbPrivGC *priv;
int numRects;
int n;
int xorg, yorg;
- priv = cfbGetGCPrivate(pGC);
- prgnClip = cfbGetCompositeClip(pGC);
+ prgnClip = fbGetCompositeClip(pGC);
prect = prectInit;
xorg = pDrawable->x;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c
index 45bc3d75d..fee8b36ef 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c
@@ -7,19 +7,15 @@ char rcsId_vmwarewindow[] =
"Id: vmwarewindow.c,v 1.4 2001/01/27 00:28:15 bennett Exp $";
#endif
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c,v 1.1 2001/04/05 19:29:44 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c,v 1.2 2001/05/16 06:48:12 keithp Exp $ */
#include "vmware.h"
void
vmwareCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
- DDXPointPtr pptSrc;
- register DDXPointPtr ppt;
RegionRec rgnDst;
- BoxPtr pbox;
int dx, dy;
- int i, nbox;
WindowPtr pwinRoot;
BoxPtr pBB;
@@ -37,26 +33,15 @@ vmwareCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip,
prgnSrc);
- pbox = REGION_RECTS(&rgnDst);
- nbox = REGION_NUM_RECTS(&rgnDst);
- if (!nbox ||
- !(pptSrc =
- (DDXPointPtr) ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
- REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
- return;
- }
- ppt = pptSrc;
- for (i = nbox; --i >= 0; ppt++, pbox++) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- }
pBB = REGION_EXTENTS(pWin->drawable.pScreen, &rgnDst);
HIDE_CURSOR_ACCEL(pVMWARE, *pBB);
- vmwareDoBitblt((DrawablePtr) pwinRoot, (DrawablePtr) pwinRoot,
- GXcopy, &rgnDst, pptSrc, ~0L, 0);
+
+ fbCopyRegion ((DrawablePtr) pwinRoot, (DrawablePtr) pwinRoot,
+ 0,
+ &rgnDst, dx, dy, vmwareDoBitblt, 0, 0);
+
SHOW_CURSOR(pVMWARE, *pBB);
UPDATE_ACCEL_AREA(pVMWARE, *pBB);
- DEALLOCATE_LOCAL(pptSrc);
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
}
diff --git a/xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c b/xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c
index 60c024c09..a16126842 100644
--- a/xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c
+++ b/xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c,v 1.2 2000/12/07 15:43:45 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c,v 1.3 2001/05/15 10:19:41 eich Exp $ */
#include "X.h"
#include "os.h"
@@ -10,7 +10,7 @@
*/
memType
-getValidBIOSBase(PCITAG tag, int *num)
+getValidBIOSBase(PCITAG tag, int num)
{
return 0;
}
diff --git a/xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c b/xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c
index 94f492200..dd00635b0 100644
--- a/xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c
+++ b/xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c,v 1.2 2001/05/04 19:05:50 dawes Exp $ */
#include "X.h"
#include "os.h"
@@ -15,7 +15,7 @@ xf86ProcessOptions(int i, pointer p, OptionInfoPtr o)
}
Bool
-xf86GetOptValBool(OptionInfoPtr o, int i, Bool *b)
+xf86GetOptValBool(const OptionInfoRec *o, int i, Bool *b)
{
return FALSE;
}
diff --git a/xc/programs/Xserver/hw/xfree86/etc/Imakefile b/xc/programs/Xserver/hw/xfree86/etc/Imakefile
index 842334b2d..f719acd6d 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/etc/Imakefile
@@ -4,7 +4,7 @@ XCOMM $XConsortium: Imakefile /main/24 1996/10/28 04:24:12 kaleb $
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/etc/Imakefile,v 3.38 2001/03/21 17:36:47 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/etc/Imakefile,v 3.38.2.1 2001/05/29 14:41:54 dawes Exp $
#include <Server.tmpl>
#if SystemV
@@ -44,10 +44,8 @@ XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/etc/Imakefile,v 3.38 2001/03/21 1
#endif
#if !BuildServersOnly && BuildClients
-#ifdef SunArchitecture
- TERMFILES = xterm.termcap xterm.terminfo
-#else
- TERMFILES = sun.termcap sun.terminfo xterm.termcap xterm.terminfo
+#ifndef SunArchitecture
+ TERMFILES = sun.termcap sun.terminfo
#endif
#endif
@@ -128,11 +126,6 @@ InstallNamedProg(svr4_patch,svr4_patch,$(LIBDIR)/etc)
InstallNamedProg(svr4_rem_pch,svr4_patch_rem,$(LIBDIR)/etc)
#endif
-#if !BuildServersOnly && BuildClients
-LinkFile(xterm.termcap,$(PROGRAMSRC)/xterm/termcap)
-LinkFile(xterm.terminfo,$(PROGRAMSRC)/xterm/terminfo)
-#endif
-
LinkFile(sun.termcap,sun.tcap)
LinkFile(sun.terminfo,sun.tinfo)
diff --git a/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh b/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh
index cce2b17a2..a8ff3fffb 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh
+++ b/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh
@@ -1,13 +1,13 @@
#!/bin/sh
#
-# $XFree86: xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh,v 1.20 2001/04/19 16:07:11 dawes Exp $
+# $XFree86: xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh,v 1.20.2.4 2001/06/01 17:16:57 dawes Exp $
#
# Copyright © 2000 by Precision Insight, Inc.
-# Copyright © 2000 by VA Linux Systems, Inc.
+# Copyright © 2000, 2001 by VA Linux Systems, Inc.
# Portions Copyright © 1996-2000 by The XFree86 Project, Inc.
#
-# This script should be used to install XFree86 4.0.2.
+# This script should be used to install XFree86 4.1.0.
#
# Parts of this script are based on the old preinst.sh and postinst.sh
# scripts.
@@ -17,23 +17,47 @@
# Authors: David Dawes <dawes@xfree86.org>
#
-VERSION=4.0.2
+# Fallbacks for when the bindist version can't be auto-detected.
+# These should be updated for each release.
-RUNDIR=/usr/X11R6
-ETCDIR=/etc/X11
-VARDIR=/var
+FULLPREFIX=4.1
+PATCHLEVEL=0
+VERSION=$FULLPREFIX.$PATCHLEVEL
+FULLVERSION=$FULLPREFIX.0
+SCRIPTVERSION=$VERSION
+
+BINDISTFULLPREFIX=
+BINDISTPATCHLEVEL=
+BINDISTVERSION=
+BINDISTFULLVERSION=
+
+ROOTDIR=
+
+TESTROOT=/home1/test
if [ X"$1" = "X-test" -o X"$XINST_TEST" != X ]; then
- RUNDIR=/home1/test/X11R6
- ETCDIR=/home1/test/etcX11
- VARDIR=/home1/test/var
+ ROOTDIR=$TESTROOT
if [ X"$1" = "X-test" ]; then
shift
fi
+ if [ ! -d $TESTROOT ]; then
+ echo "$TESTROOT doesn't exist (for test mode)"
+ exit 1
+ fi
+ for i in usr etc var; do
+ if [ ! -d $TESTROOT/$i ]; then
+ echo "$TESTROOT/$i doesn't exist, creating it"
+ mkdir $TESTROOT/$i
+ fi
+ done
echo ""
echo "Running in test mode"
fi
+RUNDIR=$ROOTDIR/usr/X11R6
+ETCDIR=$ROOTDIR/etc/X11
+VARDIR=$ROOTDIR/var
+
OLDFILES=""
OLDDIRS=" \
@@ -55,6 +79,12 @@ BASEDIST=" \
Xfenc.tgz \
"
+UPDATEDIST=" \
+ Xupdate.tgz \
+ Xdrivers.tgz \
+ Xdocupd.tgz \
+ "
+
ETCDIST="Xetc.tgz"
VARDIST=""
@@ -97,15 +127,25 @@ ETCFLINKS=" \
"
-XKBDIR="/etc/X11/xkb"
+XKBDIR="$ETCDIR/xkb"
+XKBDBDIR=
FONTDIRS=" \
local \
misc
"
+XSERVERCMD="$RUNDIR/bin/XFree86"
+
+VERSIONFILE=".XFree86_Version"
+
WDIR=`pwd`
+DOUPDATE=
+DOBASE=
+
+OPTS=""
+
# Check how to suppress newlines with echo (from perl's Configure)
((echo "xxx\c"; echo " ") > .echotmp) 2> /dev/null
if [ ! -f .echotmp ]; then
@@ -187,6 +227,8 @@ Description()
echo "Docs in PostScript";;
Xaout*)
echo "a.out compatibility libraries";;
+ Xquartz*)
+ echo "Mac OS X Quartz compatible X server";;
*)
echo "unknown";;
esac
@@ -356,16 +398,26 @@ FindDistName()
case "$OsArch" in
Power*)
case "$OsVersion" in
- 1.[2-9])
- DistName="Darwin"
+ 1.[2-9]*)
+ DistName="Darwin-ppc"
+ ;;
+ *)
+ Message="No Darwin/ppc binaries available for this OS version"
+ ;;
+ esac
+ ;;
+ x86*)
+ case "$OsVersion" in
+ 1.[3-9]*)
+ DistName="Darwin-ix86"
;;
*)
- Message="No Darwin binaries available for this OS version"
+ Message="No Darwin/ix86 binaries available for this OS version"
;;
esac
;;
*)
- Message="Darwin binaries are only available for Power Mac platforms"
+ Message="Darwin binaries are not available for this architecture"
;;
esac
;;
@@ -587,6 +639,166 @@ FindDistName()
fi
}
+GetBindistVersion()
+{
+ VERSTARBALL=
+ if [ X$DOBASE = XYES ]; then
+ if [ -f Xbin.tgz ]; then
+ VERSTARBALL=Xbin.tgz
+ fi
+ else
+ if [ X$DOUPDATE = XYES ]; then
+ if [ -f Xupdate.tgz ]; then
+ VERSTARBALL=Xupdate.tgz
+ fi
+ fi
+ fi
+ rm -f $VERSIONFILE
+ if [ X$VERSTARBALL != X ]; then
+ $TAR xzf $VERSTARBALL $VERSIONFILE
+ fi
+ if [ -f $VERSIONFILE ]; then
+ BINDISTVERSION=`cat $VERSIONFILE`
+ echo "Bindist version is $BINDISTVERSION"
+ BINDISTFULLPREFIX=`expr $BINDISTVERSION : '\([0-9]*\.[0-9]*\)\.'`
+ BINDISTPATCHLEVEL=`expr $BINDISTVERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+ BINDISTFULLVERSION=$BINDISTFULLPREFIX.0
+ else
+ echo "Warning: can't detect the bindist version"
+ fi
+
+}
+
+CheckInstallType()
+{
+ # Check for explicit options
+
+ if [ X"$1" != X ]; then
+ case $1 in
+ -update)
+ DOUPDATE=YES
+ DOBASE=NO
+ OPTS="$OPTS $1"
+ shift
+ ;;
+ -base|-full)
+ DOBASE=YES
+ DOUPDATE=NO
+ OPTS="$OPTS $1"
+ shift
+ ;;
+ esac
+ fi
+
+ # Auto-detect based on what files are present
+
+ if [ X"$DOUPDATE" = X ]; then
+ for i in $BASEDIST; do
+ if [ -f $i ]; then
+ DOBASE=YES
+ fi
+ done
+ for i in $UPDATEDIST; do
+ if [ -f $i ]; then
+ DOUPDATE=YES
+ fi
+ done
+ if [ X"$DOBASE" = XYES -a X"$DOUPDATE" = XYES ]; then
+ echo ""
+ echo "You appear to have binaries in the current directory for"
+ echo "both a full release and an update release. The full release"
+ echo "must be installed before installing the update release."
+ echo ""
+ echo "The full release can be installed by re-running this script"
+ echo "with the '-base' option (sh $0 -base)."
+ echo ""
+ echo "The update release can be installed by re-running this script"
+ echo "with the '-update' option (sh $0 -update)."
+ echo ""
+ exit 1
+ fi
+ fi
+ GetBindistVersion
+}
+
+InstallUpdate()
+{
+ # Check that there's an existing installation.
+
+ missingDir=
+
+ for d in $RUNDIR $RUNDIR/lib $RUNDIR/lib/X11 $RUNDIR/bin; do
+ if [ ! -d $d ]; then
+ missingDir="$missingDir $d"
+ fi
+ done
+
+ if [ X$missingDir != X ]; then
+ echo ""
+ echo "You don't appear to have an existing installation of XFree86."
+ echo "You must install the most recent full release ($FULLVERSION)"
+ echo "before installing this update release."
+ echo ""
+ exit 1
+ fi
+
+ if [ -f $XSERVERCMD ]; then
+ existingVer=`$XSERVERCMD -version 2>&1 | grep "XFree86 Version" | \
+ awk '{print $3}'`
+ case $existingVer in
+ ${FULLPREFIX}.*)
+ ;;
+ *)
+ echo ""
+ echo "This update release should be installed on top of the most"
+ echo "recent full release ($FULLVERSION). Your current version"
+ echo "appears to be $existingVer. Please install $FULLVERSION"
+ echo "before installing this update release."
+ echo ""
+ exit 1
+ esac
+ fi
+
+ echo ""
+ echo "Installing the update binary distribution"
+ echo ""
+ for i in $UPDATEDIST $EXTRAUPDATE; do
+ (cd $RUNDIR; $EXTRACT $WDIR/$i)
+ done
+
+ # Make sure that $RUNDIR/lib isn't group/other writable
+ chmod og-w $RUNDIR/lib
+
+ # Need to run ldconfig on some OSs
+ case "$OsName" in
+ FreeBSD|NetBSD|OpenBSD)
+ echo ""
+ echo "Running ldconfig"
+ /sbin/ldconfig -m $RUNDIR/lib
+ ;;
+ Linux)
+ echo ""
+ echo "Running ldconfig"
+ /sbin/ldconfig $RUNDIR/lib
+ ;;
+ esac
+
+ # Run mkfontdir in the local and misc directories to make sure that
+ # the fonts.dir files are up to date after the installation.
+ echo ""
+ for i in $FONTDIRS $EXTRAFONTDIRS; do
+ if [ -d $RUNDIR/lib/X11/fonts/$i ]; then
+ Echo "Updating the fonts.dir file in $RUNDIR/lib/X11/fonts/$i..."
+ $RUNDIR/bin/mkfontdir $RUNDIR/lib/X11/fonts/$i
+ echo ""
+ fi
+ done
+
+ echo ""
+ echo "Update installation complete."
+}
+
+
if [ X"$1" = "X-check" ]; then
GetOsInfo
FindDistName
@@ -594,14 +806,17 @@ if [ X"$1" = "X-check" ]; then
fi
echo ""
-echo " Welcome to the XFree86 $VERSION installer"
+echo " Welcome to the XFree86 $SCRIPTVERSION installer"
echo ""
echo "You are strongly advised to backup your existing XFree86 installation"
-echo "before proceeding. This includes the /usr/X11R6 and /etc/X11"
+echo "before proceeding. This includes the $ROOTDIR/usr/X11R6 and $ROOTDIR/etc/X11"
echo "directories. The installation process will overwrite existing files"
echo "in those directories, and this may include some configuration files"
echo "that may have been customised."
echo ""
+echo "If you are installing a version different from $SCRIPTVERSION, you"
+echo "may need an updated version of this installer script."
+echo ""
ContinueNo
# Should check if uid is zero
@@ -625,10 +840,12 @@ GetOsInfo
case "$OsName" in
Darwin)
SERVDIST="Xxserv.tgz"
+ EXTRAOPTDIST="Xquartz.tgz"
+ UPDATEDIST="Xupdate.tgz Xdocupd.tgz"
;;
FreeBSD|NetBSD|OpenBSD)
VARDIST="Xvar.tgz"
- XKBDIR="/var/db/xkb"
+ XKBDBDIR="$VARDIR/db/xkb"
;;
Interactive) # Need the correct name for this
EXTRADIST="Xbin1.tgz"
@@ -636,22 +853,10 @@ Interactive) # Need the correct name for this
;;
Linux)
VARDIST="Xvar.tgz"
- XKBDIR="/var/state/xkb"
+ XKBDBDIR="$VARDIR/lib/xkb"
;;
esac
-REQUIREDFILES=" \
- extract \
- $BASEDIST \
- $ETCDIST \
- $VARDIST \
- $SERVDIST \
- $EXTRADIST \
- "
-
-echo "Checking for required files ..."
-Needed=""
-
# Check for extract and extract.exe, and check that they are usable.
#
# This test may not be fool-proof. A FreeBSD/ELF binary downloaded in
@@ -711,12 +916,41 @@ if [ X"$ExtractOK" != XYES ]; then
echo "and put it in this directory."
fi
echo ""
- echo "When you have corrected the problem, please re-run 'sh $0'"
+ echo "When you have corrected the problem, please re-run 'sh $0$OPTS'"
echo "to proceed with the installation."
echo ""
exit 1
fi
+# Link extract to gnu-tar so it can also be used as a regular tar
+rm -f gnu-tar
+ln extract gnu-tar
+
+EXTRACT=$WDIR/extract
+TAR=$WDIR/gnu-tar
+
+CheckInstallType "$@"
+
+if [ X"$DOUPDATE" = XYES ]; then
+ REQUIREDFILES=" \
+ extract \
+ $UPDATEDIST \
+ $EXTRAUPDATE
+ "
+else
+ REQUIREDFILES=" \
+ extract \
+ $BASEDIST \
+ $ETCDIST \
+ $VARDIST \
+ $SERVDIST \
+ $EXTRADIST \
+ "
+fi
+
+echo "Checking for required files ..."
+Needed=""
+
for i in $REQUIREDFILES; do
if [ ! -f $i ]; then
Needed="$Needed $i"
@@ -731,7 +965,7 @@ if [ X"$Needed" != X ]; then
echo "must be present in the current directory to proceed with the"
echo "installation. You should be able to find it at the same place"
echo "you picked up the rest of the XFree86 binary distribution."
- echo "Please re-run 'sh $0' to proceed with the installation when"
+ echo "Please re-run 'sh $0$OPTS' to proceed with the installation when"
echo "you have them."
echo ""
exit 1
@@ -741,7 +975,7 @@ DoOsChecks
if [ X"$NEEDSOMETHING" != X ]; then
echo ""
- echo "Please re-run 'sh $0' to proceed with the installation after you"
+ echo "Please re-run 'sh $0$OPTS' to proceed with the installation after you"
echo "have made the required updates."
echo ""
exit 1
@@ -749,12 +983,25 @@ fi
echo ""
-# Link extract to gnu-tar so it can also be used as a regular tar
-rm -f gnu-tar
-ln extract gnu-tar
+# Set version variables if the bindist version was successfully auto-detected.
-EXTRACT=$WDIR/extract
-TAR=$WDIR/gnu-tar
+if [ X$BINDISTVERSION != X ]; then
+ VERSION=$BINDISTVERSION
+fi
+if [ X$BINDISTFULLVERSION != X ]; then
+ FULLVERSION=$BINDISTFULLVERSION
+fi
+if [ X$BINDISTPATCHLEVEL != X ]; then
+ PATCHLEVEL=$BINDISTPATCHLEVEL
+fi
+if [ X$BINDISTFULLPREFIX != X ]; then
+ FULLPREFIX=$BINDISTFULLPREFIX
+fi
+
+if [ X"$DOUPDATE" = XYES ]; then
+ InstallUpdate
+ exit 0
+fi
# Create $RUNDIR and $ETCDIR if they don't already exist
@@ -936,12 +1183,13 @@ for i in $ETCFLINKS; do
fi
done
if [ X"$XKBDIR" != X ]; then
- rm -fr $RUNDIR/lib/X11/xkb/compiled
if [ X"$NoSymLinks" = XYES ]; then
XKBDIR=$RUNDIR/lib/X11/xkb/compiled
fi
if [ -d .etctmp/xkb ]; then
- mkdir $XKBDIR
+ if [ ! -d $XKBDIR ]; then
+ mkdir $XKBDIR
+ fi
$TAR -C .etctmp/xkb -c -f - . | \
$TAR -C $XKBDIR -v -x -p -U -f -
fi
@@ -958,9 +1206,10 @@ if [ X"$VARDIST" != X ]; then
(cd $VARDIR; $EXTRACT $WDIR/$VARDIST)
fi
-if [ X"$XKBDIR" != X -a X"$XKBDIR" != X"$RUNDIR/lib/X11/xkb/compiled" ]; then
+if [ X"$XKBDIR" != X -a X"$XKBDIR" != X"$RUNDIR/lib/X11/xkb/compiled" -a \
+ X"$XKBDBDIR" != X ]; then
rm -fr $RUNDIR/lib/X11/xkb/compiled
- ln -s $XKBDIR $RUNDIR/lib/X11/xkb/compiled
+ ln -s $XKBDBDIR $RUNDIR/lib/X11/xkb/compiled
fi
echo "Checking for optional components to install ..."
@@ -1005,8 +1254,8 @@ for i in $FONTDIRS $EXTRAFONTDIRS; do
done
# Check if the system has a termcap file
-TERMCAP1DIR=/usr/share
-TERMCAP2=/etc/termcap
+TERMCAP1DIR=$ROOTDIR/usr/share
+TERMCAP2=$ROOTDIR/etc/termcap
if [ -d $TERMCAP1DIR ]; then
TERMCAP1=`find $TERMCAP1DIR -type f -name termcap -print 2> /dev/null`
if [ x"$TERMCAP1" != x ]; then
@@ -1040,7 +1289,7 @@ if [ X"$TERMCAPFILE" != X ]; then
fi
# Check for terminfo, and update the xterm entry
-TINFODIR=/usr/lib/terminfo
+TINFODIR=$ROOTDIR/usr/lib/terminfo
# Does this list need to be updated?
OLDTINFO=" \
x/xterm \
@@ -1100,20 +1349,20 @@ fi
if [ -f $RUNDIR/lib/libGL.so ]; then
existing=""
- if [ -f /usr/lib/libGL.so ]; then
+ if [ -f $ROOTDIR/usr/lib/libGL.so ]; then
existing="$existing /usr/lib/libGL.so"
fi
- if [ -f /usr/lib/libGL.so.1 ]; then
+ if [ -f $ROOTDIR/usr/lib/libGL.so.1 ]; then
existing="$existing /usr/lib/libGL.so.1"
fi
- if [ -d /usr/include/GL ]; then
+ if [ -d $ROOTDIR/usr/include/GL ]; then
existing="$existing /usr/include/GL"
fi
echo ""
echo "On some platforms (e.g., Linux), the OpenGL standard requires"
echo "that the GL shared library and header files be visible from the"
- echo "standard system lib and include directories (/usr/lib and"
- echo "/usr/include). This can be done by installing links in those"
+ echo "standard system lib and include directories ($ROOTDIR/usr/lib and"
+ echo "$ROOTDIR/usr/include). This can be done by installing links in those"
echo "directories to the files that have been installed under $RUNDIR."
echo ""
echo "NOTE: installing these links will overwrite existing files or"
@@ -1129,29 +1378,37 @@ if [ -f $RUNDIR/lib/libGL.so ]; then
read response
case "$response" in
[yY]*)
- rm -f /usr/lib/libGL.so
- if [ ! -f /usr/lib/libGL.so ]; then
- echo "Creating link from $RUNDIR/lib/libGL.so to /usr/lib/libGL.so"
- ln -s $RUNDIR/lib/libGL.so /usr/lib/libGL.so
+ if [ ! -d $ROOTDIR/usr/lib ]; then
+ echo "Creating $ROOTDIR/usr/lib"
+ mkdir $ROOTDIR/usr/lib
+ fi
+ if [ ! -d $ROOTDIR/usr/include ]; then
+ echo "Creating $ROOTDIR/usr/include"
+ mkdir $ROOTDIR/usr/include
+ fi
+ rm -f $ROOTDIR/usr/lib/libGL.so
+ if [ ! -f $ROOTDIR/usr/lib/libGL.so ]; then
+ echo "Creating link from $RUNDIR/lib/libGL.so to $ROOTDIR/usr/lib/libGL.so"
+ ln -s $RUNDIR/lib/libGL.so $ROOTDIR/usr/lib/libGL.so
else
- echo "Could not remove existing /usr/lib/libGL.so, so the new"
+ echo "Could not remove existing $ROOTDIR/usr/lib/libGL.so, so the new"
echo "link has not been created."
fi
- rm -f /usr/lib/libGL.so.1
- if [ ! -f /usr/lib/libGL.so.1 ]; then
- echo "Creating link from $RUNDIR/lib/libGL.so.1 to /usr/lib/libGL.so.1"
- ln -s $RUNDIR/lib/libGL.so.1 /usr/lib/libGL.so.1
+ rm -f $ROOTDIR/usr/lib/libGL.so.1
+ if [ ! -f $ROOTDIR/usr/lib/libGL.so.1 ]; then
+ echo "Creating link from $RUNDIR/lib/libGL.so.1 to $ROOTDIR/usr/lib/libGL.so.1"
+ ln -s $RUNDIR/lib/libGL.so.1 $ROOTDIR/usr/lib/libGL.so.1
else
- echo "Could not remove existing /usr/lib/libGL.so.1, so the new"
+ echo "Could not remove existing $ROOTDIR/usr/lib/libGL.so.1, so the new"
echo "link has not been created."
fi
if [ -d $RUNDIR/include/GL ]; then
- rm -f /usr/include/GL
- if [ ! -d /usr/include/GL ]; then
- echo "Creating link from $RUNDIR/include/GL to /usr/include/GL"
- ln -s $RUNDIR/include/GL /usr/include/GL
+ rm -f $ROOTDIR/usr/include/GL
+ if [ ! -d $ROOTDIR/usr/include/GL ]; then
+ echo "Creating link from $RUNDIR/include/GL to $ROOTDIR/usr/include/GL"
+ ln -s $RUNDIR/include/GL $ROOTDIR/usr/include/GL
else
- echo "Could not remove existing /usr/include/GL, so the new"
+ echo "Could not remove existing $ROOTDIR/usr/include/GL, so the new"
echo "link has not been created."
fi
fi
@@ -1163,15 +1420,19 @@ if [ -f $RUNDIR/bin/rstartd ]; then
echo ""
echo "If you are going to use rstart and $RUNDIR/bin isn't in the"
echo "default path for commands run remotely via rsh, you will need"
- echo "a link to rstartd installed in /usr/bin."
+ echo "a link to rstartd installed in $ROOTDIR/usr/bin."
echo ""
Echo "Do you wish to have this link installed (y/n)? [n] "
read response
case "$response" in
[yY]*)
- echo "Creating link from $RUNDIR/bin/rstartd to /usr/bin/rstartd"
- rm -f /usr/bin/rstartd
- ln -s $RUNDIR/bin/rstartd /usr/bin/rstartd
+ if [ ! -d $ROOTDIR/usr/bin ]; then
+ echo "Creating $ROOTDIR/usr/bin"
+ mkdir $ROOTDIR/usr/bin
+ fi
+ echo "Creating link from $RUNDIR/bin/rstartd to $ROOTDIR/usr/bin/rstartd"
+ rm -f $ROOTDIR/usr/bin/rstartd
+ ln -s $RUNDIR/bin/rstartd $ROOTDIR/usr/bin/rstartd
;;
esac
fi
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/bin-excl
index e799d5a70..e9881d34e 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-excl
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/bin-excl
@@ -3,4 +3,4 @@ bin/Xprt
bin/Xvfb
bin/X
bin/xfs
-bin/Xdarwin
+bin/XDarwin
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/bin-list
new file mode 100644
index 000000000..e4f9f74ee
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/bin-list
@@ -0,0 +1,2 @@
+.XFree86_Version
+bin
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/dir
index 11c5b9da7..11c5b9da7 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/dir
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/dir
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-dir
index 412cec0c3..412cec0c3 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-dir
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-dir
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-list
index 9c558e357..9c558e357 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-list
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/fsrv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/fsrv-list
index e4decc9eb..e4decc9eb 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/fsrv-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/fsrv-list
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/host.def
new file mode 100644
index 000000000..f0f1368fd
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/host.def
@@ -0,0 +1,10 @@
+/*
+ * Host.def for building Darwin/ix86 bindists
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/host.def,v 1.1.2.2 2001/05/31 22:20:25 dawes Exp $
+ */
+
+#define InstallEmptyHostDef
+#define BuildBindist
+
+#define DarwinQuartzSupport NO
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/lib-excl
index d7fb5cb03..d7fb5cb03 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-excl
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/lib-excl
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/lib-list
index 9673fea05..9673fea05 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/lib-list
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/man-excl
index 1ea82551a..1ea82551a 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-excl
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/man-excl
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/man-list
index 2a3700c15..2a3700c15 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/man-list
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/nest-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/nest-list
index eff754d76..eff754d76 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/nest-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/nest-list
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prog-excl
index 113d220ef..113d220ef 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-excl
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prog-excl
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prog-list
index 059b71061..059b71061 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prog-list
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prt-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prt-list
index 0646e7927..0646e7927 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prt-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prt-list
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/update-upd
new file mode 100644
index 000000000..b823f7d96
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/update-upd
@@ -0,0 +1,30 @@
+bin/Xdarwin
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/darwin.cf
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libXaw.a
+lib/libXfont.a
+lib/libXft.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/vfb-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/vfb-list
index e2d161bbc..e2d161bbc 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/vfb-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/vfb-list
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/xserv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/xserv-list
new file mode 100644
index 000000000..63c941ae0
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/xserv-list
@@ -0,0 +1,2 @@
+bin/XDarwin
+bin/X
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-excl
new file mode 100644
index 000000000..8344b81c3
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-excl
@@ -0,0 +1,8 @@
+bin/Xnest
+bin/Xprt
+bin/Xvfb
+bin/X
+bin/xfs
+bin/XDarwin
+bin/XDarwinStartup
+bin/XDarwinQuartz
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-list
new file mode 100644
index 000000000..e4f9f74ee
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-list
@@ -0,0 +1,2 @@
+.XFree86_Version
+bin
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/dir
new file mode 100644
index 000000000..11c5b9da7
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/dir
@@ -0,0 +1 @@
+usr/X11R6
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-dir
new file mode 100644
index 000000000..412cec0c3
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-dir
@@ -0,0 +1 @@
+etc/X11
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-list
new file mode 100644
index 000000000..9c558e357
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-list
@@ -0,0 +1 @@
+.
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/fsrv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/fsrv-list
new file mode 100644
index 000000000..e4decc9eb
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/fsrv-list
@@ -0,0 +1,2 @@
+bin/xfs
+man/cat1/xfs.0
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/host.def
new file mode 100644
index 000000000..7487f2319
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/host.def
@@ -0,0 +1,9 @@
+/*
+ * Host.def for building Darwin/ppc bindists
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/host.def,v 1.1.2.2 2001/05/31 22:20:25 dawes Exp $
+ */
+
+#define InstallEmptyHostDef
+#define BuildBindist
+
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-excl
new file mode 100644
index 000000000..d7fb5cb03
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-excl
@@ -0,0 +1,14 @@
+lib/X11/XF86Setup
+lib/X11/app-defaults
+lib/X11/config
+lib/X11/doc
+lib/X11/fonts
+lib/X11/fs
+lib/X11/lbxproxy
+lib/X11/proxymngr
+lib/X11/rstart
+lib/X11/twm
+lib/X11/xdm
+lib/X11/xinit
+lib/X11/xsm
+lib/X11/xserver
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-list
new file mode 100644
index 000000000..9673fea05
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-list
@@ -0,0 +1,2 @@
+lib/X11
+include/X11/bitmaps
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-excl
new file mode 100644
index 000000000..1ea82551a
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-excl
@@ -0,0 +1,3 @@
+man/cat1/XF86Setup.0
+man/cat1/xfs.0
+man/cat1/xmseconfig.0
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-list
new file mode 100644
index 000000000..2a3700c15
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-list
@@ -0,0 +1 @@
+man
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/nest-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/nest-list
new file mode 100644
index 000000000..eff754d76
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/nest-list
@@ -0,0 +1 @@
+bin/Xnest
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-excl
new file mode 100644
index 000000000..113d220ef
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-excl
@@ -0,0 +1,5 @@
+lib/Server
+lib/X11
+lib/lib*.so*
+lib/modules
+include/X11/bitmaps
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-list
new file mode 100644
index 000000000..059b71061
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-list
@@ -0,0 +1,3 @@
+lib
+include
+lib/X11/config
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prt-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prt-list
new file mode 100644
index 000000000..0646e7927
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prt-list
@@ -0,0 +1 @@
+bin/Xprt
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/quartz-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/quartz-list
new file mode 100644
index 000000000..f32a0d5f7
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/quartz-list
@@ -0,0 +1,4 @@
+bin/X
+bin/XDarwinStartup
+bin/XDarwinQuartz
+../../Applications/XDarwin.app
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/update-upd
new file mode 100644
index 000000000..b823f7d96
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/update-upd
@@ -0,0 +1,30 @@
+bin/Xdarwin
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/darwin.cf
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libXaw.a
+lib/libXfont.a
+lib/libXft.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/vfb-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/vfb-list
new file mode 100644
index 000000000..e2d161bbc
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/vfb-list
@@ -0,0 +1 @@
+bin/Xvfb
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/xserv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/xserv-list
new file mode 100644
index 000000000..63c941ae0
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/xserv-list
@@ -0,0 +1,2 @@
+bin/XDarwin
+bin/X
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-list
deleted file mode 100644
index ba077a403..000000000
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-list
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/host.def
deleted file mode 100644
index aeae712b4..000000000
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/host.def
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Host.def for building Darwin bindists
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/host.def,v 1.1 2000/12/10 00:06:21 herrb Exp $
- */
-
-#define InstallEmptyHostDef
-
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/xserv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/xserv-list
deleted file mode 100644
index 3d270e398..000000000
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/xserv-list
+++ /dev/null
@@ -1,2 +0,0 @@
-bin/Xdarwin
-bin/X
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/bin-list
index 512a75054..6cb2911ac 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/bin-list
@@ -1,5 +1,7 @@
+.XFree86_Version
bin
lib/libGL.so.1.2
+lib/libGLU.so.1.3
lib/libICE.so.6.3
lib/libPEX5.so.6.0
lib/libSM.so.6.0
@@ -13,6 +15,7 @@ lib/libXfont.so.1.3
lib/libXft.so.1.0
lib/libXi.so.6.0
lib/libXmu.so.6.2
+lib/libXmuu.so.1.0
lib/libXp.so.6.2
lib/libXpm.so.4.11
lib/libXrender.so.1.0
@@ -20,6 +23,7 @@ lib/libXt.so.6.0
lib/libXtst.so.6.1
lib/libdps.so.1.0
lib/libdpstk.so.1.0
+lib/libfreetype.so.6.0
lib/liboldX.so.6.0
lib/libpsres.so.1.0
lib/libxrx.so.6.3
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/drivers-upd
new file mode 100644
index 000000000..002f614d9
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/drivers-upd
@@ -0,0 +1,20 @@
+lib/modules/drivers/chips_drv.o
+lib/modules/drivers/cyrix_drv.o
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/i810_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/neomagic_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/r128_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/sis_drv.o
+lib/modules/drivers/tdfx_drv.o
+lib/modules/drivers/trident_drv.o
+lib/modules/drivers/tseng_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def
index 0f02f439b..70b3ad7be 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def
@@ -1,8 +1,9 @@
/*
* Host.def for building FreeBSD/a.out bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def,v 1.3 2000/03/07 14:47:32 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def,v 1.3.4.1 2001/05/31 22:20:28 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/update-upd
new file mode 100644
index 000000000..dd36865f2
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/update-upd
@@ -0,0 +1,42 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libX11.so.6.2
+lib/libXaw.a
+lib/libXaw.so.6.1
+lib/libXaw.so.7.0
+lib/libXfont.a
+lib/libXfont.so.1.3
+lib/libXft.a
+lib/libXft.so.1.0
+lib/libfreetype.a
+lib/libfreetype.so.6.0
+man/man1/XFree86.1.gz
+man/man4/nv.4.gz
+man/man5/XF86Config.5.gz
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/bin-list
index 85cbab2a5..e8d9165a2 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/bin-list
@@ -1,7 +1,10 @@
+.XFree86_Version
bin
lib/aout
lib/libGL.so.1
lib/libGL.so
+lib/libGLU.so.1
+lib/libGLU.so
lib/libICE.so.6
lib/libICE.so
lib/libOSMesa.so.3
@@ -29,6 +32,8 @@ lib/libXi.so.6
lib/libXi.so
lib/libXmu.so.6
lib/libXmu.so
+lib/libXmuu.so.1
+lib/libXmuu.so
lib/libXp.so.6
lib/libXp.so
lib/libXpm.so.4
@@ -43,6 +48,8 @@ lib/libdps.so.1
lib/libdps.so
lib/libdpstk.so.1
lib/libdpstk.so
+lib/libfreetype.so.6
+lib/libfreetype.so
lib/liboldX.so.6
lib/liboldX.so
lib/libpsres.so.1
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/drivers-upd
new file mode 100644
index 000000000..002f614d9
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/drivers-upd
@@ -0,0 +1,20 @@
+lib/modules/drivers/chips_drv.o
+lib/modules/drivers/cyrix_drv.o
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/i810_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/neomagic_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/r128_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/sis_drv.o
+lib/modules/drivers/tdfx_drv.o
+lib/modules/drivers/trident_drv.o
+lib/modules/drivers/tseng_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def
index 9208cc595..f8a38459f 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def
@@ -1,8 +1,9 @@
/*
* Host.def for building FreeBSD bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def,v 1.3 2000/03/07 14:47:31 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def,v 1.3.4.1 2001/05/31 22:20:27 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/update-upd
new file mode 100644
index 000000000..23efc6580
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/update-upd
@@ -0,0 +1,47 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libX11.so
+lib/libX11.so.6
+lib/libXaw.a
+lib/libXaw.so
+lib/libXaw.so.6
+lib/libXaw.so.7
+lib/libXfont.a
+lib/libXfont.so
+lib/libXfont.so.1
+lib/libXft.a
+lib/libXft.so
+lib/libXft.so.1
+lib/libfreetype.a
+lib/libfreetype.so
+lib/libfreetype.so.6
+man/man1/XFree86.1.gz
+man/man4/nv.4.gz
+man/man5/XF86Config.5.gz
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/bin-list
index ba077a403..e4f9f74ee 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/bin-list
@@ -1 +1,2 @@
+.XFree86_Version
bin
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/drivers-upd
new file mode 100644
index 000000000..002f614d9
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/drivers-upd
@@ -0,0 +1,20 @@
+lib/modules/drivers/chips_drv.o
+lib/modules/drivers/cyrix_drv.o
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/i810_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/neomagic_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/r128_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/sis_drv.o
+lib/modules/drivers/tdfx_drv.o
+lib/modules/drivers/trident_drv.o
+lib/modules/drivers/tseng_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/update-upd
new file mode 100644
index 000000000..8d91c6abd
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/update-upd
@@ -0,0 +1,36 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libXaw.a
+lib/libXfont.a
+lib/libXft.a
+lib/libfreetype.a
+man/man1/XFree86.1x.Z
+man/man4/XF86Config.4.Z
+man/man7/nv.7.Z
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/bin-list
index 9f9e96aa1..0b402b073 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/bin-list
@@ -1,7 +1,11 @@
+.XFree86_Version
bin
lib/libGL.so.1.2
lib/libGL.so.1
lib/libGL.so
+lib/libGLU.so.1.3
+lib/libGLU.so.1
+lib/libGLU.so
lib/libICE.so.6.3
lib/libICE.so.6
lib/libICE.so
@@ -40,6 +44,9 @@ lib/libXi.so
lib/libXmu.so.6.2
lib/libXmu.so.6
lib/libXmu.so
+lib/libXmuu.so.1.0
+lib/libXmuu.so.1
+lib/libXmuu.so
lib/libXp.so.6.2
lib/libXp.so.6
lib/libXp.so
@@ -61,6 +68,9 @@ lib/libdps.so
lib/libdpstk.so.1.0
lib/libdpstk.so.1
lib/libdpstk.so
+lib/libfreetype.so.6.0
+lib/libfreetype.so.6
+lib/libfreetype.so
lib/libpsres.so.1.0
lib/libpsres.so.1
lib/libpsres.so
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/drivers-upd
new file mode 100644
index 000000000..11ea38365
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/drivers-upd
@@ -0,0 +1,11 @@
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def
index 371566bc9..31a0c0aad 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def
@@ -1,10 +1,11 @@
/*
* Host.def for building Linux/alpha bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def,v 1.6 2001/03/17 18:41:32 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def,v 1.6.2.1 2001/05/31 22:20:28 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
/* Need to have glide 3 installed, where available */
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/update-upd
new file mode 100644
index 000000000..7c3e2f477
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/update-upd
@@ -0,0 +1,53 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libX11.so
+lib/libX11.so.6
+lib/libX11.so.6.2
+lib/libXaw.a
+lib/libXaw.so
+lib/libXaw.so.6
+lib/libXaw.so.6.1
+lib/libXaw.so.7
+lib/libXaw.so.7.0
+lib/libXfont.a
+lib/libXfont.so
+lib/libXfont.so.1
+lib/libXfont.so.1.3
+lib/libXft.a
+lib/libXft.so
+lib/libXft.so.1
+lib/libXft.so.1.0
+lib/libfreetype.a
+lib/libfreetype.so
+lib/libfreetype.so.6
+lib/libfreetype.so.6.0
+man/man1/XFree86.1x
+man/man4/nv.4
+man/man5/XF86Config.5x
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/bin-list
index 9f9e96aa1..0b402b073 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/bin-list
@@ -1,7 +1,11 @@
+.XFree86_Version
bin
lib/libGL.so.1.2
lib/libGL.so.1
lib/libGL.so
+lib/libGLU.so.1.3
+lib/libGLU.so.1
+lib/libGLU.so
lib/libICE.so.6.3
lib/libICE.so.6
lib/libICE.so
@@ -40,6 +44,9 @@ lib/libXi.so
lib/libXmu.so.6.2
lib/libXmu.so.6
lib/libXmu.so
+lib/libXmuu.so.1.0
+lib/libXmuu.so.1
+lib/libXmuu.so
lib/libXp.so.6.2
lib/libXp.so.6
lib/libXp.so
@@ -61,6 +68,9 @@ lib/libdps.so
lib/libdpstk.so.1.0
lib/libdpstk.so.1
lib/libdpstk.so
+lib/libfreetype.so.6.0
+lib/libfreetype.so.6
+lib/libfreetype.so
lib/libpsres.so.1.0
lib/libpsres.so.1
lib/libpsres.so
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/drivers-upd
new file mode 100644
index 000000000..002f614d9
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/drivers-upd
@@ -0,0 +1,20 @@
+lib/modules/drivers/chips_drv.o
+lib/modules/drivers/cyrix_drv.o
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/i810_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/neomagic_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/r128_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/sis_drv.o
+lib/modules/drivers/tdfx_drv.o
+lib/modules/drivers/trident_drv.o
+lib/modules/drivers/tseng_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def
index 6cb9eb81c..4f8964092 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def
@@ -1,10 +1,11 @@
/*
* Host.def for building Linux/ix86 bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def,v 1.7 2001/03/17 18:41:32 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def,v 1.7.2.1 2001/05/31 22:20:29 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
/* Need to have glide 2 and glide 3 installed, where available */
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/update-upd
new file mode 100644
index 000000000..7c3e2f477
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/update-upd
@@ -0,0 +1,53 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libX11.so
+lib/libX11.so.6
+lib/libX11.so.6.2
+lib/libXaw.a
+lib/libXaw.so
+lib/libXaw.so.6
+lib/libXaw.so.6.1
+lib/libXaw.so.7
+lib/libXaw.so.7.0
+lib/libXfont.a
+lib/libXfont.so
+lib/libXfont.so.1
+lib/libXfont.so.1.3
+lib/libXft.a
+lib/libXft.so
+lib/libXft.so.1
+lib/libXft.so.1.0
+lib/libfreetype.a
+lib/libfreetype.so
+lib/libfreetype.so.6
+lib/libfreetype.so.6.0
+man/man1/XFree86.1x
+man/man4/nv.4
+man/man5/XF86Config.5x
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/bin-list
index 9f9e96aa1..0b402b073 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/bin-list
@@ -1,7 +1,11 @@
+.XFree86_Version
bin
lib/libGL.so.1.2
lib/libGL.so.1
lib/libGL.so
+lib/libGLU.so.1.3
+lib/libGLU.so.1
+lib/libGLU.so
lib/libICE.so.6.3
lib/libICE.so.6
lib/libICE.so
@@ -40,6 +44,9 @@ lib/libXi.so
lib/libXmu.so.6.2
lib/libXmu.so.6
lib/libXmu.so
+lib/libXmuu.so.1.0
+lib/libXmuu.so.1
+lib/libXmuu.so
lib/libXp.so.6.2
lib/libXp.so.6
lib/libXp.so
@@ -61,6 +68,9 @@ lib/libdps.so
lib/libdpstk.so.1.0
lib/libdpstk.so.1
lib/libdpstk.so
+lib/libfreetype.so.6.0
+lib/libfreetype.so.6
+lib/libfreetype.so
lib/libpsres.so.1.0
lib/libpsres.so.1
lib/libpsres.so
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def
index 2c8e5a311..0b4a84ffe 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def
@@ -1,10 +1,11 @@
/*
* Host.def for building Linux/m68k bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def,v 1.5 2001/03/17 18:41:33 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def,v 1.5.2.1 2001/05/31 22:20:31 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
#define ForceNormalLib YES
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/bin-list
index 9f9e96aa1..0b402b073 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/bin-list
@@ -1,7 +1,11 @@
+.XFree86_Version
bin
lib/libGL.so.1.2
lib/libGL.so.1
lib/libGL.so
+lib/libGLU.so.1.3
+lib/libGLU.so.1
+lib/libGLU.so
lib/libICE.so.6.3
lib/libICE.so.6
lib/libICE.so
@@ -40,6 +44,9 @@ lib/libXi.so
lib/libXmu.so.6.2
lib/libXmu.so.6
lib/libXmu.so
+lib/libXmuu.so.1.0
+lib/libXmuu.so.1
+lib/libXmuu.so
lib/libXp.so.6.2
lib/libXp.so.6
lib/libXp.so
@@ -61,6 +68,9 @@ lib/libdps.so
lib/libdpstk.so.1.0
lib/libdpstk.so.1
lib/libdpstk.so
+lib/libfreetype.so.6.0
+lib/libfreetype.so.6
+lib/libfreetype.so
lib/libpsres.so.1.0
lib/libpsres.so.1
lib/libpsres.so
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/bin-list
index 9f9e96aa1..0b402b073 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/bin-list
@@ -1,7 +1,11 @@
+.XFree86_Version
bin
lib/libGL.so.1.2
lib/libGL.so.1
lib/libGL.so
+lib/libGLU.so.1.3
+lib/libGLU.so.1
+lib/libGLU.so
lib/libICE.so.6.3
lib/libICE.so.6
lib/libICE.so
@@ -40,6 +44,9 @@ lib/libXi.so
lib/libXmu.so.6.2
lib/libXmu.so.6
lib/libXmu.so
+lib/libXmuu.so.1.0
+lib/libXmuu.so.1
+lib/libXmuu.so
lib/libXp.so.6.2
lib/libXp.so.6
lib/libXp.so
@@ -61,6 +68,9 @@ lib/libdps.so
lib/libdpstk.so.1.0
lib/libdpstk.so.1
lib/libdpstk.so
+lib/libfreetype.so.6.0
+lib/libfreetype.so.6
+lib/libfreetype.so
lib/libpsres.so.1.0
lib/libpsres.so.1
lib/libpsres.so
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def
index 03b7f5fa2..1c6753116 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def
@@ -1,10 +1,11 @@
/*
* Host.def for building Linux/ppc bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def,v 1.4 2001/03/17 18:41:33 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def,v 1.4.2.1 2001/05/31 22:20:31 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
#define ForceNormalLib YES
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/bin-list
index ba077a403..e4f9f74ee 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/bin-list
@@ -1 +1,2 @@
+.XFree86_Version
bin
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/drivers-upd
new file mode 100644
index 000000000..002f614d9
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/drivers-upd
@@ -0,0 +1,20 @@
+lib/modules/drivers/chips_drv.o
+lib/modules/drivers/cyrix_drv.o
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/i810_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/neomagic_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/r128_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/sis_drv.o
+lib/modules/drivers/tdfx_drv.o
+lib/modules/drivers/trident_drv.o
+lib/modules/drivers/tseng_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def
index 03c9bc7ca..810c00bf2 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def
@@ -1,8 +1,11 @@
/*
* host.def for building LynxOS binary dists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def,v 1.3 2000/03/03 20:02:16 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def,v 1.3.4.1 2001/05/31 22:20:31 dawes Exp $
*/
+#define BuildBindist
+
#define HasLibCrypt YES
#define HasMTRRSupport YES
+
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/update-upd
new file mode 100644
index 000000000..6d41a8fe5
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/update-upd
@@ -0,0 +1,47 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libX11.so
+lib/libX11.so.6
+lib/libXaw.a
+lib/libXaw.so
+lib/libXaw.so.6
+lib/libXaw.so.7
+lib/libXfont.a
+lib/libXfont.so
+lib/libXfont.so.1
+lib/libXft.a
+lib/libXft.so
+lib/libXft.so.1
+lib/libfreetype.a
+lib/libfreetype.so
+lib/libfreetype.so.6
+man/cat1/XFree86.1
+man/cat4/nv.4
+man/cat5/XF86Config.5
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/bin-list
index 3d7c2a6d6..804d63722 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/bin-list
@@ -1,5 +1,7 @@
+.XFree86_Version
bin
lib/libGL.so.1.2
+lib/libGLU.so.1.3
lib/libICE.so.6.3
lib/libPEX5.so.6.0
lib/libSM.so.6.0
@@ -12,6 +14,7 @@ lib/libXfont.so.1.3
lib/libXft.so.1.0
lib/libXi.so.6.0
lib/libXmu.so.6.2
+lib/libXmuu.so.1.0
lib/libXp.so.6.2
lib/libXpm.so.4.11
lib/libXrender.so.1.0
@@ -19,5 +22,6 @@ lib/libXt.so.6.0
lib/libXtst.so.6.1
lib/libdps.so.1.0
lib/libdpstk.so.1.0
+lib/libfreetype.so.6.0
lib/liboldX.so.6.0
lib/libpsres.so.1.0
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/drivers-upd
new file mode 100644
index 000000000..183468300
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/drivers-upd
@@ -0,0 +1,19 @@
+lib/modules/drivers/chips_drv.o
+lib/modules/drivers/cyrix_drv.o
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/neomagic_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/r128_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/sis_drv.o
+lib/modules/drivers/tdfx_drv.o
+lib/modules/drivers/trident_drv.o
+lib/modules/drivers/tseng_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def
index e34b1b202..7c3d6c1f0 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def
@@ -1,8 +1,9 @@
/*
* Host.def for building NetBSD bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def,v 1.1 2000/12/09 21:46:27 herrb Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def,v 1.1.4.1 2001/05/31 22:20:32 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/update-upd
new file mode 100644
index 000000000..b1fca057f
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/update-upd
@@ -0,0 +1,42 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libX11.so.6.2
+lib/libXaw.a
+lib/libXaw.so.6.1
+lib/libXaw.so.7.0
+lib/libXfont.a
+lib/libXfont.so.1.3
+lib/libXft.a
+lib/libXft.so.1.0
+lib/libfreetype.a
+lib/libfreetype.so.6.0
+man/cat1/XFree86.0
+man/cat4/nv.0
+man/cat5/XF86Config.0
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-list
index 80b1f62b6..873b5a947 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-list
@@ -1,7 +1,11 @@
+.XFree86_Version
bin
lib/libGL.so
lib/libGL.so.1
lib/libGL.so.1.2
+lib/libGLU.so
+lib/libGLU.so.1
+lib/libGLU.so.1.3
lib/libICE.so
lib/libICE.so.6
lib/libICE.so.6.3
@@ -37,6 +41,9 @@ lib/libXi.so.6.0
lib/libXmu.so
lib/libXmu.so.6
lib/libXmu.so.6.2
+lib/libXmuu.so
+lib/libXmuu.so.1
+lib/libXmuu.so.1.0
lib/libXp.so
lib/libXp.so.6
lib/libXp.so.6.2
@@ -58,6 +65,9 @@ lib/libdps.so.1.0
lib/libdpstk.so
lib/libdpstk.so.1
lib/libdpstk.so.1.0
+lib/libfreetype.so
+lib/libfreetype.so.6
+lib/libfreetype.so.6.0
lib/liboldX.so
lib/liboldX.so.6
lib/liboldX.so.6.0
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/drivers-upd
new file mode 100644
index 000000000..183468300
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/drivers-upd
@@ -0,0 +1,19 @@
+lib/modules/drivers/chips_drv.o
+lib/modules/drivers/cyrix_drv.o
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/neomagic_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/r128_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/sis_drv.o
+lib/modules/drivers/tdfx_drv.o
+lib/modules/drivers/trident_drv.o
+lib/modules/drivers/tseng_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def
index a63db92a8..1a15feb97 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def
@@ -1,8 +1,9 @@
/*
* Host.def for building NetBSD bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def,v 1.3 2000/03/07 14:47:36 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def,v 1.3.4.1 2001/05/31 22:20:32 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/update-upd
new file mode 100644
index 000000000..aabf54d7d
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/update-upd
@@ -0,0 +1,53 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libX11.so
+lib/libX11.so.6
+lib/libX11.so.6.2
+lib/libXaw.a
+lib/libXaw.so
+lib/libXaw.so.6
+lib/libXaw.so.6.1
+lib/libXaw.so.7
+lib/libXaw.so.7.0
+lib/libXfont.a
+lib/libXfont.so
+lib/libXfont.so.1
+lib/libXfont.so.1.3
+lib/libXft.a
+lib/libXft.so
+lib/libXft.so.1
+lib/libXft.so.1.0
+lib/libfreetype.a
+lib/libfreetype.so
+lib/libfreetype.so.6
+lib/libfreetype.so.6.0
+man/cat1/XFree86.0
+man/cat4/nv.0
+man/cat5/XF86Config.0
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-list
index 75cc08f7e..40676c8bf 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-list
@@ -1,5 +1,7 @@
+.XFree86_Version
bin
lib/libGL.so.1.2
+lib/libGLU.so.1.3
lib/libICE.so.6.3
lib/libPEX5.so.6.0
lib/libSM.so.6.0
@@ -13,6 +15,7 @@ lib/libXfont.so.1.3
lib/libXft.so.1.0
lib/libXi.so.6.0
lib/libXmu.so.6.2
+lib/libXmuu.so.1.0
lib/libXp.so.6.2
lib/libXpm.so.4.11
lib/libXrender.so.1.0
@@ -20,5 +23,6 @@ lib/libXt.so.6.0
lib/libXtst.so.6.1
lib/libdps.so.1.0
lib/libdpstk.so.1.0
+lib/libfreetype.so.6.0
lib/liboldX.so.6.0
lib/libpsres.so.1.0
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/drivers-upd
new file mode 100644
index 000000000..183468300
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/drivers-upd
@@ -0,0 +1,19 @@
+lib/modules/drivers/chips_drv.o
+lib/modules/drivers/cyrix_drv.o
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/neomagic_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/r128_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/sis_drv.o
+lib/modules/drivers/tdfx_drv.o
+lib/modules/drivers/trident_drv.o
+lib/modules/drivers/tseng_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def
index 1d3de627c..4c47461a4 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def
@@ -1,10 +1,11 @@
/*
* Host.def for building OpenBSD/ix86 bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def,v 1.3 2000/02/27 01:29:03 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def,v 1.3.4.1 2001/05/31 22:20:33 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
#define ForceNormalLib YES
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/update-upd
new file mode 100644
index 000000000..b1fca057f
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/update-upd
@@ -0,0 +1,42 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libX11.so.6.2
+lib/libXaw.a
+lib/libXaw.so.6.1
+lib/libXaw.so.7.0
+lib/libXfont.a
+lib/libXfont.so.1.3
+lib/libXft.a
+lib/libXft.so.1.0
+lib/libfreetype.a
+lib/libfreetype.so.6.0
+man/cat1/XFree86.0
+man/cat4/nv.0
+man/cat5/XF86Config.0
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/bin-list
index e5d1a9397..6451b6de6 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/bin-list
@@ -1,3 +1,4 @@
+.XFree86_Version
bin
lib/libICE.so.6.3
lib/libPEX5.so.6.0
@@ -8,6 +9,7 @@ lib/libXaw.so.6.1
lib/libXext.so.6.3
lib/libXi.so.6.0
lib/libXmu.so.6.0
+lib/libXmuu.so.1.0
lib/libXp.so.6.2
lib/libXt.so.6.0
lib/libXtst.so.6.1
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def
index 11b7963e0..7b1a96939 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def
@@ -1,10 +1,11 @@
/*
* Host.def for building OpenBSD/sparc bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def,v 1.2 2000/02/27 01:39:18 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def,v 1.2.4.1 2001/05/31 22:20:34 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
#define ForceNormalLib YES
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/bin-list
index 38a00bb51..38df3a2b1 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/bin-list
@@ -1,6 +1,9 @@
+.XFree86_Version
bin
lib/libGL.so.1.2
lib/libGL.so
+lib/libGLU.so.1.3
+lib/libGLU.so
lib/libICE.so.6.3
lib/libICE.so
lib/libPEX5.so.6.0
@@ -24,6 +27,8 @@ lib/libXi.so.6.0
lib/libXi.so
lib/libXmu.so.6.2
lib/libXmu.so
+lib/libXmuu.so.1.0
+lib/libXmuu.so
lib/libXp.so.6.2
lib/libXp.so
lib/libXpm.so.4.11
@@ -38,6 +43,8 @@ lib/libdps.so.1.0
lib/libdps.so
lib/libdpstk.so.1.0
lib/libdpstk.so
+lib/libfreetype.so.6.0
+lib/libfreetype.so
lib/libpsres.so.1.0
lib/libpsres.so
lib/liboldX.so.6.0
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/drivers-upd
new file mode 100644
index 000000000..002f614d9
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/drivers-upd
@@ -0,0 +1,20 @@
+lib/modules/drivers/chips_drv.o
+lib/modules/drivers/cyrix_drv.o
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/i810_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/neomagic_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/r128_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/sis_drv.o
+lib/modules/drivers/tdfx_drv.o
+lib/modules/drivers/trident_drv.o
+lib/modules/drivers/tseng_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def
index c89665d4b..de01db44a 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def
@@ -1,10 +1,11 @@
/*
* Host.def for building SVR4.0 bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def,v 1.4 2001/03/17 18:41:33 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def,v 1.4.2.1 2001/05/31 22:20:35 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
#define ForceNormalLib YES
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/update-upd
new file mode 100644
index 000000000..2265e0f4f
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/update-upd
@@ -0,0 +1,47 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libX11.so
+lib/libX11.so.6.2
+lib/libXaw.a
+lib/libXaw.so
+lib/libXaw.so.6.1
+lib/libXaw.so.7.0
+lib/libXfont.a
+lib/libXfont.so
+lib/libXfont.so.1.3
+lib/libXft.a
+lib/libXft.so
+lib/libXft.so.1.0
+lib/libfreetype.a
+lib/libfreetype.so
+lib/libfreetype.so.6.0
+man/man1/XFree86.1x
+man/man4/XF86Config.4
+man/man7/nv.7
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/bin-list
index 38a00bb51..38df3a2b1 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/bin-list
@@ -1,6 +1,9 @@
+.XFree86_Version
bin
lib/libGL.so.1.2
lib/libGL.so
+lib/libGLU.so.1.3
+lib/libGLU.so
lib/libICE.so.6.3
lib/libICE.so
lib/libPEX5.so.6.0
@@ -24,6 +27,8 @@ lib/libXi.so.6.0
lib/libXi.so
lib/libXmu.so.6.2
lib/libXmu.so
+lib/libXmuu.so.1.0
+lib/libXmuu.so
lib/libXp.so.6.2
lib/libXp.so
lib/libXpm.so.4.11
@@ -38,6 +43,8 @@ lib/libdps.so.1.0
lib/libdps.so
lib/libdpstk.so.1.0
lib/libdpstk.so
+lib/libfreetype.so.6.0
+lib/libfreetype.so
lib/libpsres.so.1.0
lib/libpsres.so
lib/liboldX.so.6.0
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/drivers-upd
new file mode 100644
index 000000000..002f614d9
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/drivers-upd
@@ -0,0 +1,20 @@
+lib/modules/drivers/chips_drv.o
+lib/modules/drivers/cyrix_drv.o
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/i810_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/neomagic_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/r128_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/sis_drv.o
+lib/modules/drivers/tdfx_drv.o
+lib/modules/drivers/trident_drv.o
+lib/modules/drivers/tseng_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def
index 4fba95ca7..24b6ca3ff 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def
@@ -1,10 +1,11 @@
/*
* Host.def for building Solaris bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def,v 1.4 2001/03/17 18:41:33 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def,v 1.4.2.1 2001/05/31 22:20:35 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
#define ForceNormalLib YES
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/update-upd
new file mode 100644
index 000000000..2265e0f4f
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/update-upd
@@ -0,0 +1,47 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libX11.so
+lib/libX11.so.6.2
+lib/libXaw.a
+lib/libXaw.so
+lib/libXaw.so.6.1
+lib/libXaw.so.7.0
+lib/libXfont.a
+lib/libXfont.so
+lib/libXfont.so.1.3
+lib/libXft.a
+lib/libXft.so
+lib/libXft.so.1.0
+lib/libfreetype.a
+lib/libfreetype.so
+lib/libfreetype.so.6.0
+man/man1/XFree86.1x
+man/man4/XF86Config.4
+man/man7/nv.7
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/bin-list
index 38a00bb51..38df3a2b1 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/bin-list
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/bin-list
@@ -1,6 +1,9 @@
+.XFree86_Version
bin
lib/libGL.so.1.2
lib/libGL.so
+lib/libGLU.so.1.3
+lib/libGLU.so
lib/libICE.so.6.3
lib/libICE.so
lib/libPEX5.so.6.0
@@ -24,6 +27,8 @@ lib/libXi.so.6.0
lib/libXi.so
lib/libXmu.so.6.2
lib/libXmu.so
+lib/libXmuu.so.1.0
+lib/libXmuu.so
lib/libXp.so.6.2
lib/libXp.so
lib/libXpm.so.4.11
@@ -38,6 +43,8 @@ lib/libdps.so.1.0
lib/libdps.so
lib/libdpstk.so.1.0
lib/libdpstk.so
+lib/libfreetype.so.6.0
+lib/libfreetype.so
lib/libpsres.so.1.0
lib/libpsres.so
lib/liboldX.so.6.0
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/drivers-upd
new file mode 100644
index 000000000..002f614d9
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/drivers-upd
@@ -0,0 +1,20 @@
+lib/modules/drivers/chips_drv.o
+lib/modules/drivers/cyrix_drv.o
+lib/modules/drivers/glint_drv.o
+lib/modules/drivers/i810_drv.o
+lib/modules/drivers/mga_drv.o
+lib/modules/drivers/neomagic_drv.o
+lib/modules/drivers/nv_drv.o
+lib/modules/drivers/r128_drv.o
+lib/modules/drivers/s3virge_drv.o
+lib/modules/drivers/savage_drv.o
+lib/modules/drivers/sis_drv.o
+lib/modules/drivers/tdfx_drv.o
+lib/modules/drivers/trident_drv.o
+lib/modules/drivers/tseng_drv.o
+lib/modules/drivers/vga_drv.o
+lib/modules/extensions/libextmod.a
+lib/modules/fonts/libfreetype.a
+lib/modules/input/mouse_drv.o
+lib/modules/libvgahw.a
+lib/modules/libxf8_16bpp.a
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def
index 9bf96d029..b9324178c 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def
@@ -1,10 +1,11 @@
/*
* Host.def for building UnixWare bindists
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def,v 1.4 2001/03/17 18:41:33 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def,v 1.4.2.1 2001/05/31 22:20:36 dawes Exp $
*/
#define InstallEmptyHostDef
+#define BuildBindist
#define ForceNormalLib YES
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/update-upd
new file mode 100644
index 000000000..2265e0f4f
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/update-upd
@@ -0,0 +1,47 @@
+bin/SuperProbe
+bin/XFree86
+bin/gccmakedep
+bin/mkhtmlindex
+bin/rman
+bin/pswrap
+bin/twm
+bin/xedit
+bin/xfs
+bin/xf86cfg
+bin/xman
+bin/xterm
+include/X11/Xos.h
+include/X11/Xosdefs.h
+include/X11/Xos_r.h
+lib/X11/app-defaults/XF86Cfg
+lib/X11/config/FreeBSD.cf
+lib/X11/config/Imake.rules
+lib/X11/config/Imake.tmpl
+lib/X11/config/NetBSD.cf
+lib/X11/config/OpenBSD.cf
+lib/X11/config/X11.tmpl
+lib/X11/config/gnu.cf
+lib/X11/config/linux.cf
+lib/X11/config/osf1.cf
+lib/X11/config/xfree86.cf
+lib/X11/xkb/rules/xfree86.lst
+lib/X11/xkb/symbols/us
+lib/libX11.a
+lib/libX11.so
+lib/libX11.so.6.2
+lib/libXaw.a
+lib/libXaw.so
+lib/libXaw.so.6.1
+lib/libXaw.so.7.0
+lib/libXfont.a
+lib/libXfont.so
+lib/libXfont.so.1.3
+lib/libXft.a
+lib/libXft.so
+lib/libXft.so.1.0
+lib/libfreetype.a
+lib/libfreetype.so
+lib/libfreetype.so.6.0
+man/man1/XFree86.1x
+man/man4/XF86Config.4
+man/man7/nv.7
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist b/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist
index e9def824a..f996b2165 100755
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist
@@ -1,22 +1,39 @@
#!/bin/sh
#
-# $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist,v 1.4 2000/12/14 21:50:09 dawes Exp $
+# $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist,v 1.4.4.1 2001/05/31 22:20:25 dawes Exp $
#
Usage()
{
- echo `basename $0` [-l] [prefix] from-dir to-dir
+ echo `basename $0` [-l] [-t type] [prefix] from-dir to-dir
exit 1
}
+args=
createlist=NO
+type=list
-case $1 in
+while [ $# != 0 ]; do
+ case $1 in
-l)
createlist=YES
shift
;;
-esac
+ -t)
+ shift
+ type=$1
+ shift
+ ;;
+ *)
+ args="$args $1"
+ shift
+ ;;
+ esac
+done
+
+if [ X"$args" != X ]; then
+ set - $args
+fi
case $# in
3)
@@ -97,11 +114,11 @@ for d in $SUBDIRS; do
# exit 3
else
DEFPREFIX=`cat $DIRFILE`
- for i in *-list; do
- name=`basename $i -list`
+ for i in *-$type; do
+ name=`basename $i -$type`
tarball=$PRE$name.tgz
echo creating $tarball
- lfile="-T $TODIR/$d/$i"
+ lfile="`cat $TODIR/$d/$i`"
if [ -f $name-excl ]; then
xfile="-X $TODIR/$d/$name-excl"
else
@@ -113,7 +130,7 @@ for d in $SUBDIRS; do
PREFIX=$DEFPREFIX
fi
(cd $FROMDIR/$PREFIX
- $TAR $TAROPTS -f $TODIR/$BINDIR/$tarball $lfile $xfile
+ $TAR $TAROPTS -f $TODIR/$BINDIR/$tarball $xfile $lfile
)
done
fi
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/docupd-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/docupd-upd
new file mode 100644
index 000000000..112c38314
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/docupd-upd
@@ -0,0 +1,40 @@
+lib/X11/doc/BugReport
+lib/X11/doc/DESIGN
+lib/X11/doc/Install
+lib/X11/doc/LICENSE
+lib/X11/doc/README
+lib/X11/doc/README.NetBSD
+lib/X11/doc/README.OpenBSD
+lib/X11/doc/README.fonts
+lib/X11/doc/RELNOTES
+lib/X11/doc/Status
+lib/X11/doc/Versions
+lib/X11/doc/PostScript/DESIGN.ps
+lib/X11/doc/PostScript/Install.ps
+lib/X11/doc/PostScript/LICENSE.ps
+lib/X11/doc/PostScript/README.ps
+lib/X11/doc/PostScript/NetBSD.ps
+lib/X11/doc/PostScript/OpenBSD.ps
+lib/X11/doc/PostScript/RELNOTES.ps
+lib/X11/doc/PostScript/Status.ps
+lib/X11/doc/PostScript/Versions.ps
+lib/X11/doc/PostScript/fonts.ps
+lib/X11/doc/html/DESIGN*.html
+lib/X11/doc/html/Install*.html
+lib/X11/doc/html/LICENSE*.html
+lib/X11/doc/html/NetBSD*.html
+lib/X11/doc/html/OpenBSD*.html
+lib/X11/doc/html/README*.html
+lib/X11/doc/html/RELNOTES*.html
+lib/X11/doc/html/Status*.html
+lib/X11/doc/html/Versions*.html
+lib/X11/doc/html/XF86Config.5.html
+lib/X11/doc/html/XFree86.1.html
+lib/X11/doc/html/index.html
+lib/X11/doc/html/fonts*.html
+lib/X11/doc/html/manindex1.html
+lib/X11/doc/html/manindex3.html
+lib/X11/doc/html/manindex4.html
+lib/X11/doc/html/manindex5.html
+lib/X11/doc/html/manindex7.html
+lib/X11/doc/html/nv.4.html
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/extras b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/extras
index 41ca56c8c..f02d11aaa 100644
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/extras
+++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/extras
@@ -1,5 +1,4 @@
lib/X11/doc/BugReport
-lib/X11/doc/RELNOTES
lib/X11/doc/README
lib/X11/doc/Install
lib/X11/etc/Xinstall.sh
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/flat2-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/flat2-list
deleted file mode 100644
index 354ddf5ac..000000000
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/flat2-list
+++ /dev/null
@@ -1 +0,0 @@
-lib/X11/fonts/latin2
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnon-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnon-list
deleted file mode 100644
index a87d01f47..000000000
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnon-list
+++ /dev/null
@@ -1,9 +0,0 @@
-lib/X11/fonts/misc/gb16fs.pcf.gz
-lib/X11/fonts/misc/gb16st.pcf.gz
-lib/X11/fonts/misc/gb24st.pcf.gz
-lib/X11/fonts/misc/hanglg16.pcf.gz
-lib/X11/fonts/misc/hanglm16.pcf.gz
-lib/X11/fonts/misc/hanglm24.pcf.gz
-lib/X11/fonts/misc/jiskan16.pcf.gz
-lib/X11/fonts/misc/jiskan24.pcf.gz
-lib/X11/fonts/misc/k14.pcf.gz
diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnts-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnts-excl
deleted file mode 100644
index 411016a48..000000000
--- a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnts-excl
+++ /dev/null
@@ -1,5 +0,0 @@
-lib/X11/fonts/misc/gb*
-lib/X11/fonts/misc/hang*
-lib/X11/fonts/misc/heb*
-lib/X11/fonts/misc/jiskan*
-lib/X11/fonts/misc/k14*
diff --git a/xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c b/xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c
index d223c14f8..4656d6c33 100644
--- a/xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c
+++ b/xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c
@@ -30,7 +30,7 @@
* Probably buggy as hell, no idea what the initialisation strings are,
* no idea how to ack it. If the tablet stops responding power cycle it.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c,v 1.3 2001/04/01 14:00:12 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c,v 1.4 2001/05/15 18:22:22 paulo Exp $ */
#include "xf86Version.h"
@@ -1440,7 +1440,6 @@ InputDriverRec DIGITALEDGE = {
static void
xf86SumUnplug(pointer p)
{
- DBG(1, ErrorF("xf86SumUnplug\n"));
}
/*
@@ -1454,8 +1453,6 @@ xf86SumPlug(pointer module,
int *errmaj,
int *errmin)
{
- DBG(1, ErrorF("xf86SumPlug\n"));
-
xf86AddInputDriver(&DIGITALEDGE, module, 0);
return module;
diff --git a/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c b/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c
index 224a0e350..09e65f9d6 100644
--- a/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c
+++ b/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c,v 1.41 2001/03/07 16:21:05 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c,v 1.43 2001/05/18 20:22:30 tsi Exp $ */
/*
*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
@@ -63,6 +63,7 @@
#include "mousePriv.h"
#include "mipointer.h"
+static const OptionInfoRec *MouseAvailableOptions(void *unused);
static InputInfoPtr MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags);
#if 0
static void MouseUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
@@ -89,6 +90,65 @@ InputDriverRec MOUSE = {
0
};
+typedef enum {
+ OPTION_ALWAYS_CORE,
+ OPTION_SEND_CORE_EVENTS,
+ OPTION_CORE_POINTER,
+ OPTION_SEND_DRAG_EVENTS,
+ OPTION_HISTORY_SIZE,
+ OPTION_DEVICE,
+ OPTION_PROTOCOL,
+ OPTION_BUTTONS,
+ OPTION_EMULATE_3_BUTTONS,
+ OPTION_EMULATE_3_TIMEOUT,
+ OPTION_CHORD_MIDDLE,
+ OPTION_FLIP_XY,
+ OPTION_INV_X,
+ OPTION_INV_Y,
+ OPTION_Z_AXIS_MAPPING,
+ OPTION_SAMPLE_RATE,
+ OPTION_RESOLUTION,
+ OPTION_CLEAR_DTR,
+ OPTION_CLEAR_RTS,
+ OPTION_BAUD_RATE,
+ OPTION_DATA_BITS,
+ OPTION_STOP_BITS,
+ OPTION_PARITY,
+ OPTION_FLOW_CONTROL,
+ OPTION_VTIME,
+ OPTION_VMIN
+} MouseOpts;
+
+static const OptionInfoRec MouseOptions[] = {
+ { OPTION_ALWAYS_CORE, "AlwaysCore", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_SEND_CORE_EVENTS, "SendCoreEvents", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_CORE_POINTER, "CorePointer", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_SEND_DRAG_EVENTS, "SendDragEvents", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_HISTORY_SIZE, "HistorySize", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_DEVICE, "Device", OPTV_STRING, {0}, FALSE },
+ { OPTION_PROTOCOL, "Protocol", OPTV_STRING, {0}, FALSE },
+ { OPTION_BUTTONS, "Buttons", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_EMULATE_3_BUTTONS, "Emulate3Buttons",OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_EMULATE_3_TIMEOUT, "Emulate3Timeout",OPTV_INTEGER, {0}, FALSE },
+ { OPTION_CHORD_MIDDLE, "ChordMiddle", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_FLIP_XY, "FlipXY", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_INV_X, "InvX", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_INV_Y, "InvY", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_Z_AXIS_MAPPING, "ZAxisMapping", OPTV_STRING, {0}, FALSE },
+ { OPTION_SAMPLE_RATE, "SampleRate", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_RESOLUTION, "Resolution", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_CLEAR_DTR, "ClearDTR", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_CLEAR_RTS, "ClearRTS", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_BAUD_RATE, "BaudRate", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_DATA_BITS, "DataBits", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_STOP_BITS, "StopBits", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_PARITY, "Parity", OPTV_STRING, {0}, FALSE },
+ { OPTION_FLOW_CONTROL, "FlowControl", OPTV_STRING, {0}, FALSE },
+ { OPTION_VTIME, "VTime", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_VMIN, "VMin", OPTV_INTEGER, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
+};
+
/*
* Microsoft (all serial models), Logitech MouseMan, First Mouse, etc,
* ALPS GlidePoint, Thinking Mouse.
@@ -198,6 +258,13 @@ static MouseProtocolRec mouseProtocols[] = {
{ NULL, MSE_NONE, NULL, PROT_UNKNOWN }
};
+/*ARGSUSED*/
+static const OptionInfoRec *
+MouseAvailableOptions(void *unused)
+{
+ return (MouseOptions);
+}
+
static MouseProtocolID
ProtocolNameToID(const char *name)
{
@@ -1767,7 +1834,7 @@ buttonTimer(OsTimerPtr timer, CARD32 now, pointer arg)
sigstate = xf86BlockSIGIO ();
- if ((id = stateTab[pMse->emulateState][4][0]) != 0) {ErrorF("0\n");
+ if ((id = stateTab[pMse->emulateState][4][0]) != 0) {
xf86PostButtonEvent(pInfo->dev, 0, abs(id), (id >= 0), 0, 0);
pMse->emulateState = stateTab[pMse->emulateState][4][2];
} else {
@@ -1905,6 +1972,14 @@ MousePostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy, int dz, int dw)
}
#ifdef XFree86LOADER
+ModuleInfoRec MouseInfo = {
+ 1,
+ "MOUSE",
+ NULL,
+ 0,
+ MouseAvailableOptions,
+};
+
static void
xf86MouseUnplug(pointer p)
{
@@ -1915,6 +1990,16 @@ xf86MousePlug(pointer module,
int *errmaj,
int *errmin)
{
+ static Bool Initialised = FALSE;
+
+ if (!Initialised) {
+ Initialised = TRUE;
+#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
+ if (xf86LoaderCheckSymbol("xf86AddModuleInfo"))
+#endif
+ xf86AddModuleInfo(&MouseInfo, module);
+ }
+
xf86AddInputDriver(&MOUSE, module, 0);
return module;
diff --git a/xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c b/xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c
index 8f7a88ec7..9be572756 100644
--- a/xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c
+++ b/xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c
@@ -24,7 +24,7 @@
* in this Software without prior written authorization from Metro Link.
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c,v 1.10 2000/08/11 19:10:47 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c,v 1.11 2001/05/15 18:22:22 paulo Exp $ */
#define _SPACEORB_C_
/*****************************************************************************
@@ -247,16 +247,19 @@ SpaceorbPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
static void
TearDownProc( pointer p )
{
- InputInfoPtr pInfo = (InputInfoPtr) p;
- SPACEORBPrivatePtr priv = (SPACEORBPrivatePtr) pInfo->private;
-
- DeviceOff (pInfo->dev);
+ if (!xf86ServerIsOnlyDetecting()) {
+
+ InputInfoPtr pInfo = (InputInfoPtr) p;
+ SPACEORBPrivatePtr priv = (SPACEORBPrivatePtr) pInfo->private;
+
+ DeviceOff (pInfo->dev);
- xf86CloseSerial (pInfo->fd);
- XisbFree (priv->buffer);
- xfree (priv);
- xfree (pInfo->name);
- xfree (pInfo);
+ xf86CloseSerial (pInfo->fd);
+ XisbFree (priv->buffer);
+ xfree (priv);
+ xfree (pInfo->name);
+ xfree (pInfo);
+ }
}
static Bool
diff --git a/xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c b/xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c
index 14a364218..9eb4bc8d3 100644
--- a/xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c
+++ b/xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c
@@ -24,7 +24,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c,v 1.9 2001/04/23 16:17:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c,v 1.10 2001/05/15 18:22:22 paulo Exp $ */
static const char identification[] = "$Identification: 18 $";
@@ -1614,7 +1614,6 @@ InputDriverRec SUMMA = {
static void
xf86SumUnplug(pointer p)
{
- DBG(2, ErrorF("xf86SumUnplug\n"));
}
/*
@@ -1628,8 +1627,6 @@ xf86SumPlug(pointer module,
int *errmaj,
int *errmin)
{
- DBG(2, ErrorF("xf86SumPlug\n"));
-
xf86AddInputDriver(&SUMMA, module, 0);
return module;
diff --git a/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c b/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c
index ed9aa453c..ec538f018 100644
--- a/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c
+++ b/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c
@@ -1,6 +1,6 @@
/* $XConsortium: xf86Wacom.c /main/20 1996/10/27 11:05:20 kaleb $ */
/*
- * Copyright 1995-2000 by Frederic Lepied, France. <Lepied@XFree86.org>
+ * Copyright 1995-2001 by Frederic Lepied, France. <Lepied@XFree86.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -22,7 +22,7 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c,v 1.26 2001/04/01 14:00:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c,v 1.27 2001/05/18 23:35:33 dawes Exp $ */
/*
* This driver is only able to handle the Wacom IV and Wacom V protocols.
@@ -33,30 +33,16 @@
* Many thanks to Dave Fleck from Wacom for the help provided to
* build this driver.
*
- * Modified for Linux USB by MATSUMURA Namihiko.
+ * Modified for Linux USB by MATSUMURA Namihiko,
* Daniel Egger, Germany. <egger@suse.de>,
- * Frederic Lepied <lepied@xfree86.org>.
+ * Frederic Lepied <lepied@xfree86.org>,
* Brion Vibber <brion@pobox.com>,
- * Aaron Optimizer Digulla <digulla@hepe.com>
+ * Aaron Optimizer Digulla <digulla@hepe.com>,
+ * Jonathan Layes <jonathan@layes.com>.
*
*/
-/*
- * Bugs fixed by Steve Day (Updated: Apr 5 1999)
- *
- * MaxX and MaxY values that the Wacom returns are now converted from
- * 1270lpi to the actual X and Y resolutions that the tablet is using.
- *
- * Buffer bug fixed when reading X and Y resolutions from config
- * string, now receives the true X and Y resolutions. This has the
- * side effect of being more compatible with other models of Wacom
- * that have varying lengths of headers.
- *
- * <steve@lineardesigns.co.uk>
- *
- */
-
-static const char identification[] = "$Identification: 20 $";
+static const char identification[] = "$Identification: 23 $";
#include "xf86Version.h"
@@ -68,6 +54,9 @@ static const char identification[] = "$Identification: 20 $";
#include <asm/types.h>
#include <linux/input.h>
+/* max number of input events to read in one read call */
+#define MAX_EVENTS 50
+
/* keithp - a hack to avoid redefinitions of these in xf86str.h */
#ifdef BUS_PCI
#undef BUS_PCI
@@ -170,6 +159,7 @@ static InputDriverPtr wcmDrv;
#include "xf86_Config.h"
#include "xf86Xinput.h"
#include "atKeynames.h"
+#include "xf86Version.h"
#endif
#if !defined(sun) || defined(i386)
@@ -270,7 +260,8 @@ typedef struct
double factorY; /* Y factor */
unsigned int serial; /* device serial number */
int initNumber; /* magic number for the init phasis */
-
+ int screen_no; /* associated screen */
+
struct _WacomCommonRec *common; /* common info pointer */
/* state fields */
@@ -344,6 +335,7 @@ typedef struct _WacomCommonRec
#define RESOLUTION_Y 21
#define RESOLUTION_Z 22
#define USB 23
+#define SCREEN_NO 24
#if !defined(sun) || defined(i386)
static SymTabRec WcmTab[] = {
@@ -371,6 +363,7 @@ static SymTabRec WcmTab[] = {
{ RESOLUTION_Y, "resolutiony" },
{ RESOLUTION_Z, "resolutionz" },
{ USB, "usb" },
+ { SCREEN_NO, "screenno" },
{ -1, "" }
};
@@ -523,6 +516,13 @@ static KeySymsRec wacom_keysyms = {
/******************************************************************************
* external declarations
*****************************************************************************/
+
+#ifdef LINUX_INPUT
+static void xf86WcmReadUSBInput(LocalDevicePtr);
+static Bool xf86WcmUSBOpen(LocalDevicePtr);
+#endif
+
+
#ifndef XFREE86_V4
#if defined(sun) && !defined(i386)
@@ -819,7 +819,7 @@ xf86WcmConfig(LocalDevicePtr *array,
case USB:
#ifdef LINUX_INPUT
- local->read_input=xf86WcmReadUSBInput;
+ dev->read_input=xf86WcmReadUSBInput;
common->wcmOpen=xf86WcmUSBOpen;
ErrorF("%s Wacom reading USB link\n", XCONFIG_GIVEN);
#else
@@ -827,6 +827,15 @@ xf86WcmConfig(LocalDevicePtr *array,
#endif
break;
+ case SCREEN_NO:
+ if (xf86GetToken(NULL) != NUMBER)
+ xf86ConfigError("Option number expected");
+ priv->screen_no = val->num;
+ if (xf86Verbose)
+ ErrorF("%s Wacom attached screen = %d\n", XCONFIG_GIVEN,
+ priv->screen_no);
+ break;
+
case EOF:
FatalError("Unexpected EOF (missing EndSubSection)");
break;
@@ -1163,16 +1172,25 @@ xf86WcmConvert(LocalDevicePtr local,
int* y)
{
WacomDevicePtr priv = (WacomDevicePtr) local->private;
-
+ int width, height;
+
DBG(6, ErrorF("xf86WcmConvert\n"));
if (first != 0 || num == 1)
return FALSE;
#ifdef XFREE86_V4
- priv->factorX = ((double) miPointerCurrentScreen()->width)
+ if (priv->screen_no != -1) {
+ width = screenInfo.screens[priv->screen_no]->width;
+ height = screenInfo.screens[priv->screen_no]->height;
+ } else {
+ width = miPointerCurrentScreen()->width;
+ height = miPointerCurrentScreen()->height;
+ }
+
+ priv->factorX = ((double) width)
/ (priv->bottomX - priv->topX);
- priv->factorY = ((double) miPointerCurrentScreen()->height)
+ priv->factorY = ((double) height)
/ (priv->bottomY - priv->topY);
#endif
@@ -1181,7 +1199,11 @@ xf86WcmConvert(LocalDevicePtr local,
DBG(6, ErrorF("Wacom converted v0=%d v1=%d to x=%d y=%d\n",
v0, v1, *x, *y));
-
+#ifdef XFREE86_V4
+ if (priv->screen_no != -1) {
+ xf86XInputSetScreen(local, priv->screen_no, *x, *y);
+ }
+#endif
return TRUE;
}
@@ -2083,6 +2105,31 @@ xf86WcmReadInput(LocalDevicePtr local)
/*
***************************************************************************
*
+ * xf86WcmIsUSBLine --
+ * Test if the attached device is a USB one.
+ *
+ ***************************************************************************
+ */
+static int
+xf86WcmIsUSBLine(int fd)
+{
+ int version;
+ int err;
+
+ SYSCALL(err = ioctl(fd, EVIOCGVERSION, &version));
+
+ if (!err) {
+ ErrorF("%s Wacom Kernel Input driver version is %d.%d.%d\n", XCONFIG_PROBED,
+ version >> 16, (version >> 8) & 0xff, version & 0xff);
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+/*
+ ***************************************************************************
+ *
* xf86WcmReadUSBInput --
* Read the new events from the device, and enqueue them.
*
@@ -2106,11 +2153,11 @@ xf86WcmReadUSBInput(LocalDevicePtr local)
ssize_t len;
int idx;
struct input_event * event;
- char eventbuf[BUFFER_SIZE];
+ char eventbuf[sizeof(struct input_event) * MAX_EVENTS];
#define MOD_BUTTONS(bit, value) \
{ int _b=bit, _v=value; buttons = (((_v) != 0) ? (buttons | _b) : (buttons & ~ _b)); }
- SYSCALL(len = read(local->fd, eventbuf, BUFFER_SIZE));
+ SYSCALL(len = read(local->fd, eventbuf, sizeof(eventbuf)));
if (len <= 0) {
ErrorF("Error reading wacom device : %s\n", strerror(errno));
@@ -2119,11 +2166,11 @@ xf86WcmReadUSBInput(LocalDevicePtr local)
for (event=(struct input_event *)eventbuf;
event<(struct input_event *)(eventbuf+len); event++) {
- DBG(10, ErrorF("event->type=%d\n", event->type));
+ DBG(10, ErrorF("xf86WcmReadUSBInput event->type=%d\n", event->type));
switch (event->type) {
case EV_ABS:
- DBG(10, ErrorF("event->code=%d\n", event->code));
+ DBG(10, ErrorF("xf86WcmReadUSBInput event->code=%d\n", event->code));
switch (event->code) {
case ABS_X:
x = event->value;
@@ -2134,6 +2181,7 @@ xf86WcmReadUSBInput(LocalDevicePtr local)
break;
case ABS_TILT_X:
+ case ABS_RZ:
tilt_x = event->value;
break;
@@ -2143,11 +2191,23 @@ xf86WcmReadUSBInput(LocalDevicePtr local)
case ABS_PRESSURE:
pressure = event->value;
+ MOD_BUTTONS (1, event->value > common->wcmThreshold ? 1 : 0);
break;
case ABS_DISTANCE:
/* This is not sent by the driver */
break;
+
+ case ABS_MISC:
+ serial = event->value;
+ DBG(10, ErrorF("wacom tool serial id=%d\n", serial));
+ break;
+
+ case ABS_WHEEL:
+ case ABS_THROTTLE:
+ wheel = event->value;
+ break;
+
}
break; /* EV_ABS */
@@ -2165,22 +2225,29 @@ xf86WcmReadUSBInput(LocalDevicePtr local)
case EV_KEY:
switch (event->code) {
case BTN_TOOL_PEN:
+ case BTN_TOOL_PENCIL:
+ case BTN_TOOL_BRUSH:
+ case BTN_TOOL_AIRBRUSH:
+ DBG(10, ErrorF("USB Stylus detected %x\n", event->code));
common->wcmIndex = STYLUS_ID;
is_proximity = (event->value != 0);
break;
case BTN_TOOL_RUBBER:
+ DBG(10, ErrorF("USB eraser detected %x\n", event->code));
common->wcmIndex = ERASER_ID;
is_proximity = (event->value != 0);
break;
case BTN_TOOL_MOUSE:
+ case BTN_TOOL_LENS:
+ DBG(10, ErrorF("USB mouse detected %x\n", event->code));
common->wcmIndex = CURSOR_ID;
is_proximity = (event->value != 0);
break;
case BTN_TOUCH:
- MOD_BUTTONS (1, event->value);
+ /* we use the pressure to determine the button 1 */
break;
case BTN_STYLUS:
@@ -2195,17 +2262,30 @@ xf86WcmReadUSBInput(LocalDevicePtr local)
MOD_BUTTONS (1, event->value);
break;
- case BTN_RIGHT:
+ case BTN_MIDDLE:
MOD_BUTTONS (2, event->value);
break;
- case BTN_MIDDLE:
+ case BTN_RIGHT:
MOD_BUTTONS (4, event->value);
break;
+
+ case BTN_SIDE:
+ MOD_BUTTONS (8, event->value);
+ break;
+
+ case BTN_EXTRA:
+ MOD_BUTTONS (16, event->value);
+ break;
}
break; /* EV_KEY */
- }
+ } /* switch event->type */
+ /* ABS_MISC is the event terminator */
+ if (event->type != EV_ABS || event->code != ABS_MISC) {
+ continue;
+ }
+
if ((is_proximity == priv->oldProximity) &&
(buttons == priv->oldButtons) &&
(ABS(x - priv->oldX) <= common->wcmSuppress) &&
@@ -2255,12 +2335,23 @@ xf86WcmReadUSBInput(LocalDevicePtr local)
*
***************************************************************************
*/
+
+#define BITS_PER_LONG (sizeof(long) * 8)
+#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
+#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
+#define OFF(x) ((x)%BITS_PER_LONG)
+#define LONG(x) ((x)/BITS_PER_LONG)
+
static Bool
xf86WcmUSBOpen(LocalDevicePtr local)
{
int err = 0;
WacomDevicePtr priv = (WacomDevicePtr)local->private;
WacomCommonPtr common = priv->common;
+ char name[256] = "Unknown";
+ int abs[5];
+ unsigned long bit[EV_MAX][NBITS(KEY_MAX)];
+ int i, j;
#ifdef XFREE86_V4
local->fd = xf86OpenSerial(local->options);
@@ -2272,6 +2363,42 @@ xf86WcmUSBOpen(LocalDevicePtr local)
return !Success;
}
+ ioctl(local->fd, EVIOCGNAME(sizeof(name)), name);
+ ErrorF("%s Wacom Kernel Input device name: \"%s\"\n", XCONFIG_PROBED, name);
+
+ memset(bit, 0, sizeof(bit));
+ ioctl(local->fd, EVIOCGBIT(0, EV_MAX), bit[0]);
+
+ for (i = 0; i < EV_MAX; i++)
+ if (test_bit(i, bit[0])) {
+ ioctl(local->fd, EVIOCGBIT(i, KEY_MAX), bit[i]);
+ for (j = 0; j < KEY_MAX; j++)
+ if (test_bit(j, bit[i])) {
+ if (i == EV_ABS) {
+ ioctl(local->fd, EVIOCGABS(j), abs);
+ switch (j) {
+ case ABS_X:
+ if (common->wcmMaxX == 0) {
+ common->wcmMaxX = abs[2];
+ }
+ break;
+
+ case ABS_Y:
+ if (common->wcmMaxY == 0) {
+ common->wcmMaxY = abs[2];
+ }
+ break;
+
+ case ABS_Z:
+ if (common->wcmMaxZ == DEFAULT_MAXZ) {
+ common->wcmMaxZ = abs[2];
+ }
+ break;
+ }
+ }
+ }
+ }
+
DBG(2, ErrorF("setup is max X=%d max Y=%d resol X=%d resol Y=%d\n",
common->wcmMaxX, common->wcmMaxY, common->wcmResolX,
common->wcmResolY));
@@ -2314,6 +2441,9 @@ xf86WcmUSBOpen(LocalDevicePtr local)
return !Success;
}
+ /* to have the button field handled as a bit field */
+ common->wcmProtocolLevel = 5;
+
return Success;
}
@@ -2386,6 +2516,23 @@ xf86WcmOpen(LocalDevicePtr local)
return !Success;
}
+#ifdef LINUX_INPUT
+ DBG(1, ErrorF("testing USB\n"));
+
+ if (xf86WcmIsUSBLine(local->fd)) {
+ int loop;
+
+ SYSCALL(close(local->fd));
+
+ for(loop=0; loop<common->wcmNumDevices; loop++) {
+ common->wcmDevices[loop]->read_input=xf86WcmReadUSBInput;
+ }
+ common->wcmOpen=xf86WcmUSBOpen;
+
+ return xf86WcmUSBOpen(local);
+ }
+#endif
+
DBG(1, ErrorF("initializing tablet\n"));
/* Set the speed of the serial link to 38400 */
@@ -2782,6 +2929,7 @@ xf86WcmOpenDevice(DeviceIntPtr pWcm)
double screenRatio, tabletRatio;
int gap;
int loop;
+ int screen_idx = 0;
if (local->fd < 0) {
if (common->wcmInitNumber > 2 ||
@@ -2840,12 +2988,24 @@ xf86WcmOpenDevice(DeviceIntPtr pWcm)
priv->bottomY, common->wcmMaxY);
priv->bottomY = common->wcmMaxY;
}
-
+
+ if (priv->screen_no != -1 &&
+ (priv->screen_no >= screenInfo.numScreens ||
+ priv->screen_no < 0)) {
+ ErrorF("%s: invalid screen number %d, resetting to 0\n",
+ local->name, priv->screen_no);
+ priv->screen_no = 0;
+ }
+
/* Calculate the ratio according to KeepShape, TopX and TopY */
+ if (priv->screen_no != -1) {
+ screen_idx = priv->screen_no;
+ }
+
if (priv->flags & KEEP_SHAPE_FLAG) {
- screenRatio = ((double) screenInfo.screens[0]->width)
- / screenInfo.screens[0]->height;
+ screenRatio = ((double) screenInfo.screens[screen_idx]->width)
+ / screenInfo.screens[screen_idx]->height;
tabletRatio = ((double) (common->wcmMaxX - priv->topX))
/ (common->wcmMaxY - priv->topY);
@@ -3213,6 +3373,9 @@ xf86WcmAllocate(char * name,
local->name = name;
local->flags = 0;
+#ifndef XFREE86_V4
+ local->device_config = xf86WcmConfig;
+#endif
local->device_control = xf86WcmProc;
local->read_input = xf86WcmReadInput;
local->control_proc = xf86WcmChangeControl;
@@ -3247,6 +3410,7 @@ xf86WcmAllocate(char * name,
priv->oldProximity = 0; /* previous proximity */
priv->serial = 0; /* serial number */
priv->initNumber = 0; /* magic number for the init phasis */
+ priv->screen_no = -1; /* associated screen */
common->wcmDevice = ""; /* device file name */
common->wcmSuppress = -1; /* transmit position if increment is superior */
@@ -3492,7 +3656,7 @@ xf86WcmInit(InputDriverPtr drv,
while(localDevices) {
if ((local != localDevices) &&
- (localDevices->read_input == xf86WcmReadInput) &&
+ (localDevices->device_control == xf86WcmProc) &&
(strcmp(((WacomDevicePtr)localDevices->private)->common->wcmDevice,
common->wcmDevice) == 0)) {
DBG(2, ErrorF("xf86WcmConfig wacom port share between"
@@ -3507,7 +3671,7 @@ xf86WcmInit(InputDriverPtr drv,
sizeof(LocalDevicePtr) * common->wcmNumDevices);
common->wcmDevices[common->wcmNumDevices - 1] = local;
break;
- }
+ }
localDevices = localDevices->next;
}
@@ -3519,7 +3683,7 @@ xf86WcmInit(InputDriverPtr drv,
xf86Msg(X_CONFIG, "%s serial device is %s\n", dev->identifier,
common->wcmDevice);
- debug_level = xf86SetIntOption(local->options, "DebugLevel", 0);
+ debug_level = xf86SetIntOption(local->options, "DebugLevel", debug_level);
if (debug_level > 0) {
xf86Msg(X_CONFIG, "WACOM: debug level set to %d\n", debug_level);
}
@@ -3539,26 +3703,33 @@ xf86WcmInit(InputDriverPtr drv,
xf86Msg(X_CONFIG, "%s is in %s mode\n", local->name,
(priv->flags & ABSOLUTE_FLAG) ? "absolute" : "relative");
- common->wcmSuppress = xf86SetIntOption(local->options, "Suppress", -1);
+ common->wcmSuppress = xf86SetIntOption(local->options, "Suppress", common->wcmSuppress);
if (common->wcmSuppress != -1) {
xf86Msg(X_CONFIG, "WACOM: suppress value is %d\n", XCONFIG_GIVEN,
common->wcmSuppress);
}
- if (xf86SetBoolOption(local->options, "Tilt", 0)) {
+ if (xf86SetBoolOption(local->options, "Tilt", (common->wcmFlags & TILT_FLAG))) {
common->wcmFlags |= TILT_FLAG;
}
- if (xf86SetBoolOption(local->options, "USB", 0)) {
#ifdef LINUX_INPUT
+ if (xf86SetBoolOption(local->options, "USB", (common->wcmOpen == xf86WcmUSBOpen))) {
local->read_input=xf86WcmReadUSBInput;
common->wcmOpen=xf86WcmUSBOpen;
xf86Msg(X_CONFIG, "%s: reading USB link\n", dev->identifier);
#else
+ if (xf86SetBoolOption(local->options, "USB", 0)) {
ErrorF("The USB version of the driver isn't available for your platform\n");
#endif
}
+ priv->screen_no = xf86SetIntOption(local->options, "ScreenNo", -1);
+ if (priv->screen_no != -1) {
+ xf86Msg(X_CONFIG, "%s: attached screen number %d\n", dev->identifier,
+ priv->screen_no);
+ }
+
if (xf86SetBoolOption(local->options, "KeepShape", 0)) {
priv->flags |= KEEP_SHAPE_FLAG;
xf86Msg(X_CONFIG, "%s: keeps shape\n", dev->identifier);
@@ -3587,37 +3758,37 @@ xf86WcmInit(InputDriverPtr drv,
xf86Msg(X_CONFIG, "%s: serial number = %u\n", dev->identifier,
priv->serial);
}
- common->wcmThreshold = xf86SetIntOption(local->options, "Threshold", INVALID_THRESHOLD);
+ common->wcmThreshold = xf86SetIntOption(local->options, "Threshold", common->wcmThreshold);
if (common->wcmThreshold != INVALID_THRESHOLD) {
xf86Msg(X_CONFIG, "%s: threshold = %d\n", dev->identifier,
common->wcmThreshold);
}
- common->wcmMaxX = xf86SetIntOption(local->options, "MaxX", 0);
+ common->wcmMaxX = xf86SetIntOption(local->options, "MaxX", common->wcmMaxX);
if (common->wcmMaxX != 0) {
xf86Msg(X_CONFIG, "%s: max x = %d\n", dev->identifier,
common->wcmMaxX);
}
- common->wcmMaxY = xf86SetIntOption(local->options, "MaxY", 0);
+ common->wcmMaxY = xf86SetIntOption(local->options, "MaxY", common->wcmMaxY);
if (common->wcmMaxY != 0) {
xf86Msg(X_CONFIG, "%s: max x = %d\n", dev->identifier,
common->wcmMaxY);
}
- common->wcmMaxZ = xf86SetIntOption(local->options, "MaxZ", DEFAULT_MAXZ);
+ common->wcmMaxZ = xf86SetIntOption(local->options, "MaxZ", common->wcmMaxZ);
if (common->wcmMaxZ != DEFAULT_MAXZ) {
xf86Msg(X_CONFIG, "%s: max x = %d\n", dev->identifier,
common->wcmMaxZ);
}
- common->wcmResolX = xf86SetIntOption(local->options, "ResolutionX", 0);
+ common->wcmResolX = xf86SetIntOption(local->options, "ResolutionX", common->wcmResolX);
if (common->wcmResolX != 0) {
xf86Msg(X_CONFIG, "%s: resol x = %d\n", dev->identifier,
common->wcmResolX);
}
- common->wcmResolY = xf86SetIntOption(local->options, "ResolutionY", 0);
+ common->wcmResolY = xf86SetIntOption(local->options, "ResolutionY", common->wcmResolY);
if (common->wcmResolY != 0) {
xf86Msg(X_CONFIG, "%s: resol x = %d\n", dev->identifier,
common->wcmResolY);
}
- common->wcmResolZ = xf86SetIntOption(local->options, "ResolutionZ", 0);
+ common->wcmResolZ = xf86SetIntOption(local->options, "ResolutionZ", common->wcmResolZ);
if (common->wcmResolZ != 0) {
xf86Msg(X_CONFIG, "%s: resol x = %d\n", dev->identifier,
common->wcmResolZ);
@@ -3704,8 +3875,8 @@ xf86WcmPlug(pointer module,
int *errmaj,
int *errmin)
{
- DBG(1, ErrorF("xf86WcmPlug\n"));
-
+ xf86Msg(X_INFO, "Wacom driver level: %s\n", identification+strlen("$Identification: "));
+
xf86AddInputDriver(&WACOM, module, 0);
return module;
diff --git a/xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO b/xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO
index 4bd2f4356..bba0c774f 100644
--- a/xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO
+++ b/xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO
@@ -216,13 +216,13 @@ The struct vga is used to hold the state of the legacy VGA access
registers if a legacy VGA device exists. xf86InitInt10() should
return a pointer to the xf86Int10InfoRec allocated.
-2. void MapCurrentInt10(xf86Int10InfoPtr pInt);
+2. Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
In case a platform specific mapping has to be performed to map the
memory allocated for the real mode memory environment into a specific
location prior to executing the x86 real mode code a function
- void MapCurrentInt10(xf86Int10InfoPtr pInt);
+ Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
has to be provided. It will be called by a helper function whenever
the active entity changes. If the vm86 mode is used it is most likely
@@ -341,4 +341,4 @@ XF86_AL,XF86_BL,XF86_CL,XF86_DL to access the lower byte of the
AX,BX,CX and DX register.
-$XFree86: xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO,v 1.2 2000/02/08 13:13:22 eich Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO,v 1.3 2001/04/30 14:34:57 tsi Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/int10/generic.c b/xc/programs/Xserver/hw/xfree86/int10/generic.c
index 0cde994a1..f5f48601b 100644
--- a/xc/programs/Xserver/hw/xfree86/int10/generic.c
+++ b/xc/programs/Xserver/hw/xfree86/int10/generic.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.18 2001/04/09 09:38:58 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.22.2.1 2001/05/28 14:23:39 eich Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
@@ -52,48 +52,29 @@ static void UnmapVRam(xf86Int10InfoPtr pInt);
static void *sysMem = NULL;
-typedef enum {
- INT10OPT_NOINT10
-} INT10Opts;
-
-static OptionInfoRec INT10Options[] = {
- { INT10OPT_NOINT10, "NoInt10", OPTV_BOOLEAN, {0}, FALSE },
- { -1, NULL, OPTV_NONE, {0}, FALSE },
-};
-
-#define nINT10Options (sizeof(INT10Options) / sizeof(INT10Options[0]))
-
xf86Int10InfoPtr
xf86InitInt10(int entityIndex)
{
xf86Int10InfoPtr pInt;
- ScrnInfoPtr pScrn;
int screen;
void* base = 0;
void* vbiosMem = 0;
+ void* options = NULL;
legacyVGARec vga;
+ xf86int10BiosLocation bios;
+
#ifdef _PC
CARD32 cs;
#endif
- /* Default Int10 enabled. */
- Bool noint10 = FALSE;
- OptionInfoRec options[nINT10Options];
-
- pScrn = (xf86FindScreenForEntity(entityIndex));
-
- (void)memcpy(options, INT10Options, sizeof(INT10Options));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
-
- xf86GetOptValBool(options, INT10OPT_NOINT10, &noint10);
-
- if (noint10)
- return NULL;
-
screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex;
- if (int10skip(xf86Screens[screen],entityIndex))
+ options = xf86HandleInt10Options(xf86Screens[screen],entityIndex);
+
+ if (int10skip(options)) {
+ xfree(options);
return NULL;
-
+ }
+
pInt = (xf86Int10InfoPtr)xnfcalloc(1, sizeof(xf86Int10InfoRec));
pInt->entityIndex = entityIndex;
if (!xf86Int10ExecSetup(pInt))
@@ -131,47 +112,107 @@ xf86InitInt10(int entityIndex)
xf86DrvMsg(screen, X_WARNING,
"Unable to retrieve all of segment 0x%06X.\n", cs);
+ xf86int10ParseBiosLocation(options,&bios);
+
if (xf86IsEntityPrimary(entityIndex)
- && !(initPrimary(xf86Screens[screen],entityIndex))) {
- cs = MEM_RW(pInt,((0x10<<2)+2));
+ && !(initPrimary(options))) {
- vbiosMem = (unsigned char *)base + (cs << 4);
- if (!int10_check_bios(screen, cs, vbiosMem)) {
- cs = MEM_RW(pInt, (0x42 << 2) + 2);
+ if (bios.bus == BUS_ISA && bios.location.legacy) {
+ xf86DrvMsg(screen, X_CONFIG,
+ "Overriding BIOS location: 0x%lx\n",
+ bios.location.legacy);
+ cs = bios.location.legacy >> 4;
vbiosMem = (unsigned char *)base + (cs << 4);
if (!int10_check_bios(screen, cs, vbiosMem)) {
- cs = V_BIOS >> 4;
+ xf86DrvMsg(screen, X_ERROR,
+ "No V_BIOS at specified address 0x%x\n",cs << 4);
+ goto error1;
+ }
+ } else {
+ if (bios.bus == BUS_PCI) {
+ xf86DrvMsg(screen, X_WARNING,
+ "Option BiosLocation for primary device ignored: "
+ "It points to PCI.\n");
+ xf86DrvMsg(screen, X_WARNING,
+ "You must set Option InitPrimary also\n");
+ }
+
+ cs = MEM_RW(pInt,((0x10<<2)+2));
+
+ vbiosMem = (unsigned char *)base + (cs << 4);
+ if (!int10_check_bios(screen, cs, vbiosMem)) {
+ cs = MEM_RW(pInt, (0x42 << 2) + 2);
vbiosMem = (unsigned char *)base + (cs << 4);
if (!int10_check_bios(screen, cs, vbiosMem)) {
- xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n");
- goto error1;
+ cs = V_BIOS >> 4;
+ vbiosMem = (unsigned char *)base + (cs << 4);
+ if (!int10_check_bios(screen, cs, vbiosMem)) {
+ xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n");
+ goto error1;
+ }
}
}
}
+
xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs);
set_return_trap(pInt);
pInt->BIOSseg = cs;
} else {
+ BusType location_type;
+ int bios_location = V_BIOS;
+ int pci_entity;
+
EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex);
reset_int_vect(pInt);
set_return_trap(pInt);
- vbiosMem = (unsigned char *)base + V_BIOS;
- switch (pEnt->location.type) {
+
+ if (bios.bus != BUS_NONE) {
+ switch (location_type = bios.bus) {
+ case BUS_PCI:
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "PCI:%i:%i%i\n",bios.location.pci.bus,
+ bios.location.pci.dev,bios.location.pci.func);
+ break;
+ case BUS_ISA:
+ bios_location = bios.location.legacy;
+ if (bios.location.legacy)
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "Legacy:0x%x\n",bios.location.legacy);
+ else
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "Legacy\n");
+ break;
+ default:
+ break;
+ }
+ } else
+ location_type = pEnt->location.type;
+
+ vbiosMem = (unsigned char *)base + bios_location;
+
+ switch (location_type) {
case BUS_PCI:
- if (!mapPciRom(pInt,(unsigned char *)(vbiosMem))) {
- xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (3)\n");
- goto error1;
+ if (bios.bus == BUS_PCI)
+ pci_entity = xf86GetPciEntity(bios.location.pci.bus,
+ bios.location.pci.dev,
+ bios.location.pci.func);
+ else
+ pci_entity = pInt->entityIndex;
+ if (!mapPciRom(pci_entity,(unsigned char *)(vbiosMem))) {
+ xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (3)\n");
+ goto error1;
}
break;
- case BUS_ISA:
+ case BUS_ISA:
#if 0
(void)memset(vbiosMem, 0, V_BIOS_SIZE);
- if (xf86ReadBIOS(V_BIOS, 0, vbiosMem, V_BIOS_SIZE) < V_BIOS_SIZE)
+ if (xf86ReadBIOS(bios_location, 0, vbiosMem, V_BIOS_SIZE)
+ < V_BIOS_SIZE)
xf86DrvMsg(screen, X_WARNING,
- "Unable to retrieve all of segment 0x0C0000.\n");
+ "Unable to retrieve all of segment 0x%x.\n",bios_location);
#endif
- if (!int10_check_bios(screen, V_BIOS >> 4, vbiosMem)) {
+ if (!int10_check_bios(screen, bios_location >> 4, vbiosMem)) {
xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (4)\n");
goto error1;
}
@@ -214,12 +255,48 @@ xf86InitInt10(int entityIndex)
* If this adapter is the primary, use its post-init BIOS (if we can find
* it).
*/
- if (!xf86IsEntityPrimary(entityIndex) ||
- !int10_check_bios(screen, V_BIOS >> 4, vbiosMem)) {
- if (!mapPciRom(pInt, vbiosMem)) {
- xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (5)\n");
- goto error1;
- }
+ xf86int10ParseBiosLocation(options,&bios);
+
+ {
+ int bios_location = V_BIOS;
+ Bool done = FALSE;
+ vbiosMem = (unsigned char *)base + bios_location;
+
+ if ((bios.bus == BUS_ISA)
+ || (bios.bus != BUS_PCI && xf86IsEntityPrimary(entityIndex))) {
+ if (bios.bus == BUS_ISA && bios.location.legacy) {
+ xf86DrvMsg(screen, X_CONFIG,"Looking for legacy V_BIOS "
+ "at 0x%x for %sprimary device\n",
+ bios.location.legacy,
+ xf86IsEntityPrimary(entityIndex) ? "" : "non-");
+ bios_location = bios.location.legacy;
+ vbiosMem = (unsigned char *)base + bios_location;
+ }
+ if (int10_check_bios(screen, bios_location >> 4, vbiosMem))
+ done = TRUE;
+ else
+ xf86DrvMsg(screen,X_INFO,
+ "No legacy BIOS found -- trying PCI\n");
+ }
+ if (!done) {
+ int pci_entity;
+
+ if (bios.bus == BUS_PCI) {
+ xf86DrvMsg(screen,X_CONFIG,"Looking for BIOS at PCI:%i%i%i\n",
+ bios.location.pci.bus,bios.location.pci.dev,
+ bios.location.pci.func);
+ pci_entity = xf86GetPciEntity(bios.location.pci.bus,
+ bios.location.pci.dev,
+ bios.location.pci.func);
+ } else
+ pci_entity = pInt->entityIndex;
+
+ if (!mapPciRom(pci_entity, vbiosMem)) {
+ xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (5)\n");
+ goto error1;
+ }
+ }
+
}
pInt->BIOSseg = V_BIOS >> 4;
@@ -228,6 +305,7 @@ xf86InitInt10(int entityIndex)
xf86ExecX86int10(pInt);
UnlockLegacyVGA(screen, &vga);
#endif
+ xfree(options);
return pInt;
error1:
@@ -237,7 +315,8 @@ xf86InitInt10(int entityIndex)
xfree(pInt->private);
error0:
xfree(pInt);
-
+ xfree(options);
+
return NULL;
}
@@ -261,10 +340,11 @@ UnmapVRam(xf86Int10InfoPtr pInt)
xf86UnMapVidMem(screen, INTPriv(pInt)->vRam, size);
}
-void
+Bool
MapCurrentInt10(xf86Int10InfoPtr pInt)
{
- /* nothing to do here */
+ /* nothing to do here */
+ return TRUE;
}
void
diff --git a/xc/programs/Xserver/hw/xfree86/int10/helper_exec.c b/xc/programs/Xserver/hw/xfree86/int10/helper_exec.c
index edcfedb0e..496ea53c8 100644
--- a/xc/programs/Xserver/hw/xfree86/int10/helper_exec.c
+++ b/xc/programs/Xserver/hw/xfree86/int10/helper_exec.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.15 2001/03/25 05:32:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.16 2001/04/30 14:34:57 tsi Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
@@ -34,7 +34,8 @@ int
setup_int(xf86Int10InfoPtr pInt)
{
if (pInt != Int10Current) {
- MapCurrentInt10(pInt);
+ if (!MapCurrentInt10(pInt))
+ return -1;
Int10Current = pInt;
}
X86_EAX = (CARD32) pInt->ax;
diff --git a/xc/programs/Xserver/hw/xfree86/int10/helper_mem.c b/xc/programs/Xserver/hw/xfree86/int10/helper_mem.c
index cd434bf9e..c8d6f689e 100644
--- a/xc/programs/Xserver/hw/xfree86/int10/helper_mem.c
+++ b/xc/programs/Xserver/hw/xfree86/int10/helper_mem.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_mem.c,v 1.18 2001/03/03 22:46:32 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_mem.c,v 1.20.2.1 2001/05/22 16:26:46 tsi Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
@@ -17,17 +17,17 @@
typedef enum {
OPT_NOINT10,
- OPT_INIT_PRIMARY
+ OPT_INIT_PRIMARY,
+ OPT_BIOS_LOCATION
} INT10Opts;
-static OptionInfoRec INT10Options[] = {
+static const OptionInfoRec INT10Options[] = {
{OPT_NOINT10, "NoINT10", OPTV_BOOLEAN, {0}, FALSE },
{OPT_INIT_PRIMARY, "InitPrimary", OPTV_BOOLEAN, {0}, FALSE },
+ {OPT_BIOS_LOCATION, "BiosLocation", OPTV_STRING, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE },
};
-#define nINT10Options (sizeof(INT10Options) / sizeof(INT10Options[0]))
-
#ifdef DEBUG
void
dprint(unsigned long start, unsigned long size)
@@ -186,12 +186,12 @@ set_return_trap(xf86Int10InfoPtr pInt)
xf86Int10AllocPages(pInt, 1, &pInt->stackseg);
}
-Bool
-int10skip(ScrnInfoPtr pScrn, int entityIndex)
+void *
+xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex)
{
- Bool noint10 = FALSE;
EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
-
+ OptionInfoPtr options = NULL;
+
if (pEnt->device) {
pointer configOptions = NULL;
@@ -203,18 +203,28 @@ int10skip(ScrnInfoPtr pScrn, int entityIndex)
configOptions = pEnt->device->options;
if (configOptions) {
- OptionInfoRec options[nINT10Options];
-
+ if (!(options = (OptionInfoPtr) xalloc(sizeof(INT10Options))))
+ return NULL;
+
(void)memcpy(options, INT10Options, sizeof(INT10Options));
xf86ProcessOptions(pScrn->scrnIndex, configOptions, options);
- xf86GetOptValBool(options, OPT_NOINT10, &noint10);
}
}
xfree(pEnt);
- return noint10;
+ return options;
}
+Bool
+int10skip(void* options)
+{
+ Bool noint10 = FALSE;
+
+ if (!options) return FALSE;
+
+ xf86GetOptValBool(options, OPT_NOINT10, &noint10);
+ return noint10;
+}
Bool
int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem)
@@ -244,19 +254,70 @@ int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem)
}
Bool
-initPrimary(ScrnInfoPtr pScrn, int entityIndex)
+initPrimary(void* options)
{
Bool initPrimary = FALSE;
- EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
+
+ if (!options) return FALSE;
- if (pEnt->device && pEnt->device->options) {
- OptionInfoRec options[nINT10Options];
+ xf86GetOptValBool(options, OPT_INIT_PRIMARY, &initPrimary);
+ return initPrimary;
+}
- (void)memcpy(options, INT10Options, sizeof(INT10Options));
- xf86ProcessOptions(pScrn->scrnIndex, pEnt->device->options, options);
- xf86GetOptValBool(options, OPT_INIT_PRIMARY, &initPrimary);
- }
- xfree(pEnt);
+void
+xf86int10ParseBiosLocation(void* options,
+ xf86int10BiosLocationPtr bios)
+{
+ char *s;
+ char *p;
+ char *str = NULL;
- return initPrimary;
+ if (options)
+ str = xf86GetOptValString(options,OPT_BIOS_LOCATION);
+
+ bios->bus = BUS_NONE;
+ if (!str)
+ return;
+
+ s = xstrdup(str);
+ p = strtok(s,":");
+ if (xf86NameCmp(p,"pci")) bios->bus = BUS_PCI;
+ else
+ if (xf86NameCmp(p,"primary")) bios->bus = BUS_ISA;
+
+ xfree(s);
+
+ if (bios->bus == BUS_NONE) return;
+
+ s = xstrdup(str);
+ p = strchr(s, ':');
+
+ switch (bios->bus) {
+ case BUS_ISA:
+ if (p)
+ bios->location.legacy = atoi(++p);
+ else
+ bios->location.legacy = 0;
+ break;
+ case BUS_PCI:
+ if (p) {
+ bios->location.pci.bus = atoi(++p);
+ if ((p = strchr(p, ':'))) {
+ bios->location.pci.dev = atoi(++p);
+ if ((p = strchr(p, ':'))) {
+ bios->location.pci.func = atoi(++p);
+ break;
+ }
+ }
+ }
+ /* fall through */
+ bios->bus = BUS_NONE;
+ break;
+ default:
+ break;
+ }
+ xfree(s);
}
+
+
+
diff --git a/xc/programs/Xserver/hw/xfree86/int10/pci.c b/xc/programs/Xserver/hw/xfree86/int10/pci.c
index 9b523ae82..1f4899e78 100644
--- a/xc/programs/Xserver/hw/xfree86/int10/pci.c
+++ b/xc/programs/Xserver/hw/xfree86/int10/pci.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/pci.c,v 1.6 2001/01/06 20:19:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/pci.c,v 1.8.2.2 2001/05/25 18:15:46 eich Exp $ */
/*
* XFree86 int10 module
@@ -12,14 +12,13 @@
#include "xf86int10.h"
int
-mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address)
+mapPciRom(int pciEntity, unsigned char * address)
{
PCITAG tag;
- unsigned long offset = 0;
unsigned char *mem, *ptr;
int length;
-
- pciVideoPtr pvp = xf86GetPciInfoForEntity(pInt->entityIndex);
+
+ pciVideoPtr pvp = xf86GetPciInfoForEntity(pciEntity);
if (pvp == NULL) {
#ifdef DEBUG
@@ -33,7 +32,7 @@ mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address)
/* Read in entire PCI ROM */
mem = ptr = xnfcalloc(length, 1);
- if (xf86ReadPciBIOS(offset, tag, -1, ptr, length) < length) {
+ if (xf86ReadPciBIOS(0, tag, -1, ptr, length) == 0) {
xfree(mem);
#ifdef DEBUG
ErrorF("mapPciRom: cannot read BIOS\n");
@@ -41,6 +40,7 @@ mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address)
return 0;
}
+ length = 0;
while ((ptr[0] == 0x55) && (ptr[1] == 0xAA)) {
unsigned short data_off = ptr[0x18] | (ptr[0x19] << 8);
unsigned char *data = ptr + data_off;
diff --git a/xc/programs/Xserver/hw/xfree86/int10/stub.c b/xc/programs/Xserver/hw/xfree86/int10/stub.c
index c46160f5d..a6647ca29 100644
--- a/xc/programs/Xserver/hw/xfree86/int10/stub.c
+++ b/xc/programs/Xserver/hw/xfree86/int10/stub.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/stub.c,v 1.2 2000/02/12 03:39:57 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/stub.c,v 1.3 2001/04/30 14:34:57 tsi Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
@@ -16,10 +16,10 @@ xf86InitInt10(int entityIndex)
return NULL;
}
-void
+Bool
MapCurrentInt10(xf86Int10InfoPtr pInt)
{
- return;
+ return FALSE;
}
void
diff --git a/xc/programs/Xserver/hw/xfree86/int10/xf86int10.h b/xc/programs/Xserver/hw/xfree86/int10/xf86int10.h
index b2ffd420d..02fa446b2 100644
--- a/xc/programs/Xserver/hw/xfree86/int10/xf86int10.h
+++ b/xc/programs/Xserver/hw/xfree86/int10/xf86int10.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.h,v 1.19 2001/03/03 22:46:32 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.h,v 1.21 2001/05/15 10:19:41 eich Exp $ */
/*
* XFree86 int10 module
@@ -53,6 +53,18 @@ typedef struct {
CARD8 save_46e8;
} legacyVGARec, *legacyVGAPtr;
+typedef struct {
+ BusType bus;
+ union {
+ struct {
+ int bus;
+ int dev;
+ int func;
+ } pci;
+ int legacy;
+ } location;
+} xf86int10BiosLocation, *xf86int10BiosLocationPtr;
+
/* OS dependent functions */
xf86Int10InfoPtr xf86InitInt10(int entityIndex);
void xf86FreeInt10(xf86Int10InfoPtr pInt);
@@ -101,7 +113,7 @@ void xf86ExecX86int10(xf86Int10InfoPtr pInt);
#define MEM_WL(name, addr, val) (*name->mem->wl)(name, addr, val)
/* OS dependent functions */
-void MapCurrentInt10(xf86Int10InfoPtr pInt);
+Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
/* x86 executor related functions */
Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
@@ -154,15 +166,18 @@ void setup_int_vect(xf86Int10InfoPtr pInt);
int setup_system_bios(void *base_addr);
void reset_int_vect(xf86Int10InfoPtr pInt);
void set_return_trap(xf86Int10InfoPtr pInt);
-Bool int10skip(ScrnInfoPtr pScrn, int entityIndex);
+void * xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex);
+Bool int10skip(void* options);
Bool int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem);
-Bool initPrimary(ScrnInfoPtr pScrn, int entityIndex);
+Bool initPrimary(void* options);
+void xf86int10ParseBiosLocation(void* options,
+ xf86int10BiosLocationPtr bios);
#ifdef DEBUG
void dprint(unsigned long start, unsigned long size);
#endif
/* pci.c */
-int mapPciRom(xf86Int10InfoPtr pInt, unsigned char *address);
+int mapPciRom(int pciEntity, unsigned char *address);
#endif /* _INT10_PRIVATE */
#endif /* _XF86INT10_H */
diff --git a/xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c b/xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c
index d98bf5a90..6d8011ab0 100644
--- a/xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c
+++ b/xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c,v 1.10 2001/01/06 20:19:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c,v 1.11 2001/04/30 14:34:58 tsi Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
@@ -32,6 +32,9 @@ xf86ExecX86int10(xf86Int10InfoPtr pInt)
{
int sig = setup_int(pInt);
+ if (sig < 0)
+ return;
+
if (int_handler(pInt)) {
X86EMU_exec();
}
diff --git a/xc/programs/Xserver/hw/xfree86/loader/elf.h b/xc/programs/Xserver/hw/xfree86/loader/elf.h
index b5fbbc386..f7dd743da 100644
--- a/xc/programs/Xserver/hw/xfree86/loader/elf.h
+++ b/xc/programs/Xserver/hw/xfree86/loader/elf.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elf.h,v 1.10 2001/01/06 20:19:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elf.h,v 1.11 2001/04/27 19:34:00 tsi Exp $ */
typedef unsigned int Elf32_Addr;
@@ -166,19 +166,39 @@ extern Elf32_Dyn _DYNAMIC [];
#define R_SPARC_JMP_SLOT 21
#define R_SPARC_RELATIVE 22
#define R_SPARC_UA32 23
-#define R_SPARC_PLT32 24
-#define R_SPARC_HIPLT22 25
-#define R_SPARC_LOPLT10 26
-#define R_SPARC_PCPLT32 27
-#define R_SPARC_PCPLT22 28
-#define R_SPARC_PCPLT10 29
-#define R_SPARC_10 30
-#define R_SPARC_11 31
-#define R_SPARC_WDISP16 40
-#define R_SPARC_WDISP19 41
-#define R_SPARC_7 43
-#define R_SPARC_5 44
-#define R_SPARC_6 45
+#define R_SPARC_PLT32 24
+#define R_SPARC_HIPLT22 25
+#define R_SPARC_LOPLT10 26
+#define R_SPARC_PCPLT32 27
+#define R_SPARC_PCPLT22 28
+#define R_SPARC_PCPLT10 29
+#define R_SPARC_10 30
+#define R_SPARC_11 31
+#define R_SPARC_64 32
+#define R_SPARC_OLO10 33
+#define R_SPARC_HH22 34
+#define R_SPARC_HM10 35
+#define R_SPARC_LM22 36
+#define R_SPARC_PC_HH22 37
+#define R_SPARC_PC_HM10 38
+#define R_SPARC_PC_LM22 39
+#define R_SPARC_WDISP16 40
+#define R_SPARC_WDISP19 41
+#define R_SPARC_GLOB_JMP 42
+#define R_SPARC_7 43
+#define R_SPARC_5 44
+#define R_SPARC_6 45
+#define R_SPARC_DISP64 46
+#define R_SPARC_PLT64 47
+#define R_SPARC_HIX22 48
+#define R_SPARC_LOX10 49
+#define R_SPARC_H44 50
+#define R_SPARC_M44 51
+#define R_SPARC_L44 52
+#define R_SPARC_REGISTER 53
+#define R_SPARC_UA64 54
+#define R_SPARC_UA16 55
+#define R_SPARC_NUM 56
/* m68k Relocation Types */
#define R_68K_NONE 0 /* No reloc */
diff --git a/xc/programs/Xserver/hw/xfree86/loader/elfloader.c b/xc/programs/Xserver/hw/xfree86/loader/elfloader.c
index 773665b37..e3c0fc752 100644
--- a/xc/programs/Xserver/hw/xfree86/loader/elfloader.c
+++ b/xc/programs/Xserver/hw/xfree86/loader/elfloader.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.36 2001/04/01 14:00:14 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.37 2001/04/27 19:34:00 tsi Exp $ */
/*
*
@@ -1774,97 +1774,102 @@ int force;
#endif /* PowerMAX_OS */
#endif /* __powerpc__ */
#ifdef __sparc__
- case R_SPARC_RELATIVE:
- dest32 = (unsigned int *)(secp + rel->r_offset);
- *dest32 += (unsigned int)secp + rel->r_addend;
- break;
-
- case R_SPARC_GLOB_DAT:
- case R_SPARC_32:
- dest32 = (unsigned int *)(secp + rel->r_offset);
- symval += rel->r_addend;
- *dest32 = symval;
+ case R_SPARC_NONE: /* 0 */
break;
- case R_SPARC_JMP_SLOT:
- dest32 = (unsigned int *)(secp + rel->r_offset);
- /* Before we change it the PLT entry looks like:
- *
- * pltent: sethi %hi(rela_plt_offset), %g1
- * b,a PLT0
- * nop
- *
- * We change it into:
- *
- * pltent: sethi %hi(rela_plt_offset), %g1
- * sethi %hi(symval), %g1
- * jmp %g1 + %lo(symval), %g0
- */
- symval += rel->r_addend;
- dest32[2] = 0x81c06000 | (symval & 0x3ff);
- __asm __volatile("flush %0 + 0x8" : : "r" (dest32));
- dest32[1] = 0x03000000 | (symval >> 10);
- __asm __volatile("flush %0 + 0x4" : : "r" (dest32));
- break;
-
- case R_SPARC_8:
+ case R_SPARC_8: /* 1 */
dest8 = (unsigned char *)(secp + rel->r_offset);
symval += rel->r_addend;
*dest8 = symval;
break;
- case R_SPARC_16:
+ case R_SPARC_16: /* 2 */
dest16 = (unsigned short *)(secp + rel->r_offset);
symval += rel->r_addend;
*dest16 = symval;
break;
- case R_SPARC_DISP8:
+ case R_SPARC_32: /* 3 */
+ case R_SPARC_GLOB_DAT: /* 20 */
+ case R_SPARC_UA32: /* 23 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ ((unsigned char *)dest32)[0] = (unsigned char)(symval >> 24);
+ ((unsigned char *)dest32)[1] = (unsigned char)(symval >> 16);
+ ((unsigned char *)dest32)[2] = (unsigned char)(symval >> 8);
+ ((unsigned char *)dest32)[3] = (unsigned char)(symval );
+ break;
+
+ case R_SPARC_DISP8: /* 4 */
dest8 = (unsigned char *)(secp + rel->r_offset);
symval += rel->r_addend;
*dest8 = (symval - (Elf32_Addr) dest8);
break;
- case R_SPARC_DISP16:
+ case R_SPARC_DISP16: /* 5 */
dest16 = (unsigned short *)(secp + rel->r_offset);
symval += rel->r_addend;
*dest16 = (symval - (Elf32_Addr) dest16);
break;
- case R_SPARC_DISP32:
+ case R_SPARC_DISP32: /* 6 */
dest32 = (unsigned int *)(secp + rel->r_offset);
symval += rel->r_addend;
*dest32 = (symval - (Elf32_Addr) dest32);
break;
- case R_SPARC_LO10:
- dest32 = (unsigned int *)(secp + rel->r_offset);
- symval += rel->r_addend;
- *dest32 = (*dest32 & ~0x3ff) | (symval & 0x3ff);
- break;
-
- case R_SPARC_WDISP30:
+ case R_SPARC_WDISP30: /* 7 */
dest32 = (unsigned int *)(secp + rel->r_offset);
symval += rel->r_addend;
*dest32 = ((*dest32 & 0xc0000000) |
((symval - (Elf32_Addr) dest32) >> 2));
break;
- case R_SPARC_HI22:
+ case R_SPARC_HI22: /* 9 */
dest32 = (unsigned int *)(secp + rel->r_offset);
symval += rel->r_addend;
*dest32 = (*dest32 & 0xffc00000) | (symval >> 10);
break;
- case R_SPARC_NONE:
+ case R_SPARC_LO10: /* 12 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest32 = (*dest32 & ~0x3ff) | (symval & 0x3ff);
break;
- case R_SPARC_COPY:
+ case R_SPARC_COPY: /* 19 */
/* Fix your code... I'd rather dish out an error here
* so people will not link together PIC and non-PIC
* code into a final driver object file.
*/
- ErrorF("Elf_RelocateEntry() Copy relocs not supported on Sparc.\n");
+ ErrorF("Elf_RelocateEntry():"
+ " Copy relocs not supported on Sparc.\n");
+ break;
+
+ case R_SPARC_JMP_SLOT: /* 21 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ /* Before we change it the PLT entry looks like:
+ *
+ * pltent: sethi %hi(rela_plt_offset), %g1
+ * b,a PLT0
+ * nop
+ *
+ * We change it into:
+ *
+ * pltent: sethi %hi(rela_plt_offset), %g1
+ * sethi %hi(symval), %g1
+ * jmp %g1 + %lo(symval), %g0
+ */
+ symval += rel->r_addend;
+ dest32[2] = 0x81c06000 | (symval & 0x3ff);
+ __asm __volatile("flush %0 + 0x8" : : "r" (dest32));
+ dest32[1] = 0x03000000 | (symval >> 10);
+ __asm __volatile("flush %0 + 0x4" : : "r" (dest32));
+ break;
+
+ case R_SPARC_RELATIVE: /* 22 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ *dest32 += (unsigned int)secp + rel->r_addend;
break;
#endif
#ifdef __ia64__
diff --git a/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c b/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c
index 2be9e1c01..a36c48e3f 100644
--- a/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c
+++ b/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.190 2001/04/05 17:42:34 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.193 2001/05/19 00:26:45 dawes Exp $ */
/*
*
@@ -208,7 +208,7 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86UnbindGARTMemory)
SYMFUNC(xf86EnableAGP)
SYMFUNC(xf86SoundKbdBell)
-
+ SYMFUNC(xf86GARTCloseScreen)
#ifdef XINPUT
/* XISB routines (Merged from Metrolink tree) */
SYMFUNC(XisbNew)
@@ -409,6 +409,8 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86IsScreenPrimary)
SYMFUNC(xf86RegisterRootWindowProperty)
SYMFUNC(xf86IsUnblank)
+ SYMFUNC(xf86AddModuleInfo)
+ SYMFUNC(xf86DeleteModuleInfo)
#ifdef __sparc__
/* xf86sbusBus.c */
@@ -549,6 +551,9 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(VidModeGetModeValue)
SYMFUNC(VidModeSetModeValue)
SYMFUNC(VidModeGetMonitorValue)
+ SYMFUNC(VidModeSetGammaRamp)
+ SYMFUNC(VidModeGetGammaRamp)
+ SYMFUNC(VidModeGetGammaRampSize)
#endif
/* xf86MiscExt.c */
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c b/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c
index c849eb7c5..ac503f679 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.45 2001/03/25 05:32:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.48.2.1 2001/05/21 05:00:36 tsi Exp $ */
/*
* Pci.c - New server PCI access functions
*
@@ -559,7 +559,7 @@ pciGetBaseSize(PCITAG tag, int index, Bool destructive, Bool *min)
else
mask1 = PCIGETIO(mask1);
else
- mask1 = PCIGETROM(mask1);
+ mask1 = PCIGETROM(mask1);
if (mask1 == 0)
return 0;
bits = 0;
@@ -568,7 +568,12 @@ pciGetBaseSize(PCITAG tag, int index, Bool destructive, Bool *min)
mask1 >>= 1;
}
/* I/O maps can be no larger than 8 bits */
+
+#if defined(Lynx) && defined(__powerpc__)
+ if (PCI_MAP_IS_IO(addr1) && bits > 8)
+#else
if ((index < 6) && PCI_MAP_IS_IO(addr1) && bits > 8)
+#endif
bits = 8;
/* ROM maps can be no larger than 24 bits */
if (index == 6 && bits > 24)
@@ -623,20 +628,20 @@ pciMfDev(int busnum, int devnum)
PCITAG
pciGenFindNext(void)
{
- unsigned long devid, tmp;
- unsigned char base_class, sub_class, sec_bus, pri_bus;
- Bool speculativeProbe = FALSE;
+ unsigned long devid, tmp;
+ unsigned char base_class, sub_class, sec_bus, pri_bus;
+ Bool speculativeProbe = FALSE;
#ifdef DEBUGPCI
-ErrorF("pciGenFindNext\n");
+ ErrorF("pciGenFindNext\n");
#endif
- for (;;) {
+ for (;;) {
#ifdef DEBUGPCI
-ErrorF("pciGenFindNext: pciBusNum %d\n", pciBusNum);
+ ErrorF("pciGenFindNext: pciBusNum %d\n", pciBusNum);
#endif
- if (pciBusNum == -1) {
+ if (pciBusNum == -1) {
/*
* Start at top of the order
*/
@@ -646,34 +651,32 @@ ErrorF("pciGenFindNext: pciBusNum %d\n", pciBusNum);
pciBusNum = 0;
pciFuncNum = 0;
pciDevNum = 0;
- }
- else {
+ } else {
#ifdef PCI_MFDEV_SUPPORT
#ifdef DEBUGPCI
-ErrorF("pciGenFindNext: pciFuncNum %d\n", pciFuncNum);
+ ErrorF("pciGenFindNext: pciFuncNum %d\n", pciFuncNum);
#endif
/*
* Somewhere in middle of order. Determine who's
* next up
*/
if (pciFuncNum == 0) {
+ /*
+ * Is current dev a multifunction device?
+ */
+ if (pciMfDev(pciBusNum, pciDevNum))
+ /* Probe for other functions */
+ pciFuncNum = 1;
+ else
/*
- * Is current dev a multifunction device?
+ * No more functions this device. Next
+ * device please
*/
- if (pciMfDev(pciBusNum, pciDevNum))
- /* Probe for other functions */
- pciFuncNum = 1;
- else
- /*
- * No more functions this device. Next
- * device please
- */
- pciDevNum ++;
- }
- else if (++pciFuncNum >= 8) {
- /* No more functions for this device. Next device please */
- pciFuncNum = 0;
pciDevNum ++;
+ } else if (++pciFuncNum >= 8) {
+ /* No more functions for this device. Next device please */
+ pciFuncNum = 0;
+ pciDevNum ++;
}
#else
pciDevNum ++;
@@ -682,116 +685,113 @@ ErrorF("pciGenFindNext: pciFuncNum %d\n", pciFuncNum);
!pciBusInfo[pciBusNum] ||
pciDevNum >= pciBusInfo[pciBusNum]->numDevices) {
#ifdef DEBUGPCI
-ErrorF("pciGenFindNext: next bus\n");
+ ErrorF("pciGenFindNext: next bus\n");
#endif
- /*
- * No more devices for this bus. Next bus please
- */
- if (speculativeProbe) {
- xfree(pciBusInfo[pciBusNum]);
- pciBusInfo[pciBusNum] = NULL;
- }
+ /*
+ * No more devices for this bus. Next bus please
+ */
+ if (speculativeProbe) {
+ xfree(pciBusInfo[pciBusNum]);
+ pciBusInfo[pciBusNum] = NULL;
+ }
- if (++pciBusNum >= MAX_PCI_BUSES) {
+ if (++pciBusNum >= MAX_PCI_BUSES) {
#ifdef DEBUGPCI
-ErrorF("pciGenFindNext: out of buses\n");
+ ErrorF("pciGenFindNext: out of buses\n");
#endif
- /* No more buses. All done for now */
- return(PCI_NOT_FOUND);
- }
+ /* No more buses. All done for now */
+ return(PCI_NOT_FOUND);
+ }
- pciDevNum = 0;
+ pciDevNum = 0;
}
- }
+ }
#ifdef DEBUGPCI
-ErrorF("pciGenFindNext: pciBusInfo[%d] = 0x%lx\n", pciBusNum, pciBusInfo[pciBusNum]);
+ ErrorF("pciGenFindNext: pciBusInfo[%d] = 0x%lx\n", pciBusNum, pciBusInfo[pciBusNum]);
#endif
- if (!pciBusInfo[pciBusNum]) {
- pciBusInfo[pciBusNum] = xnfalloc(sizeof(pciBusInfo_t));
- *pciBusInfo[pciBusNum] = *pciBusInfo[0];
+ if (!pciBusInfo[pciBusNum]) {
+ pciBusInfo[pciBusNum] = xnfalloc(sizeof(pciBusInfo_t));
+ *pciBusInfo[pciBusNum] = *pciBusInfo[0];
- speculativeProbe = TRUE;
- }
+ speculativeProbe = TRUE;
+ }
- /*
- * At this point, pciBusNum, pciDevNum, and pciFuncNum have been
- * advanced to the next device. Compute the tag, and read the
- * device/vendor ID field.
- */
+ /*
+ * At this point, pciBusNum, pciDevNum, and pciFuncNum have been
+ * advanced to the next device. Compute the tag, and read the
+ * device/vendor ID field.
+ */
#ifdef DEBUGPCI
-ErrorF("pciGenFindNext: [%d, %d, %d]\n", pciBusNum, pciDevNum, pciFuncNum);
+ ErrorF("pciGenFindNext: [%d, %d, %d]\n", pciBusNum, pciDevNum, pciFuncNum);
#endif
- pciDeviceTag = PCI_MAKE_TAG(pciBusNum, pciDevNum, pciFuncNum);
- inProbe = TRUE;
- devid = pciReadLong(pciDeviceTag, 0);
- inProbe = FALSE;
+ pciDeviceTag = PCI_MAKE_TAG(pciBusNum, pciDevNum, pciFuncNum);
+ inProbe = TRUE;
+ devid = pciReadLong(pciDeviceTag, 0);
+ inProbe = FALSE;
#ifdef DEBUGPCI
-ErrorF("pciGenFindNext: pciDeviceTag = 0x%lx, devid = 0x%lx\n", pciDeviceTag, devid);
+ ErrorF("pciGenFindNext: pciDeviceTag = 0x%lx, devid = 0x%lx\n", pciDeviceTag, devid);
#endif
- if (devid == 0xffffffff)
+ if (devid == 0xffffffff)
continue; /* Nobody home. Next device please */
- if (speculativeProbe && (pciNumBuses <= pciBusNum))
- pciNumBuses = pciBusNum + 1;
+ if (speculativeProbe && (pciNumBuses <= pciBusNum))
+ pciNumBuses = pciBusNum + 1;
- speculativeProbe = FALSE;
+ speculativeProbe = FALSE;
- /*
- * Before checking for a specific devid, look for enabled
- * PCI to PCI bridge devices. If one is found, create and
- * initialize a bus info record (if one does not already exist).
- */
+ /*
+ * Before checking for a specific devid, look for enabled
+ * PCI to PCI bridge devices. If one is found, create and
+ * initialize a bus info record (if one does not already exist).
+ */
#ifdef PCI_BRIDGE_SUPPORT
- tmp = pciReadLong(pciDeviceTag, PCI_CLASS_REG);
- base_class = PCI_CLASS_EXTRACT(tmp);
- sub_class = PCI_SUBCLASS_EXTRACT(tmp);
- if (base_class == PCI_CLASS_BRIDGE)
- if (sub_class == PCI_SUBCLASS_BRIDGE_PCI) {
+ tmp = pciReadLong(pciDeviceTag, PCI_CLASS_REG);
+ base_class = PCI_CLASS_EXTRACT(tmp);
+ sub_class = PCI_SUBCLASS_EXTRACT(tmp);
+ if ((base_class == PCI_CLASS_BRIDGE) &&
+ (sub_class == PCI_SUBCLASS_BRIDGE_PCI)) {
tmp = pciReadLong(pciDeviceTag, PCI_PCI_BRIDGE_BUS_REG);
sec_bus = PCI_SECONDARY_BUS_EXTRACT(tmp);
pri_bus = PCI_PRIMARY_BUS_EXTRACT(tmp);
#ifdef DEBUGPCI
-ErrorF("pciGenFindNext: pri_bus %d sec_bus %d\n", pri_bus, sec_bus);
+ ErrorF("pciGenFindNext: pri_bus %d sec_bus %d\n", pri_bus, sec_bus);
#endif
if (sec_bus > 0 && sec_bus < MAX_PCI_BUSES && pciBusInfo[pri_bus]) {
- /*
- * Found a secondary PCI bus
- */
- if (!pciBusInfo[sec_bus]) {
- pciBusInfo[sec_bus] =
- xnfalloc(sizeof(pciBusInfo_t));
-
- }
-
- /* Copy parents settings... */
- *pciBusInfo[sec_bus] = *pciBusInfo[pri_bus];
-
- /* ...but not everything same as parent */
- pciBusInfo[sec_bus]->primary_bus = pri_bus;
- pciBusInfo[sec_bus]->secondary = TRUE;
- pciBusInfo[sec_bus]->numDevices = 32;
-
- if (pciNumBuses <= sec_bus)
- pciNumBuses = sec_bus+1;
+ /*
+ * Found a secondary PCI bus
+ */
+ if (!pciBusInfo[sec_bus])
+ pciBusInfo[sec_bus] = xnfalloc(sizeof(pciBusInfo_t));
+
+ /* Copy parents settings... */
+ *pciBusInfo[sec_bus] = *pciBusInfo[pri_bus];
+
+ /* ...but not everything same as parent */
+ pciBusInfo[sec_bus]->primary_bus = pri_bus;
+ pciBusInfo[sec_bus]->secondary = TRUE;
+ pciBusInfo[sec_bus]->numDevices = 32;
+
+ if (pciNumBuses <= sec_bus)
+ pciNumBuses = sec_bus+1;
}
- }
+ }
#endif
- /*
- * Does this device match the requested devid after
- * applying mask?
- */
+ /*
+ * Does this device match the requested devid after
+ * applying mask?
+ */
#ifdef DEBUGPCI
-ErrorF("pciGenFindNext: pciDevidMask = 0x%lx, pciDevid = 0x%lx\n", pciDevidMask, pciDevid);
+ ErrorF("pciGenFindNext: pciDevidMask = 0x%lx, pciDevid = 0x%lx\n", pciDevidMask, pciDevid);
#endif
- if ((devid & pciDevidMask) == pciDevid)
- /* Yes - Return it. Otherwise, next device */
- return(pciDeviceTag); /* got a match */
+ if ((devid & pciDevidMask) == pciDevid)
+ /* Yes - Return it. Otherwise, next device */
+ return(pciDeviceTag); /* got a match */
- } /* for */
- /*NOTREACHED*/
+ } /* for */
+ /*NOTREACHED*/
}
PCITAG
@@ -1053,12 +1053,122 @@ static int
readPciBIOS(unsigned long Offset, PCITAG Tag, int basereg,
unsigned char *Buf, int Len)
{
+ CARD32 romsave = 0;
+ int i;
+ romBaseSource b_reg;
+ ADDRESS hostbase;
+ CARD8 tmp[64];
+ CARD8 *image;
+
+ unsigned long offset;
+ int ret, length, len, rlength;
+
+ romsave = pciReadLong(Tag, PCI_MAP_ROM_REG);
+
+ for (i = ROM_BASE_PRESET; i <= ROM_BASE_FIND; i++) {
+ memType savebase = 0, newbase, romaddr;
+
+ if (i == ROM_BASE_PRESET) {
+ /* Does the driver have a preference? */
+ if (basereg > ROM_BASE_PRESET && basereg <= ROM_BASE_FIND)
+ b_reg = basereg;
+ else
+ b_reg = ++i;
+ } else
+ b_reg = i;
+
+ if (!(newbase = getValidBIOSBase(Tag, b_reg)))
+ continue; /* no valid address found */
+
+ romaddr = PCIGETROM(newbase);
+
+ /* if we use a mem base save it and move it out of the way */
+ if (b_reg >= 0 && b_reg <= 5) {
+ savebase = pciReadLong(Tag, PCI_MAP_REG_START+(basereg<<2));
+ xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]"
+ " for device %i:%i:%i\n", basereg,
+ PCI_BUS_FROM_TAG(Tag), PCI_DEV_FROM_TAG(Tag),
+ PCI_FUNC_FROM_TAG(Tag));
+ pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
+ (CARD32)~0);
+ }
+ /* Set ROM base address and enable ROM address decoding */
+ pciWriteLong(Tag, PCI_MAP_ROM_REG, romaddr
+ | PCI_MAP_ROM_DECODE_ENABLE);
+
+ hostbase = pciBusAddrToHostAddr(Tag, PCI_MEM, PCIGETROM(romaddr));
+
+ if ((xf86ReadBIOS(hostbase, 0, tmp, sizeof(tmp)) != sizeof(tmp))
+ || (tmp[0] != 0x55)
+ || (tmp[1] != 0xaa)
+ || !tmp[2] ) {
+ /* Restore the base register if it was changed. */
+ if (savebase) pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
+ (CARD32) savebase);
+ /* No BIOS found: try another address */
+ continue;
+ }
+
+#if 0
+ /*
+ * Currently this is only good for PC style BIOSes.
+ * This code needs to be revistited after 4.1 is out.
+ * We need to pass an argument for the BIOS type to
+ * look for. Then we can pick the correct BIOS.
+ * Combine this with the code in int10/pci.c.
+ */
+ if ((Offset) > (tmp[2] << 9)) {
+ xf86Msg(X_WARNING,"xf86ReadPciBios: requesting data past "
+ "end of BIOS %i > %i\n",(Offset) , (tmp[2] << 9));
+ } else {
+ if ((Offset + Len) > (tmp[2] << 9)) {
+ Len = (tmp[2] << 9) - Offset;
+ xf86Msg(X_INFO,"Truncating PCI BIOS Length to %i\n",Len);
+ }
+ }
+#endif
+
+ /* Read BIOS in 64kB chunks */
+ ret = 0;
+ offset = Offset;
+ image = Buf;
+ len = Len;
+ while ((length = len) > 0) {
+ if (length > 0x10000) length = 0x10000;
+ rlength = xf86ReadBIOS(hostbase, offset, image, length);
+ if (rlength < 0) {
+ ret = rlength;
+ break;
+ }
+ ret += rlength;
+ if (rlength < length) break;
+ offset += length;
+ image += length;
+ len -= length;
+ }
+ /* Restore the base register if it was changed. */
+ if (savebase) pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
+ (CARD32) savebase);
+ /* Restore ROM address decoding */
+ pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave);
+ return ret;
+
+ }
+ /* Restore ROM address decoding */
+ pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave);
+ return 0;
+}
+
+#if 0
+static int
+readPciBIOS(unsigned long Offset, PCITAG Tag, int basereg,
+ unsigned char *Buf, int Len)
+{
ADDRESS hostbase;
CARD8 *image = Buf;
unsigned long offset;
CARD32 romaddr, savebase = 0, romsave = 0, newbase = 0;
- int ret, length, rlength, n;
-
+ int ret, tmpLen, length, rlength, n;
/* XXX This assumes that memory access is enabled */
/*
@@ -1077,7 +1187,7 @@ RetryWithBase:
if (!savebase)
savebase = pciReadLong(Tag, PCI_MAP_REG_START+(basereg<<2));
if (PCIGETROM(savebase) == romaddr) {
- xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]"
+ xf86MsgVerb(X_INFO,5,"xf86ReadPciBIOS: modifying membase[%i]"
" for device %i:%i:%i\n", basereg,
PCI_BUS_FROM_TAG(Tag), PCI_DEV_FROM_TAG(Tag),
PCI_FUNC_FROM_TAG(Tag));
@@ -1099,31 +1209,38 @@ RetryWithBase:
newbase);
hostbase = pciBusAddrToHostAddr(Tag, PCI_MEM, PCIGETROM(romaddr));
-#ifdef DEBUG
- ErrorF("ReadPciBIOS: base = 0x%x\n",romaddr);
-#endif
+ xf86MsgVerb(X_INFO, 5, "ReadPciBIOS: base = 0x%x\n",romaddr);
/* Enable ROM address decoding */
pciWriteLong(Tag, PCI_MAP_ROM_REG, romaddr | PCI_MAP_ROM_DECODE_ENABLE);
- /* Read BIOS in 64kB chunks */
- ret = 0;
- offset = Offset;
- while ((length = Len) > 0) {
- if (length > 0x10000) length = 0x10000;
- rlength = xf86ReadBIOS(hostbase, offset, image, length);
- if (rlength < 0) {
- ret = rlength;
- break;
+ /* Check to see if we really have a PCI BIOS image */
+ rlength = xf86ReadBIOS(hostbase, 0, tmp_buf, sizeof(tmp_buf));
+ if (rlength < 0) return rlength;
+ /* If we found a BIOS image we read the requested data */
+ if ((rlength == sizeof(tmp_buf)) && (tmp_buf[0] == 0x55)
+ && (tmp_buf[1] == 0xaa) && tmp_buf[2] ) {
+
+ /* Read BIOS in 64kB chunks */
+ ret = 0;
+ offset = Offset;
+ tmpLen = Len;
+ image = Buf;
+
+ while ((length = tmpLen) > 0) {
+ if (length > 0x10000) length = 0x10000;
+ rlength = xf86ReadBIOS(hostbase, offset, image, length);
+ if (rlength < 0) {
+ ret = rlength;
+ break;
+ }
+ ret += rlength;
+ if (rlength < length) break;
+ offset += length;
+ image += length;
+ tmpLen -= length;
}
- ret += rlength;
- if (rlength < length) break;
- offset += length;
- image += length;
- Len -= length;
- }
-
- if ((ret != Len) || (Buf[0] != 0x55) || (Buf[1] != 0xaa) || !Buf[2] ||
- (Len < (Buf[2] << 9))) {
+ } else {
+ /* If we don't have a PCI BIOS image we look further */
n = 0;
if ((basereg >= 0) && (basereg <= 5) && xf86PciVideoInfo) do {
pciVideoPtr pvp;
@@ -1145,6 +1262,7 @@ RetryWithBase:
return ret;
}
+#endif
typedef CARD32 (*ReadProcPtr)(PCITAG, int);
typedef void (*WriteProcPtr)(PCITAG, int, CARD32);
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h b/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h
index 0c006a55d..5accd7020 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.17 2001/04/20 17:02:43 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.18.2.1 2001/05/21 05:00:36 tsi Exp $ */
/*
* Copyright 1998 by Concurrent Computer Corporation
*
@@ -85,7 +85,12 @@
*/
#define MAX_PCI_DEVICES 64 /* Max number of devices accomodated */
/* by xf86scanpci */
+#if defined(i386) || defined(__i386) || defined(__i386__)
+/* Q&D stopgap to deal with mainboards whose PCI space is smaller */
+#define MAX_PCI_BUSES 128 /* Max number of PCI buses */
+#else
#define MAX_PCI_BUSES 256 /* Max number of PCI buses */
+#endif
#define PCI_NOT_FOUND 0xffffffff
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c b/xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c
index 130b0e1e4..cb629ab31 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c,v 1.3 1999/03/28 15:32:57 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c,v 1.3.6.1 2001/05/29 16:38:00 tsi Exp $ */
/*
* Copyright 1998 by Concurrent Computer Corporation
*
@@ -80,21 +80,10 @@ pciBusInfo_t linuxPci0 = {
};
#if X_BYTE_ORDER == X_BIG_ENDIAN
-#ifdef __sparc__
-#ifndef ASI_PL
-#define ASI_PL 0x88
-#endif
-#define PCI_CPU(val) ({ \
-int __ret; \
-__asm__ __volatile__("lduwa [%1] %2, %0" : "=r" (__ret) : "r" (&val), "i" (ASI_PL)); \
-__ret; \
-})
-#else
#define PCI_CPU(val) (((val >> 24) & 0x000000ff) | \
((val >> 8) & 0x0000ff00) | \
((val << 8) & 0x00ff0000) | \
((val << 24) & 0xff000000))
-#endif
#else
#define PCI_CPU(val) (val)
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c b/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c
index 25c1abcbe..46e0eacd3 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c,v 1.5 2000/02/08 13:13:29 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c,v 1.6 2001/05/11 08:16:55 alanh Exp $ */
/*
* ppcPci.c - PowerPC PCI access functions
*
@@ -140,7 +140,13 @@ motoppcPciInit()
}
extern unsigned long motoPciMemBase = 0;
+
+#if defined(Lynx) && defined(__powerpc__)
+extern unsigned long motoPciMemLen = 0x40000000;
+#else
extern unsigned long motoPciMemLen = 0x3f000000;
+#endif
+
extern unsigned long motoPciMemBaseCPU = 0xc0000000;
ADDRESS
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h b/xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h
index ecdc009a6..51552a620 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v 1.26 2000/09/19 12:46:21 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v 1.27 2001/05/15 10:19:42 eich Exp $ */
/*
* Copyright 1998 by Concurrent Computer Corporation
*
@@ -656,6 +656,18 @@ void xf86writepci(int, int, int, int, int, CARD32, CARD32);
extern int pciNumBuses;
+typedef enum {
+ ROM_BASE_PRESET = -2,
+ ROM_BASE_BIOS,
+ ROM_BASE_MEM0 = 0,
+ ROM_BASE_MEM1,
+ ROM_BASE_MEM2,
+ ROM_BASE_MEM3,
+ ROM_BASE_MEM4,
+ ROM_BASE_MEM5,
+ ROM_BASE_FIND
+} romBaseSource;
+
#endif /* _XF86PCI_H */
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux
index 020d677fc..cb48028fd 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux
@@ -175,8 +175,8 @@ ifeq ($(SIS),1)
# file to see if we can, at least, compile the driver.
MODS += sis.o
-SISOBJS= sis_drv.o sis_context.o sis_ds.o sis_mm.o
-SISHEADERS= sis_drv.h sis_ds.h sis_drm.h $(DRMHEADERS)
+SISOBJS= sis_drv.o sis_mm.o sis_ds.o
+SISHEADERS= sis_drv.h sis_drm.h $(DRMHEADERS)
MODCFLAGS += -DCONFIG_DRM_SIS
endif
@@ -216,6 +216,9 @@ endif
dristat: dristat.c
$(CC) $(PRGCFLAGS) $< -o $@
+DRIsetup: DRIsetup.c
+ $(CC) $(PRGCFLAGS) $< -o $@ -L/usr/X11R6/lib -lGL -lm ../../../../parser/libxf86config.a ../libdrm.a
+
gamma_drv.o: gamma_drv.c
$(CC) $(MODCFLAGS) -DEXPORT_SYMTAB -I$(TREE) -c $< -o $@
gamma.o: $(GAMMAOBJS)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h
index 3def97f74..ac9f407a7 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h
@@ -44,8 +44,27 @@
#define DRM_IOCTL_NR(n) ((n) & 0xff)
#endif
+#define XFREE86_VERSION(major,minor,patch,snap) \
+ ((major << 16) | (minor << 8) | patch)
+
+#ifndef CONFIG_XFREE86_VERSION
+#define CONFIG_XFREE86_VERSION XFREE86_VERSION(4,1,0,0)
+#endif
+
+#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
+#define DRM_PROC_DEVICES "/proc/devices"
+#define DRM_PROC_MISC "/proc/misc"
+#define DRM_PROC_DRM "/proc/drm"
+#define DRM_DEV_DRM "/dev/drm"
+#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)
+#define DRM_DEV_UID 0
+#define DRM_DEV_GID 0
+#endif
+
+#if CONFIG_XFREE86_VERSION >= XFREE86_VERSION(4,1,0,0)
#define DRM_MAJOR 226
#define DRM_MAX_MINOR 15
+#endif
#define DRM_NAME "drm" /* Name in kernel, /dev, and /proc */
#define DRM_MIN_ORDER 5 /* At least 2^5 bytes = 32 bytes */
#define DRM_MAX_ORDER 22 /* Up to 2^22 bytes = 4MB */
@@ -438,15 +457,15 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_R128_CCE_RESET DRM_IO( 0x43)
#define DRM_IOCTL_R128_CCE_IDLE DRM_IO( 0x44)
#define DRM_IOCTL_R128_RESET DRM_IO( 0x46)
-#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( 0x47, drm_r128_fullscreen_t)
-#define DRM_IOCTL_R128_SWAP DRM_IO( 0x48)
-#define DRM_IOCTL_R128_CLEAR DRM_IOW( 0x49, drm_r128_clear_t)
-#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x4a, drm_r128_vertex_t)
-#define DRM_IOCTL_R128_INDICES DRM_IOW( 0x4b, drm_r128_indices_t)
-#define DRM_IOCTL_R128_BLIT DRM_IOW( 0x4c, drm_r128_blit_t)
-#define DRM_IOCTL_R128_DEPTH DRM_IOW( 0x4d, drm_r128_depth_t)
-#define DRM_IOCTL_R128_STIPPLE DRM_IOW( 0x4e, drm_r128_stipple_t)
+#define DRM_IOCTL_R128_SWAP DRM_IO( 0x47)
+#define DRM_IOCTL_R128_CLEAR DRM_IOW( 0x48, drm_r128_clear_t)
+#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x49, drm_r128_vertex_t)
+#define DRM_IOCTL_R128_INDICES DRM_IOW( 0x4a, drm_r128_indices_t)
+#define DRM_IOCTL_R128_BLIT DRM_IOW( 0x4b, drm_r128_blit_t)
+#define DRM_IOCTL_R128_DEPTH DRM_IOW( 0x4c, drm_r128_depth_t)
+#define DRM_IOCTL_R128_STIPPLE DRM_IOW( 0x4d, drm_r128_stipple_t)
#define DRM_IOCTL_R128_INDIRECT DRM_IOWR(0x4f, drm_r128_indirect_t)
+#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( 0x50, drm_r128_fullscreen_t)
/* Radeon specific ioctls */
#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( 0x40, drm_radeon_init_t)
@@ -460,9 +479,9 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_RADEON_CLEAR DRM_IOW( 0x48, drm_radeon_clear_t)
#define DRM_IOCTL_RADEON_VERTEX DRM_IOW( 0x49, drm_radeon_vertex_t)
#define DRM_IOCTL_RADEON_INDICES DRM_IOW( 0x4a, drm_radeon_indices_t)
-#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4b, drm_radeon_texture_t)
#define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( 0x4c, drm_radeon_stipple_t)
#define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(0x4d, drm_radeon_indirect_t)
+#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4e, drm_radeon_texture_t)
#ifdef CONFIG_DRM_SIS
/* SiS specific ioctls */
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_bufs.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_bufs.h
index 16af7bd54..02502321b 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_bufs.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_bufs.h
@@ -332,6 +332,12 @@ int DRM(addbufs_agp)( struct inode *inode, struct file *filp,
return -ENOMEM; /* May only call once for each order */
}
+ if (count < 0 || count > 4096) {
+ up( &dev->struct_sem );
+ atomic_dec( &dev->buf_alloc );
+ return -EINVAL;
+ }
+
entry->buflist = DRM(alloc)( count * sizeof(*entry->buflist),
DRM_MEM_BUFS );
if ( !entry->buflist ) {
@@ -479,6 +485,12 @@ int DRM(addbufs_pci)( struct inode *inode, struct file *filp,
return -ENOMEM; /* May only call once for each order */
}
+ if (count < 0 || count > 4096) {
+ up( &dev->struct_sem );
+ atomic_dec( &dev->buf_alloc );
+ return -EINVAL;
+ }
+
entry->buflist = DRM(alloc)( count * sizeof(*entry->buflist),
DRM_MEM_BUFS );
if ( !entry->buflist ) {
@@ -581,6 +593,7 @@ int DRM(addbufs_pci)( struct inode *inode, struct file *filp,
atomic_dec( &dev->buf_alloc );
return 0;
+
}
#endif /* __HAVE_PCI_DMA */
@@ -650,6 +663,12 @@ int DRM(addbufs_sg)( struct inode *inode, struct file *filp,
return -ENOMEM; /* May only call once for each order */
}
+ if (count < 0 || count > 4096) {
+ up( &dev->struct_sem );
+ atomic_dec( &dev->buf_alloc );
+ return -EINVAL;
+ }
+
entry->buflist = DRM(alloc)( count * sizeof(*entry->buflist),
DRM_MEM_BUFS );
if ( !entry->buflist ) {
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h
index e715bd416..85fa14723 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h
@@ -40,6 +40,15 @@
#ifndef __HAVE_DMA_RECLAIM
#define __HAVE_DMA_RECLAIM 0
#endif
+#ifndef __HAVE_SHARED_IRQ
+#define __HAVE_SHARED_IRQ 0
+#endif
+
+#if __HAVE_SHARED_IRQ
+#define DRM_IRQ_TYPE SA_SHIRQ
+#else
+#define DRM_IRQ_TYPE 0
+#endif
#if __HAVE_DMA
@@ -534,7 +543,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq )
/* Install handler */
ret = request_irq( dev->irq, DRM(dma_service),
- 0, dev->devname, dev );
+ DRM_IRQ_TYPE, dev->devname, dev );
if ( ret < 0 ) {
down( &dev->struct_sem );
dev->irq = 0;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h
index ea684f883..f969ec595 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h
@@ -208,21 +208,6 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
MODULE_DESCRIPTION( DRIVER_DESC );
MODULE_PARM( drm_opts, "s" );
-#ifndef MODULE
-/* DRM(options) is called by the kernel to parse command-line options
- * passed via the boot-loader (e.g., LILO). It calls the insmod option
- * routine, drm_parse_drm.
- */
-
-static int __init DRM(options)( char *str )
-{
- DRM(parse_options)( str );
- return 1;
-}
-
-__setup( DRIVER_NAME "=", DRM(options) );
-#endif
-
static int DRM(setup)( drm_device_t *dev )
{
int i;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_ioctl.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_ioctl.h
index 1cc8f31f0..c2761808a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_ioctl.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_ioctl.h
@@ -82,7 +82,7 @@ int DRM(setunique)(struct inode *inode, struct file *filp,
if (copy_from_user(&u, (drm_unique_t *)arg, sizeof(u)))
return -EFAULT;
- if (!u.unique_len)
+ if (!u.unique_len || u.unique_len > 1024)
return -EINVAL;
dev->unique_len = u.unique_len;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h
index 771c11bd2..4db521de3 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h
@@ -32,25 +32,25 @@
#define __NO_VERSION__
#include "drmP.h"
-struct vm_operations_struct drm_vm_ops = {
+struct vm_operations_struct DRM(vm_ops) = {
nopage: DRM(vm_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
};
-struct vm_operations_struct drm_vm_shm_ops = {
+struct vm_operations_struct DRM(vm_shm_ops) = {
nopage: DRM(vm_shm_nopage),
open: DRM(vm_open),
close: DRM(vm_shm_close),
};
-struct vm_operations_struct drm_vm_dma_ops = {
+struct vm_operations_struct DRM(vm_dma_ops) = {
nopage: DRM(vm_dma_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
};
-struct vm_operations_struct drm_vm_sg_ops = {
+struct vm_operations_struct DRM(vm_sg_ops) = {
nopage: DRM(vm_sg_nopage),
open: DRM(vm_open),
close: DRM(vm_close),
@@ -352,7 +352,7 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma)
}
unlock_kernel();
- vma->vm_ops = &drm_vm_dma_ops;
+ vma->vm_ops = &DRM(vm_dma_ops);
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
#if LINUX_VERSION_CODE < 0x020203 /* KERNEL_VERSION(2,2,3) */
@@ -377,6 +377,8 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
DRM_DEBUG("start = 0x%lx, end = 0x%lx, offset = 0x%lx\n",
vma->vm_start, vma->vm_end, VM_OFFSET(vma));
+ if ( !priv->authenticated ) return -EACCES;
+
if (!VM_OFFSET(vma)) return DRM(mmap_dma)(filp, vma);
/* A sequential search of a linked list is
@@ -444,10 +446,10 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
" offset = 0x%lx\n",
map->type,
vma->vm_start, vma->vm_end, VM_OFFSET(vma) + offset);
- vma->vm_ops = &drm_vm_ops;
+ vma->vm_ops = &DRM(vm_ops);
break;
case _DRM_SHM:
- vma->vm_ops = &drm_vm_shm_ops;
+ vma->vm_ops = &DRM(vm_shm_ops);
#if LINUX_VERSION_CODE >= 0x020300
vma->vm_private_data = (void *)map;
#else
@@ -458,7 +460,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
vma->vm_flags |= VM_LOCKED;
break;
case _DRM_SCATTER_GATHER:
- vma->vm_ops = &drm_vm_sg_ops;
+ vma->vm_ops = &DRM(vm_sg_ops);
#if LINUX_VERSION_CODE >= 0x020300
vma->vm_private_data = (void *)map;
#else
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c
index d3a9414d7..7510e2b57 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c
@@ -547,10 +547,6 @@ int gamma_dma(struct inode *inode, struct file *filp, unsigned int cmd,
int retcode = 0;
drm_dma_t d;
-#if 0
- LOCK_TEST_WITH_RETURN( dev );
-#endif
-
if (copy_from_user(&d, (drm_dma_t *)arg, sizeof(d)))
return -EFAULT;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c
index 98916bc53..c05465c5d 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c
@@ -62,6 +62,27 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
+
+#ifndef MODULE
+/* DRM(options) is called by the kernel to parse command-line options
+ * passed via the boot-loader (e.g., LILO). It calls the insmod option
+ * routine, drm_parse_drm.
+ */
+
+/* JH- We have to hand expand the string ourselves because of the cpp. If
+ * anyone can think of a way that we can fit into the __setup macro without
+ * changing it, then please send the solution my way.
+ */
+static int __init gamma_options( char *str )
+{
+ DRM(parse_options)( str );
+ return 1;
+}
+
+__setup( DRIVER_NAME "=", gamma_options );
+#endif
+
+
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810.h
index ed25b2a99..a5152bc0a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810.h
@@ -62,9 +62,10 @@
#define __HAVE_DMA_IRQ 1
#define __HAVE_DMA_IRQ_BH 1
+#define __HAVE_SHARED_IRQ 1
#define DRIVER_PREINSTALL() do { \
drm_i810_private_t *dev_priv = \
- (drm_i810_private_t *)dev->dev_private; \
+ (drm_i810_private_t *)dev->dev_private; \
u16 tmp; \
tmp = I810_READ16( I810REG_HWSTAM ); \
tmp = tmp & 0x6000; \
@@ -80,7 +81,7 @@
#define DRIVER_POSTINSTALL() do { \
drm_i810_private_t *dev_priv = \
- (drm_i810_private_t *)dev->dev_private; \
+ (drm_i810_private_t *)dev->dev_private; \
u16 tmp; \
tmp = I810_READ16( I810REG_INT_ENABLE_R ); \
tmp = tmp & 0x6000; \
@@ -90,15 +91,18 @@
#define DRIVER_UNINSTALL() do { \
drm_i810_private_t *dev_priv = \
- (drm_i810_private_t *)dev->dev_private; \
+ (drm_i810_private_t *)dev->dev_private; \
u16 tmp; \
- tmp = I810_READ16( I810REG_INT_IDENTITY_R ); \
- tmp = tmp & ~(0x6000); /* Clear all interrupts */ \
- if ( tmp != 0 ) I810_WRITE16( I810REG_INT_IDENTITY_R, tmp ); \
+ if ( dev_priv ) { \
+ tmp = I810_READ16( I810REG_INT_IDENTITY_R ); \
+ tmp = tmp & ~(0x6000); /* Clear all interrupts */ \
+ if ( tmp != 0 ) \
+ I810_WRITE16( I810REG_INT_IDENTITY_R, tmp ); \
\
- tmp = I810_READ16( I810REG_INT_ENABLE_R ); \
- tmp = tmp & 0x6000; /* Disable all interrupts */ \
- I810_WRITE16( I810REG_INT_ENABLE_R, tmp ); \
+ tmp = I810_READ16( I810REG_INT_ENABLE_R ); \
+ tmp = tmp & 0x6000; /* Disable all interrupts */ \
+ I810_WRITE16( I810REG_INT_ENABLE_R, tmp ); \
+ } \
} while (0)
/* Buffer customization:
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c
index 4c90496a7..75be5d0cc 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c
@@ -182,7 +182,11 @@ static int i810_map_buffer(drm_buf_t *buf, struct file *filp)
if(buf_priv->currently_mapped == I810_BUF_MAPPED) return -EINVAL;
if(VM_DONTCOPY != 0) {
- down(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE <= 0x020402
+ down( &current->mm->mmap_sem );
+#else
+ down_write( &current->mm->mmap_sem );
+#endif
old_fops = filp->f_op;
filp->f_op = &i810_buffer_fops;
dev_priv->mmap_buffer = buf;
@@ -198,7 +202,11 @@ static int i810_map_buffer(drm_buf_t *buf, struct file *filp)
retcode = (signed int)buf_priv->virtual;
buf_priv->virtual = 0;
}
- up(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE <= 0x020402
+ up( &current->mm->mmap_sem );
+#else
+ up_write( &current->mm->mmap_sem );
+#endif
} else {
buf_priv->virtual = buf_priv->kernel_virtual;
buf_priv->currently_mapped = I810_BUF_MAPPED;
@@ -214,7 +222,11 @@ static int i810_unmap_buffer(drm_buf_t *buf)
if(VM_DONTCOPY != 0) {
if(buf_priv->currently_mapped != I810_BUF_MAPPED)
return -EINVAL;
- down(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE <= 0x020402
+ down( &current->mm->mmap_sem );
+#else
+ down_write( &current->mm->mmap_sem );
+#endif
#if LINUX_VERSION_CODE < 0x020399
retcode = do_munmap((unsigned long)buf_priv->virtual,
(size_t) buf->total);
@@ -223,7 +235,11 @@ static int i810_unmap_buffer(drm_buf_t *buf)
(unsigned long)buf_priv->virtual,
(size_t) buf->total);
#endif
- up(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE <= 0x020402
+ up( &current->mm->mmap_sem );
+#else
+ up_write( &current->mm->mmap_sem );
+#endif
}
buf_priv->currently_mapped = I810_BUF_UNMAPPED;
buf_priv->virtual = 0;
@@ -1078,6 +1094,8 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n",
vertex.idx, vertex.used, vertex.discard);
+ if(vertex.idx < 0 || vertex.idx > dma->buf_count) return -EINVAL;
+
i810_dma_dispatch_vertex( dev,
dma->buflist[ vertex.idx ],
vertex.discard, vertex.used );
@@ -1107,6 +1125,11 @@ int i810_clear_bufs(struct inode *inode, struct file *filp,
return -EINVAL;
}
+ /* GH: Someone's doing nasty things... */
+ if (!dev->dev_private) {
+ return -EINVAL;
+ }
+
i810_dma_dispatch_clear( dev, clear.flags,
clear.clear_color,
clear.clear_depth );
@@ -1201,11 +1224,13 @@ int i810_copybuf(struct inode *inode, struct file *filp, unsigned int cmd,
if (copy_from_user(&d, (drm_i810_copy_t *)arg, sizeof(d)))
return -EFAULT;
- if(d.idx > dma->buf_count) return -EINVAL;
+ if(d.idx < 0 || d.idx > dma->buf_count) return -EINVAL;
buf = dma->buflist[ d.idx ];
buf_priv = buf->dev_private;
if (buf_priv->currently_mapped != I810_BUF_MAPPED) return -EPERM;
+ if(d.used < 0 || d.used > buf->total) return -EINVAL;
+
if (copy_from_user(buf_priv->virtual, d.address, d.used))
return -EFAULT;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drm.h
index cee189b7b..5d47adda2 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drm.h
@@ -98,8 +98,13 @@ typedef struct _drm_i810_init {
I810_INIT_DMA = 0x01,
I810_CLEANUP_DMA = 0x02
} func;
+#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
+ int ring_map_idx;
+ int buffer_map_idx;
+#else
unsigned int mmio_offset;
unsigned int buffers_offset;
+#endif
int sarea_priv_offset;
unsigned int ring_start;
unsigned int ring_end;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c
index 12a59dbf3..d21a19b7d 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c
@@ -39,10 +39,10 @@
#define DRIVER_NAME "i810"
#define DRIVER_DESC "Intel i810"
-#define DRIVER_DATE "20010215"
+#define DRIVER_DATE "20010616"
-#define DRIVER_MAJOR 1
-#define DRIVER_MINOR 1
+#define DRIVER_MAJOR 2
+#define DRIVER_MINOR 0
#define DRIVER_PATCHLEVEL 0
#define DRIVER_IOCTLS \
@@ -71,6 +71,26 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
+
+#ifndef MODULE
+/* DRM(options) is called by the kernel to parse command-line options
+ * passed via the boot-loader (e.g., LILO). It calls the insmod option
+ * routine, drm_parse_drm.
+ */
+
+/* JH- We have to hand expand the string ourselves because of the cpp. If
+ * anyone can think of a way that we can fit into the __setup macro without
+ * changing it, then please send the solution my way.
+ */
+static int __init i810_options( char *str )
+{
+ DRM(parse_options)( str );
+ return 1;
+}
+
+__setup( DRIVER_NAME "=", i810_options );
+#endif
+
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c
index bea65cfa6..91216d24f 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c
@@ -70,6 +70,27 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
+
+#ifndef MODULE
+/* DRM(options) is called by the kernel to parse command-line options
+ * passed via the boot-loader (e.g., LILO). It calls the insmod option
+ * routine, drm_parse_drm.
+ */
+
+/* JH- We have to hand expand the string ourselves because of the cpp. If
+ * anyone can think of a way that we can fit into the __setup macro without
+ * changing it, then please send the solution my way.
+ */
+static int __init mga_options( char *str )
+{
+ DRM(parse_options)( str );
+ return 1;
+}
+
+__setup( DRIVER_NAME "=", mga_options );
+#endif
+
+
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c
index 99778c581..41b2e9a17 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c
@@ -943,6 +943,7 @@ int mga_dma_vertex( struct inode *inode, struct file *filp,
sizeof(vertex) ) )
return -EFAULT;
+ if(vertex.idx < 0 || vertex.idx > dma->buf_count) return -EINVAL;
buf = dma->buflist[vertex.idx];
buf_priv = buf->dev_private;
@@ -984,6 +985,8 @@ int mga_dma_indices( struct inode *inode, struct file *filp,
sizeof(indices) ) )
return -EFAULT;
+ if(indices.idx < 0 || indices.idx > dma->buf_count) return -EINVAL;
+
buf = dma->buflist[indices.idx];
buf_priv = buf->dev_private;
@@ -1030,6 +1033,7 @@ int mga_dma_iload( struct inode *inode, struct file *filp,
return -EBUSY;
}
#endif
+ if(iload.idx < 0 || iload.idx > dma->buf_count) return -EINVAL;
buf = dma->buflist[iload.idx];
buf_priv = buf->dev_private;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_cce.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_cce.c
index 1ced05fe9..fbc5fabc0 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_cce.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_cce.c
@@ -131,7 +131,9 @@ static int r128_do_pixcache_flush( drm_r128_private_t *dev_priv )
udelay( 1 );
}
+#if R128_FIFO_DEBUG
DRM_ERROR( "%s failed!\n", __FUNCTION__ );
+#endif
return -EBUSY;
}
@@ -145,7 +147,9 @@ static int r128_do_wait_for_fifo( drm_r128_private_t *dev_priv, int entries )
udelay( 1 );
}
+#if R128_FIFO_DEBUG
DRM_ERROR( "%s failed!\n", __FUNCTION__ );
+#endif
return -EBUSY;
}
@@ -164,7 +168,9 @@ int r128_do_wait_for_idle( drm_r128_private_t *dev_priv )
udelay( 1 );
}
+#if R128_FIFO_DEBUG
DRM_ERROR( "%s failed!\n", __FUNCTION__ );
+#endif
return -EBUSY;
}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drm.h
index fc1261eae..0fc6a6cd1 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drm.h
@@ -175,7 +175,11 @@ typedef struct drm_r128_init {
R128_INIT_CCE = 0x01,
R128_CLEANUP_CCE = 0x02
} func;
+#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
+ int sarea_priv_offset;
+#else
unsigned long sarea_priv_offset;
+#endif
int is_pci;
int cce_mode;
int cce_secure;
@@ -189,12 +193,21 @@ typedef struct drm_r128_init {
unsigned int depth_offset, depth_pitch;
unsigned int span_offset;
+#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
+ unsigned int fb_offset;
+ unsigned int mmio_offset;
+ unsigned int ring_offset;
+ unsigned int ring_rptr_offset;
+ unsigned int buffers_offset;
+ unsigned int agp_textures_offset;
+#else
unsigned long fb_offset;
unsigned long mmio_offset;
unsigned long ring_offset;
unsigned long ring_rptr_offset;
unsigned long buffers_offset;
unsigned long agp_textures_offset;
+#endif
} drm_r128_init_t;
typedef struct drm_r128_cce_stop {
@@ -202,19 +215,17 @@ typedef struct drm_r128_cce_stop {
int idle;
} drm_r128_cce_stop_t;
-typedef struct drm_r128_fullscreen {
- enum {
- R128_INIT_FULLSCREEN = 0x01,
- R128_CLEANUP_FULLSCREEN = 0x02
- } func;
-} drm_r128_fullscreen_t;
-
typedef struct drm_r128_clear {
unsigned int flags;
+#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
+ int x, y, w, h;
+#endif
unsigned int clear_color;
unsigned int clear_depth;
+#if CONFIG_XFREE86_VERSION >= XFREE86_VERSION(4,1,0,0)
unsigned int color_mask;
unsigned int depth_mask;
+#endif
} drm_r128_clear_t;
typedef struct drm_r128_vertex {
@@ -266,4 +277,11 @@ typedef struct drm_r128_indirect {
int discard;
} drm_r128_indirect_t;
+typedef struct drm_r128_fullscreen {
+ enum {
+ R128_INIT_FULLSCREEN = 0x01,
+ R128_CLEANUP_FULLSCREEN = 0x02
+ } func;
+} drm_r128_fullscreen_t;
+
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c
index 584cb29c3..4f0bb92b8 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c
@@ -41,9 +41,9 @@
#define DRIVER_DESC "ATI Rage 128"
#define DRIVER_DATE "20010405"
-#define DRIVER_MAJOR 2
-#define DRIVER_MINOR 1
-#define DRIVER_PATCHLEVEL 6
+#define DRIVER_MAJOR 3
+#define DRIVER_MINOR 0
+#define DRIVER_PATCHLEVEL 0
#define DRIVER_IOCTLS \
[DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { r128_cce_buffers, 1, 0 }, \
@@ -81,6 +81,26 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
+
+#ifndef MODULE
+/* DRM(options) is called by the kernel to parse command-line options
+ * passed via the boot-loader (e.g., LILO). It calls the insmod option
+ * routine, drm_parse_drm.
+ */
+
+/* JH- We have to hand expand the string ourselves because of the cpp. If
+ * anyone can think of a way that we can fit into the __setup macro without
+ * changing it, then please send the solution my way.
+ */
+static int __init r128_options( char *str )
+{
+ DRM(parse_options)( str );
+ return 1;
+}
+
+__setup( DRIVER_NAME "=", r128_options );
+#endif
+
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_context.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_context.c
deleted file mode 100644
index e428dc22c..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_context.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/* radeon_context.c -- IOCTLs for Radeon contexts -*- linux-c -*-
- *
- * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
- * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Author: Kevin E. Martin <martin@valinux.com>
- * Rickard E. (Rik) Faith <faith@valinux.com>
- *
- */
-
-#define __NO_VERSION__
-#include "drmP.h"
-#include "radeon_drv.h"
-
-extern drm_ctx_t radeon_res_ctx;
-
-static int radeon_alloc_queue(drm_device_t *dev)
-{
- return drm_ctxbitmap_next(dev);
-}
-
-int radeon_context_switch(drm_device_t *dev, int old, int new)
-{
- char buf[64];
-
- atomic_inc(&dev->total_ctx);
-
- if (test_and_set_bit(0, &dev->context_flag)) {
- DRM_ERROR("Reentering -- FIXME\n");
- return -EBUSY;
- }
-
-#if DRM_DMA_HISTOGRAM
- dev->ctx_start = get_cycles();
-#endif
-
- DRM_DEBUG("Context switch from %d to %d\n", old, new);
-
- if (new == dev->last_context) {
- clear_bit(0, &dev->context_flag);
- return 0;
- }
-
- if (drm_flags & DRM_FLAG_NOCTX) {
- radeon_context_switch_complete(dev, new);
- } else {
- sprintf(buf, "C %d %d\n", old, new);
- drm_write_string(dev, buf);
- }
-
- return 0;
-}
-
-int radeon_context_switch_complete(drm_device_t *dev, int new)
-{
- dev->last_context = new; /* PRE/POST: This is the _only_ writer. */
- dev->last_switch = jiffies;
-
- if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
- DRM_ERROR("Lock isn't held after context switch\n");
- }
-
- /* If a context switch is ever initiated
- when the kernel holds the lock, release
- that lock here. */
-#if DRM_DMA_HISTOGRAM
- atomic_inc(&dev->histo.ctx[drm_histogram_slot(get_cycles()
- - dev->ctx_start)]);
-
-#endif
- clear_bit(0, &dev->context_flag);
- wake_up(&dev->context_wait);
-
- return 0;
-}
-
-
-int radeon_resctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_ctx_res_t res;
- drm_ctx_t ctx;
- int i;
-
- DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS);
- if (copy_from_user(&res, (drm_ctx_res_t *)arg, sizeof(res)))
- return -EFAULT;
- if (res.count >= DRM_RESERVED_CONTEXTS) {
- memset(&ctx, 0, sizeof(ctx));
- for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) {
- ctx.handle = i;
- if (copy_to_user(&res.contexts[i], &i, sizeof(i)))
- return -EFAULT;
- }
- }
- res.count = DRM_RESERVED_CONTEXTS;
- if (copy_to_user((drm_ctx_res_t *)arg, &res, sizeof(res)))
- return -EFAULT;
- return 0;
-}
-
-
-int radeon_addctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
- return -EFAULT;
- if ((ctx.handle = radeon_alloc_queue(dev)) == DRM_KERNEL_CONTEXT) {
- /* Skip kernel's context and get a new one. */
- ctx.handle = radeon_alloc_queue(dev);
- }
- DRM_DEBUG("%d\n", ctx.handle);
- if (ctx.handle == -1) {
- DRM_DEBUG("Not enough free contexts.\n");
- /* Should this return -EBUSY instead? */
- return -ENOMEM;
- }
-
- if (copy_to_user((drm_ctx_t *)arg, &ctx, sizeof(ctx)))
- return -EFAULT;
- return 0;
-}
-
-int radeon_modctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
- return -EFAULT;
- if (ctx.flags==_DRM_CONTEXT_PRESERVED)
- radeon_res_ctx.handle=ctx.handle;
- return 0;
-}
-
-int radeon_getctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
- return -EFAULT;
- /* This is 0, because we don't hanlde any context flags */
- ctx.flags = 0;
- if (copy_to_user((drm_ctx_t*)arg, &ctx, sizeof(ctx)))
- return -EFAULT;
- return 0;
-}
-
-int radeon_switchctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
- return -EFAULT;
- DRM_DEBUG("%d\n", ctx.handle);
- return radeon_context_switch(dev, dev->last_context, ctx.handle);
-}
-
-int radeon_newctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
- return -EFAULT;
- DRM_DEBUG("%d\n", ctx.handle);
- radeon_context_switch_complete(dev, ctx.handle);
-
- return 0;
-}
-
-int radeon_rmctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
- return -EFAULT;
- DRM_DEBUG("%d\n", ctx.handle);
- drm_ctxbitmap_free(dev, ctx.handle);
-
- return 0;
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_cp.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_cp.c
index c255a3e05..d8b85949d 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_cp.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_cp.c
@@ -38,6 +38,12 @@
#define RADEON_FIFO_DEBUG 0
+#if defined(__alpha__)
+# define PCIGART_ENABLED
+#else
+# undef PCIGART_ENABLED
+#endif
+
/* CP microcode (from ATI) */
static u32 radeon_cp_microcode[][2] = {
@@ -520,8 +526,13 @@ static int radeon_do_engine_reset( drm_device_t *dev )
clock_cntl_index = RADEON_READ( RADEON_CLOCK_CNTL_INDEX );
mclk_cntl = RADEON_READ_PLL( dev, RADEON_MCLK_CNTL );
- /* FIXME: remove magic number here and in radeon ddx driver!!! */
- RADEON_WRITE_PLL( RADEON_MCLK_CNTL, mclk_cntl | 0x003f00000 );
+ RADEON_WRITE_PLL( RADEON_MCLK_CNTL, ( mclk_cntl |
+ RADEON_FORCEON_MCLKA |
+ RADEON_FORCEON_MCLKB |
+ RADEON_FORCEON_YCLKA |
+ RADEON_FORCEON_YCLKB |
+ RADEON_FORCEON_MC |
+ RADEON_FORCEON_AIC ) );
rbbm_soft_reset = RADEON_READ( RADEON_RBBM_SOFT_RESET );
@@ -654,7 +665,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
dev_priv->is_pci = init->is_pci;
-#if 1
+#if !defined(PCIGART_ENABLED)
/* PCI support is not 100% working, so we disable it here.
*/
if ( dev_priv->is_pci ) {
@@ -666,7 +677,6 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
#endif
if ( dev_priv->is_pci && !dev->sg ) {
- DRM_DEBUG( "PCI GART memory not allocated!\n" );
DRM_ERROR( "PCI GART memory not allocated!\n" );
DRM(free)( dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER );
dev->dev_private = NULL;
@@ -873,7 +883,6 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
if ( dev_priv->is_pci ) {
dev_priv->phys_pci_gart = DRM(ati_pcigart_init)( dev );
if ( !dev_priv->phys_pci_gart ) {
- DRM_DEBUG( "failed to init PCI GART!\n" );
DRM_ERROR( "failed to init PCI GART!\n" );
DRM(free)( dev_priv, sizeof(*dev_priv),
DRM_MEM_DRIVER );
@@ -899,7 +908,8 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
/* Turn off AGP aperture -- is this required for PCIGART?
*/
- RADEON_WRITE( RADEON_MC_AGP_LOCATION, 0 );
+ RADEON_WRITE( RADEON_MC_AGP_LOCATION, 0xffffffc0 ); /* ?? */
+ RADEON_WRITE( RADEON_AGP_COMMAND, 0 ); /* clear AGP_COMMAND */
} else {
/* Turn off PCI GART
*/
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.c
index d76326676..49599bc82 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.c
@@ -78,6 +78,26 @@
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
+
+#ifndef MODULE
+/* DRM(options) is called by the kernel to parse command-line options
+ * passed via the boot-loader (e.g., LILO). It calls the insmod option
+ * routine, drm_parse_drm.
+ */
+
+/* JH- We have to hand expand the string ourselves because of the cpp. If
+ * anyone can think of a way that we can fit into the __setup macro without
+ * changing it, then please send the solution my way.
+ */
+static int __init radeon_options( char *str )
+{
+ DRM(parse_options)( str );
+ return 1;
+}
+
+__setup( DRIVER_NAME "=", radeon_options );
+#endif
+
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis.h
new file mode 100644
index 000000000..1f33a1e2a
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis.h
@@ -0,0 +1,50 @@
+/* sis_drv.h -- Private header for sis driver -*- linux-c -*-
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+/* $XFree86$ */
+
+#ifndef __SIS_H__
+#define __SIS_H__
+
+/* This remains constant for all DRM template files.
+ * Name it sisdrv_##x as there's a conflict with sis_free/malloc in the kernel
+ * that's used for fb devices
+ */
+#define DRM(x) sisdrv_##x
+
+/* General customization:
+ */
+#define __HAVE_AGP 1
+#define __MUST_HAVE_AGP 0
+#define __HAVE_MTRR 1
+#define __HAVE_CTX_BITMAP 1
+
+/* Buffer customization:
+ */
+#define DRIVER_AGP_BUFFERS_MAP( dev ) \
+ ((drm_sis_private_t *)((dev)->dev_private))->buffers
+
+#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c
deleted file mode 100644
index accd789ae..000000000
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/* sis_context.c -- IOCTLs for sis contexts -*- linux-c -*-
- * Created: Thu Oct 7 10:50:22 1999 by faith@precisioninsight.com
- *
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
- * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Rickard E. (Rik) Faith <faith@valinux.com>
- * Daryll Strauss <daryll@valinux.com>
- * Sung-Ching Lin <sclin@sis.com.tw>
- *
- */
-
-#define __NO_VERSION__
-#include "drmP.h"
-#include "sis_drv.h"
-
-extern drm_ctx_t sis_res_ctx;
-
-static int sis_alloc_queue(drm_device_t *dev)
-{
- return drm_ctxbitmap_next(dev);
-}
-
-int sis_context_switch(drm_device_t *dev, int old, int new)
-{
- char buf[64];
-
- atomic_inc(&dev->total_ctx);
-
- if (test_and_set_bit(0, &dev->context_flag)) {
- DRM_ERROR("Reentering -- FIXME\n");
- return -EBUSY;
- }
-
-#if DRM_DMA_HISTOGRAM
- dev->ctx_start = get_cycles();
-#endif
-
- DRM_DEBUG("Context switch from %d to %d\n", old, new);
-
- if (new == dev->last_context) {
- clear_bit(0, &dev->context_flag);
- return 0;
- }
-
- if (drm_flags & DRM_FLAG_NOCTX) {
- sis_context_switch_complete(dev, new);
- } else {
- sprintf(buf, "C %d %d\n", old, new);
- drm_write_string(dev, buf);
- }
-
- return 0;
-}
-
-int sis_context_switch_complete(drm_device_t *dev, int new)
-{
- dev->last_context = new; /* PRE/POST: This is the _only_ writer. */
- dev->last_switch = jiffies;
-
- if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
- DRM_ERROR("Lock isn't held after context switch\n");
- }
-
- /* If a context switch is ever initiated
- when the kernel holds the lock, release
- that lock here. */
-#if DRM_DMA_HISTOGRAM
- atomic_inc(&dev->histo.ctx[drm_histogram_slot(get_cycles()
- - dev->ctx_start)]);
-
-#endif
- clear_bit(0, &dev->context_flag);
- wake_up(&dev->context_wait);
-
- return 0;
-}
-
-
-int sis_resctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_ctx_res_t res;
- drm_ctx_t ctx;
- int i;
-
- DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS);
- if (copy_from_user(&res, (drm_ctx_res_t *)arg, sizeof(res)))
- return -EFAULT;
- if (res.count >= DRM_RESERVED_CONTEXTS) {
- memset(&ctx, 0, sizeof(ctx));
- for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) {
- ctx.handle = i;
- if (copy_to_user(&res.contexts[i], &i, sizeof(i)))
- return -EFAULT;
- }
- }
- res.count = DRM_RESERVED_CONTEXTS;
- if (copy_to_user((drm_ctx_res_t *)arg, &res, sizeof(res)))
- return -EFAULT;
- return 0;
-}
-
-
-int sis_addctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
- return -EFAULT;
- if ((ctx.handle = sis_alloc_queue(dev)) == DRM_KERNEL_CONTEXT) {
- /* Skip kernel's context and get a new one. */
- ctx.handle = sis_alloc_queue(dev);
- }
- DRM_DEBUG("%d\n", ctx.handle);
- if (ctx.handle == -1) {
- DRM_DEBUG("Not enough free contexts.\n");
- /* Should this return -EBUSY instead? */
- return -ENOMEM;
- }
-
- /* new added */
- sis_init_context(ctx.handle);
-
- if (copy_to_user((drm_ctx_t *)arg, &ctx, sizeof(ctx)))
- return -EFAULT;
- return 0;
-}
-
-int sis_modctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
- return -EFAULT;
- if (ctx.flags==_DRM_CONTEXT_PRESERVED)
- sis_res_ctx.handle=ctx.handle;
- return 0;
-}
-
-int sis_getctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
- return -EFAULT;
- /* This is 0, because we don't hanlde any context flags */
- ctx.flags = 0;
- if (copy_to_user((drm_ctx_t*)arg, &ctx, sizeof(ctx)))
- return -EFAULT;
- return 0;
-}
-
-int sis_switchctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
- return -EFAULT;
- DRM_DEBUG("%d\n", ctx.handle);
- return sis_context_switch(dev, dev->last_context, ctx.handle);
-}
-
-int sis_newctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
- return -EFAULT;
- DRM_DEBUG("%d\n", ctx.handle);
- sis_context_switch_complete(dev, ctx.handle);
-
- return 0;
-}
-
-int sis_rmctx(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- drm_ctx_t ctx;
-
- if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
- return -EFAULT;
- DRM_DEBUG("%d\n", ctx.handle);
- drm_ctxbitmap_free(dev, ctx.handle);
-
- return 0;
-}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drm.h
index 299143f61..339ed5a00 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drm.h
@@ -17,4 +17,20 @@ typedef struct {
unsigned int left, right;
} drm_sis_flip_t;
+#ifdef __KERNEL__
+
+int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg);
+int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg);
+
+int sisp_agp_init(struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg);
+int sisp_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg);
+int sisp_agp_free(struct inode *inode, struct file *filp, unsigned int cmd,
+ unsigned long arg);
+
+#endif
+
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c
index 92ec32ddd..3dd83fd7e 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c
@@ -26,669 +26,49 @@
*/
#include <linux/config.h>
+#include "sis.h"
#include "drmP.h"
#include "sis_drm.h"
#include "sis_drv.h"
-#define SIS_NAME "sis"
-#define SIS_DESC "SIS 300/630/540"
-#define SIS_DATE "20000831"
-#define SIS_MAJOR 1
-#define SIS_MINOR 0
-#define SIS_PATCHLEVEL 0
-
-static drm_device_t sis_device;
-drm_ctx_t sis_res_ctx;
-
-static struct file_operations sis_fops = {
-#if LINUX_VERSION_CODE >= 0x020400
- /* This started being used during 2.4.0-test */
- owner: THIS_MODULE,
-#endif
- open: sis_open,
- flush: drm_flush,
- release: sis_release,
- ioctl: sis_ioctl,
- mmap: drm_mmap,
- read: drm_read,
- fasync: drm_fasync,
- poll: drm_poll,
-};
-
-static struct miscdevice sis_misc = {
- minor: MISC_DYNAMIC_MINOR,
- name: SIS_NAME,
- fops: &sis_fops,
-};
-
-static drm_ioctl_desc_t sis_ioctls[] = {
- [DRM_IOCTL_NR(DRM_IOCTL_VERSION)] = { sis_version, 0, 0 },
- [DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE)] = { drm_getunique, 0, 0 },
- [DRM_IOCTL_NR(DRM_IOCTL_GET_MAGIC)] = { drm_getmagic, 0, 0 },
- [DRM_IOCTL_NR(DRM_IOCTL_IRQ_BUSID)] = { drm_irq_busid, 0, 1 },
-
- [DRM_IOCTL_NR(DRM_IOCTL_SET_UNIQUE)] = { drm_setunique, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_BLOCK)] = { drm_block, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_UNBLOCK)] = { drm_unblock, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)] = { drm_authmagic, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)] = { drm_addmap, 1, 1 },
-
- [DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)] = { sis_addctx, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)] = { sis_rmctx, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_MOD_CTX)] = { sis_modctx, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_GET_CTX)] = { sis_getctx, 1, 0 },
- [DRM_IOCTL_NR(DRM_IOCTL_SWITCH_CTX)] = { sis_switchctx, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_NEW_CTX)] = { sis_newctx, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_RES_CTX)] = { sis_resctx, 1, 0 },
- [DRM_IOCTL_NR(DRM_IOCTL_ADD_DRAW)] = { drm_adddraw, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_RM_DRAW)] = { drm_rmdraw, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_LOCK)] = { sis_lock, 1, 0 },
- [DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] = { sis_unlock, 1, 0 },
- [DRM_IOCTL_NR(DRM_IOCTL_FINISH)] = { drm_finish, 1, 0 },
-#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = {drm_agp_acquire, 1, 1},
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = {drm_agp_release, 1, 1},
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)] = {drm_agp_enable, 1, 1},
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] = {drm_agp_info, 1, 1},
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] = {drm_agp_alloc, 1, 1},
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)] = {drm_agp_free, 1, 1},
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)] = {drm_agp_bind, 1, 1},
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] = {drm_agp_unbind, 1, 1},
-#endif
- /* FB Memory Management */
- [DRM_IOCTL_NR(SIS_IOCTL_FB_ALLOC)] = { sis_fb_alloc, 1, 1 },
- [DRM_IOCTL_NR(SIS_IOCTL_FB_FREE)] = { sis_fb_free, 1, 1 },
-
- /* AGP Memory Management */
- [DRM_IOCTL_NR(SIS_IOCTL_AGP_INIT)] = { sis_agp_init, 1, 1 },
- [DRM_IOCTL_NR(SIS_IOCTL_AGP_ALLOC)] = { sis_agp_alloc, 1, 1 },
- [DRM_IOCTL_NR(SIS_IOCTL_AGP_FREE)] = { sis_agp_free, 1, 1 },
-
-#if defined(SIS_STEREO)
- [DRM_IOCTL_NR(DRM_IOCTL_CONTROL)] = { sis_control, 1, 1 },
- [DRM_IOCTL_NR(SIS_IOCTL_FLIP)] = { sis_flip, 1, 1 },
- [DRM_IOCTL_NR(SIS_IOCTL_FLIP_INIT)] = { sis_flip_init, 1, 1 },
- [DRM_IOCTL_NR(SIS_IOCTL_FLIP_FINAL)] = { sis_flip_final, 1, 1 },
-#endif
-};
-#define SIS_IOCTL_COUNT DRM_ARRAY_SIZE(sis_ioctls)
-
-#ifdef MODULE
-static char *sis = NULL;
-#endif
-
-MODULE_AUTHOR("VA Linux Systems, Inc.");
-MODULE_DESCRIPTION("sis");
-MODULE_PARM(sis, "s");
-
-#ifndef MODULE
-/* sis_options is called by the kernel to parse command-line options
- * passed via the boot-loader (e.g., LILO). It calls the insmod option
- * routine, drm_parse_drm.
- */
-
-static int __init sis_options(char *str)
-{
- drm_parse_options(str);
- return 1;
-}
-
-__setup("sis=", sis_options);
-#endif
-
-static int sis_setup(drm_device_t *dev)
-{
- int i;
-
- atomic_set(&dev->ioctl_count, 0);
- atomic_set(&dev->vma_count, 0);
- dev->buf_use = 0;
- atomic_set(&dev->buf_alloc, 0);
-
- atomic_set(&dev->total_open, 0);
- atomic_set(&dev->total_close, 0);
- atomic_set(&dev->total_ioctl, 0);
- atomic_set(&dev->total_irq, 0);
- atomic_set(&dev->total_ctx, 0);
- atomic_set(&dev->total_locks, 0);
- atomic_set(&dev->total_unlocks, 0);
- atomic_set(&dev->total_contends, 0);
- atomic_set(&dev->total_sleeps, 0);
-
- for (i = 0; i < DRM_HASH_SIZE; i++) {
- dev->magiclist[i].head = NULL;
- dev->magiclist[i].tail = NULL;
- }
- dev->maplist = NULL;
- dev->map_count = 0;
- dev->vmalist = NULL;
- dev->lock.hw_lock = NULL;
- init_waitqueue_head(&dev->lock.lock_queue);
- dev->queue_count = 0;
- dev->queue_reserved = 0;
- dev->queue_slots = 0;
- dev->queuelist = NULL;
- dev->irq = 0;
- dev->context_flag = 0;
- dev->interrupt_flag = 0;
- dev->dma = 0;
- dev->dma_flag = 0;
- dev->last_context = 0;
- dev->last_switch = 0;
- dev->last_checked = 0;
- init_timer(&dev->timer);
- init_waitqueue_head(&dev->context_wait);
-
- dev->ctx_start = 0;
- dev->lck_start = 0;
-
- dev->buf_rp = dev->buf;
- dev->buf_wp = dev->buf;
- dev->buf_end = dev->buf + DRM_BSZ;
- dev->buf_async = NULL;
- init_waitqueue_head(&dev->buf_readers);
- init_waitqueue_head(&dev->buf_writers);
-
- sis_res_ctx.handle=-1;
-
- DRM_DEBUG("\n");
-
- /* The kernel's context could be created here, but is now created
- in drm_dma_enqueue. This is more resource-efficient for
- hardware that does not do DMA, but may mean that
- drm_select_queue fails between the time the interrupt is
- initialized and the time the queues are initialized. */
-
- return 0;
-}
-
-
-static int sis_takedown(drm_device_t *dev)
-{
- int i;
- drm_magic_entry_t *pt, *next;
- drm_map_t *map;
- drm_vma_entry_t *vma, *vma_next;
-
- DRM_DEBUG("\n");
-
-#if defined(SIS_STEREO)
- if (dev->irq) sis_irq_uninstall(dev);
-#endif
-
- down(&dev->struct_sem);
- del_timer(&dev->timer);
-
- if (dev->devname) {
- drm_free(dev->devname, strlen(dev->devname)+1, DRM_MEM_DRIVER);
- dev->devname = NULL;
- }
-
- if (dev->unique) {
- drm_free(dev->unique, strlen(dev->unique)+1, DRM_MEM_DRIVER);
- dev->unique = NULL;
- dev->unique_len = 0;
- }
- /* Clear pid list */
- for (i = 0; i < DRM_HASH_SIZE; i++) {
- for (pt = dev->magiclist[i].head; pt; pt = next) {
- next = pt->next;
- drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC);
- }
- dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
- }
-#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
- /* Clear AGP information */
- if (dev->agp) {
- drm_agp_mem_t *temp;
- drm_agp_mem_t *temp_next;
-
- temp = dev->agp->memory;
- while(temp != NULL) {
- temp_next = temp->next;
- drm_free_agp(temp->memory, temp->pages);
- drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
- temp = temp_next;
- }
- if (dev->agp->acquired) _drm_agp_release();
- }
-#endif
- /* Clear vma list (only built for debugging) */
- if (dev->vmalist) {
- for (vma = dev->vmalist; vma; vma = vma_next) {
- vma_next = vma->next;
- drm_free(vma, sizeof(*vma), DRM_MEM_VMAS);
- }
- dev->vmalist = NULL;
- }
-
- /* Clear map area and mtrr information */
- if (dev->maplist) {
- for (i = 0; i < dev->map_count; i++) {
- map = dev->maplist[i];
- switch (map->type) {
- case _DRM_REGISTERS:
- case _DRM_FRAME_BUFFER:
-#ifdef CONFIG_MTRR
- if (map->mtrr >= 0) {
- int retcode;
- retcode = mtrr_del(map->mtrr,
- map->offset,
- map->size);
- DRM_DEBUG("mtrr_del = %d\n", retcode);
- }
-#endif
- drm_ioremapfree(map->handle, map->size);
- break;
- case _DRM_SHM:
- drm_free_pages((unsigned long)map->handle,
- drm_order(map->size)
- - PAGE_SHIFT,
- DRM_MEM_SAREA);
- break;
- case _DRM_AGP:
- /* Do nothing here, because this is all
- handled in the AGP/GART driver. */
- break;
- }
- drm_free(map, sizeof(*map), DRM_MEM_MAPS);
- }
- drm_free(dev->maplist,
- dev->map_count * sizeof(*dev->maplist),
- DRM_MEM_MAPS);
- dev->maplist = NULL;
- dev->map_count = 0;
- }
-
- if (dev->lock.hw_lock) {
- dev->lock.hw_lock = NULL; /* SHM removed */
- dev->lock.pid = 0;
- wake_up_interruptible(&dev->lock.lock_queue);
- }
- up(&dev->struct_sem);
-
- return 0;
-}
-
-/* sis_init is called via init_module at module load time, or via
- * linux/init/main.c (this is not currently supported). */
-
-static int sis_init(void)
-{
- int retcode;
- drm_device_t *dev = &sis_device;
-
- DRM_DEBUG("\n");
-
- memset((void *)dev, 0, sizeof(*dev));
- dev->count_lock = SPIN_LOCK_UNLOCKED;
- sema_init(&dev->struct_sem, 1);
-
-#ifdef MODULE
- drm_parse_options(sis);
-#endif
-
- if ((retcode = misc_register(&sis_misc))) {
- DRM_ERROR("Cannot register \"%s\"\n", SIS_NAME);
- return retcode;
- }
- dev->device = MKDEV(MISC_MAJOR, sis_misc.minor);
- dev->name = SIS_NAME;
-
- drm_mem_init();
- drm_proc_init(dev);
-#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
- dev->agp = drm_agp_init();
-#endif
- if((retcode = drm_ctxbitmap_init(dev))) {
- DRM_ERROR("Cannot allocate memory for context bitmap.\n");
- drm_proc_cleanup();
- misc_deregister(&sis_misc);
- sis_takedown(dev);
- return retcode;
- }
-
- DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
- SIS_NAME,
- SIS_MAJOR,
- SIS_MINOR,
- SIS_PATCHLEVEL,
- SIS_DATE,
- sis_misc.minor);
-
- return 0;
-}
-
-/* sis_cleanup is called via cleanup_module at module unload time. */
-
-static void sis_cleanup(void)
-{
- drm_device_t *dev = &sis_device;
-
- DRM_DEBUG("\n");
-
- drm_proc_cleanup();
- if (misc_deregister(&sis_misc)) {
- DRM_ERROR("Cannot unload module\n");
- } else {
- DRM_INFO("Module unloaded\n");
- }
- drm_ctxbitmap_cleanup(dev);
- sis_takedown(dev);
-#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
- if (dev->agp) {
- drm_agp_uninit();
- drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
- dev->agp = NULL;
- }
-#endif
-}
-
-module_init(sis_init);
-module_exit(sis_cleanup);
-
-
-int sis_version(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_version_t version;
- int len;
-
- if (copy_from_user(&version, (drm_version_t *)arg, sizeof(version)))
- return -EFAULT;
-
-#define DRM_COPY(name,value) \
- len = strlen(value); \
- if (len > name##_len) len = name##_len; \
- name##_len = strlen(value); \
- if (len && name) { \
- if (copy_to_user(name, value, len)) \
- return -EFAULT; \
- }
-
- version.version_major = SIS_MAJOR;
- version.version_minor = SIS_MINOR;
- version.version_patchlevel = SIS_PATCHLEVEL;
-
- DRM_COPY(version.name, SIS_NAME);
- DRM_COPY(version.date, SIS_DATE);
- DRM_COPY(version.desc, SIS_DESC);
-
- if (copy_to_user((drm_version_t *)arg, &version, sizeof(version)))
- return -EFAULT;
- return 0;
-}
-
-int sis_open(struct inode *inode, struct file *filp)
-{
- drm_device_t *dev = &sis_device;
- int retcode = 0;
-
- DRM_DEBUG("open_count = %d\n", dev->open_count);
- if (!(retcode = drm_open_helper(inode, filp, dev))) {
-#if LINUX_VERSION_CODE < 0x020333
- MOD_INC_USE_COUNT; /* Needed before Linux 2.3.51 */
-#endif
- atomic_inc(&dev->total_open);
- spin_lock(&dev->count_lock);
- if (!dev->open_count++) {
- spin_unlock(&dev->count_lock);
- return sis_setup(dev);
- }
- spin_unlock(&dev->count_lock);
- }
- return retcode;
-}
-
-int sis_release(struct inode *inode, struct file *filp)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev;
- int retcode = 0;
-
- lock_kernel();
- dev = priv->dev;
-
- DRM_DEBUG("open_count = %d\n", dev->open_count);
- if (!(retcode = drm_release(inode, filp))) {
-#if LINUX_VERSION_CODE < 0x020333
- MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */
-#endif
- atomic_inc(&dev->total_close);
- spin_lock(&dev->count_lock);
- if (!--dev->open_count) {
- if (atomic_read(&dev->ioctl_count) || dev->blocked) {
- DRM_ERROR("Device busy: %d %d\n",
- atomic_read(&dev->ioctl_count),
- dev->blocked);
- spin_unlock(&dev->count_lock);
- unlock_kernel();
- return -EBUSY;
- }
- spin_unlock(&dev->count_lock);
- unlock_kernel();
- return sis_takedown(dev);
- }
- spin_unlock(&dev->count_lock);
- }
-
- unlock_kernel();
- return retcode;
-}
-
-/* sis_ioctl is called whenever a process performs an ioctl on /dev/drm. */
-
-int sis_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- int nr = DRM_IOCTL_NR(cmd);
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- int retcode = 0;
- drm_ioctl_desc_t *ioctl;
- drm_ioctl_t *func;
-
- atomic_inc(&dev->ioctl_count);
- atomic_inc(&dev->total_ioctl);
- ++priv->ioctl_count;
-
- DRM_DEBUG("pid = %d, cmd = 0x%02x, nr = 0x%02x, dev 0x%x, auth = %d\n",
- current->pid, cmd, nr, dev->device, priv->authenticated);
-
- if (nr >= SIS_IOCTL_COUNT) {
- retcode = -EINVAL;
- } else {
- ioctl = &sis_ioctls[nr];
- func = ioctl->func;
-
- if (!func) {
- DRM_DEBUG("no function\n");
- retcode = -EINVAL;
- } else if ((ioctl->root_only && !capable(CAP_SYS_ADMIN))
- || (ioctl->auth_needed && !priv->authenticated)) {
- retcode = -EACCES;
- } else {
- retcode = (func)(inode, filp, cmd, arg);
- }
- }
-
- atomic_dec(&dev->ioctl_count);
- return retcode;
-}
-
-int sis_lock(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- DECLARE_WAITQUEUE(entry, current);
- int ret = 0;
- drm_lock_t lock;
-#if DRM_DMA_HISTOGRAM
- cycles_t start;
-
- dev->lck_start = start = get_cycles();
-#endif
-
- if (copy_from_user(&lock, (drm_lock_t *)arg, sizeof(lock)))
- return -EFAULT;
-
- if (lock.context == DRM_KERNEL_CONTEXT) {
- DRM_ERROR("Process %d using kernel context %d\n",
- current->pid, lock.context);
- return -EINVAL;
- }
-
- DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n",
- lock.context, current->pid, dev->lock.hw_lock->lock,
- lock.flags);
-
-#if 0
- /* dev->queue_count == 0 right now for
- sis. FIXME? */
- if (lock.context < 0 || lock.context >= dev->queue_count)
- return -EINVAL;
-#endif
-
- if (!ret) {
-#if 0
- if (_DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock)
- != lock.context) {
- long j = jiffies - dev->lock.lock_time;
-
- if (lock.context == sis_res_ctx.handle &&
- j >= 0 && j < DRM_LOCK_SLICE) {
- /* Can't take lock if we just had it and
- there is contention. */
- DRM_DEBUG("%d (pid %d) delayed j=%d dev=%d jiffies=%d\n",
- lock.context, current->pid, j,
- dev->lock.lock_time, jiffies);
- current->state = TASK_INTERRUPTIBLE;
- current->policy |= SCHED_YIELD;
- schedule_timeout(DRM_LOCK_SLICE-j);
- DRM_DEBUG("jiffies=%d\n", jiffies);
- }
- }
-#endif
- add_wait_queue(&dev->lock.lock_queue, &entry);
- for (;;) {
- current->state = TASK_INTERRUPTIBLE;
- if (!dev->lock.hw_lock) {
- /* Device has been unregistered */
- ret = -EINTR;
- break;
- }
- if (drm_lock_take(&dev->lock.hw_lock->lock,
- lock.context)) {
- dev->lock.pid = current->pid;
- dev->lock.lock_time = jiffies;
- atomic_inc(&dev->total_locks);
- break; /* Got lock */
- }
-
- /* Contention */
- atomic_inc(&dev->total_sleeps);
-#if 1
- current->policy |= SCHED_YIELD;
-#endif
- schedule();
- if (signal_pending(current)) {
- ret = -ERESTARTSYS;
- break;
- }
- }
- current->state = TASK_RUNNING;
- remove_wait_queue(&dev->lock.lock_queue, &entry);
- }
-
-#if 0
- if (!ret && dev->last_context != lock.context &&
- lock.context != sis_res_ctx.handle &&
- dev->last_context != sis_res_ctx.handle) {
- add_wait_queue(&dev->context_wait, &entry);
- current->state = TASK_INTERRUPTIBLE;
- /* PRE: dev->last_context != lock.context */
- sis_context_switch(dev, dev->last_context, lock.context);
- /* POST: we will wait for the context
- switch and will dispatch on a later call
- when dev->last_context == lock.context
- NOTE WE HOLD THE LOCK THROUGHOUT THIS
- TIME! */
- current->policy |= SCHED_YIELD;
- schedule();
- current->state = TASK_RUNNING;
- remove_wait_queue(&dev->context_wait, &entry);
- if (signal_pending(current)) {
- ret = -EINTR;
- } else if (dev->last_context != lock.context) {
- DRM_ERROR("Context mismatch: %d %d\n",
- dev->last_context, lock.context);
- }
- }
-#endif
-
- if (!ret) {
- sigemptyset(&dev->sigmask);
- sigaddset(&dev->sigmask, SIGSTOP);
- sigaddset(&dev->sigmask, SIGTSTP);
- sigaddset(&dev->sigmask, SIGTTIN);
- sigaddset(&dev->sigmask, SIGTTOU);
- dev->sigdata.context = lock.context;
- dev->sigdata.lock = dev->lock.hw_lock;
- block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
-
- if (lock.flags & _DRM_LOCK_READY) {
- /* Wait for space in DMA/FIFO */
- }
- if (lock.flags & _DRM_LOCK_QUIESCENT) {
- /* Make hardware quiescent */
-#if 0
- sis_quiescent(dev);
-#endif
- }
- }
-
- DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock");
-
-#if DRM_DMA_HISTOGRAM
- atomic_inc(&dev->histo.lacq[drm_histogram_slot(get_cycles() - start)]);
-#endif
-
- return ret;
-}
-
-
-int sis_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- drm_lock_t lock;
-
- if (copy_from_user(&lock, (drm_lock_t *)arg, sizeof(lock)))
- return -EFAULT;
-
- if (lock.context == DRM_KERNEL_CONTEXT) {
- DRM_ERROR("Process %d using kernel context %d\n",
- current->pid, lock.context);
- return -EINVAL;
- }
-
- DRM_DEBUG("%d frees lock (%d holds)\n",
- lock.context,
- _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock));
- atomic_inc(&dev->total_unlocks);
- if (_DRM_LOCK_IS_CONT(dev->lock.hw_lock->lock))
- atomic_inc(&dev->total_contends);
- drm_lock_transfer(dev, &dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT);
- /* FIXME: Try to send data to card here */
- if (!dev->context_flag) {
- if (drm_lock_free(dev, &dev->lock.hw_lock->lock,
- DRM_KERNEL_CONTEXT)) {
- DRM_ERROR("\n");
- }
- }
-
- unblock_all_signals();
- return 0;
-}
+#define DRIVER_AUTHOR "SIS"
+#define DRIVER_NAME "sis"
+#define DRIVER_DESC "SIS 300/630/540"
+#define DRIVER_DATE "20010503"
+#define DRIVER_MAJOR 1
+#define DRIVER_MINOR 0
+#define DRIVER_PATCHLEVEL 0
+
+#define DRIVER_IOCTLS \
+ [DRM_IOCTL_NR(SIS_IOCTL_FB_ALLOC)] = { sis_fb_alloc, 1, 1 }, \
+ [DRM_IOCTL_NR(SIS_IOCTL_FB_FREE)] = { sis_fb_free, 1, 1 }, \
+ /* AGP Memory Management */ \
+ [DRM_IOCTL_NR(SIS_IOCTL_AGP_INIT)] = { sisp_agp_init, 1, 1 }, \
+ [DRM_IOCTL_NR(SIS_IOCTL_AGP_ALLOC)] = { sisp_agp_alloc, 1, 1 }, \
+ [DRM_IOCTL_NR(SIS_IOCTL_AGP_FREE)] = { sisp_agp_free, 1, 1 }
+#if 0 /* these don't appear to be defined */
+ /* SIS Stereo */
+ [DRM_IOCTL_NR(DRM_IOCTL_CONTROL)] = { sis_control, 1, 1 },
+ [DRM_IOCTL_NR(SIS_IOCTL_FLIP)] = { sis_flip, 1, 1 },
+ [DRM_IOCTL_NR(SIS_IOCTL_FLIP_INIT)] = { sis_flip_init, 1, 1 },
+ [DRM_IOCTL_NR(SIS_IOCTL_FLIP_FINAL)] = { sis_flip_final, 1, 1 }
+#endif
+
+#define __HAVE_COUNTERS 5
+
+#include "drm_auth.h"
+#include "drm_agpsupport.h"
+#include "drm_bufs.h"
+#include "drm_context.h"
+#include "drm_dma.h"
+#include "drm_drawable.h"
+#include "drm_drv.h"
+#include "drm_fops.h"
+#include "drm_init.h"
+#include "drm_ioctl.h"
+#include "drm_lists.h"
+#include "drm_lock.h"
+#include "drm_memory.h"
+#include "drm_proc.h"
+#include "drm_vm.h"
+#include "drm_stub.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h
index 8c4e29108..844e38b07 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h
@@ -28,53 +28,11 @@
#ifndef _SIS_DRV_H_
#define _SIS_DRV_H_
- /* sis_drv.c */
-extern int sis_version(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
-extern int sis_open(struct inode *inode, struct file *filp);
-extern int sis_release(struct inode *inode, struct file *filp);
-extern int sis_ioctl(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
-extern int sis_irq_install(drm_device_t *dev, int irq);
-extern int sis_irq_uninstall(drm_device_t *dev);
-extern int sis_control(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
-extern int sis_lock(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
-extern int sis_unlock(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
+typedef struct drm_sis_private {
+ drm_map_t *buffers;
+} drm_sis_private_t;
- /* sis_context.c */
-
-extern int sis_resctx(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
-extern int sis_addctx(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
-extern int sis_modctx(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
-extern int sis_getctx(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
-extern int sis_switchctx(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
-extern int sis_newctx(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
-extern int sis_rmctx(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg);
-
-extern int sis_context_switch(drm_device_t *dev, int old, int new);
-extern int sis_context_switch_complete(drm_device_t *dev, int new);
-
-int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg);
-int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg);
-
-int sis_agp_init(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg);
-int sis_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg);
-int sis_agp_free(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg);
+/* Stereo ? - this was never committed */
int sis_flip(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg);
@@ -83,8 +41,5 @@ int sis_flip_init(struct inode *inode, struct file *filp, unsigned int cmd,
int sis_flip_final(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg);
void flip_final(void);
-
-int sis_init_context(int contexy);
-int sis_final_context(int context);
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c
index 4c2b5a6c6..2c2e0d95a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c
@@ -29,10 +29,12 @@
*/
#define __NO_VERSION__
+#include "sis.h"
+#include <linux/sisfb.h>
#include "drmP.h"
#include "sis_drm.h"
-#include "sis_ds.h"
#include "sis_drv.h"
+#include "sis_ds.h"
#define MAX_CONTEXT 100
#define VIDEO_TYPE 0
@@ -149,7 +151,7 @@ int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd,
static memHeap_t *AgpHeap = NULL;
-int sis_agp_init(struct inode *inode, struct file *filp, unsigned int cmd,
+int sisp_agp_init(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
drm_sis_agp_t agp;
@@ -164,7 +166,7 @@ int sis_agp_init(struct inode *inode, struct file *filp, unsigned int cmd,
return 0;
}
-int sis_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
+int sisp_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
drm_sis_mem_t agp;
@@ -201,7 +203,7 @@ int sis_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
return retval;
}
-int sis_agp_free(struct inode *inode, struct file *filp, unsigned int cmd,
+int sisp_agp_free(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
drm_sis_mem_t agp;
@@ -277,7 +279,9 @@ int sis_final_context(int context)
retval = setFirst(set, &item);
while(retval){
DRM_DEBUG("free video memory 0x%x\n", item);
+#if 0
sis_free(item);
+#endif
retval = setNext(set, &item);
}
setDestroy(set);
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c
index 6c1b7b52d..94e5d41c5 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c
@@ -60,6 +60,26 @@ static u_int DRM(idlist)[] = {
#include "drm_dma.h"
#include "drm_drawable.h"
#include "drm_drv.h"
+
+#ifndef MODULE
+/* DRM(options) is called by the kernel to parse command-line options
+ * passed via the boot-loader (e.g., LILO). It calls the insmod option
+ * routine, drm_parse_drm.
+ */
+
+/* JH- We have to hand expand the string ourselves because of the cpp. If
+ * anyone can think of a way that we can fit into the __setup macro without
+ * changing it, then please send the solution my way.
+ */
+static int __init tdfx_options( char *str )
+{
+ DRM(parse_options)( str );
+ return 1;
+}
+
+__setup( DRIVER_NAME "=", tdfx_options );
+#endif
+
#include "drm_fops.h"
#include "drm_init.h"
#include "drm_ioctl.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c
index 47f550f85..d27a8fda4 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c
@@ -27,7 +27,7 @@
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
* Kevin E. Martin <martin@valinux.com>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.20 2001/04/18 18:44:39 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.22 2001/05/19 00:26:45 dawes Exp $
*
*/
@@ -68,10 +68,12 @@ extern int xf86RemoveSIGIOHandler(int fd);
# endif
#endif
+/* No longer needed with CVS kernel modules on alpha
#if defined(__alpha__) && defined(__linux__)
extern unsigned long _bus_base(void);
#define BUS_BASE _bus_base()
#endif
+*/
/* Not all systems have MAP_FAILED defined */
#ifndef MAP_FAILED
@@ -542,11 +544,12 @@ int drmAddMap(int fd,
drm_map_t map;
map.offset = offset;
+/* No longer needed with CVS kernel modules on alpha
#ifdef __alpha__
- /* Make sure we add the bus_base to all but shm */
if (type != DRM_SHM)
map.offset += BUS_BASE;
#endif
+*/
map.size = size;
map.handle = 0;
map.type = type;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c
index 4a4cb98a6..a7f69d95a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c
@@ -26,7 +26,7 @@
* Author: Kevin E. Martin <martin@valinux.com>
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c,v 1.9 2001/04/10 16:08:04 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c,v 1.9.2.1 2001/05/23 18:58:00 dawes Exp $ */
#ifdef XFree86Server
# include "xf86.h"
@@ -75,7 +75,7 @@ extern int xf86RemoveSIGIOHandler(int fd);
#include "drm.h"
#define R128_BUFFER_RETRY 32
-#define R128_IDLE_RETRY 16
+#define R128_IDLE_RETRY 32
int drmR128InitCCE( int fd, drmR128Init *info )
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c
index ef0ae01bd..fb36a2883 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c,v 1.5 2001/04/10 16:08:04 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c,v 1.6.2.1 2001/05/22 21:25:46 dawes Exp $ */
#ifdef XFree86Server
# include "xf86.h"
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c
index 07451887b..51f680284 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.22 2001/03/03 23:54:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.24 2001/05/15 10:19:42 eich Exp $ */
/*
* linux specific part of the int10 module
* Copyright 1999 Egbert Eich
@@ -24,6 +24,7 @@
#endif
#define ALLOC_ENTRIES(x) ((V_RAM / x) - 1)
#define REG pInt
+#define SHMERRORPTR (pointer)(-1)
static int counter = 0;
@@ -61,15 +62,20 @@ xf86InitInt10(int entityIndex)
int fd;
static void* vidMem = NULL;
static void* sysMem = NULL;
+ void *options = NULL;
int low_mem;
int high_mem;
- char *base;
- char *base_high;
+ char *base = SHMERRORPTR;
+ char *base_high = SHMERRORPTR;
int pagesize, cs;
legacyVGARec vga;
-
+ xf86int10BiosLocation bios;
+
screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex;
- if (int10skip(xf86Screens[screen], entityIndex))
+
+ options = xf86HandleInt10Options(xf86Screens[screen],entityIndex);
+
+ if (int10skip(options))
return NULL;
if ((!vidMem) || (!sysMem)) {
@@ -139,8 +145,10 @@ xf86InitInt10(int entityIndex)
((linuxInt10Priv*)pInt->private)->lowMem = low_mem;
base = shmat(low_mem, 0, 0);
+ if (base == SHMERRORPTR) goto error4;
((linuxInt10Priv *)pInt->private)->base = base;
base_high = shmat(high_mem, 0, 0);
+ if (base_high == SHMERRORPTR) goto error4;
((linuxInt10Priv*)pInt->private)->base_high = base_high;
MapCurrentInt10(pInt);
@@ -164,52 +172,120 @@ xf86InitInt10(int entityIndex)
if (xf86ReadBIOS(cs, 0, (pointer)cs, V_BIOS_SIZE) < V_BIOS_SIZE)
xf86DrvMsg(screen, X_WARNING,
"Unable to retrieve all of segment 0x%06X.\n", cs);
-
- if (xf86IsEntityPrimary(entityIndex)
- && !(initPrimary(xf86Screens[screen],entityIndex))) {
- cs = ((CARD16*)0)[(0x10<<1) + 1];
- bios_base = (unsigned char *)(cs << 4);
+ xf86int10ParseBiosLocation(options,&bios);
- if (!int10_check_bios(screen, cs, bios_base)) {
- cs = ((CARD16*)0)[(0x42 << 1) + 1];
+ if (xf86IsEntityPrimary(entityIndex)
+ && !(initPrimary(options))) {
+ if (bios.bus == BUS_ISA && bios.location.legacy) {
+ xf86DrvMsg(screen, X_CONFIG,
+ "Overriding BIOS location: 0x%lx\n",
+ bios.location.legacy);
+ cs = bios.location.legacy >> 4;
bios_base = (unsigned char *)(cs << 4);
if (!int10_check_bios(screen, cs, bios_base)) {
- cs = V_BIOS >> 4;
+ xf86DrvMsg(screen, X_ERROR,
+ "No V_BIOS at specified address 0x%x\n",cs << 4);
+ goto error3;
+ }
+ } else {
+ if (bios.bus == BUS_PCI) {
+ xf86DrvMsg(screen, X_WARNING,
+ "Option BiosLocation for primary device ignored: "
+ "It points to PCI.\n");
+ xf86DrvMsg(screen, X_WARNING,
+ "You must set Option InitPrimary also\n");
+ }
+
+ cs = ((CARD16*)0)[(0x10<<1) + 1];
+
+ bios_base = (unsigned char *)(cs << 4);
+
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ cs = ((CARD16*)0)[(0x42 << 1) + 1];
bios_base = (unsigned char *)(cs << 4);
if (!int10_check_bios(screen, cs, bios_base)) {
- xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n");
- goto error3;
+ cs = V_BIOS >> 4;
+ bios_base = (unsigned char *)(cs << 4);
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n");
+ goto error3;
+ }
}
}
}
+
xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs);
pInt->BIOSseg = cs;
set_return_trap(pInt);
} else {
EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex);
- switch (pEnt->location.type) {
+ BusType location_type;
+
+ if (bios.bus != BUS_NONE) {
+ switch (location_type = bios.bus) {
+ case BUS_PCI:
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "PCI:%i:%i%i\n",bios.location.pci.bus,
+ bios.location.pci.dev,bios.location.pci.func);
+ break;
+ case BUS_ISA:
+ if (bios.location.legacy)
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "Legacy:0x%x\n",bios.location.legacy);
+ else
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "Legacy\n");
+ break;
+ default:
+ break;
+ }
+ } else
+ location_type = pEnt->location.type;
+
+ switch (location_type) {
case BUS_PCI:
- if (!mapPciRom(pInt, (unsigned char *)(V_BIOS))) {
+ {
+ int pci_entity;
+
+ if (bios.bus == BUS_PCI)
+ pci_entity = xf86GetPciEntity(bios.location.pci.bus,
+ bios.location.pci.dev,
+ bios.location.pci.func);
+ else
+ pci_entity = pInt->entityIndex;
+
+ if (!mapPciRom(pci_entity, (unsigned char *)(V_BIOS))) {
xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS\n");
goto error3;
}
pInt->BIOSseg = V_BIOS >> 4;
break;
+ }
case BUS_ISA:
- cs = ((CARD16*)0)[(0x10<<1)+1];
- bios_base = (unsigned char *)(cs << 4);
-
- if (!int10_check_bios(screen, cs, bios_base)) {
- cs = ((CARD16*)0)[(0x42<<1)+1];
+ if (bios.bus == BUS_ISA && bios.location.legacy) {
+ cs = bios.location.legacy >> 4;
bios_base = (unsigned char *)(cs << 4);
if (!int10_check_bios(screen, cs, bios_base)) {
- cs = V_BIOS >> 4;
+ xf86DrvMsg(screen,X_ERROR,"No V_BIOS found "
+ "on override address 0x%x\n",bios_base);
+ goto error3;
+ }
+ } else {
+ cs = ((CARD16*)0)[(0x10<<1)+1];
+ bios_base = (unsigned char *)(cs << 4);
+
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ cs = ((CARD16*)0)[(0x42<<1)+1];
bios_base = (unsigned char *)(cs << 4);
if (!int10_check_bios(screen, cs, bios_base)) {
- xf86DrvMsg(screen,X_ERROR,"No V_BIOS found\n");
- goto error3;
+ cs = V_BIOS >> 4;
+ bios_base = (unsigned char *)(cs << 4);
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ xf86DrvMsg(screen,X_ERROR,"No V_BIOS found\n");
+ goto error3;
+ }
}
}
}
@@ -233,32 +309,45 @@ xf86InitInt10(int entityIndex)
return pInt;
- error3:
+error4:
+ xf86DrvMsg(screen, X_ERROR, "shmat() call retruned errno %d\n", errno);
+error3:
shmdt(base_high);
shmdt(base);
shmdt(0);
shmdt((char*)HIGH_MEM);
shmctl(low_mem, IPC_RMID, NULL);
Int10Current = NULL;
- error2:
+error2:
shmctl(high_mem, IPC_RMID,NULL);
- error1:
+error1:
xfree(((linuxInt10Priv*)pInt->private)->alloc);
xfree(pInt->private);
- error0:
+error0:
xfree(pInt);
return NULL;
}
-void
+Bool
MapCurrentInt10(xf86Int10InfoPtr pInt)
{
+ pointer addr;
+
if (Int10Current) {
shmdt(0);
shmdt((char*)HIGH_MEM);
}
- shmat(((linuxInt10Priv*)pInt->private)->lowMem, (char*)1, SHM_RND);
- shmat(((linuxInt10Priv*)pInt->private)->highMem, (char*)HIGH_MEM, 0);
+ addr = shmat(((linuxInt10Priv*)pInt->private)->lowMem, (char*)1, SHM_RND);
+ if (addr == SHMERRORPTR) {
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot shmat() low memory\n");
+ return FALSE;
+ }
+ addr = shmat(((linuxInt10Priv*)pInt->private)->highMem, (char*)HIGH_MEM, 0);
+ if (addr == SHMERRORPTR) {
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot shmat() high memory\n");
+ return FALSE;
+ }
+ return TRUE;
}
void
@@ -557,11 +646,9 @@ do_vm86(xf86Int10InfoPtr pInt)
{
int retval, signo;
- xf86DisableIO(); /* So that all I/O can be trapped */
xf86InterceptSignals(&signo);
retval = vm86_rep(VM86S);
xf86InterceptSignals(NULL);
- xf86EnableIO();
if (signo >= 0) {
xf86DrvMsg(pInt->scrnIndex, X_ERROR,
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c
index 3f22be0b7..b66bb0329 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c
@@ -6,7 +6,7 @@
* Copyright © 2000 VA Linux Systems, Inc.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v 3.4 2000/08/28 18:12:56 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v 3.5 2001/05/19 00:26:45 dawes Exp $ */
#include "X.h"
#include "xf86.h"
@@ -34,15 +34,29 @@
static int gartFd = -1;
static int acquiredScreen = -1;
-
+static Bool initDone = FALSE;
/*
- * Open /dev/agpgart. Keep it open until server exit.
+ * Close /dev/agpgart. This frees all associated memory allocated during
+ * this server generation.
*/
+Bool
+xf86GARTCloseScreen(int screenNum)
+{
+ if(gartFd != -1) {
+ close(gartFd);
+ acquiredScreen = -1;
+ gartFd = -1;
+ initDone = FALSE;
+ }
+ return TRUE;
+}
+/*
+ * Open /dev/agpgart. Keep it open until xf86GARTCloseScreen is called.
+ */
static Bool
GARTInit()
{
- static Bool initDone = FALSE;
struct _agp_info agpinf;
if (initDone)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c
index acbeaa187..2a4c958ef 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c,v 3.6 2001/04/03 17:05:32 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c,v 3.6.2.1 2001/06/01 20:03:52 dawes Exp $ */
#include <stdio.h>
#include "X.h"
@@ -9,6 +9,16 @@
#include "xf86_OSproc.h"
#include "xf86Pci.h"
+#ifdef __sparc__
+#define PCIADDR_TYPE long long
+#define PCIADDR_IGNORE_FMT "%*llx"
+#define PCIADDR_FMT "%llx"
+#else
+#define PCIADDR_TYPE long
+#define PCIADDR_IGNORE_FMT "%*lx"
+#define PCIADDR_FMT "%lx"
+#endif
+
Bool
xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits)
{
@@ -16,9 +26,9 @@ xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits)
char c[0x200];
char *res;
int bus, devfn, dev, fn;
- unsigned int size[7];
+ unsigned PCIADDR_TYPE size[7];
unsigned int num;
- int Size;
+ signed PCIADDR_TYPE Size;
if (index > 7)
return FALSE;
@@ -28,12 +38,28 @@ xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits)
do {
res = fgets(c,0x1ff,file);
if (res) {
- num = sscanf(res,"%02x%02x\t%*04x%*04x\t%*x"
- "\t%*x\t%*x\t%*x\t%*x\t%*x\t%*x\t%*x"
- "\t%x\t%x\t%x\t%x\t%x\t%x\t%x",
+ num = sscanf(res,
+ /*bus+dev vendorid deviceid irq */
+ "%02x%02x\t%*04x%*04x\t%*x"
+ /* 7 PCI resource base addresses */
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ /* 7 PCI resource sizes, and then optionally a driver name */
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT,
&bus,&devfn,&size[0],&size[1],&size[2],&size[3],
&size[4],&size[5],&size[6]);
- if (num != 9) { /* apparently not 2.3 style */
+ if (num != 9) { /* apparantly not 2.3 style */
fclose(file);
return FALSE;
}
@@ -42,9 +68,9 @@ xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits)
if (tag == pciTag(bus,dev,fn)) {
*bits = 0;
if (size[index] != 0) {
- Size = size[index] - 1;
- while (Size & 0x01) {
- Size = Size >> 1;
+ Size = size[index] - ((PCIADDR_TYPE) 1);
+ while (Size & ((PCIADDR_TYPE) 0x01)) {
+ Size = Size >> ((PCIADDR_TYPE) 1);
(*bits)++;
}
}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c
index 6c8775c0e..8ed02faf5 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c,v 3.50 2001/04/10 16:08:03 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c,v 3.51.2.3 2001/05/29 16:38:00 tsi Exp $ */
/*
* Copyright 1992 by Orest Zborowski <obz@Kodak.com>
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
@@ -248,11 +248,10 @@ mtrr_add_wc_region(int screenNum, unsigned long base, unsigned long size,
* Splits up the write-combining region if it is not aligned on a
* size boundary.
*/
-
if (base % size) {
struct mtrr_wc_region *wcrc = wcr;
int rgs = 1;
- int srem, sdiv, bcurr;
+ unsigned long srem, sdiv, bcurr;
xf86DrvMsgVerb(screenNum, X_INFO, 2,
"WC region has to be split (0x%lx,0x%lx)\n", base, size);
@@ -261,9 +260,9 @@ mtrr_add_wc_region(int screenNum, unsigned long base, unsigned long size,
srem = size;
do {
- for (sdiv = size; sdiv /= 2; sdiv) {
+ for (sdiv = (0x1 << 31); sdiv; sdiv = sdiv >> 1) {
while(sdiv > srem) {
- sdiv /= 2;
+ sdiv >>= 1;
}
if (!(bcurr % sdiv)) {
mtrr_add_wc_region(screenNum, bcurr,
@@ -398,7 +397,15 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
pVidMem->initialised = TRUE;
}
-
+#ifdef __sparc__
+/* Basically, you simply cannot do this on Sparc. You have to do something portable
+ * like use /dev/fb* or mmap() on /proc/bus/pci/X/Y nodes. -DaveM
+ */
+static pointer mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ return NULL;
+}
+#else
static pointer
mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
{
@@ -453,6 +460,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
#endif
return (char *)base + alignOff;
}
+#endif /* !(__sparc__) */
static void
unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
@@ -512,6 +520,10 @@ xf86EnableIO(void)
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__)
if (ioperm(0, 1024, 1) || iopl(3))
FatalError("xf86EnableIOPorts: Failed to set IOPL for I/O\n");
+# if !defined(__alpha__)
+ ioperm(0x40,4,0); /* trap access to the timer chip */
+ ioperm(0x60,4,0); /* trap access to the keyboard controller */
+# endif
#endif
ExtendedEnabled = TRUE;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c b/xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c
index 297ce45ea..5b738432a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c,v 1.2 2000/07/13 21:31:40 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c,v 1.3 2001/04/30 14:34:58 tsi Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
@@ -210,10 +210,11 @@ UnmapVRam(xf86Int10InfoPtr pInt)
xf86UnMapVidMem(screen,INTPriv(pInt)->vRam,size);
}
-void
+Bool
MapCurrentInt10(xf86Int10InfoPtr pInt)
{
- /* nothing to do here */
+ /* nothing to do here */
+ return TRUE;
}
void
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c
index 4c5ec4b47..c1100e67b 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c
@@ -3,7 +3,7 @@
* AGP GART support.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c,v 1.2 2000/08/25 01:19:17 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c,v 1.3 2001/05/19 00:26:46 dawes Exp $ */
#include "X.h"
#include "xf86.h"
@@ -12,6 +12,12 @@
#include "xf86OSpriv.h"
Bool
+xf86GARTCloseScreen(int screenNum)
+{
+ return FALSE;
+}
+
+Bool
xf86AgpGARTSupported()
{
return FALSE;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c
index e4ecfab59..d2e012045 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c,v 1.8 2000/11/19 16:38:06 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c,v 1.8.4.1 2001/05/23 14:47:45 alanh Exp $ */
/*
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
*
@@ -149,7 +149,8 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
return(-1);
}
- xf86SlowBCopyFromBus(base+JENSEN_SHIFT(Offset), Buf, Len);
+ xf86SlowBCopyFromBus((unsigned char *)(base+JENSEN_SHIFT(Offset)),
+ Buf, Len);
munmap((caddr_t)JENSEN_SHIFT(base), JENSEN_SHIFT(mlen));
close(fd);
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h
index 3def97f74..ac9f407a7 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h
@@ -44,8 +44,27 @@
#define DRM_IOCTL_NR(n) ((n) & 0xff)
#endif
+#define XFREE86_VERSION(major,minor,patch,snap) \
+ ((major << 16) | (minor << 8) | patch)
+
+#ifndef CONFIG_XFREE86_VERSION
+#define CONFIG_XFREE86_VERSION XFREE86_VERSION(4,1,0,0)
+#endif
+
+#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
+#define DRM_PROC_DEVICES "/proc/devices"
+#define DRM_PROC_MISC "/proc/misc"
+#define DRM_PROC_DRM "/proc/drm"
+#define DRM_DEV_DRM "/dev/drm"
+#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)
+#define DRM_DEV_UID 0
+#define DRM_DEV_GID 0
+#endif
+
+#if CONFIG_XFREE86_VERSION >= XFREE86_VERSION(4,1,0,0)
#define DRM_MAJOR 226
#define DRM_MAX_MINOR 15
+#endif
#define DRM_NAME "drm" /* Name in kernel, /dev, and /proc */
#define DRM_MIN_ORDER 5 /* At least 2^5 bytes = 32 bytes */
#define DRM_MAX_ORDER 22 /* Up to 2^22 bytes = 4MB */
@@ -438,15 +457,15 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_R128_CCE_RESET DRM_IO( 0x43)
#define DRM_IOCTL_R128_CCE_IDLE DRM_IO( 0x44)
#define DRM_IOCTL_R128_RESET DRM_IO( 0x46)
-#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( 0x47, drm_r128_fullscreen_t)
-#define DRM_IOCTL_R128_SWAP DRM_IO( 0x48)
-#define DRM_IOCTL_R128_CLEAR DRM_IOW( 0x49, drm_r128_clear_t)
-#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x4a, drm_r128_vertex_t)
-#define DRM_IOCTL_R128_INDICES DRM_IOW( 0x4b, drm_r128_indices_t)
-#define DRM_IOCTL_R128_BLIT DRM_IOW( 0x4c, drm_r128_blit_t)
-#define DRM_IOCTL_R128_DEPTH DRM_IOW( 0x4d, drm_r128_depth_t)
-#define DRM_IOCTL_R128_STIPPLE DRM_IOW( 0x4e, drm_r128_stipple_t)
+#define DRM_IOCTL_R128_SWAP DRM_IO( 0x47)
+#define DRM_IOCTL_R128_CLEAR DRM_IOW( 0x48, drm_r128_clear_t)
+#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x49, drm_r128_vertex_t)
+#define DRM_IOCTL_R128_INDICES DRM_IOW( 0x4a, drm_r128_indices_t)
+#define DRM_IOCTL_R128_BLIT DRM_IOW( 0x4b, drm_r128_blit_t)
+#define DRM_IOCTL_R128_DEPTH DRM_IOW( 0x4c, drm_r128_depth_t)
+#define DRM_IOCTL_R128_STIPPLE DRM_IOW( 0x4d, drm_r128_stipple_t)
#define DRM_IOCTL_R128_INDIRECT DRM_IOWR(0x4f, drm_r128_indirect_t)
+#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( 0x50, drm_r128_fullscreen_t)
/* Radeon specific ioctls */
#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( 0x40, drm_radeon_init_t)
@@ -460,9 +479,9 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_RADEON_CLEAR DRM_IOW( 0x48, drm_radeon_clear_t)
#define DRM_IOCTL_RADEON_VERTEX DRM_IOW( 0x49, drm_radeon_vertex_t)
#define DRM_IOCTL_RADEON_INDICES DRM_IOW( 0x4a, drm_radeon_indices_t)
-#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4b, drm_radeon_texture_t)
#define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( 0x4c, drm_radeon_stipple_t)
#define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(0x4d, drm_radeon_indirect_t)
+#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4e, drm_radeon_texture_t)
#ifdef CONFIG_DRM_SIS
/* SiS specific ioctls */
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c
index 8468d7947..9ba4edf24 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.72 2001/02/12 01:34:53 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.75 2001/05/18 20:22:30 tsi Exp $ */
/*
* Copyright 1997 by The XFree86 Project, Inc.
*
@@ -1886,7 +1886,7 @@ xf86shmdt(char *addr)
* for now only implement the rmid command.
*/
int
-xf86shmctl(int id, int xf86cmd, pointer *buf)
+xf86shmctl(int id, int xf86cmd, pointer buf)
{
int cmd;
@@ -1898,7 +1898,7 @@ xf86shmctl(int id, int xf86cmd, pointer *buf)
return 0;
}
- return shmctl(id, cmd, NULL);
+ return shmctl(id, cmd, buf);
}
#else
@@ -1916,7 +1916,7 @@ xf86shmat(int id, char *addr, int xf86shmflg)
}
int
-xf86shmctl(int id, int xf86cmd, pointer *buf)
+xf86shmctl(int id, int xf86cmd, pointer buf)
{
return -1;
}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c
index 69c485202..fb3b824be 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c,v 1.13 2000/10/28 01:42:28 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c,v 1.14 2001/05/04 19:05:51 dawes Exp $ */
/*
* Copyright 1993-1999 by The XFree86 Project, Inc
*
@@ -112,25 +112,25 @@ removeMapping(VidMapPtr vp, MappingPtr mp)
}
enum { OPTION_MTRR };
-static OptionInfoRec opts[] =
+static const OptionInfoRec opts[] =
{
{ OPTION_MTRR, "mtrr", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
-#define nopts (sizeof(opts) / sizeof(opts[0]))
-
static void
checkMtrrOption(VidMapPtr vp)
{
if (!vp->mtrrOptChecked && vp->pScrn && vp->pScrn->options != NULL) {
- OptionInfoRec options[nopts];
+ OptionInfoPtr options;
+ options = xnfalloc(sizeof(opts));
(void)memcpy(options, opts, sizeof(opts));
xf86ProcessOptions(vp->pScrn->scrnIndex, vp->pScrn->options,
options);
if (xf86GetOptValBool(options, OPTION_MTRR, &vp->mtrrEnabled))
vp->mtrrFrom = X_CONFIG;
+ xfree(options);
vp->mtrrOptChecked = TRUE;
}
}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c b/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c
index 82eb25106..57f994856 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c,v 1.15 2001/02/15 20:00:08 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c,v 1.16 2001/05/04 19:05:51 dawes Exp $ */
/*
* XFree86 vbe module
@@ -215,13 +215,11 @@ typedef enum {
VBEOPT_NOVBE
} VBEOpts;
-static OptionInfoRec VBEOptions[] = {
+static const OptionInfoRec VBEOptions[] = {
{ VBEOPT_NOVBE, "NoVBE", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE },
};
-#define nVBEOptions (sizeof(VBEOptions) / sizeof(VBEOptions[0]))
-
static unsigned char *
vbeReadEDID(vbeInfoPtr pVbe)
{
@@ -230,13 +228,15 @@ vbeReadEDID(vbeInfoPtr pVbe)
unsigned char *tmp = NULL;
Bool novbe = FALSE;
int screen = pVbe->pInt10->scrnIndex;
- OptionInfoRec options[nVBEOptions];
+ OptionInfoPtr options;
if (!page) return NULL;
+ options = xnfalloc(sizeof(VBEOptions));
(void)memcpy(options, VBEOptions, sizeof(VBEOptions));
xf86ProcessOptions(screen, xf86Screens[screen]->options, options);
xf86GetOptValBool(options, VBEOPT_NOVBE, &novbe);
+ xfree(options);
if (novbe) return NULL;
if (!vbeProbeDDC(pVbe)) goto error;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h
index f4c78d3bd..eb38e5ad6 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v 3.80 2001/04/20 16:54:05 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v 3.81.2.1 2001/05/29 16:38:00 tsi Exp $ */
/*
* Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
* Copyright 1992 by David Dawes <dawes@XFree86.org>
@@ -108,7 +108,10 @@ extern int vsnprintf(char *str, size_t size, const char *format, va_list ap);
/**************************************************************************/
/* SYSV386 (SVR3, SVR4) - But not Solaris8 */
/**************************************************************************/
-#if (defined(SYSV) || defined(SVR4)) && !defined(DGUX) && !defined(__SOL8__)
+#if (defined(SYSV) || defined(SVR4)) && \
+ !defined(DGUX) && \
+ !defined(__SOL8__) && \
+ (!defined(sun) || defined(i386))
# ifdef SCO325
# ifndef _SVID3
# define _SVID3
@@ -252,7 +255,7 @@ extern int vsnprintf(char *str, size_t size, const char *format, va_list ap);
* Good ol' Solaris8, and its lack of VT support
***********/
-#ifdef __SOL8__
+#if defined(__SOL8__) || (defined(sun) && !defined(i386))
# include <sys/mman.h>
# include <errno.h>
# ifdef i386
@@ -374,10 +377,6 @@ extern int errno;
# define POSIX_TTY
-# ifdef __sparc__
-# define DEV_MEM "/dev/fb"
-# endif
-
#endif /* linux */
/**************************************************************************/
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h
index 99d5aeda6..ebc19bf54 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h
@@ -64,7 +64,7 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.51 2001/04/16 15:02:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.52 2001/05/19 00:26:45 dawes Exp $ */
#ifndef _XF86_OSPROC_H
#define _XF86_OSPROC_H
@@ -193,6 +193,7 @@ extern int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
extern Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset);
extern Bool xf86UnbindGARTMemory(int screenNum, int key);
extern Bool xf86EnableAGP(int screenNum, CARD32 mode);
+extern Bool xf86GARTCloseScreen(int screenNum);
/* These routines are in shared/sigio.c and are not loaded as part of the
module. These routines are small, and the code if very POSIX-signal (or
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h
index 03138c8d5..1756eacff 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h
@@ -22,7 +22,7 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.46 2001/04/10 16:08:03 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.47 2001/05/18 20:22:30 tsi Exp $ */
#ifndef _XF86_ANSIC_H
#define _XF86_ANSIC_H
@@ -303,7 +303,7 @@ unsigned int xf86sleep(unsigned int seconds);
extern int xf86shmget(xf86key_t key, int size, int xf86shmflg);
extern char * xf86shmat(int id, char *addr, int xf86shmflg);
extern int xf86shmdt(char *addr);
-extern int xf86shmctl(int id, int xf86cmd, pointer *buf);
+extern int xf86shmctl(int id, int xf86cmd, pointer buf);
extern int xf86setjmp(xf86jmp_buf env);
extern void xf86longjmp(xf86jmp_buf env, int val);
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h
index 93764058a..6f726250a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h
@@ -26,7 +26,7 @@
*
* Author: Rickard E. (Rik) Faith <faith@valinux.com>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h,v 1.14 2001/04/10 16:08:03 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h,v 1.14.2.1 2001/06/01 02:24:18 dawes Exp $
*
*/
@@ -341,7 +341,7 @@ do { register unsigned int __old __asm("o0"); \
#define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */
#endif
-#ifdef __alpha__
+#if defined(__alpha__) || defined(__powerpc__)
#define DRM_CAS_RESULT(_result) int _result
#else
#define DRM_CAS_RESULT(_result) char _result
diff --git a/xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES b/xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES
index 95749aafd..c1988c7f0 100644
--- a/xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES
+++ b/xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES
@@ -100,6 +100,22 @@ Flags
they should be the pixel values from the current colormap.
+ /* Cursor data loading flags */
+
+ HARDWARE_CURSOR_SHOW_TRANSPARENT
+
+ The HideCursor entry will normally be called instead of displaying a
+ completely transparent cursor. This flag prevents this behaviour, thus
+ causing the LoadCursorImage entry to be called with the transparent cursor
+ data.
+
+ HARDWARE_CURSOR_UPDATE_UNHIDDEN
+
+ This flag prevents the HideCursor call that would normally occur just before
+ the LoadCursorImage entry is to be called to load a new hardware cursor
+ image.
+
+
/* Cursor data packing flags */
Hardware cursor data consists of two pieces, a source and a mask.
@@ -169,4 +185,4 @@ Flags
-$XFree86: xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES,v 1.3 1999/01/31 12:22:05 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES,v 1.4 2001/05/09 03:12:06 tsi Exp $
diff --git a/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c b/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c
index 31418fbdc..a9e7f3a09 100644
--- a/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c
+++ b/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c
@@ -1,20 +1,10 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c,v 1.8 2001/04/19 14:14:06 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c,v 1.9 2001/05/18 20:22:31 tsi Exp $ */
-#include "misc.h"
#include "xf86.h"
#include "xf86_ansic.h"
-#include "xf86_OSproc.h"
-#include "xf86str.h"
-
-#include "X.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "cursorstr.h"
+#include "xf86CursorPriv.h"
#include "colormapst.h"
-#include "mi.h"
-#include "xf86Cursor.h"
+#include "cursorstr.h"
int xf86CursorScreenIndex = -1;
static unsigned long xf86CursorGeneration = 0;
@@ -211,9 +201,11 @@ xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags)
ret = (*ScreenPriv->SwitchMode)(index, mode, flags);
- if (ScreenPriv->CurrentCursor)
- xf86CursorSetCursor(pScreen, ScreenPriv->CurrentCursor,
- ScreenPriv->x, ScreenPriv->y);
+ /*
+ * Cannot restore cursor here because the new frame[XY][01] haven't been
+ * calculated yet.
+ */
+ ScreenPriv->CursorToRestore = ScreenPriv->CurrentCursor;
return ret;
}
@@ -313,6 +305,7 @@ xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
ScreenPriv->CurrentCursor = pCurs;
ScreenPriv->x = x;
ScreenPriv->y = y;
+ ScreenPriv->CursorToRestore = NULL;
if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */
if (ScreenPriv->SWCursor)
@@ -367,7 +360,10 @@ xf86CursorMoveCursor(ScreenPtr pScreen, int x, int y)
ScreenPriv->x = x;
ScreenPriv->y = y;
- if (ScreenPriv->SWCursor)
+ if (ScreenPriv->CursorToRestore)
+ xf86CursorSetCursor(pScreen, ScreenPriv->CursorToRestore,
+ ScreenPriv->x, ScreenPriv->y);
+ else if (ScreenPriv->SWCursor)
(*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
else if (ScreenPriv->isUp)
xf86MoveCursor(pScreen, x, y);
diff --git a/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h b/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h
index 17cb98e73..ab7d16209 100644
--- a/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h
+++ b/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h
@@ -1,10 +1,10 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h,v 1.6 2001/04/19 14:14:06 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h,v 1.7 2001/05/18 20:22:31 tsi Exp $ */
#ifndef _XF86CURSOR_H
#define _XF86CURSOR_H
#include "xf86str.h"
-#include "mipointrst.h"
+#include "mipointer.h"
typedef struct _xf86CursorInfoRec {
ScrnInfoPtr pScrn;
@@ -21,29 +21,6 @@ typedef struct _xf86CursorInfoRec {
} xf86CursorInfoRec, *xf86CursorInfoPtr;
-typedef struct {
- Bool SWCursor;
- Bool isUp;
- Bool showTransparent;
- short HotX;
- short HotY;
- short x;
- short y;
- CursorPtr CurrentCursor;
- xf86CursorInfoPtr CursorInfoPtr;
- CloseScreenProcPtr CloseScreen;
- RecolorCursorProcPtr RecolorCursor;
- InstallColormapProcPtr InstallColormap;
- QueryBestSizeProcPtr QueryBestSize;
- miPointerSpriteFuncPtr spriteFuncs;
- Bool PalettedCursor;
- ColormapPtr pInstalledMap;
- Bool (*SwitchMode)(int, DisplayModePtr,int);
- Bool (*EnterVT)(int, int);
- void (*LeaveVT)(int, int);
- int (*SetDGAMode)(int, int, DGADevicePtr);
-} xf86CursorScreenRec, *xf86CursorScreenPtr;
-
Bool xf86InitCursor(
ScreenPtr pScreen,
xf86CursorInfoPtr infoPtr
diff --git a/xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h b/xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h
index 8a4ee8b01..c2d7b272c 100644
--- a/xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h
+++ b/xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h
@@ -1,8 +1,34 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h,v 1.1 1998/08/29 14:34:41 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h,v 1.2 2001/05/18 20:22:31 tsi Exp $ */
#ifndef _XF86CURSORPRIV_H
#define _XF86CURSORPRIV_H
+#include "xf86Cursor.h"
+#include "mipointrst.h"
+
+typedef struct {
+ Bool SWCursor;
+ Bool isUp;
+ Bool showTransparent;
+ short HotX;
+ short HotY;
+ short x;
+ short y;
+ CursorPtr CurrentCursor, CursorToRestore;
+ xf86CursorInfoPtr CursorInfoPtr;
+ CloseScreenProcPtr CloseScreen;
+ RecolorCursorProcPtr RecolorCursor;
+ InstallColormapProcPtr InstallColormap;
+ QueryBestSizeProcPtr QueryBestSize;
+ miPointerSpriteFuncPtr spriteFuncs;
+ Bool PalettedCursor;
+ ColormapPtr pInstalledMap;
+ Bool (*SwitchMode)(int, DisplayModePtr,int);
+ Bool (*EnterVT)(int, int);
+ void (*LeaveVT)(int, int);
+ int (*SetDGAMode)(int, int, DGADevicePtr);
+} xf86CursorScreenRec, *xf86CursorScreenPtr;
+
CARD32 xf86ReverseBitOrder(CARD32 data);
#endif /* _XF86CURSORPRIV_H */
diff --git a/xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c b/xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c
index 288fe7183..c689ebc0c 100644
--- a/xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c,v 1.7 2001/04/19 14:14:06 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c,v 1.10 2001/05/18 20:22:31 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -13,7 +13,6 @@
#include "cursorstr.h"
#include "mi.h"
#include "mipointer.h"
-#include "xf86Cursor.h"
#include "xf86CursorPriv.h"
#include "servermd.h"
@@ -229,22 +228,23 @@ RealizeCursorInterleave0(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
tmp = DstS; DstS = DstM; DstM = tmp;
}
- for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
- y--;
- pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
- for(x = 0; x < Pitch; x++) {
- pSrc[x] = SrcS[x];
- pMsk[x] = SrcM[x];
- }
- }
-
if (infoPtr->Flags & HARDWARE_CURSOR_AND_SOURCE_WITH_MASK) {
- int count = words;
- SCANLINE* pntr = DstS;
- SCANLINE* pntr2 = DstM;
- while (count--) {
- *pntr &= *pntr2;
- pntr++; pntr2++;
+ for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
+ y--;
+ pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
+ for(x = 0; x < Pitch; x++) {
+ pSrc[x] = SrcS[x] & SrcM[x];
+ pMsk[x] = SrcM[x];
+ }
+ }
+ } else {
+ for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
+ y--;
+ pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
+ for(x = 0; x < Pitch; x++) {
+ pSrc[x] = SrcS[x];
+ pMsk[x] = SrcM[x];
+ }
}
}
diff --git a/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c b/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c
index 74d2ce01b..8eeb95169 100644
--- a/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c
+++ b/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c,v 1.46 2001/02/15 18:31:22 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c,v 1.50 2001/05/10 22:18:57 dbateman Exp $ */
/*
*
@@ -1420,7 +1420,7 @@ CARD32
vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
unsigned int Flags)
{
- int nExtBits = (nBits > 6) ? 0 : nBits - 6;
+ int nExtBits = (nBits < 6) ? 0 : nBits - 6;
CARD32 ExtBits;
CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 6;
@@ -1460,7 +1460,7 @@ vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
unsigned int Flags)
{
CARD32 ExtBits;
- CARD32 nExtBits = (nBits > 8) ? 0 : (nBits - 8);
+ CARD32 nExtBits = (nBits < 8) ? 0 : (nBits - 8);
CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 8;
/* If width is not known nBits should be 0. In this
* case BitMask is set to 0 so we can check for it. */
@@ -1544,7 +1544,7 @@ vgaHWAllocRegs(vgaRegPtr regp)
}
-static Bool
+Bool
vgaHWAllocDefaultRegs(vgaRegPtr regp)
{
regp->numCRTC = VGA_NUM_CRTC;
diff --git a/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h b/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h
index c716cf4f3..2d0cc63a4 100644
--- a/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h
+++ b/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h,v 1.26 2001/02/15 18:31:23 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h,v 1.28 2001/05/10 22:18:58 dbateman Exp $ */
/*
@@ -232,4 +232,5 @@ CARD32 vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
unsigned int Flags);
CARD32 vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
unsigned int Flags);
+Bool vgaHWAllocDefaultRegs(vgaRegPtr regp);
#endif /* _VGAHW_H */
diff --git a/xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c b/xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c
index 2904a7548..327599a30 100644
--- a/xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c
+++ b/xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c
@@ -1,14 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c,v 1.6 2000/06/13 02:51:24 mvojkovi Exp $ */
-
-#include "xf86.h"
-#include "xf86_ansic.h"
-#ifndef RAMDAC_MODULE
-#include "xaa.h"
-#include "xaalocal.h"
-#else
-#include "xf86CursorPriv.h"
-#endif
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c,v 1.7 2001/05/18 20:22:31 tsi Exp $ */
+#include "Xmd.h"
CARD32
XAAReverseBitOrder(CARD32 v)
diff --git a/xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c b/xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c
index 0133e4203..89d735f1d 100644
--- a/xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c
+++ b/xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c,v 1.32 2000/11/16 19:45:05 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c,v 1.33 2001/05/15 18:22:23 paulo Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -48,29 +48,6 @@ static unsigned long XAAGeneration = 0;
/* temp kludge */
static Bool SwitchedOut = FALSE;
-
-#ifdef XFree86LOADER
-
-static XF86ModuleVersionInfo xaaVersRec =
-{
- "xaa",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XF86_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-
-XF86ModuleData xaaModuleData = { &xaaVersRec, NULL, NULL };
-
-#endif
-
-
XAAInfoRecPtr
XAACreateInfoRec()
{
diff --git a/xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c b/xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c
index b0e5df048..13dd20e44 100644
--- a/xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c
+++ b/xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c,v 1.29 2001/02/04 03:19:28 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c,v 1.31 2001/05/15 18:22:23 paulo Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -13,6 +13,7 @@
#include "xf86fbman.h"
#include "servermd.h"
+static const OptionInfoRec *XAAAvailableOptions(void *unused);
/*
* XAA Config options
@@ -42,7 +43,7 @@ typedef enum {
XAAOPT_OFFSCREEN_PIXMAPS
} XAAOpts;
-static OptionInfoRec XAAOptions[] = {
+static const OptionInfoRec XAAOptions[] = {
{XAAOPT_SCREEN_TO_SCREEN_COPY, "XaaNoScreenToScreenCopy",
OPTV_BOOLEAN, {0}, FALSE },
{XAAOPT_SOLID_FILL_RECT, "XaaNoSolidFillRect",
@@ -89,7 +90,57 @@ static OptionInfoRec XAAOptions[] = {
OPTV_NONE, {0}, FALSE }
};
-#define nXAAOptions (sizeof(XAAOptions) / sizeof(XAAOptions[0]))
+#ifdef XFree86LOADER
+static MODULESETUPPROTO(xaaSetup);
+
+static XF86ModuleVersionInfo xaaVersRec =
+{
+ "xaa",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData xaaModuleData = { &xaaVersRec, xaaSetup, NULL };
+
+ModuleInfoRec XAA = {
+ 1,
+ "XAA",
+ NULL,
+ 0,
+ XAAAvailableOptions,
+};
+
+/*ARGSUSED*/
+static pointer
+xaaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
+{
+ static Bool Initialised = FALSE;
+
+ if (!Initialised) {
+ Initialised = TRUE;
+#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
+ if (xf86LoaderCheckSymbol("xf86AddModuleInfo"))
+#endif
+ xf86AddModuleInfo(&XAA, Module);
+ }
+
+ return (pointer)TRUE;
+}
+#endif
+
+/*ARGSUSED*/
+static const OptionInfoRec *
+XAAAvailableOptions(void *unused)
+{
+ return (XAAOptions);
+}
Bool
XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
@@ -113,10 +164,11 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
Bool HaveImageWriteRect = FALSE;
Bool HaveScanlineImageWriteRect = FALSE;
Bool HaveScreenToScreenColorExpandFill = FALSE;
- OptionInfoRec options[nXAAOptions];
+ OptionInfoPtr options;
int is_shared = 0;
int i;
+ options = xnfalloc(sizeof(XAAOptions));
(void)memcpy(options, XAAOptions, sizeof(XAAOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
@@ -1431,6 +1483,8 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
infoRec->CachePixelGranularity *= 2;
}
+ xfree(options);
+
if(!infoRec->CacheTile && infoRec->WritePixmapToCache)
infoRec->CacheTile = XAACacheTile;
if(!infoRec->CacheMonoStipple && infoRec->WritePixmapToCache)
diff --git a/xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c b/xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c
index 25efff45f..c5b54be13 100644
--- a/xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c
+++ b/xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c,v 1.5 2001/03/08 17:12:16 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c,v 1.6 2001/05/15 10:19:43 eich Exp $ */
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
@@ -310,7 +310,6 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop)
if ((xoff + w) <= 32)
{
- int i;
/* glyph all in one longword */
maskpartialbits(xoff, w, startmask);
diff --git a/xc/programs/Xserver/hw/xfree86/xf86Version.h b/xc/programs/Xserver/hw/xfree86/xf86Version.h
index 03a02c070..502ed3eb8 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86Version.h
+++ b/xc/programs/Xserver/hw/xfree86/xf86Version.h
@@ -1,11 +1,11 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.470 2001/04/26 16:23:12 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.472.2.5 2001/06/02 15:27:52 dawes Exp $ */
#ifndef XF86_VERSION_CURRENT
#define XF86_VERSION_MAJOR 4
-#define XF86_VERSION_MINOR 0
-#define XF86_VERSION_PATCH 99
-#define XF86_VERSION_SNAP 3
+#define XF86_VERSION_MINOR 1
+#define XF86_VERSION_PATCH 0
+#define XF86_VERSION_SNAP 0
/* This has five arguments for compatibilty reasons */
#define XF86_VERSION_NUMERIC(major,minor,patch,snap,dummy) \
@@ -24,7 +24,7 @@
0)
-#define XF86_DATE "26 April 2001"
+#define XF86_DATE "2 June 2001"
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad b/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad
index 0a2ba49b6..871d7c227 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad
@@ -26,7 +26,7 @@
!!
!! Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
!!
-!! $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad,v 1.12 2001/03/29 16:54:30 paulo Exp $
+!! $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad,v 1.13 2001/05/15 18:22:23 paulo Exp $
!!
*Form.background: gray85
@@ -475,6 +475,8 @@ XF86Cfg.translations: #override \
<Message>WM_PROTOCOLS: testmode-cancel()
.xf86cfg.Expert.translations: #override \
<Message>WM_PROTOCOLS: expert-close()
+.xf86cfg.options.moduleOptions.translations: #override \
+<Message>WM_PROTOCOLS: module-options-close()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -488,6 +490,7 @@ XF86Cfg.translations: #override \
*options*commands.remove.fromHoriz: add
*options*commands.update.fromHoriz: remove
+*options*commands.help.fromHoriz: update
*options*commands.min: 30
*options*commands.max: 30
*options*commands.showGrip: False
@@ -501,18 +504,18 @@ XF86Cfg.translations: #override \
*options*label3.fromHoriz: value
*options*viewport.fromVert: name
*options*Label.borderWidth: 0
-*options*Label.internalWidth: 0
-*options*Label.height: 21
-*options*Text.height: 19
-*options*Label.top: chainTop
-*options*Text.top: chainTop
-*options*Label.bottom: chainTop
-*options*Text.bottom: chainTop
-*options*Label.horizDistance: 0
-*options*Text.horizDistance: 0
-*options*Label.vertDistance: 8
-*options*Text.vertDistance: 8
-*options*Text.width: 147
+*options.pane.form.Label.internalWidth: 0
+*options.pane.form.Label.height: 21
+*options.pane.form.Text.height: 19
+*options.pane.form.Label.top: chainTop
+*options.pane.form.Text.top: chainTop
+*options.pane.form.Label.bottom: chainTop
+*options.pane.form.Text.bottom: chainTop
+*options.pane.form.Label.horizDistance: 0
+*options.pane.form.Text.horizDistance: 0
+*options.pane.form.Label.vertDistance: 8
+*options.pane.form.Text.vertDistance: 8
+*options.pane.form.Text.width: 147
*options*viewport.width: 390
*options*viewport.height: 50
@@ -522,7 +525,7 @@ XF86Cfg.translations: #override \
*options*viewport.right: chainRight
*options*list.longest: 376
-*options*driverOpts.label: Options for driver\
+*options*driverOpts.label: Options for module\
*options*driverOpts.justify: left
*options*driverOpts.width: 278
*options*popdown.label: Popdown dialog
@@ -530,6 +533,40 @@ XF86Cfg.translations: #override \
o option name\n\
o option type
+.xf86cfg*options.moduleOptions.geometry: 360x245
+.xf86cfg*options.moduleOptions.minWidth: 360
+.xf86cfg*options.moduleOptions.maxWidth: 360
+.xf86cfg*options.moduleOptions.minHeight: 245
+.xf86cfg*options.moduleOptions.maxHeight: 245
+*options.moduleOptions*descriptions*labelType.label: Select option
+*options.moduleOptions*descriptions*labelType.width: 348
+*options.moduleOptions*descriptions*module.fromVert: labelType
+*options.moduleOptions*descriptions*module.label: Module
+*options.moduleOptions*descriptions*Label.horizDistance: 8
+*options.moduleOptions*descriptions*option.fromVert: labelType
+*options.moduleOptions*descriptions*option.label: Option
+*options.moduleOptions*descriptions*option.fromHoriz: viewM
+*options.moduleOptions*descriptions*viewM.fromVert: module
+*options.moduleOptions*descriptions*viewM.width: 120
+*options.moduleOptions*descriptions*viewM.height: 94
+*options.moduleOptions*descriptions*modL.longest: 100
+*options.moduleOptions*descriptions*viewO.fromHoriz: viewM
+*options.moduleOptions*descriptions*viewO.fromVert: option
+*options.moduleOptions*descriptions*viewO.width: 220
+*options.moduleOptions*descriptions*viewO.height: 94
+*options.moduleOptions*descriptions*optL.longest: 220
+*options.moduleOptions*descriptions*desc.horizDistance: 4
+*options.moduleOptions*descriptions*desc.fromVert: viewM
+*options.moduleOptions*descriptions*desc.width: 348
+*options.moduleOptions*descriptions*desc.height: 62
+*options.moduleOptions*descriptions*desc.wrap: word
+*options.moduleOptions*descriptions*desc.scrollVertical: Always
+*options.moduleOptions*descriptions*desc.Scrollbar.foreground: rgb:a/5/5
+*options.moduleOptions*descriptions*desc.Scrollbar.borderWidth: 1
+*options.moduleOptions*descriptions*desc.Scrollbar.borderColor: gray60
+*options.moduleOptions*descriptions.showGrip: False
+*options.moduleOptions*popdown.label: Popdown dialog
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! monitor
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -1300,11 +1337,16 @@ kbd?family=Courier&pixelsize=10,\
code?family=Courier&pixelsize=10,\
samp?family=Courier&pixelsize=10,\
tt?family=Courier&pixelsize=10
-*help*close.min: 18
-*help*close.max: 18
-*help*close.showGrip: False
+*help*commands.min: 22
+*help*commands.max: 22
+*help*commands.showGrip:False
*help*wrap: word
+*help*commands.close.label: Close
.xf86cfg.help.geometry: 320x369
+.xf86cfg.help.minWidth: 320
+.xf86cfg.help.maxWidth: 320
+.xf86cfg.help.minHeight: 369
+.xf86cfg.help.maxHeight: 369
.xf86cfg.help.translations: #override \
<Message>WM_PROTOCOLS: help-close()
*help*text.translations:\
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c
index d2a708905..f50925dbc 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c,v 1.5 2001/03/24 01:17:20 paulo Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c,v 1.6.2.2 2001/05/23 14:45:15 tsi Exp $
*/
#include "xf86config.h"
@@ -111,10 +111,11 @@ CardConfig(XtPointer config)
XtSetArg(args[0], XtNstring, card->dev_busid);
XtSetValues(busid, args, 1);
#ifdef USE_MODULES
- XtSetArg(args[0], XtNlabel, driver_str = XtNewString(card->dev_driver));
-#else
- XtSetArg(args[0], XtNstring, card->dev_driver);
+ if (!nomodules)
+ XtSetArg(args[0], XtNlabel, driver_str = XtNewString(card->dev_driver));
+ else
#endif
+ XtSetArg(args[0], XtNstring, card->dev_driver);
XtSetValues(driver, args, 1);
}
else {
@@ -136,10 +137,11 @@ CardConfig(XtPointer config)
XtSetArg(args[0], XtNstring, "");
XtSetValues(busid, args, 1);
#ifdef USE_MODULES
- XtSetArg(args[0], XtNlabel, driver_str = XtNewString("vga"));
-#else
- XtSetArg(args[0], XtNstring, "vga");
+ if (!nomodules)
+ XtSetArg(args[0], XtNlabel, driver_str = XtNewString("vga"));
+ else
#endif
+ XtSetArg(args[0], XtNstring, "vga");
XtSetValues(driver, args, 1);
}
@@ -152,14 +154,17 @@ CardConfig(XtPointer config)
if (card == NULL) {
card = (XF86ConfDevicePtr)XtCalloc(1, sizeof(XF86ConfDeviceRec));
card->dev_identifier = XtNewString(ident_string);
- card->dev_driver = XtNewString(card_entry->driver);
- card->dev_card = XtNewString(card_entry->name);
- if (card_entry->chipset)
- card->dev_chipset = XtNewString(card_entry->chipset);
- if (card_entry->ramdac)
- card->dev_ramdac = XtNewString(card_entry->ramdac);
- if (card_entry->clockchip)
- card->dev_clockchip = XtNewString(card_entry->clockchip);
+ if (card_entry) {
+ card->dev_driver = XtNewString(card_entry->driver);
+ card->dev_card = XtNewString(card_entry->name);
+ if (card_entry->chipset)
+ card->dev_chipset = XtNewString(card_entry->chipset);
+ if (card_entry->ramdac)
+ card->dev_ramdac = XtNewString(card_entry->ramdac);
+ if (card_entry->clockchip)
+ card->dev_clockchip = XtNewString(card_entry->clockchip);
+ }
+ /* else will fallback to "vga" */
}
else if (card_entry != NULL) {
XtFree(card->dev_driver);
@@ -185,23 +190,28 @@ CardConfig(XtPointer config)
card->dev_busid = XtNewString(bus);
#ifdef USE_MODULES
- drv_nam = driver_str;
-#else
- XtSetArg(args[0], XtNstring, &drv_nam);
- XtGetValues(driver, args, 1);
+ if (!nomodules)
+ drv_nam = driver_str;
+ else
#endif
+ {
+ XtSetArg(args[0], XtNstring, &drv_nam);
+ XtGetValues(driver, args, 1);
+ }
XtFree(card->dev_driver);
card->dev_driver = XtNewString(drv_nam);
#ifdef USE_MODULES
- XtFree(driver_str);
+ if (!nomodules)
+ XtFree(driver_str);
#endif
return ((XtPointer)card);
}
#ifdef USE_MODULES
- XtFree(driver_str);
+ if (!nomodules)
+ XtFree(driver_str);
#endif
return (NULL);
@@ -214,15 +224,22 @@ CardConfigCheck(void)
char *drv_nam;
#ifdef USE_MODULES
- drv_nam = driver_str;
-#else
- Arg args[1];
-
- XtSetArg(args[0], XtNstring, &drv_nam);
- XtGetValues(driver, args, 1);
+ if (!nomodules)
+ drv_nam = driver_str;
+ else
#endif
+ {
+ Arg args[1];
+
+ XtSetArg(args[0], XtNstring, &drv_nam);
+ XtGetValues(driver, args, 1);
+ }
+
if (ident_string == NULL || strlen(ident_string) == 0 ||
+#if 0
+ /* not all available cards are in the Cards database */
(current_device == NULL && card_entry == NULL) ||
+#endif
drv_nam == NULL || *drv_nam == '\0')
return (False);
@@ -258,9 +275,11 @@ CardModelCallback(Widget w, XtPointer user_data, XtPointer call_data)
"Chipset: %s\n", card_entry->chipset);
if (card_entry->driver != NULL) {
#ifdef USE_MODULES
- XtFree(driver_str);
- driver_str = XtNewString(card_entry->driver);
- XtVaSetValues(driver, XtNlabel, driver_str, NULL, 0);
+ if (!nomodules) {
+ XtFree(driver_str);
+ driver_str = XtNewString(card_entry->driver);
+ XtVaSetValues(driver, XtNlabel, driver_str, NULL, 0);
+ }
#endif
len += XmuSnprintf(tip + len, sizeof(tip) - len,
"Driver: %s\n", card_entry->driver);
@@ -288,8 +307,11 @@ CardModelCallback(Widget w, XtPointer user_data, XtPointer call_data)
first = 0;
#ifndef USE_MODULES
- XtSetArg(args[0], XtNstring, card_entry->driver ? card_entry->driver : "vga");
- XtSetValues(driver, args, 1);
+ if (!nomodules) {
+ XtSetArg(args[0], XtNstring,
+ card_entry->driver ? card_entry->driver : "vga");
+ XtSetValues(driver, args, 1);
+ }
#endif
str = XtNewString(tip);
@@ -381,29 +403,34 @@ CardModel(XF86SetupInfo *info)
(XtPointer)info);
XtCreateManagedWidget("driverL", labelWidgetClass, model, NULL, 0);
#ifdef USE_MODULES
- driver = XtVaCreateManagedWidget("driver", menuButtonWidgetClass,
- model,
- XtNmenuName, "driverM",
- NULL, 0);
- {
- Widget menu, sme;
- xf86cfgDriverOptions *opts = video_driver_info;
-
- menu = XtCreatePopupShell("driverM", simpleMenuWidgetClass,
- driver, NULL, 0);
- while (opts) {
- sme = XtCreateManagedWidget(opts->name, smeBSBObjectClass,
- menu, NULL, 0);
- XtAddCallback(sme, XtNcallback, DriverCallback, NULL);
- opts = opts->next;
+ if (!nomodules) {
+ driver = XtVaCreateManagedWidget("driver", menuButtonWidgetClass,
+ model,
+ XtNmenuName, "driverM",
+ NULL, 0);
+ {
+ Widget menu, sme;
+ xf86cfgModuleOptions *opts = module_options;
+
+ menu = XtCreatePopupShell("driverM", simpleMenuWidgetClass,
+ driver, NULL, 0);
+ while (opts) {
+ if (opts->type == VideoModule) {
+ sme = XtCreateManagedWidget(opts->name, smeBSBObjectClass,
+ menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, DriverCallback, NULL);
+ }
+ opts = opts->next;
+ }
}
}
-#else
- driver = XtVaCreateManagedWidget("driver", asciiTextWidgetClass,
- model,
- XtNeditType, XawtextEdit,
- NULL, 0);
+ else
#endif
+ driver = XtVaCreateManagedWidget("driver", asciiTextWidgetClass,
+ model,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+
XtCreateManagedWidget("busidL", labelWidgetClass, model, NULL, 0);
busid = XtVaCreateManagedWidget("busid", asciiTextWidgetClass,
model,
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/config.h b/xc/programs/Xserver/hw/xfree86/xf86cfg/config.h
index 9d8a6a9e2..e7ef66767 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/config.h
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/config.h
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.h,v 1.10 2001/03/29 16:54:30 paulo Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.h,v 1.10.2.1 2001/05/21 22:24:02 paulo Exp $
*/
#include <X11/IntrinsicP.h>
@@ -217,5 +217,6 @@ extern xf86cfgComputer computer;
extern Atom wm_delete_window;
extern Display *DPY;
extern Pixmap menuPixmap;
+extern Bool nomodules;
#endif /* _xf86cfg_config_h */
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c
index 1b13ae39f..e099ca804 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c,v 1.8 2001/04/01 14:00:15 tsi Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c,v 1.8.2.1 2001/05/21 22:24:02 paulo Exp $
*/
#include "config.h"
@@ -2407,6 +2407,10 @@ NewDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
DeleteNode(node);
dev = (XF86ConfDevicePtr)XtCalloc(1, sizeof(XF86ConfDeviceRec));
dev->dev_identifier = XtNewString(label);
+ dev->dev_chipid = -1;
+ dev->dev_chiprev = -1;
+ dev->dev_irq = -1;
+
XF86Config->conf_device_lst =
xf86addDevice(XF86Config->conf_device_lst, dev);
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/help.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/help.c
index 8f53a52ed..1e98306ed 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/help.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/help.c
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/help.c,v 1.3 2000/10/20 14:59:05 alanh Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/help.c,v 1.4 2001/05/15 18:22:23 paulo Exp $
*/
#include <X11/IntrinsicP.h>
@@ -34,6 +34,7 @@
#include <X11/Shell.h>
#include <X11/Xaw/AsciiText.h>
#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Form.h>
#include <X11/Xaw/Paned.h>
#include <X11/Xaw/Text.h>
@@ -46,6 +47,7 @@
#endif
#include <ctype.h>
#include "help.h"
+#include "options.h"
/*
* Prototypes
@@ -122,7 +124,7 @@ StartHelp(void)
};
if (shell == NULL) {
- Widget pane, close;
+ Widget pane, commands, close;
char *props;
XawTextPropertyList *propl;
@@ -132,8 +134,10 @@ StartHelp(void)
shell, NULL, 0);
text = XtVaCreateManagedWidget("text", asciiTextWidgetClass,
pane, XtNeditType, XawtextRead, NULL, 0);
+ commands = XtCreateManagedWidget("commands", formWidgetClass, pane,
+ NULL, 0);
close = XtCreateManagedWidget("close", commandWidgetClass,
- pane, NULL, 0);
+ commands, NULL, 0);
XtAddCallback(close, XtNcallback, CloseCallback, NULL);
XtRealizeWidget(shell);
XSetWMProtocols(DPY, XtWindow(shell), &wm_delete_window, 1);
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c
index 01518410b..3489f2a04 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c,v 1.21 2001/04/01 14:00:15 tsi Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c,v 1.23.2.1 2001/05/21 22:24:02 paulo Exp $
*/
#include <X11/IntrinsicP.h>
@@ -130,7 +130,7 @@ static char XF86Config_path_static[1024];
static char XkbConfig_path_static[1024];
Bool xf86config_set = False;
-Bool textmode = False;
+Bool textmode = False, nomodules = False;
xf86cfgComputer computer;
xf86cfgDevice cpu_device;
@@ -171,6 +171,9 @@ static XtActionsRec actions[] = {
{"testmode-cancel", CancelTestModeAction},
{"help-close", HelpCancelAction},
{"expert-close", ExpertCloseAction},
+#ifdef USE_MODULES
+ {"module-options-close", ModuleOptionsCancelAction},
+#endif
};
static char *device_names[] = {
@@ -214,7 +217,7 @@ main(int argc, char *argv[])
XGCValues values;
XF86ConfLayoutPtr lay;
int i, startedx;
- char *menuPixmapPath;
+ char *menuPixmapPath = NULL;
XrmValue from, to;
#ifdef USE_MODULES
@@ -249,6 +252,8 @@ main(int argc, char *argv[])
else if (strcmp(argv[i], "-textmode") == 0)
textmode = True;
#endif
+ else if (strcmp(argv[i], "-nomodules") == 0)
+ nomodules = True;
}
#ifdef HAS_NCURSES
@@ -259,8 +264,8 @@ main(int argc, char *argv[])
#endif
startedx = startx();
-/* if (XF86Config_path == NULL)
- XF86Config_path = "/etc/X11/XF86Config-4";*/
+ if (XF86Config_path == NULL)
+ XF86Config_path = "XF86Config-4";
if (XkbConfig_path == NULL)
XkbConfig_path = XkbConfigDir XkbConfigFile;
toplevel = XtAppInitialize(&appcon, "XF86Cfg",
@@ -271,9 +276,9 @@ main(int argc, char *argv[])
if (DPY == NULL)
DPY = XtDisplay(toplevel);
- if (strlen(menuPixmapPath)) {
- XtGetApplicationResources(toplevel, (XtPointer)&menuPixmapPath,
- appResources, XtNumber(appResources), NULL, 0);
+ XtGetApplicationResources(toplevel, (XtPointer)&menuPixmapPath,
+ appResources, XtNumber(appResources), NULL, 0);
+ if (menuPixmapPath && strlen(menuPixmapPath)) {
from.size = strlen(menuPixmapPath);
from.addr = menuPixmapPath;
to.size = sizeof(Pixmap);
@@ -479,6 +484,7 @@ main(int argc, char *argv[])
}
#ifdef USE_MODULES
+ if (!nomodules)
LoaderInitializeOptions();
#endif
@@ -1419,7 +1425,7 @@ OptionsCallback(Widget w, XtPointer user_data, XtPointer call_data)
int i;
XF86OptionPtr *options;
#ifdef USE_MODULES
- xf86cfgDriverOptions *drv_opts = NULL;
+ xf86cfgModuleOptions *drv_opts = NULL;
#endif
if (config_mode == CONFIG_SCREEN) {
@@ -1446,19 +1452,37 @@ OptionsCallback(Widget w, XtPointer user_data, XtPointer call_data)
case KEYBOARD:
options = (XF86OptionPtr*)&(((XF86ConfInputPtr)
(computer.devices[i]->config))->inp_option_lst);
+#ifdef USE_MODULES
+ if (!nomodules) {
+ char *drv = ((XF86ConfInputPtr)
+ (computer.devices[i]->config))->inp_driver;
+
+ if (drv) {
+ drv_opts = module_options;
+ while (drv_opts) {
+ if (drv_opts->type == InputModule &&
+ strcmp(drv_opts->name, drv) == 0)
+ break;
+ drv_opts = drv_opts->next;
+ }
+ }
+ }
+#endif
+
break;
case CARD:
options = (XF86OptionPtr*)&(((XF86ConfDevicePtr)
(computer.devices[i]->config))->dev_option_lst);
#ifdef USE_MODULES
- {
+ if (!nomodules) {
char *drv = ((XF86ConfDevicePtr)
(computer.devices[i]->config))->dev_driver;
if (drv) {
- drv_opts = video_driver_info;
+ drv_opts = module_options;
while (drv_opts) {
- if (strcmp(drv_opts->name, drv) == 0)
+ if (drv_opts->type == VideoModule &&
+ strcmp(drv_opts->name, drv) == 0)
break;
drv_opts = drv_opts->next;
}
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c
index 8b811e6fb..fed6b8850 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c,v 1.3 2000/12/01 18:31:07 paulo Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c,v 1.5.2.1 2001/05/28 21:36:44 paulo Exp $
*/
#define LOADER_PRIVATE
#include "loader.h"
@@ -34,10 +34,16 @@
/* XXX beware (or fix it) libc functions called here are the xf86 ones */
#ifdef USE_MODULES
+static void AddModuleOptions(char*, OptionInfoPtr);
void xf86AddDriver(DriverPtr, void*, int);
Bool xf86ServerIsOnlyDetecting(void);
+void xf86AddInputDriver(InputDriverPtr, pointer, int);
+void xf86AddModuleInfo(ModuleInfoPtr, void*);
+Bool xf86LoaderCheckSymbol(const char*);
+void xf86LoaderReqSymLists(const char **, ...);
+void xf86Msg(int, const char*, ...);
-xf86cfgDriverOptions *video_driver_info;
+xf86cfgModuleOptions *module_options;
int xf86ShowUnresolved = 1;
@@ -231,10 +237,49 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86AddDriver)
SYMFUNC(xf86ServerIsOnlyDetecting)
+ SYMFUNC(xf86AddInputDriver)
+ SYMFUNC(xf86AddModuleInfo)
+ SYMFUNC(xf86LoaderCheckSymbol)
+
+ SYMFUNC(xf86LoaderReqSymLists)
+ SYMFUNC(xf86Msg)
+ SYMFUNC(ErrorF)
{0,0}
};
static DriverPtr driver;
+static ModuleInfoPtr info;
+static ModuleType type = GenericModule;
+
+static void
+AddModuleOptions(char *name, OptionInfoPtr option)
+{
+ xf86cfgModuleOptions *ptr;
+ OptionInfoPtr tmp;
+
+ ptr = XtNew(xf86cfgModuleOptions);
+ ptr->name = XtNewString(name);
+ ptr->type = type;
+ if (option) {
+ int count;
+
+ for (count = 0, tmp = option; tmp->name != NULL; tmp++, count++)
+ ;
+ ++count;
+ ptr->option = (XtPointer)XtCalloc(1, count * sizeof(OptionInfoRec));
+ for (count = 0, tmp = option; tmp->name != NULL; count++, tmp++) {
+ memcpy(&ptr->option[count], tmp, sizeof(OptionInfoRec));
+ ptr->option[count].name = XtNewString(tmp->name);
+ if (tmp->type == OPTV_STRING || tmp->type == OPTV_ANYSTR)
+ ptr->option[count].value.str = XtNewString(tmp->value.str);
+ }
+ }
+ else
+ ptr->option = NULL;
+
+ ptr->next = module_options;
+ module_options = ptr;
+}
Bool
LoaderInitializeOptions(void)
@@ -257,7 +302,9 @@ LoaderInitializeOptions(void)
if (path == NULL || strcmp(XF86Module_path, path)) {
char **list, **l;
const char *subdirs[] = {
+ ".",
"drivers",
+ "input",
NULL
};
int errmaj, errmin;
@@ -268,61 +315,32 @@ LoaderInitializeOptions(void)
list = LoaderListDirs(subdirs, NULL);
if (list) {
- xf86cfgDriverOptions *prev, *ptr = video_driver_info;
-
+#if 0
if (ptr) {
- while (video_driver_info) {
- video_driver_info = video_driver_info->next;
+ while (module_options) {
+ module_options = module_options->next;
XtFree(ptr->name);
XtFree((XtPointer)ptr->option);
XtFree((XtPointer)ptr);
- ptr = video_driver_info;
+ ptr = module_options;
}
}
+#endif
for (l = list; *l; l++) {
driver = NULL;
+ info = NULL;
+ type = GenericModule;
xf86Verbose = 0;
if ((module = LoadModule(*l, NULL, NULL, NULL, NULL,
NULL, &errmaj, &errmin)) == NULL)
LoaderErrorMsg(NULL, *l, errmaj, errmin);
- else if (driver && driver->AvailableOptions) {
- OptionInfoPtr tmp,
- option = (*driver->AvailableOptions)(-1, -1);
-
- ptr = XtNew(xf86cfgDriverOptions);
- ptr->name = XtNewString(*l);
- if (option) {
- int count;
-
- for (count = 0, tmp = option; tmp->name != NULL; tmp++, count++)
- ;
- ++count;
- ptr->option = (XtPointer)XtCalloc(1, count *
- sizeof(OptionInfoRec));
- for (count = 0, tmp = option; tmp->name != NULL;
- count++, tmp++) {
- memcpy(&ptr->option[count], tmp,
- sizeof(OptionInfoRec));
- ptr->option[count].name =
- XtNewString(tmp->name);
- if (tmp->type == OPTV_STRING ||
- tmp->type == OPTV_ANYSTR)
- ptr->option[count].value.str =
- XtNewString(tmp->value.str);
- }
- }
- else
- ptr->option = NULL;
- ptr->next = NULL;
- if (video_driver_info == NULL)
- video_driver_info = ptr;
- else
- prev->next = ptr;
- prev = ptr;
+ else if (driver && driver->AvailableOptions)
+ AddModuleOptions(*l, (*driver->AvailableOptions)(-1, -1));
+ else if (info && info->AvailableOptions)
+ AddModuleOptions(*l, (*info->AvailableOptions)(NULL));
- UnloadModule(module);
- }
+ UnloadModule(module);
xf86Verbose = saveVerbose;
}
LoaderFreeDirList(list);
@@ -342,6 +360,7 @@ void
xf86AddDriver(DriverPtr drv, void *module, int flags)
{
driver = drv;
+ type = VideoModule;
}
Bool
@@ -349,4 +368,31 @@ xf86ServerIsOnlyDetecting(void)
{
return (True);
}
+
+void
+xf86AddInputDriver(InputDriverPtr inp, void *module, int flags)
+{
+ type = InputModule;
+}
+
+void
+xf86AddModuleInfo(ModuleInfoPtr inf, void *module)
+{
+ info = inf;
+}
+
+Bool
+xf86LoaderCheckSymbol(const char *symbol)
+{
+ return LoaderSymbol(symbol) != NULL;
+}
+
+void
+xf86LoaderReqSymLists(const char **list0, ...)
+{
+}
+
+void xf86Msg(int type, const char *format, ...)
+{
+}
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h b/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h
index 5d7b69863..d3d763cab 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h,v 1.1 2000/10/20 14:59:05 alanh Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h,v 1.4 2001/05/18 20:22:31 tsi Exp $
*/
#ifdef USE_MODULES
#include "config.h"
@@ -149,15 +149,65 @@ typedef struct _DriverRec {
void * module;
int refCount;
} DriverRec, *DriverPtr;
+
+typedef struct _InputDriverRec {
+ int driverVersion;
+ char * driverName;
+ void (*Identify)(int flags);
+ struct _LocalDeviceRec *(*PreInit)(struct _InputDriverRec *drv,
+ void *dev, int flags);
+ void (*UnInit)(struct _InputDriverRec *drv,
+ void *pInfo,
+ int flags);
+ pointer module;
+ int refCount;
+} InputDriverRec, *InputDriverPtr;
+
+typedef struct _loader_item *itemPtr;
+typedef struct _loader_item {
+ char *name ;
+ void *address ;
+ itemPtr next ;
+ int handle ;
+ int module ;
+ itemPtr exports;
+#if defined(__powerpc__)
+ /*
+ * PowerPC file formats require special routines in some circumstances
+ * to assist in the linking process. See the specific loader for
+ * more details.
+ */
+ union {
+ unsigned short plt[8]; /* ELF */
+ unsigned short glink[14]; /* XCOFF */
+ } code ;
+#endif
+ } itemRec ;
+
+typedef struct _ModuleInfoRec {
+ int moduleVersion;
+ char * moduleName;
+ pointer module;
+ int refCount;
+ OptionInfoRec * (*AvailableOptions)(void *unused);
+ pointer unused[2]; /* leave some space for more fields */
+} ModuleInfoRec, *ModuleInfoPtr;
#endif /* LOADER_PRIVATE */
-typedef struct _xf86cfgDriverOptions {
+typedef enum {
+ VideoModule,
+ InputModule,
+ GenericModule
+} ModuleType;
+
+typedef struct _xf86cfgModuleOptions {
char *name;
+ ModuleType type;
OptionInfoPtr option;
- struct _xf86cfgDriverOptions *next;
-} xf86cfgDriverOptions;
+ struct _xf86cfgModuleOptions *next;
+} xf86cfgModuleOptions;
-extern xf86cfgDriverOptions *video_driver_info;
+extern xf86cfgModuleOptions *module_options;
Bool LoaderInitializeOptions(void);
#endif /* USE_MODULES */
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/options.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/options.c
index 792002001..8c6f6661c 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/options.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/options.c
@@ -26,11 +26,12 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.c,v 1.4 2000/11/30 20:55:18 paulo Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.c,v 1.6.2.2 2001/05/25 21:45:01 paulo Exp $
*/
#include "options.h"
#include "xf86config.h"
+#include <X11/Xresource.h>
#include <X11/Shell.h>
#include <X11/Xaw/AsciiText.h>
#include <X11/Xaw/List.h>
@@ -52,6 +53,9 @@ static void UpdateOption(Widget, XtPointer, XtPointer);
static void UpdateOptionList(void);
#ifdef USE_MODULES
static void AddDriverOption(Widget, XtPointer, XtPointer);
+static void SelectModuleCallback(Widget, XtPointer, XtPointer);
+static void SelectModuleOptionCallback(Widget, XtPointer, XtPointer);
+static void ModuleOptionsPopdown(Widget, XtPointer, XtPointer);
#endif
/*
@@ -62,10 +66,153 @@ static XF86OptionPtr *options;
static Widget add, remov, update, list, name, value;
static char *option_str;
static int option_index, popped = False;
+static char *Options = "lib/X11/Options";
+static XrmDatabase xrm;
+#ifdef USE_MODULES
+static Widget modList, optList, desc, modOptionsShell, labelType;
+static char *module_sel;
+static char *types[] = {
+ "none", "integer", "(non null) string", "string", "real",
+ "boolean", "frequency",
+};
+#endif
/*
* Implementation
*/
+#ifdef USE_MODULES
+static int
+qcmp_str(_Xconst void *a, _Xconst void *b)
+{
+ return (strcmp(*(char**)a, *(char**)b));
+}
+
+void
+ModuleOptionsPopup(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ xf86cfgModuleOptions *info = module_options;
+
+ if (modOptionsShell == NULL) {
+ char **ops;
+ int nops;
+ Widget pane, form, viewport, bottom, popdown;
+
+ modOptionsShell = XtCreatePopupShell("moduleOptions",
+ transientShellWidgetClass,
+ optionsShell, NULL, 0);
+
+ pane = XtCreateManagedWidget("pane", panedWidgetClass,
+ modOptionsShell, NULL, 0);
+
+ form = XtCreateManagedWidget("descriptions", formWidgetClass,
+ pane, NULL, 0);
+ labelType = XtCreateManagedWidget("labelType", labelWidgetClass,
+ form, NULL, 0);
+ XtCreateManagedWidget("module", labelWidgetClass, form, NULL, 0);
+ viewport = XtCreateManagedWidget("viewM", viewportWidgetClass,
+ form, NULL, 0);
+ ops = NULL;
+ nops = 0;
+ while (info) {
+ ++nops;
+ ops = (char**)XtRealloc((XtPointer)ops, sizeof(char*) * nops);
+ ops[nops - 1] = XtNewString(info->name);
+ info = info->next;
+ }
+ if (nops == 0) {
+ ops = (char**)XtMalloc(sizeof(char*));
+ ops[0] = XtNewString("");
+ nops = 1;
+ }
+ else
+ qsort(ops, nops, sizeof(char*), qcmp_str);
+ modList = XtVaCreateManagedWidget("modL", listWidgetClass,
+ viewport, XtNlist, ops,
+ XtNnumberStrings, nops,
+ NULL, 0);
+ XtAddCallback(modList, XtNcallback, SelectModuleCallback, NULL);
+ XtCreateManagedWidget("option", labelWidgetClass, form, NULL, 0);
+ viewport = XtCreateManagedWidget("viewO", viewportWidgetClass,
+ form, NULL, 0);
+ ops = (char**)XtMalloc(sizeof(char*));
+ ops[0] = XtNewString("");
+ optList = XtVaCreateManagedWidget("optL", listWidgetClass,
+ viewport, XtNlist, ops,
+ XtNnumberStrings, 1, NULL, 0);
+ XtAddCallback(optList, XtNcallback, SelectModuleOptionCallback, NULL);
+ desc = XtVaCreateManagedWidget("desc", asciiTextWidgetClass,
+ form, XtNeditType, XawtextRead,
+ NULL, 0);
+
+ bottom = XtCreateManagedWidget("bottom", formWidgetClass,
+ pane, NULL, 0);
+ popdown = XtVaCreateManagedWidget("popdown", commandWidgetClass,
+ bottom, NULL, 0);
+ XtAddCallback(popdown, XtNcallback, ModuleOptionsPopdown, NULL);
+ XtRealizeWidget(modOptionsShell);
+ XSetWMProtocols(DPY, XtWindow(modOptionsShell), &wm_delete_window, 1);
+
+ info = module_options;
+ }
+
+ if (module_sel && *module_sel) {
+ XawListReturnStruct list; /* hack to call ballbacks */
+ char **strs;
+ int nstrs, idx = 0;
+
+ XtVaGetValues(modList, XtNlist, &strs, XtNnumberStrings, &nstrs, NULL);
+ for (idx = nstrs - 1; idx > 0; idx--)
+ if (strcmp(module_sel, strs[idx]) == 0)
+ break;
+ while (info) {
+ if (strcmp(module_sel, info->name) == 0)
+ break;
+ info = info->next;
+ }
+ if (info) {
+ list.string = info->name;
+ list.list_index = idx;
+ XawListHighlight(modList, idx);
+ SelectModuleCallback(modList, NULL, (XtPointer)&list);
+ }
+ if (option_str && *option_str) {
+ OptionInfoPtr opts = info->option;
+
+ idx = 0;
+ while (opts && opts->name) {
+ if (strcmp(opts->name, option_str) == 0)
+ break;
+ ++idx;
+ ++opts;
+ }
+
+ if (opts && opts->name) {
+ list.string = (char *)opts->name;
+ list.list_index = idx;
+ XawListHighlight(optList, idx);
+ SelectModuleOptionCallback(optList, NULL, (XtPointer)&list);
+ }
+ }
+ }
+ XtPopup(modOptionsShell, XtGrabNone);
+}
+
+/*ARGSUSED*/
+static void
+ModuleOptionsPopdown(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XtPopdown(modOptionsShell);
+}
+
+/*ARGSUSED*/
+void
+ModuleOptionsCancelAction(Widget w, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ ModuleOptionsPopdown(w, NULL, NULL);
+}
+#endif
+
void
CreateOptionsShell(void)
{
@@ -95,7 +242,7 @@ OptionsPopup(XF86OptionPtr *opts)
option_str = NULL;
options = opts;
if (first) {
- Widget pane, form, viewport, bottom, popdown;
+ Widget pane, form, viewport, bottom, popdown, command;
first = 0;
@@ -103,6 +250,7 @@ OptionsPopup(XF86OptionPtr *opts)
CreateOptionsShell();
pane = XtCreateManagedWidget("pane", panedWidgetClass,
optionsShell, NULL, 0);
+
form = XtCreateManagedWidget("commands", formWidgetClass,
pane, NULL, 0);
add = XtCreateManagedWidget("add", commandWidgetClass,
@@ -114,6 +262,13 @@ OptionsPopup(XF86OptionPtr *opts)
update = XtCreateManagedWidget("update", commandWidgetClass,
form, NULL, 0);
XtAddCallback(update, XtNcallback, UpdateOption, NULL);
+#ifdef USE_MODULES
+ if (!nomodules) {
+ command = XtCreateManagedWidget("help", commandWidgetClass,
+ form, NULL, 0);
+ XtAddCallback(command, XtNcallback, ModuleOptionsPopup, NULL);
+ }
+#endif
form = XtCreateManagedWidget("form", formWidgetClass,
pane, NULL, 0);
XtVaCreateManagedWidget("label1", labelWidgetClass, form,
@@ -140,13 +295,15 @@ OptionsPopup(XF86OptionPtr *opts)
bottom = XtCreateManagedWidget("bottom", formWidgetClass,
pane, NULL, 0);
#ifdef USE_MODULES
- button = XtCreateManagedWidget("driverOpts", menuButtonWidgetClass,
- bottom, NULL, 0);
+ if (!nomodules)
+ button = XtCreateManagedWidget("driverOpts", menuButtonWidgetClass,
+ bottom, NULL, 0);
#endif
popdown = XtVaCreateManagedWidget("popdown", commandWidgetClass,
bottom, NULL, 0);
#ifdef USE_MODULES
- XtVaSetValues(popdown, XtNfromHoriz, button, NULL, 0);
+ if (!nomodules)
+ XtVaSetValues(popdown, XtNfromHoriz, button, NULL, 0);
#endif
XtAddCallback(popdown, XtNcallback, PopdownCallback, NULL);
@@ -154,7 +311,7 @@ OptionsPopup(XF86OptionPtr *opts)
XSetWMProtocols(DPY, XtWindow(optionsShell), &wm_delete_window, 1);
#ifdef USE_MODULES
- {
+ if (!nomodules) {
char *str;
XtSetArg(args[0], XtNlabel, &str);
@@ -165,49 +322,57 @@ OptionsPopup(XF86OptionPtr *opts)
}
#ifdef USE_MODULES
- if (menu)
- XtDestroyWidget(menu);
- XmuSnprintf(menuName, sizeof(buf), "optionM%d", menuN);
- menuN = !menuN;
- menu = XtCreatePopupShell(menuName, simpleMenuWidgetClass, button,
- NULL, 0);
- XtVaSetValues(button, XtNmenuName, menuName, NULL, 0);
- if (drv_opts) {
- int len, longest = 0;
- char fmt[32];
- static char *types[] = {
- "none", "integer", "(non null) string", "string", "real",
- "boolean", "frequency",
- };
-
- for (i = 0; drv_opts[i].name != NULL; i++) {
- len = strlen(drv_opts[i].name);
- if (len > longest)
- longest = len;
+ if (!nomodules) {
+ if (menu)
+ XtDestroyWidget(menu);
+ XmuSnprintf(menuName, sizeof(buf), "optionM%d", menuN);
+ menuN = !menuN;
+ menu = XtCreatePopupShell(menuName, simpleMenuWidgetClass, button,
+ NULL, 0);
+ XtVaSetValues(button, XtNmenuName, menuName, NULL, 0);
+ if (drv_opts) {
+ int len, longest = 0;
+ char fmt[32];
+
+ for (i = 0; drv_opts[i].name != NULL; i++) {
+ len = strlen(drv_opts[i].name);
+ if (len > longest)
+ longest = len;
+ }
+ XmuSnprintf(fmt, sizeof(fmt), "%c-%ds %%s", '%', longest);
+ for (; drv_opts->name != NULL; drv_opts++) {
+ char *type;
+
+ if (drv_opts->type >= OPTV_NONE && drv_opts->type <= OPTV_FREQ)
+ type = types[drv_opts->type];
+ else
+ type = "UNKNOWN";
+
+ XmuSnprintf(buf, sizeof(buf), fmt, drv_opts->name, type);
+ sme = XtVaCreateManagedWidget(drv_opts->name, smeBSBObjectClass,
+ menu, XtNlabel, buf, NULL, 0);
+ XtAddCallback(sme, XtNcallback, AddDriverOption, (XtPointer)drv_opts);
+ }
}
- XmuSnprintf(fmt, sizeof(fmt), "%c-%ds %%s", '%', longest);
- for (; drv_opts->name != NULL; drv_opts++) {
- char *type;
-
- if (drv_opts->type >= OPTV_NONE && drv_opts->type <= OPTV_FREQ)
- type = types[drv_opts->type];
- else
- type = "UNKNOWN";
-
- XmuSnprintf(buf, sizeof(buf), fmt, drv_opts->name, type);
- sme = XtVaCreateManagedWidget(drv_opts->name, smeBSBObjectClass,
- menu, XtNlabel, buf, NULL, 0);
- XtAddCallback(sme, XtNcallback, AddDriverOption, (XtPointer)drv_opts);
+ if (i) {
+ xf86cfgModuleOptions *mod = module_options;
+
+ while (mod) {
+ if (strcmp(mod->name, driver) == 0) {
+ /* don't assign to driver, as it may be a temp string */
+ module_sel = mod->name;
+ break;
+ }
+ mod = mod->next;
+ }
+ XmuSnprintf(buf, sizeof(buf), "%s%s", label, driver);
+ XtSetArg(args[0], XtNlabel, buf);
+ XtSetValues(button, args, 1);
+ XtMapWidget(button);
}
+ else
+ XtUnmapWidget(button);
}
- if (i) {
- XmuSnprintf(buf, sizeof(buf), "%s%s", label, driver);
- XtSetArg(args[0], XtNlabel, buf);
- XtSetValues(button, args, 1);
- XtMapWidget(button);
- }
- else
- XtUnmapWidget(button);
#endif
UpdateOptionList();
@@ -334,6 +499,7 @@ AddDriverOption(Widget w, XtPointer user_data, XtPointer call_data)
OptionInfoPtr opt = (OptionInfoPtr)user_data;
XF86OptionPtr option;
+ option_str = (char *)opt->name;
XtSetArg(args[0], XtNstring, opt->name);
XtSetValues(name, args, 1);
if ((option = xf86findOption(*options, opt->name)) == NULL)
@@ -342,6 +508,90 @@ AddDriverOption(Widget w, XtPointer user_data, XtPointer call_data)
XtSetArg(args[0], XtNstring, option->opt_val);
XtSetValues(value, args, 1);
}
+
+/*ARGSUSED*/
+static void
+SelectModuleCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ xf86cfgModuleOptions *mod = module_options;
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+
+ while (mod) {
+ if (strcmp(mod->name, info->string) == 0)
+ break;
+ mod = mod->next;
+ }
+
+ if (mod) {
+ Arg args[2];
+ char **list = NULL, **old;
+ OptionInfoPtr opts = mod->option;
+ int num = 0, oldnum;
+
+ module_sel = mod->name;
+ XtSetArg(args[0], XtNlist, &old);
+ XtSetArg(args[1], XtNnumberStrings, &oldnum);
+ XtGetValues(optList, args, 2);
+ while (opts && opts->name) {
+ ++num;
+ list = (char**)XtRealloc((XtPointer)list, sizeof(char*) * num);
+ list[num - 1] = XtNewString(opts->name);
+ ++opts;
+ }
+ if (num == 0) {
+ list = (char**)XtMalloc(sizeof(char*));
+ list[0] = XtNewString("");
+ num = 1;
+ }
+ XtSetArg(args[0], XtNlist, list);
+ XtSetArg(args[1], XtNnumberStrings, num);
+ XtSetValues(optList, args, 2);
+ while (--oldnum >= 0)
+ XtFree(old[oldnum]);
+ XtFree((XtPointer)old);
+
+ XtVaSetValues(desc, XtNstring, "", NULL);
+ XawListUnhighlight(optList);
+ }
+}
+
+static void
+SelectModuleOptionCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ xf86cfgModuleOptions *mod = module_options;
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+ char *description = NULL, *type = "undefined";
+ char label[256];
+
+ if (module_sel && info->string)
+ description = GetOptionDescription(module_sel, info->string);
+ if (description == NULL)
+ description = "** NO DESCRIPTION AVAILABLE **";
+
+ XtVaSetValues(desc, XtNstring, description, NULL);
+
+ while (mod) {
+ if (strcmp(module_sel, mod->name) == 0)
+ break;
+ mod = mod->next;
+ }
+ if (mod) {
+ OptionInfoPtr opts = mod->option;
+
+ while (opts && opts->name) {
+ if (strcmp(info->string, opts->name) == 0)
+ break;
+ ++opts;
+ }
+ if (opts && opts->name && opts->type >= OPTV_NONE &&
+ opts->type <= OPTV_FREQ)
+ type = types[opts->type];
+ }
+
+ XmuSnprintf(label, sizeof(label), "%s.%s (%s)", module_sel, info->string,
+ type);
+ XtVaSetValues(labelType, XtNlabel, label, NULL);
+}
#endif
/*ARGSUSED*/
@@ -393,3 +643,27 @@ UpdateOption(Widget w, XtPointer user_data, XtPointer call_data)
XtSetSensitive(remov, True);
XtSetSensitive(update, True);
}
+
+char *
+GetOptionDescription(char *module, char *option)
+{
+ static int first = 1;
+ char *type;
+ XrmValue value;
+ char query[256];
+
+ if (first) {
+ first = 0;
+ XrmInitialize();
+ if ((xrm = XrmGetFileDatabase(Options)) == (XrmDatabase)0) {
+ fprintf(stderr, "Cannot open '%s' database.\n", Options);
+ return (NULL);
+ }
+ }
+
+ XmuSnprintf(query, sizeof(query), "%s.%s", module, option);
+ if (XrmGetResource(xrm, query, "Module.Option", &type, &value))
+ return ((char*)value.addr);
+
+ return (NULL);
+}
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/options.h b/xc/programs/Xserver/hw/xfree86/xf86cfg/options.h
index eb5b4474a..6c754f86b 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/options.h
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/options.h
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.h,v 1.3 2000/10/20 14:59:07 alanh Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.h,v 1.4.2.1 2001/05/25 21:45:01 paulo Exp $
*/
#include "config.h"
@@ -39,7 +39,12 @@
*/
#ifdef USE_MODULES
void OptionsPopup(XF86OptionPtr*, char*, OptionInfoPtr);
+void ModuleOptionsPopup(Widget, XtPointer, XtPointer);
#else
void OptionsPopup(XF86OptionPtr*);
#endif
void OptionsCancelAction(Widget, XEvent*, String*, Cardinal*);
+void ModuleOptionsCancelAction(Widget, XEvent*, String*, Cardinal*);
+char *GetOptionDescription(char *module, char *option);
+
+void CreateOptionsShell(void); \ No newline at end of file
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c
index e683bff12..7a166623d 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c,v 1.7 2001/04/01 14:00:15 tsi Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c,v 1.8.2.1 2001/05/21 22:24:02 paulo Exp $
*/
#include "xf86config.h"
@@ -406,7 +406,7 @@ ScreenDialog(XF86SetupInfo *info)
XF86ConfModeLinePtr mline = mon != NULL ? mon->mon_modeline_lst : NULL;
int i;
#ifdef USE_MODULES
- xf86cfgDriverOptions *drv_opts = video_driver_info;
+ xf86cfgModuleOptions *drv_opts = module_options;
Bool foundRotate = False;
#endif
@@ -486,31 +486,34 @@ ScreenDialog(XF86SetupInfo *info)
}
#ifdef USE_MODULES
- while (drv_opts) {
- if (strcmp(drv_opts->name, screen->scrn_device->dev_driver) == 0) {
- OptionInfoPtr opts = drv_opts->option;
-
- while (opts->name) {
- if (xf86nameCompare(opts->name, "Rotate") == 0) {
- foundRotate = True;
- break;
+ if (!nomodules) {
+ while (drv_opts) {
+ if (drv_opts->type == VideoModule &&
+ strcmp(drv_opts->name, screen->scrn_device->dev_driver) == 0) {
+ OptionInfoPtr opts = drv_opts->option;
+
+ while (opts->name) {
+ if (xf86nameCompare(opts->name, "Rotate") == 0) {
+ foundRotate = True;
+ break;
+ }
+ opts++;
}
- opts++;
+ break;
}
- break;
+ drv_opts = drv_opts->next;
}
- drv_opts = drv_opts->next;
- }
- if (!foundRotate) {
- XtUnmapWidget(labelRotate);
- XtUnmapWidget(cw);
- XtUnmapWidget(ccw);
- }
- else {
- XtMapWidget(labelRotate);
- XtMapWidget(cw);
- XtMapWidget(ccw);
+ if (!foundRotate) {
+ XtUnmapWidget(labelRotate);
+ XtUnmapWidget(cw);
+ XtUnmapWidget(ccw);
+ }
+ else {
+ XtMapWidget(labelRotate);
+ XtMapWidget(cw);
+ XtMapWidget(ccw);
+ }
}
#endif
if (rotate == CW) {
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c
index bf50a62b2..0849deee5 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c
@@ -26,7 +26,7 @@
*
* Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c,v 1.10 2001/04/22 08:36:31 herrb Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c,v 1.10.2.1 2001/05/21 22:24:02 paulo Exp $
*/
#include <stdio.h>
@@ -1055,31 +1055,16 @@ CardConfig(void)
char **list = NULL, *identifier = NULL, *driver, *busid, *tmp;
int nlist, def;
CardsEntry *entry = NULL;
-#ifdef USE_MODULES
static char **drivers;
static int ndrivers;
+#ifdef USE_MODULES
static char *path = NULL, *modules = "lib/modules";
const char *subdirs[] = {
"drivers",
NULL
};
-
- if (XF86Module_path == NULL) {
- XF86Module_path = XtMalloc(strlen(XFree86Dir) + strlen(modules) + 2);
- sprintf(XF86Module_path, "%s/%s", XFree86Dir, modules);
- }
-
- if (drivers == NULL) {
- xf86Verbose = 0;
- LoaderInit();
- path = XtNewString(XF86Module_path);
- LoaderSetPath(path);
- drivers = LoaderListDirs((char**)subdirs, NULL);
- for (; drivers[ndrivers]; ndrivers++)
- ;
- }
-#else
- static char *drivers[] = {
+#endif
+ static char *xdrivers[] = {
"apm",
"ark",
"ati",
@@ -1107,8 +1092,30 @@ CardConfig(void)
"vga",
"vesa",
};
- static int ndrivers = sizeof(drivers) / sizeof(drivers[0]);
+
+#ifdef USE_MODULES
+ if (!nomodules) {
+ if (XF86Module_path == NULL) {
+ XF86Module_path = XtMalloc(strlen(XFree86Dir) + strlen(modules) + 2);
+ sprintf(XF86Module_path, "%s/%s", XFree86Dir, modules);
+ }
+
+ if (drivers == NULL) {
+ xf86Verbose = 0;
+ LoaderInit();
+ path = XtNewString(XF86Module_path);
+ LoaderSetPath(path);
+ drivers = LoaderListDirs((char**)subdirs, NULL);
+ for (; drivers[ndrivers]; ndrivers++)
+ ;
+ }
+ }
+ else
#endif
+ {
+ ndrivers = sizeof(xdrivers) / sizeof(xdrivers[0]);
+ drivers = xdrivers;
+ }
nlist = 0;
while (device) {
diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man b/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man
index 103fc64d5..0a16cb385 100644
--- a/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man
+++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man
@@ -26,7 +26,7 @@
.\"
.\" Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
.\"
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man,v 1.6 2001/01/27 18:20:59 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man,v 1.6.2.1 2001/05/21 22:24:02 paulo Exp $
.\"
.TH xf86cfg 1 __vendorversion__
.SH NAME
@@ -91,6 +91,10 @@ started by xf86cfg, if any.
.I -textmode
If xf86cfg was compiled with support to ncurses, this option makes xf86cfg
enters a text mode interface.
+.TP 8
+.I -nomodules
+When built with support for loading modules, this options changes xf86cfg
+behaviour, so that it will not load any modules, and thus start quickier.
.SH ENVIRONMENT
.TP 8
diff --git a/xc/programs/Xserver/hw/xwin/InitInput.c b/xc/programs/Xserver/hw/xwin/InitInput.c
index 4d008b272..355315f86 100644
--- a/xc/programs/Xserver/hw/xwin/InitInput.c
+++ b/xc/programs/Xserver/hw/xwin/InitInput.c
@@ -22,17 +22,20 @@
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/InitInput.c,v 1.3 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/InitInput.c,v 1.4 2001/05/02 00:45:26 alanh Exp $ */
#include "win.h"
-/* Called from dix/devices.c */
-/* All of our keys generate up and down transition notifications,
- so all of our keys can be used as modifiers.
+CARD32 g_c32LastInputEventTime = 0;
- An example of a modifier is mapping the A key to the Control key.
- A has to be a legal modifier. I think.
-*/
+/* Called from dix/devices.c */
+/*
+ * All of our keys generate up and down transition notifications,
+ * so all of our keys can be used as modifiers.
+ *
+ * An example of a modifier is mapping the A key to the Control key.
+ * A has to be a legal modifier. I think.
+ */
Bool
LegalModifier (unsigned int uiKey, DevicePtr pDevice)
{
@@ -48,6 +51,14 @@ ProcessInputEvents (void)
miPointerUpdate ();
}
+int
+TimeSinceLastInputEvent ()
+{
+ if (g_c32LastInputEventTime == 0)
+ g_c32LastInputEventTime = GetTickCount ();
+ return GetTickCount () - g_c32LastInputEventTime;
+}
+
/* See Porting Layer Definition - p. 17 */
void
InitInput (int argc, char *argv[])
diff --git a/xc/programs/Xserver/hw/xwin/InitOutput.c b/xc/programs/Xserver/hw/xwin/InitOutput.c
index fe098dbb9..31c3cdee3 100644
--- a/xc/programs/Xserver/hw/xwin/InitOutput.c
+++ b/xc/programs/Xserver/hw/xwin/InitOutput.c
@@ -22,7 +22,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/InitOutput.c,v 1.5 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/InitOutput.c,v 1.8 2001/05/08 08:14:09 alanh Exp $ */
#include "win.h"
@@ -30,7 +30,7 @@ int g_nNumScreens;
winScreenInfo g_winScreens[MAXSCREENS];
int g_nLastScreen = -1;
ColormapPtr g_cmInstalledMaps[MAXSCREENS];
-int g_fdMessageQueue = -1;
+int g_fdMessageQueue = WIN_FD_INVALID;
int g_winScreenPrivateIndex = -1;
unsigned long g_winGeneration = 0;
@@ -40,7 +40,7 @@ static PixmapFormatRec g_PixmapFormats[] = {
{ 8, 8, BITMAP_SCANLINE_PAD },
{ 15, 16, BITMAP_SCANLINE_PAD },
{ 16, 16, BITMAP_SCANLINE_PAD },
- { 24, 32, BITMAP_SCANLINE_PAD },
+ { 24, 24, BITMAP_SCANLINE_PAD },
{ 32, 32, BITMAP_SCANLINE_PAD }
};
const int NUMFORMATS = sizeof (g_PixmapFormats) / sizeof (g_PixmapFormats[0]);
@@ -60,6 +60,8 @@ winInitializeDefaultScreens (void)
g_winScreens[i].pixelWhite = WIN_DEFAULT_WHITEPIXEL;
g_winScreens[i].dwLineBias = WIN_DEFAULT_LINEBIAS;
g_winScreens[i].pfb = NULL;
+ g_winScreens[i].fFullScreen = FALSE;
+ g_winScreens[i].iE3BTimeout = WIN_E3B_OFF;
}
g_nNumScreens = 1;
}
@@ -132,6 +134,8 @@ ddxUseMsg (void)
"\t\tDirectDraw4 blitter\t4\n");
ErrorF ("-fullscreen\n"
"\tRun the specified server engine in fullscreen mode\n");
+ ErrorF ("-emulate3buttons [n]\n"
+ "\tEmulate 3 button mouse with timeout of n milliseconds\n");
}
/* See Porting Layer Definition - p. 57 */
@@ -148,8 +152,8 @@ ddxProcessArgument (int argc, char *argv[], int i)
}
/*
- Look for the '-screen n WxHxD' arugment
- */
+ * Look for the '-screen n WxHxD' arugment
+ */
if (strcmp (argv[i], "-screen") == 0)
{
int nScreenNum;
@@ -163,17 +167,21 @@ ddxProcessArgument (int argc, char *argv[], int i)
nScreenNum = atoi (argv[i+1]);
+ /* Validate the specified screen number */
if (nScreenNum < 0 || nScreenNum >= MAXSCREENS)
{
ErrorF ("Invalid screen number %d\n", nScreenNum);
UseMsg ();
return 0;
}
+
+ /* Grab the height, width, and depth parameters */
if (3 != sscanf (argv[i+2], "%dx%dx%d",
(int*)&g_winScreens[nScreenNum].dwWidth,
(int*)&g_winScreens[nScreenNum].dwHeight,
(int*)&g_winScreens[nScreenNum].dwDepth))
{
+ /* I see no height, width, and depth here */
ErrorF ("Invalid screen configuration %s\n", argv[i+2]);
UseMsg ();
return 0;
@@ -186,8 +194,8 @@ ddxProcessArgument (int argc, char *argv[], int i)
}
/*
- Look for the '-blackpixel n' argument
- */
+ * Look for the '-blackpixel n' argument
+ */
if (strcmp (argv[i], "-blackpixel") == 0) /* -blackpixel n */
{
Pixel pix;
@@ -200,24 +208,29 @@ ddxProcessArgument (int argc, char *argv[], int i)
}
pix = atoi (argv[i]);
+
+ /* Is this parameter attached to a screen or global? */
if (-1 == g_nLastScreen)
{
- int i;
- for (i = 0; i < MAXSCREENS; i++)
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
{
- g_winScreens[i].pixelBlack = pix;
+ g_winScreens[j].pixelBlack = pix;
}
}
else
{
+ /* Parameter is for a single screen */
g_winScreens[g_nLastScreen].pixelBlack = pix;
}
return 2;
}
/*
- Look for the '-whitepixel n' argument
- */
+ * Look for the '-whitepixel n' argument
+ */
if (strcmp (argv[i], "-whitepixel") == 0) /* -whitepixel n */
{
Pixel pix;
@@ -230,24 +243,29 @@ ddxProcessArgument (int argc, char *argv[], int i)
}
pix = atoi (argv[i]);
+
+ /* Is this parameter attached to a screen or global? */
if (-1 == g_nLastScreen)
{
- int i;
- for (i = 0; i < MAXSCREENS; i++)
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
{
- g_winScreens[i].pixelWhite = pix;
+ g_winScreens[j].pixelWhite = pix;
}
}
else
{
+ /* Parameter is for a single screen */
g_winScreens[g_nLastScreen].pixelWhite = pix;
}
return 2;
}
/*
- Look for the '-linebias n' argument
- */
+ * Look for the '-linebias n' argument
+ */
if (strcmp (argv[i], "-linebias") == 0)
{
unsigned int uiLinebias;
@@ -261,25 +279,28 @@ ddxProcessArgument (int argc, char *argv[], int i)
uiLinebias = atoi (argv[i]);
+ /* Is this parameter attached to a screen or global? */
if (-1 == g_nLastScreen)
{
- int i;
+ int j;
- for (i = 0; i < MAXSCREENS; i++)
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
{
- g_winScreens[i].dwLineBias = uiLinebias;
+ g_winScreens[j].dwLineBias = uiLinebias;
}
}
else
{
+ /* Parameter is for a single screen */
g_winScreens[g_nLastScreen].dwLineBias = uiLinebias;
}
return 2;
}
/*
- Look for the '-engine n' argument
- */
+ * Look for the '-engine n' argument
+ */
if (strcmp (argv[i], "-engine") == 0)
{
DWORD dwEngine = 0;
@@ -308,12 +329,12 @@ ddxProcessArgument (int argc, char *argv[], int i)
/* Is this parameter attached to a screen or global? */
if (-1 == g_nLastScreen)
{
- int i;
+ int j;
/* Parameter is for all screens */
- for (i = 0; i < MAXSCREENS; i++)
+ for (j = 0; j < MAXSCREENS; j++)
{
- g_winScreens[i].dwEnginePreferred = dwEngine;
+ g_winScreens[j].dwEnginePreferred = dwEngine;
}
}
else
@@ -326,18 +347,20 @@ ddxProcessArgument (int argc, char *argv[], int i)
return 2;
}
- /* Look for the '-fullscreen' argument */
+ /*
+ * Look for the '-fullscreen' argument
+ */
if (strcmp(argv[i], "-fullscreen") == 0)
{
/* Is this parameter attached to a screen or is it global? */
if (-1 == g_nLastScreen)
{
- int i;
+ int j;
/* Parameter is for all screens */
- for (i = 0; i < MAXSCREENS; i++)
+ for (j = 0; j < MAXSCREENS; j++)
{
- g_winScreens[i].fFullScreen = TRUE;
+ g_winScreens[j].fFullScreen = TRUE;
}
}
else
@@ -350,6 +373,54 @@ ddxProcessArgument (int argc, char *argv[], int i)
return 1;
}
+ /*
+ * Look for the '-emulate3buttons' argument
+ */
+ if (strcmp(argv[i], "-emulate3buttons") == 0)
+ {
+ int iArgsProcessed = 1;
+ int iE3BTimeout = WIN_DEFAULT_E3B_TIME;
+
+ /* Grab the optional timeout value */
+ if (i + 1 < argc
+ && 1 == sscanf (argv[i + 1], "%d",
+ &iE3BTimeout))
+ {
+ /* Indicate that we have processed the next argument */
+ iArgsProcessed++;
+ }
+ else
+ {
+ /*
+ * sscanf () won't modify iE3BTimeout if it doesn't find
+ * the specified format; however, I want to be explicit
+ * about setting the default timeout in such cases to
+ * prevent some programs (me) from getting confused.
+ */
+ iE3BTimeout = WIN_DEFAULT_E3B_TIME;
+ }
+
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_nLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_winScreens[j].iE3BTimeout = iE3BTimeout;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_winScreens[g_nLastScreen].iE3BTimeout = TRUE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return iArgsProcessed;
+ }
+
return 0;
}
diff --git a/xc/programs/Xserver/hw/xwin/win.h b/xc/programs/Xserver/hw/xwin/win.h
index 691d8b908..0a380cb1e 100644
--- a/xc/programs/Xserver/hw/xwin/win.h
+++ b/xc/programs/Xserver/hw/xwin/win.h
@@ -30,7 +30,7 @@
* Peter Busch
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/win.h,v 1.3 2001/04/19 12:56:03 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/win.h,v 1.6 2001/05/08 08:14:09 alanh Exp $ */
#ifndef _WIN_H_
#define _WIN_H_
@@ -72,9 +72,6 @@
#define DEBUGPROC_MSG
#endif
-/* We use xor this macro for detecting toggle key state changes */
-#define WIN_XOR(a,b) ((!(a) && (b)) || ((a) && !(b)))
-
/* Constant strings */
#define WINDOW_CLASS "cygwin/xfree86"
#define WINDOW_TITLE "Cygwin/XFree86"
@@ -89,7 +86,10 @@
#define WIN_DEFAULT_WHITEPIXEL 255
#define WIN_DEFAULT_BLACKPIXEL 0
#define WIN_DEFAULT_LINEBIAS 0
+#define WIN_DEFAULT_E3B_TIME 50 /* milliseconds */
+#define WIN_E3B_OFF -1
+#define WIN_E3B_TIMER_ID 1
#define WIN_FD_INVALID -1
#define WIN_SERVER_NONE 0x0L /* 0 */
@@ -104,6 +104,10 @@
#define KanaMapIndex Mod4MapIndex
#define ScrollLockMapIndex Mod5MapIndex
+#define WIN_24BPP_MASK_RED 0x00FF0000
+#define WIN_24BPP_MASK_GREEN 0x0000FF00
+#define WIN_24BPP_MASK_BLUE 0x000000FF
+
/*
* We need symbols for the scan codes of keys.
*/
@@ -155,6 +159,7 @@
#include "fb.h"
#ifdef RENDER
+#include "mipict.h"
#include "picturestr.h"
#endif
@@ -193,6 +198,10 @@ typedef void (*winCreateBoundingWindowProcPtr)(ScreenPtr);
typedef Bool (*winFinishScreenInitProcPtr)(int, ScreenPtr, int, char **);
+typedef Bool (*winBltExposedRegionsProcPtr)(ScreenPtr);
+
+typedef Bool (*winActivateAppProcPtr)(ScreenPtr);
+
/*
* Privates structures
*/
@@ -228,6 +237,7 @@ typedef struct
DWORD dwEnginePreferred;
DWORD dwEnginesSupported;
Bool fFullScreen;
+ int iE3BTimeout;
} winScreenInfo, *winScreenInfoPtr;
typedef struct
@@ -250,6 +260,10 @@ typedef struct
DWORD dwModeKeyStates;
+ /* 3 button emulation variables */
+ int iE3BCachedPress;
+ Bool fE3BFakeButton2Sent;
+
/* Privates used by shadow fb GDI server */
HBITMAP hbmpShadow;
HDC hdcScreen;
@@ -286,6 +300,8 @@ typedef struct
winAdjustVideoModeProcPtr pwinAdjustVideoMode;
winCreateBoundingWindowProcPtr pwinCreateBoundingWindow;
winFinishScreenInitProcPtr pwinFinishScreenInit;
+ winBltExposedRegionsProcPtr pwinBltExposedRegions;
+ winActivateAppProcPtr pwinActivateApp;
} winPrivScreenRec, *winPrivScreenPtr;
extern ColormapPtr g_cmInstalledMaps[];
@@ -296,6 +312,7 @@ extern DWORD g_dwEvents;
extern int g_fdMessageQueue;
extern int g_winScreenPrivateIndex;
extern unsigned long g_winGeneration;
+extern CARD32 g_c32LastInputEventTime;
/*
* Screen privates macros
@@ -315,13 +332,17 @@ extern unsigned long g_winGeneration;
(_pWin)->devPrivates[winWindowPrivateIndex].ptr)
/*
- FIXME: Windows mouse wheel macro; should be in Cygwin w32api headers
-*/
+ * FIXME: Windows mouse wheel macro; should be in Cygwin w32api headers.
+ * Has been fixed after May 05, 2001. Remove this section after the
+ * fixed headers are in distribution.
+ */
#ifndef GET_WHEEL_DELTA_WPARAM
#define GET_WHEEL_DELTA_WPARAM(wparam) ((short)HIWORD (wparam))
#endif /* GET_WHEEL_DELTA_WPARAM */
-/* BEGIN DDX and DIX Function Prototypes */
+/*
+ * BEGIN DDX and DIX Function Prototypes
+ */
/*
* InitOutput.c
@@ -474,6 +495,7 @@ winGetSpansNativeGDI (DrawablePtr pDrawable,
/*
* winkeybd.c
*/
+
void
winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode);
@@ -499,6 +521,9 @@ winStoreModeKeyStates (ScreenPtr pScreen);
void
winRestoreModeKeyStates (ScreenPtr pScreen);
+Bool
+winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam);
+
/*
* winmisc.c
*/
@@ -523,6 +548,17 @@ winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl);
int
winMouseProc (DeviceIntPtr pDeviceInt, int iState);
+int
+winMouseWheel (ScreenPtr pScreen, int iDeltaZ);
+
+void
+winMouseButtonsSendEvent (int iEventType, int iButton);
+
+int
+winMouseButtonsHandle (ScreenPtr pScreen,
+ int iEventType, int iButton,
+ WPARAM wParam);
+
/*
* winpfbddd.c
*/
@@ -540,6 +576,9 @@ Bool
winAdjustVideoModePrimaryDD (ScreenPtr pScreen);
Bool
+winActivateAppPrimaryDD (ScreenPtr pScreen);
+
+Bool
winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen);
/*
@@ -669,6 +708,12 @@ Bool
winAdjustVideoModeShadowDD (ScreenPtr pScreen);
Bool
+winBltExposedRegionsShadowDD (ScreenPtr pScreen);
+
+Bool
+winActivateAppShadowDD (ScreenPtr pScreen);
+
+Bool
winSetEngineFunctionsShadowDD (ScreenPtr pScreen);
/*
@@ -707,6 +752,12 @@ Bool
winAdjustVideoModeShadowDDNL (ScreenPtr pScreen);
Bool
+winBltExposedRegionsShadowDDNL (ScreenPtr pScreen);
+
+Bool
+winActivateAppShadowDDNL (ScreenPtr pScreen);
+
+Bool
winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen);
/*
@@ -745,6 +796,9 @@ Bool
winAdjustVideoModeShadowGDI (ScreenPtr pScreen);
Bool
+winActivateAppShadowGDI (ScreenPtr pScreen);
+
+Bool
winSetEngineFunctionsShadowGDI (ScreenPtr pScreen);
/*
@@ -794,7 +848,9 @@ winWindowProc (HWND hWnd, UINT message,
void
winRestoreModeKeyStates (ScreenPtr pScreen);
-/* END DDX and DIX Function Prototypes */
+/*
+ * END DDX and DIX Function Prototypes
+ */
#endif /* _WIN_H_ */
diff --git a/xc/programs/Xserver/hw/xwin/winallpriv.c b/xc/programs/Xserver/hw/xwin/winallpriv.c
index f0c033862..bc8700486 100644
--- a/xc/programs/Xserver/hw/xwin/winallpriv.c
+++ b/xc/programs/Xserver/hw/xwin/winallpriv.c
@@ -28,7 +28,7 @@
* Authors: Keith Packard, MIT X Consortium
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winallpriv.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winallpriv.c,v 1.3 2001/05/14 16:52:33 alanh Exp $ */
#include "win.h"
@@ -49,7 +49,10 @@ winAllocatePrivates (ScreenPtr pScreen)
/* Allocate memory for our private structure */
pScreenPriv = (winPrivScreenPtr) xalloc (sizeof (*pScreenPriv));
if (!pScreenPriv)
- return FALSE;
+ {
+ ErrorF ("winAllocatePrivates () - xalloc () failed\n");
+ return FALSE;
+ }
/* Initialize the memory of the private structure */
ZeroMemory (pScreenPriv, sizeof (winPrivScreenRec));
diff --git a/xc/programs/Xserver/hw/xwin/wincmap.c b/xc/programs/Xserver/hw/xwin/wincmap.c
index b59da898d..bb728c595 100644
--- a/xc/programs/Xserver/hw/xwin/wincmap.c
+++ b/xc/programs/Xserver/hw/xwin/wincmap.c
@@ -30,7 +30,7 @@
* Peter Busch
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/wincmap.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wincmap.c,v 1.4 2001/05/14 16:52:33 alanh Exp $ */
#include "win.h"
@@ -38,7 +38,8 @@
int
winListInstalledColormapsNativeGDI (ScreenPtr pScreen, Colormap *pmaps)
{
- /* By the time we are processing requests, we can guarantee that there
+ /*
+ * By the time we are processing requests, we can guarantee that there
* is always a colormap installed
*/
@@ -68,7 +69,9 @@ void
winStoreColorsNativeGDI (ColormapPtr pmap, int ndef, xColorItem *pdefs)
{
ErrorF ("winStoreColors ()\n");
- //miStoreColors (pmap, ndef, pdefs);
+#if 0
+ miStoreColors (pmap, ndef, pdefs);
+#endif
}
/* See Porting Layer Definition - p. 30 */
@@ -88,7 +91,10 @@ Bool
winInitializeColormapNativeGDI (ColormapPtr pmap)
{
ErrorF ("\nwinInitializeColormap ()\n");
+#if 0
return miInitializeColormap (pmap);
+#endif
+ return TRUE;
}
int
@@ -102,61 +108,66 @@ winExpandDirectColorsNativeGDI (ColormapPtr pmap, int ndef,
Bool
winCreateDefColormapNativeGDI (ScreenPtr pScreen)
{
+ winScreenPriv(pScreen);
+ Bool fReturn = TRUE;
VisualPtr pVisual;
ColormapPtr pcmap = NULL;
- HBITMAP hbmp;
- HDC hdc = GetDC (NULL);
- BITMAPINFO *pbmi = xalloc (sizeof (BITMAPINFOHEADER)
- + 256 * sizeof (RGBQUAD));
int i;
Pixel pixel;
unsigned short nRed, nGreen, nBlue;
-
- ErrorF ("winCreateDefColormap () - sizeof (*pbmi): %d\n",
- sizeof (*pbmi));
+ UINT uiSystemPaletteEntries;
+ PALETTEENTRY *ppeColors = NULL;
/* Find the root visual */
for (pVisual = pScreen->visuals;
pVisual->vid != pScreen->rootVisual;
pVisual++);
- hbmp = CreateCompatibleBitmap (hdc, 1, 1);
+ /*
+ * AllocNone for Dynamic visual classes,
+ * AllocAll for non-Dynamic visual classes.
+ */
- /* Allocate a colormap */
+ /* Allocate an X colormap, owned by client 0 */
if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &pcmap,
AllocNone, 0) != Success)
- return FALSE;
+ {
+ ErrorF ("winCreateDefColormapNativeGDI () - CreateColormap failed\n");
+ return FALSE;
+ }
if (pcmap == NULL)
{
- FatalError ("winCreateDefColormap () - Colormap could not be created\n");
+ ErrorF ("winCreateDefColormap () - Colormap could not be created\n");
+ return FALSE;
}
-
ErrorF ("winCreateDefColormap () - Created a colormap\n");
- /* Intialize memory of bitmap info header */
- ZeroMemory (pbmi, sizeof (*pbmi));
- pbmi->bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
-
- /* Get the screen bitmap format and colormap */
- GetDIBits (hdc, hbmp,
- 0, 0,
- NULL,
- pbmi,
- DIB_RGB_COLORS);
-
- ErrorF ("winCreateDefColormap () - Got screen colormap %d %d\n",
- pbmi->bmiHeader.biClrUsed, pbmi->bmiHeader.biClrImportant);
+ /* Get the number of entries in the system palette */
+ uiSystemPaletteEntries = GetSystemPaletteEntries (pScreenPriv->hdcScreen,
+ 0, 0, NULL);
+ ErrorF ("winCreateDefColormap () - uiSystemPaletteEntries %d\n",
+ uiSystemPaletteEntries);
+
+ /* Allocate palette entries structure */
+ ppeColors = xalloc (uiSystemPaletteEntries * sizeof (PALETTEENTRY));
+
+ /* Get system palette entries */
+ GetSystemPaletteEntries (pScreenPriv->hdcScreen,
+ 0, uiSystemPaletteEntries, ppeColors);
- /* Allocate an X colormap entry for each of Windows' colormap entries */
- for (i = 0; i < 8; ++i)
+ /* Allocate an X colormap entry for every system palette entry */
+ for (i = 0; i < uiSystemPaletteEntries; ++i)
{
pixel = i;
- nRed = pbmi->bmiColors[i].rgbRed;
- nGreen = pbmi->bmiColors[i].rgbGreen;
- nBlue = pbmi->bmiColors[i].rgbBlue;
+ /* Extract the color values for current palette entry */
+ nRed = ppeColors[i].peRed << 8;
+ nGreen = ppeColors[i].peGreen << 8;
+ nBlue = ppeColors[i].peBlue << 8;
- ErrorF ("winCreateDefColormap () - Allocating a color: %d; %d %d %d\n",
+#if 0
+ ErrorF ("winCreateDefColormap () - Allocating a color: %d; "\
+ "%d %d %d ",
pixel, nRed, nGreen, nBlue);
if (AllocColor (pcmap,
&nRed,
@@ -165,16 +176,31 @@ winCreateDefColormapNativeGDI (ScreenPtr pScreen)
&pixel,
0) != Success)
break;
+#endif
+
+ pcmap->red[i].co.local.red = nRed;
+ pcmap->red[i].co.local.green = nGreen;
+ pcmap->red[i].co.local.blue = nBlue;
}
- /* Free memory */
- ReleaseDC (NULL, hdc);
- DeleteObject (hbmp);
- xfree (pbmi);
+ if (uiSystemPaletteEntries == 0)
+ {
+ fbInitializeColormap (pcmap);
+ }
+ else
+ {
+ /* Set the black and white pixel indices */
+ pScreen->whitePixel = uiSystemPaletteEntries - 1;
+ pScreen->blackPixel = 0;
+ }
- ErrorF ("winCreateDefColormap () - Returning\n");
+ /* Free colormap */
+ free (ppeColors);
- return TRUE;
+ /* Install the created colormap */
+ (*pScreen->InstallColormap)(pcmap);
+
+ return fReturn;
}
void
@@ -221,10 +247,11 @@ winInitVisualsNativeGDI (ScreenPtr pScreen)
pbmi->bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
/* Call GetDIBits for the first time; doesn't do much */
- /* NOTE: This doesn't actually return the bits, because our
- data pointer is NULL; therefore, we don't have to free
- memory later.
- */
+ /*
+ * NOTE: This doesn't actually return the bits, because our
+ * data pointer is NULL; therefore, we don't have to free
+ * memory later.
+ */
GetDIBits (hdc, hbmp,
0, 0,
NULL,
diff --git a/xc/programs/Xserver/hw/xwin/wincursor.c b/xc/programs/Xserver/hw/xwin/wincursor.c
index f6baf40de..ed04f4b81 100644
--- a/xc/programs/Xserver/hw/xwin/wincursor.c
+++ b/xc/programs/Xserver/hw/xwin/wincursor.c
@@ -30,7 +30,7 @@
* Peter Busch
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/wincursor.c,v 1.1 2001/04/05 20:13:49 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wincursor.c,v 1.2 2001/05/14 16:52:33 alanh Exp $ */
#include "win.h"
@@ -44,6 +44,7 @@ miPointerScreenFuncRec g_winPointerCursorFuncs =
Bool
winCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y)
{
+ ErrorF ("winCursorOffScreen () - hmm...\n");
return FALSE;
}
diff --git a/xc/programs/Xserver/hw/xwin/winkeybd.c b/xc/programs/Xserver/hw/xwin/winkeybd.c
index 5df741748..05b5bf5d6 100644
--- a/xc/programs/Xserver/hw/xwin/winkeybd.c
+++ b/xc/programs/Xserver/hw/xwin/winkeybd.c
@@ -30,7 +30,7 @@
* Peter Busch
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winkeybd.c,v 1.1 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winkeybd.c,v 1.2 2001/05/02 00:45:26 alanh Exp $ */
#include "win.h"
@@ -66,9 +66,9 @@ winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode)
}
/*
- Handle extended keys that weren't handled correctly as
- non-extended keys.
- */
+ * Handle extended keys that weren't handled correctly as
+ * non-extended keys.
+ */
if (HIWORD (lParam) & KF_EXTENDED)
{
switch (wParam)
@@ -235,7 +235,12 @@ void
winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
pointer pCtrl, int iClass)
{
-
+ /*
+ * Window 95 and later ignore the parameters to Beep.
+ * Systems with sound cards will play the default sound event;
+ * systems without sound cards will play the standard system beep.
+ */
+ Beep (0, 0);
}
/* Change some keyboard configuration parameters */
@@ -356,9 +361,9 @@ winInitializeModeKeyStates (void)
}
/*
- We have to store the last state of each mode
- key before we lose the keyboard focus.
-*/
+ * We have to store the last state of each mode
+ * key before we lose the keyboard focus.
+ */
void
winStoreModeKeyStates (ScreenPtr pScreen)
{
@@ -381,10 +386,10 @@ winStoreModeKeyStates (ScreenPtr pScreen)
}
/*
- Upon regaining the keyboard focus we must
- resynchronize our internal mode key states
- with the actual state of the keys.
-*/
+ * Upon regaining the keyboard focus we must
+ * resynchronize our internal mode key states
+ * with the actual state of the keys.
+ */
void
winRestoreModeKeyStates (ScreenPtr pScreen)
{
@@ -393,8 +398,8 @@ winRestoreModeKeyStates (ScreenPtr pScreen)
ZeroMemory (&xCurrentEvent, sizeof (xCurrentEvent));
/* Has the key state changed? */
- if (WIN_XOR(pScreenPriv->dwModeKeyStates & NumLockMask,
- GetKeyState (VK_NUMLOCK) & 0x0001))
+ if ((pScreenPriv->dwModeKeyStates & NumLockMask)
+ ^ (GetKeyState (VK_NUMLOCK) & 0x0001))
{
xCurrentEvent.u.u.detail = KEY_NumLock + MIN_KEYCODE;
@@ -410,8 +415,8 @@ winRestoreModeKeyStates (ScreenPtr pScreen)
}
/* Has the key state changed? */
- if (WIN_XOR(pScreenPriv->dwModeKeyStates & LockMask,
- GetKeyState (VK_CAPITAL) & 0x0001))
+ if ((pScreenPriv->dwModeKeyStates & LockMask)
+ ^ (GetKeyState (VK_CAPITAL) & 0x0001))
{
xCurrentEvent.u.u.detail = KEY_CapsLock + MIN_KEYCODE;
@@ -427,8 +432,8 @@ winRestoreModeKeyStates (ScreenPtr pScreen)
}
/* Has the key state changed? */
- if (WIN_XOR(pScreenPriv->dwModeKeyStates & ScrollLockMask,
- GetKeyState (VK_SCROLL) & 0x0001))
+ if ((pScreenPriv->dwModeKeyStates & ScrollLockMask)
+ ^ (GetKeyState (VK_SCROLL) & 0x0001))
{
xCurrentEvent.u.u.detail = KEY_ScrollLock + MIN_KEYCODE;
@@ -444,8 +449,8 @@ winRestoreModeKeyStates (ScreenPtr pScreen)
}
/* Has the key state changed? */
- if (WIN_XOR(pScreenPriv->dwModeKeyStates & KanaMask,
- GetKeyState (VK_KANA) & 0x0001))
+ if ((pScreenPriv->dwModeKeyStates & KanaMask)
+ ^ (GetKeyState (VK_KANA) & 0x0001))
{
xCurrentEvent.u.u.detail = KEY_HKTG + MIN_KEYCODE;
@@ -461,5 +466,86 @@ winRestoreModeKeyStates (ScreenPtr pScreen)
}
}
+/*
+ * Look for the lovely fake Control_L press/release generated by Windows
+ * when AltGr is pressed/released on a non-U.S. keyboard.
+ */
+Bool
+winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam)
+{
+ MSG msgNext;
+ LONG lTime;
+ Bool fReturn;
+
+ /*
+ * Fake Ctrl_L presses will be followed by an Alt_R keypress
+ * with the same timestamp as the Ctrl_L press.
+ */
+ if (message == WM_KEYDOWN
+ && wParam == VK_CONTROL
+ && (HIWORD (lParam) & KF_EXTENDED) == 0)
+ {
+ /* Got a Ctrl_L press */
+
+ /* Get time of current message */
+ lTime = GetMessageTime ();
+
+ /* Look for fake Ctrl_L preceeding an Alt_R press. */
+ fReturn = PeekMessage (&msgNext, NULL,
+ WM_KEYDOWN, WM_KEYDOWN,
+ PM_NOREMOVE);
+
+ /* Is next press an Alt_R with the same timestamp? */
+ if (fReturn && msgNext.wParam == VK_MENU
+ && msgNext.time == lTime
+ && (HIWORD (msgNext.lParam) & KF_EXTENDED))
+ {
+ /*
+ * Next key press is Alt_R with same timestamp as current
+ * Ctrl_L message. Therefore, this Ctrl_L press is a fake
+ * event, so discard it.
+ */
+ return TRUE;
+ }
+ }
+
+ /*
+ * Fake Ctrl_L releases will be followed by an Alt_R release
+ * with the same timestamp as the Ctrl_L press.
+ */
+ if ((message == WM_KEYUP || message == WM_SYSKEYUP)
+ && wParam == VK_CONTROL
+ && (HIWORD (lParam) & KF_EXTENDED) == 0)
+ {
+ /* Got a Ctrl_L release */
+
+ /* Get time of current message */
+ lTime = GetMessageTime ();
+
+ /* Look for fake Ctrl_L release preceeding an Alt_R release. */
+ fReturn = PeekMessage (&msgNext, NULL,
+ WM_KEYUP, WM_SYSKEYUP,
+ PM_NOREMOVE);
+
+ /* Is next press an Alt_R with the same timestamp? */
+ if (fReturn
+ && (msgNext.message == WM_KEYUP
+ || msgNext.message == WM_SYSKEYUP)
+ && msgNext.wParam == VK_MENU
+ && msgNext.time == lTime
+ && (HIWORD (msgNext.lParam) & KF_EXTENDED))
+ {
+ /*
+ * Next key release is Alt_R with same timestamp as current
+ * Ctrl_L message. Therefore, this Ctrl_L release is a fake
+ * event, so discard it.
+ */
+ return TRUE;
+ }
+ }
+
+ /* Not a fake control left press/release */
+ return FALSE;
+}
diff --git a/xc/programs/Xserver/hw/xwin/winkeymap.h b/xc/programs/Xserver/hw/xwin/winkeymap.h
deleted file mode 100644
index 71ffc128f..000000000
--- a/xc/programs/Xserver/hw/xwin/winkeymap.h
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of the XFree86 Project
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from the XFree86 Project.
- *
- * Authors: Dakshinamurthy Karra
- * Suhaib M Siddiqi
- * Peter Busch
- * Harold L Hunt II
- */
-/* $XFree86: xc/programs/Xserver/hw/xwin/winkeymap.h,v 1.2 2001/04/05 20:13:49 dawes Exp $ */
-
-/* This table maps Windows Virtual Key Codes to X11 KeySyms.
-
- To map a particular VKey, lookup the value of the VKey
- in MSDN Library->Platform SDK->User Interface Services->
- Windows User Interface->User Input->Virtual-Key Codes,
- find the array position corresponding to the VKey code
- (e.g. 0x09 for VK_TAB), and fill in the first column
- in that row with the primary key cap, the second column
- with the secondary key (shift), and so on. Note that
- there are not generally any symbols in the third and fourth
- columns of a particular row.
-
- Lookup the XK constants in xc/include/keysymdef.h.
-*/
-static KeySym g_winKeySym[NUM_KEYCODES * GLYPHS_PER_KEY] = {
- /* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x01 through 0x06 are mouse buttons */
- /* 0x01 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x02 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x03 */ XK_Cancel, NoSymbol, NoSymbol, NoSymbol,
- /* 0x04 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x05 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x06 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x07 undefined */
- /* 0x07 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x08 */ XK_BackSpace, NoSymbol, NoSymbol, NoSymbol,
- /* 0x09 */ XK_Tab, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x0a through 0x0b reserved */
- /* 0x0a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x0b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x0c */ XK_Clear, NoSymbol, NoSymbol, NoSymbol,
- /* 0x0d */ XK_Return, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x0e through 0x0f undefined */
- /* We use 0x0e for the numeric keypad return key */
- /* 0x0e */ XK_KP_Enter, NoSymbol, NoSymbol, NoSymbol,
- /* 0x0f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x10, 0x11, and 0x12 are Shift, Control, and Alt, but we don't use
- them because they do not distinquish between Left and Right keys.
-
- See keys 0xa0 through 0xa5 for Shift, Control, and Alt symbols.
- */
- /* 0x10 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x11 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x12 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x13 */ XK_Pause, NoSymbol, NoSymbol, NoSymbol,
- /* 0x14 */ XK_Caps_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x15 */ XK_Kana_Lock, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x16 undefined */
- /* 0x16 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* I don't know what to pass for Junja and Final mode keys,
- so I'm just passing a mode siwtch.
- */
- /* 0x19 for Kanji mode may be the wrong symbol */
- /* 0x17 */ XK_Mode_switch, NoSymbol, NoSymbol, NoSymbol,
- /* 0x18 */ XK_Mode_switch, NoSymbol, NoSymbol, NoSymbol,
- /* 0x19 */ XK_Kanji, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x1a undefined */
- /* 0x1a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x1c, 0x1d, and 0x1e are probably wrong.
- Having a symbol passed at least allows people to map the key
- to something more useful.
- */
- /* 0x1b */ XK_Escape, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1c */ XK_Henkan, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1d */ XK_Muhenkan, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1e */ XK_Kanji_Bangou,NoSymbol, NoSymbol, NoSymbol,
- /* 0x1f */ XK_Mode_switch, NoSymbol, NoSymbol, NoSymbol,
- /* 0x20 */ XK_space, NoSymbol, NoSymbol, NoSymbol,
- /* 0x21 */ XK_Page_Up, NoSymbol, NoSymbol, NoSymbol,
- /* 0x22 */ XK_Page_Down, NoSymbol, NoSymbol, NoSymbol,
- /* 0x23 */ XK_End, NoSymbol, NoSymbol, NoSymbol,
- /* 0x24 */ XK_Home, NoSymbol, NoSymbol, NoSymbol,
- /* 0x25 */ XK_Left, NoSymbol, NoSymbol, NoSymbol,
- /* 0x26 */ XK_Up, NoSymbol, NoSymbol, NoSymbol,
- /* 0x27 */ XK_Right, NoSymbol, NoSymbol, NoSymbol,
- /* 0x28 */ XK_Down, NoSymbol, NoSymbol, NoSymbol,
- /* 0x29 */ XK_Select, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2a */ XK_Print, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2b */ XK_Execute, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2c */ XK_Print, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2d */ XK_Insert, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2e */ XK_Delete, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2f */ XK_Help, NoSymbol, NoSymbol, NoSymbol,
- /* 0x30 */ XK_0, XK_parenright, NoSymbol, NoSymbol,
- /* 0x31 */ XK_1, XK_exclam, NoSymbol, NoSymbol,
- /* 0x32 */ XK_2, XK_at, NoSymbol, NoSymbol,
- /* 0x33 */ XK_3, XK_numbersign, NoSymbol, NoSymbol,
- /* 0x34 */ XK_4, XK_dollar, NoSymbol, NoSymbol,
- /* 0x35 */ XK_5, XK_percent, NoSymbol, NoSymbol,
- /* 0x36 */ XK_6, XK_asciicircum, NoSymbol, NoSymbol,
- /* 0x37 */ XK_7, XK_ampersand, NoSymbol, NoSymbol,
- /* 0x38 */ XK_8, XK_asterisk, NoSymbol, NoSymbol,
- /* 0x39 */ XK_9, XK_parenleft, NoSymbol, NoSymbol,
-
- /* 0x3a through 0x40 undefined */
- /* 0x3a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3d */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x40 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x41 */ XK_A, NoSymbol, NoSymbol, NoSymbol,
- /* 0x42 */ XK_B, NoSymbol, NoSymbol, NoSymbol,
- /* 0x43 */ XK_C, NoSymbol, NoSymbol, NoSymbol,
- /* 0x44 */ XK_D, NoSymbol, NoSymbol, NoSymbol,
- /* 0x45 */ XK_E, NoSymbol, NoSymbol, NoSymbol,
- /* 0x46 */ XK_F, NoSymbol, NoSymbol, NoSymbol,
- /* 0x47 */ XK_G, NoSymbol, NoSymbol, NoSymbol,
- /* 0x48 */ XK_H, NoSymbol, NoSymbol, NoSymbol,
- /* 0x49 */ XK_I, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4a */ XK_J, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4b */ XK_K, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4c */ XK_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4d */ XK_M, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4e */ XK_N, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4f */ XK_O, NoSymbol, NoSymbol, NoSymbol,
- /* 0x50 */ XK_P, NoSymbol, NoSymbol, NoSymbol,
- /* 0x51 */ XK_Q, NoSymbol, NoSymbol, NoSymbol,
- /* 0x52 */ XK_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x53 */ XK_S, NoSymbol, NoSymbol, NoSymbol,
- /* 0x54 */ XK_T, NoSymbol, NoSymbol, NoSymbol,
- /* 0x55 */ XK_U, NoSymbol, NoSymbol, NoSymbol,
- /* 0x56 */ XK_V, NoSymbol, NoSymbol, NoSymbol,
- /* 0x57 */ XK_W, NoSymbol, NoSymbol, NoSymbol,
- /* 0x58 */ XK_X, NoSymbol, NoSymbol, NoSymbol,
- /* 0x59 */ XK_Y, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5a */ XK_Z, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x5b through 0x5f undefined */
- /* 0x5b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5d */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x60 */ XK_KP_Insert, XK_KP_0, NoSymbol, NoSymbol,
- /* 0x61 */ XK_KP_End, XK_KP_1, NoSymbol, NoSymbol,
- /* 0x62 */ XK_KP_Down, XK_KP_2, NoSymbol, NoSymbol,
- /* 0x63 */ XK_KP_Page_Down,XK_KP_3, NoSymbol, NoSymbol,
- /* 0x64 */ XK_KP_Left, XK_KP_4, NoSymbol, NoSymbol,
- /* 0x65 */ NoSymbol, XK_KP_5, NoSymbol, NoSymbol,
- /* 0x66 */ XK_KP_Right, XK_KP_6, NoSymbol, NoSymbol,
- /* 0x67 */ XK_KP_Home, XK_KP_7, NoSymbol, NoSymbol,
- /* 0x68 */ XK_KP_Up, XK_KP_8, NoSymbol, NoSymbol,
- /* 0x69 */ XK_KP_Page_Up, XK_KP_9, NoSymbol, NoSymbol,
- /* 0x6a */ XK_KP_Multiply, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6b */ XK_KP_Add, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6c */ XK_KP_Separator,NoSymbol, NoSymbol, NoSymbol,
- /* 0x6d */ XK_KP_Subtract, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6e */ XK_KP_Delete, XK_KP_Decimal, NoSymbol, NoSymbol,
- /* 0x6f */ XK_KP_Divide, NoSymbol, NoSymbol, NoSymbol,
- /* 0x70 */ XK_F1, NoSymbol, NoSymbol, NoSymbol,
- /* 0x71 */ XK_F2, NoSymbol, NoSymbol, NoSymbol,
- /* 0x72 */ XK_F3, NoSymbol, NoSymbol, NoSymbol,
- /* 0x73 */ XK_F4, NoSymbol, NoSymbol, NoSymbol,
- /* 0x74 */ XK_F5, NoSymbol, NoSymbol, NoSymbol,
- /* 0x75 */ XK_F6, NoSymbol, NoSymbol, NoSymbol,
- /* 0x76 */ XK_F7, NoSymbol, NoSymbol, NoSymbol,
- /* 0x77 */ XK_F8, NoSymbol, NoSymbol, NoSymbol,
- /* 0x78 */ XK_F9, NoSymbol, NoSymbol, NoSymbol,
- /* 0x79 */ XK_F10, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7a */ XK_F11, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7b */ XK_F12, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7c */ XK_F13, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7d */ XK_F14, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7e */ XK_F15, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7f */ XK_F16, NoSymbol, NoSymbol, NoSymbol,
- /* 0x80 */ XK_F17, NoSymbol, NoSymbol, NoSymbol,
- /* 0x81 */ XK_F18, NoSymbol, NoSymbol, NoSymbol,
- /* 0x82 */ XK_F19, NoSymbol, NoSymbol, NoSymbol,
- /* 0x83 */ XK_F20, NoSymbol, NoSymbol, NoSymbol,
- /* 0x84 */ XK_F21, NoSymbol, NoSymbol, NoSymbol,
- /* 0x85 */ XK_F22, NoSymbol, NoSymbol, NoSymbol,
- /* 0x86 */ XK_F23, NoSymbol, NoSymbol, NoSymbol,
- /* 0x87 */ XK_F24, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x88 through 0x8f unassigned */
- /* 0x88 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x89 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x8a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x8b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x8c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x8d */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x8e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x8f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x90 */ XK_Num_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x91 */ XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x92 through 0x96 OEM specific */
- /* 0x92 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x93 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x94 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x95 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x96 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0x97 through 0x9f unassigned */
- /* 0x97 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x98 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x99 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x9a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x9b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x9c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x9d */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x9e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x9f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xa0 */ XK_Shift_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0xa1 */ XK_Shift_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0xa2 */ XK_Control_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0xa3 */ XK_Control_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0xa4 */ XK_Alt_L, XK_Meta_L, NoSymbol, NoSymbol,
- /* 0xa5 */ XK_Alt_R, XK_Meta_R, NoSymbol, NoSymbol,
-
- /* 0xa6 through 0xb7 are MS Natural Keyboard Pro browser buttons, etc. */
- /* 0xa6 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xa7 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xa8 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xa9 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xaa */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xab */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xac */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xad */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xae */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xaf */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xb0 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xb1 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xb2 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xb3 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xb4 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xb5 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xb6 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xb7 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xb8 through 0xb9 reserved */
- /* 0xb8 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xb9 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xba */ XK_semicolon, XK_colon, NoSymbol, NoSymbol,
- /* 0xbb */ XK_equal, XK_plus, NoSymbol, NoSymbol,
- /* 0xbc */ XK_comma, XK_less, NoSymbol, NoSymbol,
- /* 0xbd */ XK_minus, XK_underscore, NoSymbol, NoSymbol,
- /* 0xbe */ XK_period, XK_greater, NoSymbol, NoSymbol,
- /* 0xbf */ XK_slash, XK_question, NoSymbol, NoSymbol,
- /* 0xc0 */ XK_quoteleft, XK_asciitilde, NoSymbol, NoSymbol,
-
- /* 0xc1 through 0xd7 reserved */
- /* 0xc1 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xc2 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xc3 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xc4 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xc5 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xc6 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xc7 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xc8 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xc9 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xca */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xcb */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xcc */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xcd */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xce */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xcf */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xd0 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xd1 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xd2 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xd3 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xd4 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xd5 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xd6 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xd7 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xd8 through 0xda unassigned */
- /* 0xd8 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xd9 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xda */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xdb */ XK_bracketleft, XK_braceleft, NoSymbol, NoSymbol,
- /* 0xdc */ XK_backslash, XK_bar, NoSymbol, NoSymbol,
- /* 0xdd */ XK_bracketright,XK_braceright, NoSymbol, NoSymbol,
- /* 0xde */ XK_apostrophe, XK_quotedbl, NoSymbol, NoSymbol,
- /* 0xdf */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xe0 reserved */
- /* 0xe0 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xe1 OEM specific */
- /* 0xe1 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xe2 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xe3 through 0xe4 OEM specific */
- /* 0xe3 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xe4 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xe5 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xe6 OEM specific */
- /* 0xe6 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xe7 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xe8 unassigned */
- /* 0xe8 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xe9 through 0xf5 OEM specific */
- /* 0xe9 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xea */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xeb */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xec */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xed */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xef */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xf0 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xf1 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xf2 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xf3 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xf4 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xf5 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* 0xf6 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xf7 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xf8 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xf9 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xfa */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xfb */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xfc */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xfd */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xfe */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0xff */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
-
- /* For X Server NumLock handling */
- /* 0x100 */ XK_KP_7, NoSymbol, NoSymbol, NoSymbol,
- /* 0x101 */ XK_KP_8, NoSymbol, NoSymbol, NoSymbol,
- /* 0x102 */ XK_KP_9, NoSymbol, NoSymbol, NoSymbol,
- /* 0x103 */ XK_KP_4, NoSymbol, NoSymbol, NoSymbol,
- /* 0x104 */ XK_KP_5, NoSymbol, NoSymbol, NoSymbol,
- /* 0x105 */ XK_KP_6, NoSymbol, NoSymbol, NoSymbol,
- /* 0x106 */ XK_KP_1, NoSymbol, NoSymbol, NoSymbol,
- /* 0x107 */ XK_KP_2, NoSymbol, NoSymbol, NoSymbol,
- /* 0x108 */ XK_KP_3, NoSymbol, NoSymbol, NoSymbol,
- /* 0x109 */ XK_KP_0, NoSymbol, NoSymbol, NoSymbol,
- /* 0x10a */ XK_KP_Decimal, NoSymbol, NoSymbol, NoSymbol,
- /* 0x10b */ XK_KP_Home, NoSymbol, NoSymbol, NoSymbol,
- /* 0x10c */ XK_KP_Up, NoSymbol, NoSymbol, NoSymbol,
- /* 0x10d */ XK_KP_Prior, NoSymbol, NoSymbol, NoSymbol,
- /* 0x10e */ XK_KP_Left, NoSymbol, NoSymbol, NoSymbol,
- /* 0x10f */ XK_KP_Begin, NoSymbol, NoSymbol, NoSymbol,
- /* 0x110 */ XK_KP_Right, NoSymbol, NoSymbol, NoSymbol,
- /* 0x111 */ XK_KP_End, NoSymbol, NoSymbol, NoSymbol,
- /* 0x112 */ XK_KP_Down, NoSymbol, NoSymbol, NoSymbol,
- /* 0x113 */ XK_KP_Next, NoSymbol, NoSymbol, NoSymbol,
- /* 0x114 */ XK_KP_Insert, NoSymbol, NoSymbol, NoSymbol,
- /* 0x115 */ XK_KP_Delete, NoSymbol, NoSymbol, NoSymbol
-};
diff --git a/xc/programs/Xserver/hw/xwin/winmisc.c b/xc/programs/Xserver/hw/xwin/winmisc.c
index 320458d5d..f730a3ce4 100644
--- a/xc/programs/Xserver/hw/xwin/winmisc.c
+++ b/xc/programs/Xserver/hw/xwin/winmisc.c
@@ -27,23 +27,25 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmisc.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmisc.c,v 1.3 2001/05/02 00:45:26 alanh Exp $ */
#include "win.h"
/* See Porting Layer Definition - p. 33 */
-/* Called by clients, returns the best size for a cursor, tile, or
- stipple, specified by class (sometimes called kind) */
+/*
+ * Called by clients, returns the best size for a cursor, tile, or
+ * stipple, specified by class (sometimes called kind)
+ */
void
winQueryBestSizeNativeGDI (int class, unsigned short *pWidth,
unsigned short *pHeight, ScreenPtr pScreen)
{
- fprintf (stderr, "winQueryBestSize()\n");
+ ErrorF ("winQueryBestSize()\n");
}
/*
- Count the number of one bits in a color mask.
-*/
+ * Count the number of one bits in a color mask.
+ */
CARD8
winCountBits (DWORD dw)
{
diff --git a/xc/programs/Xserver/hw/xwin/winmouse.c b/xc/programs/Xserver/hw/xwin/winmouse.c
index a75e3bb5e..f448f6111 100644
--- a/xc/programs/Xserver/hw/xwin/winmouse.c
+++ b/xc/programs/Xserver/hw/xwin/winmouse.c
@@ -30,17 +30,17 @@
* Peter Busch
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmouse.c,v 1.1 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmouse.c,v 1.3 2001/05/08 08:14:09 alanh Exp $ */
#include "win.h"
void
winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl)
{
-
}
-/* See Porting Layer Definition - p. 18
+/*
+ * See Porting Layer Definition - p. 18
* This is known as a DeviceProc
*/
int
@@ -76,3 +76,213 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
}
return Success;
}
+
+/* Handle the mouse wheel */
+int
+winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
+{
+ winScreenPriv(pScreen);
+ xEvent xCurrentEvent;
+
+ /* Button4 = WheelUp */
+ /* Button5 = WheelDown */
+
+ /* Do we have any previous delta stored? */
+ if ((pScreenPriv->iDeltaZ > 0
+ && iDeltaZ > 0)
+ || (pScreenPriv->iDeltaZ < 0
+ && iDeltaZ < 0))
+ {
+ /* Previous delta and of same sign as current delta */
+ iDeltaZ += pScreenPriv->iDeltaZ;
+ pScreenPriv->iDeltaZ = 0;
+ }
+ else
+ {
+ /*
+ * Previous delta of different sign, or zero.
+ * We will set it to zero for either case,
+ * as blindly setting takes just as much time
+ * as checking, then setting if necessary :)
+ */
+ pScreenPriv->iDeltaZ = 0;
+ }
+
+ /*
+ * Only process this message if the wheel has moved further than
+ * WHEEL_DELTA
+ */
+ if (iDeltaZ >= WHEEL_DELTA || (-1 * iDeltaZ) >= WHEEL_DELTA)
+ {
+ pScreenPriv->iDeltaZ = 0;
+
+ /* Figure out how many whole deltas of the wheel we have */
+ iDeltaZ /= WHEEL_DELTA;
+ }
+ else
+ {
+ /*
+ * Wheel has not moved past WHEEL_DELTA threshold;
+ * we will store the wheel delta until the threshold
+ * has been reached.
+ */
+ pScreenPriv->iDeltaZ = iDeltaZ;
+ return 0;
+ }
+
+ /* Set the button to indicate up or down wheel delta */
+ if (iDeltaZ > 0)
+ {
+ xCurrentEvent.u.u.detail = Button4;
+ }
+ else
+ {
+ xCurrentEvent.u.u.detail = Button5;
+ }
+
+ /*
+ * Flip iDeltaZ to positive, if negative,
+ * because always need to generate a *positive* number of
+ * button clicks for the Z axis.
+ */
+ if (iDeltaZ < 0)
+ {
+ iDeltaZ *= -1;
+ }
+
+ /* Generate X input messages for each wheel delta we have seen */
+ while (iDeltaZ--)
+ {
+ /* Push the wheel button */
+ xCurrentEvent.u.u.type = ButtonPress;
+ xCurrentEvent.u.keyButtonPointer.time
+ = g_c32LastInputEventTime = GetTickCount ();
+ mieqEnqueue (&xCurrentEvent);
+
+ /* Release the wheel button */
+ xCurrentEvent.u.u.type = ButtonRelease;
+ xCurrentEvent.u.keyButtonPointer.time
+ = g_c32LastInputEventTime = GetTickCount ();
+ mieqEnqueue (&xCurrentEvent);
+ }
+
+ return 0;
+}
+
+/*
+ * Enqueue a mouse button event
+ */
+void
+winMouseButtonsSendEvent (int iEventType, int iButton)
+{
+ xEvent xCurrentEvent;
+
+ /* Load an xEvent and enqueue the event */
+ xCurrentEvent.u.u.type = iEventType;
+ xCurrentEvent.u.u.detail = iButton;
+ xCurrentEvent.u.keyButtonPointer.time
+ = g_c32LastInputEventTime = GetTickCount ();
+ mieqEnqueue (&xCurrentEvent);
+}
+
+/*
+ * Decide what to do with a Windows mouse message
+ */
+int
+winMouseButtonsHandle (ScreenPtr pScreen,
+ int iEventType, int iButton,
+ WPARAM wParam)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Send button events right away if emulate 3 buttons is off */
+ if (pScreenInfo->iE3BTimeout == WIN_E3B_OFF)
+ {
+ /* Emulate 3 buttons is off, send the button event */
+ winMouseButtonsSendEvent (iEventType, iButton);
+ return 0;
+ }
+
+ /* Emulate 3 buttons is on, let the fun begin */
+ if (iEventType == ButtonPress
+ && pScreenPriv->iE3BCachedPress == 0
+ && !pScreenPriv->fE3BFakeButton2Sent)
+ {
+ /*
+ * Button was pressed, no press is cached,
+ * and there is no fake button 2 release pending.
+ */
+
+ /* Store button press type */
+ pScreenPriv->iE3BCachedPress = iButton;
+
+ /*
+ * Set a timer to send this button press if the other button
+ * is not pressed within the timeout time.
+ */
+ SetTimer (pScreenPriv->hwndScreen,
+ WIN_E3B_TIMER_ID,
+ pScreenInfo->iE3BTimeout,
+ NULL);
+ }
+ else if (iEventType == ButtonPress
+ && pScreenPriv->iE3BCachedPress != 0
+ && pScreenPriv->iE3BCachedPress != iButton
+ && !pScreenPriv->fE3BFakeButton2Sent)
+ {
+ /*
+ * Button press is cached, other button was pressed,
+ * and there is no fake button 2 release pending.
+ */
+
+ /* Mouse button was cached and other button was pressed */
+ KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
+ pScreenPriv->iE3BCachedPress = 0;
+
+ /* Send fake middle button */
+ winMouseButtonsSendEvent (ButtonPress, Button2);
+
+ /* Indicate that a fake middle button event was sent */
+ pScreenPriv->fE3BFakeButton2Sent = TRUE;
+ }
+ else if (iEventType == ButtonRelease
+ && pScreenPriv->iE3BCachedPress == iButton)
+ {
+ /*
+ * Cached button was released before timer ran out,
+ * and before the other mouse button was pressed.
+ */
+ KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
+ pScreenPriv->iE3BCachedPress = 0;
+
+ /* Send cached press, then send release */
+ winMouseButtonsSendEvent (ButtonPress, iButton);
+ winMouseButtonsSendEvent (ButtonRelease, iButton);
+ }
+ else if (iEventType == ButtonRelease
+ && pScreenPriv->fE3BFakeButton2Sent
+ && !(wParam & MK_LBUTTON)
+ && !(wParam & MK_RBUTTON))
+ {
+ /*
+ * Fake button 2 was sent and both mouse buttons have now been released
+ */
+ pScreenPriv->fE3BFakeButton2Sent = FALSE;
+
+ /* Send middle mouse button release */
+ winMouseButtonsSendEvent (ButtonRelease, Button2);
+ }
+ else if (iEventType == ButtonRelease
+ && pScreenPriv->iE3BCachedPress == 0
+ && !pScreenPriv->fE3BFakeButton2Sent)
+ {
+ /*
+ * Button was release, no button is cached,
+ * and there is no fake button 2 release is pending.
+ */
+ winMouseButtonsSendEvent (ButtonRelease, iButton);
+ }
+
+ return 0;
+}
diff --git a/xc/programs/Xserver/hw/xwin/winpfbdd.c b/xc/programs/Xserver/hw/xwin/winpfbdd.c
index 44829b448..e020cb76f 100644
--- a/xc/programs/Xserver/hw/xwin/winpfbdd.c
+++ b/xc/programs/Xserver/hw/xwin/winpfbdd.c
@@ -30,13 +30,13 @@
* Peter Busch
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winpfbdd.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winpfbdd.c,v 1.5 2001/05/14 16:52:33 alanh Exp $ */
#include "win.h"
/*
- Create a DirectDraw primary surface
-*/
+ * Create a DirectDraw primary surface
+ */
Bool
winAllocateFBPrimaryDD (ScreenPtr pScreen)
{
@@ -122,13 +122,14 @@ winAllocateFBPrimaryDD (ScreenPtr pScreen)
pddsdPrimary->dwSize = sizeof (*pddsdPrimary);
/* Describe the offscreen surface to be created */
- /* NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
- as drawing, locking, and unlocking take forever
- with video memory surfaces. In addition,
- video memory is a somewhat scarce resource,
- so you shouldn't be allocating video memory when
- you could use system memory instead.
- */
+ /*
+ * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
+ * as drawing, locking, and unlocking take forever
+ * with video memory surfaces. In addition,
+ * video memory is a somewhat scarce resource,
+ * so you shouldn't be allocating video memory when
+ * you have the option of using system memory instead.
+ */
ZeroMemory (&ddsd, sizeof (ddsd));
ddsd.dwSize = sizeof (ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
@@ -192,10 +193,10 @@ winAllocateFBPrimaryDD (ScreenPtr pScreen)
}
/*
- Call the wrapped CloseScreen function.
-
- Free our resources and private structures.
-*/
+ * Call the wrapped CloseScreen function.
+ *
+ * Free our resources and private structures.
+ */
Bool
winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen)
{
@@ -264,12 +265,12 @@ winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen)
}
/*
- Tell mi what sort of visuals we need.
-
- Generally we only need one visual, as our screen can only
- handle one format at a time, I believe. You may want
- to verify that last sentence.
-*/
+ * Tell mi what sort of visuals we need.
+ *
+ * Generally we only need one visual, as our screen can only
+ * handle one format at a time, I believe. You may want
+ * to verify that last sentence.
+ */
Bool
winInitVisualsPrimaryDD (ScreenPtr pScreen)
{
@@ -311,12 +312,16 @@ winInitVisualsPrimaryDD (ScreenPtr pScreen)
pScreenPriv->dwGreenMask,
pScreenPriv->dwBlueMask))
{
- FatalError ("winInitVisualsPrimaryDD () - miSetVisualTypesAndMasks failed\n");
+ ErrorF ("winInitVisualsPrimaryDD () - " \
+ "miSetVisualTypesAndMasks failed\n");
+ return FALSE;
}
break;
case 8:
+#if CYGDEBUG
ErrorF ("winInitVisuals () - Calling miSetVisualTypesAndMasks\n");
+#endif /* CYGDEBUG */
if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
PseudoColorMask,
pScreenPriv->dwBitsPerRGB,
@@ -325,13 +330,19 @@ winInitVisualsPrimaryDD (ScreenPtr pScreen)
pScreenPriv->dwGreenMask,
pScreenPriv->dwBlueMask))
{
- FatalError ("winInitVisualsPrimaryDD () - miSetVisualTypesAndMasks failed\n");
+ ErrorF ("winInitVisualsPrimaryDD () - "\
+ "miSetVisualTypesAndMasks failed\n");
+ return FALSE;
}
- ErrorF ("winInitVisualsPrimaryDD () - Returned from miSetVisualTypesAndMasks\n");
+#if CYGDEBUG
+ ErrorF ("winInitVisualsPrimaryDD () - Returned from "\
+ "miSetVisualTypesAndMasks\n");
+#endif /* CYGDEBUG */
break;
default:
- break;
+ ErrorF ("winInitVisualsPrimaryDD () - Unknown screen depth\n");
+ return FALSE;
}
/* Set DPI info */
@@ -361,7 +372,10 @@ winAdjustVideoModePrimaryDD (ScreenPtr pScreen)
/* We're in serious trouble if we can't get a DC */
hdc = GetDC (NULL);
if (hdc == NULL)
- return FALSE;
+ {
+ ErrorF ("winAdjustVideoModePrimaryDD () - GetDC failed\n");
+ return FALSE;
+ }
/* Query GDI for current display depth */
dwDepth = GetDeviceCaps (hdc, BITSPIXEL);
@@ -378,7 +392,88 @@ winAdjustVideoModePrimaryDD (ScreenPtr pScreen)
}
/* Release our DC */
- ReleaseDC ((HDC) hdc, NULL);
+ ReleaseDC (NULL, hdc);
+
+ return TRUE;
+}
+
+Bool
+winActivateAppPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcSrc, rcClient;
+ HRESULT ddrval = DD_OK;
+
+ /*
+ * We need to blit our offscreen fb to
+ * the screen when we are activated, and we need to point
+ * the fb code back to the primary surface memory.
+ */
+ if (pScreenPriv != NULL
+ && pScreenPriv->pddsPrimary != NULL
+ && pScreenPriv->pddsOffscreen != NULL
+ && pScreenPriv->fActive)
+ {
+ /* We are activating */
+ ddrval = IDirectDrawSurface_IsLost (pScreenPriv->pddsOffscreen);
+ if (ddrval == DD_OK)
+ {
+ IDirectDrawSurface_Unlock (pScreenPriv->pddsOffscreen,
+ NULL);
+ /*
+ * We don't check for an error from Unlock, because it
+ * doesn't matter if the Unlock failed.
+ */
+ }
+
+ /* Restore both surfaces, just cause I like it that way */
+ IDirectDrawSurface_Restore (pScreenPriv->pddsOffscreen);
+ IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary);
+
+ /* Get client area in screen coords */
+ GetClientRect (pScreenPriv->hwndScreen, &rcClient);
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&rcClient, 2);
+
+ /* Setup a source rectangle */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary,
+ &rcClient,
+ pScreenPriv->pddsOffscreen,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ FatalError ("winWindowProc () - Failed blitting offscreen "\
+ "surface to primary surface %08x\n", ddrval);
+
+ /* Lock the primary surface */
+ ddrval = IDirectDrawSurface_Lock (pScreenPriv->pddsPrimary,
+ &rcClient,
+ pScreenPriv->pddsdPrimary,
+ DDLOCK_WAIT,
+ NULL);
+ if (ddrval != DD_OK
+ || pScreenPriv->pddsdPrimary->lpSurface == NULL)
+ FatalError ("winWindowProc () - Could not lock "\
+ "primary surface\n");
+
+ /* Notify FB of the new memory pointer */
+ winUpdateFBPointer (pScreen,
+ pScreenPriv->pddsdPrimary->lpSurface);
+
+ /*
+ * Register the Alt-Tab combo as a hotkey so we can copy
+ * the primary framebuffer before the display mode changes
+ */
+ RegisterHotKey (pScreenPriv->hwndScreen, 1, MOD_ALT, 9);
+ }
return TRUE;
}
@@ -404,6 +499,9 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen)
else
pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions
+ = (winBltExposedRegionsProcPtr) (void (*)())NoopDDA;
+ pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD;
return TRUE;
}
diff --git a/xc/programs/Xserver/hw/xwin/winpixmap.c b/xc/programs/Xserver/hw/xwin/winpixmap.c
index 9b008a514..b753f3c1a 100644
--- a/xc/programs/Xserver/hw/xwin/winpixmap.c
+++ b/xc/programs/Xserver/hw/xwin/winpixmap.c
@@ -28,7 +28,7 @@
* Authors: drewry, september 1986
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winpixmap.c,v 1.1 2001/04/05 20:13:50 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winpixmap.c,v 1.3 2001/05/02 00:45:26 alanh Exp $ */
#include "win.h"
@@ -116,7 +116,7 @@ winDestroyPixmapNativeGDI (PixmapPtr pPixmap)
HBITMAP hBitmap;
fprintf (stderr, "winDestroyPixmap - pPixmap->devPrivate.ptr: %08x\n",
- pPixmap->devPrivate.ptr);
+ (UINT) pPixmap->devPrivate.ptr);
/* Decrement reference count, and, if zero, free the pixmap */
--(pPixmap->refcnt);
diff --git a/xc/programs/Xserver/hw/xwin/winscrinit.c b/xc/programs/Xserver/hw/xwin/winscrinit.c
index b29de0ba4..32bc0de2f 100644
--- a/xc/programs/Xserver/hw/xwin/winscrinit.c
+++ b/xc/programs/Xserver/hw/xwin/winscrinit.c
@@ -30,7 +30,7 @@
* Peter Busch
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winscrinit.c,v 1.3 2001/04/22 19:52:36 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winscrinit.c,v 1.7 2001/05/14 16:52:33 alanh Exp $ */
#include "win.h"
@@ -65,18 +65,18 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen)
RegisterClass (&wc);
/* Create the window */
- *phwnd = CreateWindowExA (WS_EX_TOPMOST, // Extended styles
- WINDOW_CLASS, // Class name
- WINDOW_TITLE, // Window name
+ *phwnd = CreateWindowExA (WS_EX_TOPMOST, /* Extended styles */
+ WINDOW_CLASS, /* Class name */
+ WINDOW_TITLE, /* Window name */
WS_POPUP,
- 0, // Horizontal position
- 0, // Vertical position
- iWidth, // Right edge
- iHeight, // Bottom edge
- (HWND) NULL, // No parent or owner window
- (HMENU) NULL, // No menu
- GetModuleHandle (NULL),// Instance handle
- pScreenPriv); // ScreenPrivates
+ 0, /* Horizontal position */
+ 0, /* Vertical position */
+ iWidth, /* Right edge */
+ iHeight, /* Bottom edge */
+ (HWND) NULL, /* No parent or owner window */
+ (HMENU) NULL, /* No menu */
+ GetModuleHandle (NULL),/* Instance handle */
+ pScreenPriv); /* ScreenPrivates */
/* Branch on the server engine */
switch (pScreenInfo->dwEngine)
@@ -151,13 +151,14 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
/* Trim window height to fit work area */
if (iHeight >= (rcWorkArea.bottom - rcWorkArea.top))
{
- /* FIXME: Currently chopping 1 off the maximum height
- to allow hidden start bars to pop up when the mouse
- reaches the bottom of the screen.
-
- This only works if the start menu is at the bottom
- of the screen.
- */
+ /*
+ * FIXME: Currently chopping 1 off the maximum height
+ * to allow hidden start bars to pop up when the mouse
+ * reaches the bottom of the screen.
+ *
+ * This only works if the start menu is at the bottom
+ * of the screen.
+ */
iHeight = rcWorkArea.bottom - rcWorkArea.top - 1;
pScreenInfo->dwHeight = iHeight
- 2 * GetSystemMetrics (SM_CYFIXEDFRAME)
@@ -171,21 +172,21 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
#endif
/* Create the window */
- *phwnd = CreateWindowExA (0, // Extended styles
- WINDOW_CLASS, // Class name
- WINDOW_TITLE, // Window name
+ *phwnd = CreateWindowExA (0, /* Extended styles */
+ WINDOW_CLASS, /* Class name */
+ WINDOW_TITLE, /* Window name */
WS_OVERLAPPED
| WS_CAPTION
| WS_SYSMENU
- | WS_MINIMIZEBOX, // Almost an OverlappedWindow
- 0, // Horizontal position
- 0, // Vertical position
- iWidth, // Right edge
- iHeight, // Bottom edge
- (HWND) NULL, // No parent or owner window
- (HMENU) NULL, // No menu
- GetModuleHandle (NULL),// Instance handle
- pScreenPriv); // ScreenPrivates
+ | WS_MINIMIZEBOX, /* Almost an OverlappedWindow */
+ 0, /* Horizontal position */
+ 0, /* Vertical position */
+ iWidth, /* Right edge */
+ iHeight, /* Bottom edge */
+ (HWND) NULL, /* No parent or owner window */
+ (HMENU) NULL, /* No menu */
+ GetModuleHandle (NULL),/* Instance handle */
+ pScreenPriv); /* ScreenPrivates */
/* Get the client area coordinates */
GetClientRect (*phwnd, &rcClient);
@@ -204,10 +205,10 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
}
/*
- Determine what type of screen we are initializing
- and call the appropriate procedure to intiailize
- that type of screen.
-*/
+ * Determine what type of screen we are initializing
+ * and call the appropriate procedure to intiailize
+ * that type of screen.
+ */
Bool
winScreenInit (int index,
ScreenPtr pScreen,
@@ -234,15 +235,24 @@ winScreenInit (int index,
/* Determine which engine to use */
if (!winSetEngine (pScreen))
- return FALSE;
+ {
+ ErrorF ("winScreenInit () - winSetEngine () failed\n");
+ return FALSE;
+ }
/* Adjust the video mode for our engine type */
if (!(*pScreenPriv->pwinAdjustVideoMode) (pScreen))
- return FALSE;
+ {
+ ErrorF ("winScreenInit () - winAdjustVideoMode () failed\n");
+ return FALSE;
+ }
/* Call the engine dependent screen initialization procedure */
if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv)))
- return FALSE;
+ {
+ ErrorF ("winScreenInit () - winFinishScreenInit () failed\n");
+ return FALSE;
+ }
return TRUE;
}
@@ -293,7 +303,8 @@ winFinishScreenInitFB (int index,
/* Setup a local variable to point to the framebuffer */
pbits = pScreenInfo->pfb;
-
+
+ /* Apparently we need this for the render extension */
miSetPixmapDepths ();
/* Initialize the fb code */
@@ -337,11 +348,12 @@ winFinishScreenInitFB (int index,
pScreenPriv->pwinShadowWindow);
}
- /* Register our block and wakeup handlers; these procedures
- process messages in our Windows message queue; specifically,
- they process mouse and keyboard input.
- */
- RegisterBlockAndWakeupHandlers ((BlockHandlerProcPtr)NoopDDA,
+ /*
+ * Register our block and wakeup handlers; these procedures
+ * process messages in our Windows message queue; specifically,
+ * they process mouse and keyboard input.
+ */
+ RegisterBlockAndWakeupHandlers (winBlockHandler,
winWakeupHandler,
pScreen);
@@ -360,9 +372,10 @@ winFinishScreenInitFB (int index,
return fReturn;
}
-/* Detect engines supported by current Windows version
- DirectDraw version and hardware
-*/
+/*
+ * Detect engines supported by current Windows version
+ * DirectDraw version and hardware
+ */
Bool
winDetectSupportedEngines (ScreenPtr pScreen)
{
@@ -469,10 +482,11 @@ winDetectSupportedEngines (ScreenPtr pScreen)
return TRUE;
}
-/* Set the engine type, depending on the engines
- supported for this screen, and whether the user
- suggested an engine type
-*/
+/*
+ * Set the engine type, depending on the engines
+ * supported for this screen, and whether the user
+ * suggested an engine type
+ */
Bool
winSetEngine (ScreenPtr pScreen)
{
@@ -578,14 +592,17 @@ winFinishScreenInitNativeGDI (int index,
char *pbits = NULL;
VisualPtr pVisuals = NULL;
DepthPtr pDepths = NULL;
- VisualID rootVisual;
- int nVisuals, nDepths, nRootDepth = 0;
+ VisualID rootVisual = 0;
+ int nVisuals = 0, nDepths = 0, nRootDepth = 0;
winPrivScreenPtr pScreenPriv = NULL;
- fprintf (stderr, "winScreenInit ()\n");
+ ErrorF ("winScreenInit ()\n");
if (!winAllocatePrivates (pScreen))
- return FALSE;
+ {
+ ErrorF ("winFinishScreenInitNativeGDI () winAllocatePrivates failed\n");
+ return FALSE;
+ }
/* Get a pointer to the privates structure that was allocated */
pScreenPriv = winGetScreenPriv (pScreen);
@@ -728,9 +745,10 @@ winFinishScreenInitNativeGDI (int index,
pScreen->MarkUnrealizedWindow = miMarkUnrealizedWindow;
/* GC Handling Routines */
- /* All other GC handling routines are pointed to through
- pScreen->gcfuncs
- */
+ /*
+ * All other GC handling routines are pointed to through
+ * pScreen->gcfuncs
+ */
/* See Porting Layer Definition pp. 43-46 */
pScreen->CreateGC = winCreateGCNativeGDI;
@@ -771,7 +789,7 @@ winFinishScreenInitNativeGDI (int index,
miPointerSetNewScreen (pScreenInfo->dwScreen, 0, 0);
- fprintf (stderr, "winScreenInit () - calling miDCInitialize()\n");
+ ErrorF ("winScreenInit () - calling miDCInitialize()\n");
if (!miDCInitialize (pScreen, &g_winPointerCursorFuncs))
{
ErrorF ("winScreenInit () - miDCInitialize failed\n");
diff --git a/xc/programs/Xserver/hw/xwin/winshaddd.c b/xc/programs/Xserver/hw/xwin/winshaddd.c
index dc4bed83a..9735d4e9f 100644
--- a/xc/programs/Xserver/hw/xwin/winshaddd.c
+++ b/xc/programs/Xserver/hw/xwin/winshaddd.c
@@ -30,17 +30,17 @@
* Peter Busch
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winshaddd.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winshaddd.c,v 1.5 2001/05/14 16:52:33 alanh Exp $ */
#include "win.h"
/*
- Create a DirectDraw surface for the shadow framebuffer; also create
- a primary surface object so we can blit to the display.
-
- Install a DirectDraw clipper on our primary surface object
- that clips our blits to the unobscured client area of our display window.
-*/
+ * Create a DirectDraw surface for the shadow framebuffer; also create
+ * a primary surface object so we can blit to the display.
+ *
+ * Install a DirectDraw clipper on our primary surface object
+ * that clips our blits to the unobscured client area of our display window.
+ */
Bool
winAllocateFBShadowDD (ScreenPtr pScreen)
{
@@ -157,6 +157,10 @@ winAllocateFBShadowDD (ScreenPtr pScreen)
ErrorF ("winAllocateFBShadowDD () - Created primary\n");
#endif
+ /*
+ * Attach a clipper to the primary surface that will clip our blits to our
+ * display window.
+ */
ddrval = IDirectDrawSurface_SetClipper (pScreenPriv->pddsPrimary,
pScreenPriv->pddcPrimary);
if (FAILED (ddrval))
@@ -171,12 +175,12 @@ winAllocateFBShadowDD (ScreenPtr pScreen)
/* Describe the shadow surface to be created */
/* NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
- as drawing, locking, and unlocking take forever
- with video memory surfaces. In addition,
- video memory is a somewhat scarce resource,
- so you shouldn't be allocating video memory when
- you could use system memory instead.
- */
+ * as drawing, locking, and unlocking take forever
+ * with video memory surfaces. In addition,
+ * video memory is a somewhat scarce resource,
+ * so you shouldn't be allocating video memory when
+ * you have the option of using system memory instead.
+ */
ZeroMemory (&ddsd, sizeof (ddsd));
ddsd.dwSize = sizeof (ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
@@ -259,8 +263,8 @@ winAllocateFBShadowDD (ScreenPtr pScreen)
}
/*
- Transfer the damaged regions of the shadow framebuffer to the display.
-*/
+ * Transfer the damaged regions of the shadow framebuffer to the display.
+ */
void
winShadowUpdateDD (ScreenPtr pScreen,
PixmapPtr pShadow,
@@ -287,7 +291,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
if (FAILED (ddrval))
{
ErrorF ("winShadowUpdateProcDD () - Unlock failed\n");
- return FALSE;
+ return;
}
/* Loop through all boxes in the damaged region */
@@ -326,7 +330,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
if (FAILED (ddrval))
{
ErrorF ("winShadowUpdateProcDD () - Lock failed\n");
- return FALSE;
+ return;
}
/* Has our memory pointer changed? */
@@ -347,16 +351,16 @@ winShadowUpdateDD (ScreenPtr pScreen,
{
ErrorF ("winShadowUpdateProcDD () - Bits changed, could not "\
"notify fb.\n");
- return FALSE;
+ return;
}
}
}
/*
- Return a pointer to some part of the shadow framebuffer.
-
- NOTE: I have not seen this function get called, yet.
-*/
+ * Return a pointer to some part of the shadow framebuffer.
+ *
+ * NOTE: I have not seen this function get called, yet.
+ */
void *
winShadowSetWindowLinearDD (ScreenPtr pScreen,
CARD32 dwRow,
@@ -368,18 +372,20 @@ winShadowSetWindowLinearDD (ScreenPtr pScreen,
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
*pdwSize = pScreenInfo->dwPaddedWidth;
- return (CARD8 *) pScreenInfo->pfb + dwRow * pScreenInfo->dwPaddedWidth + dwOffset;
+
+ return (CARD8 *) pScreenInfo->pfb
+ + dwRow * pScreenInfo->dwPaddedWidth + dwOffset;
}
/*
- Return a pointer to some part of the shadow framebuffer.
-
- NOTE: I have not seen this function get called, yet.
-
- We call winShadowSetWindowLinearDD because there could,
- theoretically, be other framebuffer styles that
- required a different calculation.
-*/
+ * Return a pointer to some part of the shadow framebuffer.
+ *
+ * NOTE: I have not seen this function get called, yet.
+ *
+ * We call winShadowSetWindowLinearDD because there could,
+ * theoretically, be other framebuffer styles that
+ * required a different calculation.
+ */
void *
winShadowWindowDD (ScreenPtr pScreen,
CARD32 row,
@@ -391,10 +397,10 @@ winShadowWindowDD (ScreenPtr pScreen,
}
/*
- Call the wrapped CloseScreen function.
-
- Free our resources and private structures.
-*/
+ * Call the wrapped CloseScreen function.
+ *
+ * Free our resources and private structures.
+ */
Bool
winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen)
{
@@ -464,12 +470,12 @@ winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen)
}
/*
- Tell mi what sort of visuals we need.
-
- Generally we only need one visual, as our screen can only
- handle one format at a time, I believe. You may want
- to verify that last sentence.
-*/
+ * Tell mi what sort of visuals we need.
+ *
+ * Generally we only need one visual, as our screen can only
+ * handle one format at a time, I believe. You may want
+ * to verify that last sentence.
+ */
Bool
winInitVisualsShadowDD (ScreenPtr pScreen)
{
@@ -518,7 +524,10 @@ winInitVisualsShadowDD (ScreenPtr pScreen)
break;
case 8:
- ErrorF ("winInitVisuals () - Calling miSetVisualTypesAndMasks\n");
+#if CYGDEBUG
+ ErrorF ("winInitVisualsShadowDD () - Calling "\
+ "miSetVisualTypesAndMasks\n");
+#endif /* CYGDEBUG */
if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
PseudoColorMask,
pScreenPriv->dwBitsPerRGB,
@@ -531,11 +540,15 @@ winInitVisualsShadowDD (ScreenPtr pScreen)
"failed\n");
return FALSE;
}
- ErrorF ("winInitVisualsShadowDD () - Returned from miSetVisualTypesAndMasks\n");
+#if CYGDEBUG
+ ErrorF ("winInitVisualsShadowDD () - Returned from "\
+ "miSetVisualTypesAndMasks\n");
+#endif /* CYGDEBUG */
break;
default:
- break;
+ ErrorF ("winInitVisualsDD () - Unknown screen depth\n");
+ return FALSE;
}
/* Set DPI info */
@@ -565,7 +578,10 @@ winAdjustVideoModeShadowDD (ScreenPtr pScreen)
/* We're in serious trouble if we can't get a DC */
hdc = GetDC (NULL);
if (hdc == NULL)
- return FALSE;
+ {
+ ErrorF ("winAdjustVideoModeShadowDD () - GetDC () failed\n");
+ return FALSE;
+ }
/* Query GDI for current display depth */
dwDepth = GetDeviceCaps (hdc, BITSPIXEL);
@@ -582,7 +598,96 @@ winAdjustVideoModeShadowDD (ScreenPtr pScreen)
}
/* Release our DC */
- ReleaseDC ((HDC) hdc, NULL);
+ ReleaseDC (NULL, hdc);
+ return TRUE;
+}
+
+/* Blt exposed regions to the screen */
+Bool
+winBltExposedRegionsShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcClient, rcSrc;
+ HDC hdcUpdate = NULL;
+ PAINTSTRUCT ps;
+ HRESULT ddrval = DD_OK;
+ Bool fReturn = TRUE;
+
+ /* BeginPaint gives us an hdc that clips to the invalidated region */
+ hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
+
+ /* Unlock the shadow surface, so we can blit */
+ ddrval = IDirectDrawSurface_Unlock (pScreenPriv->pddsShadow, NULL);
+ if (FAILED (ddrval))
+ {
+ fReturn = FALSE;
+ goto winBltExposedRegionsShadowDD_Exit;
+ }
+
+ /* Get client area in screen coords */
+ GetClientRect (pScreenPriv->hwndScreen, &rcClient);
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&rcClient, 2);
+
+ /* Source can be enter shadow surface, as Blt should clip */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Our Blt should be clipped to the invalidated region */
+ ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary,
+ &rcClient,
+ pScreenPriv->pddsShadow,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+
+ /* Relock the shadow surface */
+ ddrval = IDirectDrawSurface_Lock (pScreenPriv->pddsShadow,
+ NULL,
+ pScreenPriv->pddsdShadow,
+ DDLOCK_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ fReturn = FALSE;
+ goto winBltExposedRegionsShadowDD_Exit;
+ }
+
+ /* Has our memory pointer changed? */
+ if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
+ winUpdateFBPointer (pScreen,
+ pScreenPriv->pddsdShadow->lpSurface);
+
+ winBltExposedRegionsShadowDD_Exit:
+ /* EndPaint frees the DC */
+ if (hdcUpdate != NULL)
+ EndPaint (pScreenPriv->hwndScreen, &ps);
+ return fReturn;
+}
+
+Bool
+winActivateAppShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ /*
+ * Do we have a surface?
+ * Are we active?
+ * Are we fullscreen?
+ */
+ if (pScreenPriv != NULL
+ && pScreenPriv->pddsPrimary != NULL
+ && pScreenPriv->fActive
+ )
+ {
+ /* Primary surface was lost, restore it */
+ IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary);
+ }
+
return TRUE;
}
@@ -605,6 +710,10 @@ winSetEngineFunctionsShadowDD (ScreenPtr pScreen)
else
pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDD;
+ pScreenPriv->pwinActivateApp = winActivateAppShadowDD;
return TRUE;
}
+
+
diff --git a/xc/programs/Xserver/hw/xwin/winshadddnl.c b/xc/programs/Xserver/hw/xwin/winshadddnl.c
index d78074654..3ef39252f 100644
--- a/xc/programs/Xserver/hw/xwin/winshadddnl.c
+++ b/xc/programs/Xserver/hw/xwin/winshadddnl.c
@@ -30,32 +30,34 @@
* Peter Busch
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winshadddnl.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winshadddnl.c,v 1.5 2001/05/14 16:52:33 alanh Exp $ */
#include "win.h"
-/* FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
- so we have to redefine it here.
-*/
+/*
+ * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
+ * so we have to redefine it here.
+ */
#ifdef DEFINE_GUID
#undef DEFINE_GUID
#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
#endif /* DEFINE_GUID */
-/* FIXME: Headers are broken, IID_IDirectDraw4 has to be defined
- here manually. Should be handled by ddraw.h
-*/
+/*
+ * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined
+ * here manually. Should be handled by ddraw.h
+ */
#ifndef IID_IDirectDraw4
DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
#endif /* IID_IDirectDraw4 */
/*
- Create a DirectDraw surface for the shadow framebuffer; also create
- a primary surface object so we can blit to the display.
-
- Install a DirectDraw clipper on our primary surface object
- that clips our blits to the unobscured client area of our display window.
-*/
+ * Create a DirectDraw surface for the shadow framebuffer; also create
+ * a primary surface object so we can blit to the display.
+ *
+ * Install a DirectDraw clipper on our primary surface object
+ * that clips our blits to the unobscured client area of our display window.
+ */
Bool
winAllocateFBShadowDDNL (ScreenPtr pScreen)
{
@@ -75,11 +77,15 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
/* Allocate memory for our shadow surface */
lpSurface = xalloc (pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight);
if (lpSurface == NULL)
- FatalError ("winAllocateFBShadowDDNL () - Could not allocate bits\n");
-
- /* Initialize the framebuffer memory so we don't get a
- strange display at startup
- */
+ {
+ ErrorF ("winAllocateFBShadowDDNL () - Could not allocate bits\n");
+ return FALSE;
+ }
+
+ /*
+ * Initialize the framebuffer memory so we don't get a
+ * strange display at startup
+ */
ZeroMemory (lpSurface, pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight);
/* Create a clipper */
@@ -113,7 +119,7 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
/* Create a DirectDraw object, store the address at lpdd */
ddrval = DirectDrawCreate (NULL,
- (void**) &pScreenPriv->pdd,
+ (LPDIRECTDRAW*) &pScreenPriv->pdd,
NULL);
if (ddrval != DD_OK)
{
@@ -186,7 +192,8 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
/* Create the primary surface */
ddrval = IDirectDraw_CreateSurface (pScreenPriv->pdd4,
- &ddsdPrimary,
+ (LPDDSURFACEDESC)&ddsdPrimary,
+ (LPDIRECTDRAWSURFACE*)
&pScreenPriv->pddsPrimary4,
NULL);
if (FAILED (ddrval))
@@ -200,6 +207,7 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
ErrorF ("winAllocateFBShadowDDNL () - Created primary\n");
#endif
+ /* Get primary surface's pixel format */
ZeroMemory (&ddpfPrimary, sizeof (ddpfPrimary));
ddpfPrimary.dwSize = sizeof (ddpfPrimary);
ddrval = IDirectDrawSurface_GetPixelFormat (pScreenPriv->pddsPrimary4,
@@ -236,13 +244,14 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
#endif
/* Describe the shadow surface to be created */
- /* NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
- as drawing, locking, and unlocking take forever
- with video memory surfaces. In addition,
- video memory is a somewhat scarce resource,
- so you shouldn't be allocating video memory when
- you could use system memory instead.
- */
+ /*
+ * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
+ * as drawing, locking, and unlocking take forever
+ * with video memory surfaces. In addition,
+ * video memory is a somewhat scarce resource,
+ * so you shouldn't be allocating video memory when
+ * you have the option of using system memory instead.
+ */
ZeroMemory (&ddsdShadow, sizeof (ddsdShadow));
ddsdShadow.dwSize = sizeof (ddsdShadow);
ddsdShadow.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH
@@ -256,7 +265,8 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
/* Create the shadow surface */
ddrval = IDirectDraw_CreateSurface (pScreenPriv->pdd4,
- &ddsdShadow,
+ (LPDDSURFACEDESC)&ddsdShadow,
+ (LPDIRECTDRAWSURFACE*)
&pScreenPriv->pddsShadow4,
NULL);
if (ddrval != DD_OK)
@@ -291,8 +301,8 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
}
/*
- Transfer the damaged regions of the shadow framebuffer to the display.
-*/
+ * Transfer the damaged regions of the shadow framebuffer to the display.
+ */
void
winShadowUpdateDDNL (ScreenPtr pScreen,
PixmapPtr pShadow,
@@ -343,10 +353,10 @@ winShadowUpdateDDNL (ScreenPtr pScreen,
}
/*
- Return a pointer to some part of the shadow framebuffer.
-
- NOTE: I have not seen this function get called, yet.
-*/
+ * Return a pointer to some part of the shadow framebuffer.
+ *
+ * NOTE: I have not seen this function get called, yet.
+ */
void *
winShadowSetWindowLinearDDNL (ScreenPtr pScreen,
CARD32 dwRow,
@@ -358,19 +368,19 @@ winShadowSetWindowLinearDDNL (ScreenPtr pScreen,
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
*pdwSize = pScreenInfo->dwPaddedWidth;
- return (CARD8 *) pScreenInfo->pfb + dwRow * pScreenInfo->dwPaddedWidth
- + dwOffset;
+ return (CARD8 *) pScreenInfo->pfb
+ + dwRow * pScreenInfo->dwPaddedWidth + dwOffset;
}
/*
- Return a pointer to some part of the shadow framebuffer.
-
- NOTE: I have not seen this function get called, yet.
-
- We call winShadowSetWindowLinearDD because there could,
- theoretically, be other framebuffer styles that
- required a different calculation.
-*/
+ * Return a pointer to some part of the shadow framebuffer.
+ *
+ * NOTE: I have not seen this function get called, yet.
+ *
+ * We call winShadowSetWindowLinearDD because there could,
+ * theoretically, be other framebuffer styles that
+ * required a different calculation.
+ */
void *
winShadowWindowDDNL (ScreenPtr pScreen,
CARD32 row,
@@ -385,10 +395,10 @@ winShadowWindowDDNL (ScreenPtr pScreen,
}
/*
- Call the wrapped CloseScreen function.
-
- Free our resources and private structures.
-*/
+ * Call the wrapped CloseScreen function.
+ *
+ * Free our resources and private structures.
+ */
Bool
winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen)
{
@@ -463,12 +473,12 @@ winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen)
}
/*
- Tell mi what sort of visuals we need.
-
- Generally we only need one visual, as our screen can only
- handle one format at a time, I believe. You may want
- to verify that last sentence.
-*/
+ * Tell mi what sort of visuals we need.
+ *
+ * Generally we only need one visual, as our screen can only
+ * handle one format at a time, I believe. You may want
+ * to verify that last sentence.
+ */
Bool
winInitVisualsShadowDDNL (ScreenPtr pScreen)
{
@@ -518,8 +528,10 @@ winInitVisualsShadowDDNL (ScreenPtr pScreen)
break;
case 8:
+#if CYGDEBUG
ErrorF ("winInitVisualsShadowDDNL () - Calling "\
"miSetVisualTypesAndMasks\n");
+#endif /* CYGDEBUG */
if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
PseudoColorMask,
pScreenPriv->dwBitsPerRGB,
@@ -535,7 +547,8 @@ winInitVisualsShadowDDNL (ScreenPtr pScreen)
break;
default:
- break;
+ ErrorF ("winInitVisualsDDNL () - Unknown screen depth\n");
+ return FALSE;
}
/* Set DPI info */
@@ -565,7 +578,10 @@ winAdjustVideoModeShadowDDNL (ScreenPtr pScreen)
/* We're in serious trouble if we can't get a DC */
hdc = GetDC (NULL);
if (hdc == NULL)
- return FALSE;
+ {
+ ErrorF ("winAdjustVideoModeShadowDDNL () - GetDC () failed\n");
+ return FALSE;
+ }
/* Query GDI for current display depth */
dwDepth = GetDeviceCaps (hdc, BITSPIXEL);
@@ -582,11 +598,72 @@ winAdjustVideoModeShadowDDNL (ScreenPtr pScreen)
}
/* Release our DC */
- ReleaseDC ((HDC) hdc, NULL);
+ ReleaseDC (NULL, hdc);
return TRUE;
}
+/* Blt exposed regions to the screen */
+Bool
+winBltExposedRegionsShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcClient, rcSrc;
+ HDC hdcUpdate;
+ PAINTSTRUCT ps;
+ HRESULT ddrval = DD_OK;
+
+ /* BeginPaint gives us an hdc that clips to the invalidated region */
+ hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
+
+ /* Get client area in screen coords */
+ GetClientRect (pScreenPriv->hwndScreen, &rcClient);
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&rcClient, 2);
+
+ /* Source can be enter shadow surface, as Blt should clip */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Our Blt should be clipped to the invalidated region */
+ ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary4,
+ &rcClient,
+ pScreenPriv->pddsShadow4,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+
+ /* EndPaint frees the DC */
+ EndPaint (pScreenPriv->hwndScreen, &ps);
+
+ return TRUE;
+}
+
+Bool
+winActivateAppShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ /*
+ * Do we have a surface?
+ * Are we active?
+ * Are we full screen?
+ */
+ if (pScreenPriv != NULL
+ && pScreenPriv->pddsPrimary4 != NULL
+ && pScreenPriv->fActive
+ )
+ {
+ /* Primary surface was lost, restore it */
+ IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary4);
+ }
+
+ return TRUE;
+}
/* Set pointers to our engine specific functions */
Bool
@@ -607,6 +684,10 @@ winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen)
else
pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDDNL;
+ pScreenPriv->pwinActivateApp = winActivateAppShadowDDNL;
return TRUE;
}
+
+
diff --git a/xc/programs/Xserver/hw/xwin/winshadgdi.c b/xc/programs/Xserver/hw/xwin/winshadgdi.c
index f16ab1037..3aac70b3b 100644
--- a/xc/programs/Xserver/hw/xwin/winshadgdi.c
+++ b/xc/programs/Xserver/hw/xwin/winshadgdi.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winshadgdi.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winshadgdi.c,v 1.6 2001/05/14 16:52:33 alanh Exp $ */
#include "win.h"
@@ -37,38 +37,61 @@ winQueryScreenDIBFormat (ScreenPtr pScreen, BITMAPINFOHEADER *pbmih)
{
winScreenPriv(pScreen);
HBITMAP hbmp;
- Bool fReturn = TRUE;
+#if CYGDEBUG
+ LPDWORD pdw = NULL;
+#endif
/* Create a memory bitmap compatible with the screen */
hbmp = CreateCompatibleBitmap (pScreenPriv->hdcScreen, 1, 1);
if (hbmp == NULL)
- return FALSE;
+ {
+ ErrorF ("winQueryScreenDIBFormat () - CreateCompatibleBitmap failed\n");
+ return FALSE;
+ }
/* Initialize our bitmap info header */
ZeroMemory (pbmih, sizeof (BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD));
pbmih->biSize = sizeof (BITMAPINFOHEADER);
/* Get the biBitCount */
- fReturn = GetDIBits (pScreenPriv->hdcScreen,
- hbmp,
- 0, 1,
- NULL,
- (BITMAPINFO*) pbmih,
- DIB_RGB_COLORS);
+ if (!GetDIBits (pScreenPriv->hdcScreen,
+ hbmp,
+ 0, 1,
+ NULL,
+ (BITMAPINFO*) pbmih,
+ DIB_RGB_COLORS))
+ {
+ ErrorF ("winQueryScreenDIBFormat () - First call to GetDIBits failed\n");
+ DeleteObject (hbmp);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ /* Get a pointer to bitfields */
+ pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER));
+
+ ErrorF ("winQueryScreenDIBFormat () - First call masks: %08x %08x %08x\n",
+ pdw[0], pdw[1], pdw[2]);
+#endif
/* Get optimal color table, or the optimal bitfields */
- if (fReturn)
- fReturn = GetDIBits (pScreenPriv->hdcScreen,
- hbmp,
- 0, 1,
- NULL,
- (BITMAPINFO*)pbmih,
- DIB_RGB_COLORS);
+ if (!GetDIBits (pScreenPriv->hdcScreen,
+ hbmp,
+ 0, 1,
+ NULL,
+ (BITMAPINFO*)pbmih,
+ DIB_RGB_COLORS))
+ {
+ ErrorF ("winQueryScreenDIBFormat () - Second call to GetDIBits "\
+ "failed\n");
+ DeleteObject (hbmp);
+ return FALSE;
+ }
/* Free memory */
DeleteObject (hbmp);
- return fReturn;
+ return TRUE;
}
static
@@ -79,19 +102,33 @@ winQueryRGBBitsAndMasks (ScreenPtr pScreen)
BITMAPINFOHEADER *pbmih = NULL;
Bool fReturn = TRUE;
LPDWORD pdw = NULL;
+ DWORD dwRedBits, dwGreenBits, dwBlueBits;
/* RGB BPP for 8 bit palletes is always 8 bits per pixel */
if (GetDeviceCaps (pScreenPriv->hdcScreen, RASTERCAPS) & RC_PALETTE)
{
+ /*
+ * FIXME: 8bpp doesn't work.
+ */
pScreenPriv->dwBitsPerRGB = 8;
+ pScreenPriv->dwRedMask = 0x0L;
+ pScreenPriv->dwGreenMask = 0x0L;
+ pScreenPriv->dwBlueMask = 0x0L;
return TRUE;
}
- /* 24bpp is easy */
+ /* Color masks for 24 bpp are standardized */
if (GetDeviceCaps (pScreenPriv->hdcScreen, PLANES)
* GetDeviceCaps (pScreenPriv->hdcScreen, BITSPIXEL) == 24)
{
+ /* 8 bits per primary color */
pScreenPriv->dwBitsPerRGB = 8;
+
+ /* Set screen privates masks */
+ pScreenPriv->dwRedMask = WIN_24BPP_MASK_RED;
+ pScreenPriv->dwGreenMask = WIN_24BPP_MASK_GREEN;
+ pScreenPriv->dwBlueMask = WIN_24BPP_MASK_BLUE;
+
return TRUE;
}
@@ -99,16 +136,22 @@ winQueryRGBBitsAndMasks (ScreenPtr pScreen)
pbmih = (BITMAPINFOHEADER*) xalloc (sizeof (BITMAPINFOHEADER)
+ 256 * sizeof (RGBQUAD));
if (pbmih == NULL)
- return FALSE;
+ {
+ ErrorF ("winQueryRGBBitsAndMasks () - xalloc failed\n");
+ return FALSE;
+ }
/* Get screen description */
if (winQueryScreenDIBFormat (pScreen, pbmih))
{
- DWORD dwRedBits, dwGreenBits, dwBlueBits;
-
/* Get a pointer to bitfields */
pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER));
+#if CYGDEBUG
+ ErrorF ("winQueryRGBBitsAndMasks () - Masks: %08x %08x %08x\n",
+ pdw[0], pdw[1], pdw[2]);
+#endif
+
/* Count the number of bits in each mask */
dwRedBits = winCountBits (pdw[0]);
dwGreenBits = winCountBits (pdw[1]);
@@ -129,6 +172,8 @@ winQueryRGBBitsAndMasks (ScreenPtr pScreen)
}
else
{
+ ErrorF ("winQueryRGBBitsAndMasks () - winQueryScreenDIBFormat failed\n");
+ xfree (pbmih);
fReturn = FALSE;
}
@@ -156,7 +201,10 @@ winAllocateFBShadowGDI (ScreenPtr pScreen)
pbmih = (BITMAPINFOHEADER*) xalloc (sizeof (BITMAPINFOHEADER)
+ 256 * sizeof (RGBQUAD));
if (pbmih == NULL)
- return FALSE;
+ {
+ ErrorF ("winAllocateFBShadowGDI - xalloc () failed\n");
+ return FALSE;
+ }
/* Query the screen format */
fReturn = winQueryScreenDIBFormat (pScreen, pbmih);
@@ -173,7 +221,10 @@ winAllocateFBShadowGDI (ScreenPtr pScreen)
NULL,
0);
if (pScreenPriv->hbmpShadow == NULL || pScreenInfo->pfb == NULL)
- return FALSE;
+ {
+ ErrorF ("winAllocateFBShadowGDI () - CreateDIBSection failed\n");
+ return FALSE;
+ }
else
{
#if CYGDEBUG
@@ -199,16 +250,23 @@ winAllocateFBShadowGDI (ScreenPtr pScreen)
ErrorF ("winAllocateFBShadowGDI () - Attempting a shadow blit\n");
#endif
- BitBlt (pScreenPriv->hdcScreen,
- 0, 0,
- pScreenInfo->dwWidth, pScreenInfo->dwHeight,
- pScreenPriv->hdcShadow,
- 0, 0,
- SRCCOPY);
-
+ fReturn = BitBlt (pScreenPriv->hdcScreen,
+ 0, 0,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ pScreenPriv->hdcShadow,
+ 0, 0,
+ SRCCOPY);
+ if (fReturn)
+ {
#if CYGDEBUG
- ErrorF ("winAllocateFBShadowGDI () - Shadow blit success\n");
+ ErrorF ("winAllocateFBShadowGDI () - Shadow blit success\n");
#endif
+ }
+ else
+ {
+ ErrorF ("winAllocateFBShadowGDI () - Shadow blit failure\n");
+ return FALSE;
+ }
/* Set screeninfo stride */
pScreenInfo->dwStrideBytes = pScreenInfo->dwPaddedWidth;
@@ -267,7 +325,8 @@ winShadowSetWindowLinearGDI (ScreenPtr pScreen,
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
*pdwSize = pScreenInfo->dwPaddedWidth;
- return (CARD8 *) pScreenInfo->pfb + dwRow * pScreenInfo->dwPaddedWidth + dwOffset;
+ return (CARD8 *) pScreenInfo->pfb
+ + dwRow * pScreenInfo->dwPaddedWidth + dwOffset;
}
void *
@@ -380,7 +439,9 @@ winInitVisualsShadowGDI (ScreenPtr pScreen)
break;
case 8:
+#if CYGDEBUG
ErrorF ("winInitVisualsGDI () - Calling miSetVisualTypesAndMasks\n");
+#endif /* CYGDEBUG */
if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
PseudoColorMask,
pScreenPriv->dwBitsPerRGB,
@@ -420,12 +481,17 @@ winAdjustVideoModeShadowGDI (ScreenPtr pScreen)
{
winScreenPriv(pScreen);
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- HDC hdc = GetDC (NULL);
+ HDC hdc;
DWORD dwDepth;
+ hdc = GetDC (NULL);
+
/* We're in serious trouble if we can't get a DC */
if (hdc == NULL)
- return FALSE;
+ {
+ ErrorF ("winAdjustVideoModeShadowGDI () - GetDC () failed\n");
+ return FALSE;
+ }
/* Query GDI for current display depth */
dwDepth = GetDeviceCaps (hdc, BITSPIXEL);
@@ -442,8 +508,73 @@ winAdjustVideoModeShadowGDI (ScreenPtr pScreen)
}
/* Release our DC */
- ReleaseDC (hdc, NULL);
-
+ ReleaseDC (NULL, hdc);
+
+ return TRUE;
+}
+
+/* Blt exposed regions to the screen */
+Bool
+winBltExposedRegionsShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HDC hdcUpdate;
+ PAINTSTRUCT ps;
+
+ /* BeginPaint gives us an hdc that clips to the invalidated region */
+ hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
+
+ /* Our BitBlt will be clipped to the invalidated region */
+ BitBlt (hdcUpdate,
+ 0, 0,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ pScreenPriv->hdcShadow,
+ 0, 0,
+ SRCCOPY);
+
+ /* EndPaint frees the DC */
+ EndPaint (pScreenPriv->hwndScreen, &ps);
+
+ return TRUE;
+}
+
+Bool
+winActivateAppShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /*
+ * Are we active?
+ * Are we fullscreen?
+ */
+ if (pScreenPriv != NULL
+ && pScreenPriv->fActive
+ && pScreenInfo->fFullScreen)
+ {
+ /*
+ * Activating, attempt to bring our window
+ * to the top of the display
+ */
+ ShowWindow (pScreenPriv->hwndScreen, SW_RESTORE);
+ }
+
+ /*
+ * Are we inactive?
+ * Are we fullscreen?
+ */
+ if (pScreenPriv != NULL
+ && !pScreenPriv->fActive
+ && pScreenInfo->fFullScreen)
+ {
+ /*
+ * Deactivating, stuff our window onto the
+ * task bar.
+ */
+ ShowWindow (pScreenPriv->hwndScreen, SW_MINIMIZE);
+ }
+
return TRUE;
}
@@ -466,6 +597,8 @@ winSetEngineFunctionsShadowGDI (ScreenPtr pScreen)
else
pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowGDI;
+ pScreenPriv->pwinActivateApp = winActivateAppShadowGDI;
return TRUE;
}
diff --git a/xc/programs/Xserver/hw/xwin/winwakeup.c b/xc/programs/Xserver/hw/xwin/winwakeup.c
index b026f3bcb..09a264418 100644
--- a/xc/programs/Xserver/hw/xwin/winwakeup.c
+++ b/xc/programs/Xserver/hw/xwin/winwakeup.c
@@ -30,7 +30,7 @@
* Peter Busch
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winwakeup.c,v 1.2 2001/04/18 17:14:07 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winwakeup.c,v 1.3 2001/05/02 00:45:26 alanh Exp $ */
#include "win.h"
@@ -43,6 +43,7 @@ winWakeupHandler (pointer pWakeupData,
winScreenPriv((ScreenPtr)pWakeupData);
MSG msg;
+ /* Process all message on our queue */
while (PeekMessage (&msg, pScreenPriv->hwndScreen, 0, 0, PM_REMOVE))
{
DispatchMessage (&msg);
diff --git a/xc/programs/Xserver/hw/xwin/winwndproc.c b/xc/programs/Xserver/hw/xwin/winwndproc.c
index 35fb5369c..2e7f31f0f 100644
--- a/xc/programs/Xserver/hw/xwin/winwndproc.c
+++ b/xc/programs/Xserver/hw/xwin/winwndproc.c
@@ -30,12 +30,13 @@
* Peter Busch
* Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winwndproc.c,v 1.2 2001/04/18 17:14:07 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winwndproc.c,v 1.4 2001/05/08 08:14:09 alanh Exp $ */
#include "win.h"
-/* Called by the WakeupHandler
- * Processes and/or dispatches Windows messages
+/*
+ * Called by winWakeupHandler
+ * Processes current Windows message
*/
LRESULT CALLBACK
winWindowProc (HWND hWnd, UINT message,
@@ -45,9 +46,6 @@ winWindowProc (HWND hWnd, UINT message,
winScreenInfo *pScreenInfo = NULL;
ScreenPtr pScreen = NULL;
xEvent xCurrentEvent;
- int iDeltaZ;
- HDC hdcUpdate;
- PAINTSTRUCT ps;
LPCREATESTRUCT pcs;
HRESULT ddrval;
RECT rcClient, rcSrc;
@@ -68,14 +66,15 @@ winWindowProc (HWND hWnd, UINT message,
switch (message)
{
case WM_CREATE:
- /* Add a property to our display window that references
- this screens' privates.
-
- This allows the window procedure to refer to the
- appropriate window DC and shadow DC for the window that
- it is processing. We use this to repaint exposed
- areas of our display window.
- */
+ /*
+ * Add a property to our display window that references
+ * this screens' privates.
+ *
+ * This allows the window procedure to refer to the
+ * appropriate window DC and shadow DC for the window that
+ * it is processing. We use this to repaint exposed
+ * areas of our display window.
+ */
pcs = (LPCREATESTRUCT) lParam;
pScreenPriv = pcs->lpCreateParams;
pScreen = pScreenPriv->pScreenInfo->pScreen;
@@ -97,101 +96,8 @@ winWindowProc (HWND hWnd, UINT message,
break;
}
- /* BeginPaint gives us an hdc that clips to the invalidated region */
- hdcUpdate = BeginPaint (hWnd, &ps);
-
- /* Branch on server style */
- switch (pScreenInfo->dwEngine)
- {
- case WIN_SERVER_SHADOW_GDI:
- /* Our BitBlt will be clipped to the invalidated region */
- BitBlt (hdcUpdate,
- 0, 0,
- pScreenInfo->dwWidth, pScreenInfo->dwHeight,
- pScreenPriv->hdcShadow,
- 0, 0,
- SRCCOPY);
- break;
-
- case WIN_SERVER_SHADOW_DD:
- /* Unlock the shadow surface, so we can blit */
- ddrval = IDirectDrawSurface_Unlock (pScreenPriv->pddsShadow, NULL);
- if (FAILED (ddrval))
- FatalError ("winWindowProc () - DD unlock failed\n");
-
- /* Get client area in screen coords */
- GetClientRect (pScreenPriv->hwndScreen, &rcClient);
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&rcClient, 2);
-
- /* Source can be enter shadow surface, as Blt should clip */
- rcSrc.left = 0;
- rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
-
- /* Our Blt should be clipped to the invalidated region */
- ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary,
- &rcClient,
- pScreenPriv->pddsShadow,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
-
- /* Relock the shadow surface */
- ddrval = IDirectDrawSurface_Lock (pScreenPriv->pddsShadow,
- NULL,
- pScreenPriv->pddsdShadow,
- DDLOCK_WAIT,
- NULL);
- if (FAILED (ddrval))
- FatalError ("winWindowProc () - DD lock failed\n");
-
- /* Has our memory pointer changed? */
- if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
- winUpdateFBPointer (pScreen,
- pScreenPriv->pddsdShadow->lpSurface);
- break;
-
- case WIN_SERVER_SHADOW_DDNL:
- /* Get client area in screen coords */
- GetClientRect (pScreenPriv->hwndScreen, &rcClient);
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&rcClient, 2);
-
- /* Source can be enter shadow surface, as Blt should clip */
- rcSrc.left = 0;
- rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
-
- /* Our Blt should be clipped to the invalidated region */
- ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary4,
- &rcClient,
- pScreenPriv->pddsShadow4,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
- break;
-
- case WIN_SERVER_PRIMARY_DD:
- /* FIXME: We only run in fullscreen mode with primary fb
- DirectDraw server.
-
- We'll have to hand roll the clipping for windowed mode;
- the performance of the primary fb server is so bad
- that it probably wouldn't be worth the effort to write
- the clipping code.
- */
- break;
- default:
- FatalError ("winWindowProc () - WM_PAINT - Unknown engine type\n");
- }
-
- /* EndPaint frees the DC */
- EndPaint (hWnd, &ps);
+ /* Call the engine dependent repainter */
+ (*pScreenPriv->pwinBltExposedRegions) (pScreen);
return 0;
case WM_MOUSEMOVE:
@@ -218,7 +124,7 @@ winWindowProc (HWND hWnd, UINT message,
/* Deliver absolute cursor position to X Server */
miPointerAbsoluteCursor (GET_X_LPARAM(lParam),
GET_Y_LPARAM(lParam),
- GetTickCount ());
+ g_c32LastInputEventTime = GetTickCount ());
return 0;
case WM_NCMOUSEMOVE:
@@ -232,147 +138,66 @@ winWindowProc (HWND hWnd, UINT message,
case WM_LBUTTONDBLCLK:
case WM_LBUTTONDOWN:
- xCurrentEvent.u.u.type = ButtonPress;
- xCurrentEvent.u.u.detail = Button1;
- xCurrentEvent.u.keyButtonPointer.time = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
- return 0;
-
+ return winMouseButtonsHandle (pScreen, ButtonPress, Button1, wParam);
+
case WM_LBUTTONUP:
- xCurrentEvent.u.u.type = ButtonRelease;
- xCurrentEvent.u.u.detail = Button1;
- xCurrentEvent.u.keyButtonPointer.time = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
- return 0;
+ return winMouseButtonsHandle (pScreen, ButtonRelease, Button1, wParam);
case WM_MBUTTONDBLCLK:
case WM_MBUTTONDOWN:
- xCurrentEvent.u.u.type = ButtonPress;
- xCurrentEvent.u.u.detail = Button2;
- xCurrentEvent.u.keyButtonPointer.time = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
- return 0;
-
+ return winMouseButtonsHandle (pScreen, ButtonPress, Button2, wParam);
+
case WM_MBUTTONUP:
- xCurrentEvent.u.u.type = ButtonRelease;
- xCurrentEvent.u.u.detail = Button2;
- xCurrentEvent.u.keyButtonPointer.time = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
- return 0;
-
+ return winMouseButtonsHandle (pScreen, ButtonRelease, Button2, wParam);
+
case WM_RBUTTONDBLCLK:
case WM_RBUTTONDOWN:
- xCurrentEvent.u.u.type = ButtonPress;
- xCurrentEvent.u.u.detail = Button3;
- xCurrentEvent.u.keyButtonPointer.time = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
- return 0;
-
+ return winMouseButtonsHandle (pScreen, ButtonPress, Button3, wParam);
+
case WM_RBUTTONUP:
- xCurrentEvent.u.u.type = ButtonRelease;
- xCurrentEvent.u.u.detail = Button3;
- xCurrentEvent.u.keyButtonPointer.time = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
- return 0;
-
- case WM_MOUSEWHEEL:
- /* Button4 = WheelUp */
- /* Button5 = WheelDown */
-
- /* Find out how far the wheel has moved */
- iDeltaZ = GET_WHEEL_DELTA_WPARAM(wParam);
-
- /* Do we have any previous delta stored? */
- if ((pScreenPriv->iDeltaZ > 0
- && iDeltaZ > 0)
- || (pScreenPriv->iDeltaZ < 0
- && iDeltaZ < 0))
- {
- /* Previous delta and of same sign as current delta */
- iDeltaZ += pScreenPriv->iDeltaZ;
- pScreenPriv->iDeltaZ = 0;
- }
- else
- {
- /* Previous delta of different sign, or zero.
- We will set it to zero for either case,
- as blindly setting takes just as much time
- as checking, then setting if necessary :) */
- pScreenPriv->iDeltaZ = 0;
- }
-
- /*
- Only process this message if the wheel has moved further than
- WHEEL_DELTA
- */
- if (iDeltaZ >= WHEEL_DELTA || (-1 * iDeltaZ) >= WHEEL_DELTA)
- {
- pScreenPriv->iDeltaZ = 0;
-
- /* Figure out how many whole deltas of the wheel we have */
- iDeltaZ /= WHEEL_DELTA;
- }
- else
- {
- /*
- Wheel has not moved past WHEEL_DELTA threshold;
- we will store the wheel delta until the threshold
- has been reached.
- */
- pScreenPriv->iDeltaZ = iDeltaZ;
- return 0;
- }
+ return winMouseButtonsHandle (pScreen, ButtonRelease, Button3, wParam);
- /* Set the button to indicate up or down wheel delta */
- if (iDeltaZ > 0)
+ case WM_TIMER:
+ switch (wParam)
{
- xCurrentEvent.u.u.detail = Button4;
- }
- else
- {
- xCurrentEvent.u.u.detail = Button5;
- }
+ case WIN_E3B_TIMER_ID:
+ /* Send delayed button press */
+ winMouseButtonsSendEvent (ButtonPress,
+ pScreenPriv->iE3BCachedPress);
- /*
- Flip iDeltaZ to positive, if negative,
- because always need to generate a *positive* number of
- button clicks for the Z axis.
- */
- if (iDeltaZ < 0)
- {
- iDeltaZ *= -1;
- }
+ /* Kill this timer */
+ KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
- /* Generate X input messages for each wheel delta we have seen */
- while (iDeltaZ--)
- {
- /* Push the wheel button */
- xCurrentEvent.u.u.type = ButtonPress;
- xCurrentEvent.u.keyButtonPointer.time = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
-
- /* Release the wheel button */
- xCurrentEvent.u.u.type = ButtonRelease;
- xCurrentEvent.u.keyButtonPointer.time = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
+ /* Clear screen privates flags */
+ pScreenPriv->iE3BCachedPress = 0;
+ break;
}
return 0;
+ case WM_MOUSEWHEEL:
+ return winMouseWheel (pScreen, GET_WHEEL_DELTA_WPARAM(wParam));
+
case WM_SYSKEYDOWN:
case WM_KEYDOWN:
+ if (winIsFakeCtrl_L (message, wParam, lParam))
+ return 0;
winTranslateKey (wParam, lParam, &iScanCode);
xCurrentEvent.u.u.type = KeyPress;
xCurrentEvent.u.u.detail = iScanCode;
- xCurrentEvent.u.keyButtonPointer.time = GetTickCount ();
+ xCurrentEvent.u.keyButtonPointer.time
+ = g_c32LastInputEventTime = GetTickCount ();
mieqEnqueue (&xCurrentEvent);
return 0;
case WM_SYSKEYUP:
case WM_KEYUP:
+ if (winIsFakeCtrl_L (message, wParam, lParam))
+ return 0;
winTranslateKey (wParam, lParam, &iScanCode);
xCurrentEvent.u.u.type = KeyRelease;
xCurrentEvent.u.u.detail = iScanCode;
- xCurrentEvent.u.keyButtonPointer.time = GetTickCount ();
+ xCurrentEvent.u.keyButtonPointer.time
+ = g_c32LastInputEventTime = GetTickCount ();
mieqEnqueue (&xCurrentEvent);
return 0;
@@ -387,10 +212,11 @@ winWindowProc (HWND hWnd, UINT message,
/* Alt+Tab was pressed, we will lose focus very soon */
pScreenPriv->fActive = FALSE;
- /* We need to save the primary fb to an offscreen fb when
- we get deactivated, and point the fb code at the offscreen
- fb for the duration of the deactivation.
- */
+ /*
+ * We need to save the primary fb to an offscreen fb when
+ * we get deactivated, and point the fb code at the offscreen
+ * fb for the duration of the deactivation.
+ */
if (pScreenPriv != NULL
&& pScreenPriv->pddsPrimary != NULL
&& pScreenPriv->pddsPrimary != NULL)
@@ -473,15 +299,20 @@ winWindowProc (HWND hWnd, UINT message,
break;
case WM_ACTIVATE:
- /* Focus is being changed to another window.
- The other window may or may not belong to
- our process.
- */
+ /*
+ * Focus is being changed to another window.
+ * The other window may or may not belong to
+ * our process.
+ */
/* We can't do anything if we don't have screen privates */
if (pScreenPriv == NULL)
break;
+ /* Clear any lingering wheel delta */
+ pScreenPriv->iDeltaZ = 0;
+
+ /* Activating or deactivating? */
if (LOWORD (wParam) == WA_ACTIVE || LOWORD (wParam) == WA_CLICKACTIVE)
{
/* Restore the state of all mode keys */
@@ -492,9 +323,9 @@ winWindowProc (HWND hWnd, UINT message,
&& pScreen != miPointerCurrentScreen ())
{
/*
- Tell mi that we are changing the screen that receives
- mouse input events.
- */
+ * Tell mi that we are changing the screen that receives
+ * mouse input events.
+ */
miPointerSetNewScreen (pScreenInfo->dwScreen,
0, 0);
}
@@ -547,147 +378,8 @@ winWindowProc (HWND hWnd, UINT message,
ShowCursor (TRUE);
}
- /* Handle activation/deactivation for each engine */
- switch (pScreenInfo->dwEngine)
- {
- case WIN_SERVER_SHADOW_GDI:
- /*
- Are we active?
- Are we fullscreen?
- */
- if (pScreenPriv != NULL
- && pScreenPriv->fActive
- && pScreenInfo->fFullScreen)
- {
- /*
- Activating, attempt to bring our window
- to the top of the display
- */
- ShowWindow (hWnd, SW_RESTORE);
- }
-
- /*
- Are we inactive?
- Are we fullscreen?
- */
- if (pScreenPriv != NULL
- && !pScreenPriv->fActive
- && pScreenInfo->fFullScreen)
- {
- /* Deactivating, stuff our window onto the
- task bar.
- */
- ShowWindow (hWnd, SW_MINIMIZE);
- }
- break;
-
- case WIN_SERVER_SHADOW_DD:
- /*
- Do we have a surface?
- Are we active?
- Are we fullscreen?
- */
- if (pScreenPriv != NULL
- && pScreenPriv->pddsPrimary != NULL
- && pScreenPriv->fActive
- //&& pScreenInfo->fFullScreen
- )
- {
- /* Primary surface was lost, restore it */
- IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary);
- }
- break;
-
- case WIN_SERVER_SHADOW_DDNL:
- /*
- Do we have a surface?
- Are we active?
- Are we full screen?
- */
- if (pScreenPriv != NULL
- && pScreenPriv->pddsPrimary4 != NULL
- && pScreenPriv->fActive
- //&& pScreenInfo->fFullScreen
- )
- {
- /* Primary surface was lost, restore it */
- IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary4);
- }
- break;
-
- case WIN_SERVER_PRIMARY_DD:
- /* We need to blit our offscreen fb to
- the screen when we are activated, and we need to point
- the fb code back to the primary surface memory.
- */
- if (pScreenPriv != NULL
- && pScreenPriv->pddsPrimary != NULL
- && pScreenPriv->pddsOffscreen != NULL
- && pScreenPriv->fActive)
- {
- /* We are activating */
- ddrval = IDirectDrawSurface_IsLost (pScreenPriv->pddsOffscreen);
- if (ddrval == DD_OK)
- {
- ddrval = IDirectDrawSurface_Unlock (pScreenPriv->pddsOffscreen,
- NULL);
-#if 0
- if (FAILED (ddrval))
- FatalError ("winWindowProc () - Failed unlocking "\
- "offscreen surface %08x\n", ddrval);
-#endif
- }
-
- /* Restore both surfaces, just cause I like it that way */
- IDirectDrawSurface_Restore (pScreenPriv->pddsOffscreen);
- IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary);
-
- /* Get client area in screen coords */
- GetClientRect (pScreenPriv->hwndScreen, &rcClient);
- MapWindowPoints (pScreenPriv->hwndScreen,
- HWND_DESKTOP,
- (LPPOINT)&rcClient, 2);
-
- /* Setup a source rectangle */
- rcSrc.left = 0;
- rcSrc.top = 0;
- rcSrc.right = pScreenInfo->dwWidth;
- rcSrc.bottom = pScreenInfo->dwHeight;
-
- ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary,
- &rcClient,
- pScreenPriv->pddsOffscreen,
- &rcSrc,
- DDBLT_WAIT,
- NULL);
- if (FAILED (ddrval))
- FatalError ("winWindowProc () - Failed blitting offscreen "\
- "surface to primary surface %08x\n", ddrval);
-
- /* Lock the primary surface */
- ddrval = IDirectDrawSurface_Lock (pScreenPriv->pddsPrimary,
- &rcClient,
- pScreenPriv->pddsdPrimary,
- DDLOCK_WAIT,
- NULL);
- if (ddrval != DD_OK
- || pScreenPriv->pddsdPrimary->lpSurface == NULL)
- FatalError ("winWindowProc () - Could not lock "\
- "primary surface\n");
-
- /* Notify FB of the new memory pointer */
- winUpdateFBPointer (pScreen,
- pScreenPriv->pddsdPrimary->lpSurface);
-
- /* Register the Alt-Tab combo as a hotkey so we can copy
- the primary framebuffer before the display mode changes
- */
- RegisterHotKey (hWnd, 1, MOD_ALT, 9);
- }
- break;
- default:
- FatalError ("winWindowProc () - WM_ACTIVATEAPP - Unknown engine\n");
- }
+ /* Call engine specific screen activation/deactivation function */
+ (*pScreenPriv->pwinActivateApp) (pScreen);
return 0;
case WM_CLOSE:
diff --git a/xc/programs/Xserver/include/misc.h b/xc/programs/Xserver/include/misc.h
index be72c472b..ba020ea9d 100644
--- a/xc/programs/Xserver/include/misc.h
+++ b/xc/programs/Xserver/include/misc.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/include/misc.h,v 3.25 2001/01/17 22:36:57 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/include/misc.h,v 3.26 2001/05/06 06:28:46 alanh Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -182,11 +182,6 @@ typedef struct _xReq *xReqPtr;
* #include'ing it later.
*/
-#ifdef __CYGWIN__
-/* needed to avoid INFINITY redeclarations from CYGWIN math.h */
-#define __STRICT_ANSI__
-#endif
-
#include <math.h>
#endif
#undef MAXSHORT
diff --git a/xc/programs/Xserver/include/opaque.h b/xc/programs/Xserver/include/opaque.h
index b4ac45a58..9b19bee67 100644
--- a/xc/programs/Xserver/include/opaque.h
+++ b/xc/programs/Xserver/include/opaque.h
@@ -22,7 +22,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/include/opaque.h,v 1.8 2001/01/17 22:36:57 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/include/opaque.h,v 1.9 2001/05/04 19:05:52 dawes Exp $ */
#ifndef OPAQUE_H
#define OPAQUE_H
@@ -70,9 +70,6 @@ extern int limitNoFile;
#endif
extern Bool permitOldBugs;
extern Bool defeatAccessControl;
-#ifdef SERVER_LOCK
-static Bool nolock = FALSE;
-#endif
extern char* protNoListen;
diff --git a/xc/programs/Xserver/lbx/lbxdix.c b/xc/programs/Xserver/lbx/lbxdix.c
index a59959664..c22fe00ea 100644
--- a/xc/programs/Xserver/lbx/lbxdix.c
+++ b/xc/programs/Xserver/lbx/lbxdix.c
@@ -42,7 +42,7 @@ in this Software without prior written authorization from The Open Group.
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
-/* $XFree86: xc/programs/Xserver/lbx/lbxdix.c,v 1.5 2001/01/17 22:36:59 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/lbx/lbxdix.c,v 1.6 2001/05/15 10:19:43 eich Exp $ */
/* various bits of DIX-level mangling */
@@ -72,8 +72,8 @@ in this Software without prior written authorization from The Open Group.
#ifdef XAPPGROUP
#include "Xagsrv.h"
#endif
+#include "swaprep.h"
-extern ReplySwapPtr CopySwap32Write;
extern int (*ProcVector[256]) (ClientPtr);
extern int (*SwappedProcVector[256]) (ClientPtr);
@@ -312,7 +312,7 @@ LbxGetKeyboardMapping(ClientPtr client)
WriteToClient(client, sizeof(xLbxGetKeyboardMappingReply), (char *)&rep);
if (send_data) {
- client->pSwapReplyFunc = CopySwap32Write;
+ client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write;
WriteSwappedDataToClient(client,
curKeySyms->mapWidth * stuff->count * sizeof(KeySym),
&curKeySyms->map[(stuff->firstKeyCode - curKeySyms->minKeyCode) *
diff --git a/xc/programs/Xserver/lbx/lbxprop.c b/xc/programs/Xserver/lbx/lbxprop.c
index c72b0fed8..993359d90 100644
--- a/xc/programs/Xserver/lbx/lbxprop.c
+++ b/xc/programs/Xserver/lbx/lbxprop.c
@@ -42,7 +42,7 @@ in this Software without prior written authorization from The Open Group.
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
-/* $XFree86: xc/programs/Xserver/lbx/lbxprop.c,v 1.3 2001/01/17 22:37:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/lbx/lbxprop.c,v 1.4 2001/05/15 10:19:43 eich Exp $ */
/* various bits of DIX-level mangling */
@@ -69,8 +69,7 @@ in this Software without prior written authorization from The Open Group.
#define _SECURITY_SERVER
#include "extensions/security.h"
#endif
-
-extern ReplySwapPtr CopySwap16Write, CopySwap32Write, Swap32Write;
+#include "swaprep.h"
void
LbxStallPropRequest(ClientPtr client,
@@ -515,10 +514,10 @@ LbxGetProperty(ClientPtr client)
if (len) {
switch (reply.format) {
case 32:
- client->pSwapReplyFunc = CopySwap32Write;
+ client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write;
break;
case 16:
- client->pSwapReplyFunc = CopySwap16Write;
+ client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write;
break;
default:
client->pSwapReplyFunc = (ReplySwapPtr) WriteToClient;
diff --git a/xc/programs/Xserver/mi/mi.h b/xc/programs/Xserver/mi/mi.h
index ec6dc006f..042deead6 100644
--- a/xc/programs/Xserver/mi/mi.h
+++ b/xc/programs/Xserver/mi/mi.h
@@ -41,7 +41,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/mi/mi.h,v 3.7 2001/01/17 22:37:05 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/mi/mi.h,v 3.7.2.1 2001/05/25 18:50:12 dawes Exp $ */
#ifndef MI_H
#define MI_H
@@ -218,7 +218,7 @@ extern void mieqSwitchScreen(
#endif
);
-extern int mieqProcessInputEvents(
+extern void mieqProcessInputEvents(
#if NeedFunctionPrototypes
void
#endif
diff --git a/xc/programs/Xserver/mi/micmap.c b/xc/programs/Xserver/mi/micmap.c
index 603b76cb0..8d4332626 100644
--- a/xc/programs/Xserver/mi/micmap.c
+++ b/xc/programs/Xserver/mi/micmap.c
@@ -27,7 +27,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/programs/Xserver/mi/micmap.c,v 1.10 2000/09/20 00:09:14 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/mi/micmap.c,v 1.10.4.1 2001/05/29 22:28:23 dawes Exp $ */
/*
* This is based on cfbcmap.c. The functions here are useful independently
@@ -447,7 +447,7 @@ miGetDefaultVisualMask(int depth)
return SMALL_VISUALS;
}
-Bool
+static Bool
miVisualTypesSet (int depth)
{
miVisualsPtr visuals;
@@ -473,6 +473,7 @@ miSetPixmapDepths (void)
return FALSE;
}
}
+ return TRUE;
}
Bool
diff --git a/xc/programs/Xserver/mi/mieq.c b/xc/programs/Xserver/mi/mieq.c
index e6a11d623..114a4df9e 100644
--- a/xc/programs/Xserver/mi/mieq.c
+++ b/xc/programs/Xserver/mi/mieq.c
@@ -21,6 +21,7 @@ in this Software without prior written authorization from The Open Group.
*
* Author: Keith Packard, MIT X Consortium
*/
+/* $XFree86: xc/programs/Xserver/mi/mieq.c,v 1.1.1.4.2.1 2001/05/25 18:50:12 dawes Exp $ */
/*
* mieq.c
@@ -85,7 +86,7 @@ void
mieqEnqueue (e)
xEvent *e;
{
- HWEventQueueType oldtail, newtail, prevtail;
+ HWEventQueueType oldtail, newtail;
Bool isMotion;
oldtail = miEventQueue.tail;
@@ -135,7 +136,7 @@ mieqSwitchScreen (pScreen, fromDIX)
* Call this from ProcessInputEvents()
*/
-mieqProcessInputEvents ()
+void mieqProcessInputEvents ()
{
EventRec *e;
int x, y;
@@ -143,8 +144,6 @@ mieqProcessInputEvents ()
while (miEventQueue.head != miEventQueue.tail)
{
- extern int screenIsSaved;
-
if (screenIsSaved == SCREEN_SAVER_ON)
SaveScreens (SCREEN_SAVER_OFF, ScreenSaverReset);
diff --git a/xc/programs/Xserver/mi/miinitext.c b/xc/programs/Xserver/mi/miinitext.c
index d7aadd91e..e5eea6fde 100644
--- a/xc/programs/Xserver/mi/miinitext.c
+++ b/xc/programs/Xserver/mi/miinitext.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/mi/miinitext.c,v 3.56 2001/03/16 04:45:36 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/mi/miinitext.c,v 3.57 2001/05/10 10:17:39 alanh Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -476,8 +476,8 @@ InitExtensions(argc, argv)
int argc;
char *argv[];
{
- int i, j, k, numExts, ii;
- ExtensionModule *ext, *newList;
+ int i;
+ ExtensionModule *ext;
static Bool listInitialised = FALSE;
if (!listInitialised) {
diff --git a/xc/programs/Xserver/os/osinit.c b/xc/programs/Xserver/os/osinit.c
index 80144ef8b..c6d124982 100644
--- a/xc/programs/Xserver/os/osinit.c
+++ b/xc/programs/Xserver/os/osinit.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/os/osinit.c,v 3.21 2001/01/17 22:37:11 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/os/osinit.c,v 3.22 2001/05/11 08:16:55 alanh Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -61,6 +61,10 @@ SOFTWARE.
#endif
#endif
+#if defined(Lynx)
+#include <sys/wait.h>
+#endif
+
#if !defined(SYSV) && !defined(AMOEBA) && !defined(_MINIX) && !defined(WIN32) && !defined(Lynx) && !defined(QNX4)
#include <sys/resource.h>
#endif
diff --git a/xc/programs/Xserver/os/utils.c b/xc/programs/Xserver/os/utils.c
index 2a4fcf1f9..9dde7b6a4 100644
--- a/xc/programs/Xserver/os/utils.c
+++ b/xc/programs/Xserver/os/utils.c
@@ -45,7 +45,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/os/utils.c,v 3.68 2001/01/17 22:37:12 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/os/utils.c,v 3.69 2001/05/04 19:05:52 dawes Exp $ */
#ifdef __CYGWIN__
#include <stdlib.h>
#include <signal.h>
@@ -234,6 +234,7 @@ OsSignal(sig, handler)
static Bool StillLocking = FALSE;
static char LockFile[PATH_MAX];
+static Bool nolock = FALSE;
/*
* LockServer --
diff --git a/xc/programs/Xserver/os/xdmcp.c b/xc/programs/Xserver/os/xdmcp.c
index b9d1e2caa..d9d5c3c89 100644
--- a/xc/programs/Xserver/os/xdmcp.c
+++ b/xc/programs/Xserver/os/xdmcp.c
@@ -13,7 +13,7 @@
* without express or implied warranty.
*
*/
-/* $XFree86: xc/programs/Xserver/os/xdmcp.c,v 3.14 2001/01/17 22:37:13 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/os/xdmcp.c,v 3.15 2001/05/01 07:53:47 alanh Exp $ */
#ifdef WIN32
/* avoid conflicting definitions */
@@ -324,7 +324,6 @@ XdmcpOptions(int argc, char **argv, int i)
return (i + 1);
}
if (strcmp(argv[i], "-class") == 0) {
- ++i;
if (++i == argc) {
ErrorF("Xserver: missing class name in command line\n");
exit(1);
diff --git a/xc/programs/Xserver/render/mipict.c b/xc/programs/Xserver/render/mipict.c
index f5481b671..b85aec5da 100644
--- a/xc/programs/Xserver/render/mipict.c
+++ b/xc/programs/Xserver/render/mipict.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/render/mipict.c,v 1.6 2001/01/29 15:08:09 keithp Exp $
+ * $XFree86: xc/programs/Xserver/render/mipict.c,v 1.6.2.1 2001/06/01 01:06:35 dawes Exp $
*
* Copyright © 1999 Keith Packard
*
@@ -30,6 +30,10 @@
#include "picturestr.h"
#include "mipict.h"
+#ifndef __GNUC__
+#define __inline
+#endif
+
int
miCreatePicture (PicturePtr pPicture)
{