Compare commits

...

320 Commits

Author SHA1 Message Date
Eamon Walsh e1edd9e668 security: Grant untrusted windows remove access on all windows.
This allows untrusted clients to destroy their own windows when they
have been reparented by a trusted window manager.
(cherry picked from commit 4559d2ace6)
2009-04-16 23:50:13 -04:00
Eamon Walsh a26ae2c63d security: Fix a crash caused by wrong ordering of format arguments.
(cherry picked from commit 3481b32ab9)
2009-04-16 23:50:05 -04:00
Eamon Walsh 62aa06d499 security: Revert behavior of extension access for compatibility.
Previously, three extensions were defined as "trusted" by the extension:
BIG-REQUESTS, XC-MISC, and XPrint.  No other extensions were permitted
to be used by untrusted clients.

In commit 8b5d21cc1d this was changed for
some reason.  Return to the old, compatible behavior.
(cherry picked from commit 6045506be0)
2009-04-16 23:49:58 -04:00
Peter Hutterer 4970d757a7 xkb: Extra sanity checks to prevent dev->key == NULL dereferencing.
(cherry picked from commit 95fc59a199)
2008-12-16 14:19:00 -05:00
Dave Airlie 336df75f12 EXA: avoid copy operations if no boxes in use
Simple fix for now, I'm sure damage shouldn't be calling us with nbox = 0.
(cherry picked from commit 8f8a9c19ad)
2008-12-16 14:06:25 -05:00
Alan Coopersmith cd15136dc1 Non-Linux OS'es should default to kbd driver, not now-dead keyboard driver
(cherry picked from commit d63ea51013)
2008-12-16 14:06:14 -05:00
Alan Coopersmith 1e3f8913c5 Use OsSignal in Popen/Pclose to avoid SysV signal() stupidity
(cherry picked from commit c9051b684b)
2008-12-16 14:06:04 -05:00
Luc Verhaegen 244e960bb0 XAA PixmapOps: Sync before accessing unwrapped callbacks.
When using any XAAPixmapOps, we call into unknown but freshly
unwrapped callbacks (like fb ones). Unlike the XAA*Fallback calls,
we did so without syncing first, exposing us to all kinds of
synchronisation issues.

I believe that the rendering errors appeared now because *PaintWindow
vanished (e4d11e58), and we just use miPaintWindow instead. This
takes a less direct route to the hw and ends up at
PolyFillRectPixmap, which very often left drawing artifacts.

We now sync accordingly, and no longer get the rendering artifacts i
was methodically reproducing on radeonhd, radeon, unichrome...

Also, in order to allow driver authors to remove extensive syncing
or flushing to hide this issue, create XAA_VERSION_ defines, put
them in xaa.h and bump the patchlevel.

(novell bug #435791)
(cherry picked from commit 59f9fb4b8c)
2008-12-16 14:05:54 -05:00
Julien Cristau bfe5a13499 xfree86: xf86SetDepthBpp needs to respect the driver's depth24flags
When setting the depth to 24, leave bpp unset so the logic to pick
a supported value is used instead of ignoring the driver's preference
and forcing 32 bpp.
(cherry picked from commit 991c88b754)
2008-12-16 14:05:43 -05:00
Julien Cristau 8e1ee573b3 mi: Fix infinite loop on regen when swrast_dri.so is missing
The swrast DRI provider gets pushed on the glx provider stack at every
server generation, so the stack turns into a circular list on regen.

X.Org bug#18388 <https://bugs.freedesktop.org/show_bug.cgi?id=18388>
(cherry picked from commit d3d6be4948)
2008-12-16 14:05:19 -05:00
Egbert Eich 38e0a542fc int10: Do an mprotect(..,PROT_EXEC) on shmat()ed memory ranges.
When the linux kernel sets the NX bit vm86 segfaults when it tries to execute
code in memory that is not marked EXEC. Such code gets called whenever
we return from a VBIOS call to signal the calling program that the call
is actually finished and that we are not trapping for other reasons (like
IO accesses).
Use mprotect(2) to set these memory ranges PROT_EXEC.
(cherry picked from commit a9e20306fb)
2008-12-16 14:04:30 -05:00
Adam Jackson 4c6a89ee78 xserver 1.5.3 2008-11-05 15:39:01 -05:00
Julien Cristau b0c2d00985 xfree86: fix compiler warnings in DoModalias()
The precedence of == is higher than that of &, so that code was
probably buggy.

xf86Init.c: In function 'DoModalias':
xf86Init.c:300: warning: suggest parentheses around comparison in operand of &
xf86Init.c:304: warning: suggest parentheses around comparison in operand of &
xf86Init.c:308: warning: suggest parentheses around comparison in operand of &
(cherry picked from commit ffaaa1a198)
2008-11-05 14:41:11 -05:00
Nathaniel McCallum a311fdc040 Xorg: add -modalias option
This scans the installed video drivers and prints a Linux-style modalias
listing of the devices each driver claims to support.
2008-11-05 14:40:59 -05:00
Michel Dänzer b8fd8da1ad AIGLX: Reinstate call to driver texOffsetFinish hook.
It was accidentally lost when factoring out __glXDRIdoReleaseTexImage, so this
is a regression fix and should probably be backported to server-1.5-branch.
(cherry picked from commit a4d62bbf21)
2008-11-05 13:48:30 -05:00
Adam Jackson 377712dbfc linux: Drain the console fd of data when using evdev for keyboards
Works around a silly bug in the kernel that causes wakeup storms after
too many keypresses.  Should fix the kernel bug too, but this at least
keeps the idle wakeup count below 1000/sec.
(cherry picked from commit 446d9443ce)
2008-11-05 13:37:36 -05:00
Peter Hutterer 3245bf1136 xfree86: If AEI is on, disable "kbd" and "mouse" devices.
This consists of two parts:
In the implicit server layout, ignore those drivers when looking for a core
device.

And after finishing the server layout, run through the list of devices and
remove any that use mouse or kbd.

AEI is mutually exclusive with the kbd and mouse drivers, so pick either - or.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
(cherry picked from commit c264826da9)
2008-11-05 13:36:42 -05:00
Peter Hutterer 58e6d6afe0 xfree86: if AllowEmptyInput is true, enable RAW mode on the console.
Usually, the console is set to RAW in the kbd driver. If we hotplug all input
devices (i.e. the evdev driver for keyboards) and the console is left as-is.
As a result, the evdev driver must put an EVIOCGRAB on the device to avoid
characters leaking onto the console. This again breaks many things, amongst
them lirc, in-kernel mouse button emulation and HAL.

This patch sets the console to RAW if AllowEmptyInput is on.

Use-cases:
1. AEI is off
  1.1. Only kbd driver is used - behaviour as-is.
  1.2. kbd and evdev driver is used: if evdev does not grab the device,
       duplicate events are generated.
2. AEI is on
  2.1. Only evdev driver is used - behaviour as-is, but evdev does not need
       to grab the device anymore.
  2.2. evdev and kbd are used: duplicate key events are generated if evdev
       does not grab the device.

1.2 is a marginal use-case that can be fixed by adding a "grab" option to the
evdev driver (update of xorg.conf is needed).

2.2 is an issue. If we have no ServerLayout section, AEI is on, but devices
specified in the xorg.conf are still added [1], resulting in duplicate events.
This is a common configuration and needs sorting out.

[1] 2eaed4a10f

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit d936a4235c)
2008-11-05 13:35:26 -05:00
Peter Hutterer bc199fdf79 config: don't add duplicate devices through HAL.
If HAL is restarted, the device list is sent to the server again, leading
first to duplicate devices (and thus duplicate events), and later to a
FatalError "Too many input devices."

dev->config_info contains the UDI for the device. If the UDI of a new devices
is equal to one we already have in the device list, just ignore it.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
(cherry picked from commit 6c45185955)
2008-11-05 13:30:32 -05:00
Matthieu Herrb e63ef549bb Close well known connections in ServerAbort()
(cherry picked from commit d72cd753b9)
2008-11-05 13:04:33 -05:00
Adam Jackson 5d14e34541 exa: Add exaDrawableIsOffscreen() to the driver API.
(cherry picked from commit 3891dd8924)
2008-11-05 13:02:46 -05:00
Michel Dänzer f4c33e2e64 EXA: Avoid excessive syncing in PutImage
(cherry picked from commit 2188582e5e)
2008-11-05 13:01:35 -05:00
Pierre Willenbrock df22857b34 RANDR: Fix output property event delivery.
(cherry picked from commit 8de26770a4)
2008-11-05 13:01:10 -05:00
Keith Packard 42429aa326 RANDR: Delivery output property events.
(cherry picked from commit 9187f6ad9e)
2008-11-05 13:01:03 -05:00
Rémi Cardona b28c25b5ae Force LC_ALL=C when building xf86DefModeSet.c
Fixes build in not-quite-latin locales.
2008-11-05 11:49:49 -05:00
Martin von Gagern 992a7168f0 Bug #17858: Fix Xvesa build on newer kernels.
Not cherry picked from master, Xvesa is gone there.
2008-11-05 11:44:03 -05:00
Maarten Maathuis ec5046ca75 dri: don't set the dixPrivate key to NULL, as this is a staticly set variable.
- This breaks on the 2nd server generation.
- No other subsystem seems to NULL their key.
- This should fix bug 17982.
(cherry picked from commit 5b336585a4)
2008-10-27 09:47:45 -04:00
Adam Jackson f75163e5f6 Bug #18159: Spell "anisotropic" correctly
(cherry picked from commit 81e197b2a5)
2008-10-27 09:46:52 -04:00
Adam Jackson b468eacf51 kdrive: Hardcode a different wrong value for number of mouse buttons
This should really come from the input driver directly, but, kdrive.
(cherry picked from commit 3eb52de7f2)
2008-10-27 09:46:46 -04:00
Adam Jackson 19776ede8f Add backtrace definitions to dix-config.h.in
(cherry picked from commit ad677238bc)
2008-10-27 09:46:37 -04:00
Adam Jackson 483fb847b4 mieq: Backtrace when the queue overflows.
Since we're probably stuck down in a driver somewhere, let's at least
try to point out where.  This will need to be rethought when the input
thread work lands though.
(cherry picked from commit b736f477f5)
2008-10-27 09:46:32 -04:00
Adam Jackson 7df5e93cf5 Move xorg_backtrace() up to the OS level so we can call it from DIX.
(cherry picked from commit 94ed0ba1b5)
2008-10-27 09:46:28 -04:00
Adam Jackson aa548b0a9b EDID: Catch even more cases of encoding aspect as size.
Very cute, Samsung, not only do you claim to be 16cm by 9cm in the
global size record, you also claim to be 160mm by 90mm in the detailed
timings.  Grrr.
(cherry picked from commit bd9c6b3a4d)
2008-10-27 09:46:22 -04:00
Adam Jackson 6dcfa994b0 xserver 1.5.2 2008-10-10 15:26:32 -04:00
Adam Jackson 75504517a3 EDID: Catch monitors that encode aspect ratio for physical size.
This is not legal in either EDID 1.3 or 1.4, but hey, when did a little
thing like legality stop anyone.
(cherry picked from commit 0660dd9d70)
2008-10-10 14:12:57 -04:00
Adam Jackson b595b65e54 Revert "Array-index based devPrivates implementation."
This reverts commit 8ef37c194f.
2008-10-09 14:53:29 -04:00
Julien Cristau ca659813a8 Fix GKVE with key_code > 255
Move the keycode validation checks before use.
2008-10-08 19:46:50 +02:00
Luc Verhaegen 8337c9aa3d DGA: Fix ProcXF86DGASetViewPort for missing support in driver.
Fixes a segfault when trying to activate a DGA mode without checking
whether DGA modesetting is at all possible.
(cherry picked from commit 1feb69eb63)
2008-10-08 11:21:49 -04:00
Zhenyu Wang 4e6cbd3238 Check nextEnabledOutput()'s return in bestModeForAspect()
In case no enabled outputs, we will reference wrong index of
output array.
(cherry picked from commit 56c615368c)
2008-10-08 11:21:39 -04:00
Adam Jackson 43e3af9cac int10: Fix a nasty memory leak.
(cherry picked from commit 94919480d8)
2008-10-08 11:16:56 -04:00
Adam Jackson 00ac80a0c4 int10: Don't warn when scanning for devices we don't have.
Some BIOSes (hi XGI!) will attempt to enumerate the PCI bus by asking
for the config space of every possible device number.  This despite
perfectly functional BIOS methods to enumerate the bus exactly.
(cherry picked from commit a57b2f172c)
2008-10-08 11:16:52 -04:00
Adam Jackson c6ce2f6b3f int10: Remove useless check.
If you have more than one PCI device with the same d/b/d/f, you're
already in trouble.
(cherry picked from commit a65e36a873)
2008-10-08 11:16:48 -04:00
Eamon Walsh 8ef37c194f Array-index based devPrivates implementation.
Note: DevPrivateKey is now pointer-to-int, which means
each key now needs to point to some global storage of
size at least sizeof(int).

(cherry picked from commit b6ab114212)
2008-10-08 11:15:27 -04:00
Peter Hutterer e88df87851 xkb: squash canonical types into explicit ones on core reconstruction.
If we update key types from core, and groups 2 - n have a canonical type but
the same symbols as the explicit type of group 1, assume that it was a core
sym duplication according to Section 12.4 of the XKB Protocol Spec.
Ignore the canonical types and pretend there's only one group for the key -
with the explicit key type.

The protocol spec does not cover this case, so we have to guess here.
(cherry picked from commit 30c3c13f10)
2008-10-08 11:15:21 -04:00
Peter Hutterer be3b3cb970 xkb: fix core keyboard map generation. #14373
According to Section 12.4 of the XKB Protocol Spec, if a key only has a single
group but the keyboard has multiple groups defined, the core description of
the key is a duplication of the single group across all symbols. i.e.
G1L1 G1L2 G1L1 G1L2 G1L3 G1L4 G1L3 G1L4

The previous code generated G1L1 G1L2 G1L3 G1L4 G1L3 G1L4, leading to
"invented" groups when the process is reversed.

Note that this creates wrong key types on reconstruction from core to xkb,
i.e. any single-group key with a key type that is not one of the canonical
four (Sec 12.2.3), will get the assigned type on group 1, and a canonical type
for the other gruops.

X.Org Bug 14373 <http://bugs.freedesktop.org/show_bug.cgi?id=14373>
(cherry picked from commit ae986d1c73)
2008-10-08 11:15:13 -04:00
Kim Woelders 3bf826f590 xkb: fix use of uninitialized variable.
And some cosmetic changes to use stuff->change consistently.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
(cherry picked from commit 8c46505d7d)
2008-10-08 11:15:05 -04:00
Alan Coopersmith 88ebde608d Remove usage of mfbChangeWindowAttributes missed in e4d11e58c... 2008-10-06 20:10:25 -07:00
Alan Hourihane af8cef461c only build dri2 when DRI2 is enabled 2008-09-24 14:24:36 +01:00
Adam Jackson 97f688f2b4 xserver 1.5.1 2008-09-23 14:51:33 -04:00
Adam Jackson 68c575cb73 Move RELEASE_DATE below AC_INIT.
Doing it the other way around clobbers the setting, which means you get
a null release date string in the log.  Thanks autoconf!
2008-09-23 11:05:44 -04:00
Peter Harris dba26368e5 Fix panoramiX request and reply swapping
Fix panoramiX request and reply swapping
 Set window and screen values in panoramix replies
 Prevent buffer overrun in ProcPanoramiXGetScreenSize
(cherry picked from commit 2b266eda6e)
2008-09-23 10:36:20 -04:00
Julien Cristau ce6424853c exa: disable shared pixmaps
They got re-enabled in ee7c684f21
("Reimplement ShmPutImage.")
(cherry picked from commit b4762c0245)
2008-09-23 10:36:02 -04:00
Aaron Plattner 3787660295 Conditionalize Composite-based backing store on pScreen->backingStoreSupport. 2008-09-17 15:48:56 -07:00
Adam Jackson 05fb2f9e12 xserver 1.5.0
Drinkin' island is inside each of us, my son.
2008-09-03 19:14:22 -04:00
Adam Jackson f385303cd0 Fix strict-aliasing silliness in XAA.
(cherry picked from commit 613ce09550)
2008-09-03 18:58:43 -04:00
Adam Jackson 6cb7f595b9 Disable DRI2 by default. 2008-09-03 14:59:24 -04:00
Adam Jackson ed2248f673 Disable XTrap build by default. 2008-09-03 14:58:43 -04:00
Julien Cristau 9bb4990c91 Xevie: swap replies as necessary
(cherry picked from commit b5cdcfa55c)
2008-09-03 13:05:45 -04:00
Thorvald Natvig bcea1095da Xevie: always initialize rep.length (bug#17394)
The XEvIE extension doesn't clear the rep.length field for any reply but
the version check. Hence, if there is junk data in it and that is sent
to the client, it hangs.

X.Org bug#17394 (http://bugs.freedesktop.org/show_bug.cgi?id=17394)
(cherry picked from commit d3ae193f4a)
2008-09-03 13:05:44 -04:00
Julien Cristau 67ed1f23fe Add swapped dispatch for randr 1.2 requests
(cherry picked from commit 01264f1792)
2008-09-03 13:04:19 -04:00
Thomas Bodzar 62524d9d76 Xorg.man: typo (the the).
(cherry picked from commit 229e60db8f)
2008-09-02 17:57:46 -04:00
Matthieu Herrb 57fa9fd4a5 Xserver.man: Typo (the the).
(cherry picked from commit d01c5ca793)
2008-09-02 17:57:34 -04:00
Daniel Drake 7f42ed6ca9 Don't try to destroy a NULL pixmap.
(cherry picked from commit 4e1f9f51a9)
2008-09-02 17:33:21 -04:00
Maarten Maathuis 48744d20b1 xf86Crtc: Set mode to NULL, so nothing bad happens if crtc == NULL.
- Fix is courtesy of math_b.
2008-08-31 18:14:57 +02:00
Xavier Bestel 580e96d6d4 Cosmetic fix to EDID decoding.
(cherry picked from commit bb2cacd33e)
2008-08-29 14:48:40 -04:00
Fredrik Höglund d0ef934305 Fix the tile offset in miPaintWindow for ParentRelative windows.
(cherry picked from commit 244a635fcd)
2008-08-29 14:39:05 -04:00
Daniel Drake 05472534cf Don't abort if swrast library is not present
GLX is enabled by default, but the current swrast behaviour causes X
to abort with fatal error if the swrast dri library dlopen fails.

Handle the case where the swrast library is not present, and do not
register the GLX extension unless at least one screen has a usable
GL provider.
(cherry picked from commit eff25430b4)
2008-08-29 14:38:43 -04:00
Adam Jackson 4652c51e92 Reimplement ShmPutImage.
There's no reason to not just dispatch this straight into the GC.  As a
bonus, if you do so, damage wraps correctly, and thus swcursor works.
The side effect is it's no longer possible to override ShmPutImage with
ShmRegisterFuncs().

Also remove the (broken) damage tracking for same from EXA, since it didn't
work right, and is now superfluous.

(cherry picked from commit ee7c684f21)
2008-08-29 14:36:43 -04:00
Eamon Walsh ef0780b738 Attempt getpeercon() on remote sockets as well as local ones.
(cherry picked from commit 60ad8d5d05)
2008-08-28 23:50:20 -04:00
Kristian Høgsberg 78f50cd575 Fix driGetConfigAttribIndex unaligned access to GLboolean.
We don't actually send the float mode so just drop it.  Drop a couple of
other unused or redundant fields from GLXconfig.
2008-08-26 10:58:35 -04:00
Maarten Maathuis c662381a14 exa: fix assert logic thinko from 361a9eb953
- I guess failing PrepareAccess is rare, since this a 3 year old bug.
2008-08-17 23:20:45 +02:00
Peter Hutterer 582f1381ae xkb: ProcXkbSetDeviceInfo should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
(cherry picked from commit c06e27b2f6)
2008-08-13 16:59:02 +09:30
Peter Hutterer 07e922a257 xkb: ProcXkbSetGeometry should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
(cherry picked from commit d9ca9819e9)
2008-08-13 16:57:28 +09:30
Peter Hutterer 245fecf7cd xkb: ProcXkbSetNames should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
(cherry picked from commit 5ba87c3327)
2008-08-13 16:56:05 +09:30
Peter Hutterer a5c4b9db12 xkb: ProcXkbSetNamedIndicator should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
(cherry picked from commit 7e45c80204)

Includes follow-up fix d684f5760f.
2008-08-13 16:55:04 +09:30
Peter Hutterer 8d4004b092 xkb: ProcXkbSetIndicatorMap should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
(cherry picked from commit a609dbed7c)
2008-08-13 16:52:55 +09:30
Peter Hutterer 8a18475848 xkb: ProcXkbSetCompatMap should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
(cherry picked from commit e8c2a3d7c9)

Conflicts:

	xkb/xkb.c
2008-08-13 16:52:03 +09:30
Peter Hutterer 5b3eb0a3af xkb: ProcXkbSetMap should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
(cherry picked from commit 3c7740aa8f)

Conflicts:

	xkb/xkb.c
2008-08-13 16:49:33 +09:30
Peter Hutterer 2fa7edd30d xkb: ProcXkbBell should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
(cherry picked from commit 31afd51dd4)
2008-08-13 16:43:22 +09:30
Alan Coopersmith 50382652af Fix --disable/--enable-kbd_mode configure flag 2008-08-12 14:53:14 -07:00
Dave Miller 5930aeb45e glx: fix crash in driGetConfigAttribIndex
Don't access GLboolean via int pointers
2008-08-09 16:47:49 +10:00
Alan Coopersmith b61ee18b72 Make xstrcasestr prototype return value match the implementation
(cherry picked from 3b687ffe16 commit)
2008-08-06 16:12:59 -07:00
Daniel Stone b5932f176c DIX: Add strcasestr from FreeBSD
Add strcasestr for use on systems which don't have it.
(cherry picked from ad87c72edc commit)
2008-08-06 16:12:06 -07:00
Daniel Stone ce10b41f1b dix: Actually build str(n)casecmp if we don't have it
Remember to add stuff to dix-config.h when you add new AC_DEFINES,
people ...
(cherry picked from 69b57dc651 commit)
2008-08-06 16:08:42 -07:00
Daniel Stone 8a319335fa strcasecmp: Actually use the right license
Forgot to update the license when I committed the FreeBSD version, so it
still had an old SGI license.  Sorry.  Sorry.
(cherry picked from dcf6293030 commit)
2008-08-06 16:05:45 -07:00
Daniel Stone 5a5030af9b DIX: Add strncasecmp from FreeBSD, make strcasecmp args const
Add strncasecmp (as we're now using it) in case someone doesn't have it,
and also change strncasecmp args to be const, in accordance with
everything else.
(cherry picked from 11f9e35202 commit)
2008-08-06 16:05:32 -07:00
Peter Hutterer f7ee776de2 config: protect against potential out-of-bounds indexing.
(cherry picked from commit 3c6a9c531f)
2008-08-06 10:34:35 +09:30
Peter Hutterer 7d508f783c config: support type strlist for XkbOptions property.
For backwards compatibility with server 1.4.
(cherry picked from commit 92c51b183c)
2008-08-06 10:34:35 +09:30
Peter Hutterer 2f6b270e48 config: add parsing for input.x11_options.XkbOptions. #16874
X.Org Bug 16874 <http://bugs.freedesktop.org/show_bug.cgi?id=16784>
(cherry picked from commit 35b14519b4)
2008-08-06 10:34:35 +09:30
Daniel Stone 0788adb9a6 HAL: Remove grotesque open-coded strcasestr
Not only was this pretty ugly, but it didn't even work on systems
without strcasestr anyway, due to the define not being in dix-config.h.
Lack of strcasestr is handled transparently with the version from
FreeBSD now anyway, so, huzzah.
(cherry picked from commit b8dd07f855)
2008-08-06 10:34:35 +09:30
Julien Cristau db918ea2b0 xfree86: use xorg.conf input devices if there is no ServerLayout
If xorg.conf has no ServerLayout section, use the first mouse and
keyboard sections as core devices, even with AllowEmptyInput.
(cherry picked from commit 2eaed4a10f)
2008-08-06 10:34:35 +09:30
Peter Hutterer b6024da704 Xi: ChangeDeviceControl presence events should set the appropriate devchange.
Requires inputproto 1.4.4 or higher.
(cherry picked from commit 591ef3c047)
2008-07-29 10:16:16 +09:30
Peter Hutterer da29a25315 Require inputproto 1.4.4
for DeviceControlChanged define.
2008-07-29 10:04:24 +09:30
Peter Hutterer d199d800a4 xfree86: warn some more about potential missing input devices.
Put out a warning if xorg.conf has InputDevice sections, but these aren't
referenced in the used ServerLayout. This is only performed if AllowEmptyInput
is enabled.
The reason behind this is that the server used to auto-add the first
mouse/keyboard sections if none where referenced. Now, with HAL and AEI
enabled by default, setups that relied on this auto-adding break and are left
without input devices. The least we can do is warn them.
(cherry picked from commit 47160edec7)
2008-07-29 10:03:07 +09:30
Peter Hutterer 538942cc65 xfree86: if AllowEmptyInput is on, warn the user that we rely on HAL now.
(cherry picked from commit f30b0823db)
2008-07-29 10:03:07 +09:30
Daniel Stone 37927b8bfa Revert "Xi: event_{x,y} should refer to the extended device (bug #16289)"
After discussion with Peter, realised that diverging from 1.3 and 1.4's
behaviour was daft and insane.  Sorry.

This reverts commit 8259d19f71.
2008-07-29 02:51:57 +03:00
Adam Jackson c0c73e9236 xserver 1.4.99.906
You know, Mesa 7.1 could release any day now and that'd be just fine.
2008-07-23 14:16:47 -04:00
Pierre-Loup A. Griffais e909a39619 Don't return BadAlloc when trying to set a PictureFilter with no parameters when a filter with parameters was previously set.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
(cherry picked from commit bc3c03a3f3)
2008-07-23 13:50:54 -04:00
Dodji Seketeli c217cb96dc [Xephyr] Fix #15839
Make sure the _XSERVER64 macro is not defined in Xlib client code.
That macro is meant to be define only on pure server code, when necessary.
(cherry picked from commit 5de1867fbb)
2008-07-23 13:50:48 -04:00
Roland Scheidegger 14a033f032 glx: copy msaa visual capabilities
(cherry picked from commit 49751fee3b)
2008-07-23 13:49:58 -04:00
Peter Hutterer ff1a9b7fea xkb: don't send core events for extension devices on SlowKey timeout.
RedHat Bug 448604 <https://bugzilla.redhat.com/show_bug.cgi?id=448604>
2008-07-23 17:08:49 +09:30
Kristian Høgsberg 2d6022bd40 Need to unref pixmaps backing pbuffers too.
(cherry picked from commit facb255fa9)
2008-07-21 17:16:00 -04:00
Kristian Høgsberg e4cfdc07f4 Fix embarrasing GLXPixmap leak.
(cherry picked from commit d5ae85b5b7)
2008-07-21 17:14:08 -04:00
Eamon Walsh ceffece78b Fix "warning: passing argument 1 of `modeIsPresent' from incompatible pointer type".
(cherry picked from commit 95d4ede538)
2008-07-21 17:13:59 -04:00
Dave Airlie 7f542ab37f modes: fix initial xorg.conf mode selection.
This was all kinds of broken, we ignored user preferred modes for multiple
monitors and also for side-by-side configurations.
(cherry picked from commit 0b9ef835a0)
2008-07-21 17:08:07 -04:00
Peter Hutterer 0baf677da6 kdrive: don't post motion event if there was no motion. #16179
Based on the patch by Tomas Janousek. Backported version.

X.Org Bug 16179 <http://bugs.freedesktop.org/show_bug.cgi?id=16179>
(cherry picked from commit 26e7e69ab8)
2008-07-17 08:44:39 +09:30
Peter Hutterer a75cbabc25 Revert "kdrive: don't post motion event if there was no motion. #16179"
Just because it compiles on my machine doesn't make it right. Needs backported
patch from http://bugs.freedesktop.org/show_bug.cgi?id=16179.

This reverts commit a08ea64ded.
2008-07-17 08:40:54 +09:30
Peter Hutterer a08ea64ded kdrive: don't post motion event if there was no motion. #16179
Based on the patch by Tomas Janousek.

X.Org Bug 16179 <http://bugs.freedesktop.org/show_bug.cgi?id=16179>
(cherry picked from commit 26e7e69ab8)
2008-07-16 21:43:22 +09:30
Peter Hutterer 45f274415d Xi: don't attempt to send to a NULL window.
Only applicable when the server comes down/restarts. In this case,
WindowTable[i] may be NULL. Let's not try to send an event then.
(cherry picked from commit f377141912)
2008-07-16 11:05:10 +09:30
Peter Hutterer 476de585be dix: NULL out WindowTable after freeing all the windows.
CloseDownDevices() tries to send PresenceNotify events. If the windows are
already freed, then we are accessing dangling pointers.
(cherry picked from commit aec485f2dc)
2008-07-16 10:34:55 +09:30
Peter Hutterer 5cb38a3fca xfree86: don't free the config-file related information in DIDR. #15645
In DeleteInputDeviceRequest, leave the conf_idev (which is shared with
xf86ConfigLayout.input) alone for devices that were specified in the
ServerLayout section of the config file. This way, in the next server
generation we are left with what was the original config and can thus re-init
the devices.

This is an addon to 6d22a9615a, an attempt to
fix Bug 14418.

X.Org Bug 15645 <https://bugs.freedesktop.org/show_bug.cgi?id=15645>
X.Org Bug 14418 <https://bugs.freedesktop.org/show_bug.cgi?id=15645>
(cherry picked from commit 9ab4e2fd8e)
2008-07-16 10:32:46 +09:30
Julien Cristau 2b3faf2a75 Bug #16674: Make sure RANDR reports refresh as 0 if pixel clock is 0.
(cherry picked from commit 9111944b29)
2008-07-15 10:37:31 -04:00
Peter Hutterer 5b546f1c49 xfree86: append, not prepent, new input devices to xf86InputDevs.
If devices are prepended to the list, their wake-up order on resume is not the
same as the original initialisation order. Hot-plugged devices, originally
inited last, are re-enabled before the xorg.conf devices and in some cases may
steal the device files. Result: we have different devices before and after
suspend/resume.

RedHat Bug 439386 <https://bugzilla.redhat.com/show_bug.cgi?id=439386>
(cherry picked from commit 11ee0ae939)
2008-07-14 12:53:28 +09:30
Julien Cristau 5659f6d31b Export xkbfile.h in the SDK
It's needed by xkbsrv.h
(cherry picked from commit d8af9d9ab1)
2008-07-13 15:14:41 +02:00
Ander Conselvan de Oliveira e135a77b8b Fix incorrect test regarding keyboard map.
In the map stored in each keyboard device, the first line refers to minimum
keycode, i.e., the 0th line refers to keycode 8. When not using XKB the wrong
test caused some keys to be interpreted as locks ('m' for instance). The had
to be pressed twice to generate both KeyPress and KeyRelease events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-13 21:30:46 +09:30
Sascha Hlusiak c30f36c8c1 xfree86: AllowEmptyInput is now enabled by default if hotplugging is enabled.
Remove AEI check from configImpliedLayout as the setting isn't actually parsed
at this point anyway.

Set AllowEmptyInput to enabled by default if hotplugging is enabled.
2008-07-03 21:42:10 +02:00
Dave Airlie 5144158ced dri2: bump libdrm numbers as 2.3.1 is released without ttm interface 2008-07-03 20:01:28 +10:00
Dave Airlie 793ff6754e modes: check the crtc is valid before using its desired modes.
this fixes a crash I was getting on radeon rotate when gnome is running.
I'm sure g-s-d was doing something bad, but really not crashing ftw.
(cherry picked from commit 1771edcb44)
2008-07-03 19:01:44 +10:00
Dave Airlie e9f83740e3 cursor: don't dereference NULL pointer is devPrivates not yet set.
This fixes a bug on server recycle with ati zaphod.
2008-07-03 18:46:38 +10:00
Alan Hourihane 8081eda696 Set driverPriv immediately on CreatePixmap.
If it's NULL anyway, we bail, if not, it lets
ModifyPixmapHeader know about the private.
(cherry picked from commit 528b4e36ad)
2008-07-02 11:27:26 -04:00
Adam Jackson a18551cad1 Fix GLX in Xvfb and kdrive.
(cherry picked from commit 689292e58c)
2008-07-02 11:26:10 -04:00
Julien Cristau 81e6ab4851 autoconfig: don't call closedir() when opendir() failed
If opendir() fails, return from matchDriverFromFiles() immediately.
Ubuntu bug 217647.
(cherry picked from commit fbad87f2ae)
2008-07-01 13:27:54 -04:00
Aaron Plattner 75b5e999f0 Work around the DIX losing mmWidth/mmHeight for RandR 1.1 DDXen.
RandR 1.1 has a physical size for each mode.  It used to be that the DIX would
remember these modes and pass them back up to the DDX when changing the screen
configuration.  The DDX uses RR_GET_MODE_MM to query the driver for the physical
dimensions of the screen, allowing it to preserve the DPI.

With RandR 1.2, the physical dimensions are stored as part of the output, rather
than per mode.  The DIX only uses the sizes passed in from the DDX to select the
mode pool for the "default" output, and forgets the physical sizes.  Then, when
reconfiguring the screen, it makes up a new RRScreenSizeRec using the dimensions
from the output, screwing up the DPI.

This change works around this problem by ignoring the DIX and querying the real
size from the driver.
(cherry picked from commit 2e8daee053)
2008-07-01 09:08:36 -07:00
Adam Jackson 9ab88bb9b1 Don't try to load DRI2 if built without it.
(cherry picked from commit e2bbf2d248)
2008-07-01 12:02:18 -04:00
Simon Thum ccb373f2fb input: change dxremaind, dyremaind to floats for better acceleration #9156
X.Org Bug 9156 <http://bugs.freedesktop.org/show_bug.cgi?id=9156>

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>

(cherry picked from commit 0050165a67)
2008-07-01 09:46:34 -04:00
Adam Jackson 0617653277 xserver 1.5RC5 2008-06-30 16:11:32 -04:00
Adam Jackson bee463bd8a XInput ABI is 2.1, not 3.1.
(cherry picked from commit 76576c87b0)
2008-06-30 16:11:04 -04:00
Keith Packard 795d293d76 Wrap AddTraps in exa and damage.
This fine (and unused) function wasn't ever wrapped which made it not work
under exa.
(cherry picked from commit 06e7e1d048)
2008-06-30 13:50:57 -04:00
Adam Jackson 32cd2c5109 xserver 1.5RC4.
Remember kids, distcheck before you tag.
2008-06-30 11:18:27 -04:00
Adam Jackson 6ec12077ef Distcheck fixes. 2008-06-30 11:17:53 -04:00
Adam Jackson 6a2ee7e0bb xserver 1.5RC3. 2008-06-30 10:40:50 -04:00
Adam Jackson 6e8ed1398d Bump ABI minor numbers for the devPrivate ABI functions.
(cherry picked from commit 211e2bdcc6)
2008-06-30 10:31:55 -04:00
Eamon Walsh 39cc11b005 Fix a leak of window devPrivates in window.c/CrushTree().
(cherry picked from commit 7ddfb2f158)
2008-06-27 23:11:29 -04:00
Dan Nicholson 8017c99901 Actually enable building GLX without Mesa source
(cherry picked from commit e837244947)
2008-06-26 16:14:52 -04:00
George Sapountzis 90f2a82ba5 glx: fix forgotten swrast -> SWRast
(cherry picked from commit 21a8052fdc)
2008-06-26 16:14:52 -04:00
George Sapountzis 6e278e3944 glx: missing swrast is fatal
(cherry picked from commit 877e6c35ff)
2008-06-26 16:14:52 -04:00
George Sapountzis 0845476521 glx: drop stray glcore.h include
(cherry picked from commit 1345c93ad4)
2008-06-26 16:14:52 -04:00
George Sapountzis 6f18c5d703 kdrive: need not export symbols for glx anymore
(cherry picked from commit ae0504d34d)
2008-06-26 16:14:52 -04:00
Kristian Høgsberg a194718e9d Move GL/glx on level up now that it's the only thing left under GL.
(cherry picked from commit c3eb5b80d8)
2008-06-26 16:14:52 -04:00
Kristian Høgsberg cb402b4112 Move the windows GL files to the xwin DDX.
(cherry picked from commit a8a9b40e55)
2008-06-26 16:14:51 -04:00
Kristian Høgsberg 0234d3d48f Get out of the mesa symlinking business.
This copies over the files generated from mesa/src/mesa/glapi.  There's
a corresponding mesa commit that makes it easy to generate the glapi files
straight into the xserver tree when the XML definitions change.

The only few files that are copied from mesa but aren't generated are
glapi.[ch] and glthread.[ch].  Everything in there is technically DRI
driver API and the whole setup is still a bit fragile, but it's not a new
problem.

The --with-mesa-source configure option is still around since other
parts of the server (XGL and DMX - grep for MESA_SOURCE) need that,
but for common case of building with GLX and AIGLX support, that
option is no longer needed.
(cherry picked from commit e5aad4bc08)
2008-06-26 16:14:51 -04:00
Dan Nicholson d3a2e060bf Fix up paths for GL/glx -> glx renaming
(cherry picked from commit c76fddeea2)
2008-06-26 16:14:51 -04:00
Kristian Høgsberg d325a207c8 Use LD_EXPORT_SYMBOLS_FLAG when linking Xnest.
(cherry picked from commit f558c7d4d1)
2008-06-26 16:14:51 -04:00
Kristian Høgsberg bd81faff8c Drop glcore GLX provider.
Obsoleted by the DRI swrast driver.
(cherry picked from commit 77ff8fd507)
2008-06-26 16:14:51 -04:00
Jeremy Huddleston d88da6638e Moved Apple GL bits into our DDX subtree
(cherry picked from commit c9356f3289)
(cherry picked from commit d09c520b32)
2008-06-26 16:14:51 -04:00
Kristian Høgsberg 500463f728 Stop symlinking glcontextmodes.[ch] from mesa.
(cherry picked from commit 61eaef2235)
2008-06-26 16:14:51 -04:00
Jeremy Huddleston a569beba4c XQuartz: Compile in missing glx source that we still need
(cherry picked from commit c611335dee)
(cherry picked from commit 63853e4ad2)
2008-06-26 16:14:51 -04:00
Ben Byer 46e0bb6211 xquartz: remove vestigial aglGlx.c
(cherry picked from commit 40bd041e42)
(cherry picked from commit 3685b171da)
2008-06-26 16:14:51 -04:00
Ben Byer e8a1eda65d add missing DARWIN_GLX_LIBS in configure.ac
(cherry picked from commit a033c0b3db)
(cherry picked from commit 744d0cfda7)
2008-06-26 16:14:51 -04:00
George Sapountzis 17ac93b23b glx: drop drm.h, sareaHandle from swrast loader
(cherry picked from commit 88f43e5d06)
2008-06-26 16:14:51 -04:00
George Sapountzis 988b1b8df3 Add loader for the swrast dri driver.
(cherry picked from commit 6ff6465931)
2008-06-26 16:14:51 -04:00
George Sapountzis 1efc0329b1 glcore: drop GLcore (files)
(cherry picked from commit a88c6b6646)
2008-06-26 16:14:50 -04:00
George Sapountzis 9b4d5b6521 glcore: drop GLcore (build system)
(cherry picked from commit dd7a53f8f2)
2008-06-26 16:14:50 -04:00
George Sapountzis 1ea2e69cfc glcore: build from mesa, dlopen from xorg
* The GLcore interface is disposable
* GLcore is installed in DRI_DRIVER_INSTALL_DIR which is overloaded for
  GLX_PROVIDER_INSTALL_DIR
(cherry picked from commit 567d389d47)
2008-06-26 16:14:50 -04:00
Donnie Berkholz f2c30a57e3 glcore: prepare for dynamic loading
glcore gets linked with -ldl, -lpthread for s3tc and glapi
xserver needs
        DLOPEN_LIBS - to dlopen the glcore dso
        LD_EXPORT_SYMBOLS_FLAG - to export symbols for glcore to use

the ld flag is added to kdrive only when GLX is enabled, the net overhead for
Xephyr is ~155KB, could be reduced with --dynamic-list.
(cherry picked from commit efb723e166)

Conflicts:

	configure.ac
2008-06-26 16:14:50 -04:00
Alan Coopersmith 9029748f89 Don't log null device name in XkbDDXLoadKeymapByNames
(cherry picked from 7ce6dcef11 commit)
2008-06-25 18:22:41 -07:00
Eamon Walsh 5d66908975 Fix a leak in the code that parses the protocol names.
Also added some comments.
Reported by Ben Gamari (bug #16492).
(cherry picked from commit a3ec226273)
2008-06-24 22:03:30 -04:00
Roland Bär 7351c07ae8 Bug #11857: Avoid running off the end of a MAXCLIENTS-sized array.
(cherry picked from commit 249c892784)
2008-06-24 14:13:30 -04:00
Adam Jackson 429b2a97a0 Bug #11842: Fix emulation of int1A PCI BIOS services.
Use only %di to name the PCI register to read/write, rather than %edi.
DOS is only expecting the base PCI config space anyway, and the BIOS
might be using the high bits of %edi.
(cherry picked from commit 9e5b3deafb)
2008-06-24 14:10:12 -04:00
Owen Taylor 3dfe90fe6c Bug #15369: Don't reduce Over to Src for transform + RepeatNone.
Only do no-src-alpha optimizations for a RepeatNone source if we can
easily probe that we won't sample outside the edges of the source.
(cherry picked from commit 574c62e305)
2008-06-24 12:42:38 -04:00
Hasso Tepper 3a7657b713 configure.ac: Fix monotonic test harder
This was only introduced in a later version of POSIX, so define that
version to get it from more conformant systems.
(cherry picked from commit 08073862f8)
2008-06-24 12:38:10 -04:00
Adam Jackson a8a6334783 Bug #15586: (Correctly) refuse to redirect the root window.
(cherry picked from commit 100afae578)
2008-06-24 10:53:10 -04:00
Paul Bender 2334ff9bb2 Bug #15665: Fix building without Composite.
(cherry picked from commit 4c4e06af79)
2008-06-24 10:45:16 -04:00
Adam Jackson 85e598cc62 Remove some default modes that really shouldn't be in the default set.
(cherry picked from commit 59510a7643)
2008-06-24 10:41:27 -04:00
Alan Coopersmith 2f8ad7f938 Check for strcasestr and workaround it on systems without it
(cherry picked from ed65e8b4f0 commit)
2008-06-23 19:41:10 -07:00
Alan Coopersmith dfb326790e Restore return type on xf86SetScrnInfoModes
Seems to have been accidentally lost by commit 	76943fec86
(cherry picked from 925e895b86 commit)
2008-06-23 19:32:01 -07:00
Jesse Ruffin 4c8a84acf5 Bug #16302: Fix GLX drawable refcounting in DMX.
(cherry picked from commit 3b58782692)
2008-06-23 14:35:46 -04:00
Adam Jackson 89d73d7595 Implement bswap in x86emu.
Yes, this is a 486+ instruction and thus not strictly legal in vm86
mode, but enough BIOSes use it (looking at you VIA) that we might as
well implement it.
(cherry picked from commit c8d066a151)
2008-06-23 14:01:15 -04:00
Matthieu Herrb b0df9a6a42 preserve errno around the SIGIO handler
(cherry picked from commit 19c7e9da55)
2008-06-20 13:36:16 -04:00
Adam Jackson fc37f8fcb2 Bug #12414: Create full-fledged pixmaps in fb24_32ReformatTile().
... instead of creating pixmaps that only fb knows about, which will
have no devPrivates for any other subsystem and thus cause havoc if
(when) they leak out.
(cherry picked from commit b55fbca4f0)
2008-06-20 13:31:18 -04:00
Matthieu Herrb 7e3ec36e0e Merge branch 'server-1.5-branch' of git+ssh://herrb@git.freedesktop.org/git/xorg/xserver into server-1.5-branch 2008-06-18 09:20:05 +02:00
Eamon Walsh ad10515b6c SELinux: Add an extension alias under the OS-agnostic "Flask" name.
(cherry picked from commit 79dd600942)
2008-06-17 19:12:43 -04:00
Eamon Walsh eed6713d3d SELinux: Bring server-side name registry up to date.
(cherry picked from commit 656d3d7623)
2008-06-17 17:59:10 -04:00
Adam Jackson 7822a3d05f XAA: Disable offscreen pixmaps by default.
Say Option "XaaOffscreenPixmaps" to turn them back on.

Apropos of bugs #13795 and #15098.  Not yet applied to master as this wants
a proper solution someday, but then, those bugs aren't closed yet either.
2008-06-17 16:10:51 -04:00
Michel Dänzer d900de5a8f AIGLX/DRI1: Switch to server context for calling pScreen->GetImage.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16292 .

(cherry picked from commit 23b55a61f8)
2008-06-17 13:13:23 -04:00
Ian Romanick fba700f1f6 Bug #15169: Make the server build again on Alpha.
Still won't work until the kernel makes the resource files actually exist.

(cherry picked from commit f3490d3eba)
2008-06-17 10:48:41 -04:00
Matthieu Herrb d254903413 configure.ac: fix the help string for --with-freetype.
Default value was changed to 'no' in e5b1d38e14
but the help string wasn't updated.
2008-06-14 14:40:32 -06:00
Matthieu Herrb c2877c073b Merge branch 'server-1.5-branch' of git+ssh://herrb@git.freedesktop.org/git/xorg/xserver into server-1.5-branch 2008-06-14 14:32:42 -06:00
Eamon Walsh 2552026664 Make devPrivates lookup functions ABI instead of static inlines.
This is required to preserve compatibility across changes to the
internal representation of the privates list.
(cherry picked from commit 2d7ba09dc4)
2008-06-13 16:45:08 -04:00
Matthieu Herrb a645b47f04 Merge branch 'server-1.5-branch' of git+ssh://herrb@git.freedesktop.org/git/xorg/xserver into server-1.5-branch 2008-06-12 14:22:32 -06:00
Dave Airlie 21248705bb modes: make aspect choosing work on single output case.
In the single output enabled case we never enter the loop and test
never gets set and so we fail to match a good mode.

This was causing my 2560x1600 to end up at 2048x1536.
2008-06-12 14:54:56 +10:00
Julien Cristau 53a84d75c6 xfree86: fix build on GNU/kFreeBSD
GNU/kFreeBSD defines __FreeBSD_kernel__, but not __FreeBSD__.
Unify preprocessor conditionals between variable declaration and use.
Debian bug #482550.
(cherry picked from commit e6cbb1e11e)
2008-06-12 10:01:41 +10:00
George Sapountzis 336a46c519 glx: fix memory corruption with r5g6b5
should cherry-pick to xserver-1.5
(cherry picked from commit 6c72961d8f)
2008-06-12 09:27:00 +10:00
Dave Airlie 38f573566e dbe: fix DoS reported by iDefense.
This isn't a security problem just a user could DoS themselves for fun or profit.
(cherry picked from commit 23e71ef71a)
2008-06-12 09:04:47 +10:00
Peter Hutterer 59a52d8151 config: override xkb_{r,m,l,v} with Xkb{r,m,l,v} if the latter is set.
The HAL spec says that input.xkb.{rmlv}* can be sent, but if the user
specifies a X-specific {rmlv}, then this is overridden through the use of
input.x11_options.Xkb{RMLV}.
However, the way how the server parses options--by ignoring capitalisation,
underscores and spaces--the HAL and the x11_options would override each other.

So we simply filter the options, letting Xkb{RMLV} override xkb_{rmlv} and
only actually add them to the device after parsing _all_ options.

* rmlv ... rules, model, layout, variant

See Bug 13037 <http://bugs.freedesktop.org/show_bug.cgi?id=13037>
(cherry picked from commit fc35d1e3be)
(cherry picked from commit ff013b0da4)
2008-06-11 11:27:01 -04:00
Peter Hutterer 82e7cf1245 config: remove trailing whitespaces.
It makes my vim look ugly. Put "let c_space_errors=1" into your .vimrc.
(cherry picked from commit 1f54c05cf8)
(cherry picked from commit 901978ebe0)
2008-06-11 11:27:01 -04:00
Sascha Hlusiak b4c5832c75 Support to pass arbitrary options via HAL hotplugging
Parse "input.x11_options" and pass every key/name pair to the driver.
Remove check for input.capabilities, because that's part of the fdi files.

Thanks to Dustin Spicuzza <dustin@virtualroadside.com> for the patch.
(cherry picked from commit 47eb658e80)
2008-06-11 11:27:01 -04:00
Matthieu Herrb 626ea1b02d CVE-2008-1377 - RECORD and Security extensions memory corruption
Lack of validation of the parameters of the
SProcSecurityGenerateAuthorization SProcRecordCreateContext
functions makes it possible for a specially crafted request to trigger
the swapping of bytes outside the parameter of these requests, causing
memory corruption.
(cherry picked from commit 95d162c438)
2008-06-11 11:27:00 -04:00
Matthieu Herrb e83c79701f CVE-2008-1379 - MIT-SHM arbitrary memory read
An integer overflow in the validation of the parameters of the
ShmPutImage() request makes it possible to trigger the copy of
arbitrary server memory to a pixmap that can subsequently be read by
the client, to read arbitrary parts of the X server memory space.
(cherry picked from commit 063f18ef6d)
2008-06-11 11:27:00 -04:00
Matthieu Herrb 69b173c699 CVE-2008-2360 - RENDER Extension heap buffer overflow
An integer overflow may occur in the computation of the size of the
glyph to be allocated by the AllocateGlyph() function which will cause
less memory to be allocated than expected, leading to later heap
overflow.
(cherry picked from commit c5f69b297b)
2008-06-11 11:27:00 -04:00
Matthieu Herrb b251fdd9d9 CVE-2008-2361 - RENDER Extension crash
An integer overflow may occur in the computation of the size of the
glyph to be allocated by the ProcRenderCreateCursor() function which
will cause less memory to be allocated than expected, leading later to
dereferencing un-mapped memory, causing a crash of the X server.
(cherry picked from commit 5257a0f83d)
2008-06-11 11:27:00 -04:00
Matthieu Herrb edd2cac9fa CVE-2008-2362 - RENDER Extension memory corruption
Integer overflows can occur in the code validating the parameters for
the SProcRenderCreateLinearGradient, SProcRenderCreateRadialGradient
and SProcRenderCreateConicalGradient functions, leading to memory
corruption by swapping bytes outside of the intended request
parameters.
(cherry picked from commit 9171206db3)
2008-06-11 11:27:00 -04:00
Matthieu Herrb 6de2855b88 CVE-2008-1379 - MIT-SHM arbitrary memory read
An integer overflow in the validation of the parameters of the
ShmPutImage() request makes it possible to trigger the copy of
arbitrary server memory to a pixmap that can subsequently be read by
the client, to read arbitrary parts of the X server memory space.
2008-06-10 12:31:11 -06:00
Matthieu Herrb ebd916314d CVE-2008-1377 - RECORD and Security extensions memory corruption
Lack of validation of the parameters of the
SProcSecurityGenerateAuthorization SProcRecordCreateContext
functions makes it possible for a specially crafted request to trigger
the swapping of bytes outside the parameter of these requests, causing
memory corruption.
2008-06-10 12:30:54 -06:00
Matthieu Herrb a1733327aa CVE-2008-2362 - RENDER Extension memory corruption
Integer overflows can occur in the code validating the parameters for
the SProcRenderCreateLinearGradient, SProcRenderCreateRadialGradient
and SProcRenderCreateConicalGradient functions, leading to memory
corruption by swapping bytes outside of the intended request
parameters.
2008-06-10 12:30:46 -06:00
Matthieu Herrb 5677751a04 CVE-2008-2361 - RENDER Extension crash
An integer overflow may occur in the computation of the size of the
glyph to be allocated by the ProcRenderCreateCursor() function which
will cause less memory to be allocated than expected, leading later to
dereferencing un-mapped memory, causing a crash of the X server.
2008-06-10 12:30:31 -06:00
Matthieu Herrb f7c40a003d CVE-2008-2360 - RENDER Extension heap buffer overflow
An integer overflow may occur in the computation of the size of the
glyph to be allocated by the AllocateGlyph() function which will cause
less memory to be allocated than expected, leading to later heap
overflow.
2008-06-10 12:30:06 -06:00
Daniel Stone 8259d19f71 Xi: event_{x,y} should refer to the extended device (bug #16289)
ProcessOtherEvents was unconditionally stomping the root_{x,y}
co-ordinates provided by GetPointerEvents with those of the core
pointer, meaning that both root_{x,y} and event_{x,y} reported to
clients would reflect the sprite's position, not the position reported
by the device that generated the DeviceMotionNotify or the
DeviceButton{Press,Release} event in the first place.

For key events we still take the sprite's co-ords, as we're delivering
to the focus, which is the (VCP) sprite.

Not cherry-picked from master as MPX fixes this anyway, by taking the
co-ords of the sprite the device moves (be it visible or no).
2008-06-10 18:33:57 +03:00
Julien Cristau 4e3cf7cd89 Add xkbstr.h and xkbsrv.h to sdk_HEADERS
(cherry picked from commit 150c2f55a5)
2008-06-09 17:31:10 -04:00
Adam Jackson c7c43285b1 Merge branch 'server-1.5-branch' of git+ssh://git.freedesktop.org/git/xorg/xserver into server-1.5-branch 2008-06-09 17:06:41 -04:00
Michel Dänzer facf271b05 EXA: Fix exaGetPixmapFirstPixel() crash if the driver has a CreatePixmap hook.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16243
(cherry picked from commit 6b96281100)
2008-06-09 14:11:46 -04:00
Paulo Cesar Pereira de Andrade 60990c69b4 Correct a NULL pointer deference
The problem happens if Monitor/Card combo doesn't provide EDID info,
and the XFree86-VidModeExtension extension is used.

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
(cherry picked from commit c8af7ce35a)
2008-06-09 14:09:39 -04:00
Michel Dänzer 1667ed6e24 EXA: Don't migrate twice in exaImageGlyphBlt.
exaPrepareAccess already handles migration.
(cherry picked from commit f6d61d3d86)
2008-06-09 14:04:21 -04:00
Michel Dänzer 6dee3fdf18 EXA: Don't suggest exaCopyDirty be inlined.
Leave the decision to the compiler toolchain.
(cherry picked from commit d733043982)
2008-06-09 14:04:01 -04:00
Michel Dänzer 3943a3a567 EXA: Specify region used for source pixmap migration in exaCopyNtoN.
Avoids excessive migration overhead in some pathological cases. See
http://bugs.freedesktop.org/show_bug.cgi?id=15845 .
(cherry picked from commit 3baf3b42e0)
2008-06-09 14:03:36 -04:00
Drew Parsons c00ff932f8 Disable D-BUS from Xprint.
Use dummy config functions to replace those from config/config.c, and
therefore do not link Xprt with $CONFIG_LIB.

Works around an endlessly spinning loop in dix/dispatch.c::Dispatch()
(WaitForSomething() not waiting) when built with dbus, which was
causing Xprt to use 95% cpu.
(cherry picked from commit 2a3d1421e0)
2008-06-09 13:57:03 -04:00
Drew Parsons 2f994cb00e Create dix/libXpdix.la for Xprint-specific build of libdix.la
(cherry picked from commit 4e2c6dbabdbbaaca213fd08edd422de15d0900cc)

required because of commit 7c0709a736,
which made requestingClient in dix specific to Xprint only.
Add to XPRINT_LIBS in hw/xprint/Makefile.am in front of
$(XSERVER_LIBS) to override definitions in libdix.la for standard xservers.

Follows 571206832d (providing -DXPRINT
to xprint subdirs).

Note it may be possible to restructure the code so that
requestingClient is stored elsewhere than in dix. See discussions
following http://lists.freedesktop.org/archives/xorg/2008-March/033844.html
If this is done it may be possible to revert this commit (if not 571206...).
(cherry picked from commit 966ae1781f)
2008-06-09 13:56:59 -04:00
Drew Parsons 30774d6b3c Define XPRINT in XPRINT_CFLAGS (configure.ac)
-DXPRINT had only been set for Xprt in hw/xprint/Makefile.am
After commit 7c0709a736 it is also
required for ps/PsArea.c and PsFonts.c to ensure ‘requestingClient’ is
defined, so make it a global Xprint definition in configure.ac.
(cherry picked from commit 28a6719fd486d9a9cecad0b057d9ea7c59c66055)
(cherry picked from commit 571206832d)
2008-06-09 13:56:53 -04:00
Tilman Sauerbeck 200d676be2 EXA: Set pixmap->accel_blocked on the screen pixmap, too.
(cherry picked from commit 3f081b4de5)
2008-06-09 13:44:37 -04:00
Tilman Sauerbeck 2df83b491e EXA: Update sys_pitch/fb_pitch in exaModifyPixmapHeader.
exaModifyPixmapHeader now also only evaluates arguments that have a
meaningful value.
(cherry picked from commit 26c1801a27)
2008-06-09 13:44:32 -04:00
Michel Dänzer 0fba91a532 EXA: Offscreen memory eviction improvements.
* Make sure available areas are considered to have no eviction cost. This seems
  to help for https://bugs.freedesktop.org/show_bug.cgi?id=15513 but I'm afraid
  that may just be coincidence.
* Only calculate eviction cost of each area once for each eviction pass.
  Safeguard against potential (though unlikely) division by zero.
* Cosmetic enhancements: Name eviction cost related variables 'cost' instead of
  'score' to emphasize that smaller values are better, update Doxygen file
  comment to the way eviction works now.
(cherry picked from commit 6c95fae1e9)
2008-06-09 13:44:26 -04:00
Dave Airlie 50e77eb838 int10: add pci_device_enable support on Linux
(cherry picked from commit ea4ec9e998)
2008-06-09 13:29:32 -04:00
Aaron Plattner 77313bdc76 CreateColormap returns Success on success, not TRUE.
Fixes a problem where enabling color index overlays disables the RENDER
extension.
(cherry picked from commit 607b0d09ea)
2008-06-09 09:59:42 -07:00
Adam Jackson 9211a10b98 xserver 1.4.99.902 2008-05-21 17:52:23 -04:00
Aaron Plattner b69c74d14b Short-circuit PanoramiXTranslateVisualID after verifying that the visual actually exists first.
This allows using PanoramiXTranslateVisualID to test whether a given visual made
it through PanoramiXVisualConsolidate.
(cherry picked from commit 8b3d26f5b6)
2008-05-20 14:11:37 -07:00
Adam Jackson 5efe36f7af Fix reduced-blanking mode filtering in RANDR 1.2.
If the monitor isn't reduced-blanking (either through EDID logic, or
config file setting), then remove RB modes from the default pool.  Any
RB modes from the driver and config file pools will stick around though;
you asked for them, you got them.
(cherry picked from commit 0178b6a4ab)
2008-05-19 11:27:58 -04:00
James Cloos e644d2e73f Prevent the -wm command line option from causing a SEGV
The -wm (when mapped) option for the BackingStore support has been
causing the server to dereference a NULL pointer.

This has probably been the case since backing store has been
implemented on top of Composite.

It looks like (some of?) Composite didn’t expect its WIndowPtr
argument to be the root window.

In Composite’s compCheckRedirect() function we now avoid calling
compAllocPixmap() and compFreePixmap() when the pWin pointer’s
parent member is NULL, as is it the case with a server’s root window.

This addresses:

https://bugs.freedesktop.org/show_bug.cgi?id=15878

(cherry picked from commit 04211c3532)
2008-05-16 13:01:34 -04:00
Adam Jackson 0230f39fa3 RANDR 1.1 compat: remove senseless comparison against the virtual size.
(cherry picked from commit aad1c37b09)
2008-05-16 11:11:40 -04:00
Adam Jackson 95985256ef xf86SetDesiredModes(): Skip disabled CRTCs first thing.
(cherry picked from commit 14726b776d)
2008-05-16 11:11:40 -04:00
Adam Jackson bedcf98558 Fix initial mode selection even harder.
The first guess used to be "is the preferred mode for one output the
preferred mode on all outputs".  Instead, do "find the largest mode that's
preferred for at least one output and available on all outputs".
(cherry picked from commit 459f34b089)
2008-05-16 11:11:40 -04:00
Adam Jackson bd50c41f6f Redo RANDR compatibility output selection.
Old logic was just the first one that happened to have an associated
CRTC.  The new logic tries to find one that's definitely connected, has
probed modes, and has the largest candidate mode.
(cherry picked from commit 96111c1547)
2008-05-16 11:11:40 -04:00
Adam Jackson 0b031442fe Re-add sync range inference from legacy setup to RANDR 1.2.
(cherry picked from commit a4bbe1c8bc)
2008-05-16 11:11:39 -04:00
Adam Jackson b053c9768b Default X-SELinux to off.
Applied only to 1.5 branch for purposes of release stability.  Reevaluate
this when we do 1.6.
2008-05-16 10:06:27 -04:00
Adam Jackson cfff55a2bb Fix fbdevhw initialization for PCI drivers.
graphics/fb%d, not graphics:fb%d.  Thanks sysfs.  Thysfs.
(cherry picked from commit 86678e7cc2)
2008-05-16 10:03:24 -04:00
Adam Jackson 1bd229d4ac Fix hal shutdown crash.
Removing the device invalidates its ->next pointer.  Copy it aside before
destroying the device.
(cherry picked from commit f52f6c5c7e)
2008-05-16 09:50:38 -04:00
Hans de Goede 18a1d643bc Prefer glxvisuals with stencil buffer for default visuals
The first fbconfig which has a depthbuffer > 0  and doublebuf is choosen
when associating fbconfigs with the visuals, indepenent of stencil bits.
This happens to work ok on intel as there all fbconfigs with a
depthbuffer > 0 also have stencil bits.

This patch fixes this by first trying to get a fbconfig for default X visuals
with both stencilbuf, depthbuf and doublebuffering, and if that fails fallback
to trying to get one with only a depthbuf and doublebuffering.
(cherry picked from commit f6e22d69af)
2008-05-16 09:45:30 -04:00
Alan Coopersmith ce1f6de2e8 When XKB fails to open rules file, log the file name, not the NULL file pointer
(cherry picked from 7cdc19b29d commit)
2008-05-13 16:40:46 -07:00
Aaron Plattner 8afd1d62f6 Bug #14692: Allow drivers to have a say in Xinerama visual consolidation.
Create a new exported global variable, XineramaVisualsEqualPtr.  Use this
pointer to decide whether two visuals are equal during visual consolidation.
This pointer can be wrapped, which allows drivers and extensions to control
which visuals are consolidated.  A wrapper can reject the visuals without
calling down, but must call down and return that result if it deems the visuals
equal.  This ensures that all layers agree that the visuals are equal.

Pass the screen of the other visual into the VisualsEqual callchain.

Don't free PanoramiXVisuals since we need it for PanoramiXTranslateVisualID.

Don't skip the first visual on the other screen in PanoramiXMaybeAddVisual.

Skip the loop in PanoramiXTranslateVisualID if screen is 0.
(cherry picked from commit c50b5d9789)
2008-05-12 16:43:50 -07:00
Julien Cristau f2278a882f kdrive: allow disabling Composite
KdInitOutput() used to enable Composite when it was disabled by default,
but now this hack prevents ``-extension Composite'' from working.
Remove it, as Composite is enabled by default anyway.
(cherry picked from commit 9dfb525f6c)
2008-05-11 23:38:03 +02:00
Adam Jackson 64948dc667 Bug #13104: Remove broken XAA a1 glyph fast path.
(cherry picked from commit f17ba5d584)
2008-05-08 16:12:01 -04:00
Adam Jackson f2aa0000a2 Bug #13104: Don't let XAA glyph pixmaps anywhere near video memory.
Since glyphs are stored in pixmaps now, they can make their way into VRAM,
which invalidates a bunch of fast-path assumptions in the XAA code.  Thus
you end up doing color-expands or WriteBitmap from la-la land and your
aliased glyphs go all funny.

Since XAA isn't ever growing the ability to do sane glyph accel, just force
glyph pixmaps into host memory by catching them at CreatePixmap time.
(cherry picked from commit 718652eaf9)
2008-05-08 16:09:56 -04:00
Daniel Stone f7a9d30f82 XKB: Actually explain keymap failures
When something went wrong building a keymap, try to explain to the user
what it actually was, instead of the dreaded 'Failed to load XKB keymap'
catch-all.
(cherry picked from commit cf20df39cc)
2008-05-07 22:56:17 +03:00
Keith Packard 3e71527048 Empty the borderClip of manual redirect windows. (bug 15823)
Thanks to Owen Taylor for root-causing this one.

If a TreatAsTransparent window has any area in the borderClip, that will be
added to the totalClip region for use by other windows. That's wrong.
Instead, simply empty the borderClip for TreatAsTransparent windows right up
front.
(cherry picked from commit 6c1accce87)
2008-05-06 13:03:58 -04:00
Jordan Crouse fd0ec73bcb xf86: Change AutoConfig driver for PCI ID 022:2091 to 'geode'
(cherry picked from commit 4fa89fbe18)
2008-04-30 11:51:08 +03:00
Alan Coopersmith 7c05b4c621 Bug 14247: If pkg-config can't find openssl.pc, just link with -lcrypto
X.Org bugzilla #14247 <http://bugs.freedesktop.org/show_bug.cgi?id=14247>
(cherry picked from b1ae7c79db commit)
2008-04-24 19:06:18 -07:00
Dave Airlie 947419bce2 glx: test for valid read and draw privates before using them
this should fix a bug where f-spot exiting blows up the X server
(cherry picked from commit ae982a27e4)
2008-04-24 16:58:14 +10:00
Dave Airlie d7db6dd1a1 GLcore: make googleearth not crash the server on sw-rendering.
I don't think this is the 100% correct answer as I get log spam saying
(EE) DoSwapInterval: cx = 0x98b8998, GLX screen = 0x96dd780
(EE) AIGLX: cx->pGlxScreen->swapInterval == NULL

but thats better than X exiting in my book.
(cherry picked from commit a368ab757e)
2008-04-24 16:58:03 +10:00
Kristian Høgsberg 5a2b538c1b Make DRI2 a serverlayout/serverflags option.
Add xf86DRI2Enabled() to export the value of the setting.
(cherry picked from commit 35982bc109)
2008-04-15 11:48:33 +10:00
Tilman Sauerbeck 46b74e8450 EXA: Update pixmaps' accel_blocked field in ModifyPixmapHeader.
(cherry picked from commit f133d85778)
2008-04-15 11:48:28 +10:00
Tilman Sauerbeck 4161c9781b EXA: Teach exaCompositeFallbackPictDesc() about x8r8g8b8.
(cherry picked from commit bb8868540f)
2008-04-15 11:48:23 +10:00
Dave Airlie 32604d0f13 glx: silly nitpick...
even though i and j are the same, we use i to derefence visuals everywhere else
(cherry picked from commit 3e12c5bb67)
2008-04-15 11:48:10 +10:00
Dave Airlie 738aea7a94 glcore: make visualRating GLX_NONE - note GLX_NONE is not == 0
Finally glxinfo returns the set of 3 visuals and glxgears works again for me on
sw rendering
(cherry picked from commit 97565c0f39)
2008-04-15 11:48:03 +10:00
Dave Airlie d6916b149d glcore: zero fbconfigs before filling them in.
I'm not sure this the complete proper solution, perhaps it should explicitly fill
in ever field.

This at least makes glxinfo on glcore return sensible information, it doesn't make
gears work yet though.
(cherry picked from commit c61087c827)
2008-04-15 11:47:56 +10:00
Matt Turner db00d4a4dc Check for __x86_64__ when we check for __amd64__
It seems Intel C Compiler neglects to define __amd64__, __amd64, or
amd64, but *does* define __x86_64__.
(cherry picked from commit 1fa4de80fc)
2008-04-15 11:47:48 +10:00
Tilman Sauerbeck d2f4471933 Fixed configure.ac for autoconf 2.62. 2008-04-15 11:47:23 +10:00
Peter Hutterer 099d1bef22 dix: Call DeleteInputDeviceRequest from CloseDownDevices (#14418)
The DDX (xfree86 anyway) maintains its own device list in addition to the one
in the DIX. CloseDevice will only remove it from the DIX, not the DDX. If the
server then restarts (last client disconnects), the DDX devices are still
there, will be re-initialised, then the hal devices come in and are added too.
This repeats until we run out of device ids.

This also requires us to strdup() the default pointer/keyboard in
checkCoreInputDevices.

X.Org Bug 14418 <http://bugs.freedesktop.org/show_bug.cgi?id=14418>
(cherry picked from commit 6d22a9615a)
2008-04-15 11:47:04 +10:00
Dave Airlie 566037a914 quirk: add quirk for ACR 640x350 default mode is wrong
RH #440186
(cherry picked from commit b19027fbae)
2008-04-15 11:46:36 +10:00
Michel Dänzer 0327322708 Fix off-by-one error in ProcXResQueryClients().
Fixes memory corruption reported at
http://bugs.freedesktop.org/show_bug.cgi?id=14004 .
(cherry picked from commit 0d1746995d)
2008-04-09 15:34:16 +02:00
Adam Tkac 85b855f26f Fix Xvfb input when building against current X sources.
(cherry picked from commit 726dcd9e4e)
2008-04-07 10:34:18 -04:00
Julien Cristau fe87d921da Fix the clock_gettime check for glibc-based non-Linux systems
We need to define _POSIX_C_SOURCE on glibc, not just Linux, so add a new
test for the __GLIBC__ macro.
(cherry picked from commit 6c0cfe3d43)
2008-04-07 10:32:13 -04:00
Adam Jackson 9a908769e6 Fix PCI config space cycles from int10 emulator.
The top bit of 0xCF8 is an enable bit, not part of the domain.  Sending
cycles to domain 128 instead of domain 0 is rarely the right thing to do.
(cherry picked from commit cc7c045bae)
2008-04-07 10:32:07 -04:00
Eric Anholt bd91565ac8 Fix clock_gettime presence detect on FreeBSD.
For non-Linux, _POSIX_C_SOURCE and friends restrict symbols defined rather
than enabling defines of symbols.  Additionally, CLOCK_MONOTONIC was
apparently added to the standard around 2000 anyway, not 1993.
(cherry picked from commit d1de3dda8e)
2008-04-07 10:32:04 -04:00
Dave Airlie b2704de8a7 quirk: add quirk for ACER EDID
(cherry picked from commit f0915fb3c4)
2008-04-07 10:31:46 -04:00
Hong Liu 8ccdaa288a Bug #15160: quirk Proview AY765C
prefer first detailed timing
(cherry picked from commit ebc56aca8b)
2008-04-07 10:30:38 -04:00
Goneri Le Bouder 8059b57f9b xfree86: don't crash in AutoConfig if the primary device is not pci
Only call matchDriverFromFiles() if we found a pci device.
Debian bug#472823 (http://bugs.debian.org/472823).
(cherry picked from commit 9500033b9e)
2008-04-07 10:30:26 -04:00
Fredrik Höglund 841aa08ea4 EXA: Optimize the eviction scanning loop in exaOffscreenAlloc.
Reduce the cost of the inner loop, by keeping a set of pointers to the
first and the last areas in the series, subtracting the cost of the first
area from the score, and adding the cost of the last area while walking
the list.  This commit also moves the scanning loop from exaOffscreenAlloc
into a separate function.

Idea by Michel Dänzer.
(cherry picked from commit 8074676d2d)
2008-04-07 10:29:00 -04:00
Fredrik Höglund 2e4b72dd84 EXA: Improve the algorithm used for tracking offscreen pixmap use.
Replace the current score keeping algorithm with a rolling counter that's
incremented in ExaOffscreenMarkUsed, with the previous value being stored
in the area.  exaOffscreenAlloc uses the difference between the counter
value and the value in the area when deciding which area to evict.
It now also takes the size of the areas into account, and favors evicting
smaller areas.

The credit for these ideas goes to Michel Dänzer.
(cherry picked from commit 93d876891d)
2008-04-07 10:28:54 -04:00
Daniel Stone 32b5c67145 gitignore: Add two more bits
Get slightly better at ignoring vim swap files, and let people keep
local changes if they want to.
(cherry picked from commit 7034484f08)
2008-04-07 10:27:04 -04:00
Dave Airlie a2fcdfd5f9 quirk: fix LPL monitors properly.
no point having a h cm fix when we really want to copy the sizes from the
other place.

RH BZ 435216
(cherry picked from commit c747030a49)
2008-04-07 10:26:59 -04:00
Hasso Tepper db62e494ff configure.ac: DragonFly BSD support
Add support for DragonFly BSD, which is just the same as FreeBSD for all
of these cases.
(cherry picked from commit 0f87b41a43)
2008-04-07 14:11:03 +03:00
Owen W. Taylor 685a04c2bf EXA: Fix TS origin computation when implementing RenderComposite with tiling.
(cherry picked from commit 6b1a27023e)
2008-04-07 11:15:19 +02:00
Kristian Høgsberg ff886a66de Convert __DRIconfigs after we've made sure createNewScreen succeeded.
(cherry picked from commit ec17900f52)
2008-04-04 11:47:09 -04:00
Kristian Høgsberg d1dd774910 Only autoload RECORD if it was enabled.
(cherry picked from commit 16a8ce7558)
2008-04-04 11:47:08 -04:00
Kristian Høgsberg 81af92f5d9 Pick up dri2proto from the standard proto header include path. 2008-04-02 19:22:05 -04:00
Kristian Høgsberg 856d9dd615 Send the GLX_EXT_texture_from_pixmap attributes to the client. 2008-04-02 19:06:40 -04:00
Kristian Høgsberg bbd87f85a3 Add @XORG_CFLAGS@ to satisfy xf86* includes.
Pointed out by Hasso Tepper.
2008-04-02 18:00:06 -04:00
Kristian Høgsberg 2478122793 dri2: Unbreak glcore visual setup. 2008-04-02 12:59:25 -04:00
Xiang, Haihao 7d97c19c2d dri2: fix crasher if DRI2Connect fails 2008-04-02 12:03:12 -04:00
Kristian Høgsberg 2156bdf3b7 Implement DRI2 direct rendering and update AIGLX to DRI interface changes.
Get rid of glcontextmodes.[ch] from build, rename __GlcontextModes to
__GLXcontext.  Drop all #includes of glcontextmodes.h and glcore.h.
Drop the DRI context modes extension.

Add protocol code to DRI2 module and load DRI2 extension by default.
(cherry picked from commit c40e0b51f0)
2008-04-01 11:58:27 -04:00
Thomas Jaeger a45586da2b XKB: Fix processInputProc wrapping
If input processing is frozen, only wrap realInputProc: don't smash
processInputProc as well.  When input processing is thawed, pIP will be
rewrapped correctly.

This supersedes the previous workaround in 50e80c9.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 37b1258f0a)
2008-04-01 15:32:01 +03:00
Eamon Walsh bde2890148 XSELinux: Add a request to get a client's context from a resource ID.
(cherry picked from commit 9f56fc5806)
2008-03-31 19:22:53 -04:00
Eamon Walsh c26bccf417 XSELinux: Add xorg.conf option for permissive/enforcing/disabled.
Patch by Joe Nall.

The option goes in the "extmod" subsection.
TODO: Make it easier for extension modules to handle their own options.
(cherry picked from commit b5f98fcea2)
2008-03-28 14:24:06 -04:00
Adam Jackson ae8edf3ee7 Fix that last commit.
I can apply patches, really.
(cherry picked from commit 333e7123dc)
2008-03-25 12:48:44 -04:00
Sascha Hlusiak ff99a3aa2b Fix getValuatorEvents to compute number of valuators correctly.
(cherry picked from commit e7a3644255)
2008-03-25 12:33:03 -04:00
David Nusinow 2d312eaf4f Bug #10016: Implement WM_CLASS hints in Xephyr.
(cherry picked from commit f028e245a7)
2008-03-24 16:59:22 -04:00
Adam Jackson d6ec5eaded Bug #11510: Fix build without RECORD.
(cherry picked from commit 862ff9ac92)
2008-03-24 13:38:01 -04:00
Adam Jackson f250352d2e Bug #11508: Fix build without XV.
(cherry picked from commit 87bfd3bd96)
2008-03-24 13:34:30 -04:00
Adam Jackson fdf927c2cd Bug #13962: Re-arm the DPMS timer when re-enabling DPMS.
(cherry picked from commit 536f2ff538)
2008-03-24 12:24:38 -04:00
Julien Cristau 80968c4a91 xaa: use xf86ReturnOptValBool instead of xf86IsOptionSet
The latter doesn't return the option's value, just whether it's present
in the configuration.
(cherry picked from commit 4217ba0cf0)
2008-03-24 10:22:41 -04:00
Julien Cristau f40bd686e5 exa: use xf86ReturnOptValBool instead of xf86IsOptionSet
The latter doesn't give you the option's value, it just tells you if
it's present in the configuration.  So using Option "EXANoComposite" "false"
disabled composite acceleration.
(cherry picked from commit 6b9d2bb1f7)
2008-03-24 10:22:37 -04:00
Michel Dänzer 84a27f7a92 Fix RandR 1.2 driver interface conversion of two colour cursors to ARGB
This patch (and not setting HARDWARE_CURSOR_BIT_ORDER_MSBFIRST on big endian
platforms) fixes it for me with the radeon driver and doesn't break intel.

Correct patch this time :)
(cherry picked from commit da973e962d)
2008-03-24 10:20:14 -04:00
Alan Coopersmith a65e9722c4 Make Xevie private symbol names less generic
Makes it easier to figure out what you're seeing in the stack trace
instead of wondering where in the server "ProcSend" is.
(cherry picked from commit 060a99444e)
2008-03-24 10:20:03 -04:00
Alan Coopersmith 0aa3b971b4 Xevie cleanups, byteswapping fixes & request length check fixes
(cherry picked from commit f37046984d)
2008-03-24 10:19:39 -04:00
Dodji Seketeli 21dc186245 [Xephyr/DRI] correctly route motion events targeted at GL drawable
(cherry picked from commit cdadd2ff9b)
2008-03-24 10:18:52 -04:00
Jesse Barnes 4f0755d6d4 Fail CRTC configuration if !vtSema
Unless we check for vtSema before calling into the CRTC and output callbacks,
we may end up trying to access video memory that no longer exists, leading to a
crash.  So if we don't have vtSema, return FALSE to the caller, indicating that
we didn't do anything.

Fixes #14444.
(cherry picked from commit bee2ddf35f)
2008-03-24 10:09:23 -04:00
Matthieu Herrb 727e22c830 test for the presence of pci_system_init_dev_mem() before calling it.
This avoids creating a dependency on -current libpciaccess for
BSD systems other than OpenBSD (which don't otherwise need it).
(cherry picked from commit db248ffb84)
2008-03-24 10:09:09 -04:00
Donnie Berkholz a399b77e8f Xephyr: Build fix: Port across XF86dri.c changes from Mesa.
(cherry picked from commit aa231f28d5)
2008-03-24 10:08:47 -04:00
Donnie Berkholz c81a8c3eac Xephyr: Distribute ephyrdriext.h in tarballs.
(cherry picked from commit a955c3b587)
2008-03-24 10:08:40 -04:00
Daniel Stone 6b75b44d9e XkbCopyKeymap: Fix broken indentation
An astute observer will note that the entirety of XkbCopyKeymap is indented
with spaces, and no tabs whatsoever, and not commit changes which break the
otherwise consistent indentation.
A non-astute observer will note the breakage when the commit mail comes
through with clearly broken indentation.
A polite, non-astute, observer will then fix it.

C'est la vie.
(cherry picked from commit 090b26db76)
2008-03-24 10:08:30 -04:00
Eamon Walsh 98249dfa98 XSELinux: Do a check for whether background "None" is allowed.
(cherry picked from commit 3bbd77ff98)
2008-03-20 21:34:42 -04:00
Eamon Walsh d08bb7040c XSELinux: Correctly handle some permission bits that are used more than once.
(cherry picked from commit e323bb426c)
2008-03-20 21:34:31 -04:00
Eamon Walsh c6ac4d4f4d Apply __glXDisp_GetVisualConfigs message patch
From http://bugs.freedesktop.org/show_bug.cgi?id=13863

Problem was that the glxcmds.c __glXDisp_GetVisualConfigs
function left garbage in the tail end of the message used for extensions.
(cherry picked from commit edad0a9dfe)
2008-03-18 18:06:37 -04:00
Adam Jackson 4a61cf3b08 Fix a stray use of ALLOCATE_LOCAL.
(cherry picked from commit 57d48d94b8)
2008-03-14 14:46:34 -04:00
Adam Jackson 43739b9a32 RANDR 1.2: Fix initial mode aspect ratio match in a corner case.
Actually more like in the mainline case, where the ideal mode happens to
be the very first aspect match on the first monitor.  But let's not
split hairs.
(cherry picked from commit 8248537722)
2008-03-14 14:25:27 -04:00
Bart Trojanowski 92cffb8cc2 Bug #14332: Fix PCI access cycles from x86emu.
The address written to 0xcf8 contains the PCI slot address to send the
config cycle to.  However, we would ignore that and always send the
cycle to the device whose BIOS we were running.  This breaks some
integrated graphics platforms that have explicit knowledge about the
system's host bridge, for example.
2008-03-14 14:10:22 -04:00
Doug Chapman db26f32d0d Bug #14091: Fix build (and runtime) on ia64. 2008-03-14 14:10:11 -04:00
Adam Jackson 95f6d8822d RANDR 1.2: Fix the RANDR 1.1 screen size estimation to approach reality.
While the ScreenRec's notion of size in millimeters would get updates,
the RANDR 1.1 notion wouldn't, so your screen would appear to be square
and probably at some ludicrous DPI.
2008-03-14 14:10:06 -04:00
Adam Jackson e4dee1626d RANDR 1.2: Don't report a square resolution to RANDR 1.1 clients.
It can't possibly do anything useful, and older versions of Gnome (and
proably others) get very confused by it.  So do the drivers, for that
matter.
2008-03-14 14:09:57 -04:00
Mark Kettenis ce70eb1fe3 OpenBSD support for libpciaccess.
xserver and libpciaccess both need to open /dev/xf86, which can only
be opened once.  I implemented pci_system_init_dev_mem() like Ian
suggested.  This requires some minor changes to the BSD-specific
os-support code.  Since pci_system_init_dev_mem() is a no-op on
FreeBSD this should be no problem.
2008-03-14 14:09:45 -04:00
Kristian Høgsberg b02d11e629 DRI2: Add DRI2AuthConnection().
DRI2 uses the same authentication scheme as XF86DRI, so implement this
entry point so DRI2 protocol code can access it.
2008-03-14 14:08:12 -04:00
Keith Packard 54c31572d5 XkbCopyKeymap was mangling doodads and overlays 2008-03-14 14:03:47 -04:00
Kristian Høgsberg 02feb14a67 GLX: Track changes to DRI_TEX_BUFFER extension.
We now just pass in the __DRIdrawable.
(cherry picked from commit 01c2e01f2a)
2008-03-10 18:18:17 -04:00
Kristian Høgsberg 12829f1e91 DRI2: Return event buffer head index in DRI2CreateDrawable.
And pass it to the DRI driver in AIGLX.
(cherry picked from commit acedc03367)
2008-03-10 18:18:14 -04:00
Kristian Høgsberg 4aaf048b5a Fix DRI2 texture target for GLX_EXT_texture_from_pixmap.
Thanks to Dennis Kasprzyk for pointing it out and for reminding me to
commit it.
(cherry picked from commit 9abaad115c)
2008-03-10 18:18:11 -04:00
Adam Jackson 921cbc5803 Add the "amd" driver to magic driver selection. 2008-03-10 13:40:23 -04:00
Adam Jackson e5bd75e11f Bug #14927: Fix the math for xf86NumDefaultModes.
(cherry picked from commit 0f6aaf636b)
2008-03-10 09:14:38 -04:00
Adam Jackson ef702d5866 Size xf86DefaultModes explicitly.
i.e., don't check for the end of the list by ->name == NULL, since that
won't work now.  Fix the consumers of xf86DefaultModes to use the new
explicit size as well.
2008-03-07 09:25:34 -05:00
Adam Jackson b260febcec Fix segfault when a monitor exists but has no modes.
Thanks to Zhenyu Wang for finding this.
(cherry picked from commit 3fcb6445dc)
2008-03-07 08:31:40 -05:00
Adam Jackson 375908557f xserver 1.4.99.901 2008-03-06 00:19:09 -05:00
Adam Jackson 2a47accff8 Fix distcheck. 2008-03-05 23:56:49 -05:00
Eamon Walsh 9de621afee xselinux: Implement polyinstantiation support and related protocol.
(cherry picked from commit d4101140f4)
2008-03-04 22:42:53 -05:00
Adam Jackson e4d92a13e8 Make xf86InitialConfiguration slightly smarter.
Old heuristic was to find the first monitor that expressed a preference,
then attempt to get all other monitors to agree.  This doesn't work
particularly well when the two sets of modes don't precisely intersect,
you get overlapping-but-not-identical output geometry and things go wrong.

New heuristic is:
- Exact user preference, if given
- Exact output preference, if the same for all outputs
- Best (largest) mode of modes common to all outputs:
  - with the same aspect ratio as all outputs (may be NULL)
  - with 4:3 aspect ratio
- Then the old heuristic to try to get something lit

Note that it is simply not doable to have a reliable initial output guess if
you insist on trying to clone all outputs together.  It's far too easy to
end up with displays that simply don't have modes in common.  We need to
switch to right-of placement someday, once we're not limited to CRTC size
limits and we have working multi-GPU in RANDR.
(cherry picked from commit 27e7dacbf7)
2008-03-04 13:01:15 -05:00
Adam Jackson 5afdba241e Remove all mention of the vga driver from the config logic.
(cherry picked from commit 95df04b744)
2008-03-04 13:01:03 -05:00
Eamon Walsh 926f32df3c XACE: Check the return value of the selection create hook call.
(cherry picked from commit 056a2ce02c)
2008-03-04 02:46:20 -05:00
Eamon Walsh 7f74ba1b77 dix: Convert selection list to a linked list.
Fixes a bug where pointers were being invalidated after a realloc.
(cherry picked from commit 72f2197545)
2008-03-04 02:17:13 -05:00
Daniel Stone 1bda57a41e XKB: Fix initial map setting on startup
Due to an unwitting sense inversion when eliminating XkbFileInfo, we were
setting the complete wrong keymap on startup (non-XKB map if we had an XKB
map available, or the XKB map if we didn't have any available).  Invert the
sense properly, and add two small bits that also went missing in that commit.
(cherry picked from commit 0bd0f90d7c)
2008-03-03 23:23:22 -05:00
Adam Jackson 5d2946655b RANDR 1.2: Inherit PreferredMode from the global configuration, if any.
If you don't do this, then Modes "800x600" in the Display subsection will
be dutifully ignored and the driver will start at whatever resolution it
feels like.
2008-03-03 15:52:50 -05:00
Adam Jackson 28c156e2ba Fix Motif menu drawing in Xnest.
See also Red Hat bug #229350, OpenSolaris bug #6366490.
2008-03-03 15:52:42 -05:00
Adam Jackson 71037ebfb4 xf86DDCMonitorSet: Honor the DisplaySize from the config file.
We honor sync ranges and pixel clock settings from the config here, no
reason to ignore DisplaySize.
2008-03-03 15:52:32 -05:00
Adam Jackson a9028a492f Branch for 1.5. 2008-03-03 15:04:49 -05:00
285 changed files with 41208 additions and 6828 deletions

3
.gitignore vendored
View File

@ -8,11 +8,12 @@ Makefile.in
*.a
*.o
*~
.*.swp
.*sw?
*.pbxuser
*.mode1v3
obj*
build*
local
aclocal.m4
autom4te.cache
compile

View File

@ -1,14 +0,0 @@
if XQUARTZ
XQUARTZ_SUBDIRS = apple
endif
SUBDIRS = glx mesa $(XQUARTZ_SUBDIRS)
DIST_SUBDIRS = glx mesa apple
WINDOWS_EXTRAS = \
windows/ChangeLog \
windows/glwindows.h \
windows/glwrap.c \
windows/indirect.c
EXTRA_DIST = symlink-mesa.sh $(WINDOWS_EXTRAS)

View File

@ -1,24 +0,0 @@
AM_CFLAGS = $(DIX_CFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/GL/glx \
-I$(top_srcdir)/GL/include \
-I$(top_srcdir)/GL/mesa/glapi \
-I$(top_srcdir)/hw/xquartz \
-I$(top_srcdir)/hw/xquartz/xpr \
-I$(top_srcdir)/miext/damage
if HAVE_AGL_FRAMEWORK
noinst_LIBRARIES = libAGLcore.a
libAGLcore_a_SOURCES = aglGlx.c \
$(top_srcdir)/hw/darwin/quartz/xpr/x-list.c \
$(top_srcdir)/hw/darwin/quartz/xpr/x-list.h \
$(top_srcdir)/hw/darwin/quartz/xpr/x-hash.c \
$(top_srcdir)/hw/darwin/quartz/xpr/x-hash.h \
$(top_srcdir)/hw/dmx/glxProxy/compsize.c
endif
#noinst_LIBRARIES = libCGLcore.a
#libCGLcore_a_SOURCES = \
# indirect.c \
# $(top_srcdir)/hw/dmx/glxProxy/compsize.c

File diff suppressed because it is too large Load Diff

13
GL/glx/.gitignore vendored
View File

@ -1,13 +0,0 @@
glapi.c
glcontextmodes.c
glcontextmodes.h
glthread.c
indirect_dispatch.c
indirect_dispatch.h
indirect_dispatch_swap.c
indirect_reqsize.c
indirect_reqsize.h
indirect_size.h
indirect_size_get.c
indirect_size_get.h
indirect_table.c

View File

@ -1,438 +0,0 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
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, sub license, 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 NON-INFRINGEMENT.
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:
* Kevin E. Martin <kevin@precisioninsight.com>
* Brian E. Paul <brian@precisioninsight.com>
*
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <string.h>
#include <GL/xmesa.h>
#include <GL/internal/glcore.h>
#include <glxserver.h>
#include <glxscreens.h>
#include <glxdrawable.h>
#include <glxcontext.h>
#include <glxutil.h>
#include "glcontextmodes.h"
#include "os.h"
typedef struct __GLXMESAscreen __GLXMESAscreen;
typedef struct __GLXMESAcontext __GLXMESAcontext;
typedef struct __GLXMESAdrawable __GLXMESAdrawable;
struct __GLXMESAscreen {
__GLXscreen base;
int index;
int num_vis;
XMesaVisual *xm_vis;
};
struct __GLXMESAcontext {
__GLXcontext base;
XMesaContext xmesa;
};
struct __GLXMESAdrawable {
__GLXdrawable base;
XMesaBuffer xm_buf;
};
static XMesaVisual find_mesa_visual(__GLXscreen *screen, XID fbconfigID);
static void
__glXMesaDrawableDestroy(__GLXdrawable *base)
{
__GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base;
if (glxPriv->xm_buf != NULL)
XMesaDestroyBuffer(glxPriv->xm_buf);
xfree(glxPriv);
}
static GLboolean
__glXMesaDrawableResize(__GLXdrawable *base)
{
__GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base;
XMesaResizeBuffers(glxPriv->xm_buf);
return GL_TRUE;
}
static GLboolean
__glXMesaDrawableSwapBuffers(__GLXdrawable *base)
{
__GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base;
/* This is terrifying: XMesaSwapBuffers() ends up calling CopyArea
* to do the buffer swap, but this assumes that the server holds
* the lock and has its context visible. If another screen uses a
* DRI driver, that will have installed the DRI enter/leave server
* functions, which lifts the lock during GLX dispatch. This is
* why we need to re-take the lock and swap in the server context
* before calling XMesaSwapBuffers() here. /me shakes head. */
__glXenterServer(GL_FALSE);
XMesaSwapBuffers(glxPriv->xm_buf);
__glXleaveServer(GL_FALSE);
return GL_TRUE;
}
static __GLXdrawable *
__glXMesaScreenCreateDrawable(__GLXscreen *screen,
DrawablePtr pDraw, int type,
XID drawId,
__GLcontextModes *modes)
{
__GLXMESAdrawable *glxPriv;
XMesaVisual xm_vis;
glxPriv = xalloc(sizeof *glxPriv);
if (glxPriv == NULL)
return NULL;
memset(glxPriv, 0, sizeof *glxPriv);
if (!__glXDrawableInit(&glxPriv->base, screen,
pDraw, type, drawId, modes)) {
xfree(glxPriv);
return NULL;
}
glxPriv->base.destroy = __glXMesaDrawableDestroy;
glxPriv->base.resize = __glXMesaDrawableResize;
glxPriv->base.swapBuffers = __glXMesaDrawableSwapBuffers;
xm_vis = find_mesa_visual(screen, modes->fbconfigID);
if (xm_vis == NULL) {
ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
modes->visualID);
xfree(glxPriv);
return NULL;
}
if (glxPriv->base.type == DRAWABLE_WINDOW) {
glxPriv->xm_buf = XMesaCreateWindowBuffer(xm_vis, (WindowPtr)pDraw);
} else {
glxPriv->xm_buf = XMesaCreatePixmapBuffer(xm_vis, (PixmapPtr)pDraw, 0);
}
if (glxPriv->xm_buf == NULL) {
xfree(glxPriv);
return NULL;
}
return &glxPriv->base;
}
static void
__glXMesaContextDestroy(__GLXcontext *baseContext)
{
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
XMesaDestroyContext(context->xmesa);
__glXContextDestroy(&context->base);
xfree(context);
}
static int
__glXMesaContextMakeCurrent(__GLXcontext *baseContext)
{
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
__GLXMESAdrawable *drawPriv = (__GLXMESAdrawable *) context->base.drawPriv;
__GLXMESAdrawable *readPriv = (__GLXMESAdrawable *) context->base.readPriv;
return XMesaMakeCurrent2(context->xmesa,
drawPriv->xm_buf,
readPriv->xm_buf);
}
static int
__glXMesaContextLoseCurrent(__GLXcontext *baseContext)
{
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
return XMesaLoseCurrent(context->xmesa);
}
static int
__glXMesaContextCopy(__GLXcontext *baseDst,
__GLXcontext *baseSrc,
unsigned long mask)
{
__GLXMESAcontext *dst = (__GLXMESAcontext *) baseDst;
__GLXMESAcontext *src = (__GLXMESAcontext *) baseSrc;
return XMesaCopyContext(src->xmesa, dst->xmesa, mask);
}
static int
__glXMesaContextForceCurrent(__GLXcontext *baseContext)
{
__GLXMESAcontext *context = (__GLXMESAcontext *) baseContext;
/* GlxSetRenderTables() call for XGL moved in XMesaForceCurrent() */
return XMesaForceCurrent(context->xmesa);
}
static __GLXcontext *
__glXMesaScreenCreateContext(__GLXscreen *screen,
__GLcontextModes *modes,
__GLXcontext *baseShareContext)
{
__GLXMESAcontext *context;
__GLXMESAcontext *shareContext = (__GLXMESAcontext *) baseShareContext;
XMesaVisual xm_vis;
XMesaContext xm_share;
context = xalloc (sizeof (__GLXMESAcontext));
if (context == NULL)
return NULL;
memset(context, 0, sizeof *context);
context->base.pGlxScreen = screen;
context->base.modes = modes;
context->base.destroy = __glXMesaContextDestroy;
context->base.makeCurrent = __glXMesaContextMakeCurrent;
context->base.loseCurrent = __glXMesaContextLoseCurrent;
context->base.copy = __glXMesaContextCopy;
context->base.forceCurrent = __glXMesaContextForceCurrent;
xm_vis = find_mesa_visual(screen, modes->fbconfigID);
if (!xm_vis) {
ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n",
modes->visualID);
xfree(context);
return NULL;
}
xm_share = shareContext ? shareContext->xmesa : NULL;
context->xmesa = XMesaCreateContext(xm_vis, xm_share);
if (!context->xmesa) {
xfree(context);
return NULL;
}
return &context->base;
}
static void
__glXMesaScreenDestroy(__GLXscreen *screen)
{
__GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen;
int i;
if (mesaScreen->xm_vis) {
for (i = 0; i < mesaScreen->base.numFBConfigs; i++) {
if (mesaScreen->xm_vis[i])
XMesaDestroyVisual(mesaScreen->xm_vis[i]);
}
xfree(mesaScreen->xm_vis);
}
__glXScreenDestroy(screen);
xfree(screen);
}
static XMesaVisual
find_mesa_visual(__GLXscreen *screen, XID fbconfigID)
{
__GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen;
const __GLcontextModes *modes;
unsigned i = 0;
for (modes = screen->fbconfigs; modes != NULL; modes = modes->next) {
if (modes->fbconfigID == fbconfigID)
return mesaScreen->xm_vis[i];
i++;
}
return NULL;
}
const static int numBack = 2;
const static int numDepth = 2;
const static int numStencil = 2;
static __GLcontextModes *
createFBConfigsForVisual(__GLXscreen *screen, ScreenPtr pScreen,
VisualPtr visual, __GLcontextModes *config)
{
int back, depth, stencil;
/* FIXME: Ok, I'm making all this up... anybody has a better idea? */
for (back = numBack - 1; back >= 0; back--)
for (depth = 0; depth < numDepth; depth++)
for (stencil = 0; stencil < numStencil; stencil++) {
config->visualType = _gl_convert_from_x_visual_type(visual->class);
config->xRenderable = GL_TRUE;
config->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
config->rgbMode = (visual->class >= TrueColor);
config->colorIndexMode = !config->rgbMode;
config->renderType =
(config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
config->doubleBufferMode = back;
config->haveDepthBuffer = depth;
config->depthBits = depth ? visual->nplanes : 0;
config->haveStencilBuffer = stencil;
config->stencilBits = stencil ? visual->bitsPerRGBValue : 0;
config->haveAccumBuffer = 0;
config->redBits = Ones(visual->redMask);
config->greenBits = Ones(visual->greenMask);
config->blueBits = Ones(visual->blueMask);
config->alphaBits = 0;
config->redMask = visual->redMask;
config->greenMask = visual->greenMask;
config->blueMask = visual->blueMask;
config->alphaMask = 0;
config->rgbBits = config->rgbMode ? visual->nplanes : 0;
config->indexBits = config->colorIndexMode ? visual->nplanes : 0;
config = config->next;
}
return config;
}
static void
createFBConfigs(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
{
__GLcontextModes *configs;
int i;
/* We assume here that each existing visual correspond to a
* different visual class. Note, this runs before COMPOSITE adds
* its visual, so it's not entirely crazy. */
pGlxScreen->numFBConfigs = pScreen->numVisuals * numBack * numDepth * numStencil;
pGlxScreen->fbconfigs = _gl_context_modes_create(pGlxScreen->numFBConfigs,
sizeof *configs);
configs = pGlxScreen->fbconfigs;
for (i = 0; i < pScreen->numVisuals; i++)
configs = createFBConfigsForVisual(pGlxScreen, pScreen,
&pScreen->visuals[i], configs);
}
static void
createMesaVisuals(__GLXMESAscreen *pMesaScreen)
{
__GLcontextModes *config;
ScreenPtr pScreen;
VisualPtr visual = NULL;
int i, j;
i = 0;
pScreen = pMesaScreen->base.pScreen;
pMesaScreen->xm_vis =
xcalloc(pMesaScreen->base.numFBConfigs, sizeof (XMesaVisual));
for (config = pMesaScreen->base.fbconfigs; config != NULL; config = config->next) {
for (j = 0; j < pScreen->numVisuals; j++)
if (pScreen->visuals[j].vid == config->visualID) {
visual = &pScreen->visuals[j];
break;
}
pMesaScreen->xm_vis[i++] =
XMesaCreateVisual(pScreen,
visual,
config->rgbMode,
(config->alphaBits > 0),
config->doubleBufferMode,
config->stereoMode,
GL_TRUE, /* ximage_flag */
config->depthBits,
config->stencilBits,
config->accumRedBits,
config->accumGreenBits,
config->accumBlueBits,
config->accumAlphaBits,
config->samples,
config->level,
config->visualRating);
}
}
static __GLXscreen *
__glXMesaScreenProbe(ScreenPtr pScreen)
{
__GLXMESAscreen *screen;
screen = xalloc(sizeof *screen);
if (screen == NULL)
return NULL;
/*
* Find the GLX visuals that are supported by this screen and create
* XMesa's visuals.
*/
createFBConfigs(&screen->base, pScreen);
__glXScreenInit(&screen->base, pScreen);
/* Now that GLX has created the corresponding X visual, create the mesa visuals. */
createMesaVisuals(screen);
screen->base.destroy = __glXMesaScreenDestroy;
screen->base.createContext = __glXMesaScreenCreateContext;
screen->base.createDrawable = __glXMesaScreenCreateDrawable;
screen->base.pScreen = pScreen;
return &screen->base;
}
__GLXprovider __glXMesaProvider = {
__glXMesaScreenProbe,
"MESA",
NULL
};
__GLXprovider *
GlxGetMesaProvider (void)
{
return &__glXMesaProvider;
}

32
GL/mesa/.gitignore vendored
View File

@ -1,32 +0,0 @@
X/drivers
X/glxheader.h
X/xm*.h
X/xm*.c
mesa/drivers
mesa/glxheader.h
mesa/xm*.c
glapi/*.c
glapi/*.h
main/*.c
main/*.h
math/*.c
math/*.h
ppc
shader/*.c
shader/*.h
shader/slang/*.c
shader/slang/*.h
shader/slang/library
shader/grammar/*.c
shader/grammar/*.h
sparc
swrast/*.c
swrast/*.h
swrast_setup/*.c
swrast_setup/*.h
tnl/*.c
tnl/*.h
x86
x86-64
vbo/*.c
vbo/*.h

View File

@ -1,18 +0,0 @@
SUBDIRS = X
SUBDIRS += main math swrast swrast_setup tnl shader glapi vbo
noinst_LTLIBRARIES = libGLcore.la
libGLcore_la_SOURCES = dummy.c
MESA_LIBS = main/libmain.la \
math/libmath.la \
swrast/libswrast.la \
swrast_setup/libss.la \
tnl/libtnl.la \
shader/libshader.la \
shader/grammar/libgrammar.la \
shader/slang/libslang.la \
vbo/libvbo.la
libGLcore_la_LIBADD = $(MESA_LIBS) \
X/libX.la

View File

@ -1,27 +0,0 @@
noinst_LTLIBRARIES = libX.la
INCLUDES = -I@MESA_SOURCE@/include \
-I. \
-I@MESA_SOURCE@/src/mesa/glapi \
-I@MESA_SOURCE@/src/mesa/main \
-I@MESA_SOURCE@/src/mesa
# -DXFree86Server is required because the X11 driver in Mesa thinks that
# symbol means "being built in the server"
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@
XM_SOURCES = \
xm_api.c \
xm_buffer.c \
xm_dd.c \
xm_image.c \
xm_line.c \
xm_span.c \
xm_tri.c
XM_SOURCES += drivers/common/driverfuncs.c
nodist_libX_la_SOURCES = $(XM_SOURCES)

View File

View File

@ -1,20 +0,0 @@
noinst_LTLIBRARIES = libglapi.la
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@
INCLUDES = -I@MESA_SOURCE@/include \
-I../X \
-I../glapi \
-I../main \
-I../math \
-I../shader \
-I../swrast \
-I../swrast_setup \
-I../tnl \
-I.. \
-I$(top_srcdir)/hw/xfree86/os-support
nodist_libglapi_la_SOURCES = glapi.c glthread.c

View File

@ -1,86 +0,0 @@
noinst_LTLIBRARIES = libmain.la
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@
INCLUDES = -I@MESA_SOURCE@/include \
-I../X \
-I../glapi \
-I../main \
-I../math \
-I../shader \
-I../swrast \
-I../swrast_setup \
-I../tnl \
-I.. \
-I$(top_srcdir)/hw/xfree86/os-support
if NEED_VSNPRINTF
VSNPRINTF_SOURCES = vsnprintf.c
endif
nodist_libmain_la_SOURCES = accum.c \
api_arrayelt.c \
api_loopback.c \
api_noop.c \
api_validate.c \
arrayobj.c \
attrib.c \
blend.c \
bufferobj.c \
buffers.c \
clip.c \
colortab.c \
context.c \
convolve.c \
debug.c \
depth.c \
depthstencil.c \
dlist.c \
drawpix.c \
enable.c \
enums.c \
eval.c \
execmem.c \
extensions.c \
fbobject.c \
feedback.c \
fog.c \
framebuffer.c \
get.c \
getstring.c \
hash.c \
hint.c \
histogram.c \
image.c \
imports.c \
light.c \
lines.c \
matrix.c \
mipmap.c \
mm.c \
pixel.c \
points.c \
polygon.c \
queryobj.c \
rastpos.c \
rbadaptors.c \
renderbuffer.c \
shaders.c \
state.c \
stencil.c \
texcompress.c \
texcompress_fxt1.c \
texcompress_s3tc.c \
texenvprogram.c \
texformat.c \
teximage.c \
texobj.c \
texrender.c \
texstate.c \
texstore.c \
varray.c \
$(VSNPRINTF_SOURCES) \
vtxfmt.c

View File

@ -1,27 +0,0 @@
noinst_LTLIBRARIES = libmath.la
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@
INCLUDES = -I@MESA_SOURCE@/include \
-I../X \
-I../glapi \
-I../main \
-I../math \
-I../shader \
-I../swrast \
-I../swrast_setup \
-I../tnl \
-I.. \
-I$(top_srcdir)/hw/xfree86/os-support
nodist_libmath_la_SOURCES = m_debug_clip.c \
m_debug_norm.c \
m_debug_xform.c \
m_eval.c \
m_matrix.c \
m_translate.c \
m_vector.c \
m_xform.c

View File

@ -1,39 +0,0 @@
SUBDIRS = grammar slang
noinst_LTLIBRARIES = libshader.la
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@
INCLUDES = -I@MESA_SOURCE@/include \
-I../X \
-I../glapi \
-I../main \
-I../math \
-I../shader \
-I../shader/grammar \
-I../shader/slang \
-I../swrast \
-I../swrast_setup \
-I../tnl \
-I.. \
-I$(top_srcdir)/hw/xfree86/os-support
nodist_libshader_la_SOURCES = \
arbprogparse.c \
arbprogram.c \
atifragshader.c \
nvfragparse.c \
nvprogram.c \
nvvertparse.c \
prog_debug.c \
prog_execute.c \
prog_instruction.c \
prog_parameter.c \
prog_print.c \
program.c \
programopt.c \
prog_statevars.c \
shader_api.c

View File

@ -1,20 +0,0 @@
noinst_LTLIBRARIES = libgrammar.la
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@
INCLUDES = -I@MESA_SOURCE@/include \
-I../../X \
-I../../glapi \
-I../../main \
-I../../math \
-I../../shader \
-I../../swrast \
-I../../swrast_setup \
-I../../tnl \
-I../.. \
-I$(top_srcdir)/hw/xfree86/os-support
nodist_libgrammar_la_SOURCES = grammar_mesa.c

View File

@ -1,41 +0,0 @@
noinst_LTLIBRARIES = libslang.la
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@
INCLUDES = -I@MESA_SOURCE@/include \
-I../grammar \
-I../../X \
-I../../glapi \
-I../../main \
-I../../math \
-I../../shader \
-I../../swrast \
-I../../swrast_setup \
-I../../tnl \
-I../.. \
-I$(top_srcdir)/hw/xfree86/os-support
nodist_libslang_la_SOURCES = slang_builtin.c \
slang_codegen.c \
slang_compile.c \
slang_compile_function.c \
slang_compile_operation.c \
slang_compile_struct.c \
slang_compile_variable.c \
slang_emit.c \
slang_ir.c \
slang_label.c \
slang_library_noise.c \
slang_link.c \
slang_log.c \
slang_mem.c \
slang_preprocess.c \
slang_print.c \
slang_simplify.c \
slang_storage.c \
slang_typeinfo.c \
slang_utility.c \
slang_vartable.c

View File

@ -1,50 +0,0 @@
noinst_LTLIBRARIES = libswrast.la
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@
INCLUDES = -I@MESA_SOURCE@/include \
-I../X \
-I../glapi \
-I../main \
-I../math \
-I../shader \
-I../shader/slang \
-I../shader/slang \
-I../swrast \
-I../swrast_setup \
-I../tnl \
-I.. \
-I$(top_srcdir)/hw/xfree86/os-support
nodist_libswrast_la_SOURCES = s_aaline.c \
s_aatriangle.c \
s_accum.c \
s_alpha.c \
s_atifragshader.c \
s_bitmap.c \
s_blend.c \
s_blit.c \
s_buffers.c \
s_context.c \
s_copypix.c \
s_depth.c \
s_drawpix.c \
s_feedback.c \
s_fog.c \
s_fragprog.c \
s_imaging.c \
s_lines.c \
s_logic.c \
s_masking.c \
s_points.c \
s_readpix.c \
s_span.c \
s_stencil.c \
s_texcombine.c \
s_texfilter.c \
s_texstore.c \
s_triangle.c \
s_zoom.c

View File

@ -1,20 +0,0 @@
noinst_LTLIBRARIES = libss.la
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@
INCLUDES = -I@MESA_SOURCE@/include \
-I../X \
-I../glapi \
-I../main \
-I../math \
-I../shader \
-I../swrast \
-I../swrast_setup \
-I../tnl \
-I.. \
-I$(top_srcdir)/hw/xfree86/os-support
nodist_libss_la_SOURCES = ss_context.c ss_triangle.c

View File

@ -1,37 +0,0 @@
noinst_LTLIBRARIES = libtnl.la
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@
INCLUDES = -I@MESA_SOURCE@/include \
-I../X \
-I../glapi \
-I../main \
-I../math \
-I../shader \
-I../shader/slang \
-I../swrast \
-I../swrast_setup \
-I../tnl \
-I.. \
-I$(top_srcdir)/hw/xfree86/os-support
nodist_libtnl_la_SOURCES = t_context.c \
t_draw.c \
t_pipeline.c \
t_vb_cull.c \
t_vb_fog.c \
t_vb_light.c \
t_vb_normals.c \
t_vb_points.c \
t_vb_program.c \
t_vb_render.c \
t_vb_texgen.c \
t_vb_texmat.c \
t_vb_vertex.c \
t_vertex.c \
t_vertex_generic.c \
t_vertex_sse.c \
t_vp_build.c

View File

@ -1,35 +0,0 @@
noinst_LTLIBRARIES = libvbo.la
AM_CFLAGS = \
$(DIX_CFLAGS) \
-DXFree86Server \
@GLX_DEFINES@
INCLUDES = -I@MESA_SOURCE@/include \
-I../X \
-I../glapi \
-I../main \
-I../math \
-I../shader \
-I../shader/slang \
-I../shader/slang \
-I../swrast \
-I../swrast_setup \
-I../tnl \
-I.. \
-I$(top_srcdir)/hw/xfree86/os-support
nodist_libvbo_la_SOURCES = vbo_context.c \
vbo_exec_api.c \
vbo_exec_array.c \
vbo_exec.c \
vbo_exec_draw.c \
vbo_exec_eval.c \
vbo_rebase.c \
vbo_save_api.c \
vbo_save.c \
vbo_save_draw.c \
vbo_save_loopback.c \
vbo_split.c \
vbo_split_copy.c \
vbo_split_inplace.c

View File

@ -1,344 +0,0 @@
#!/bin/sh
#
# A script that symlinks source files from Mesa to modular
#
# Author: Soren Sandmann (sandmann@redhat.com) (original)
# adapted for Mesa by Adam Jackson (ajax@nwnk.net)
#
# Things we would like to do
#
# - Check that all the relevant files exist
# - AUTHORS, autogen.sh, configure.ac, ...
# - Check that we have actually linked everything
# - if a file doesn't need to be linked, then it needs
# to be listed as "not-linked"
# - Compute diffs between all the files (shouldn't be necessary)
# - possibly check that files are listet in Makefile.am's
# - Clean target directory of irrelevant files
#
check_destinations () {
# don't do anything - we are relying on the side
# effect of dst_dir
true
}
check_exist() {
# Check whether $1 exists
if [ ! -e $1 ] ; then
error "$1 not found"
fi
}
delete_existing() {
# Delete $2
rm -f $2
}
link_files() {
# Link $1 to $2
if [ ! -e $2 ] ; then
ln -s $1 $2
fi
}
main() {
check_args $1 $2
run check_destinations "Creating destination directories"
run check_exist "Checking that the source files exist"
run delete_existing "Deleting existing files"
run link_files "Linking files"
}
## actual symlinking
symlink_mesa_glapi() {
src_dir src/mesa/glapi
dst_dir mesa/glapi
for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
action `basename $src`
done
}
symlink_mesa_main() {
src_dir src/mesa/main
dst_dir mesa/main
for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
action `basename $src`
done
}
symlink_mesa_math() {
src_dir src/mesa/math
dst_dir mesa/math
for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
action `basename $src`
done
}
symlink_mesa_swrast() {
src_dir src/mesa/swrast
dst_dir mesa/swrast
for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
action `basename $src`
done
}
symlink_mesa_ss() {
src_dir src/mesa/swrast_setup
dst_dir mesa/swrast_setup
for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
action `basename $src`
done
}
symlink_mesa_tnl() {
src_dir src/mesa/tnl
dst_dir mesa/tnl
for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
action `basename $src`
done
}
symlink_mesa_shader() {
src_dir src/mesa/shader
dst_dir mesa/shader
for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
action `basename $src`
done
}
symlink_mesa_shader_grammar() {
src_dir src/mesa/shader/grammar
dst_dir mesa/shader/grammar
for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
action `basename $src`
done
}
symlink_mesa_shader_slang() {
src_dir src/mesa/shader/slang
dst_dir mesa/shader/slang
for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
action `basename $src`
done
}
symlink_mesa_shader_slang_library() {
src_dir src/mesa/shader/slang/library
dst_dir mesa/shader/slang/library
for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
action `basename $src`
done
}
symlink_mesa_vbo() {
src_dir src/mesa/vbo
dst_dir mesa/vbo
for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do
action `basename $src`
done
}
symlink_mesa_x() {
src_dir src/mesa/drivers/x11
dst_dir mesa/X
# action glxapi.h
action glxheader.h
# action realglx.h
# action xfonts.h
action xm_api.c
action xm_buffer.c
action xm_dd.c
action xm_image.c
action xm_image.h
action xm_line.c
action xm_span.c
action xm_tri.c
action xmesaP.h
# another hack
src_dir src/mesa/drivers/common
dst_dir mesa/X/drivers/common
action driverfuncs.c
action driverfuncs.h
}
symlink_mesa_ppc() {
src_dir src/mesa/ppc
dst_dir mesa/ppc
}
symlink_mesa_sparc() {
src_dir src/mesa/sparc
dst_dir mesa/sparc
}
symlink_mesa_x86() {
src_dir src/mesa/x86
dst_dir mesa/x86
}
symlink_mesa_x8664() {
src_dir src/mesa/x86-64
dst_dir mesa/x86-64
}
symlink_mesa() {
symlink_mesa_main
symlink_mesa_math
symlink_mesa_swrast
symlink_mesa_ss
symlink_mesa_tnl
symlink_mesa_shader
symlink_mesa_shader_grammar
symlink_mesa_shader_slang
symlink_mesa_shader_slang_library
symlink_mesa_x
symlink_mesa_glapi
symlink_mesa_ppc
symlink_mesa_sparc
symlink_mesa_vbo
symlink_mesa_x86
symlink_mesa_x8664
}
symlink_glx() {
# this is... unpleasant
src_dir src/glx/x11
dst_dir glx
action indirect_size.h
action glcontextmodes.c
action glcontextmodes.h
action indirect_dispatch.c
action indirect_dispatch.h
action indirect_dispatch_swap.c
action indirect_reqsize.c
action indirect_reqsize.h
action indirect_size_get.c
action indirect_size_get.h
action indirect_table.c
src_dir src/mesa/glapi
action glapi.c
action glthread.c
}
#########
#
# Helper functions
#
#########
error() {
echo
echo \ \ \ error:\ \ \ $1
exit 1
}
# printing out what's going on
run_module() {
# $1 module
# $2 explanation
echo -n $EXPLANATION for $1 module ...\
symlink_$1
echo DONE
}
run() {
# $1 what to do
# $2 explanation
ACTION=$1 EXPLANATION=$2 run_module mesa
ACTION=$1 EXPLANATION=$2 run_module glx
}
src_dir() {
REAL_SRC_DIR=$SRC_DIR/$1
if [ ! -d $REAL_SRC_DIR ] ; then
error "Source directory $REAL_SRC_DIR does not exist"
fi
}
dst_dir() {
REAL_DST_DIR=$DST_DIR/$1
if [ ! -d $REAL_DST_DIR ] ; then
mkdir -p $REAL_DST_DIR
fi
}
action() {
if [ -z $2 ] ; then
$ACTION $REAL_SRC_DIR/$1 $REAL_DST_DIR/$1
else
$ACTION $REAL_SRC_DIR/$1 $REAL_DST_DIR/$2
fi
}
usage() {
echo symlink-mesa.sh src-dir dst-dir
echo src-dir: the Mesa source directory
echo dst-dir: the GL subdirectory of the Xserver modular tree
}
# Check commandline args
check_args() {
if [ -z $1 ] ; then
echo Missing source dir
usage
exit 1
fi
if [ -z $2 ] ; then
echo Missing destination dir
usage
exit 1
fi
if [ ! -d $1 ] ; then
echo $1 is not a dir
usage
exit 1
fi
if [ ! -d $2 ] ; then
echo $2 is not a dir
usage
exit 1
fi
if [ $1 = $2 ] ; then
echo source and destination can\'t be the same
usage
exit 1
fi
D=`dirname "$relpath"`
B=`basename "$relpath"`
abspath="`cd \"$D\" 2>/dev/null && pwd || echo \"$D\"`/$B"
SRC_DIR=`( cd $1 ; pwd )`
DST_DIR=`(cd $2 ; pwd )`
}
main $1 $2

View File

@ -23,13 +23,17 @@ MFB_DIR=mfb
endif
if GLX
GLX_DIR=GL
GLX_DIR=glx
endif
if DBE
DBE_DIR=dbe
endif
if RECORD
RECORD_DIR=record
endif
SUBDIRS = \
doc \
include \
@ -48,7 +52,7 @@ SUBDIRS = \
$(AFB_DIR) \
$(CFB_DIR) \
$(CFB32_DIR) \
record \
$(RECORD_DIR) \
xfixes \
damageext \
$(XTRAP_DIR) \
@ -99,7 +103,7 @@ DIST_SUBDIRS = \
damageext \
XTrap \
composite \
GL \
glx \
exa \
config \
hw

View File

@ -486,7 +486,7 @@ int XETrapCreateEnv(ClientPtr client)
XETrapEnv *penv = NULL;
int status = Success;
if (client->index > MAXCLIENTS)
if (client->index >= MAXCLIENTS)
{
status = BadImplementation;
}

View File

@ -188,12 +188,15 @@ static int
ProcDPMSEnable(client)
register ClientPtr client;
{
/* REQUEST(xDPMSEnableReq); */
Bool was_enabled = DPMSEnabled;
REQUEST_SIZE_MATCH(xDPMSEnableReq);
if (DPMSCapableFlag)
if (DPMSCapableFlag) {
DPMSEnabled = TRUE;
if (!was_enabled)
SetScreenSaverTimer();
}
return(client->noClientException);
}

View File

@ -87,6 +87,9 @@ _X_EXPORT unsigned long XRT_PIXMAP;
_X_EXPORT unsigned long XRT_GC;
_X_EXPORT unsigned long XRT_COLORMAP;
static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr);
_X_EXPORT XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
/*
* Function prototypes
*/
@ -668,10 +671,10 @@ Bool PanoramiXCreateConnectionBlock(void)
connSetupPrefix.length = length >> 2;
xfree(PanoramiXVisuals);
for (i = 0; i < PanoramiXNumDepths; i++)
xfree(PanoramiXDepths[i].vids);
xfree(PanoramiXDepths);
PanoramiXDepths = NULL;
/*
* OK, change some dimensions so it looks as if it were one big screen
@ -709,7 +712,7 @@ Bool PanoramiXCreateConnectionBlock(void)
* do their own back-mapping.
*/
static Bool
VisualsEqual(VisualPtr a, VisualPtr b)
VisualsEqual(VisualPtr a, ScreenPtr pScreenB, VisualPtr b)
{
return ((a->class == b->class) &&
(a->ColormapEntries == b->ColormapEntries) &&
@ -759,7 +762,6 @@ static void
PanoramiXMaybeAddVisual(VisualPtr pVisual)
{
ScreenPtr pScreen;
VisualPtr candidate = NULL;
int j, k;
Bool found = FALSE;
@ -767,10 +769,10 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual)
pScreen = screenInfo.screens[j];
found = FALSE;
candidate = pScreen->visuals;
for (k = 0; k < pScreen->numVisuals; k++) {
candidate++;
if (VisualsEqual(pVisual, candidate)
VisualPtr candidate = &pScreen->visuals[k];
if ((*XineramaVisualsEqualPtr)(pVisual, pScreen, candidate)
#ifdef GLXPROXY
&& glxMatchVisual(screenInfo.screens[0], pVisual, pScreen)
#endif
@ -844,8 +846,9 @@ PanoramiXConsolidate(void)
_X_EXPORT VisualID
PanoramiXTranslateVisualID(int screen, VisualID orig)
{
ScreenPtr pOtherScreen = screenInfo.screens[screen];
VisualPtr pVisual = NULL;
int i, j;
int i;
for (i = 0; i < PanoramiXNumVisuals; i++) {
if (orig == PanoramiXVisuals[i].vid) {
@ -857,12 +860,18 @@ PanoramiXTranslateVisualID(int screen, VisualID orig)
if (!pVisual)
return 0;
/* if screen is 0, orig is already the correct visual ID */
if (screen == 0)
return orig;
/* found the original, now translate it relative to the backend screen */
for (i = 0; i < PanoramiXNumScreens; i++)
for (j = 0; j < screenInfo.screens[i]->numVisuals; j++)
if (VisualsEqual(pVisual, &screenInfo.screens[i]->visuals[j]))
return screenInfo.screens[i]->visuals[j].vid;
for (i = 0; i < pOtherScreen->numVisuals; i++) {
VisualPtr pOtherVisual = &pOtherScreen->visuals[i];
if ((*XineramaVisualsEqualPtr)(pVisual, pOtherScreen, pOtherVisual))
return pOtherVisual->vid;
}
return 0;
}
@ -927,10 +936,11 @@ ProcPanoramiXGetState(ClientPtr client)
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.state = !noPanoramiXExtension;
rep.window = stuff->window;
if (client->swapped) {
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swaps (&rep.state, n);
swapl (&rep.window, n);
}
WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
return client->noClientException;
@ -954,10 +964,11 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.ScreenCount = PanoramiXNumScreens;
rep.window = stuff->window;
if (client->swapped) {
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swaps (&rep.ScreenCount, n);
swapl (&rep.window, n);
}
WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep);
return client->noClientException;
@ -971,6 +982,9 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
xPanoramiXGetScreenSizeReply rep;
register int n, rc;
if (stuff->screen >= PanoramiXNumScreens)
return BadMatch;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
@ -982,11 +996,15 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
/* screen dimensions */
rep.width = panoramiXdataPtr[stuff->screen].width;
rep.height = panoramiXdataPtr[stuff->screen].height;
rep.window = stuff->window;
rep.screen = stuff->screen;
if (client->swapped) {
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swaps (&rep.width, n);
swaps (&rep.height, n);
swapl (&rep.width, n);
swapl (&rep.height, n);
swapl (&rep.window, n);
swapl (&rep.screen, n);
}
WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep);
return client->noClientException;

View File

@ -30,6 +30,16 @@ extern unsigned long XRT_PIXMAP;
extern unsigned long XRT_GC;
extern unsigned long XRT_COLORMAP;
/*
* Drivers are allowed to wrap this function. Each wrapper can decide that the
* two visuals are unequal, but if they are deemed equal, the wrapper must call
* down and return FALSE if the wrapped function does. This ensures that all
* layers agree that the visuals are equal. The first visual is always from
* screen 0.
*/
typedef Bool (*XineramaVisualsEqualProcPtr)(VisualPtr, ScreenPtr, VisualPtr);
extern XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr;
extern void XineramaGetImageData(
DrawablePtr *pDrawables,
int left,

View File

@ -63,10 +63,10 @@ typedef struct {
} SecurityStateRec;
/* Extensions that untrusted clients shouldn't have access to */
static char *SecurityUntrustedExtensions[] = {
"RandR",
"SECURITY",
"XFree86-DGA",
static char *SecurityTrustedExtensions[] = {
"XC-MISC",
"BIG-REQUESTS",
"XpExtension",
NULL
};
@ -76,6 +76,7 @@ static char *SecurityUntrustedExtensions[] = {
static const Mask SecurityResourceMask =
DixGetAttrAccess | DixReceiveAccess | DixListPropAccess |
DixGetPropAccess | DixListAccess;
static const Mask SecurityWindowExtraMask = DixRemoveAccess;
static const Mask SecurityRootWindowExtraMask =
DixReceiveAccess | DixSendAccess | DixAddAccess | DixRemoveAccess;
static const Mask SecurityDeviceMask =
@ -679,15 +680,19 @@ SProcSecurityGenerateAuthorization(
register char n;
CARD32 *values;
unsigned long nvalues;
int values_offset;
swaps(&stuff->length, n);
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
swaps(&stuff->nbytesAuthProto, n);
swaps(&stuff->nbytesAuthData, n);
swapl(&stuff->valueMask, n);
values = (CARD32 *)(&stuff[1]) +
((stuff->nbytesAuthProto + (unsigned)3) >> 2) +
((stuff->nbytesAuthData + (unsigned)3) >> 2);
values_offset = ((stuff->nbytesAuthProto + (unsigned)3) >> 2) +
((stuff->nbytesAuthData + (unsigned)3) >> 2);
if (values_offset >
stuff->length - (sz_xSecurityGenerateAuthorizationReq >> 2))
return BadLength;
values = (CARD32 *)(&stuff[1]) + values_offset;
nvalues = (((CARD32 *)stuff) + stuff->length) - values;
SwapLongs(values, nvalues);
return ProcSecurityGenerateAuthorization(client);
@ -815,6 +820,10 @@ SecurityResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
if (subj->haveState && subj->trustLevel != XSecurityClientTrusted)
((WindowPtr)rec->res)->forcedBG = TRUE;
/* additional permissions for specific resource types */
if (rec->rtype == RT_WINDOW)
allowed |= SecurityWindowExtraMask;
/* special checks for server-owned resources */
if (cid == 0) {
if (rec->rtype & RC_DRAWABLE)
@ -855,16 +864,18 @@ SecurityExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
if (subj->haveState && subj->trustLevel != XSecurityClientTrusted)
while (SecurityUntrustedExtensions[i])
if (!strcmp(SecurityUntrustedExtensions[i++], rec->ext->name)) {
SecurityAudit("Security: denied client %d access to extension "
"%s on request %s\n",
rec->client->index, rec->ext->name,
SecurityLookupRequestName(rec->client));
rec->status = BadAccess;
return;
}
if (subj->haveState && subj->trustLevel == XSecurityClientTrusted)
return;
while (SecurityTrustedExtensions[i])
if (!strcmp(SecurityTrustedExtensions[i++], rec->ext->name))
return;
SecurityAudit("Security: denied client %d access to extension "
"%s on request %s\n",
rec->client->index, rec->ext->name,
SecurityLookupRequestName(rec->client));
rec->status = BadAccess;
}
static void
@ -949,9 +960,10 @@ SecuritySend(CallbackListPtr *pcbl, pointer unused, pointer calldata)
SecurityAudit("Security: denied client %d from sending event "
"of type %s to window 0x%x of client %d\n",
rec->client->index, rec->pWin->drawable.id,
wClient(rec->pWin)->index,
LookupEventName(rec->events[i].u.u.type));
rec->client->index,
LookupEventName(rec->events[i].u.u.type),
rec->pWin->drawable.id,
wClient(rec->pWin)->index);
rec->status = BadAccess;
return;
}

View File

@ -106,7 +106,6 @@ typedef struct _ShmDesc {
unsigned long size;
} ShmDescRec, *ShmDescPtr;
static void miShmPutImage(XSHM_PUT_IMAGE_ARGS);
static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS);
static int ShmDetachSegment(
pointer /* value */,
@ -148,8 +147,8 @@ static int shmPixFormat[MAXSCREENS];
static ShmFuncsPtr shmFuncs[MAXSCREENS];
static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS];
static DevPrivateKey shmPixmapPrivate = &shmPixmapPrivate;
static ShmFuncs miFuncs = {NULL, miShmPutImage};
static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage};
static ShmFuncs miFuncs = {NULL, NULL};
static ShmFuncs fbFuncs = {fbShmCreatePixmap, NULL};
#define VERIFY_SHMSEG(shmseg,shmdesc,client) \
{ \
@ -522,70 +521,28 @@ ProcShmDetach(client)
return(client->noClientException);
}
/*
* If the given request doesn't exactly match PutImage's constraints,
* wrap the image in a scratch pixmap header and let CopyArea sort it out.
*/
static void
miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
DrawablePtr dst;
GCPtr pGC;
int depth, w, h, sx, sy, sw, sh, dx, dy;
unsigned int format;
char *data;
doShmPutImage(DrawablePtr dst, GCPtr pGC,
int depth, unsigned int format,
int w, int h, int sx, int sy, int sw, int sh, int dx, int dy,
char *data)
{
PixmapPtr pmap;
GCPtr putGC;
putGC = GetScratchGC(depth, dst->pScreen);
if (!putGC)
PixmapPtr pPixmap;
pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth,
BitsPerPixel(depth),
PixmapBytePad(w, depth),
data);
if (!pPixmap)
return;
pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pmap)
{
FreeScratchGC(putGC);
return;
}
ValidateGC((DrawablePtr)pmap, putGC);
(*putGC->ops->PutImage)((DrawablePtr)pmap, putGC, depth, -sx, -sy, w, h, 0,
(format == XYPixmap) ? XYPixmap : ZPixmap, data);
FreeScratchGC(putGC);
if (format == XYBitmap)
(void)(*pGC->ops->CopyPlane)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh,
dx, dy, 1L);
else
(void)(*pGC->ops->CopyArea)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh,
dx, dy);
(*pmap->drawable.pScreen->DestroyPixmap)(pmap);
pGC->ops->CopyArea((DrawablePtr)pPixmap, dst, pGC, sx, sy, sw, sh, dx, dy);
FreeScratchPixmapHeader(pPixmap);
}
_X_EXPORT void
fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
DrawablePtr dst;
GCPtr pGC;
int depth, w, h, sx, sy, sw, sh, dx, dy;
unsigned int format;
char *data;
{
if ((format == ZPixmap) || (depth == 1))
{
PixmapPtr pPixmap;
pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth,
BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data);
if (!pPixmap)
return;
if (format == XYBitmap)
(void)(*pGC->ops->CopyPlane)((DrawablePtr)pPixmap, dst, pGC,
sx, sy, sw, sh, dx, dy, 1L);
else
(void)(*pGC->ops->CopyArea)((DrawablePtr)pPixmap, dst, pGC,
sx, sy, sw, sh, dx, dy);
FreeScratchPixmapHeader(pPixmap);
}
else
miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy,
data);
}
#ifdef PANORAMIX
static int
ProcPanoramiXShmPutImage(register ClientPtr client)
@ -894,8 +851,17 @@ ProcShmPutImage(client)
return BadValue;
}
VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight,
client);
/*
* There's a potential integer overflow in this check:
* VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight,
* client);
* the version below ought to avoid it
*/
if (stuff->totalHeight != 0 &&
length > (shmdesc->size - stuff->offset)/stuff->totalHeight) {
client->errorValue = stuff->totalWidth;
return BadValue;
}
if (stuff->srcX > stuff->totalWidth)
{
client->errorValue = stuff->srcX;
@ -931,13 +897,12 @@ ProcShmPutImage(client)
shmdesc->addr + stuff->offset +
(stuff->srcY * length));
else
(*shmFuncs[pDraw->pScreen->myNum]->PutImage)(
pDraw, pGC, stuff->depth, stuff->format,
stuff->totalWidth, stuff->totalHeight,
stuff->srcX, stuff->srcY,
stuff->srcWidth, stuff->srcHeight,
stuff->dstX, stuff->dstY,
shmdesc->addr + stuff->offset);
doShmPutImage(pDraw, pGC, stuff->depth, stuff->format,
stuff->totalWidth, stuff->totalHeight,
stuff->srcX, stuff->srcY,
stuff->srcWidth, stuff->srcHeight,
stuff->dstX, stuff->dstY,
shmdesc->addr + stuff->offset);
if (stuff->sendEvent)
{

View File

@ -36,9 +36,6 @@ ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs);
void
ShmSetPixmapFormat(ScreenPtr pScreen, int format);
void
fbShmPutImage(XSHM_PUT_IMAGE_ARGS);
void
ShmRegisterFbFuncs(ScreenPtr pScreen);

View File

@ -63,11 +63,13 @@ extern Bool noXkbExtension;
#endif
extern int xeviegrabState;
static int ProcDispatch (register ClientPtr client), SProcDispatch (register ClientPtr client);
static void ResetProc (ExtensionEntry *extEntry);
static DISPATCH_PROC(ProcXevieDispatch);
static DISPATCH_PROC(SProcXevieDispatch);
static unsigned char ReqCode = 0;
static int ErrorBase;
static void XevieResetProc (ExtensionEntry *extEntry);
static unsigned char XevieReqCode = 0;
static int XevieErrorBase;
int xevieFlag = 0;
int xevieClientIndex = 0;
@ -77,7 +79,7 @@ Mask xevieMask = 0;
int xevieEventSent = 0;
int xevieKBEventSent = 0;
static DevPrivateKey xevieDevicePrivateKey = &xevieDevicePrivateKey;
static Bool xevieModifiersOn = FALSE;
static Bool xevieModifiersOn = FALSE;
#define XEVIEINFO(dev) ((xevieDeviceInfoPtr) \
dixLookupPrivate(&(dev)->devPrivates, xevieDevicePrivateKey))
@ -108,11 +110,6 @@ typedef struct {
static xevieKeycQueueRec keycq[KEYC_QUEUE_SIZE] = {{0, NULL}};
static int keycqHead = 0, keycqTail = 0;
static int ProcDispatch (ClientPtr), SProcDispatch (ClientPtr);
static void ResetProc (ExtensionEntry*);
static int ErrorBase;
static Bool XevieStart(void);
static void XevieEnd(int clientIndex);
static void XevieClientStateCallback(CallbackListPtr *pcbl, pointer nulldata,
@ -140,27 +137,26 @@ XevieExtensionInit (void)
if ((extEntry = AddExtension (XEVIENAME,
0,
XevieNumberErrors,
ProcDispatch,
SProcDispatch,
ResetProc,
ProcXevieDispatch,
SProcXevieDispatch,
XevieResetProc,
StandardMinorOpcode))) {
ReqCode = (unsigned char)extEntry->base;
ErrorBase = extEntry->errorBase;
XevieReqCode = (unsigned char)extEntry->base;
XevieErrorBase = extEntry->errorBase;
}
/* PC servers initialize the desktop colors (citems) here! */
}
/*ARGSUSED*/
static
void ResetProc (ExtensionEntry *extEntry)
void XevieResetProc (ExtensionEntry *extEntry)
{
}
static
int ProcQueryVersion (register ClientPtr client)
int ProcXevieQueryVersion (register ClientPtr client)
{
xXevieQueryVersionReply rep;
int n;
REQUEST_SIZE_MATCH (xXevieQueryVersionReq);
rep.type = X_Reply;
@ -168,14 +164,21 @@ int ProcQueryVersion (register ClientPtr client)
rep.sequence_number = client->sequence;
rep.server_major_version = XEVIE_MAJOR_VERSION;
rep.server_minor_version = XEVIE_MINOR_VERSION;
if (client->swapped) {
swaps(&rep.sequence_number, n);
swapl(&rep.length, n);
swaps(&rep.server_major_version, n);
swaps(&rep.server_minor_version, n);
}
WriteToClient (client, sizeof (xXevieQueryVersionReply), (char *)&rep);
return client->noClientException;
}
static
int ProcStart (register ClientPtr client)
int ProcXevieStart (register ClientPtr client)
{
xXevieStartReply rep;
int n;
REQUEST_SIZE_MATCH (xXevieStartReq);
rep.pad1 = 0;
@ -207,17 +210,25 @@ int ProcStart (register ClientPtr client)
xevieModifiersOn = FALSE;
rep.length = 0;
rep.type = X_Reply;
rep.sequence_number = client->sequence;
if (client->swapped) {
swaps(&rep.sequence_number, n);
swapl(&rep.length, n);
}
WriteToClient (client, sizeof (xXevieStartReply), (char *)&rep);
return client->noClientException;
}
static
int ProcEnd (register ClientPtr client)
int ProcXevieEnd (register ClientPtr client)
{
xXevieEndReply rep;
int n;
REQUEST_SIZE_MATCH (xXevieEndReq);
if (xevieFlag) {
if (client->index != xevieClientIndex)
return BadAccess;
@ -226,26 +237,39 @@ int ProcEnd (register ClientPtr client)
XevieEnd(xevieClientIndex);
}
rep.length = 0;
rep.type = X_Reply;
rep.sequence_number = client->sequence;
if (client->swapped) {
swaps(&rep.sequence_number, n);
swapl(&rep.length, n);
}
WriteToClient (client, sizeof (xXevieEndReply), (char *)&rep);
return client->noClientException;
}
static
int ProcSend (register ClientPtr client)
int ProcXevieSend (register ClientPtr client)
{
REQUEST (xXevieSendReq);
xXevieSendReply rep;
xEvent *xE;
static unsigned char lastDetail = 0, lastType = 0;
int n;
REQUEST_SIZE_MATCH (xXevieSendReq);
if (client->index != xevieClientIndex)
return BadAccess;
xE = (xEvent *)&stuff->event;
rep.length = 0;
rep.type = X_Reply;
rep.sequence_number = client->sequence;
if (client->swapped) {
swaps(&rep.sequence_number, n);
swapl(&rep.length, n);
}
WriteToClient (client, sizeof (xXevieSendReply), (char *)&rep);
switch(xE->u.u.type) {
@ -279,117 +303,138 @@ int ProcSend (register ClientPtr client)
}
static
int ProcSelectInput (register ClientPtr client)
int ProcXevieSelectInput (register ClientPtr client)
{
REQUEST (xXevieSelectInputReq);
xXevieSelectInputReply rep;
int n;
REQUEST_SIZE_MATCH (xXevieSelectInputReq);
if (client->index != xevieClientIndex)
return BadAccess;
xevieMask = (long)stuff->event_mask;
xevieMask = stuff->event_mask;
rep.length = 0;
rep.type = X_Reply;
rep.sequence_number = client->sequence;
if (client->swapped) {
swaps(&rep.sequence_number, n);
swapl(&rep.length, n);
}
WriteToClient (client, sizeof (xXevieSelectInputReply), (char *)&rep);
return client->noClientException;
}
static
int ProcDispatch (register ClientPtr client)
int ProcXevieDispatch (register ClientPtr client)
{
REQUEST (xReq);
switch (stuff->data)
{
case X_XevieQueryVersion:
return ProcQueryVersion (client);
return ProcXevieQueryVersion (client);
case X_XevieStart:
return ProcStart (client);
return ProcXevieStart (client);
case X_XevieEnd:
return ProcEnd (client);
return ProcXevieEnd (client);
case X_XevieSend:
return ProcSend (client);
return ProcXevieSend (client);
case X_XevieSelectInput:
return ProcSelectInput(client);
return ProcXevieSelectInput(client);
default:
return BadRequest;
}
}
static
int SProcQueryVersion (register ClientPtr client)
int SProcXevieQueryVersion (register ClientPtr client)
{
register int n;
REQUEST(xXevieQueryVersionReq);
swaps(&stuff->length, n);
return ProcQueryVersion(client);
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH (xXevieQueryVersionReq);
swaps (&stuff->client_major_version, n);
swaps (&stuff->client_minor_version, n);
return ProcXevieQueryVersion(client);
}
static
int SProcStart (ClientPtr client)
int SProcXevieStart (ClientPtr client)
{
register int n;
REQUEST (xXevieStartReq);
swaps (&stuff->length, n);
REQUEST_SIZE_MATCH (xXevieStartReq);
swapl (&stuff->screen, n);
REQUEST_AT_LEAST_SIZE (xXevieStartReq);
return ProcStart (client);
return ProcXevieStart (client);
}
static
int SProcEnd (ClientPtr client)
int SProcXevieEnd (ClientPtr client)
{
register int n;
REQUEST (xXevieEndReq);
swaps (&stuff->length, n);
REQUEST_AT_LEAST_SIZE (xXevieEndReq);
swapl(&stuff->cmap, n);
return ProcEnd (client);
REQUEST_SIZE_MATCH (xXevieEndReq);
swapl (&stuff->cmap, n);
return ProcXevieEnd (client);
}
static
int SProcSend (ClientPtr client)
int SProcXevieSend (ClientPtr client)
{
register int n;
xEvent eventT;
EventSwapPtr proc;
REQUEST (xXevieSendReq);
swaps (&stuff->length, n);
REQUEST_AT_LEAST_SIZE (xXevieSendReq);
swapl(&stuff->event, n);
return ProcSend (client);
REQUEST_SIZE_MATCH (xXevieSendReq);
swapl (&stuff->dataType, n);
/* Swap event */
proc = EventSwapVector[stuff->event.u.u.type & 0177];
if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */
return (BadValue);
(*proc)(&stuff->event, &eventT);
stuff->event = eventT;
return ProcXevieSend (client);
}
static
int SProcSelectInput (ClientPtr client)
int SProcXevieSelectInput (ClientPtr client)
{
register int n;
REQUEST (xXevieSelectInputReq);
swaps (&stuff->length, n);
REQUEST_AT_LEAST_SIZE (xXevieSelectInputReq);
swapl(&stuff->event_mask, n);
return ProcSelectInput (client);
REQUEST_SIZE_MATCH (xXevieSelectInputReq);
swapl (&stuff->event_mask, n);
return ProcXevieSelectInput (client);
}
static
int SProcDispatch (register ClientPtr client)
int SProcXevieDispatch (register ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data)
{
case X_XevieQueryVersion:
return SProcQueryVersion (client);
return SProcXevieQueryVersion (client);
case X_XevieStart:
return SProcStart (client);
return SProcXevieStart (client);
case X_XevieEnd:
return SProcEnd (client);
return SProcXevieEnd (client);
case X_XevieSend:
return SProcSend (client);
return SProcXevieSend (client);
case X_XevieSelectInput:
return SProcSelectInput(client);
return SProcXevieSelectInput(client);
default:
return BadRequest;
}

View File

@ -64,7 +64,7 @@ ProcXResQueryClients (ClientPtr client)
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
current_clients = xalloc((currentMaxClients - 1) * sizeof(int));
current_clients = xalloc(currentMaxClients * sizeof(int));
num_clients = 0;
for(i = 0; i < currentMaxClients; i++) {

File diff suppressed because it is too large Load Diff

View File

@ -31,21 +31,28 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* Extension protocol */
#define X_SELinuxQueryVersion 0
#define X_SELinuxSetSecurityManager 1
#define X_SELinuxGetSecurityManager 2
#define X_SELinuxSetDeviceCreateContext 3
#define X_SELinuxGetDeviceCreateContext 4
#define X_SELinuxSetDeviceContext 5
#define X_SELinuxGetDeviceContext 6
#define X_SELinuxSetPropertyCreateContext 7
#define X_SELinuxGetPropertyCreateContext 8
#define X_SELinuxGetPropertyContext 9
#define X_SELinuxSetWindowCreateContext 10
#define X_SELinuxGetWindowCreateContext 11
#define X_SELinuxGetWindowContext 12
#define X_SELinuxSetSelectionCreateContext 13
#define X_SELinuxGetSelectionCreateContext 14
#define X_SELinuxGetSelectionContext 15
#define X_SELinuxSetDeviceCreateContext 1
#define X_SELinuxGetDeviceCreateContext 2
#define X_SELinuxSetDeviceContext 3
#define X_SELinuxGetDeviceContext 4
#define X_SELinuxSetWindowCreateContext 5
#define X_SELinuxGetWindowCreateContext 6
#define X_SELinuxGetWindowContext 7
#define X_SELinuxSetPropertyCreateContext 8
#define X_SELinuxGetPropertyCreateContext 9
#define X_SELinuxSetPropertyUseContext 10
#define X_SELinuxGetPropertyUseContext 11
#define X_SELinuxGetPropertyContext 12
#define X_SELinuxGetPropertyDataContext 13
#define X_SELinuxListProperties 14
#define X_SELinuxSetSelectionCreateContext 15
#define X_SELinuxGetSelectionCreateContext 16
#define X_SELinuxSetSelectionUseContext 17
#define X_SELinuxGetSelectionUseContext 18
#define X_SELinuxGetSelectionContext 19
#define X_SELinuxGetSelectionDataContext 20
#define X_SELinuxListSelections 21
#define X_SELinuxGetClientContext 22
typedef struct {
CARD8 reqType;
@ -53,7 +60,6 @@ typedef struct {
CARD16 length;
CARD8 client_major;
CARD8 client_minor;
CARD16 unused;
} SELinuxQueryVersionReq;
typedef struct {
@ -74,35 +80,7 @@ typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
CARD32 window;
} SELinuxSetSecurityManagerReq;
typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
} SELinuxGetSecurityManagerReq;
typedef struct {
CARD8 type;
CARD8 pad1;
CARD16 sequenceNumber;
CARD32 length;
CARD32 window;
CARD32 pad2;
CARD32 pad3;
CARD32 pad4;
CARD32 pad5;
CARD32 pad6;
} SELinuxGetSecurityManagerReply;
typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
CARD8 permanent;
CARD8 unused;
CARD16 context_len;
CARD32 context_len;
} SELinuxSetCreateContextReq;
typedef struct {
@ -111,27 +89,12 @@ typedef struct {
CARD16 length;
} SELinuxGetCreateContextReq;
typedef struct {
CARD8 type;
CARD8 permanent;
CARD16 sequenceNumber;
CARD32 length;
CARD16 context_len;
CARD16 pad1;
CARD32 pad2;
CARD32 pad3;
CARD32 pad4;
CARD32 pad5;
CARD32 pad6;
} SELinuxGetCreateContextReply;
typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
CARD32 id;
CARD16 unused;
CARD16 context_len;
CARD32 context_len;
} SELinuxSetContextReq;
typedef struct {
@ -154,15 +117,27 @@ typedef struct {
CARD8 pad1;
CARD16 sequenceNumber;
CARD32 length;
CARD16 context_len;
CARD16 pad2;
CARD32 context_len;
CARD32 pad2;
CARD32 pad3;
CARD32 pad4;
CARD32 pad5;
CARD32 pad6;
CARD32 pad7;
} SELinuxGetContextReply;
typedef struct {
CARD8 type;
CARD8 pad1;
CARD16 sequenceNumber;
CARD32 length;
CARD32 count;
CARD32 pad2;
CARD32 pad3;
CARD32 pad4;
CARD32 pad5;
CARD32 pad6;
} SELinuxListItemsReply;
/* Private Flask definitions */
#define SECCLASS_X_DRAWABLE 1

View File

@ -287,7 +287,7 @@ out:
if (ret == Success) {
dpn.type = DevicePresenceNotify;
dpn.time = currentTime.milliseconds;
dpn.devchange = 1;
dpn.devchange = DeviceControlChanged;
dpn.deviceid = dev->id;
dpn.control = stuff->control;
SendEventToAllWindows(dev, DevicePresenceNotifyMask,

View File

@ -1279,6 +1279,8 @@ SendEventToAllWindows(DeviceIntPtr dev, Mask mask, xEvent * ev, int count)
for (i = 0; i < screenInfo.numScreens; i++) {
pWin = WindowTable[i];
if (!pWin)
continue;
(void)DeliverEventsToWindow(pWin, ev, count, mask, NullGrab, dev->id);
p1 = pWin->firstChild;
FindInterestedChildren(dev, p1, mask, ev, count);

View File

@ -82,6 +82,9 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
return Success;
}
if (!pWin->parent)
return BadMatch;
/*
* Only one Manual update is allowed
*/

View File

@ -119,7 +119,8 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes;
ret = pScreen->ChangeWindowAttributes(pWin, mask);
if (ret && (mask & CWBackingStore)) {
if (ret && (mask & CWBackingStore) &&
pScreen->backingStoreSupport != NotUseful) {
if (pWin->backingStore != NotUseful) {
compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
pWin->backStorage = TRUE;

View File

@ -146,8 +146,8 @@ compCheckRedirect (WindowPtr pWin)
Bool should;
should = pWin->realized && (pWin->drawable.class != InputOnly) &&
(cw != NULL);
(cw != NULL) && (pWin->parent != NULL);
/* Never redirect the overlay window */
if (cs->pOverlayWin != NULL) {
if (pWin == cs->pOverlayWin) {

View File

@ -1,5 +1,6 @@
/*
* Copyright © 2007 Daniel Stone
* Copyright © 2007 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -38,19 +39,31 @@
#include "config-backends.h"
#include "os.h"
#define TYPE_NONE 0
#define TYPE_KEYS 1
#define TYPE_POINTER 2
#define LIBHAL_PROP_KEY "input.x11_options."
#define LIBHAL_XKB_PROP_KEY "input.xkb."
struct config_hal_info {
DBusConnection *system_bus;
LibHalContext *hal_ctx;
};
/* Used for special handling of xkb options. */
struct xkb_options {
char* layout;
char* model;
char* rules;
char* variant;
char* options;
};
static void
remove_device(DeviceIntPtr dev)
{
DebugF("[config/hal] removing device %s\n", dev->name);
/* this only gets called for devices that have already been added */
LogMessage(X_INFO, "config/hal: removing device %s\n", dev->name);
/* Call PIE here so we don't try to dereference a device that's
* already been removed. */
@ -63,7 +76,7 @@ remove_device(DeviceIntPtr dev)
static void
device_removed(LibHalContext *ctx, const char *udi)
{
DeviceIntPtr dev;
DeviceIntPtr dev, next;
char *value;
value = xalloc(strlen(udi) + 5); /* "hal:" + NULL */
@ -71,11 +84,13 @@ device_removed(LibHalContext *ctx, const char *udi)
return;
sprintf(value, "hal:%s", udi);
for (dev = inputInfo.devices; dev; dev = dev->next) {
for (dev = inputInfo.devices; dev; dev = next) {
next = dev->next;
if (dev->config_info && strcmp(dev->config_info, value) == 0)
remove_device(dev);
}
for (dev = inputInfo.off_devices; dev; dev = dev->next) {
for (dev = inputInfo.off_devices; dev; dev = next) {
next = dev->next;
if (dev->config_info && strcmp(dev->config_info, value) == 0)
remove_device(dev);
}
@ -105,7 +120,7 @@ get_prop_string(LibHalContext *hal_ctx, const char *udi, const char *name)
char *prop, *ret;
prop = libhal_device_get_property_string(hal_ctx, udi, name, NULL);
DebugF("[config/hal] getting %s on %s returned %s\n", name, udi, prop);
LogMessageVerb(X_INFO, 10, "config/hal: getting %s on %s returned %s\n", name, udi, prop);
if (prop) {
ret = xstrdup(prop);
libhal_free_string(prop);
@ -151,116 +166,260 @@ get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop)
return ret;
}
static BOOL
device_is_duplicate(char *config_info)
{
DeviceIntPtr dev;
for (dev = inputInfo.devices; dev; dev = dev->next)
{
if (dev->config_info && (strcmp(dev->config_info, config_info) == 0))
return TRUE;
}
for (dev = inputInfo.off_devices; dev; dev = dev->next)
{
if (dev->config_info && (strcmp(dev->config_info, config_info) == 0))
return TRUE;
}
return FALSE;
}
static void
device_added(LibHalContext *hal_ctx, const char *udi)
{
char **props;
char *path = NULL, *driver = NULL, *name = NULL, *xkb_rules = NULL;
char *xkb_model = NULL, *xkb_layout = NULL, *xkb_variant = NULL;
char *xkb_options = NULL, *config_info = NULL;
char *path = NULL, *driver = NULL, *name = NULL, *config_info = NULL;
InputOption *options = NULL, *tmpo = NULL;
DeviceIntPtr dev;
DBusError error;
int type = TYPE_NONE;
int i;
struct xkb_options xkb_opts = {0};
LibHalPropertySet *set = NULL;
LibHalPropertySetIterator set_iter;
char *psi_key = NULL, *tmp_val;
dbus_error_init(&error);
props = libhal_device_get_property_strlist(hal_ctx, udi,
"info.capabilities", &error);
if (!props) {
DebugF("[config/hal] couldn't get capabilities for %s: %s (%s)\n",
udi, error.name, error.message);
goto out_error;
}
for (i = 0; props[i]; i++) {
/* input.keys is the new, of which input.keyboard is a subset, but
* input.keyboard is the old 'we have keys', so we have to keep it
* around. */
if (strcmp(props[i], "input.keys") == 0 ||
strcmp(props[i], "input.keyboard") == 0)
type |= TYPE_KEYS;
if (strcmp(props[i], "input.mouse") == 0 ||
strcmp(props[i], "input.touchpad") == 0)
type |= TYPE_POINTER;
}
libhal_free_string_array(props);
if (type == TYPE_NONE)
goto out_error;
driver = get_prop_string(hal_ctx, udi, "input.x11_driver");
path = get_prop_string(hal_ctx, udi, "input.device");
if (!driver || !path) {
DebugF("[config/hal] no driver or path specified for %s\n", udi);
if (!driver){
/* verbose, don't tell the user unless they _want_ to see it */
LogMessageVerb(X_INFO,7,"config/hal: no driver specified for device %s\n", udi);
goto unwind;
}
path = get_prop_string(hal_ctx, udi, "input.device");
if (!path) {
LogMessage(X_WARNING,"config/hal: no driver or path specified for %s\n", udi);
goto unwind;
}
name = get_prop_string(hal_ctx, udi, "info.product");
if (!name)
name = xstrdup("(unnamed)");
if (type & TYPE_KEYS) {
xkb_rules = get_prop_string(hal_ctx, udi, "input.xkb.rules");
xkb_model = get_prop_string(hal_ctx, udi, "input.xkb.model");
xkb_layout = get_prop_string(hal_ctx, udi, "input.xkb.layout");
xkb_variant = get_prop_string(hal_ctx, udi, "input.xkb.variant");
xkb_options = get_prop_string_array(hal_ctx, udi, "input.xkb.options");
options = xcalloc(sizeof(*options), 1);
if (!options){
LogMessage(X_ERROR, "config/hal: couldn't allocate space for input options!\n");
goto unwind;
}
options = xcalloc(sizeof(*options), 1);
options->key = xstrdup("_source");
options->value = xstrdup("server/hal");
if (!options->key || !options->value) {
ErrorF("[config] couldn't allocate first key/value pair\n");
LogMessage(X_ERROR, "config/hal: couldn't allocate first key/value pair\n");
goto unwind;
}
/* most drivers use device.. not path. evdev uses both however, but the
* path version isn't documented apparently. support both for now. */
add_option(&options, "path", path);
add_option(&options, "device", path);
add_option(&options, "driver", driver);
add_option(&options, "name", name);
config_info = xalloc(strlen(udi) + 5); /* "hal:" and NULL */
if (!config_info)
if (!config_info) {
LogMessage(X_ERROR, "config/hal: couldn't allocate name\n");
goto unwind;
}
sprintf(config_info, "hal:%s", udi);
if (xkb_rules)
add_option(&options, "xkb_rules", xkb_rules);
if (xkb_model)
add_option(&options, "xkb_model", xkb_model);
if (xkb_layout)
add_option(&options, "xkb_layout", xkb_layout);
if (xkb_variant)
add_option(&options, "xkb_variant", xkb_variant);
if (xkb_options)
add_option(&options, "xkb_options", xkb_options);
/* Check for duplicate devices */
if (device_is_duplicate(config_info))
{
LogMessage(X_WARNING, "config/hal: device %s already added. Ignoring.\n", name);
goto unwind;
}
DebugF("[config/hal] Adding device %s\n", name);
/* ok, grab options from hal.. iterate through all properties
* and lets see if any of them are options that we can add */
set = libhal_device_get_all_properties(hal_ctx, udi, &error);
if (!set) {
LogMessage(X_ERROR, "config/hal: couldn't get property list for %s: %s (%s)\n",
udi, error.name, error.message);
goto unwind;
}
libhal_psi_init(&set_iter,set);
while (libhal_psi_has_more(&set_iter)) {
/* we are looking for supported keys.. extract and add to options */
psi_key = libhal_psi_get_key(&set_iter);
if (psi_key){
/* normal options first (input.x11_options.<propname>) */
if (!strncasecmp(psi_key, LIBHAL_PROP_KEY, sizeof(LIBHAL_PROP_KEY)-1)){
char* tmp;
/* only support strings for all values */
tmp_val = get_prop_string(hal_ctx, udi, psi_key);
if (tmp_val){
/* xkb needs special handling. HAL specs include
* input.xkb.xyz options, but the x11-input.fdi specifies
* input.x11_options.Xkbxyz options. By default, we use
* the former, unless the specific X11 ones are specified.
* Since we can't predict the order in which the keys
* arrive, we need to store them.
*/
if ((tmp = strcasestr(psi_key, "xkb")) && strlen(tmp) >= 4)
{
if (!strcasecmp(&tmp[3], "layout"))
{
if (xkb_opts.layout)
xfree(xkb_opts.layout);
xkb_opts.layout = strdup(tmp_val);
} else if (!strcasecmp(&tmp[3], "model"))
{
if (xkb_opts.model)
xfree(xkb_opts.model);
xkb_opts.model = strdup(tmp_val);
} else if (!strcasecmp(&tmp[3], "rules"))
{
if (xkb_opts.rules)
xfree(xkb_opts.rules);
xkb_opts.rules = strdup(tmp_val);
} else if (!strcasecmp(&tmp[3], "variant"))
{
if (xkb_opts.variant)
xfree(xkb_opts.variant);
xkb_opts.variant = strdup(tmp_val);
} else if (!strcasecmp(&tmp[3], "options"))
{
if (xkb_opts.options)
xfree(xkb_opts.options);
xkb_opts.options = strdup(tmp_val);
}
} else
{
/* all others */
add_option(&options, psi_key + sizeof(LIBHAL_PROP_KEY)-1, tmp_val);
xfree(tmp_val);
}
} else
{
/* server 1.4 had xkb_options as strlist. */
if ((tmp = strcasestr(psi_key, "xkb")) &&
(strlen(tmp) >= 4) &&
(!strcasecmp(&tmp[3], "options")) &&
(tmp_val = get_prop_string_array(hal_ctx, udi, psi_key)))
{
if (xkb_opts.options)
xfree(xkb_opts.options);
xkb_opts.options = strdup(tmp_val);
}
}
} else if (!strncasecmp(psi_key, LIBHAL_XKB_PROP_KEY, sizeof(LIBHAL_XKB_PROP_KEY)-1)){
char* tmp;
/* only support strings for all values */
tmp_val = get_prop_string(hal_ctx, udi, psi_key);
if (tmp_val && strlen(psi_key) >= sizeof(LIBHAL_XKB_PROP_KEY)) {
tmp = &psi_key[sizeof(LIBHAL_XKB_PROP_KEY) - 1];
if (!strcasecmp(tmp, "layout"))
{
if (!xkb_opts.layout)
xkb_opts.layout = strdup(tmp_val);
} else if (!strcasecmp(tmp, "rules"))
{
if (!xkb_opts.rules)
xkb_opts.rules = strdup(tmp_val);
} else if (!strcasecmp(tmp, "variant"))
{
if (!xkb_opts.variant)
xkb_opts.variant = strdup(tmp_val);
} else if (!strcasecmp(tmp, "model"))
{
if (!xkb_opts.model)
xkb_opts.model = strdup(tmp_val);
} else if (!strcasecmp(tmp, "options"))
{
if (!xkb_opts.options)
xkb_opts.options = strdup(tmp_val);
}
xfree(tmp_val);
} else
{
/* server 1.4 had xkb options as strlist */
tmp_val = get_prop_string_array(hal_ctx, udi, psi_key);
if (tmp_val && strlen(psi_key) >= sizeof(LIBHAL_XKB_PROP_KEY))
{
tmp = &psi_key[sizeof(LIBHAL_XKB_PROP_KEY) - 1];
if (!strcasecmp(tmp, ".options") && (!xkb_opts.options))
xkb_opts.options = strdup(tmp_val);
}
}
}
}
/* psi_key doesn't need to be freed */
libhal_psi_next(&set_iter);
}
/* Now add xkb options */
if (xkb_opts.layout)
add_option(&options, "xkb_layout", xkb_opts.layout);
if (xkb_opts.rules)
add_option(&options, "xkb_rules", xkb_opts.rules);
if (xkb_opts.variant)
add_option(&options, "xkb_variant", xkb_opts.variant);
if (xkb_opts.model)
add_option(&options, "xkb_model", xkb_opts.model);
if (xkb_opts.options)
add_option(&options, "xkb_options", xkb_opts.options);
/* this isn't an error, but how else do you output something that the user can see? */
LogMessage(X_INFO, "config/hal: Adding input device %s\n", name);
if (NewInputDeviceRequest(options, &dev) != Success) {
ErrorF("[config/hal] NewInputDeviceRequest failed\n");
LogMessage(X_ERROR, "config/hal: NewInputDeviceRequest failed\n");
dev = NULL;
goto unwind;
}
for (; dev; dev = dev->next)
for (; dev; dev = dev->next){
if (dev->config_info)
xfree(dev->config_info);
dev->config_info = xstrdup(config_info);
}
unwind:
if (set)
libhal_free_property_set(set);
if (path)
xfree(path);
if (driver)
xfree(driver);
if (name)
xfree(name);
if (xkb_rules)
xfree(xkb_rules);
if (xkb_model)
xfree(xkb_model);
if (xkb_layout)
xfree(xkb_layout);
if (xkb_variant)
xfree(xkb_variant);
if (xkb_options)
xfree(xkb_options);
if (config_info)
xfree(config_info);
while (!dev && (tmpo = options)) {
@ -270,7 +429,17 @@ unwind:
xfree(tmpo);
}
out_error:
if (xkb_opts.layout)
xfree(xkb_opts.layout);
if (xkb_opts.rules)
xfree(xkb_opts.rules);
if (xkb_opts.model)
xfree(xkb_opts.model);
if (xkb_opts.variant)
xfree(xkb_opts.variant);
if (xkb_opts.options)
xfree(xkb_opts.options);
dbus_error_free(&error);
return;
@ -286,7 +455,7 @@ disconnect_hook(void *data)
if (dbus_connection_get_is_connected(info->system_bus)) {
dbus_error_init(&error);
if (!libhal_ctx_shutdown(info->hal_ctx, &error))
DebugF("[config/hal] couldn't shut down context: %s (%s)\n",
LogMessage(X_WARNING, "config/hal: disconnect_hook couldn't shut down context: %s (%s)\n",
error.name, error.message);
dbus_error_free(&error);
}
@ -312,21 +481,21 @@ connect_hook(DBusConnection *connection, void *data)
if (!info->hal_ctx)
info->hal_ctx = libhal_ctx_new();
if (!info->hal_ctx) {
ErrorF("[config/hal] couldn't create HAL context\n");
LogMessage(X_ERROR, "config/hal: couldn't create HAL context\n");
goto out_err;
}
if (!libhal_ctx_set_dbus_connection(info->hal_ctx, info->system_bus)) {
ErrorF("[config/hal] couldn't associate HAL context with bus\n");
LogMessage(X_ERROR, "config/hal: couldn't associate HAL context with bus\n");
goto out_ctx;
}
if (!libhal_ctx_init(info->hal_ctx, &error)) {
ErrorF("[config/hal] couldn't initialise context: %s (%s)\n",
LogMessage(X_ERROR, "config/hal: couldn't initialise context: %s (%s)\n",
error.name, error.message);
goto out_ctx;
}
if (!libhal_device_property_watch_all(info->hal_ctx, &error)) {
ErrorF("[config/hal] couldn't watch all properties: %s (%s)\n",
LogMessage(X_ERROR, "config/hal: couldn't watch all properties: %s (%s)\n",
error.name, error.message);
goto out_ctx2;
}
@ -346,7 +515,7 @@ connect_hook(DBusConnection *connection, void *data)
out_ctx2:
if (!libhal_ctx_shutdown(info->hal_ctx, &error))
DebugF("[config/hal] couldn't shut down context: %s (%s)\n",
LogMessage(X_WARNING, "config/hal: couldn't shut down context: %s (%s)\n",
error.name, error.message);
out_ctx:
libhal_ctx_free(info->hal_ctx);
@ -374,10 +543,13 @@ config_hal_init(void)
hal_info.hal_ctx = NULL;
if (!config_dbus_core_add_hook(&hook)) {
ErrorF("[config/hal] failed to add D-Bus hook\n");
LogMessage(X_ERROR, "config/hal: failed to add D-Bus hook\n");
return 0;
}
/* verbose message */
LogMessageVerb(X_INFO,7,"config/hal: initialized");
return 1;
}

View File

@ -1,7 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<!-- FIXME: Support tablets too. -->
<!-- The way this works:
Match against some input device (see the HAL specification for more
information), and then merge in keys, which you can use to specify
the configuration similar to the way you would in xorg.conf. You will
need to restart HAL after making changes. If you are having issues,
starting X with the -logverbose 7 flag may yield useful information.
Keys Supported:
Key "input.x11_driver" (string)
This specifies the driver to use. You MUST specify this option,
or a driver will not be loaded and the rest will be ignored by
Xorg
Key "input.x11_options.<option name>" (string)
This allows you to specify arbitrary options to pass to the driver.
Anything you would normally specify in xorg.conf goes here. So, for
option "Mode" in xorg.conf, you would specify the key name of
"input.x11_options.Mode".
Do not specify "input.x11_options.Device" since "input.device"
will be used automatically.
Legacy Keys
"input.xkb.rules"
"input.xkb.model"
"input.xkb.layout"
"input.xkb.variant"
"input.xkb.options"
These keys are deprecated. Use these instead:
"input.x11_options.XkbRules"
"input.x11_options.XkbModel"
"input.x11_options.XkbLayout"
"input.x11_options.XkbVariant"
"input.x11_options.XkbOptions"
See the evdev documentation for more information.
You will probably want to add the following option to the ServerFlags of
your xorg.conf:
Option "AllowEmptyInput" "True"
FIXME: Support tablets too.
TODO: I think its fixed, can't test
-->
<match key="info.capabilities" contains="input.mouse">
<merge key="input.x11_driver" type="string">mouse</merge>
<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
@ -11,21 +61,21 @@
</match>
<match key="info.capabilities" contains="input.keys">
<merge key="input.xkb.rules" type="string">base</merge>
<merge key="input.x11_options.XkbRules" type="string">base</merge>
<!-- If we're using Linux, we use evdev by default (falling back to
keyboard otherwise). -->
<merge key="input.x11_driver" type="string">keyboard</merge>
<merge key="input.xkb.model" type="string">pc105</merge>
kbd otherwise). -->
<merge key="input.x11_driver" type="string">kbd</merge>
<merge key="input.x11_options.XkbModel" type="string">pc105</merge>
<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
string="Linux">
<merge key="input.x11_driver" type="string">evdev</merge>
<merge key="input.xkb.model" type="string">evdev</merge>
<merge key="input.x11_options.XkbModel" type="string">evdev</merge>
</match>
<merge key="input.xkb.layout" type="string">us</merge>
<merge key="input.x11_options.XkbLayout" type="string">us</merge>
<merge key="input.xkb.variant" type="string" />
<merge key="input.x11_options.XkbVariant" type="string" />
</match>
</device>
</deviceinfo>

View File

@ -26,7 +26,9 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.57)
AC_INIT([xorg-server], 1.4.99.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
AC_INIT([xorg-server], 1.5.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="5 November 2008"
REMEMBER_REMEMBER="The Fifth of November"
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([dist-bzip2 foreign])
AM_MAINTAINER_MODE
@ -190,7 +192,7 @@ dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
strtol getopt getopt_long vsnprintf walkcontext backtrace \
getisax getzoneid shmctl64])
getisax getzoneid shmctl64 strcasestr])
AC_FUNC_ALLOCA
dnl Old HAS_* names used in os/*.c.
AC_CHECK_FUNC([getdtablesize],
@ -313,6 +315,7 @@ case $host_cpu in
case $host_os in
*linux*) DEFAULT_INT10=vm86 ;;
*freebsd*) AC_DEFINE(USE_DEV_IO) ;;
*dragonfly*) AC_DEFINE(USE_DEV_IO) ;;
*netbsd*) AC_DEFINE(USE_I386_IOPL)
SYS_LIBS=-li386
;;
@ -337,6 +340,7 @@ case $host_cpu in
I386_VIDEO=yes
case $host_os in
*freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
*dragonfly*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
*netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl])
SYS_LIBS=-lx86_64
;;
@ -367,7 +371,7 @@ DRI2=no
KDRIVE_HW=no
dnl it would be nice to autodetect these *CONS_SUPPORTs
case $host_os in
*freebsd*)
*freebsd* | *dragonfly*)
case $host_os in
kfreebsd*-gnu) ;;
*) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;;
@ -416,7 +420,6 @@ VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}"
VENDOR_NAME="The X.Org Foundation"
VENDOR_NAME_SHORT="X.Org"
RELEASE_DATE="5 September 2007"
VENDOR_WEB="http://wiki.x.org"
m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
@ -524,7 +527,7 @@ AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string
AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-shm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes])
AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
AC_ARG_ENABLE(xtrap, AS_HELP_STRING([--disable-xtrap], [Build XTrap extension (default: enabled)]), [XTRAP=$enableval], [XTRAP=yes])
AC_ARG_ENABLE(xtrap, AS_HELP_STRING([--enable-xtrap], [Build XTrap extension (default: no)]), [XTRAP=$enableval], [XTRAP=no])
AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: disabled)]), [RECORD=$enableval], [RECORD=no])
AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes])
@ -534,7 +537,7 @@ AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP ext
AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto])
AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes])
AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval])
AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval])
AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: no)]), [DRI2=$enableval], [DRI2=no])
AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes])
AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto])
AC_ARG_ENABLE(xf86misc, AS_HELP_STRING([--disable-xf86misc], [Build XF86Misc extension (default: auto)]), [XF86MISC=$enableval], [XF86MISC=auto])
@ -582,7 +585,7 @@ AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive
AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto])
AC_ARG_ENABLE(kdrive-vesa, AS_HELP_STRING([--enable-kdrive-vesa], [Build the kdrive VESA-based servers (default: auto)]), [KDRIVEVESA=$enableval], [KDRIVEVESA=auto])
dnl xprint
AC_ARG_ENABLE(freetype, AS_HELP_STRING([ --enable-freetype], [Build Xprint FreeType backend (default: yes)]), [XP_USE_FREETYPE=$enableval],[XP_USE_FREETYPE=no])
AC_ARG_ENABLE(freetype, AS_HELP_STRING([ --enable-freetype], [Build Xprint FreeType backend (default: no)]), [XP_USE_FREETYPE=$enableval],[XP_USE_FREETYPE=no])
AC_ARG_WITH(freetype-config, AS_HELP_STRING([ --with-freetype-config=PROG], [Use FreeType configuration program PROG (default: auto)]), freetype_config=$withval, freetype_config=auto)
@ -660,7 +663,7 @@ else
RENDERPROTO="renderproto"
fi
REQUIRED_MODULES="[randrproto >= 1.2] $RENDERPROTO [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]"
REQUIRED_MODULES="[randrproto >= 1.2] $RENDERPROTO [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.4] [kbproto >= 1.0.3]"
REQUIRED_LIBS="xfont xau fontenc [pixman-1 >= 0.9.5]"
dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
@ -705,6 +708,15 @@ if test "x$NEED_DBUS" = xyes; then
fi
CONFIG_LIB='$(top_builddir)/config/libconfig.a'
AC_MSG_CHECKING([for glibc...])
AC_PREPROC_IFELSE([
#include <features.h>
#ifndef __GLIBC__
#error
#endif
], glibc=yes, glibc=no)
AC_MSG_RESULT([$glibc])
AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes],
[AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt],
[have_clock_gettime=no])])
@ -720,9 +732,13 @@ if ! test "x$have_clock_gettime" = xno; then
LIBS_SAVE="$LIBS"
LIBS="$CLOCK_LIBS"
CPPFLAGS_SAVE="$CPPFLAGS"
if test x"$glibc" = xyes; then
CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
fi
AC_RUN_IFELSE([
#define _POSIX_C_SOURCE 199309L
#include <time.h>
int main(int argc, char *argv[[]]) {
@ -737,6 +753,7 @@ int main(int argc, char *argv[[]]) {
[MONOTONIC_CLOCK="cross compiling"])
LIBS="$LIBS_SAVE"
CPPFLAGS="$CPPFLAGS_SAVE"
else
MONOTONIC_CLOCK=no
fi
@ -806,22 +823,13 @@ if test "x$RES" = xyes; then
REQUIRED_MODULES="$REQUIRED_MODULES resourceproto"
fi
if test "x$GLX" = xyes && ! test "x$MESA_SOURCE" = x; then
if test "x$GLX" = xyes; then
PKG_CHECK_MODULES([XLIB], [x11])
PKG_CHECK_MODULES([GL], [glproto >= 1.4.9])
PKG_CHECK_MODULES([GL], [glproto >= 1.4.9 gl >= 7.1.0])
AC_SUBST(XLIB_CFLAGS)
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
GLX_LIBS='$(top_builddir)/GL/glx/libglx.la $(top_builddir)/GL/mesa/libGLcore.la'
test -d GL || mkdir GL
case $host_os in
solaris*)
SYMLINK_MESA="/usr/bin/bash $srcdir/GL/symlink-mesa.sh" ;;
*) SYMLINK_MESA=$srcdir/GL/symlink-mesa.sh ;;
esac
$SYMLINK_MESA $MESA_SOURCE GL/
if test $? -ne 0; then
AC_MSG_ERROR([Failed to link Mesa source tree. Please specify a proper path to Mesa sources, or disable GLX.])
fi
GLX_LIBS='$(top_builddir)/glx/libglx.la'
GLX_SYS_LIBS="$GLX_SYS_LIBS $DLOPEN_LIBS"
else
GLX=no
fi
@ -846,7 +854,7 @@ if test "x$DRI" = xyes; then
AC_DEFINE(XF86DRI, 1, [Build DRI extension])
PKG_CHECK_MODULES([DRIPROTO], [xf86driproto])
PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.0])
PKG_CHECK_MODULES([GL], [glproto >= 1.4.1])
PKG_CHECK_MODULES([GL], [glproto >= 1.4.1 gl >= 7.1.0])
PKG_CHECK_EXISTS(libdrm >= 2.2.0,
[AC_DEFINE([HAVE_LIBDRM_2_2], 1,
[Has version 2.2 (or newer) of the drm library])])
@ -860,8 +868,8 @@ AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
if test "x$DRI2" = xyes; then
# FIXME: Bump the versions once we have releases of these.
AC_DEFINE(DRI2, 1, [Build DRI2 extension])
PKG_CHECK_MODULES([DRIPROTO], [xf86driproto >= 2.0.3])
PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.1])
PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= 1.1])
PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.2])
fi
AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes])
@ -1009,6 +1017,10 @@ XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1,
[Do not have 'strcasecmp'.]))
AC_CHECK_FUNC(strncasecmp, [], AC_DEFINE([NEED_STRNCASECMP], 1,
[Do not have 'strncasecmp'.]))
AC_CHECK_FUNC(strcasestr, [], AC_DEFINE([NEED_STRCASESTR], 1,
[Do not have 'strcasestr'.]))
if test "x$NULL_ROOT_CURSOR" = xyes; then
AC_DEFINE(NULL_ROOT_CURSOR, 1, [Use an empty root cursor])
@ -1113,7 +1125,9 @@ PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
# OpenSSL used for SHA1 hashing in render/glyph.c, but we don't need all of
# the OpenSSL libraries, just libcrypto
PKG_CHECK_MODULES([OPENSSL], [openssl], [OPENSSL_LIB_FLAGS=`$PKG_CONFIG --libs-only-L --libs-only-other openssl`])
PKG_CHECK_EXISTS([openssl],
[PKG_CHECK_MODULES([OPENSSL], [openssl],
[OPENSSL_LIB_FLAGS=`$PKG_CONFIG --libs-only-L --libs-only-other openssl`])])
LIBCRYPTO="$OPENSSL_LIB_FLAGS -lcrypto"
# Autotools has some unfortunate issues with library handling. In order to
@ -1308,6 +1322,14 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then
XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XPSTUBS_LIB $SELINUX_LIB"
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
SAVE_LIBS=$LIBS
SAVE_CFLAGS=$CFLAGS
CFLAGS=$PCIACCESS_CFLAGS
LIBS=$PCIACCESS_LIBS
AC_CHECK_FUNCS([pci_system_init_dev_mem])
AC_CHECK_FUNCS([pci_device_enable])
LIBS=$SAVE_LIBS
CFLAGS=$SAVE_CFLAGS
XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS"
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
@ -1327,8 +1349,6 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then
;;
alpha*)
linux_alpha=yes
XORG_OS_PCI="axp"
xorg_bus_linuxpci="no"
;;
i*86|amd64*|x86_64*)
linux_acpi="yes"
@ -1337,7 +1357,7 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then
;;
esac
;;
freebsd* | kfreebsd*-gnu)
freebsd* | kfreebsd*-gnu | dragonfly*)
XORG_OS="freebsd"
XORG_OS_SUBDIR="bsd"
xorg_bus_bsdpci="yes"
@ -1532,7 +1552,11 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then
abi_xinput=`extract_abi XINPUT`
abi_extension=`extract_abi EXTENSION`
abi_font=`extract_abi FONT`
AC_SUBST([abi_ansic abi_videodrv abi_xinput abi_extension abi_font])
AC_SUBST([abi_ansic])
AC_SUBST([abi_videodrv])
AC_SUBST([abi_xinput])
AC_SUBST([abi_extension])
AC_SUBST([abi_font])
fi
AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes])
@ -1571,8 +1595,8 @@ AC_MSG_RESULT([$XPRINT])
if test "x$XPRINT" = xyes; then
PKG_CHECK_MODULES([XPRINTMODULES], [printproto x11 xfont $XDMCP_MODULES xau])
XPRINT_CFLAGS="$XPRINTMODULES_CFLAGS"
XPRINT_LIBS="$XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS $MIEXT_DAMAGE_LIB $XKB_LIB $XKB_STUB_LIB"
XPRINT_CFLAGS="$XPRINTMODULES_CFLAGS -DXPRINT"
XPRINT_LIBS="$XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS $MIEXT_DAMAGE_LIB $XKB_LIB $XKB_STUB_LIB"
XPRINT_SYS_LIBS="$XPRINTMODULES_LIBS"
xpconfigdir=$libdir/X11/xserver
@ -1709,22 +1733,14 @@ fi
if test "x$XQUARTZ" = xyes; then
AC_DEFINE([XQUARTZ],[1],[Have Quartz])
#glxAGL / glxCGL don't work yet
# AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[
# save_LDFLAGS=$LDFLAGS
# LDFLAGS="$LDFLAGS -framework AGL"
# AC_LINK_IFELSE(
# [char aglEnable(); int main() { aglEnable(); return 0;}],
# [xorg_cv_AGL_framework=yes],
# [xorg_cv_AGL_framework=no])
# LDFLAGS=$save_LDFLAGS
# ])
xorg_cv_AGL_framework=no
DARWIN_GLX_LIBS='$(top_builddir)/GL/apple/indirect.o $(top_builddir)/GL/glx/libglx.la'
DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB"
DARWIN_GLX_LIBS='$(top_builddir)/hw/xquartz/GL/libCGLCore.la $(top_builddir)/glx/libglx.la'
DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $DARWIN_GLX_LIBS"
AC_SUBST([DARWIN_LIBS])
AC_CHECK_LIB([Xplugin],[xp_init],[:])
CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA"
if test "x$XF86MISC" = xyes || test "x$XF86MISC" = xauto; then
AC_MSG_NOTICE([Disabling XF86Misc extension])
XF86MISC=no
@ -2041,7 +2057,7 @@ AM_CONDITIONAL(USE_CURSES, [test x$CURSES = xyes])
AC_ARG_ENABLE(kbd_mode, AS_HELP_STRING([--enable-kbd_mode],
[Build kbd_mode utility (default: auto)]),
[BUILD_KBD_MODE=$enable_val], [BUILD_KBD_MODE="auto"])
[BUILD_KBD_MODE=$enableval], [BUILD_KBD_MODE="auto"])
if test x$BUILD_KBD_MODE != xno ; then
case $host_os in
*bsd*)
@ -2071,28 +2087,16 @@ DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"
AC_SUBST([DIX_CFLAGS])
AC_SUBST([libdir exec_prefix prefix])
AC_SUBST([libdir])
AC_SUBST([exec_prefix])
AC_SUBST([prefix])
# Man page sections - used in config utils & generating man pages
XORG_MANPAGE_SECTIONS
AC_OUTPUT([
Makefile
GL/Makefile
GL/apple/Makefile
GL/glx/Makefile
GL/mesa/Makefile
GL/mesa/glapi/Makefile
GL/mesa/main/Makefile
GL/mesa/math/Makefile
GL/mesa/shader/Makefile
GL/mesa/shader/grammar/Makefile
GL/mesa/shader/slang/Makefile
GL/mesa/swrast/Makefile
GL/mesa/swrast_setup/Makefile
GL/mesa/tnl/Makefile
GL/mesa/vbo/Makefile
GL/mesa/X/Makefile
glx/Makefile
include/Makefile
afb/Makefile
composite/Makefile
@ -2190,6 +2194,7 @@ hw/xgl/glxext/module/Makefile
hw/xnest/Makefile
hw/xwin/Makefile
hw/xquartz/Makefile
hw/xquartz/GL/Makefile
hw/xquartz/bundle/Makefile
hw/xquartz/xpr/Makefile
hw/kdrive/Makefile

View File

@ -229,6 +229,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
xDbeSwapAction swapAction;
VisualID visual;
int status;
int add_index;
REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq);
@ -299,14 +300,6 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
return(BadAlloc);
bzero(pDbeWindowPriv, sizeof(DbeWindowPrivRec));
/* Make the window priv a DBE window priv resource. */
if (!AddResource(stuff->buffer, dbeWindowPrivResType,
(pointer)pDbeWindowPriv))
{
xfree(pDbeWindowPriv);
return(BadAlloc);
}
/* Fill out window priv information. */
pDbeWindowPriv->pWindow = pWin;
pDbeWindowPriv->width = pWin->drawable.width;
@ -321,14 +314,15 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
/* Initialize the buffer ID list. */
pDbeWindowPriv->maxAvailableIDs = DBE_INIT_MAX_IDS;
pDbeWindowPriv->IDs[0] = stuff->buffer;
for (i = 1; i < DBE_INIT_MAX_IDS; i++)
add_index = 0;
for (i = 0; i < DBE_INIT_MAX_IDS; i++)
{
pDbeWindowPriv->IDs[i] = DBE_FREE_ID_ELEMENT;
}
/* Actually connect the window priv to the window. */
dixSetPrivate(&pWin->devPrivates, dbeWindowPrivKey, pDbeWindowPriv);
dixSetPrivate(&pWin->devPrivates, dbeWindowPrivKey, pDbeWindowPriv);
} /* if -- There is no buffer associated with the window. */
@ -354,7 +348,6 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
/* No more room in the ID array -- reallocate another array. */
XID *pIDs;
/* Setup an array pointer for the realloc operation below. */
if (pDbeWindowPriv->maxAvailableIDs == DBE_INIT_MAX_IDS)
{
@ -391,16 +384,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
pDbeWindowPriv->maxAvailableIDs += DBE_INCR_MAX_IDS;
}
/* Finally, record the buffer ID in the array. */
pDbeWindowPriv->IDs[i] = stuff->buffer;
/* Associate the new ID with an existing window priv. */
if (!AddResource(stuff->buffer, dbeWindowPrivResType,
(pointer)pDbeWindowPriv))
{
pDbeWindowPriv->IDs[i] = DBE_FREE_ID_ELEMENT;
return(BadAlloc);
}
add_index = i;
} /* else -- A buffer is already associated with the window. */
@ -409,13 +393,26 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
status = (*pDbeScreenPriv->AllocBackBufferName)(pWin, stuff->buffer,
stuff->swapAction);
if ((status != Success) && (pDbeWindowPriv->nBufferIDs == 0))
if (status == Success)
{
pDbeWindowPriv->IDs[add_index] = stuff->buffer;
if (!AddResource(stuff->buffer, dbeWindowPrivResType,
(pointer)pDbeWindowPriv))
{
pDbeWindowPriv->IDs[add_index] = DBE_FREE_ID_ELEMENT;
if (pDbeWindowPriv->nBufferIDs == 0) {
status = BadAlloc;
goto out_free;
}
}
} else {
/* The DDX buffer allocation routine failed for the first buffer of
* this window.
*/
xfree(pDbeWindowPriv);
return(status);
if (pDbeWindowPriv->nBufferIDs == 0) {
goto out_free;
}
}
/* Increment the number of buffers (XIDs) associated with this window. */
@ -424,9 +421,13 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
/* Set swap action on all calls. */
pDbeWindowPriv->swapAction = stuff->swapAction;
return(status);
out_free:
dixSetPrivate(&pWin->devPrivates, dbeWindowPrivKey, NULL);
xfree(pDbeWindowPriv);
return (status);
} /* ProcDbeAllocateBackBufferName() */

View File

@ -1,4 +1,10 @@
noinst_LTLIBRARIES = libdix.la libxpstubs.la
standard_dix_libs = libdix.la libxpstubs.la
if XPRINT
noinst_LTLIBRARIES = $(standard_dix_libs) libXpdix.la
else
noinst_LTLIBRARIES = $(standard_dix_libs)
endif
AM_CFLAGS = $(DIX_CFLAGS) \
-DVENDOR_NAME=\""@VENDOR_NAME@"\" \
@ -34,12 +40,17 @@ libdix_la_SOURCES = \
swapreq.c \
tables.c \
window.c \
strcasecmp.c
strcasecmp.c \
strcasestr.c
libxpstubs_la_SOURCES = \
xpstubs.c
INCLUDES = -I$(top_srcdir)/Xprint
if XPRINT
libXpdix_la_SOURCES = $(libdix_la_SOURCES)
libXpdix_la_CPPFLAGS = -I$(top_srcdir)/hw/xprint
libXpdix_la_CFLAGS = $(AM_CFLAGS) $(XPRINT_CFLAGS)
endif
EXTRA_DIST = buildatoms BuiltInAtoms CHANGES Xserver.d Xserver-dtrace.h.in

View File

@ -618,12 +618,12 @@ CloseDownDevices(void)
for (dev = inputInfo.devices; dev; dev = next)
{
next = dev->next;
CloseDevice(dev);
DeleteInputDeviceRequest(dev);
}
for (dev = inputInfo.off_devices; dev; dev = next)
{
next = dev->next;
CloseDevice(dev);
DeleteInputDeviceRequest(dev);
}
inputInfo.devices = NULL;
inputInfo.off_devices = NULL;

View File

@ -1338,8 +1338,8 @@ CreatePmap:
}
if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap))
return(client->noClientException);
(*pDraw->pScreen->DestroyPixmap)(pMap);
}
(*pDraw->pScreen->DestroyPixmap)(pMap);
return (BadAlloc);
}

View File

@ -349,7 +349,7 @@ getValuatorEvents(xEvent *events, DeviceIntPtr pDev, int first_valuator,
for (i = first_valuator; i < final_valuator; i += 6, xv++, events++) {
xv->type = DeviceValuator;
xv->first_valuator = i;
xv->num_valuators = ((num_valuators - i) > 6) ? 6 : (num_valuators - i);
xv->num_valuators = ((final_valuator - i) > 6) ? 6 : (final_valuator - i);
xv->deviceid = pDev->id;
switch (final_valuator - i) {
case 6:
@ -408,7 +408,7 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
int numEvents = 0;
CARD32 ms = 0;
KeySym *map = pDev->key->curKeySyms.map;
KeySym sym = map[key_code * pDev->key->curKeySyms.mapWidth];
KeySym sym;
deviceKeyButtonPointer *kbp = NULL;
if (!events)
@ -425,6 +425,9 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
if (key_code < 8 || key_code > 255)
return 0;
sym = map[(key_code - pDev->key->curKeySyms.minKeyCode)
* pDev->key->curKeySyms.mapWidth];
if (pDev->coreEvents)
numEvents = 2;
else

View File

@ -458,7 +458,10 @@ main(int argc, char *argv[], char *envp[])
#endif
config_fini();
memset(WindowTable, 0, MAXSCREENS * sizeof(WindowPtr));
CloseDownDevices();
for (i = screenInfo.numScreens - 1; i >= 0; i--)
{
FreeScratchPixmapsForScreen(i);

View File

@ -39,6 +39,12 @@ from The Open Group.
#include "colormapst.h"
#include "inputstr.h"
struct _Private {
DevPrivateKey key;
pointer value;
struct _Private *next;
};
typedef struct _PrivateDesc {
DevPrivateKey key;
unsigned size;
@ -116,6 +122,65 @@ dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key)
return &ptr->value;
}
/*
* Look up a private pointer.
*/
_X_EXPORT pointer
dixLookupPrivate(PrivateRec **privates, const DevPrivateKey key)
{
PrivateRec *rec = *privates;
pointer *ptr;
while (rec) {
if (rec->key == key)
return rec->value;
rec = rec->next;
}
ptr = dixAllocatePrivate(privates, key);
return ptr ? *ptr : NULL;
}
/*
* Look up the address of a private pointer.
*/
_X_EXPORT pointer *
dixLookupPrivateAddr(PrivateRec **privates, const DevPrivateKey key)
{
PrivateRec *rec = *privates;
while (rec) {
if (rec->key == key)
return &rec->value;
rec = rec->next;
}
return dixAllocatePrivate(privates, key);
}
/*
* Set a private pointer.
*/
_X_EXPORT int
dixSetPrivate(PrivateRec **privates, const DevPrivateKey key, pointer val)
{
PrivateRec *rec;
top:
rec = *privates;
while (rec) {
if (rec->key == key) {
rec->value = val;
return TRUE;
}
rec = rec->next;
}
if (!dixAllocatePrivate(privates, key))
return FALSE;
goto top;
}
/*
* Called to free privates at object deletion time.
*/

View File

@ -359,16 +359,28 @@ V000 SECURITY:AuthorizationRevoked
E000 SECURITY:BadAuthorization
E001 SECURITY:BadAuthorizationProtocol
R000 SELinux:SELinuxQueryVersion
R001 SELinux:SELinuxSetSelectionManager
R002 SELinux:SELinuxGetSelectionManager
R001 SELinux:SELinuxSetDeviceCreateContext
R002 SELinux:SELinuxGetDeviceCreateContext
R003 SELinux:SELinuxSetDeviceContext
R004 SELinux:SELinuxGetDeviceContext
R005 SELinux:SELinuxSetPropertyCreateContext
R006 SELinux:SELinuxGetPropertyCreateContext
R007 SELinux:SELinuxGetPropertyContext
R008 SELinux:SELinuxSetWindowCreateContext
R009 SELinux:SELinuxGetWindowCreateContext
R010 SELinux:SELinuxGetWindowContext
R005 SELinux:SELinuxSetWindowCreateContext
R006 SELinux:SELinuxGetWindowCreateContext
R007 SELinux:SELinuxGetWindowContext
R008 SELinux:SELinuxSetPropertyCreateContext
R009 SELinux:SELinuxGetPropertyCreateContext
R010 SELinux:SELinuxSetPropertyUseContext
R011 SELinux:SELinuxGetPropertyUseContext
R012 SELinux:SELinuxGetPropertyContext
R013 SELinux:SELinuxGetPropertyDataContext
R014 SELinux:SELinuxListProperties
R015 SELinux:SELinuxSetSelectionCreateContext
R016 SELinux:SELinuxGetSelectionCreateContext
R017 SELinux:SELinuxSetSelectionUseContext
R018 SELinux:SELinuxGetSelectionUseContext
R019 SELinux:SELinuxGetSelectionContext
R020 SELinux:SELinuxGetSelectionDataContext
R021 SELinux:SELinuxListSelections
R022 SELinux:SELinuxGetClientContext
R000 SHAPE:QueryVersion
R001 SHAPE:Rectangles
R002 SHAPE:Mask

View File

@ -126,10 +126,12 @@ RegisterExtensionNames(ExtensionEntry *extEntry)
rewind(fh);
while (fgets(buf, sizeof(buf), fh)) {
lineobj = NULL;
ptr = strchr(buf, '\n');
if (ptr)
*ptr = 0;
/* Check for comments or empty lines */
switch (buf[0]) {
case PROT_REQUEST:
case PROT_EVENT:
@ -139,48 +141,54 @@ RegisterExtensionNames(ExtensionEntry *extEntry)
case '\0':
continue;
default:
continue;
goto invalid;
}
/* Check for space character in the fifth position */
ptr = strchr(buf, ' ');
if (!ptr || ptr != buf + 4) {
LogMessage(X_WARNING, "Invalid line in " FILENAME ", skipping\n");
continue;
}
if (!ptr || ptr != buf + 4)
goto invalid;
/* Duplicate the string after the space */
lineobj = strdup(ptr + 1);
if (!lineobj)
continue;
/* Check for a colon somewhere on the line */
ptr = strchr(buf, ':');
if (!ptr) {
LogMessage(X_WARNING, "Invalid line in " FILENAME ", skipping\n");
continue;
}
if (!ptr)
goto invalid;
/* Compare the part before colon with the target extension name */
*ptr = 0;
if (strcmp(buf + 5, extEntry->name))
continue;
goto skip;
/* Get the opcode for the request, event, or error */
offset = strtol(buf + 1, &ptr, 10);
if (offset == 0 && ptr == buf + 1) {
LogMessage(X_WARNING, "Invalid line in " FILENAME ", skipping\n");
continue;
}
if (offset == 0 && ptr == buf + 1)
goto invalid;
/* Save the strdup result in the registry */
switch(buf[0]) {
case PROT_REQUEST:
if (extEntry->base)
RegisterRequestName(extEntry->base, offset, lineobj);
else
RegisterRequestName(offset, 0, lineobj);
break;
continue;
case PROT_EVENT:
RegisterEventName(extEntry->eventBase + offset, lineobj);
break;
continue;
case PROT_ERROR:
RegisterErrorName(extEntry->errorBase + offset, lineobj);
break;
continue;
}
invalid:
LogMessage(X_WARNING, "Invalid line in " FILENAME ", skipping\n");
skip:
free(lineobj);
}
}

View File

@ -66,24 +66,22 @@ SOFTWARE.
*****************************************************************/
_X_EXPORT Selection *CurrentSelections;
static int NumCurrentSelections;
CallbackListPtr SelectionCallback;
_X_EXPORT int
dixLookupSelection(Selection **result, Atom selectionName,
ClientPtr client, Mask access_mode)
{
Selection *pSel = NULL;
int i, rc = BadMatch;
Selection *pSel;
int rc = BadMatch;
client->errorValue = selectionName;
for (i = 0; i < NumCurrentSelections; i++)
if (CurrentSelections[i].selection == selectionName) {
pSel = CurrentSelections + i;
rc = XaceHookSelectionAccess(client, &pSel, access_mode);
for (pSel = CurrentSelections; pSel; pSel = pSel->next)
if (pSel->selection == selectionName)
break;
}
if (pSel)
rc = XaceHookSelectionAccess(client, &pSel, access_mode);
*result = pSel;
return rc;
}
@ -91,14 +89,17 @@ dixLookupSelection(Selection **result, Atom selectionName,
void
InitSelections(void)
{
Selection *pSel = CurrentSelections;
Selection *pSel, *pNextSel;
for (; pSel - CurrentSelections < NumCurrentSelections; pSel++)
pSel = CurrentSelections;
while (pSel) {
pNextSel = pSel->next;
dixFreePrivates(pSel->devPrivates);
xfree(pSel);
pSel = pNextSel;
}
xfree(CurrentSelections);
CurrentSelections = NULL;
NumCurrentSelections = 0;
}
static _X_INLINE void
@ -112,9 +113,9 @@ CallSelectionCallback(Selection *pSel, ClientPtr client,
void
DeleteWindowFromAnySelections(WindowPtr pWin)
{
Selection *pSel = CurrentSelections;
Selection *pSel;
for (; pSel - CurrentSelections < NumCurrentSelections; pSel++)
for (pSel = CurrentSelections; pSel; pSel = pSel->next)
if (pSel->pWin == pWin) {
CallSelectionCallback(pSel, NULL, SelectionWindowDestroy);
@ -127,9 +128,9 @@ DeleteWindowFromAnySelections(WindowPtr pWin)
void
DeleteClientFromAnySelections(ClientPtr client)
{
Selection *pSel = CurrentSelections;
Selection *pSel;
for (; pSel - CurrentSelections < NumCurrentSelections; pSel++)
for (pSel = CurrentSelections; pSel; pSel = pSel->next)
if (pSel->client == client) {
CallSelectionCallback(pSel, NULL, SelectionClientClose);
@ -197,23 +198,23 @@ ProcSetSelectionOwner(ClientPtr client)
/*
* It doesn't exist, so add it...
*/
int size = (NumCurrentSelections + 1) * sizeof(Selection);
CurrentSelections = xrealloc(CurrentSelections, size);
if (!CurrentSelections) {
NumCurrentSelections = 0;
pSel = xalloc(sizeof(Selection));
if (!pSel)
return BadAlloc;
}
pSel = CurrentSelections + NumCurrentSelections;
pSel->selection = stuff->selection;
pSel->devPrivates = NULL;
/* security creation/labeling check */
(void)XaceHookSelectionAccess(client, &pSel, DixCreateAccess);
rc = XaceHookSelectionAccess(client, &pSel,
DixCreateAccess|DixSetAttrAccess);
if (rc != Success) {
xfree(pSel);
return rc;
}
pSel->next = NULL;
if (NumCurrentSelections > 0)
CurrentSelections[NumCurrentSelections - 1].next = pSel;
NumCurrentSelections++;
pSel->next = CurrentSelections;
CurrentSelections = pSel;
}
else
return rc;

View File

@ -1,28 +1,31 @@
/************************************************************
Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, 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 Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS 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.
********************************************************/
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
@ -33,7 +36,7 @@
#ifdef NEED_STRCASECMP
int
xstrcasecmp(char *str1,char *str2)
xstrcasecmp(const char *str1, const char *str2)
{
const u_char *us1 = (const u_char *)str1, *us2 = (const u_char *)str2;
@ -46,3 +49,22 @@ xstrcasecmp(char *str1,char *str2)
return (tolower(*us1) - tolower(*us2));
}
#endif
#ifdef NEED_STRNCASECMP
int
xstrncasecmp(const char *s1, const char *s2, size_t n)
{
if (n != 0) {
const u_char *us1 = (const u_char *)s1, *us2 = (const u_char *)s2;
do {
if (tolower(*us1) != tolower(*us2++))
return (tolower(*us1) - tolower(*--us2));
if (*us1++ == '\0')
break;
} while (--n != 0);
}
return 0;
}
#endif

64
dix/strcasestr.c Normal file
View File

@ -0,0 +1,64 @@
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <ctype.h>
#include <string.h>
#include "dix.h"
/*
* Find the first occurrence of find in s, ignore case.
*/
#ifdef NEED_STRCASESTR
char *
xstrcasestr(const char *s, const char *find)
{
char c, sc;
size_t len;
if ((c = *find++) != 0) {
c = tolower((unsigned char)c);
len = strlen(find);
do {
do {
if ((sc = *s++) == 0)
return (NULL);
} while ((char)tolower((unsigned char)sc) != c);
} while (strncasecmp(s, find, len) != 0);
s--;
}
return ((char *)s);
}
#endif

View File

@ -884,6 +884,7 @@ CrushTree(WindowPtr pWin)
(*UnrealizeWindow)(pChild);
}
FreeWindowResources(pChild);
dixFreePrivates(pChild->devPrivates);
xfree(pChild);
if ( (pChild = pSib) )
break;

View File

@ -507,7 +507,7 @@ by the \fIfont path\fP.
The default font path is
__default_font_path__ .
.LP
A special kind of directory can be specified using the the \fBcatalogue\fP:
A special kind of directory can be specified using the \fBcatalogue\fP:
prefix. Directories specified this way can contain symlinks pointing to the
real font directories. See the FONTPATH.D section for details.
.LP

153
exa/exa.c
View File

@ -43,6 +43,10 @@
DevPrivateKey exaScreenPrivateKey = &exaScreenPrivateKey;
DevPrivateKey exaPixmapPrivateKey = &exaPixmapPrivateKey;
#ifdef MITSHM
static ShmFuncs exaShmFuncs = { NULL, NULL };
#endif
static _X_INLINE void*
ExaGetPixmapAddress(PixmapPtr p)
{
@ -224,6 +228,43 @@ exaLog2(int val)
return bits - 1;
}
static void
exaSetAccelBlock(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
int w, int h, int bpp)
{
pExaPixmap->accel_blocked = 0;
if (pExaScr->info->maxPitchPixels) {
int max_pitch = pExaScr->info->maxPitchPixels * (bpp + 7) / 8;
if (pExaPixmap->fb_pitch > max_pitch)
pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
}
if (pExaScr->info->maxPitchBytes &&
pExaPixmap->fb_pitch > pExaScr->info->maxPitchBytes)
pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
if (w > pExaScr->info->maxX)
pExaPixmap->accel_blocked |= EXA_RANGE_WIDTH;
if (h > pExaScr->info->maxY)
pExaPixmap->accel_blocked |= EXA_RANGE_HEIGHT;
}
static void
exaSetFbPitch(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
int w, int h, int bpp)
{
if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
pExaPixmap->fb_pitch = (1 << (exaLog2(w - 1) + 1)) * bpp / 8;
else
pExaPixmap->fb_pitch = w * bpp / 8;
pExaPixmap->fb_pitch = EXA_ALIGN(pExaPixmap->fb_pitch,
pExaScr->info->pixmapPitchAlign);
}
/**
* exaCreatePixmap() creates a new pixmap.
*
@ -262,39 +303,33 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
if (driver_alloc) {
size_t paddedWidth, datasize;
void *driver_priv;
paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
if (paddedWidth / 4 > 32767 || h > 32767)
return NullPixmap;
if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
pExaPixmap->fb_pitch = (1 << (exaLog2(w - 1) + 1)) * bpp / 8;
else
pExaPixmap->fb_pitch = w * bpp / 8;
pExaPixmap->fb_pitch = EXA_ALIGN(pExaPixmap->fb_pitch,
pExaScr->info->pixmapPitchAlign);
exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp);
if (paddedWidth < pExaPixmap->fb_pitch)
paddedWidth = pExaPixmap->fb_pitch;
datasize = h * paddedWidth;
driver_priv = pExaScr->info->CreatePixmap(pScreen, datasize, 0);
if (!driver_priv) {
pExaPixmap->driverPriv = pExaScr->info->CreatePixmap(pScreen, datasize, 0);
if (!pExaPixmap->driverPriv) {
fbDestroyPixmap(pPixmap);
return NULL;
}
(*pScreen->ModifyPixmapHeader)(pPixmap, w, h, 0, 0,
paddedWidth, NULL);
pExaPixmap->driverPriv = driver_priv;
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
pExaPixmap->fb_ptr = NULL;
} else {
pExaPixmap->driverPriv = NULL;
/* Scratch pixmaps may have w/h equal to zero, and may not be
* migrated.
*/
pExaPixmap->driverPriv = NULL;
/* Scratch pixmaps may have w/h equal to zero, and may not be
* migrated.
*/
if (!w || !h)
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
else
@ -307,12 +342,7 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
pExaPixmap->offscreen = FALSE;
pExaPixmap->fb_ptr = NULL;
if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
pExaPixmap->fb_pitch = (1 << (exaLog2(w - 1) + 1)) * bpp / 8;
else
pExaPixmap->fb_pitch = w * bpp / 8;
pExaPixmap->fb_pitch = EXA_ALIGN(pExaPixmap->fb_pitch,
pExaScr->info->pixmapPitchAlign);
exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp);
pExaPixmap->fb_size = pExaPixmap->fb_pitch * h;
if (pExaPixmap->fb_pitch > 131071) {
@ -339,25 +369,8 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
REGION_NULL(pScreen, &pExaPixmap->validSys);
REGION_NULL(pScreen, &pExaPixmap->validFB);
/* Check whether this pixmap can be used for acceleration. */
pExaPixmap->accel_blocked = 0;
if (pExaScr->info->maxPitchPixels) {
int max_pitch = pExaScr->info->maxPitchPixels * (bpp + 7) / 8;
if (pExaPixmap->fb_pitch > max_pitch)
pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
}
if (pExaScr->info->maxPitchBytes &&
pExaPixmap->fb_pitch > pExaScr->info->maxPitchBytes)
pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
if (w > pExaScr->info->maxX)
pExaPixmap->accel_blocked |= EXA_RANGE_WIDTH;
if (h > pExaScr->info->maxY)
pExaPixmap->accel_blocked |= EXA_RANGE_HEIGHT;
exaSetAccelBlock(pExaScr, pExaPixmap,
w, h, bpp);
return pPixmap;
}
@ -373,12 +386,25 @@ exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
if (!pPixmap)
return FALSE;
pExaScr = ExaGetScreenPriv(pPixmap->drawable.pScreen);
pExaPixmap = ExaGetPixmapPriv(pPixmap);
if (pExaPixmap)
pExaPixmap->sys_ptr = pPixData;
if (pExaPixmap) {
if (pPixData)
pExaPixmap->sys_ptr = pPixData;
if (devKind > 0)
pExaPixmap->sys_pitch = devKind;
if (width > 0 && height > 0 && bitsPerPixel > 0) {
exaSetFbPitch(pExaScr, pExaPixmap,
width, height, bitsPerPixel);
exaSetAccelBlock(pExaScr, pExaPixmap,
width, height, bitsPerPixel);
}
}
pExaScr = ExaGetScreenPriv(pPixmap->drawable.pScreen);
if (pExaScr->info->ModifyPixmapHeader) {
ret = pExaScr->info->ModifyPixmapHeader(pPixmap, width, height, depth,
@ -477,7 +503,7 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
if (!(*pExaScr->info->PrepareAccess) (pPixmap, index)) {
ExaPixmapPriv (pPixmap);
if (pExaPixmap->score != EXA_PIXMAP_SCORE_PINNED)
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
FatalError("Driver failed PrepareAccess on a pinned pixmap\n");
exaMoveOutPixmap (pPixmap);
}
@ -675,6 +701,34 @@ exaBitmapToRegion(PixmapPtr pPix)
return ret;
}
static Bool
exaCreateScreenResources(ScreenPtr pScreen)
{
ExaScreenPriv(pScreen);
PixmapPtr pScreenPixmap;
Bool b;
pScreen->CreateScreenResources = pExaScr->SavedCreateScreenResources;
b = pScreen->CreateScreenResources(pScreen);
pScreen->CreateScreenResources = exaCreateScreenResources;
if (!b)
return FALSE;
pScreenPixmap = pScreen->GetScreenPixmap(pScreen);
if (pScreenPixmap) {
ExaPixmapPriv(pScreenPixmap);
exaSetAccelBlock(pExaScr, pExaPixmap,
pScreenPixmap->drawable.width,
pScreenPixmap->drawable.height,
pScreenPixmap->drawable.bitsPerPixel);
}
return TRUE;
}
/**
* exaCloseScreen() unwraps its wrapped screen functions and tears down EXA's
* screen private, before calling down to the next CloseSccreen.
@ -696,10 +750,12 @@ exaCloseScreen(int i, ScreenPtr pScreen)
pScreen->CopyWindow = pExaScr->SavedCopyWindow;
pScreen->ChangeWindowAttributes = pExaScr->SavedChangeWindowAttributes;
pScreen->BitmapToRegion = pExaScr->SavedBitmapToRegion;
pScreen->CreateScreenResources = pExaScr->SavedCreateScreenResources;
#ifdef RENDER
if (ps) {
ps->Composite = pExaScr->SavedComposite;
ps->Trapezoids = pExaScr->SavedTrapezoids;
ps->AddTraps = pExaScr->SavedAddTraps;
}
#endif
@ -853,6 +909,9 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->SavedBitmapToRegion = pScreen->BitmapToRegion;
pScreen->BitmapToRegion = exaBitmapToRegion;
pExaScr->SavedCreateScreenResources = pScreen->CreateScreenResources;
pScreen->CreateScreenResources = exaCreateScreenResources;
#ifdef RENDER
if (ps) {
pExaScr->SavedComposite = ps->Composite;
@ -863,13 +922,15 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->SavedTrapezoids = ps->Trapezoids;
ps->Trapezoids = exaTrapezoids;
pExaScr->SavedAddTraps = ps->AddTraps;
ps->AddTraps = ExaCheckAddTraps;
}
#endif
#ifdef MITSHM
/* Re-register with the MI funcs, which don't allow shared pixmaps.
* Shared pixmaps are almost always a performance loss for us, but this
* still allows for SHM PutImage.
/*
* Don't allow shared pixmaps.
*/
ShmRegisterFuncs(pScreen, &exaShmFuncs);
#endif

View File

@ -56,7 +56,7 @@ struct _ExaOffscreenArea {
int base_offset; /* allocation base */
int offset; /* aligned offset */
int size; /* total allocation size */
int score;
unsigned last_use;
pointer privData;
ExaOffscreenSaveProc save;
@ -64,6 +64,8 @@ struct _ExaOffscreenArea {
ExaOffscreenState state;
ExaOffscreenArea *next;
unsigned eviction_cost;
};
/**
@ -781,6 +783,10 @@ exaGetPixmapSize(PixmapPtr pPix);
void
exaEnableDisableFBAccess (int index, Bool enable);
Bool
exaDrawableIsOffscreen (DrawablePtr pDrawable);
/* in exa_migration.c */
void
exaMoveInPixmap (PixmapPtr pPixmap);

View File

@ -245,104 +245,12 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
return TRUE;
}
#ifdef MITSHM
static Bool
exaDoShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
unsigned int format, int w, int h, int sx, int sy, int sw,
int sh, int dx, int dy, char *data)
{
int src_stride = PixmapBytePad(w, depth);
if (exaDoPutImage(pDrawable, pGC, depth, dx, dy, sw, sh, format, data +
sy * src_stride + sx * BitsPerPixel(depth) / 8,
src_stride))
return TRUE;
if (format == ZPixmap)
{
PixmapPtr pPixmap;
pPixmap = GetScratchPixmapHeader(pDrawable->pScreen, w, h, depth,
BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data);
if (!pPixmap)
return FALSE;
if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle,
pGC->alu))
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
else
ExaDoPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbCopyArea((DrawablePtr)pPixmap, pDrawable, pGC, sx, sy, sw, sh, dx, dy);
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
FreeScratchPixmapHeader(pPixmap);
return TRUE;
}
return FALSE;
}
/* The actual ShmPutImage isn't wrapped by the damage layer, so we need to
* inform any interested parties of the damage incurred to the drawable.
*
* We also need to set the pending damage to ensure correct migration in all
* cases.
*/
void
exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format,
int w, int h, int sx, int sy, int sw, int sh, int dx, int dy,
char *data)
{
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
ExaPixmapPriv(pPixmap);
BoxRec box = { .x1 = pDrawable->x + dx, .y1 = pDrawable->y + dy,
.x2 = pDrawable->x + dx + sw, .y2 = pDrawable->y + dy + sh };
RegionRec region;
int xoff, yoff;
RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
REGION_INIT(pScreen, &region, &box, 1);
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
REGION_TRANSLATE(pScreen, &region, xoff, yoff);
REGION_UNION(pScreen, pending_damage, pending_damage, &region);
if (!exaDoShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh,
dx, dy, data)) {
if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle,
pGC->alu))
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
else
ExaDoPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy,
data);
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
}
REGION_TRANSLATE(pScreen, &region, -xoff, -yoff);
DamageDamageRegion(pDrawable, &region);
REGION_UNINIT(pScreen, &region);
}
ShmFuncs exaShmFuncs = { NULL, exaShmPutImage };
#endif
static void
exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
int w, int h, int leftPad, int format, char *bits)
{
#ifdef MITSHM
if (!exaDoShmPutImage(pDrawable, pGC, depth, format, w, h, 0, 0, w, h, x, y,
bits))
#else
if (!exaDoPutImage(pDrawable, pGC, depth, x, y, w, h, format, bits,
PixmapBytePad(w, pDrawable->depth)))
#endif
ExaCheckPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format,
bits);
}
@ -487,7 +395,12 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
int src_off_x, src_off_y;
int dst_off_x, dst_off_y;
ExaMigrationRec pixmaps[2];
RegionPtr region = NULL;
RegionPtr srcregion = NULL, dstregion = NULL;
xRectangle *rects;
/* avoid doing copy operations if no boxes */
if (nbox == 0)
return;
pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable);
pDstPixmap = exaGetDrawablePixmap (pDstDrawable);
@ -495,33 +408,38 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
exaGetDrawableDeltas (pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y);
exaGetDrawableDeltas (pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y);
if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,
pGC->fillStyle, pGC->alu)) {
xRectangle *rects = xalloc(nbox * sizeof(xRectangle));
rects = xalloc(nbox * sizeof(xRectangle));
if (rects) {
int i;
if (rects) {
int i;
for (i = 0; i < nbox; i++) {
rects[i].x = pbox[i].x1 + dst_off_x;
rects[i].y = pbox[i].y1 + dst_off_y;
rects[i].width = pbox[i].x2 - pbox[i].x1;
rects[i].height = pbox[i].y2 - pbox[i].y1;
}
for (i = 0; i < nbox; i++) {
rects[i].x = pbox[i].x1 + dx + src_off_x;
rects[i].y = pbox[i].y1 + dy + src_off_y;
rects[i].width = pbox[i].x2 - pbox[i].x1;
rects[i].height = pbox[i].y2 - pbox[i].y1;
}
region = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED);
xfree(rects);
srcregion = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED);
xfree(rects);
if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,
pGC->fillStyle, pGC->alu)) {
dstregion = REGION_CREATE(pScreen, NullBox, 0);
REGION_COPY(pScreen, dstregion, srcregion);
REGION_TRANSLATE(pScreen, dstregion, dst_off_x - dx - src_off_x,
dst_off_y - dy - src_off_y);
}
}
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
pixmaps[0].pPix = pDstPixmap;
pixmaps[0].pReg = region;
pixmaps[0].pReg = dstregion;
pixmaps[1].as_dst = FALSE;
pixmaps[1].as_src = TRUE;
pixmaps[1].pPix = pSrcPixmap;
pixmaps[1].pReg = NULL;
pixmaps[1].pReg = srcregion;
pSrcExaPixmap = ExaGetPixmapPriv (pSrcPixmap);
pDstExaPixmap = ExaGetPixmapPriv (pDstPixmap);
@ -574,17 +492,21 @@ fallback:
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable,
exaDrawableLocation(pSrcDrawable),
exaDrawableLocation(pDstDrawable)));
exaPrepareAccessReg (pDstDrawable, EXA_PREPARE_DEST, region);
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
exaPrepareAccessReg (pDstDrawable, EXA_PREPARE_DEST, dstregion);
exaPrepareAccessReg (pSrcDrawable, EXA_PREPARE_SRC, srcregion);
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy, reverse,
upsidedown, bitplane, closure);
exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
out:
if (region) {
REGION_UNINIT(pScreen, region);
REGION_DESTROY(pScreen, region);
if (dstregion) {
REGION_UNINIT(pScreen, dstregion);
REGION_DESTROY(pScreen, dstregion);
}
if (srcregion) {
REGION_UNINIT(pScreen, srcregion);
REGION_DESTROY(pScreen, srcregion);
}
}
@ -940,10 +862,8 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
int dstBpp;
int dstXoff, dstYoff;
FbBits depthMask;
Bool fallback;
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
ExaPixmapPriv(pPixmap);
ExaMigrationRec pixmaps[1];
RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
BoxRec extents = *REGION_EXTENTS(pScreen, pending_damage);
int xoff, yoff;
@ -952,16 +872,8 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
return;
depthMask = FbFullMask(pDrawable->depth);
fallback = (pGC->planemask & depthMask) != depthMask;
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
pixmaps[0].pPix = pPixmap;
pixmaps[0].pReg = fallback ? NULL : pending_damage;
exaDoMigration(pixmaps, 1, FALSE);
if (fallback)
if ((pGC->planemask & depthMask) != depthMask)
{
ExaCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase);
return;
@ -984,7 +896,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
extents.y1 -= yoff;
extents.y2 -= yoff;
exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg);
exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pending_damage);
if (TERMINALFONT (pGC->font) && !glyph)
{

View File

@ -116,7 +116,7 @@ exaPixmapShouldBeInFB (PixmapPtr pPix)
* If the pixmap is currently dirty, this copies at least the dirty area from
* FB to system or vice versa. Both areas must be allocated.
*/
static _X_INLINE void
static void
exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
Bool (*transfer) (PixmapPtr pPix, int x, int y, int w, int h,
char *sys, int sys_pitch), CARD8 *fallback_src,
@ -132,6 +132,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
BoxPtr pBox;
int nbox;
Bool access_prepared = FALSE;
Bool need_sync = FALSE;
/* Damaged bits are valid in current copy but invalid in other one */
if (exaPixmapIsOffscreen(pPixmap)) {
@ -223,14 +224,15 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
exaMemcpyBox (pPixmap, pBox,
fallback_src, fallback_srcpitch,
fallback_dst, fallback_dstpitch);
}
} else
need_sync = TRUE;
pBox++;
}
if (access_prepared)
exaFinishAccess(&pPixmap->drawable, fallback_index);
else
else if (need_sync)
sync (pPixmap->drawable.pScreen);
pExaPixmap->offscreen = save_offscreen;

View File

@ -21,11 +21,9 @@
*/
/** @file
* This allocator allocates blocks of memory by maintaining a list of areas
* and a score for each area. As an area is marked used, its score is
* incremented, and periodically all of the areas have their scores decayed by
* a fraction. When allocating, the contiguous block of areas with the minimum
* score is found and evicted in order to make room for the new allocation.
* This allocator allocates blocks of memory by maintaining a list of areas.
* When allocating, the contiguous block of areas with the minimum eviction
* cost is found and evicted in order to make room for the new allocation.
*/
#include "exa_priv.h"
@ -71,6 +69,82 @@ ExaOffscreenKickOut (ScreenPtr pScreen, ExaOffscreenArea *area)
return exaOffscreenFree (pScreen, area);
}
static void
exaUpdateEvictionCost(ExaOffscreenArea *area, unsigned offScreenCounter)
{
unsigned age;
if (area->state == ExaOffscreenAvail)
return;
age = offScreenCounter - area->last_use;
/* This is unlikely to happen, but could result in a division by zero... */
if (age > (UINT_MAX / 2)) {
age = UINT_MAX / 2;
area->last_use = offScreenCounter - age;
}
area->eviction_cost = area->size / age;
}
static ExaOffscreenArea *
exaFindAreaToEvict(ExaScreenPrivPtr pExaScr, int size, int align)
{
ExaOffscreenArea *begin, *end, *best;
unsigned cost, best_cost;
int avail, real_size, tmp;
best_cost = UINT_MAX;
begin = end = pExaScr->info->offScreenAreas;
avail = 0;
cost = 0;
best = 0;
while (end != NULL)
{
restart:
while (begin != NULL && begin->state == ExaOffscreenLocked)
begin = end = begin->next;
if (begin == NULL)
break;
/* adjust size needed to account for alignment loss for this area */
real_size = size;
tmp = begin->base_offset % align;
if (tmp)
real_size += (align - tmp);
while (avail < real_size && end != NULL)
{
if (end->state == ExaOffscreenLocked) {
/* Can't more room here, restart after this locked area */
avail = 0;
cost = 0;
begin = end;
goto restart;
}
avail += end->size;
exaUpdateEvictionCost(end, pExaScr->offScreenCounter);
cost += end->eviction_cost;
end = end->next;
}
/* Check the cost, update best */
if (avail >= real_size && cost < best_cost) {
best = begin;
best_cost = cost;
}
avail -= begin->size;
cost -= begin->eviction_cost;
begin = begin->next;
}
return best;
}
/**
* exaOffscreenAlloc allocates offscreen memory
*
@ -96,9 +170,9 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
ExaOffscreenSaveProc save,
pointer privData)
{
ExaOffscreenArea *area, *begin, *best;
ExaOffscreenArea *area;
ExaScreenPriv (pScreen);
int tmp, real_size = 0, best_score;
int tmp, real_size = 0;
#if DEBUG_OFFSCREEN
static int number = 0;
ErrorF("================= ============ allocating a new pixmap %d\n", ++number);
@ -143,53 +217,8 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
if (!area)
{
/*
* Kick out existing users to make space.
*
* First, locate a region which can hold the desired object.
*/
area = exaFindAreaToEvict(pExaScr, size, align);
/* prev points at the first object to boot */
best = NULL;
best_score = INT_MAX;
for (begin = pExaScr->info->offScreenAreas; begin != NULL;
begin = begin->next)
{
int avail, score;
ExaOffscreenArea *scan;
if (begin->state == ExaOffscreenLocked)
continue;
/* adjust size needed to account for alignment loss for this area */
real_size = size;
tmp = begin->base_offset % align;
if (tmp)
real_size += (align - tmp);
avail = 0;
score = 0;
/* now see if we can make room here, and how "costly" it'll be. */
for (scan = begin; scan != NULL; scan = scan->next)
{
if (scan->state == ExaOffscreenLocked) {
/* Can't make room here, start after this locked area. */
begin = scan;
break;
}
/* Score should only be non-zero for ExaOffscreenRemovable */
score += scan->score;
avail += scan->size;
if (avail >= real_size)
break;
}
/* Is it the best option we've found so far? */
if (avail >= real_size && score < best_score) {
best = begin;
best_score = score;
}
}
area = best;
if (!area)
{
DBG_OFFSCREEN (("Alloc 0x%x -> NOSPACE\n", size));
@ -230,7 +259,8 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
new_area->size = area->size - real_size;
new_area->state = ExaOffscreenAvail;
new_area->save = NULL;
new_area->score = 0;
new_area->last_use = 0;
new_area->eviction_cost = 0;
new_area->next = area->next;
area->next = new_area;
area->size = real_size;
@ -244,7 +274,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
area->state = ExaOffscreenRemovable;
area->privData = privData;
area->save = save;
area->score = 0;
area->last_use = pExaScr->offScreenCounter++;
area->offset = (area->base_offset + align - 1);
area->offset -= area->offset % align;
@ -395,7 +425,8 @@ exaOffscreenFree (ScreenPtr pScreen, ExaOffscreenArea *area)
area->state = ExaOffscreenAvail;
area->save = NULL;
area->score = 0;
area->last_use = 0;
area->eviction_cost = 0;
/*
* Find previous area
*/
@ -427,23 +458,11 @@ ExaOffscreenMarkUsed (PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
ExaScreenPriv (pPixmap->drawable.pScreen);
static int iter = 0;
if (!pExaPixmap || !pExaPixmap->area)
return;
/* The numbers here are arbitrary. We may want to tune these. */
pExaPixmap->area->score += 100;
if (++iter == 10) {
ExaOffscreenArea *area;
for (area = pExaScr->info->offScreenAreas; area != NULL;
area = area->next)
{
if (area->state == ExaOffscreenRemovable)
area->score = (area->score * 7) / 8;
}
iter = 0;
}
pExaPixmap->area->last_use = pExaScr->offScreenCounter++;
}
/**
@ -472,10 +491,12 @@ exaOffscreenInit (ScreenPtr pScreen)
area->size = pExaScr->info->memorySize - area->base_offset;
area->save = NULL;
area->next = NULL;
area->score = 0;
area->last_use = 0;
area->eviction_cost = 0;
/* Add it to the free areas */
pExaScr->info->offScreenAreas = area;
pExaScr->offScreenCounter = 1;
ExaOffscreenValidate (pScreen);

View File

@ -107,12 +107,14 @@ typedef struct {
CopyWindowProcPtr SavedCopyWindow;
ChangeWindowAttributesProcPtr SavedChangeWindowAttributes;
BitmapToRegionProcPtr SavedBitmapToRegion;
CreateScreenResourcesProcPtr SavedCreateScreenResources;
ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader;
#ifdef RENDER
CompositeProcPtr SavedComposite;
TrianglesProcPtr SavedTriangles;
GlyphsProcPtr SavedGlyphs;
TrapezoidsProcPtr SavedTrapezoids;
AddTrapsProcPtr SavedAddTraps;
#endif
Bool swappedOut;
@ -120,6 +122,7 @@ typedef struct {
Bool checkDirtyCorrectness;
unsigned disableFbCount;
Bool optimize_migration;
unsigned offScreenCounter;
} ExaScreenPrivRec, *ExaScreenPrivPtr;
/*
@ -291,6 +294,13 @@ ExaCheckGetSpans (DrawablePtr pDrawable,
int nspans,
char *pdstStart);
void
ExaCheckAddTraps (PicturePtr pPicture,
INT16 x_off,
INT16 y_off,
int ntrap,
xTrap *traps);
/* exa_accel.c */
static _X_INLINE Bool
@ -309,21 +319,12 @@ Bool
exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu);
void
exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format,
int w, int h, int sx, int sy, int sw, int sh, int dx, int dy,
char *data);
void
exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int format, unsigned long planeMask, char *d);
extern const GCOps exaOps;
#ifdef MITSHM
extern ShmFuncs exaShmFuncs;
#endif
#ifdef RENDER
void
ExaCheckComposite (CARD8 op,
@ -373,9 +374,6 @@ void
exaGetDrawableDeltas (DrawablePtr pDrawable, PixmapPtr pPixmap,
int *xp, int *yp);
Bool
exaDrawableIsOffscreen (DrawablePtr pDrawable);
Bool
exaPixmapIsOffscreen(PixmapPtr p);

View File

@ -51,6 +51,9 @@ static void exaCompositeFallbackPictDesc(PicturePtr pict, char *string, int n)
case PICT_a8r8g8b8:
snprintf(format, 20, "ARGB8888");
break;
case PICT_x8r8g8b8:
snprintf(format, 20, "XRGB8888");
break;
case PICT_r5g6b5:
snprintf(format, 20, "RGB565 ");
break;
@ -650,7 +653,7 @@ exaComposite(CARD8 op,
!pSrc->transform &&
pSrc->repeatType == RepeatNormal)
{
DDXPointRec srcOrg;
DDXPointRec patOrg;
/* Let's see if the driver can do the repeat in one go */
if (pExaScr->info->PrepareComposite && !pSrc->alphaMap &&
@ -674,12 +677,14 @@ exaComposite(CARD8 op,
width, height))
goto done;
srcOrg.x = (xSrc - xDst) % pSrc->pDrawable->width;
srcOrg.y = (ySrc - yDst) % pSrc->pDrawable->height;
/* pattern origin is the point in the destination drawable
* corresponding to (0,0) in the source */
patOrg.x = xDst - xSrc;
patOrg.y = yDst - ySrc;
ret = exaFillRegionTiled(pDst->pDrawable, &region,
(PixmapPtr)pSrc->pDrawable,
&srcOrg, FB_ALLONES, GXcopy);
&patOrg, FB_ALLONES, GXcopy);
REGION_UNINIT(pDst->pDrawable->pScreen, &region);

View File

@ -350,6 +350,20 @@ ExaCheckComposite (CARD8 op,
REGION_UNINIT(pScreen, &region);
}
void
ExaCheckAddTraps (PicturePtr pPicture,
INT16 x_off,
INT16 y_off,
int ntrap,
xTrap *traps)
{
EXA_FALLBACK(("to pict %p (%c)\n",
exaDrawableLocation(pPicture->pDrawable)));
exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
fbAddTraps (pPicture, x_off, y_off, ntrap, traps);
exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
}
/**
* Gets the 0,0 pixel of a pixmap. Used for doing solid fills of tiled pixmaps
* that happen to be 1x1. Pixmap must be at least 8bpp.
@ -359,6 +373,7 @@ ExaCheckComposite (CARD8 op,
CARD32
exaGetPixmapFirstPixel (PixmapPtr pPixmap)
{
ExaScreenPriv(pPixmap->drawable.pScreen);
CARD32 pixel;
void *fb;
Bool need_finish = FALSE;
@ -373,7 +388,8 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap)
fb = pExaPixmap->sys_ptr;
/* Try to avoid framebuffer readbacks */
if ((!offscreen && !sys_valid && !damaged) ||
if (pExaScr->info->CreatePixmap ||
(!offscreen && !sys_valid && !damaged) ||
(offscreen && (!sys_valid || damaged)))
{
box.x1 = 0;

View File

@ -141,7 +141,7 @@ typedef unsigned __int64 FbBits;
defined(ia64) || defined(__ia64__) || \
defined(__sparc64__) || defined(_LP64) || \
defined(__s390x__) || \
defined(amd64) || defined (__amd64__) || \
defined(amd64) || defined (__amd64__) || defined(__x86_64__) || \
defined (__powerpc64__) || \
(defined(sgi) && (_MIPS_SZLONG == 64))
typedef unsigned long FbBits;

View File

@ -1,5 +1,4 @@
/*
*
* Copyright © 2000 SuSE, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
@ -544,11 +543,10 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
int oldXoff, oldYoff;
int newXoff, newYoff;
pNewTile = fbCreatePixmapBpp (pScreen,
pOldTile->drawable.width,
pOldTile->drawable.height,
pOldTile->drawable.depth,
bitsPerPixel, 0);
pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width,
pOldTile->drawable.height,
pOldTile->drawable.depth,
pOldTile->usage_hint);
if (!pNewTile)
return 0;
fbGetDrawable (&pOldTile->drawable,

View File

@ -5,14 +5,11 @@ endif
noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY)
AM_CFLAGS = \
-I@MESA_SOURCE@/include \
@DIX_CFLAGS@ \
@GL_CFLAGS@ \
@XLIB_CFLAGS@ \
@LIBDRM_CFLAGS@ \
@DRIPROTO_CFLAGS@ \
-I@MESA_SOURCE@/src/mesa/glapi \
-I@MESA_SOURCE@/src/mesa/main \
-DXFree86Server \
@GLX_DEFINES@ \
@GLX_ARCH_DEFINES@
@ -28,28 +25,45 @@ INCLUDES = \
-I$(top_srcdir)/hw/xfree86/dri2 \
-I$(top_srcdir)/mi
glapi_sources = \
indirect_dispatch.c \
indirect_dispatch.h \
indirect_dispatch_swap.c \
indirect_reqsize.c \
indirect_reqsize.h \
indirect_size.h \
indirect_size_get.c \
indirect_size_get.h \
indirect_table.c \
dispatch.h \
glapitable.h \
glapitemp.h \
glapi.c \
glapi.h \
glapioffsets.h \
glthread.c \
glthread.h \
glprocs.h
nodist_libglx_la_SOURCES = indirect_size.h \
glapi.c \
glcontextmodes.c \
glcontextmode.h \
glthread.c \
indirect_dispatch.c \
indirect_dispatch.h \
indirect_dispatch_swap.c \
indirect_reqsize.c \
indirect_reqsize.h \
indirect_size_get.c \
indirect_size_get.h \
indirect_table.c
if DRI2
GLXDRI_SOURCE = glxdri2.c
endif
libglxdri_la_SOURCES = \
glxdri.c \
glxdri2.c \
$(GLXDRI2_SOURCE) \
glxdricommon.h \
extension_string.c \
extension_string.h
libglx_la_SOURCES = \
$(indirect_sources) \
$(glapi_sources) \
indirect_util.c \
indirect_util.h \
indirect_program.c \
indirect_table.h \
indirect_texture_compression.c \
g_disptab.h \
glxbyteorder.h \
glxcmds.c \
@ -58,17 +72,13 @@ libglx_la_SOURCES = \
glxdrawable.h \
glxext.c \
glxext.h \
glxglcore.c \
glxdriswrast.c \
glxdricommon.c \
glxscreens.c \
glxscreens.h \
glxserver.h \
glxutil.c \
glxutil.h \
indirect_program.c \
indirect_table.h \
indirect_texture_compression.c \
indirect_util.c \
indirect_util.h \
render2.c \
render2swap.c \
renderpix.c \

3829
glx/dispatch.h Normal file

File diff suppressed because it is too large Load Diff

1064
glx/glapi.c Normal file

File diff suppressed because it is too large Load Diff

160
glx/glapi.h Normal file
View File

@ -0,0 +1,160 @@
/*
* Mesa 3-D graphics library
* Version: 6.5
*
* Copyright (C) 1999-2006 Brian Paul 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
* BRIAN PAUL 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.
*/
/**
* \mainpage Mesa GL API Module
*
* \section GLAPIIntroduction Introduction
*
* The Mesa GL API module is responsible for dispatching all the
* gl*() functions. All GL functions are dispatched by jumping through
* the current dispatch table (basically a struct full of function
* pointers.)
*
* A per-thread current dispatch table and per-thread current context
* pointer are managed by this module too.
*
* This module is intended to be non-Mesa-specific so it can be used
* with the X/DRI libGL also.
*/
#ifndef _GLAPI_H
#define _GLAPI_H
#include "GL/gl.h"
#include "glapitable.h"
#include "glthread.h"
typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...);
#if defined(USE_MGL_NAMESPACE)
#define _glapi_set_dispatch _mglapi_set_dispatch
#define _glapi_get_dispatch _mglapi_get_dispatch
#define _glapi_set_context _mglapi_set_context
#define _glapi_get_context _mglapi_get_context
#define _glapi_Context _mglapi_Context
#define _glapi_Dispatch _mglapi_Dispatch
#endif
/**
** Define the GET_CURRENT_CONTEXT() macro.
** \param C local variable which will hold the current context.
**/
#if defined (GLX_USE_TLS)
const extern void *_glapi_Context;
const extern struct _glapi_table *_glapi_Dispatch;
extern __thread void * _glapi_tls_Context
__attribute__((tls_model("initial-exec")));
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context
#else
extern void *_glapi_Context;
extern struct _glapi_table *_glapi_Dispatch;
# ifdef THREADS
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context())
# else
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_Context
# endif
#endif /* defined (GLX_USE_TLS) */
/**
** GL API public functions
**/
extern void
_glapi_noop_enable_warnings(GLboolean enable);
extern void
_glapi_set_warning_func(_glapi_warning_func func);
extern void
_glapi_check_multithread(void);
extern void
_glapi_set_context(void *context);
extern void *
_glapi_get_context(void);
extern void
_glapi_set_dispatch(struct _glapi_table *dispatch);
extern struct _glapi_table *
_glapi_get_dispatch(void);
extern int
_glapi_begin_dispatch_override(struct _glapi_table *override);
extern void
_glapi_end_dispatch_override(int layer);
struct _glapi_table *
_glapi_get_override_dispatch(int layer);
extern GLuint
_glapi_get_dispatch_table_size(void);
extern void
_glapi_check_table(const struct _glapi_table *table);
extern int
_glapi_add_dispatch( const char * const * function_names,
const char * parameter_signature );
extern GLint
_glapi_get_proc_offset(const char *funcName);
extern _glapi_proc
_glapi_get_proc_address(const char *funcName);
extern const char *
_glapi_get_proc_name(GLuint offset);
#endif

1174
glx/glapioffsets.h Normal file

File diff suppressed because it is too large Load Diff

816
glx/glapitable.h Normal file
View File

@ -0,0 +1,816 @@
/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */
/*
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
* (C) Copyright IBM Corporation 2004
* 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, sub license,
* 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL, IBM,
* AND/OR THEIR 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.
*/
#if !defined( _GLAPI_TABLE_H_ )
# define _GLAPI_TABLE_H_
#ifndef GLAPIENTRYP
# ifndef GLAPIENTRY
# define GLAPIENTRY
# endif
# define GLAPIENTRYP GLAPIENTRY *
#endif
typedef void (*_glapi_proc)(void); /* generic function pointer */
struct _glapi_table
{
void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */
void (GLAPIENTRYP EndList)(void); /* 1 */
void (GLAPIENTRYP CallList)(GLuint list); /* 2 */
void (GLAPIENTRYP CallLists)(GLsizei n, GLenum type, const GLvoid * lists); /* 3 */
void (GLAPIENTRYP DeleteLists)(GLuint list, GLsizei range); /* 4 */
GLuint (GLAPIENTRYP GenLists)(GLsizei range); /* 5 */
void (GLAPIENTRYP ListBase)(GLuint base); /* 6 */
void (GLAPIENTRYP Begin)(GLenum mode); /* 7 */
void (GLAPIENTRYP Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); /* 8 */
void (GLAPIENTRYP Color3b)(GLbyte red, GLbyte green, GLbyte blue); /* 9 */
void (GLAPIENTRYP Color3bv)(const GLbyte * v); /* 10 */
void (GLAPIENTRYP Color3d)(GLdouble red, GLdouble green, GLdouble blue); /* 11 */
void (GLAPIENTRYP Color3dv)(const GLdouble * v); /* 12 */
void (GLAPIENTRYP Color3f)(GLfloat red, GLfloat green, GLfloat blue); /* 13 */
void (GLAPIENTRYP Color3fv)(const GLfloat * v); /* 14 */
void (GLAPIENTRYP Color3i)(GLint red, GLint green, GLint blue); /* 15 */
void (GLAPIENTRYP Color3iv)(const GLint * v); /* 16 */
void (GLAPIENTRYP Color3s)(GLshort red, GLshort green, GLshort blue); /* 17 */
void (GLAPIENTRYP Color3sv)(const GLshort * v); /* 18 */
void (GLAPIENTRYP Color3ub)(GLubyte red, GLubyte green, GLubyte blue); /* 19 */
void (GLAPIENTRYP Color3ubv)(const GLubyte * v); /* 20 */
void (GLAPIENTRYP Color3ui)(GLuint red, GLuint green, GLuint blue); /* 21 */
void (GLAPIENTRYP Color3uiv)(const GLuint * v); /* 22 */
void (GLAPIENTRYP Color3us)(GLushort red, GLushort green, GLushort blue); /* 23 */
void (GLAPIENTRYP Color3usv)(const GLushort * v); /* 24 */
void (GLAPIENTRYP Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); /* 25 */
void (GLAPIENTRYP Color4bv)(const GLbyte * v); /* 26 */
void (GLAPIENTRYP Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); /* 27 */
void (GLAPIENTRYP Color4dv)(const GLdouble * v); /* 28 */
void (GLAPIENTRYP Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 29 */
void (GLAPIENTRYP Color4fv)(const GLfloat * v); /* 30 */
void (GLAPIENTRYP Color4i)(GLint red, GLint green, GLint blue, GLint alpha); /* 31 */
void (GLAPIENTRYP Color4iv)(const GLint * v); /* 32 */
void (GLAPIENTRYP Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); /* 33 */
void (GLAPIENTRYP Color4sv)(const GLshort * v); /* 34 */
void (GLAPIENTRYP Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); /* 35 */
void (GLAPIENTRYP Color4ubv)(const GLubyte * v); /* 36 */
void (GLAPIENTRYP Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); /* 37 */
void (GLAPIENTRYP Color4uiv)(const GLuint * v); /* 38 */
void (GLAPIENTRYP Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); /* 39 */
void (GLAPIENTRYP Color4usv)(const GLushort * v); /* 40 */
void (GLAPIENTRYP EdgeFlag)(GLboolean flag); /* 41 */
void (GLAPIENTRYP EdgeFlagv)(const GLboolean * flag); /* 42 */
void (GLAPIENTRYP End)(void); /* 43 */
void (GLAPIENTRYP Indexd)(GLdouble c); /* 44 */
void (GLAPIENTRYP Indexdv)(const GLdouble * c); /* 45 */
void (GLAPIENTRYP Indexf)(GLfloat c); /* 46 */
void (GLAPIENTRYP Indexfv)(const GLfloat * c); /* 47 */
void (GLAPIENTRYP Indexi)(GLint c); /* 48 */
void (GLAPIENTRYP Indexiv)(const GLint * c); /* 49 */
void (GLAPIENTRYP Indexs)(GLshort c); /* 50 */
void (GLAPIENTRYP Indexsv)(const GLshort * c); /* 51 */
void (GLAPIENTRYP Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz); /* 52 */
void (GLAPIENTRYP Normal3bv)(const GLbyte * v); /* 53 */
void (GLAPIENTRYP Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz); /* 54 */
void (GLAPIENTRYP Normal3dv)(const GLdouble * v); /* 55 */
void (GLAPIENTRYP Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz); /* 56 */
void (GLAPIENTRYP Normal3fv)(const GLfloat * v); /* 57 */
void (GLAPIENTRYP Normal3i)(GLint nx, GLint ny, GLint nz); /* 58 */
void (GLAPIENTRYP Normal3iv)(const GLint * v); /* 59 */
void (GLAPIENTRYP Normal3s)(GLshort nx, GLshort ny, GLshort nz); /* 60 */
void (GLAPIENTRYP Normal3sv)(const GLshort * v); /* 61 */
void (GLAPIENTRYP RasterPos2d)(GLdouble x, GLdouble y); /* 62 */
void (GLAPIENTRYP RasterPos2dv)(const GLdouble * v); /* 63 */
void (GLAPIENTRYP RasterPos2f)(GLfloat x, GLfloat y); /* 64 */
void (GLAPIENTRYP RasterPos2fv)(const GLfloat * v); /* 65 */
void (GLAPIENTRYP RasterPos2i)(GLint x, GLint y); /* 66 */
void (GLAPIENTRYP RasterPos2iv)(const GLint * v); /* 67 */
void (GLAPIENTRYP RasterPos2s)(GLshort x, GLshort y); /* 68 */
void (GLAPIENTRYP RasterPos2sv)(const GLshort * v); /* 69 */
void (GLAPIENTRYP RasterPos3d)(GLdouble x, GLdouble y, GLdouble z); /* 70 */
void (GLAPIENTRYP RasterPos3dv)(const GLdouble * v); /* 71 */
void (GLAPIENTRYP RasterPos3f)(GLfloat x, GLfloat y, GLfloat z); /* 72 */
void (GLAPIENTRYP RasterPos3fv)(const GLfloat * v); /* 73 */
void (GLAPIENTRYP RasterPos3i)(GLint x, GLint y, GLint z); /* 74 */
void (GLAPIENTRYP RasterPos3iv)(const GLint * v); /* 75 */
void (GLAPIENTRYP RasterPos3s)(GLshort x, GLshort y, GLshort z); /* 76 */
void (GLAPIENTRYP RasterPos3sv)(const GLshort * v); /* 77 */
void (GLAPIENTRYP RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 78 */
void (GLAPIENTRYP RasterPos4dv)(const GLdouble * v); /* 79 */
void (GLAPIENTRYP RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 80 */
void (GLAPIENTRYP RasterPos4fv)(const GLfloat * v); /* 81 */
void (GLAPIENTRYP RasterPos4i)(GLint x, GLint y, GLint z, GLint w); /* 82 */
void (GLAPIENTRYP RasterPos4iv)(const GLint * v); /* 83 */
void (GLAPIENTRYP RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 84 */
void (GLAPIENTRYP RasterPos4sv)(const GLshort * v); /* 85 */
void (GLAPIENTRYP Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); /* 86 */
void (GLAPIENTRYP Rectdv)(const GLdouble * v1, const GLdouble * v2); /* 87 */
void (GLAPIENTRYP Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); /* 88 */
void (GLAPIENTRYP Rectfv)(const GLfloat * v1, const GLfloat * v2); /* 89 */
void (GLAPIENTRYP Recti)(GLint x1, GLint y1, GLint x2, GLint y2); /* 90 */
void (GLAPIENTRYP Rectiv)(const GLint * v1, const GLint * v2); /* 91 */
void (GLAPIENTRYP Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); /* 92 */
void (GLAPIENTRYP Rectsv)(const GLshort * v1, const GLshort * v2); /* 93 */
void (GLAPIENTRYP TexCoord1d)(GLdouble s); /* 94 */
void (GLAPIENTRYP TexCoord1dv)(const GLdouble * v); /* 95 */
void (GLAPIENTRYP TexCoord1f)(GLfloat s); /* 96 */
void (GLAPIENTRYP TexCoord1fv)(const GLfloat * v); /* 97 */
void (GLAPIENTRYP TexCoord1i)(GLint s); /* 98 */
void (GLAPIENTRYP TexCoord1iv)(const GLint * v); /* 99 */
void (GLAPIENTRYP TexCoord1s)(GLshort s); /* 100 */
void (GLAPIENTRYP TexCoord1sv)(const GLshort * v); /* 101 */
void (GLAPIENTRYP TexCoord2d)(GLdouble s, GLdouble t); /* 102 */
void (GLAPIENTRYP TexCoord2dv)(const GLdouble * v); /* 103 */
void (GLAPIENTRYP TexCoord2f)(GLfloat s, GLfloat t); /* 104 */
void (GLAPIENTRYP TexCoord2fv)(const GLfloat * v); /* 105 */
void (GLAPIENTRYP TexCoord2i)(GLint s, GLint t); /* 106 */
void (GLAPIENTRYP TexCoord2iv)(const GLint * v); /* 107 */
void (GLAPIENTRYP TexCoord2s)(GLshort s, GLshort t); /* 108 */
void (GLAPIENTRYP TexCoord2sv)(const GLshort * v); /* 109 */
void (GLAPIENTRYP TexCoord3d)(GLdouble s, GLdouble t, GLdouble r); /* 110 */
void (GLAPIENTRYP TexCoord3dv)(const GLdouble * v); /* 111 */
void (GLAPIENTRYP TexCoord3f)(GLfloat s, GLfloat t, GLfloat r); /* 112 */
void (GLAPIENTRYP TexCoord3fv)(const GLfloat * v); /* 113 */
void (GLAPIENTRYP TexCoord3i)(GLint s, GLint t, GLint r); /* 114 */
void (GLAPIENTRYP TexCoord3iv)(const GLint * v); /* 115 */
void (GLAPIENTRYP TexCoord3s)(GLshort s, GLshort t, GLshort r); /* 116 */
void (GLAPIENTRYP TexCoord3sv)(const GLshort * v); /* 117 */
void (GLAPIENTRYP TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 118 */
void (GLAPIENTRYP TexCoord4dv)(const GLdouble * v); /* 119 */
void (GLAPIENTRYP TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 120 */
void (GLAPIENTRYP TexCoord4fv)(const GLfloat * v); /* 121 */
void (GLAPIENTRYP TexCoord4i)(GLint s, GLint t, GLint r, GLint q); /* 122 */
void (GLAPIENTRYP TexCoord4iv)(const GLint * v); /* 123 */
void (GLAPIENTRYP TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); /* 124 */
void (GLAPIENTRYP TexCoord4sv)(const GLshort * v); /* 125 */
void (GLAPIENTRYP Vertex2d)(GLdouble x, GLdouble y); /* 126 */
void (GLAPIENTRYP Vertex2dv)(const GLdouble * v); /* 127 */
void (GLAPIENTRYP Vertex2f)(GLfloat x, GLfloat y); /* 128 */
void (GLAPIENTRYP Vertex2fv)(const GLfloat * v); /* 129 */
void (GLAPIENTRYP Vertex2i)(GLint x, GLint y); /* 130 */
void (GLAPIENTRYP Vertex2iv)(const GLint * v); /* 131 */
void (GLAPIENTRYP Vertex2s)(GLshort x, GLshort y); /* 132 */
void (GLAPIENTRYP Vertex2sv)(const GLshort * v); /* 133 */
void (GLAPIENTRYP Vertex3d)(GLdouble x, GLdouble y, GLdouble z); /* 134 */
void (GLAPIENTRYP Vertex3dv)(const GLdouble * v); /* 135 */
void (GLAPIENTRYP Vertex3f)(GLfloat x, GLfloat y, GLfloat z); /* 136 */
void (GLAPIENTRYP Vertex3fv)(const GLfloat * v); /* 137 */
void (GLAPIENTRYP Vertex3i)(GLint x, GLint y, GLint z); /* 138 */
void (GLAPIENTRYP Vertex3iv)(const GLint * v); /* 139 */
void (GLAPIENTRYP Vertex3s)(GLshort x, GLshort y, GLshort z); /* 140 */
void (GLAPIENTRYP Vertex3sv)(const GLshort * v); /* 141 */
void (GLAPIENTRYP Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 142 */
void (GLAPIENTRYP Vertex4dv)(const GLdouble * v); /* 143 */
void (GLAPIENTRYP Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 144 */
void (GLAPIENTRYP Vertex4fv)(const GLfloat * v); /* 145 */
void (GLAPIENTRYP Vertex4i)(GLint x, GLint y, GLint z, GLint w); /* 146 */
void (GLAPIENTRYP Vertex4iv)(const GLint * v); /* 147 */
void (GLAPIENTRYP Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 148 */
void (GLAPIENTRYP Vertex4sv)(const GLshort * v); /* 149 */
void (GLAPIENTRYP ClipPlane)(GLenum plane, const GLdouble * equation); /* 150 */
void (GLAPIENTRYP ColorMaterial)(GLenum face, GLenum mode); /* 151 */
void (GLAPIENTRYP CullFace)(GLenum mode); /* 152 */
void (GLAPIENTRYP Fogf)(GLenum pname, GLfloat param); /* 153 */
void (GLAPIENTRYP Fogfv)(GLenum pname, const GLfloat * params); /* 154 */
void (GLAPIENTRYP Fogi)(GLenum pname, GLint param); /* 155 */
void (GLAPIENTRYP Fogiv)(GLenum pname, const GLint * params); /* 156 */
void (GLAPIENTRYP FrontFace)(GLenum mode); /* 157 */
void (GLAPIENTRYP Hint)(GLenum target, GLenum mode); /* 158 */
void (GLAPIENTRYP Lightf)(GLenum light, GLenum pname, GLfloat param); /* 159 */
void (GLAPIENTRYP Lightfv)(GLenum light, GLenum pname, const GLfloat * params); /* 160 */
void (GLAPIENTRYP Lighti)(GLenum light, GLenum pname, GLint param); /* 161 */
void (GLAPIENTRYP Lightiv)(GLenum light, GLenum pname, const GLint * params); /* 162 */
void (GLAPIENTRYP LightModelf)(GLenum pname, GLfloat param); /* 163 */
void (GLAPIENTRYP LightModelfv)(GLenum pname, const GLfloat * params); /* 164 */
void (GLAPIENTRYP LightModeli)(GLenum pname, GLint param); /* 165 */
void (GLAPIENTRYP LightModeliv)(GLenum pname, const GLint * params); /* 166 */
void (GLAPIENTRYP LineStipple)(GLint factor, GLushort pattern); /* 167 */
void (GLAPIENTRYP LineWidth)(GLfloat width); /* 168 */
void (GLAPIENTRYP Materialf)(GLenum face, GLenum pname, GLfloat param); /* 169 */
void (GLAPIENTRYP Materialfv)(GLenum face, GLenum pname, const GLfloat * params); /* 170 */
void (GLAPIENTRYP Materiali)(GLenum face, GLenum pname, GLint param); /* 171 */
void (GLAPIENTRYP Materialiv)(GLenum face, GLenum pname, const GLint * params); /* 172 */
void (GLAPIENTRYP PointSize)(GLfloat size); /* 173 */
void (GLAPIENTRYP PolygonMode)(GLenum face, GLenum mode); /* 174 */
void (GLAPIENTRYP PolygonStipple)(const GLubyte * mask); /* 175 */
void (GLAPIENTRYP Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); /* 176 */
void (GLAPIENTRYP ShadeModel)(GLenum mode); /* 177 */
void (GLAPIENTRYP TexParameterf)(GLenum target, GLenum pname, GLfloat param); /* 178 */
void (GLAPIENTRYP TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 179 */
void (GLAPIENTRYP TexParameteri)(GLenum target, GLenum pname, GLint param); /* 180 */
void (GLAPIENTRYP TexParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 181 */
void (GLAPIENTRYP TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 182 */
void (GLAPIENTRYP TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 183 */
void (GLAPIENTRYP TexEnvf)(GLenum target, GLenum pname, GLfloat param); /* 184 */
void (GLAPIENTRYP TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params); /* 185 */
void (GLAPIENTRYP TexEnvi)(GLenum target, GLenum pname, GLint param); /* 186 */
void (GLAPIENTRYP TexEnviv)(GLenum target, GLenum pname, const GLint * params); /* 187 */
void (GLAPIENTRYP TexGend)(GLenum coord, GLenum pname, GLdouble param); /* 188 */
void (GLAPIENTRYP TexGendv)(GLenum coord, GLenum pname, const GLdouble * params); /* 189 */
void (GLAPIENTRYP TexGenf)(GLenum coord, GLenum pname, GLfloat param); /* 190 */
void (GLAPIENTRYP TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params); /* 191 */
void (GLAPIENTRYP TexGeni)(GLenum coord, GLenum pname, GLint param); /* 192 */
void (GLAPIENTRYP TexGeniv)(GLenum coord, GLenum pname, const GLint * params); /* 193 */
void (GLAPIENTRYP FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer); /* 194 */
void (GLAPIENTRYP SelectBuffer)(GLsizei size, GLuint * buffer); /* 195 */
GLint (GLAPIENTRYP RenderMode)(GLenum mode); /* 196 */
void (GLAPIENTRYP InitNames)(void); /* 197 */
void (GLAPIENTRYP LoadName)(GLuint name); /* 198 */
void (GLAPIENTRYP PassThrough)(GLfloat token); /* 199 */
void (GLAPIENTRYP PopName)(void); /* 200 */
void (GLAPIENTRYP PushName)(GLuint name); /* 201 */
void (GLAPIENTRYP DrawBuffer)(GLenum mode); /* 202 */
void (GLAPIENTRYP Clear)(GLbitfield mask); /* 203 */
void (GLAPIENTRYP ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 204 */
void (GLAPIENTRYP ClearIndex)(GLfloat c); /* 205 */
void (GLAPIENTRYP ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 206 */
void (GLAPIENTRYP ClearStencil)(GLint s); /* 207 */
void (GLAPIENTRYP ClearDepth)(GLclampd depth); /* 208 */
void (GLAPIENTRYP StencilMask)(GLuint mask); /* 209 */
void (GLAPIENTRYP ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); /* 210 */
void (GLAPIENTRYP DepthMask)(GLboolean flag); /* 211 */
void (GLAPIENTRYP IndexMask)(GLuint mask); /* 212 */
void (GLAPIENTRYP Accum)(GLenum op, GLfloat value); /* 213 */
void (GLAPIENTRYP Disable)(GLenum cap); /* 214 */
void (GLAPIENTRYP Enable)(GLenum cap); /* 215 */
void (GLAPIENTRYP Finish)(void); /* 216 */
void (GLAPIENTRYP Flush)(void); /* 217 */
void (GLAPIENTRYP PopAttrib)(void); /* 218 */
void (GLAPIENTRYP PushAttrib)(GLbitfield mask); /* 219 */
void (GLAPIENTRYP Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); /* 220 */
void (GLAPIENTRYP Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); /* 221 */
void (GLAPIENTRYP Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); /* 222 */
void (GLAPIENTRYP Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); /* 223 */
void (GLAPIENTRYP MapGrid1d)(GLint un, GLdouble u1, GLdouble u2); /* 224 */
void (GLAPIENTRYP MapGrid1f)(GLint un, GLfloat u1, GLfloat u2); /* 225 */
void (GLAPIENTRYP MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); /* 226 */
void (GLAPIENTRYP MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); /* 227 */
void (GLAPIENTRYP EvalCoord1d)(GLdouble u); /* 228 */
void (GLAPIENTRYP EvalCoord1dv)(const GLdouble * u); /* 229 */
void (GLAPIENTRYP EvalCoord1f)(GLfloat u); /* 230 */
void (GLAPIENTRYP EvalCoord1fv)(const GLfloat * u); /* 231 */
void (GLAPIENTRYP EvalCoord2d)(GLdouble u, GLdouble v); /* 232 */
void (GLAPIENTRYP EvalCoord2dv)(const GLdouble * u); /* 233 */
void (GLAPIENTRYP EvalCoord2f)(GLfloat u, GLfloat v); /* 234 */
void (GLAPIENTRYP EvalCoord2fv)(const GLfloat * u); /* 235 */
void (GLAPIENTRYP EvalMesh1)(GLenum mode, GLint i1, GLint i2); /* 236 */
void (GLAPIENTRYP EvalPoint1)(GLint i); /* 237 */
void (GLAPIENTRYP EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); /* 238 */
void (GLAPIENTRYP EvalPoint2)(GLint i, GLint j); /* 239 */
void (GLAPIENTRYP AlphaFunc)(GLenum func, GLclampf ref); /* 240 */
void (GLAPIENTRYP BlendFunc)(GLenum sfactor, GLenum dfactor); /* 241 */
void (GLAPIENTRYP LogicOp)(GLenum opcode); /* 242 */
void (GLAPIENTRYP StencilFunc)(GLenum func, GLint ref, GLuint mask); /* 243 */
void (GLAPIENTRYP StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); /* 244 */
void (GLAPIENTRYP DepthFunc)(GLenum func); /* 245 */
void (GLAPIENTRYP PixelZoom)(GLfloat xfactor, GLfloat yfactor); /* 246 */
void (GLAPIENTRYP PixelTransferf)(GLenum pname, GLfloat param); /* 247 */
void (GLAPIENTRYP PixelTransferi)(GLenum pname, GLint param); /* 248 */
void (GLAPIENTRYP PixelStoref)(GLenum pname, GLfloat param); /* 249 */
void (GLAPIENTRYP PixelStorei)(GLenum pname, GLint param); /* 250 */
void (GLAPIENTRYP PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values); /* 251 */
void (GLAPIENTRYP PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values); /* 252 */
void (GLAPIENTRYP PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values); /* 253 */
void (GLAPIENTRYP ReadBuffer)(GLenum mode); /* 254 */
void (GLAPIENTRYP CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); /* 255 */
void (GLAPIENTRYP ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels); /* 256 */
void (GLAPIENTRYP DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 257 */
void (GLAPIENTRYP GetBooleanv)(GLenum pname, GLboolean * params); /* 258 */
void (GLAPIENTRYP GetClipPlane)(GLenum plane, GLdouble * equation); /* 259 */
void (GLAPIENTRYP GetDoublev)(GLenum pname, GLdouble * params); /* 260 */
GLenum (GLAPIENTRYP GetError)(void); /* 261 */
void (GLAPIENTRYP GetFloatv)(GLenum pname, GLfloat * params); /* 262 */
void (GLAPIENTRYP GetIntegerv)(GLenum pname, GLint * params); /* 263 */
void (GLAPIENTRYP GetLightfv)(GLenum light, GLenum pname, GLfloat * params); /* 264 */
void (GLAPIENTRYP GetLightiv)(GLenum light, GLenum pname, GLint * params); /* 265 */
void (GLAPIENTRYP GetMapdv)(GLenum target, GLenum query, GLdouble * v); /* 266 */
void (GLAPIENTRYP GetMapfv)(GLenum target, GLenum query, GLfloat * v); /* 267 */
void (GLAPIENTRYP GetMapiv)(GLenum target, GLenum query, GLint * v); /* 268 */
void (GLAPIENTRYP GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params); /* 269 */
void (GLAPIENTRYP GetMaterialiv)(GLenum face, GLenum pname, GLint * params); /* 270 */
void (GLAPIENTRYP GetPixelMapfv)(GLenum map, GLfloat * values); /* 271 */
void (GLAPIENTRYP GetPixelMapuiv)(GLenum map, GLuint * values); /* 272 */
void (GLAPIENTRYP GetPixelMapusv)(GLenum map, GLushort * values); /* 273 */
void (GLAPIENTRYP GetPolygonStipple)(GLubyte * mask); /* 274 */
const GLubyte * (GLAPIENTRYP GetString)(GLenum name); /* 275 */
void (GLAPIENTRYP GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params); /* 276 */
void (GLAPIENTRYP GetTexEnviv)(GLenum target, GLenum pname, GLint * params); /* 277 */
void (GLAPIENTRYP GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params); /* 278 */
void (GLAPIENTRYP GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params); /* 279 */
void (GLAPIENTRYP GetTexGeniv)(GLenum coord, GLenum pname, GLint * params); /* 280 */
void (GLAPIENTRYP GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); /* 281 */
void (GLAPIENTRYP GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 282 */
void (GLAPIENTRYP GetTexParameteriv)(GLenum target, GLenum pname, GLint * params); /* 283 */
void (GLAPIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params); /* 284 */
void (GLAPIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params); /* 285 */
GLboolean (GLAPIENTRYP IsEnabled)(GLenum cap); /* 286 */
GLboolean (GLAPIENTRYP IsList)(GLuint list); /* 287 */
void (GLAPIENTRYP DepthRange)(GLclampd zNear, GLclampd zFar); /* 288 */
void (GLAPIENTRYP Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 289 */
void (GLAPIENTRYP LoadIdentity)(void); /* 290 */
void (GLAPIENTRYP LoadMatrixf)(const GLfloat * m); /* 291 */
void (GLAPIENTRYP LoadMatrixd)(const GLdouble * m); /* 292 */
void (GLAPIENTRYP MatrixMode)(GLenum mode); /* 293 */
void (GLAPIENTRYP MultMatrixf)(const GLfloat * m); /* 294 */
void (GLAPIENTRYP MultMatrixd)(const GLdouble * m); /* 295 */
void (GLAPIENTRYP Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 296 */
void (GLAPIENTRYP PopMatrix)(void); /* 297 */
void (GLAPIENTRYP PushMatrix)(void); /* 298 */
void (GLAPIENTRYP Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); /* 299 */
void (GLAPIENTRYP Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); /* 300 */
void (GLAPIENTRYP Scaled)(GLdouble x, GLdouble y, GLdouble z); /* 301 */
void (GLAPIENTRYP Scalef)(GLfloat x, GLfloat y, GLfloat z); /* 302 */
void (GLAPIENTRYP Translated)(GLdouble x, GLdouble y, GLdouble z); /* 303 */
void (GLAPIENTRYP Translatef)(GLfloat x, GLfloat y, GLfloat z); /* 304 */
void (GLAPIENTRYP Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); /* 305 */
void (GLAPIENTRYP ArrayElement)(GLint i); /* 306 */
void (GLAPIENTRYP BindTexture)(GLenum target, GLuint texture); /* 307 */
void (GLAPIENTRYP ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 308 */
void (GLAPIENTRYP DisableClientState)(GLenum array); /* 309 */
void (GLAPIENTRYP DrawArrays)(GLenum mode, GLint first, GLsizei count); /* 310 */
void (GLAPIENTRYP DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); /* 311 */
void (GLAPIENTRYP EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer); /* 312 */
void (GLAPIENTRYP EnableClientState)(GLenum array); /* 313 */
void (GLAPIENTRYP IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 314 */
void (GLAPIENTRYP Indexub)(GLubyte c); /* 315 */
void (GLAPIENTRYP Indexubv)(const GLubyte * c); /* 316 */
void (GLAPIENTRYP InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer); /* 317 */
void (GLAPIENTRYP NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 318 */
void (GLAPIENTRYP PolygonOffset)(GLfloat factor, GLfloat units); /* 319 */
void (GLAPIENTRYP TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 320 */
void (GLAPIENTRYP VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 321 */
GLboolean (GLAPIENTRYP AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 322 */
void (GLAPIENTRYP CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); /* 323 */
void (GLAPIENTRYP CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); /* 324 */
void (GLAPIENTRYP CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); /* 325 */
void (GLAPIENTRYP CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 326 */
void (GLAPIENTRYP DeleteTextures)(GLsizei n, const GLuint * textures); /* 327 */
void (GLAPIENTRYP GenTextures)(GLsizei n, GLuint * textures); /* 328 */
void (GLAPIENTRYP GetPointerv)(GLenum pname, GLvoid ** params); /* 329 */
GLboolean (GLAPIENTRYP IsTexture)(GLuint texture); /* 330 */
void (GLAPIENTRYP PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities); /* 331 */
void (GLAPIENTRYP TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); /* 332 */
void (GLAPIENTRYP TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 333 */
void (GLAPIENTRYP PopClientAttrib)(void); /* 334 */
void (GLAPIENTRYP PushClientAttrib)(GLbitfield mask); /* 335 */
void (GLAPIENTRYP BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 336 */
void (GLAPIENTRYP BlendEquation)(GLenum mode); /* 337 */
void (GLAPIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); /* 338 */
void (GLAPIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); /* 339 */
void (GLAPIENTRYP ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 340 */
void (GLAPIENTRYP ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 341 */
void (GLAPIENTRYP CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 342 */
void (GLAPIENTRYP GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 343 */
void (GLAPIENTRYP GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 344 */
void (GLAPIENTRYP GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params); /* 345 */
void (GLAPIENTRYP ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); /* 346 */
void (GLAPIENTRYP CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); /* 347 */
void (GLAPIENTRYP ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); /* 348 */
void (GLAPIENTRYP ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); /* 349 */
void (GLAPIENTRYP ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params); /* 350 */
void (GLAPIENTRYP ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 351 */
void (GLAPIENTRYP ConvolutionParameteri)(GLenum target, GLenum pname, GLint params); /* 352 */
void (GLAPIENTRYP ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 353 */
void (GLAPIENTRYP CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 354 */
void (GLAPIENTRYP CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); /* 355 */
void (GLAPIENTRYP GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 356 */
void (GLAPIENTRYP GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 357 */
void (GLAPIENTRYP GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params); /* 358 */
void (GLAPIENTRYP GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 359 */
void (GLAPIENTRYP SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); /* 360 */
void (GLAPIENTRYP GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 361 */
void (GLAPIENTRYP GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 362 */
void (GLAPIENTRYP GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params); /* 363 */
void (GLAPIENTRYP GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 364 */
void (GLAPIENTRYP GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 365 */
void (GLAPIENTRYP GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params); /* 366 */
void (GLAPIENTRYP Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); /* 367 */
void (GLAPIENTRYP Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */
void (GLAPIENTRYP ResetHistogram)(GLenum target); /* 369 */
void (GLAPIENTRYP ResetMinmax)(GLenum target); /* 370 */
void (GLAPIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */
void (GLAPIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */
void (GLAPIENTRYP CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */
void (GLAPIENTRYP ActiveTextureARB)(GLenum texture); /* 374 */
void (GLAPIENTRYP ClientActiveTextureARB)(GLenum texture); /* 375 */
void (GLAPIENTRYP MultiTexCoord1dARB)(GLenum target, GLdouble s); /* 376 */
void (GLAPIENTRYP MultiTexCoord1dvARB)(GLenum target, const GLdouble * v); /* 377 */
void (GLAPIENTRYP MultiTexCoord1fARB)(GLenum target, GLfloat s); /* 378 */
void (GLAPIENTRYP MultiTexCoord1fvARB)(GLenum target, const GLfloat * v); /* 379 */
void (GLAPIENTRYP MultiTexCoord1iARB)(GLenum target, GLint s); /* 380 */
void (GLAPIENTRYP MultiTexCoord1ivARB)(GLenum target, const GLint * v); /* 381 */
void (GLAPIENTRYP MultiTexCoord1sARB)(GLenum target, GLshort s); /* 382 */
void (GLAPIENTRYP MultiTexCoord1svARB)(GLenum target, const GLshort * v); /* 383 */
void (GLAPIENTRYP MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t); /* 384 */
void (GLAPIENTRYP MultiTexCoord2dvARB)(GLenum target, const GLdouble * v); /* 385 */
void (GLAPIENTRYP MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t); /* 386 */
void (GLAPIENTRYP MultiTexCoord2fvARB)(GLenum target, const GLfloat * v); /* 387 */
void (GLAPIENTRYP MultiTexCoord2iARB)(GLenum target, GLint s, GLint t); /* 388 */
void (GLAPIENTRYP MultiTexCoord2ivARB)(GLenum target, const GLint * v); /* 389 */
void (GLAPIENTRYP MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t); /* 390 */
void (GLAPIENTRYP MultiTexCoord2svARB)(GLenum target, const GLshort * v); /* 391 */
void (GLAPIENTRYP MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r); /* 392 */
void (GLAPIENTRYP MultiTexCoord3dvARB)(GLenum target, const GLdouble * v); /* 393 */
void (GLAPIENTRYP MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r); /* 394 */
void (GLAPIENTRYP MultiTexCoord3fvARB)(GLenum target, const GLfloat * v); /* 395 */
void (GLAPIENTRYP MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r); /* 396 */
void (GLAPIENTRYP MultiTexCoord3ivARB)(GLenum target, const GLint * v); /* 397 */
void (GLAPIENTRYP MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r); /* 398 */
void (GLAPIENTRYP MultiTexCoord3svARB)(GLenum target, const GLshort * v); /* 399 */
void (GLAPIENTRYP MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 400 */
void (GLAPIENTRYP MultiTexCoord4dvARB)(GLenum target, const GLdouble * v); /* 401 */
void (GLAPIENTRYP MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 402 */
void (GLAPIENTRYP MultiTexCoord4fvARB)(GLenum target, const GLfloat * v); /* 403 */
void (GLAPIENTRYP MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q); /* 404 */
void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 408 */
GLuint (GLAPIENTRYP CreateProgram)(void); /* 409 */
GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 410 */
void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 411 */
void (GLAPIENTRYP DeleteShader)(GLuint program); /* 412 */
void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 413 */
void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 414 */
void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 415 */
void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 416 */
void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 417 */
void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 418 */
GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 419 */
GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 420 */
void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 421 */
void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 422 */
void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); /* 423 */
void (GLAPIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 424 */
void (GLAPIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 425 */
void (GLAPIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 426 */
void (GLAPIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 427 */
void (GLAPIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 428 */
void (GLAPIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 429 */
void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 430 */
void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 431 */
void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 432 */
void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 433 */
void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 434 */
void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 435 */
void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 436 */
void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 437 */
void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 438 */
void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 439 */
void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 440 */
void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 441 */
void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 442 */
void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 443 */
void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 444 */
void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 445 */
void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 446 */
void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 447 */
void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 448 */
void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 449 */
void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 450 */
void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 451 */
void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 452 */
void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 453 */
void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 454 */
void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 455 */
void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 456 */
void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 457 */
void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 458 */
void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 459 */
void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 460 */
void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 461 */
void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 462 */
void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 463 */
void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 464 */
void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 465 */
void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 466 */
void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 467 */
void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 468 */
void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 469 */
void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 470 */
void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 471 */
void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 472 */
void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 473 */
void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 474 */
void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 475 */
void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 476 */
void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 477 */
void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 478 */
void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 479 */
void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 480 */
void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 481 */
void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 482 */
void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 483 */
void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 484 */
void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 485 */
void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 486 */
void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 487 */
void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 488 */
void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 489 */
void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 490 */
void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 491 */
void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 492 */
void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 493 */
void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 494 */
void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 495 */
void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 496 */
void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 497 */
void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 498 */
void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 499 */
void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 500 */
void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 501 */
void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 502 */
void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 503 */
void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 504 */
void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 505 */
void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 506 */
GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 507 */
GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 508 */
GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 509 */
void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 510 */
void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 511 */
void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 512 */
void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 513 */
void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 514 */
void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 515 */
void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 516 */
GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 517 */
void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 518 */
void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shader); /* 519 */
GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 520 */
GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 521 */
void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 522 */
void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 523 */
void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 524 */
void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 525 */
GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 526 */
void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 527 */
void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 528 */
void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 529 */
void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source); /* 530 */
GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name); /* 531 */
void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params); /* 532 */
void (GLAPIENTRYP GetUniformivARB)(GLhandleARB program, GLint location, GLint * params); /* 533 */
void (GLAPIENTRYP LinkProgramARB)(GLhandleARB program); /* 534 */
void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length); /* 535 */
void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 536 */
void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 537 */
void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 538 */
void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 539 */
void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 540 */
void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 541 */
void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 542 */
void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 543 */
void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 544 */
void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 545 */
void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 546 */
void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 547 */
void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 548 */
void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 549 */
void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 550 */
void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 551 */
void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 552 */
void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 553 */
void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 554 */
void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB program); /* 555 */
void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB program); /* 556 */
void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name); /* 557 */
void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 558 */
GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 559 */
void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 560 */
void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 561 */
void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 562 */
void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 563 */
void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 564 */
void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 565 */
void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 566 */
void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 567 */
void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 568 */
void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 569 */
void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 570 */
void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 571 */
void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 572 */
void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 573 */
void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 574 */
void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 575 */
void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 576 */
void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 577 */
void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 578 */
void (GLAPIENTRYP UnlockArraysEXT)(void); /* 579 */
void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 580 */
void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 581 */
void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 582 */
void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 583 */
void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 584 */
void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 585 */
void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 586 */
void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 587 */
void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 588 */
void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 589 */
void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 590 */
void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 591 */
void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 592 */
void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 593 */
void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 594 */
void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 595 */
void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 596 */
void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 597 */
void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 598 */
void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 599 */
void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 600 */
void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 601 */
void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 602 */
void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 603 */
void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 604 */
void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 605 */
void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 606 */
void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 607 */
void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 608 */
void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 609 */
void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 610 */
void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 611 */
void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 612 */
void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 613 */
void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 614 */
void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 615 */
void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 616 */
void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 617 */
void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 618 */
void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 619 */
void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 620 */
void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 621 */
void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 622 */
void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 623 */
void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 624 */
void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 625 */
void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 626 */
void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 627 */
void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 628 */
void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 629 */
void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 630 */
void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 631 */
void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 632 */
void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 633 */
void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 634 */
void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 635 */
void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 636 */
void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 637 */
void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 638 */
void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 639 */
void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 640 */
void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 641 */
void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 642 */
void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 643 */
void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 644 */
void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 645 */
void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 646 */
void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 647 */
void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 648 */
void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 649 */
void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 650 */
void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 651 */
void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 652 */
void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 653 */
GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 654 */
void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 655 */
GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 656 */
GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 657 */
void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 658 */
void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 659 */
void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 660 */
void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 661 */
void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 662 */
void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 663 */
void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 664 */
void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 665 */
void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 666 */
void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 667 */
void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 668 */
void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 669 */
void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 670 */
GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 671 */
void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 672 */
void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 673 */
void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 674 */
void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 675 */
void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 676 */
void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 677 */
void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 678 */
void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 679 */
void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 680 */
void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 681 */
void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 682 */
void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 683 */
void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 684 */
void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 685 */
void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 686 */
void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 687 */
void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 688 */
void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 689 */
void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 690 */
void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 691 */
void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 692 */
void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 693 */
void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 694 */
void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 695 */
void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 696 */
void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 697 */
void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 698 */
void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 699 */
void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 700 */
void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 701 */
void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 702 */
void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 703 */
void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 704 */
void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 705 */
void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 706 */
void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 707 */
void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 708 */
void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 709 */
void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 710 */
void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 711 */
void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 712 */
void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 713 */
void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 714 */
void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 715 */
void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 716 */
void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 717 */
void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 718 */
void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 719 */
void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 720 */
void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 721 */
void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 722 */
void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 723 */
void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 724 */
void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 725 */
void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 726 */
GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 727 */
void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 728 */
void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 729 */
void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 730 */
void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 731 */
void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 732 */
void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 733 */
void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 734 */
void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 735 */
void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 736 */
GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 737 */
void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 738 */
void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 739 */
void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 740 */
void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 741 */
void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 742 */
void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 743 */
void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 744 */
void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 745 */
void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 746 */
void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 747 */
GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 748 */
void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 749 */
void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 750 */
void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 751 */
void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 752 */
void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 753 */
void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 754 */
void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 755 */
void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 756 */
void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 757 */
void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 758 */
void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 759 */
GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 760 */
GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 761 */
void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 762 */
void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 763 */
void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 764 */
void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 765 */
void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 766 */
void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 767 */
void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 768 */
void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 769 */
};
#endif /* !defined( _GLAPI_TABLE_H_ ) */

6655
glx/glapitemp.h Normal file

File diff suppressed because it is too large Load Diff

2260
glx/glprocs.h Normal file

File diff suppressed because it is too large Load Diff

378
glx/glthread.c Normal file
View File

@ -0,0 +1,378 @@
/*
* Mesa 3-D graphics library
* Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul 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
* BRIAN PAUL 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.
*/
/*
* XXX There's probably some work to do in order to make this file
* truly reusable outside of Mesa.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdlib.h>
#include "glthread.h"
/*
* This file should still compile even when THREADS is not defined.
* This is to make things easier to deal with on the makefile scene..
*/
#ifdef THREADS
#include <errno.h>
/*
* Error messages
*/
#define INIT_TSD_ERROR "_glthread_: failed to allocate key for thread specific data"
#define GET_TSD_ERROR "_glthread_: failed to get thread specific data"
#define SET_TSD_ERROR "_glthread_: thread failed to set thread specific data"
/*
* Magic number to determine if a TSD object has been initialized.
* Kind of a hack but there doesn't appear to be a better cross-platform
* solution.
*/
#define INIT_MAGIC 0xff8adc98
/*
* POSIX Threads -- The best way to go if your platform supports them.
* Solaris >= 2.5 have POSIX threads, IRIX >= 6.4 reportedly
* has them, and many of the free Unixes now have them.
* Be sure to use appropriate -mt or -D_REENTRANT type
* compile flags when building.
*/
#ifdef PTHREADS
unsigned long
_glthread_GetID(void)
{
return (unsigned long) pthread_self();
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
perror(INIT_TSD_ERROR);
exit(-1);
}
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
return pthread_getspecific(tsd->key);
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
if (pthread_setspecific(tsd->key, ptr) != 0) {
perror(SET_TSD_ERROR);
exit(-1);
}
}
#endif /* PTHREADS */
/*
* Solaris/Unix International Threads -- Use only if POSIX threads
* aren't available on your Unix platform. Solaris 2.[34] are examples
* of platforms where this is the case. Be sure to use -mt and/or
* -D_REENTRANT when compiling.
*/
#ifdef SOLARIS_THREADS
#define USE_LOCK_FOR_KEY /* undef this to try a version without
lock for the global key... */
unsigned long
_glthread_GetID(void)
{
abort(); /* XXX not implemented yet */
return (unsigned long) 0;
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
if ((errno = mutex_init(&tsd->keylock, 0, NULL)) != 0 ||
(errno = thr_keycreate(&(tsd->key), free)) != 0) {
perror(INIT_TSD_ERROR);
exit(-1);
}
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
void* ret;
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
#ifdef USE_LOCK_FOR_KEY
mutex_lock(&tsd->keylock);
thr_getspecific(tsd->key, &ret);
mutex_unlock(&tsd->keylock);
#else
if ((errno = thr_getspecific(tsd->key, &ret)) != 0) {
perror(GET_TSD_ERROR);
exit(-1);
}
#endif
return ret;
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
if ((errno = thr_setspecific(tsd->key, ptr)) != 0) {
perror(SET_TSD_ERROR);
exit(-1);
}
}
#undef USE_LOCK_FOR_KEY
#endif /* SOLARIS_THREADS */
/*
* Win32 Threads. The only available option for Windows 95/NT.
* Be sure that you compile using the Multithreaded runtime, otherwise
* bad things will happen.
*/
#ifdef WIN32_THREADS
void FreeTSD(_glthread_TSD *p)
{
if (p->initMagic==INIT_MAGIC) {
TlsFree(p->key);
p->initMagic=0;
}
}
void InsteadOf_exit(int nCode)
{
DWORD dwErr=GetLastError();
}
unsigned long
_glthread_GetID(void)
{
return GetCurrentThreadId();
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
tsd->key = TlsAlloc();
if (tsd->key == TLS_OUT_OF_INDEXES) {
perror("Mesa:_glthread_InitTSD");
InsteadOf_exit(-1);
}
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
return TlsGetValue(tsd->key);
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
/* the following code assumes that the _glthread_TSD has been initialized
to zero at creation */
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
if (TlsSetValue(tsd->key, ptr) == 0) {
perror("Mesa:_glthread_SetTSD");
InsteadOf_exit(-1);
}
}
#endif /* WIN32_THREADS */
/*
* XFree86 has its own thread wrapper, Xthreads.h
* We wrap it again for GL.
*/
#ifdef USE_XTHREADS
unsigned long
_glthread_GetID(void)
{
return (unsigned long) xthread_self();
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
if (xthread_key_create(&tsd->key, NULL) != 0) {
perror(INIT_TSD_ERROR);
exit(-1);
}
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
void *ptr;
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
xthread_get_specific(tsd->key, &ptr);
return ptr;
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
if (tsd->initMagic != INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
xthread_set_specific(tsd->key, ptr);
}
#endif /* XTHREAD */
/*
* BeOS threads
*/
#ifdef BEOS_THREADS
unsigned long
_glthread_GetID(void)
{
return (unsigned long) find_thread(NULL);
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
tsd->key = tls_allocate();
tsd->initMagic = INIT_MAGIC;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
return tls_get(tsd->key);
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
if (tsd->initMagic != (int) INIT_MAGIC) {
_glthread_InitTSD(tsd);
}
tls_set(tsd->key, ptr);
}
#endif /* BEOS_THREADS */
#else /* THREADS */
/*
* no-op functions
*/
unsigned long
_glthread_GetID(void)
{
return 0;
}
void
_glthread_InitTSD(_glthread_TSD *tsd)
{
(void) tsd;
}
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
(void) tsd;
return NULL;
}
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
(void) tsd;
(void) ptr;
}
#endif /* THREADS */

319
glx/glthread.h Normal file
View File

@ -0,0 +1,319 @@
/*
* Mesa 3-D graphics library
* Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul 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
* BRIAN PAUL 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.
*/
/*
* Thread support for gl dispatch.
*
* Initial version by John Stone (j.stone@acm.org) (johns@cs.umr.edu)
* and Christoph Poliwoda (poliwoda@volumegraphics.com)
* Revised by Keith Whitwell
* Adapted for new gl dispatcher by Brian Paul
*
*
*
* DOCUMENTATION
*
* This thread module exports the following types:
* _glthread_TSD Thread-specific data area
* _glthread_Thread Thread datatype
* _glthread_Mutex Mutual exclusion lock
*
* Macros:
* _glthread_DECLARE_STATIC_MUTEX(name) Declare a non-local mutex
* _glthread_INIT_MUTEX(name) Initialize a mutex
* _glthread_LOCK_MUTEX(name) Lock a mutex
* _glthread_UNLOCK_MUTEX(name) Unlock a mutex
*
* Functions:
* _glthread_GetID(v) Get integer thread ID
* _glthread_InitTSD() Initialize thread-specific data
* _glthread_GetTSD() Get thread-specific data
* _glthread_SetTSD() Set thread-specific data
*
*/
/*
* If this file is accidentally included by a non-threaded build,
* it should not cause the build to fail, or otherwise cause problems.
* In general, it should only be included when needed however.
*/
#ifndef GLTHREAD_H
#define GLTHREAD_H
#if defined(USE_MGL_NAMESPACE)
#define _glapi_Dispatch _mglapi_Dispatch
#endif
#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\
defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \
&& !defined(THREADS)
# define THREADS
#endif
#ifdef VMS
#include <GL/vms_x_fix.h>
#endif
/*
* POSIX threads. This should be your choice in the Unix world
* whenever possible. When building with POSIX threads, be sure
* to enable any compiler flags which will cause the MT-safe
* libc (if one exists) to be used when linking, as well as any
* header macros for MT-safe errno, etc. For Solaris, this is the -mt
* compiler flag. On Solaris with gcc, use -D_REENTRANT to enable
* proper compiling for MT-safe libc etc.
*/
#if defined(PTHREADS)
#include <pthread.h> /* POSIX threads headers */
typedef struct {
pthread_key_t key;
int initMagic;
} _glthread_TSD;
typedef pthread_t _glthread_Thread;
typedef pthread_mutex_t _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) \
static _glthread_Mutex name = PTHREAD_MUTEX_INITIALIZER
#define _glthread_INIT_MUTEX(name) \
pthread_mutex_init(&(name), NULL)
#define _glthread_DESTROY_MUTEX(name) \
pthread_mutex_destroy(&(name))
#define _glthread_LOCK_MUTEX(name) \
(void) pthread_mutex_lock(&(name))
#define _glthread_UNLOCK_MUTEX(name) \
(void) pthread_mutex_unlock(&(name))
#endif /* PTHREADS */
/*
* Solaris threads. Use only up to Solaris 2.4.
* Solaris 2.5 and higher provide POSIX threads.
* Be sure to compile with -mt on the Solaris compilers, or
* use -D_REENTRANT if using gcc.
*/
#ifdef SOLARIS_THREADS
#include <thread.h>
typedef struct {
thread_key_t key;
mutex_t keylock;
int initMagic;
} _glthread_TSD;
typedef thread_t _glthread_Thread;
typedef mutex_t _glthread_Mutex;
/* XXX need to really implement mutex-related macros */
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
#define _glthread_INIT_MUTEX(name) (void) name
#define _glthread_DESTROY_MUTEX(name) (void) name
#define _glthread_LOCK_MUTEX(name) (void) name
#define _glthread_UNLOCK_MUTEX(name) (void) name
#endif /* SOLARIS_THREADS */
/*
* Windows threads. Should work with Windows NT and 95.
* IMPORTANT: Link with multithreaded runtime library when THREADS are
* used!
*/
#ifdef WIN32_THREADS
#include <windows.h>
typedef struct {
DWORD key;
int initMagic;
} _glthread_TSD;
typedef HANDLE _glthread_Thread;
typedef CRITICAL_SECTION _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) /*static*/ _glthread_Mutex name = {0,0,0,0,0,0}
#define _glthread_INIT_MUTEX(name) InitializeCriticalSection(&name)
#define _glthread_DESTROY_MUTEX(name) DeleteCriticalSection(&name)
#define _glthread_LOCK_MUTEX(name) EnterCriticalSection(&name)
#define _glthread_UNLOCK_MUTEX(name) LeaveCriticalSection(&name)
#endif /* WIN32_THREADS */
/*
* XFree86 has its own thread wrapper, Xthreads.h
* We wrap it again for GL.
*/
#ifdef USE_XTHREADS
#include <X11/Xthreads.h>
typedef struct {
xthread_key_t key;
int initMagic;
} _glthread_TSD;
typedef xthread_t _glthread_Thread;
typedef xmutex_rec _glthread_Mutex;
#ifdef XMUTEX_INITIALIZER
#define _glthread_DECLARE_STATIC_MUTEX(name) \
static _glthread_Mutex name = XMUTEX_INITIALIZER
#else
#define _glthread_DECLARE_STATIC_MUTEX(name) \
static _glthread_Mutex name
#endif
#define _glthread_INIT_MUTEX(name) \
xmutex_init(&(name))
#define _glthread_DESTROY_MUTEX(name) \
xmutex_clear(&(name))
#define _glthread_LOCK_MUTEX(name) \
(void) xmutex_lock(&(name))
#define _glthread_UNLOCK_MUTEX(name) \
(void) xmutex_unlock(&(name))
#endif /* USE_XTHREADS */
/*
* BeOS threads. R5.x required.
*/
#ifdef BEOS_THREADS
#include <kernel/OS.h>
#include <support/TLS.h>
typedef struct {
int32 key;
int initMagic;
} _glthread_TSD;
typedef thread_id _glthread_Thread;
/* Use Benaphore, aka speeder semaphore */
typedef struct {
int32 lock;
sem_id sem;
} benaphore;
typedef benaphore _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = { 0, 0 }
#define _glthread_INIT_MUTEX(name) name.sem = create_sem(0, #name"_benaphore"), name.lock = 0
#define _glthread_DESTROY_MUTEX(name) delete_sem(name.sem), name.lock = 0
#define _glthread_LOCK_MUTEX(name) if (name.sem == 0) _glthread_INIT_MUTEX(name); \
if (atomic_add(&(name.lock), 1) >= 1) acquire_sem(name.sem)
#define _glthread_UNLOCK_MUTEX(name) if (atomic_add(&(name.lock), -1) > 1) release_sem(name.sem)
#endif /* BEOS_THREADS */
#ifndef THREADS
/*
* THREADS not defined
*/
typedef int _glthread_TSD;
typedef int _glthread_Thread;
typedef int _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
#define _glthread_INIT_MUTEX(name) (void) name
#define _glthread_DESTROY_MUTEX(name) (void) name
#define _glthread_LOCK_MUTEX(name) (void) name
#define _glthread_UNLOCK_MUTEX(name) (void) name
#endif /* THREADS */
/*
* Platform independent thread specific data API.
*/
extern unsigned long
_glthread_GetID(void);
extern void
_glthread_InitTSD(_glthread_TSD *);
extern void *
_glthread_GetTSD(_glthread_TSD *);
extern void
_glthread_SetTSD(_glthread_TSD *, void *);
#if defined(GLX_USE_TLS)
extern __thread struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec")));
#define GET_DISPATCH() _glapi_tls_Dispatch
#elif !defined(GL_CALL)
# if defined(THREADS)
# define GET_DISPATCH() \
((__builtin_expect( _glapi_Dispatch != NULL, 1 )) \
? _glapi_Dispatch : _glapi_get_dispatch())
# else
# define GET_DISPATCH() _glapi_Dispatch
# endif /* defined(THREADS) */
#endif /* ndef GL_CALL */
#endif /* THREADS_H */

View File

@ -50,7 +50,6 @@
#include <windowstr.h>
#include "glxutil.h"
#include "glxext.h"
#include "glcontextmodes.h"
#include "glapitable.h"
#include "glapi.h"
#include "glthread.h"
@ -83,9 +82,9 @@ validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err)
static int
validGlxFBConfig(ClientPtr client, __GLXscreen *pGlxScreen, XID id,
__GLcontextModes **config, int *err)
__GLXconfig **config, int *err)
{
__GLcontextModes *m;
__GLXconfig *m;
for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next)
if (m->fbconfigID == id) {
@ -101,7 +100,7 @@ validGlxFBConfig(ClientPtr client, __GLXscreen *pGlxScreen, XID id,
static int
validGlxVisual(ClientPtr client, __GLXscreen *pGlxScreen, XID id,
__GLcontextModes **config, int *err)
__GLXconfig **config, int *err)
{
int i;
@ -118,7 +117,7 @@ validGlxVisual(ClientPtr client, __GLXscreen *pGlxScreen, XID id,
}
static int
validGlxFBConfigForWindow(ClientPtr client, __GLcontextModes *config,
validGlxFBConfigForWindow(ClientPtr client, __GLXconfig *config,
DrawablePtr pDraw, int *err)
{
ScreenPtr pScreen = pDraw->pScreen;
@ -135,7 +134,7 @@ validGlxFBConfigForWindow(ClientPtr client, __GLcontextModes *config,
}
/* FIXME: What exactly should we check here... */
if (pVisual->class != _gl_convert_to_x_visual_type(config->visualType) ||
if (pVisual->class != glxConvertToXVisualType(config->visualType) ||
!(config->drawableType & GLX_WINDOW_BIT)) {
client->errorValue = pDraw->id;
*err = BadMatch;
@ -161,7 +160,7 @@ static void __glXdirectContextDestroy(__GLXcontext *context)
}
static __GLXcontext *__glXdirectContextCreate(__GLXscreen *screen,
__GLcontextModes *modes,
__GLXconfig *modes,
__GLXcontext *shareContext)
{
__GLXcontext *context;
@ -186,7 +185,7 @@ static __GLXcontext *__glXdirectContextCreate(__GLXscreen *screen,
static int
DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
GLXContextID shareList, __GLcontextModes *config,
GLXContextID shareList, __GLXconfig *config,
__GLXscreen *pGlxScreen, GLboolean isDirect)
{
ClientPtr client = cl->client;
@ -248,7 +247,7 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
** a GL core that needs windowing information (e.g., Mesa).
*/
glxc->pGlxScreen = pGlxScreen;
glxc->modes = config;
glxc->config = config;
/*
** Register this context as a resource.
@ -276,7 +275,7 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
int __glXDisp_CreateContext(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
__GLcontextModes *config;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
@ -292,7 +291,7 @@ int __glXDisp_CreateContext(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
__GLcontextModes *config;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
@ -309,7 +308,7 @@ int __glXDisp_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateContextWithConfigSGIXReq *req =
(xGLXCreateContextWithConfigSGIXReq *) pc;
__GLcontextModes *config;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
@ -462,7 +461,7 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client,
* GLXPixmap and we just return the __GLXdrawable. */
pGlxDraw = (__GLXdrawable *) LookupIDByType(drawId, __glXDrawableRes);
if (pGlxDraw != NULL) {
if (glxc != NULL && pGlxDraw->modes != glxc->modes) {
if (glxc != NULL && pGlxDraw->config != glxc->config) {
client->errorValue = drawId;
*error = BadMatch;
return NULL;
@ -497,12 +496,12 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client,
* the context screen and that the context fbconfig is compatible
* with the window visual. */
if (pDraw->pScreen != glxc->pGlxScreen->pScreen ||
!validGlxFBConfigForWindow(client, glxc->modes, pDraw, error))
!validGlxFBConfigForWindow(client, glxc->config, pDraw, error))
return NULL;
pGlxDraw = glxc->pGlxScreen->createDrawable(glxc->pGlxScreen,
pDraw, GLX_DRAWABLE_WINDOW,
drawId, glxc->modes);
drawId, glxc->config);
/* since we are creating the drawablePrivate, drawId should be new */
if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) {
@ -878,7 +877,7 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client;
xGLXGetVisualConfigsReply reply;
__GLXscreen *pGlxScreen;
__GLcontextModes *modes;
__GLXconfig *modes;
CARD32 buf[__GLX_TOTAL_CONFIG];
int p, i, err;
__GLX_DECLARE_SWAP_VARIABLES;
@ -907,8 +906,8 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
p = 0;
buf[p++] = modes->visualID;
buf[p++] = _gl_convert_to_x_visual_type( modes->visualType );
buf[p++] = modes->rgbMode;
buf[p++] = glxConvertToXVisualType( modes->visualType );
buf[p++] = (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE;
buf[p++] = modes->redBits;
buf[p++] = modes->greenBits;
@ -944,6 +943,12 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
buf[p++] = modes->transparentAlpha;
buf[p++] = GLX_TRANSPARENT_INDEX_VALUE;
buf[p++] = modes->transparentIndex;
buf[p++] = GLX_SAMPLES_SGIS;
buf[p++] = modes->samples;
buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
buf[p++] = modes->sampleBuffers;
buf[p++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */
buf[p++] = 0;
if (client->swapped) {
__GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
@ -954,7 +959,7 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
return Success;
}
#define __GLX_TOTAL_FBCONFIG_ATTRIBS (28)
#define __GLX_TOTAL_FBCONFIG_ATTRIBS (36)
#define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2)
/**
* Send the set of GLXFBConfigs to the client. There is not currently
@ -974,7 +979,7 @@ DoGetFBConfigs(__GLXclientState *cl, unsigned screen)
__GLXscreen *pGlxScreen;
CARD32 buf[__GLX_FBCONFIG_ATTRIBS_LENGTH];
int p, err;
__GLcontextModes *modes;
__GLXconfig *modes;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
@ -1006,7 +1011,9 @@ DoGetFBConfigs(__GLXclientState *cl, unsigned screen)
WRITE_PAIR( GLX_FBCONFIG_ID, modes->fbconfigID );
WRITE_PAIR( GLX_X_RENDERABLE, GL_TRUE );
WRITE_PAIR( GLX_RGBA, modes->rgbMode );
WRITE_PAIR( GLX_RGBA,
(modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE );
WRITE_PAIR( GLX_RENDER_TYPE, modes->renderType );
WRITE_PAIR( GLX_DOUBLEBUFFER, modes->doubleBufferMode );
WRITE_PAIR( GLX_STEREO, modes->stereoMode );
@ -1032,6 +1039,14 @@ DoGetFBConfigs(__GLXclientState *cl, unsigned screen)
WRITE_PAIR( GLX_TRANSPARENT_ALPHA_VALUE, modes->transparentAlpha );
WRITE_PAIR( GLX_TRANSPARENT_INDEX_VALUE, modes->transparentIndex );
WRITE_PAIR( GLX_SWAP_METHOD_OML, modes->swapMethod );
WRITE_PAIR( GLX_SAMPLES_SGIS, modes->samples );
WRITE_PAIR( GLX_SAMPLE_BUFFERS_SGIS, modes->sampleBuffers );
/* GLX_VISUAL_SELECT_GROUP_SGIX ? */
WRITE_PAIR( GLX_DRAWABLE_TYPE, modes->drawableType );
WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGB_EXT, modes->bindToTextureRgb );
WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGBA_EXT, modes->bindToTextureRgba );
WRITE_PAIR( GLX_BIND_TO_MIPMAP_TEXTURE_EXT, modes->bindToMipmapTexture );
WRITE_PAIR( GLX_BIND_TO_TEXTURE_TARGETS_EXT, modes->bindToTextureTargets );
if (client->swapped) {
__GLX_SWAP_INT_ARRAY(buf, __GLX_FBCONFIG_ATTRIBS_LENGTH);
@ -1056,7 +1071,7 @@ int __glXDisp_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
}
static int
DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, __GLcontextModes *config,
DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config,
DrawablePtr pDraw, XID glxDrawableId, int type)
{
__GLXdrawable *pGlxDraw;
@ -1080,7 +1095,7 @@ DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, __GLcontextModes
}
static int
DoCreateGLXPixmap(ClientPtr client, __GLXscreen *pGlxScreen, __GLcontextModes *config,
DoCreateGLXPixmap(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config,
XID drawableId, XID glxDrawableId)
{
DrawablePtr pDraw;
@ -1138,7 +1153,7 @@ determineTextureTarget(XID glxDrawableID, CARD32 *attribs, CARD32 numAttribs)
int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
__GLcontextModes *config;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
@ -1154,7 +1169,7 @@ int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
__GLcontextModes *config;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
@ -1178,7 +1193,7 @@ int __glXDisp_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateGLXPixmapWithConfigSGIXReq *req =
(xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
__GLcontextModes *config;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
@ -1213,10 +1228,6 @@ static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type)
}
}
if (type == GLX_DRAWABLE_PIXMAP) {
((PixmapPtr) pGlxDraw->pDraw)->refcnt--;
}
FreeResource(glxdrawable, FALSE);
return Success;
@ -1240,7 +1251,7 @@ static int
DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
int width, int height, XID glxDrawableId)
{
__GLcontextModes *config;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
PixmapPtr pPixmap;
int err;
@ -1353,7 +1364,7 @@ int __glXDisp_ChangeDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
__GLcontextModes *config;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
ClientPtr client = cl->client;
DrawablePtr pDraw;
@ -1467,7 +1478,7 @@ DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
*pSendBuf++ = GLX_SHARE_CONTEXT_EXT;
*pSendBuf++ = (int)(ctx->share_id);
*pSendBuf++ = GLX_VISUAL_ID_EXT;
*pSendBuf++ = (int)(ctx->modes->visualID);
*pSendBuf++ = (int)(ctx->config->visualID);
*pSendBuf++ = GLX_SCREEN_EXT;
*pSendBuf++ = (int)(ctx->pGlxScreen->pScreen->myNum);

View File

@ -40,8 +40,6 @@
**
*/
#include "GL/internal/glcore.h"
typedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap;
struct __GLXtextureFromPixmap {
int (*bindTexImage) (__GLXcontext *baseContext,
@ -77,9 +75,9 @@ struct __GLXcontext {
__GLXcontext *nextReadPriv;
/*
** mode struct for this context
** config struct for this context
*/
__GLcontextModes *modes;
__GLXconfig *config;
/*
** Pointer to screen info data for this context. This is set

View File

@ -74,7 +74,7 @@ struct __GLXdrawable {
/*
** Configuration of the visual to which this drawable was created.
*/
__GLcontextModes *modes;
__GLXconfig *config;
/*
** Lists of contexts bound to this drawable. There are two lists here.

View File

@ -52,7 +52,7 @@
#define DRI_NEW_INTERFACE_ONLY
#include "glxserver.h"
#include "glxutil.h"
#include "glcontextmodes.h"
#include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h"
@ -61,26 +61,25 @@
#include "dispatch.h"
#include "extension_string.h"
#define containerOf(ptr, type, member) \
(type *)( (char *)ptr - offsetof(type,member) )
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
struct __GLXDRIscreen {
__GLXscreen base;
__DRIscreen driScreen;
__DRIscreen *driScreen;
void *driver;
xf86EnterVTProc *enterVT;
xf86LeaveVTProc *leaveVT;
__DRIcopySubBufferExtension *copySubBuffer;
__DRIswapControlExtension *swapControl;
const __DRIcoreExtension *core;
const __DRIlegacyExtension *legacy;
const __DRIcopySubBufferExtension *copySubBuffer;
const __DRIswapControlExtension *swapControl;
#ifdef __DRI_TEX_OFFSET
__DRItexOffsetExtension *texOffset;
const __DRItexOffsetExtension *texOffset;
DRITexOffsetStartProcPtr texOffsetStart;
DRITexOffsetFinishProcPtr texOffsetFinish;
__GLXDRIdrawable *texOffsetOverride[16];
@ -92,13 +91,13 @@ struct __GLXDRIscreen {
struct __GLXDRIcontext {
__GLXcontext base;
__DRIcontext driContext;
__DRIcontext *driContext;
XID hwContextID;
};
struct __GLXDRIdrawable {
__GLXdrawable base;
__DRIdrawable driDrawable;
__DRIdrawable *driDrawable;
/* Pulled in from old __GLXpixmap */
#ifdef __DRI_TEX_OFFSET
@ -109,8 +108,6 @@ struct __GLXDRIdrawable {
#endif
};
static const char CREATE_NEW_SCREEN_FUNC[] = __DRI_CREATE_NEW_SCREEN_STRING;
static void
__glXDRIleaveServer(GLboolean rendering)
{
@ -151,7 +148,7 @@ __glXDRIleaveServer(GLboolean rendering)
__GLXDRIdrawable *pGlxPix = texOffsetOverride[j];
if (pGlxPix && pGlxPix->texname) {
screen->texOffset->setTexOffset(&pGlxPix->ctx->driContext,
screen->texOffset->setTexOffset(pGlxPix->ctx->driContext,
pGlxPix->texname,
pGlxPix->offset,
pGlxPix->base.pDraw->depth,
@ -192,6 +189,8 @@ __glXDRIdoReleaseTexImage(__GLXDRIscreen *screen, __GLXDRIdrawable *drawable)
for (i = 0; i < lastOverride; i++) {
if (texOffsetOverride[i] == drawable) {
if (screen->texOffsetFinish)
screen->texOffsetFinish((PixmapPtr)drawable->base.pDraw);
texOffsetOverride[i] = NULL;
@ -219,24 +218,24 @@ static void
__glXDRIdrawableDestroy(__GLXdrawable *drawable)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
__GLXDRIscreen *screen;
int i;
for (i = 0; i < screenInfo.numScreens; i++) {
__glXDRIdoReleaseTexImage((__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[i]),
private);
screen = (__GLXDRIscreen *) glxGetScreen(screenInfo.screens[i]);
__glXDRIdoReleaseTexImage(screen, private);
}
(*private->driDrawable.destroyDrawable)(&private->driDrawable);
/* If the X window was destroyed, the dri DestroyWindow hook will
* aready have taken care of this, so only call if pDraw isn't NULL. */
if (drawable->pDraw != NULL) {
__glXenterServer(GL_FALSE);
DRIDestroyDrawable(drawable->pDraw->pScreen,
serverClient, drawable->pDraw);
__glXleaveServer(GL_FALSE);
screen = (__GLXDRIscreen *) glxGetScreen(drawable->pDraw->pScreen);
(*screen->core->destroyDrawable)(private->driDrawable);
__glXenterServer(GL_FALSE);
DRIDestroyDrawable(drawable->pDraw->pScreen,
serverClient, drawable->pDraw);
__glXleaveServer(GL_FALSE);
}
xfree(private);
@ -255,8 +254,10 @@ static GLboolean
__glXDRIdrawableSwapBuffers(__GLXdrawable *basePrivate)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) basePrivate;
__GLXDRIscreen *screen =
(__GLXDRIscreen *) glxGetScreen(basePrivate->pDraw->pScreen);
(*private->driDrawable.swapBuffers)(&private->driDrawable);
(*screen->core->swapBuffers)(private->driDrawable);
return TRUE;
}
@ -266,11 +267,11 @@ static int
__glXDRIdrawableSwapInterval(__GLXdrawable *baseDrawable, int interval)
{
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseDrawable;
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(baseDrawable->pDraw->pScreen);
__GLXDRIscreen *screen =
(__GLXDRIscreen *) glxGetScreen(baseDrawable->pDraw->pScreen);
if (screen->swapControl)
screen->swapControl->setSwapInterval(&draw->driDrawable, interval);
screen->swapControl->setSwapInterval(draw->driDrawable, interval);
return 0;
}
@ -285,20 +286,21 @@ __glXDRIdrawableCopySubBuffer(__GLXdrawable *basePrivate,
glxGetScreen(basePrivate->pDraw->pScreen);
if (screen->copySubBuffer)
screen->copySubBuffer->copySubBuffer(&private->driDrawable,
x, y, w, h);
screen->copySubBuffer->copySubBuffer(private->driDrawable, x, y, w, h);
}
static void
__glXDRIcontextDestroy(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
Bool retval;
context->driContext.destroyContext(&context->driContext);
screen->core->destroyContext(context->driContext);
__glXenterServer(GL_FALSE);
retval = DRIDestroyContext(baseContext->pGlxScreen->pScreen, context->hwContextID);
retval = DRIDestroyContext(baseContext->pGlxScreen->pScreen,
context->hwContextID);
__glXleaveServer(GL_FALSE);
__glXContextDestroy(&context->base);
@ -309,20 +311,22 @@ static int
__glXDRIcontextMakeCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
return (*context->driContext.bindContext)(&context->driContext,
&draw->driDrawable,
&read->driDrawable);
return (*screen->core->bindContext)(context->driContext,
draw->driDrawable,
read->driDrawable);
}
static int
__glXDRIcontextLoseCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*context->driContext.unbindContext)(&context->driContext);
return (*screen->core->unbindContext)(context->driContext);
}
static int
@ -331,13 +335,10 @@ __glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
{
__GLXDRIcontext *dst = (__GLXDRIcontext *) baseDst;
__GLXDRIcontext *src = (__GLXDRIcontext *) baseSrc;
__GLXDRIscreen *screen = (__GLXDRIscreen *) dst->base.pGlxScreen;
/* FIXME: We will need to add DRIcontext::copyContext for this. */
(void) dst;
(void) src;
return FALSE;
return (*screen->core->copyContext)(dst->driContext,
src->driContext, mask);
}
static int
@ -346,10 +347,11 @@ __glXDRIcontextForceCurrent(__GLXcontext *baseContext)
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*context->driContext.bindContext)(&context->driContext,
&draw->driDrawable,
&read->driDrawable);
return (*screen->core->bindContext)(context->driContext,
draw->driDrawable,
read->driDrawable);
}
static void
@ -392,10 +394,8 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
int bpp, override = 0, texname;
GLenum format, type;
ScreenPtr pScreen = glxPixmap->pDraw->pScreen;
__GLXDRIdrawable *driDraw =
containerOf(glxPixmap, __GLXDRIdrawable, base);
__GLXDRIscreen * const screen =
(__GLXDRIscreen *) glxGetScreen(pScreen);
__GLXDRIdrawable *driDraw = (__GLXDRIdrawable *) glxPixmap;
__GLXDRIscreen * const screen = (__GLXDRIscreen *) glxGetScreen(pScreen);
CALL_GetIntegerv(GET_DISPATCH(), (glxPixmap->target == GL_TEXTURE_2D ?
GL_TEXTURE_BINDING_2D :
@ -439,7 +439,7 @@ alreadyin:
driDraw->texname = texname;
screen->texOffset->setTexOffset(&driDraw->ctx->driContext, texname, 0,
screen->texOffset->setTexOffset(driDraw->ctx->driContext, texname, 0,
pixmap->drawable.depth,
pixmap->devKind);
}
@ -487,9 +487,11 @@ nooverride:
data = xalloc(pitch * pixmap->drawable.height);
__glXenterServer(GL_FALSE);
pScreen->GetImage(&pixmap->drawable, 0 /*pixmap->drawable.x*/,
0 /*pixmap->drawable.y*/, pixmap->drawable.width,
pixmap->drawable.height, ZPixmap, ~0, data);
__glXleaveServer(GL_FALSE);
if (pixmap->drawable.depth == 24)
glxFillAlphaChannel(data,
@ -531,9 +533,11 @@ nooverride:
pixmap->drawable.depth);
void *data = xalloc(pitch * (p[i].y2 - p[i].y1));
__glXenterServer(GL_FALSE);
pScreen->GetImage(&pixmap->drawable, /*pixmap->drawable.x +*/ p[i].x1,
/*pixmap->drawable.y*/ + p[i].y1, p[i].x2 - p[i].x1,
p[i].y2 - p[i].y1, ZPixmap, ~0, data);
__glXleaveServer(GL_FALSE);
if (pixmap->drawable.depth == 24)
glxFillAlphaChannel(data,
@ -568,9 +572,11 @@ __glXDRIreleaseTexImage(__GLXcontext *baseContext,
int buffer,
__GLXdrawable *pixmap)
{
__glXDRIdoReleaseTexImage((__GLXDRIscreen *)
glxGetScreen(pixmap->pDraw->pScreen),
containerOf(pixmap, __GLXDRIdrawable, base));
__GLXDRIscreen *screen =
(__GLXDRIscreen *) glxGetScreen(pixmap->pDraw->pScreen);
__GLXDRIdrawable *drawable = (__GLXDRIdrawable *) pixmap;
__glXDRIdoReleaseTexImage(screen, drawable);
return Success;
}
@ -585,7 +591,7 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
{
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
screen->driScreen.destroyScreen(&screen->driScreen);
screen->core->destroyScreen(screen->driScreen);
dlclose(screen->driver);
@ -596,11 +602,12 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
static __GLXcontext *
__glXDRIscreenCreateContext(__GLXscreen *baseScreen,
__GLcontextModes *modes,
__GLXconfig *glxConfig,
__GLXcontext *baseShareContext)
{
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
__GLXDRIcontext *context, *shareContext;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
VisualPtr visual;
int i;
GLboolean retval;
@ -610,7 +617,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
shareContext = (__GLXDRIcontext *) baseShareContext;
if (shareContext)
driShare = &shareContext->driContext;
driShare = shareContext->driContext;
else
driShare = NULL;
@ -632,7 +639,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
/* Find the requested X visual */
visual = pScreen->visuals;
for (i = 0; i < pScreen->numVisuals; i++, visual++)
if (visual->vid == modes->visualID)
if (visual->vid == glxConfig->visualID)
break;
if (i == pScreen->numVisuals)
return GL_FALSE;
@ -644,15 +651,15 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->hwContextID, &hwContext);
__glXleaveServer(GL_FALSE);
context->driContext.private =
screen->driScreen.createNewContext(&screen->driScreen,
modes,
0, /* render type */
driShare,
hwContext,
&context->driContext);
context->driContext =
screen->legacy->createNewContext(screen->driScreen,
config->driConfig,
0, /* render type */
driShare,
hwContext,
context);
if (context->driContext.private == NULL) {
if (context->driContext == NULL) {
__glXenterServer(GL_FALSE);
retval = DRIDestroyContext(baseScreen->pScreen, context->hwContextID);
__glXleaveServer(GL_FALSE);
@ -668,9 +675,10 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
DrawablePtr pDraw,
int type,
XID drawId,
__GLcontextModes *modes)
__GLXconfig *glxConfig)
{
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
__GLXDRIdrawable *private;
GLboolean retval;
drm_drawable_t hwDrawable;
@ -682,7 +690,7 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
memset(private, 0, sizeof *private);
if (!__glXDrawableInit(&private->base, screen,
pDraw, type, drawId, modes)) {
pDraw, type, drawId, glxConfig)) {
xfree(private);
return NULL;
}
@ -700,13 +708,12 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
/* The last argument is 'attrs', which is used with pbuffers which
* we currently don't support. */
private->driDrawable.private =
(driScreen->driScreen.createNewDrawable)(&driScreen->driScreen,
modes,
&private->driDrawable,
hwDrawable, 0, NULL);
private->driDrawable =
(driScreen->legacy->createNewDrawable)(driScreen->driScreen,
config->driConfig,
hwDrawable, 0, NULL, private);
if (private->driDrawable.private == NULL) {
if (private->driDrawable == NULL) {
__glXenterServer(GL_FALSE);
DRIDestroyDrawable(screen->pScreen, serverClient, pDraw);
__glXleaveServer(GL_FALSE);
@ -723,10 +730,10 @@ getDrawableInfo(__DRIdrawable *driDrawable,
int *x, int *y, int *width, int *height,
int *numClipRects, drm_clip_rect_t **ppClipRects,
int *backX, int *backY,
int *numBackClipRects, drm_clip_rect_t **ppBackClipRects)
int *numBackClipRects, drm_clip_rect_t **ppBackClipRects,
void *data)
{
__GLXDRIdrawable *drawable = containerOf(driDrawable,
__GLXDRIdrawable, driDrawable);
__GLXDRIdrawable *drawable = data;
ScreenPtr pScreen;
drm_clip_rect_t *pClipRects, *pBackClipRects;
GLboolean retval;
@ -791,29 +798,13 @@ getDrawableInfo(__DRIdrawable *driDrawable,
return retval;
}
static int
getUST(int64_t *ust)
{
struct timeval tv;
if (ust == NULL)
return -EFAULT;
if (gettimeofday(&tv, NULL) == 0) {
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
return 0;
} else {
return -errno;
}
}
static void __glXReportDamage(__DRIdrawable *driDraw,
int x, int y,
drm_clip_rect_t *rects, int num_rects,
GLboolean front_buffer)
GLboolean front_buffer,
void *data)
{
__GLXDRIdrawable *drawable =
containerOf(driDraw, __GLXDRIdrawable, driDrawable);
__GLXDRIdrawable *drawable = data;
DrawablePtr pDraw = drawable->base.pDraw;
RegionRec region;
@ -827,19 +818,6 @@ static void __glXReportDamage(__DRIdrawable *driDraw,
__glXleaveServer(GL_FALSE);
}
/* Table of functions that we export to the driver. */
static const __DRIcontextModesExtension contextModesExtension = {
{ __DRI_CONTEXT_MODES, __DRI_CONTEXT_MODES_VERSION },
_gl_context_modes_create,
_gl_context_modes_destroy,
};
static const __DRIsystemTimeExtension systemTimeExtension = {
{ __DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION },
getUST,
NULL,
};
static const __DRIgetDrawableInfoExtension getDrawableInfoExtension = {
{ __DRI_GET_DRAWABLE_INFO, __DRI_GET_DRAWABLE_INFO_VERSION },
getDrawableInfo
@ -851,7 +829,6 @@ static const __DRIdamageExtension damageExtension = {
};
static const __DRIextension *loader_extensions[] = {
&contextModesExtension.base,
&systemTimeExtension.base,
&getDrawableInfoExtension.base,
&damageExtension.base,
@ -897,7 +874,8 @@ initializeExtensions(__GLXDRIscreen *screen)
const __DRIextension **extensions;
int i;
extensions = screen->driScreen.getExtensions(&screen->driScreen);
extensions = screen->core->getExtensions(screen->driScreen);
for (i = 0; extensions[i]; i++) {
#ifdef __DRI_COPY_SUB_BUFFER
if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
@ -931,12 +909,12 @@ initializeExtensions(__GLXDRIscreen *screen)
}
}
#define COPY_SUB_BUFFER_INTERNAL_VERSION 20060314
extern __GLXconfig *
glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs);
static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
{
PFNCREATENEWSCREENFUNC createNewScreen;
drm_handle_t hSAREA;
drmAddress pSAREA = NULL;
char *BusID;
@ -953,11 +931,13 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
drm_handle_t hFB;
int junk;
__GLXDRIscreen *screen;
void *dev_priv = NULL;
char filename[128];
Bool isCapable;
size_t buffer_size;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
const __DRIconfig **driConfigs;
const __DRIextension **extensions;
int i;
if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
!DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
@ -985,9 +965,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
dri_version.minor = XF86DRI_MINOR_VERSION;
dri_version.patch = XF86DRI_PATCH_VERSION;
framebuffer.base = NULL;
framebuffer.dev_priv = NULL;
if (!DRIOpenConnection(pScreen, &hSAREA, &BusID)) {
LogMessage(X_ERROR, "AIGLX error: DRIOpenConnection failed\n");
goto handle_error;
@ -1046,11 +1023,30 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
goto handle_error;
}
createNewScreen = dlsym(screen->driver, CREATE_NEW_SCREEN_FUNC);
if (createNewScreen == NULL) {
LogMessage(X_ERROR, "AIGLX error: dlsym for %s failed (%s)\n",
CREATE_NEW_SCREEN_FUNC, dlerror());
goto handle_error;
extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
if (extensions == NULL) {
LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
driverName, dlerror());
goto handle_error;
}
for (i = 0; extensions[i]; i++) {
if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
extensions[i]->version >= __DRI_CORE_VERSION) {
screen->core = (__DRIcoreExtension *) extensions[i];
}
if (strcmp(extensions[i]->name, __DRI_LEGACY) == 0 &&
extensions[i]->version >= __DRI_LEGACY_VERSION) {
screen->legacy = (__DRIlegacyExtension *) extensions[i];
}
}
if (screen->core == NULL || screen->legacy == NULL) {
LogMessage(X_ERROR,
"AIGLX error: %s does not export required DRI extension\n",
driverName);
goto handle_error;
}
/*
@ -1066,19 +1062,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
goto handle_error;
}
/* Sigh... the DRI interface is broken; the DRI driver will free
* the dev private pointer using _mesa_free() on screen destroy,
* but we can't use _mesa_malloc() here. In fact, the DRI driver
* shouldn't free data it didn't allocate itself, but what can you
* do... */
dev_priv = xalloc(framebuffer.dev_priv_size);
if (dev_priv == NULL) {
LogMessage(X_ERROR, "AIGLX error: dev_priv allocation failed");
goto handle_error;
}
memcpy(dev_priv, framebuffer.dev_priv, framebuffer.dev_priv_size);
framebuffer.dev_priv = dev_priv;
framebuffer.width = pScreen->width;
framebuffer.height = pScreen->height;
@ -1101,28 +1084,30 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
goto handle_error;
}
screen->driScreen.private =
(*createNewScreen)(pScreen->myNum,
&screen->driScreen,
&ddx_version,
&dri_version,
&drm_version,
&framebuffer,
pSAREA,
fd,
loader_extensions,
&screen->base.fbconfigs);
screen->driScreen =
(*screen->legacy->createNewScreen)(pScreen->myNum,
&ddx_version,
&dri_version,
&drm_version,
&framebuffer,
pSAREA,
fd,
loader_extensions,
&driConfigs,
screen);
if (screen->driScreen.private == NULL) {
if (screen->driScreen == NULL) {
LogMessage(X_ERROR, "AIGLX error: Calling driver entry point failed");
goto handle_error;
}
DRIGetTexOffsetFuncs(pScreen, &screen->texOffsetStart,
&screen->texOffsetFinish);
screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs);
initializeExtensions(screen);
DRIGetTexOffsetFuncs(pScreen, &screen->texOffsetStart,
&screen->texOffsetFinish);
__glXScreenInit(&screen->base, pScreen);
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
@ -1155,9 +1140,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
if (framebuffer.base != NULL)
drmUnmap((drmAddress)framebuffer.base, framebuffer.size);
if (dev_priv != NULL)
xfree(dev_priv);
if (fd >= 0)
drmCloseOnce(fd);

View File

@ -29,26 +29,24 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/time.h>
#include <dlfcn.h>
#include <drm.h>
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#include <GL/glxtokens.h>
#include <windowstr.h>
#include <os.h>
#define _XF86DRI_SERVER_
#include <xf86drm.h>
#include <xf86dristr.h>
#include <xf86str.h>
#include <xf86.h>
#include <dri2.h>
#include "glxserver.h"
#include "glxutil.h"
#include "glcontextmodes.h"
#include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h"
@ -57,53 +55,50 @@
#include "dispatch.h"
#include "extension_string.h"
#define containerOf(ptr, type, member) \
(type *)( (char *)ptr - offsetof(type,member) )
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
struct __GLXDRIscreen {
__GLXscreen base;
__DRIscreen driScreen;
__DRIscreen *driScreen;
void *driver;
int fd;
xf86EnterVTProc *enterVT;
xf86LeaveVTProc *leaveVT;
__DRIcopySubBufferExtension *copySubBuffer;
__DRIswapControlExtension *swapControl;
__DRItexBufferExtension *texBuffer;
const __DRIcoreExtension *core;
const __DRIcopySubBufferExtension *copySubBuffer;
const __DRIswapControlExtension *swapControl;
const __DRItexBufferExtension *texBuffer;
unsigned char glx_enable_bits[__GLX_EXT_BYTES];
};
struct __GLXDRIcontext {
__GLXcontext base;
__DRIcontext driContext;
drm_context_t hwContext;
__GLXcontext base;
__DRIcontext *driContext;
};
struct __GLXDRIdrawable {
__GLXdrawable base;
__DRIdrawable driDrawable;
__GLXdrawable base;
__DRIdrawable *driDrawable;
__GLXDRIscreen *screen;
};
static const char CREATE_NEW_SCREEN_FUNC[] = __DRI2_CREATE_NEW_SCREEN_STRING;
static void
__glXDRIdrawableDestroy(__GLXdrawable *drawable)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
(*private->driDrawable.destroyDrawable)(&private->driDrawable);
const __DRIcoreExtension *core = private->screen->core;
(*core->destroyDrawable)(private->driDrawable);
/* If the X window was destroyed, the dri DestroyWindow hook will
* aready have taken care of this, so only call if pDraw isn't NULL. */
if (drawable->pDraw != NULL)
DRI2DestroyDrawable(drawable->pDraw->pScreen, drawable->pDraw);
DRI2DestroyDrawable(drawable->pDraw);
xfree(private);
}
@ -118,25 +113,25 @@ __glXDRIdrawableResize(__GLXdrawable *glxPriv)
}
static GLboolean
__glXDRIdrawableSwapBuffers(__GLXdrawable *basePrivate)
__glXDRIdrawableSwapBuffers(__GLXdrawable *drawable)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) basePrivate;
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
const __DRIcoreExtension *core = private->screen->core;
(*private->driDrawable.swapBuffers)(&private->driDrawable);
(*core->swapBuffers)(private->driDrawable);
return TRUE;
}
static int
__glXDRIdrawableSwapInterval(__GLXdrawable *baseDrawable, int interval)
__glXDRIdrawableSwapInterval(__GLXdrawable *drawable, int interval)
{
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseDrawable;
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(baseDrawable->pDraw->pScreen);
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
const __DRIswapControlExtension *swapControl = private->screen->swapControl;
if (screen->swapControl)
screen->swapControl->setSwapInterval(&draw->driDrawable, interval);
if (swapControl)
swapControl->setSwapInterval(private->driDrawable, interval);
return 0;
}
@ -147,22 +142,20 @@ __glXDRIdrawableCopySubBuffer(__GLXdrawable *basePrivate,
int x, int y, int w, int h)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) basePrivate;
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(basePrivate->pDraw->pScreen);
const __DRIcopySubBufferExtension *copySubBuffer =
private->screen->copySubBuffer;
if (screen->copySubBuffer)
screen->copySubBuffer->copySubBuffer(&private->driDrawable,
x, y, w, h);
if (copySubBuffer)
(*copySubBuffer->copySubBuffer)(private->driDrawable, x, y, w, h);
}
static void
__glXDRIcontextDestroy(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseContext->pGlxScreen;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
context->driContext.destroyContext(&context->driContext);
drmDestroyContext(screen->fd, context->hwContext);
(*screen->core->destroyContext)(context->driContext);
__glXContextDestroy(&context->base);
xfree(context);
}
@ -173,18 +166,20 @@ __glXDRIcontextMakeCurrent(__GLXcontext *baseContext)
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*context->driContext.bindContext)(&context->driContext,
&draw->driDrawable,
&read->driDrawable);
return (*screen->core->bindContext)(context->driContext,
draw->driDrawable,
read->driDrawable);
}
static int
__glXDRIcontextLoseCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*context->driContext.unbindContext)(&context->driContext);
return (*screen->core->unbindContext)(context->driContext);
}
static int
@ -193,13 +188,10 @@ __glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
{
__GLXDRIcontext *dst = (__GLXDRIcontext *) baseDst;
__GLXDRIcontext *src = (__GLXDRIcontext *) baseSrc;
__GLXDRIscreen *screen = (__GLXDRIscreen *) dst->base.pGlxScreen;
/* FIXME: We will need to add DRIcontext::copyContext for this. */
(void) dst;
(void) src;
return FALSE;
return (*screen->core->copyContext)(dst->driContext,
src->driContext, mask);
}
static int
@ -208,46 +200,30 @@ __glXDRIcontextForceCurrent(__GLXcontext *baseContext)
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*context->driContext.bindContext)(&context->driContext,
&draw->driDrawable,
&read->driDrawable);
return (*screen->core->bindContext)(context->driContext,
draw->driDrawable,
read->driDrawable);
}
#ifdef __DRI_TEX_BUFFER
#define isPowerOfTwo(n) (((n) & ((n) - 1 )) == 0)
static int
__glXDRIbindTexImage(__GLXcontext *baseContext,
int buffer,
__GLXdrawable *glxPixmap)
{
ScreenPtr pScreen = glxPixmap->pDraw->pScreen;
__GLXDRIscreen * const screen = (__GLXDRIscreen *) glxGetScreen(pScreen);
PixmapPtr pixmap;
__GLXDRIdrawable *drawable = (__GLXDRIdrawable *) glxPixmap;
const __DRItexBufferExtension *texBuffer = drawable->screen->texBuffer;
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
unsigned int flags;
int w, h, target;
if (screen->texBuffer == NULL)
if (texBuffer == NULL)
return Success;
pixmap = (PixmapPtr) glxPixmap->pDraw;
w = pixmap->drawable.width;
h = pixmap->drawable.height;
if (!isPowerOfTwo(w) || !isPowerOfTwo(h))
target = GL_TEXTURE_RECTANGLE_ARB;
else
target = GL_TEXTURE_2D;
screen->texBuffer->setTexBuffer(&context->driContext,
target,
DRI2GetPixmapHandle(pixmap, &flags),
pixmap->drawable.depth,
pixmap->devKind,
h);
texBuffer->setTexBuffer(context->driContext,
glxPixmap->target,
drawable->driDrawable);
return Success;
}
@ -291,7 +267,7 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
{
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
screen->driScreen.destroyScreen(&screen->driScreen);
(*screen->core->destroyScreen)(screen->driScreen);
dlclose(screen->driver);
@ -302,16 +278,18 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
static __GLXcontext *
__glXDRIscreenCreateContext(__GLXscreen *baseScreen,
__GLcontextModes *modes,
__GLXconfig *glxConfig,
__GLXcontext *baseShareContext)
{
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
__GLXDRIcontext *context, *shareContext;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
const __DRIcoreExtension *core = screen->core;
__DRIcontext *driShare;
shareContext = (__GLXDRIcontext *) baseShareContext;
if (shareContext)
driShare = &shareContext->driContext;
driShare = shareContext->driContext;
else
driShare = NULL;
@ -327,16 +305,9 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->base.forceCurrent = __glXDRIcontextForceCurrent;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
if (drmCreateContext(screen->fd, &context->hwContext))
return GL_FALSE;
context->driContext.private =
screen->driScreen.createNewContext(&screen->driScreen,
modes,
0, /* render type */
driShare,
context->hwContext,
&context->driContext);
context->driContext =
(*core->createNewContext)(screen->driScreen,
config->driConfig, driShare, context);
return &context->base;
}
@ -346,12 +317,13 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
DrawablePtr pDraw,
int type,
XID drawId,
__GLcontextModes *modes)
__GLXconfig *glxConfig)
{
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
__GLXDRIdrawable *private;
GLboolean retval;
drm_drawable_t hwDrawable;
unsigned int handle, head;
private = xalloc(sizeof *private);
if (private == NULL)
@ -359,8 +331,9 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
memset(private, 0, sizeof *private);
private->screen = driScreen;
if (!__glXDrawableInit(&private->base, screen,
pDraw, type, drawId, modes)) {
pDraw, type, drawId, glxConfig)) {
xfree(private);
return NULL;
}
@ -370,71 +343,47 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
retval = DRI2CreateDrawable(screen->pScreen, pDraw, &hwDrawable);
retval = DRI2CreateDrawable(pDraw, &handle, &head);
private->driDrawable.private =
(driScreen->driScreen.createNewDrawable)(&driScreen->driScreen,
modes,
&private->driDrawable,
hwDrawable, 0, NULL);
private->driDrawable =
(*driScreen->core->createNewDrawable)(driScreen->driScreen,
config->driConfig,
handle, head, private);
return &private->base;
}
static int
getUST(int64_t *ust)
static void dri2ReemitDrawableInfo(__DRIdrawable *draw, unsigned int *tail,
void *loaderPrivate)
{
struct timeval tv;
if (ust == NULL)
return -EFAULT;
__GLXDRIdrawable *pdraw = loaderPrivate;
if (gettimeofday(&tv, NULL) == 0) {
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
return 0;
} else {
return -errno;
}
DRI2ReemitDrawableInfo(pdraw->base.pDraw, tail);
}
static void __glXReportDamage(__DRIdrawable *driDraw,
int x, int y,
drm_clip_rect_t *rects, int num_rects,
GLboolean front_buffer)
{
__GLXDRIdrawable *drawable =
containerOf(driDraw, __GLXDRIdrawable, driDrawable);
static void dri2PostDamage(__DRIdrawable *draw,
struct drm_clip_rect *rects,
int numRects, void *loaderPrivate)
{
__GLXDRIdrawable *drawable = loaderPrivate;
DrawablePtr pDraw = drawable->base.pDraw;
RegionRec region;
REGION_INIT(pDraw->pScreen, &region, (BoxPtr) rects, num_rects);
REGION_INIT(pDraw->pScreen, &region, (BoxPtr) rects, numRects);
REGION_TRANSLATE(pScreen, &region, pDraw->x, pDraw->y);
DamageDamageRegion(pDraw, &region);
REGION_UNINIT(pDraw->pScreen, &region);
}
/* Table of functions that we export to the driver. */
static const __DRIcontextModesExtension contextModesExtension = {
{ __DRI_CONTEXT_MODES, __DRI_CONTEXT_MODES_VERSION },
_gl_context_modes_create,
_gl_context_modes_destroy,
};
static const __DRIsystemTimeExtension systemTimeExtension = {
{ __DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION },
getUST,
NULL,
};
static const __DRIdamageExtension damageExtension = {
{ __DRI_DAMAGE, __DRI_DAMAGE_VERSION },
__glXReportDamage,
static const __DRIloaderExtension loaderExtension = {
{ __DRI_LOADER, __DRI_LOADER_VERSION },
dri2ReemitDrawableInfo,
dri2PostDamage
};
static const __DRIextension *loader_extensions[] = {
&contextModesExtension.base,
&systemTimeExtension.base,
&damageExtension.base,
&loaderExtension.base,
NULL
};
@ -475,11 +424,13 @@ initializeExtensions(__GLXDRIscreen *screen)
const __DRIextension **extensions;
int i;
extensions = screen->driScreen.getExtensions(&screen->driScreen);
extensions = screen->core->getExtensions(screen->driScreen);
for (i = 0; extensions[i]; i++) {
#ifdef __DRI_COPY_SUB_BUFFER
if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
screen->copySubBuffer = (__DRIcopySubBufferExtension *) extensions[i];
screen->copySubBuffer =
(const __DRIcopySubBufferExtension *) extensions[i];
__glXEnableExtension(screen->glx_enable_bits,
"GLX_MESA_copy_sub_buffer");
@ -489,7 +440,8 @@ initializeExtensions(__GLXDRIscreen *screen)
#ifdef __DRI_SWAP_CONTROL
if (strcmp(extensions[i]->name, __DRI_SWAP_CONTROL) == 0) {
screen->swapControl = (__DRIswapControlExtension *) extensions[i];
screen->swapControl =
(const __DRIswapControlExtension *) extensions[i];
__glXEnableExtension(screen->glx_enable_bits,
"GLX_SGI_swap_control");
__glXEnableExtension(screen->glx_enable_bits,
@ -501,7 +453,8 @@ initializeExtensions(__GLXDRIscreen *screen)
#ifdef __DRI_TEX_BUFFER
if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) {
screen->texBuffer = (__DRItexBufferExtension *) extensions[i];
screen->texBuffer =
(const __DRItexBufferExtension *) extensions[i];
/* GLX_EXT_texture_from_pixmap is always enabled. */
LogMessage(X_INFO, "AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n");
}
@ -509,28 +462,27 @@ initializeExtensions(__GLXDRIscreen *screen)
/* Ignore unknown extensions */
}
}
static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
{
__DRI2_CREATE_NEW_SCREEN_FUNC *createNewScreen;
const char *driverName;
__GLXDRIscreen *screen;
char filename[128];
size_t buffer_size;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
unsigned int sareaHandle;
const __DRIextension **extensions;
const __DRIconfig **driConfigs;
int i;
screen = xalloc(sizeof *screen);
if (screen == NULL)
return NULL;
return NULL;
memset(screen, 0, sizeof *screen);
if (!xf86LoaderCheckSymbol("DRI2Connect") ||
!DRI2Connect(pScreen,
&screen->fd,
&driverName,
&sareaHandle)) {
!DRI2Connect(pScreen, &screen->fd, &driverName, &sareaHandle)) {
LogMessage(X_INFO,
"AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);
return NULL;
@ -544,8 +496,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
__glXInitExtensionEnableBits(screen->glx_enable_bits);
snprintf(filename, sizeof filename, "%s/%s_dri.so",
dri_driver_path, driverName);
snprintf(filename, sizeof filename,
"%s/%s_dri.so", dri_driver_path, driverName);
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
if (screen->driver == NULL) {
@ -554,28 +506,43 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
goto handle_error;
}
createNewScreen = dlsym(screen->driver, CREATE_NEW_SCREEN_FUNC);
if (createNewScreen == NULL) {
LogMessage(X_ERROR, "AIGLX error: dlsym for %s failed (%s)\n",
CREATE_NEW_SCREEN_FUNC, dlerror());
goto handle_error;
extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
if (extensions == NULL) {
LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
driverName, dlerror());
goto handle_error;
}
screen->driScreen.private =
(*createNewScreen)(pScreen->myNum,
&screen->driScreen,
screen->fd,
sareaHandle,
loader_extensions,
&screen->base.fbconfigs);
for (i = 0; extensions[i]; i++) {
if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
extensions[i]->version >= __DRI_CORE_VERSION) {
screen->core = (const __DRIcoreExtension *) extensions[i];
}
}
if (screen->driScreen.private == NULL) {
if (screen->core == NULL) {
LogMessage(X_ERROR, "AIGLX error: %s exports no DRI extension\n",
driverName);
goto handle_error;
}
screen->driScreen =
(*screen->core->createNewScreen)(pScreen->myNum,
screen->fd,
sareaHandle,
loader_extensions,
&driConfigs,
screen);
if (screen->driScreen == NULL) {
LogMessage(X_ERROR, "AIGLX error: Calling driver entry point failed");
goto handle_error;
}
initializeExtensions(screen);
screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs);
__glXScreenInit(&screen->base, pScreen);
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);

203
glx/glxdricommon.c Normal file
View File

@ -0,0 +1,203 @@
/*
* Copyright © 2008 Red Hat, Inc
*
* 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 the
* copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS 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.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdint.h>
#include <errno.h>
#include <sys/time.h>
#include <GL/gl.h>
#include <GL/glxtokens.h>
#include <GL/internal/dri_interface.h>
#include <os.h>
#include "glxserver.h"
#include "glxcontext.h"
#include "glxscreens.h"
#include "glxdricommon.h"
static int
getUST(int64_t *ust)
{
struct timeval tv;
if (ust == NULL)
return -EFAULT;
if (gettimeofday(&tv, NULL) == 0) {
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
return 0;
} else {
return -errno;
}
}
const __DRIsystemTimeExtension systemTimeExtension = {
{ __DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION },
getUST,
NULL,
};
#define __ATTRIB(attrib, field) \
{ attrib, offsetof(__GLXconfig, field) }
static const struct { unsigned int attrib, offset; } attribMap[] = {
__ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits),
__ATTRIB(__DRI_ATTRIB_LEVEL, level),
__ATTRIB(__DRI_ATTRIB_RED_SIZE, redBits),
__ATTRIB(__DRI_ATTRIB_GREEN_SIZE, greenBits),
__ATTRIB(__DRI_ATTRIB_BLUE_SIZE, blueBits),
__ATTRIB(__DRI_ATTRIB_ALPHA_SIZE, alphaBits),
__ATTRIB(__DRI_ATTRIB_DEPTH_SIZE, depthBits),
__ATTRIB(__DRI_ATTRIB_STENCIL_SIZE, stencilBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_RED_SIZE, accumRedBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_GREEN_SIZE, accumGreenBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_BLUE_SIZE, accumBlueBits),
__ATTRIB(__DRI_ATTRIB_ACCUM_ALPHA_SIZE, accumAlphaBits),
__ATTRIB(__DRI_ATTRIB_SAMPLE_BUFFERS, sampleBuffers),
__ATTRIB(__DRI_ATTRIB_SAMPLES, samples),
__ATTRIB(__DRI_ATTRIB_DOUBLE_BUFFER, doubleBufferMode),
__ATTRIB(__DRI_ATTRIB_STEREO, stereoMode),
__ATTRIB(__DRI_ATTRIB_AUX_BUFFERS, numAuxBuffers),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_TYPE, transparentPixel),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_INDEX_VALUE, transparentPixel),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_RED_VALUE, transparentRed),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_GREEN_VALUE, transparentGreen),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_BLUE_VALUE, transparentBlue),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE, transparentAlpha),
__ATTRIB(__DRI_ATTRIB_RED_MASK, redMask),
__ATTRIB(__DRI_ATTRIB_GREEN_MASK, greenMask),
__ATTRIB(__DRI_ATTRIB_BLUE_MASK, blueMask),
__ATTRIB(__DRI_ATTRIB_ALPHA_MASK, alphaMask),
__ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_WIDTH, maxPbufferWidth),
__ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_HEIGHT, maxPbufferHeight),
__ATTRIB(__DRI_ATTRIB_MAX_PBUFFER_PIXELS, maxPbufferPixels),
__ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH, optimalPbufferWidth),
__ATTRIB(__DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT, optimalPbufferHeight),
__ATTRIB(__DRI_ATTRIB_SWAP_METHOD, swapMethod),
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb),
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba),
__ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture),
__ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),
};
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
static void
setScalar(__GLXconfig *config, unsigned int attrib, unsigned int value)
{
int i;
for (i = 0; i < ARRAY_SIZE(attribMap); i++)
if (attribMap[i].attrib == attrib) {
*(unsigned int *) ((char *) config + attribMap[i].offset) = value;
return;
}
}
static __GLXconfig *
createModeFromConfig(const __DRIcoreExtension *core,
const __DRIconfig *driConfig,
unsigned int visualType)
{
__GLXDRIconfig *config;
unsigned int attrib, value;
int i;
config = xalloc(sizeof *config);
config->driConfig = driConfig;
i = 0;
while (core->indexConfigAttrib(driConfig, i++, &attrib, &value)) {
switch (attrib) {
case __DRI_ATTRIB_RENDER_TYPE:
config->config.renderType = 0;
if (value & __DRI_ATTRIB_RGBA_BIT)
config->config.renderType |= GLX_RGBA_BIT;
if (value & __DRI_ATTRIB_COLOR_INDEX_BIT)
config->config.renderType |= GLX_COLOR_INDEX_BIT;
break;
case __DRI_ATTRIB_CONFIG_CAVEAT:
if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG)
config->config.visualRating = GLX_NON_CONFORMANT_CONFIG;
else if (value & __DRI_ATTRIB_SLOW_BIT)
config->config.visualRating = GLX_SLOW_CONFIG;
else
config->config.visualRating = GLX_NONE;
break;
case __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS:
config->config.bindToTextureTargets = 0;
if (value & __DRI_ATTRIB_TEXTURE_1D_BIT)
config->config.bindToTextureTargets |= GLX_TEXTURE_1D_BIT_EXT;
if (value & __DRI_ATTRIB_TEXTURE_2D_BIT)
config->config.bindToTextureTargets |= GLX_TEXTURE_2D_BIT_EXT;
if (value & __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT)
config->config.bindToTextureTargets |= GLX_TEXTURE_RECTANGLE_BIT_EXT;
break;
default:
setScalar(&config->config, attrib, value);
break;
}
}
config->config.next = NULL;
config->config.xRenderable = GL_TRUE;
config->config.visualType = visualType;
config->config.drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
return &config->config;
}
__GLXconfig *
glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs)
{
__GLXconfig head, *tail;
int i;
tail = &head;
head.next = NULL;
for (i = 0; configs[i]; i++) {
tail->next = createModeFromConfig(core,
configs[i], GLX_TRUE_COLOR);
if (tail->next == NULL)
break;
tail = tail->next;
}
for (i = 0; configs[i]; i++) {
tail->next = createModeFromConfig(core,
configs[i], GLX_DIRECT_COLOR);
if (tail->next == NULL)
break;
tail = tail->next;
}
return head.next;
}

40
glx/glxdricommon.h Normal file
View File

@ -0,0 +1,40 @@
/*
* Copyright © 2008 Red Hat, Inc
*
* 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 the
* copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS 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 _GLX_dri_common_h
#define _GLX_dri_common_h
typedef struct __GLXDRIconfig __GLXDRIconfig;
struct __GLXDRIconfig {
__GLXconfig config;
const __DRIconfig *driConfig;
};
__GLXconfig *
glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs);
extern const __DRIsystemTimeExtension systemTimeExtension;
#endif

544
glx/glxdriswrast.c Normal file
View File

@ -0,0 +1,544 @@
/*
* Copyright © 2008 George Sapountzis <gsap7@yahoo.gr>
* Copyright © 2008 Red Hat, Inc
*
* 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 the
* copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS 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.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/time.h>
#include <dlfcn.h>
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#include <GL/glxtokens.h>
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "gcstruct.h"
#include "os.h"
#include "glxserver.h"
#include "glxutil.h"
#include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h"
#include "glapi.h"
#include "glthread.h"
#include "dispatch.h"
#include "extension_string.h"
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
struct __GLXDRIscreen {
__GLXscreen base;
__DRIscreen *driScreen;
void *driver;
const __DRIcoreExtension *core;
const __DRIswrastExtension *swrast;
const __DRIcopySubBufferExtension *copySubBuffer;
const __DRItexBufferExtension *texBuffer;
};
struct __GLXDRIcontext {
__GLXcontext base;
__DRIcontext *driContext;
};
struct __GLXDRIdrawable {
__GLXdrawable base;
__DRIdrawable *driDrawable;
__GLXDRIscreen *screen;
GCPtr gc; /* scratch GC for span drawing */
GCPtr cleargc; /* GC for clearing the color buffer */
GCPtr swapgc; /* GC for swapping the color buffers */
};
static void
__glXDRIdrawableDestroy(__GLXdrawable *drawable)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
const __DRIcoreExtension *core = private->screen->core;
(*core->destroyDrawable)(private->driDrawable);
FreeScratchGC(private->gc);
FreeScratchGC(private->cleargc);
FreeScratchGC(private->swapgc);
xfree(private);
}
static GLboolean
__glXDRIdrawableResize(__GLXdrawable *drawable)
{
/* Nothing to do here, the DRI driver asks the server for drawable
* geometry appropriately. */
return GL_TRUE;
}
static GLboolean
__glXDRIdrawableSwapBuffers(__GLXdrawable *drawable)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
const __DRIcoreExtension *core = private->screen->core;
(*core->swapBuffers)(private->driDrawable);
return TRUE;
}
static void
__glXDRIdrawableCopySubBuffer(__GLXdrawable *basePrivate,
int x, int y, int w, int h)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) basePrivate;
const __DRIcopySubBufferExtension *copySubBuffer =
private->screen->copySubBuffer;
if (copySubBuffer)
(*copySubBuffer->copySubBuffer)(private->driDrawable, x, y, w, h);
}
static void
__glXDRIcontextDestroy(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
(*screen->core->destroyContext)(context->driContext);
__glXContextDestroy(&context->base);
xfree(context);
}
static int
__glXDRIcontextMakeCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*screen->core->bindContext)(context->driContext,
draw->driDrawable,
read->driDrawable);
}
static int
__glXDRIcontextLoseCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*screen->core->unbindContext)(context->driContext);
}
static int
__glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
unsigned long mask)
{
__GLXDRIcontext *dst = (__GLXDRIcontext *) baseDst;
__GLXDRIcontext *src = (__GLXDRIcontext *) baseSrc;
__GLXDRIscreen *screen = (__GLXDRIscreen *) dst->base.pGlxScreen;
return (*screen->core->copyContext)(dst->driContext,
src->driContext, mask);
}
static int
__glXDRIcontextForceCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*screen->core->bindContext)(context->driContext,
draw->driDrawable,
read->driDrawable);
}
#ifdef __DRI_TEX_BUFFER
static int
__glXDRIbindTexImage(__GLXcontext *baseContext,
int buffer,
__GLXdrawable *glxPixmap)
{
__GLXDRIdrawable *drawable = (__GLXDRIdrawable *) glxPixmap;
const __DRItexBufferExtension *texBuffer = drawable->screen->texBuffer;
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
if (texBuffer == NULL)
return Success;
texBuffer->setTexBuffer(context->driContext,
glxPixmap->target,
drawable->driDrawable);
return Success;
}
static int
__glXDRIreleaseTexImage(__GLXcontext *baseContext,
int buffer,
__GLXdrawable *pixmap)
{
/* FIXME: Just unbind the texture? */
return Success;
}
#else
static int
__glXDRIbindTexImage(__GLXcontext *baseContext,
int buffer,
__GLXdrawable *glxPixmap)
{
return Success;
}
static int
__glXDRIreleaseTexImage(__GLXcontext *baseContext,
int buffer,
__GLXdrawable *pixmap)
{
return Success;
}
#endif
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
__glXDRIbindTexImage,
__glXDRIreleaseTexImage
};
static void
__glXDRIscreenDestroy(__GLXscreen *baseScreen)
{
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
(*screen->core->destroyScreen)(screen->driScreen);
dlclose(screen->driver);
__glXScreenDestroy(baseScreen);
xfree(screen);
}
static __GLXcontext *
__glXDRIscreenCreateContext(__GLXscreen *baseScreen,
__GLXconfig *glxConfig,
__GLXcontext *baseShareContext)
{
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
__GLXDRIcontext *context, *shareContext;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
const __DRIcoreExtension *core = screen->core;
__DRIcontext *driShare;
shareContext = (__GLXDRIcontext *) baseShareContext;
if (shareContext)
driShare = shareContext->driContext;
else
driShare = NULL;
context = xalloc(sizeof *context);
if (context == NULL)
return NULL;
memset(context, 0, sizeof *context);
context->base.destroy = __glXDRIcontextDestroy;
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy;
context->base.forceCurrent = __glXDRIcontextForceCurrent;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
context->driContext =
(*core->createNewContext)(screen->driScreen,
config->driConfig, driShare, context);
return &context->base;
}
static void
glxChangeGC(GCPtr gc, BITS32 mask, CARD32 val)
{
CARD32 v[1];
v[0] = val;
dixChangeGC(NullClient, gc, mask, v, NULL);
}
static __GLXdrawable *
__glXDRIscreenCreateDrawable(__GLXscreen *screen,
DrawablePtr pDraw,
int type,
XID drawId,
__GLXconfig *glxConfig)
{
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
__GLXDRIdrawable *private;
ScreenPtr pScreen = driScreen->base.pScreen;
private = xalloc(sizeof *private);
if (private == NULL)
return NULL;
memset(private, 0, sizeof *private);
private->screen = driScreen;
if (!__glXDrawableInit(&private->base, screen,
pDraw, type, drawId, glxConfig)) {
xfree(private);
return NULL;
}
private->base.destroy = __glXDRIdrawableDestroy;
private->base.resize = __glXDRIdrawableResize;
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
private->gc = CreateScratchGC(pScreen, pDraw->depth);
private->cleargc = CreateScratchGC(pScreen, pDraw->depth);
private->swapgc = CreateScratchGC(pScreen, pDraw->depth);
glxChangeGC(private->gc, GCFunction, GXcopy);
glxChangeGC(private->cleargc, GCFunction, GXcopy);
glxChangeGC(private->swapgc, GCFunction, GXcopy);
glxChangeGC(private->swapgc, GCGraphicsExposures, FALSE);
private->driDrawable =
(*driScreen->swrast->createNewDrawable)(driScreen->driScreen,
config->driConfig,
private);
return &private->base;
}
static void
swrastGetDrawableInfo(__DRIdrawable *draw,
int *x, int *y, int *w, int *h,
void *loaderPrivate)
{
__GLXDRIdrawable *drawable = loaderPrivate;
DrawablePtr pDraw = drawable->base.pDraw;
*x = pDraw->x;
*y = pDraw->x;
*w = pDraw->width;
*h = pDraw->height;
}
static void
swrastPutImage(__DRIdrawable *draw, int op,
int x, int y, int w, int h, char *data,
void *loaderPrivate)
{
__GLXDRIdrawable *drawable = loaderPrivate;
DrawablePtr pDraw = drawable->base.pDraw;
GCPtr gc;
switch (op) {
case __DRI_SWRAST_IMAGE_OP_DRAW:
gc = drawable->gc;
break;
case __DRI_SWRAST_IMAGE_OP_CLEAR:
gc = drawable->cleargc;
break;
case __DRI_SWRAST_IMAGE_OP_SWAP:
gc = drawable->swapgc;
break;
default:
return;
}
ValidateGC(pDraw, gc);
gc->ops->PutImage(pDraw, gc, pDraw->depth,
x, y, w, h, 0, ZPixmap, data);
}
static void
swrastGetImage(__DRIdrawable *draw,
int x, int y, int w, int h, char *data,
void *loaderPrivate)
{
__GLXDRIdrawable *drawable = loaderPrivate;
DrawablePtr pDraw = drawable->base.pDraw;
ScreenPtr pScreen = pDraw->pScreen;
pScreen->GetImage(pDraw, x, y, w, h, ZPixmap, ~0L, data);
}
static const __DRIswrastLoaderExtension swrastLoaderExtension = {
{ __DRI_SWRAST_LOADER, __DRI_SWRAST_LOADER_VERSION },
swrastGetDrawableInfo,
swrastPutImage,
swrastGetImage
};
static const __DRIextension *loader_extensions[] = {
&systemTimeExtension.base,
&swrastLoaderExtension.base,
NULL
};
static void
initializeExtensions(__GLXDRIscreen *screen)
{
const __DRIextension **extensions;
int i;
extensions = screen->core->getExtensions(screen->driScreen);
for (i = 0; extensions[i]; i++) {
#ifdef __DRI_COPY_SUB_BUFFER
if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
screen->copySubBuffer =
(const __DRIcopySubBufferExtension *) extensions[i];
/* GLX_MESA_copy_sub_buffer is always enabled. */
}
#endif
#ifdef __DRI_TEX_BUFFER
if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) {
screen->texBuffer =
(const __DRItexBufferExtension *) extensions[i];
/* GLX_EXT_texture_from_pixmap is always enabled. */
}
#endif
/* Ignore unknown extensions */
}
}
static const char dri_driver_path[] = DRI_DRIVER_PATH;
static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
{
const char *driverName = "swrast";
__GLXDRIscreen *screen;
char filename[128];
const __DRIextension **extensions;
const __DRIconfig **driConfigs;
int i;
screen = xalloc(sizeof *screen);
if (screen == NULL)
return NULL;
memset(screen, 0, sizeof *screen);
screen->base.destroy = __glXDRIscreenDestroy;
screen->base.createContext = __glXDRIscreenCreateContext;
screen->base.createDrawable = __glXDRIscreenCreateDrawable;
screen->base.swapInterval = NULL;
screen->base.pScreen = pScreen;
snprintf(filename, sizeof filename,
"%s/%s_dri.so", dri_driver_path, driverName);
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
if (screen->driver == NULL) {
LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
filename, dlerror());
goto handle_error;
}
extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
if (extensions == NULL) {
LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
driverName, dlerror());
goto handle_error;
}
for (i = 0; extensions[i]; i++) {
if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
extensions[i]->version >= __DRI_CORE_VERSION) {
screen->core = (const __DRIcoreExtension *) extensions[i];
}
if (strcmp(extensions[i]->name, __DRI_SWRAST) == 0 &&
extensions[i]->version >= __DRI_SWRAST_VERSION) {
screen->swrast = (const __DRIswrastExtension *) extensions[i];
}
}
if (screen->core == NULL || screen->swrast == NULL) {
LogMessage(X_ERROR, "AIGLX error: %s exports no DRI extension\n",
driverName);
goto handle_error;
}
screen->driScreen =
(*screen->swrast->createNewScreen)(pScreen->myNum,
loader_extensions,
&driConfigs,
screen);
if (screen->driScreen == NULL) {
LogMessage(X_ERROR, "AIGLX error: Calling driver entry point failed");
goto handle_error;
}
initializeExtensions(screen);
screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs);
__glXScreenInit(&screen->base, pScreen);
LogMessage(X_INFO,
"AIGLX: Loaded and initialized %s\n", filename);
return &screen->base;
handle_error:
if (screen->driver)
dlclose(screen->driver);
xfree(screen);
LogMessage(X_ERROR, "GLX: could not load software renderer\n");
return NULL;
}
__GLXprovider __glXDRISWRastProvider = {
__glXDRIscreenProbe,
"DRISWRAST",
NULL
};

View File

@ -107,6 +107,15 @@ static int ContextGone(__GLXcontext* cx, XID id)
*/
static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
{
ScreenPtr pScreen = glxPriv->pDraw->pScreen;
switch (glxPriv->type) {
case GLX_DRAWABLE_PIXMAP:
case GLX_DRAWABLE_PBUFFER:
(*pScreen->DestroyPixmap)((PixmapPtr) glxPriv->pDraw);
break;
}
glxPriv->pDraw = NULL;
glxPriv->drawId = 0;
__glXUnrefDrawable(glxPriv);
@ -270,6 +279,7 @@ void GlxExtensionInit(void)
ScreenPtr pScreen;
int i;
__GLXprovider *p;
Bool glx_provided = False;
__glXContextRes = CreateNewResourceType((DeleteType)ContextGone);
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
@ -280,6 +290,29 @@ void GlxExtensionInit(void)
if (!AddCallback (&ClientStateCallback, glxClientCallback, 0))
return;
for (i = 0; i < screenInfo.numScreens; i++) {
pScreen = screenInfo.screens[i];
for (p = __glXProviderStack; p != NULL; p = p->next) {
if (p->screenProbe(pScreen) != NULL) {
LogMessage(X_INFO,
"GLX: Initialized %s GL provider for screen %d\n",
p->name, i);
break;
}
}
if (!p)
LogMessage(X_INFO,
"GLX: no usable GL providers found for screen %d\n", i);
else
glx_provided = True;
}
/* don't register extension if GL is not provided on any screen */
if (!glx_provided)
return;
/*
** Add extension to server extensions.
*/
@ -297,19 +330,6 @@ void GlxExtensionInit(void)
}
__glXErrorBase = extEntry->errorBase;
for (i = 0; i < screenInfo.numScreens; i++) {
pScreen = screenInfo.screens[i];
for (p = __glXProviderStack; p != NULL; p = p->next) {
if (p->screenProbe(pScreen) != NULL) {
LogMessage(X_INFO,
"GLX: Initialized %s GL provider for screen %d\n",
p->name, i);
break;
}
}
}
}
/************************************************************************/

View File

@ -37,6 +37,7 @@
#include <dix-config.h>
#endif
#include <GL/glxtokens.h>
#include <string.h>
#include <windowstr.h>
#include <os.h>
@ -46,7 +47,6 @@
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
#include "glcontextmodes.h"
static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKey;
@ -110,7 +110,7 @@ static const char GLServerExtensions[] =
"GL_EXT_texture_env_add "
"GL_EXT_texture_env_combine "
"GL_EXT_texture_env_dot3 "
"GL_EXT_texture_filter_ansiotropic "
"GL_EXT_texture_filter_anisotropic "
"GL_EXT_texture_lod "
"GL_EXT_texture_lod_bias "
"GL_EXT_texture_mirror_clamp "
@ -280,10 +280,23 @@ void GlxSetVisualConfigs(int nconfigs,
* call it. */
}
GLint glxConvertToXVisualType(int visualType)
{
static const int x_visual_types[] = {
TrueColor, DirectColor,
PseudoColor, StaticColor,
GrayScale, StaticGray
};
return ( (unsigned) (visualType - GLX_TRUE_COLOR) < 6 )
? x_visual_types[ visualType - GLX_TRUE_COLOR ] : -1;
}
static void
filterOutNativeConfigs(__GLXscreen *pGlxScreen)
{
__GLcontextModes *m, *next, *native_modes, **last;
__GLXconfig *m, *next, **last;
ScreenPtr pScreen = pGlxScreen->pScreen;
int i, depth;
@ -305,12 +318,12 @@ filterOutNativeConfigs(__GLXscreen *pGlxScreen)
}
static XID
findVisualForConfig(ScreenPtr pScreen, __GLcontextModes *m)
findVisualForConfig(ScreenPtr pScreen, __GLXconfig *m)
{
int i;
for (i = 0; i < pScreen->numVisuals; i++) {
if (_gl_convert_to_x_visual_type(m->visualType) == pScreen->visuals[i].class)
if (glxConvertToXVisualType(m->visualType) == pScreen->visuals[i].class)
return pScreen->visuals[i].vid;
}
@ -405,12 +418,15 @@ findFirstSet(unsigned int v)
}
static void
initGlxVisual(VisualPtr visual, __GLcontextModes *config)
initGlxVisual(VisualPtr visual, __GLXconfig *config)
{
int maxBits;
maxBits = max(config->redBits, max(config->greenBits, config->blueBits));
config->visualID = visual->vid;
visual->class = _gl_convert_to_x_visual_type(config->visualType);
visual->bitsPerRGBValue = config->redBits;
visual->ColormapEntries = 1 << config->redBits;
visual->class = glxConvertToXVisualType(config->visualType);
visual->bitsPerRGBValue = maxBits;
visual->ColormapEntries = 1 << maxBits;
visual->nplanes = config->redBits + config->greenBits + config->blueBits;
visual->redMask = config->redMask;
@ -424,22 +440,25 @@ initGlxVisual(VisualPtr visual, __GLcontextModes *config)
typedef struct {
GLboolean doubleBuffer;
GLboolean depthBuffer;
GLboolean stencilBuffer;
} FBConfigTemplateRec, *FBConfigTemplatePtr;
static __GLcontextModes *
static __GLXconfig *
pickFBConfig(__GLXscreen *pGlxScreen, FBConfigTemplatePtr template, int class)
{
__GLcontextModes *config;
__GLXconfig *config;
for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) {
if (config->visualRating != GLX_NONE)
continue;
if (_gl_convert_to_x_visual_type(config->visualType) != class)
if (glxConvertToXVisualType(config->visualType) != class)
continue;
if ((config->doubleBufferMode > 0) != template->doubleBuffer)
continue;
if ((config->depthBits > 0) != template->depthBuffer)
continue;
if ((config->stencilBits > 0) != template->stencilBuffer)
continue;
return config;
}
@ -450,32 +469,40 @@ pickFBConfig(__GLXscreen *pGlxScreen, FBConfigTemplatePtr template, int class)
static void
addMinimalSet(__GLXscreen *pGlxScreen)
{
__GLcontextModes *config;
__GLXconfig *config;
VisualPtr visuals;
int i;
FBConfigTemplateRec best = { GL_TRUE, GL_TRUE };
FBConfigTemplateRec minimal = { GL_FALSE, GL_FALSE };
int i, j;
FBConfigTemplateRec best = { GL_TRUE, GL_TRUE, GL_TRUE };
FBConfigTemplateRec good = { GL_TRUE, GL_TRUE, GL_FALSE };
FBConfigTemplateRec minimal = { GL_FALSE, GL_FALSE, GL_FALSE };
pGlxScreen->visuals = xcalloc(pGlxScreen->pScreen->numVisuals,
sizeof (__GLcontextModes *));
sizeof (__GLXconfig *));
if (pGlxScreen->visuals == NULL) {
ErrorF("Failed to allocate for minimal set of GLX visuals\n");
return;
}
pGlxScreen->numVisuals = pGlxScreen->pScreen->numVisuals;
visuals = pGlxScreen->pScreen->visuals;
for (i = 0; i < pGlxScreen->numVisuals; i++) {
for (i = 0, j = 0; i < pGlxScreen->pScreen->numVisuals; i++) {
if (visuals[i].nplanes == 32)
config = pickFBConfig(pGlxScreen, &minimal, visuals[i].class);
else
else {
config = pickFBConfig(pGlxScreen, &best, visuals[i].class);
if (config == NULL)
config = pickFBConfig(pGlxScreen, &good, visuals[i].class);
}
if (config == NULL)
config = pGlxScreen->fbconfigs;
pGlxScreen->visuals[i] = config;
if (config == NULL)
continue;
pGlxScreen->visuals[j] = config;
config->visualID = visuals[i].vid;
j++;
}
pGlxScreen->numVisuals = j;
}
static void
@ -487,12 +514,12 @@ addTypicalSet(__GLXscreen *pGlxScreen)
static void
addFullSet(__GLXscreen *pGlxScreen)
{
__GLcontextModes *config;
__GLXconfig *config;
VisualPtr visuals;
int i, depth;
pGlxScreen->visuals =
xcalloc(pGlxScreen->numFBConfigs, sizeof (__GLcontextModes *));
xcalloc(pGlxScreen->numFBConfigs, sizeof (__GLXconfig *));
if (pGlxScreen->visuals == NULL) {
ErrorF("Failed to allocate for full set of GLX visuals\n");
return;
@ -522,7 +549,7 @@ void GlxSetVisualConfig(int config)
void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
{
__GLcontextModes *m;
__GLXconfig *m;
int i;
pGlxScreen->pScreen = pScreen;

View File

@ -40,8 +40,6 @@
**
*/
#include "GL/internal/glcore.h"
typedef struct {
void * (* queryHyperpipeNetworkFunc)(int, int *, int *);
void * (* queryHyperpipeConfigFunc)(int, int, int *, int *);
@ -57,6 +55,77 @@ typedef struct {
void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs);
void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs);
typedef struct __GLXconfig __GLXconfig;
struct __GLXconfig {
__GLXconfig *next;
GLuint doubleBufferMode;
GLuint stereoMode;
GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
GLuint redMask, greenMask, blueMask, alphaMask;
GLint rgbBits; /* total bits for rgb */
GLint indexBits; /* total bits for colorindex */
GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
GLint depthBits;
GLint stencilBits;
GLint numAuxBuffers;
GLint level;
GLint pixmapMode;
/* GLX */
GLint visualID;
GLint visualType; /**< One of the GLX X visual types. (i.e.,
* \c GLX_TRUE_COLOR, etc.)
*/
/* EXT_visual_rating / GLX 1.2 */
GLint visualRating;
/* EXT_visual_info / GLX 1.2 */
GLint transparentPixel;
/* colors are floats scaled to ints */
GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
GLint transparentIndex;
/* ARB_multisample / SGIS_multisample */
GLint sampleBuffers;
GLint samples;
/* SGIX_fbconfig / GLX 1.3 */
GLint drawableType;
GLint renderType;
GLint xRenderable;
GLint fbconfigID;
/* SGIX_pbuffer / GLX 1.3 */
GLint maxPbufferWidth;
GLint maxPbufferHeight;
GLint maxPbufferPixels;
GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */
GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */
/* SGIX_visual_select_group */
GLint visualSelectGroup;
/* OML_swap_method */
GLint swapMethod;
GLint screen;
/* EXT_texture_from_pixmap */
GLint bindToTextureRgb;
GLint bindToTextureRgba;
GLint bindToMipmapTexture;
GLint bindToTextureTargets;
GLint yInverted;
};
GLint glxConvertToXVisualType(int visualType);
/*
** Screen dependent data. These methods are the interface between the DIX
** and DDX layers of the GLX server extension. The methods provide an
@ -67,14 +136,14 @@ struct __GLXscreen {
void (*destroy) (__GLXscreen *screen);
__GLXcontext *(*createContext) (__GLXscreen *screen,
__GLcontextModes *modes,
__GLXconfig *modes,
__GLXcontext *shareContext);
__GLXdrawable *(*createDrawable)(__GLXscreen *context,
DrawablePtr pDraw,
int type,
XID drawId,
__GLcontextModes *modes);
__GLXconfig *modes);
int (*swapInterval) (__GLXdrawable *drawable,
int interval);
@ -84,11 +153,11 @@ struct __GLXscreen {
ScreenPtr pScreen;
/* Linked list of valid fbconfigs for this screen. */
__GLcontextModes *fbconfigs;
__GLXconfig *fbconfigs;
int numFBConfigs;
/* Subset of fbconfigs that are exposed as GLX visuals. */
__GLcontextModes **visuals;
__GLXconfig **visuals;
GLint numVisuals;
char *GLextensions;

View File

@ -42,14 +42,7 @@
#include <string.h>
#include "glxserver.h"
#include <GL/glxtokens.h>
#include <unpack.h>
#include <pixmapstr.h>
#include <windowstr.h>
#include "glxutil.h"
#include "GL/internal/glcore.h"
#include "GL/glxint.h"
#include "glcontextmodes.h"
/************************************************************************/
/* Context stuff */
@ -82,38 +75,40 @@ __glXDeassociateContext(__GLXcontext *glxc)
__GLXcontext *curr, *prev;
prev = NULL;
for ( curr = glxc->drawPriv->drawGlxc
; curr != NULL
; prev = curr, curr = curr->nextDrawPriv ) {
if (curr == glxc) {
/* found context. Deassociate. */
if (prev == NULL) {
glxc->drawPriv->drawGlxc = curr->nextDrawPriv;
} else {
prev->nextDrawPriv = curr->nextDrawPriv;
if (glxc->drawPriv) {
for ( curr = glxc->drawPriv->drawGlxc; curr != NULL
; prev = curr, curr = curr->nextDrawPriv ) {
if (curr == glxc) {
/* found context. Deassociate. */
if (prev == NULL) {
glxc->drawPriv->drawGlxc = curr->nextDrawPriv;
} else {
prev->nextDrawPriv = curr->nextDrawPriv;
}
curr->nextDrawPriv = NULL;
__glXUnrefDrawable(glxc->drawPriv);
break;
}
curr->nextDrawPriv = NULL;
__glXUnrefDrawable(glxc->drawPriv);
break;
}
}
}
prev = NULL;
for ( curr = glxc->readPriv->readGlxc
; curr != NULL
; prev = curr, curr = curr->nextReadPriv ) {
if (curr == glxc) {
/* found context. Deassociate. */
if (prev == NULL) {
glxc->readPriv->readGlxc = curr->nextReadPriv;
} else {
prev->nextReadPriv = curr->nextReadPriv;
}
curr->nextReadPriv = NULL;
__glXUnrefDrawable(glxc->readPriv);
break;
}
if (glxc->readPriv) {
for ( curr = glxc->readPriv->readGlxc
; curr != NULL
; prev = curr, curr = curr->nextReadPriv ) {
if (curr == glxc) {
/* found context. Deassociate. */
if (prev == NULL) {
glxc->readPriv->readGlxc = curr->nextReadPriv;
} else {
prev->nextReadPriv = curr->nextReadPriv;
}
curr->nextReadPriv = NULL;
__glXUnrefDrawable(glxc->readPriv);
break;
}
}
}
}
@ -140,13 +135,13 @@ __glXUnrefDrawable(__GLXdrawable *glxPriv)
GLboolean
__glXDrawableInit(__GLXdrawable *drawable,
__GLXscreen *screen, DrawablePtr pDraw, int type,
XID drawId, __GLcontextModes *modes)
XID drawId, __GLXconfig *config)
{
drawable->pDraw = pDraw;
drawable->type = type;
drawable->drawId = drawId;
drawable->refCount = 1;
drawable->modes = modes;
drawable->config = config;
drawable->eventMask = 0;
return GL_TRUE;

View File

@ -51,7 +51,7 @@ extern void __glXUnrefDrawable(__GLXdrawable *glxPriv);
extern GLboolean __glXDrawableInit(__GLXdrawable *drawable,
__GLXscreen *screen,
DrawablePtr pDraw, int type, XID drawID,
__GLcontextModes *modes);
__GLXconfig *config);
/* context helper routines */
extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag);

5889
glx/indirect_dispatch.c Normal file

File diff suppressed because it is too large Load Diff

1047
glx/indirect_dispatch.h Normal file

File diff suppressed because it is too large Load Diff

6051
glx/indirect_dispatch_swap.c Normal file

File diff suppressed because it is too large Load Diff

832
glx/indirect_reqsize.c Normal file
View File

@ -0,0 +1,832 @@
/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
/*
* (C) Copyright IBM Corporation 2005
* 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, sub license,
* 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* IBM,
* AND/OR THEIR 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.
*/
#include <GL/gl.h>
#include "glxserver.h"
#include "glxbyteorder.h"
#include "indirect_size.h"
#include "indirect_reqsize.h"
#define __GLX_PAD(x) (((x) + 3) & ~3)
#if defined(__CYGWIN__) || defined(__MINGW32__)
# undef HAVE_ALIAS
#endif
#ifdef HAVE_ALIAS
# define ALIAS2(from,to) \
GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
__attribute__ ((alias( # to )));
# define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )
#else
# define ALIAS(from,to) \
GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
{ return __glX ## to ## ReqSize( pc, swap ); }
#endif
int
__glXCallListsReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 0);
GLenum type = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
n = bswap_32(n);
type = bswap_32(type);
}
compsize = __glCallLists_size(type);
return __GLX_PAD((compsize * n));
}
int
__glXBitmapReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLsizei width = *(GLsizei *) (pc + 20);
GLsizei height = *(GLsizei *) (pc + 24);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
width = bswap_32(width);
height = bswap_32(height);
}
return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, width, height, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXFogfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 0);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glFogfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXLightfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glLightfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXLightModelfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 0);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glLightModelfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXMaterialfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glMaterialfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXPolygonStippleReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
}
return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, 32, 32, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXTexParameterfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glTexParameterfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXTexImage1DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 32);
GLenum format = *(GLenum *) (pc + 44);
GLenum type = *(GLenum *) (pc + 48);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXTexImage2DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 32);
GLsizei height = *(GLsizei *) (pc + 36);
GLenum format = *(GLenum *) (pc + 44);
GLenum type = *(GLenum *) (pc + 48);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
height = bswap_32(height);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXTexEnvfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glTexEnvfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXTexGendvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glTexGendv_size(pname);
return __GLX_PAD((compsize * 8));
}
int
__glXTexGenfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glTexGenfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXPixelMapfvReqSize(const GLbyte *pc, Bool swap)
{
GLsizei mapsize = *(GLsizei *) (pc + 4);
if (swap) {
mapsize = bswap_32(mapsize);
}
return __GLX_PAD((mapsize * 4));
}
int
__glXPixelMapusvReqSize(const GLbyte *pc, Bool swap)
{
GLsizei mapsize = *(GLsizei *) (pc + 4);
if (swap) {
mapsize = bswap_32(mapsize);
}
return __GLX_PAD((mapsize * 2));
}
int
__glXDrawPixelsReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLsizei width = *(GLsizei *) (pc + 20);
GLsizei height = *(GLsizei *) (pc + 24);
GLenum format = *(GLenum *) (pc + 28);
GLenum type = *(GLenum *) (pc + 32);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
width = bswap_32(width);
height = bswap_32(height);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, 0, width, height, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXPrioritizeTexturesReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 0);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 4) + (n * 4));
}
int
__glXTexSubImage1DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 36);
GLenum format = *(GLenum *) (pc + 44);
GLenum type = *(GLenum *) (pc + 48);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXTexSubImage2DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 36);
GLsizei height = *(GLsizei *) (pc + 40);
GLenum format = *(GLenum *) (pc + 44);
GLenum type = *(GLenum *) (pc + 48);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
height = bswap_32(height);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXColorTableReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 28);
GLenum format = *(GLenum *) (pc + 32);
GLenum type = *(GLenum *) (pc + 36);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXColorTableParameterfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glColorTableParameterfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXColorSubTableReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei count = *(GLsizei *) (pc + 28);
GLenum format = *(GLenum *) (pc + 32);
GLenum type = *(GLenum *) (pc + 36);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
count = bswap_32(count);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, count, 1, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXConvolutionFilter1DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 28);
GLenum format = *(GLenum *) (pc + 36);
GLenum type = *(GLenum *) (pc + 40);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXConvolutionFilter2DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
GLint skip_images = 0;
GLint skip_rows = *(GLint *) (pc + 8);
GLint alignment = *(GLint *) (pc + 16);
GLenum target = *(GLenum *) (pc + 20);
GLsizei width = *(GLsizei *) (pc + 28);
GLsizei height = *(GLsizei *) (pc + 32);
GLenum format = *(GLenum *) (pc + 36);
GLenum type = *(GLenum *) (pc + 40);
if (swap) {
row_length = bswap_32(row_length);
skip_rows = bswap_32(skip_rows);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
height = bswap_32(height);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, 1,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXConvolutionParameterfvReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glConvolutionParameterfv_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXTexImage3DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = *(GLint *) (pc + 8);
GLint skip_rows = *(GLint *) (pc + 16);
GLint skip_images = *(GLint *) (pc + 20);
GLint alignment = *(GLint *) (pc + 32);
GLenum target = *(GLenum *) (pc + 36);
GLsizei width = *(GLsizei *) (pc + 48);
GLsizei height = *(GLsizei *) (pc + 52);
GLsizei depth = *(GLsizei *) (pc + 56);
GLenum format = *(GLenum *) (pc + 68);
GLenum type = *(GLenum *) (pc + 72);
if (swap) {
row_length = bswap_32(row_length);
image_height = bswap_32(image_height);
skip_rows = bswap_32(skip_rows);
skip_images = bswap_32(skip_images);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
height = bswap_32(height);
depth = bswap_32(depth);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, depth,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap)
{
GLint row_length = *(GLint *) (pc + 4);
GLint image_height = *(GLint *) (pc + 8);
GLint skip_rows = *(GLint *) (pc + 16);
GLint skip_images = *(GLint *) (pc + 20);
GLint alignment = *(GLint *) (pc + 32);
GLenum target = *(GLenum *) (pc + 36);
GLsizei width = *(GLsizei *) (pc + 60);
GLsizei height = *(GLsizei *) (pc + 64);
GLsizei depth = *(GLsizei *) (pc + 68);
GLenum format = *(GLenum *) (pc + 76);
GLenum type = *(GLenum *) (pc + 80);
if (swap) {
row_length = bswap_32(row_length);
image_height = bswap_32(image_height);
skip_rows = bswap_32(skip_rows);
skip_images = bswap_32(skip_images);
alignment = bswap_32(alignment);
target = bswap_32(target);
width = bswap_32(width);
height = bswap_32(height);
depth = bswap_32(depth);
format = bswap_32(format);
type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, depth,
image_height, row_length, skip_images,
skip_rows, alignment);
}
int
__glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei imageSize = *(GLsizei *) (pc + 20);
if (swap) {
imageSize = bswap_32(imageSize);
}
return __GLX_PAD(imageSize);
}
int
__glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei imageSize = *(GLsizei *) (pc + 24);
if (swap) {
imageSize = bswap_32(imageSize);
}
return __GLX_PAD(imageSize);
}
int
__glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei imageSize = *(GLsizei *) (pc + 28);
if (swap) {
imageSize = bswap_32(imageSize);
}
return __GLX_PAD(imageSize);
}
int
__glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei imageSize = *(GLsizei *) (pc + 36);
if (swap) {
imageSize = bswap_32(imageSize);
}
return __GLX_PAD(imageSize);
}
int
__glXProgramStringARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei len = *(GLsizei *) (pc + 8);
if (swap) {
len = bswap_32(len);
}
return __GLX_PAD(len);
}
int
__glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 0);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 4));
}
int
__glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap)
{
GLenum pname = *(GLenum *) (pc + 0);
GLsizei compsize;
if (swap) {
pname = bswap_32(pname);
}
compsize = __glPointParameterfvEXT_size(pname);
return __GLX_PAD((compsize * 4));
}
int
__glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap)
{
GLuint num = *(GLuint *) (pc + 8);
if (swap) {
num = bswap_32(num);
}
return __GLX_PAD((num * 32));
}
int
__glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap)
{
GLuint num = *(GLuint *) (pc + 8);
if (swap) {
num = bswap_32(num);
}
return __GLX_PAD((num * 16));
}
int
__glXVertexAttribs1dvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 8));
}
int
__glXVertexAttribs2dvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 16));
}
int
__glXVertexAttribs3dvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 24));
}
int
__glXVertexAttribs3fvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 12));
}
int
__glXVertexAttribs3svNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 6));
}
int
__glXVertexAttribs4dvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
n = bswap_32(n);
}
return __GLX_PAD((n * 32));
}
int
__glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap)
{
GLsizei len = *(GLsizei *) (pc + 4);
if (swap) {
len = bswap_32(len);
}
return __GLX_PAD(len);
}
ALIAS(Fogiv, Fogfv)
ALIAS(Lightiv, Lightfv)
ALIAS(LightModeliv, LightModelfv)
ALIAS(Materialiv, Materialfv)
ALIAS(TexParameteriv, TexParameterfv)
ALIAS(TexEnviv, TexEnvfv)
ALIAS(TexGeniv, TexGenfv)
ALIAS(PixelMapuiv, PixelMapfv)
ALIAS(ColorTableParameteriv, ColorTableParameterfv)
ALIAS(ConvolutionParameteriv, ConvolutionParameterfv)
ALIAS(CompressedTexSubImage1DARB, CompressedTexImage1DARB)
ALIAS(CompressedTexSubImage2DARB, CompressedTexImage3DARB)
ALIAS(LoadProgramNV, ProgramStringARB)
ALIAS(RequestResidentProgramsNV, DrawBuffersARB)
ALIAS(VertexAttribs1fvNV, PixelMapfv)
ALIAS(VertexAttribs1svNV, PixelMapusv)
ALIAS(VertexAttribs2fvNV, VertexAttribs1dvNV)
ALIAS(VertexAttribs2svNV, PixelMapfv)
ALIAS(VertexAttribs4fvNV, VertexAttribs2dvNV)
ALIAS(VertexAttribs4svNV, VertexAttribs1dvNV)
ALIAS(VertexAttribs4ubvNV, PixelMapfv)
ALIAS(PointParameterivNV, PointParameterfvEXT)
ALIAS(ProgramNamedParameter4dvNV, CompressedTexSubImage3DARB)
ALIAS(DeleteFramebuffersEXT, DrawBuffersARB)
ALIAS(DeleteRenderbuffersEXT, DrawBuffersARB)

Some files were not shown because too many files have changed in this diff Show More