Commit Graph

356 Commits

Author SHA1 Message Date
Jeremy Huddleston
78d39b3222 Revert "glx: don't leak fbconfigs"
This reverts commit d26fae246d.

This patch free()s memory in __glXScreenDestroy which was allocated in
glxdricommon (which isn't in every DDX).  That breaks abstraction and
causes a crash when XQuartz quits, because it results in freeing a pointer
that was never allocated.

The correct fix is to do this cleanup in __glXDRIscreenDestroy.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-01-15 02:28:07 -08:00
Keith Packard
5037c9af78 glx/glapioffsets.h is no longer part of the build, remove it
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-27 14:02:39 -08:00
Keith Packard
e4b4d83fad Merge remote-tracking branch 'idr/glx-fixes' 2011-12-19 22:36:31 -08:00
Ville Syrjälä
4df65d247b dri2: Invalidate window pixmaps
While a redirected window is flipped, its pixmap may still be used as
and EGL image and should also get invalidated. When sending invalidate
events for a window, also send the events for its pixmap.

Signed-off-by: Ville Syrjälä <syrjala@sci.fi>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-19 22:32:33 -08:00
Ian Romanick
d26cb70272 glx: use dispatch.h instead of glapioffsets.h
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-19 13:38:50 -08:00
Ian Romanick
66e6037c33 glx: Regenerate GL API files from Mesa
Adam reviewed the underlying changes in the Mesa generated scripts.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-19 13:38:50 -08:00
Ian Romanick
e8485768c1 glx: Add stub implementations of next GLX extension functions
Generated code from Mesa contains dispatch for GLX_ARB_create_context
and GLX_ARB_create_context_profile.  Provide stub implementations of
these functions so that the GLX extension will link.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-19 13:38:49 -08:00
Ian Romanick
2df539c0bc glx: Only declare GlxExtensionInit in one header file
This silences the GCC warning:

In file included from singlepixswap.c:36:0:
glxext.h:47:13: warning: redundant redeclaration of 'GlxExtensionInit' [-Wredundant-decls]
glxserver.h:80:6: note: previous declaration of 'GlxExtensionInit' was here

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-19 13:38:46 -08:00
Paulo Zanoni
0ae087e131 glx: don't leak driConfigs
For dri, dri2 and driswrast.

12,968 (584 direct, 12,384 indirect) bytes in 1 blocks are definitely lost in loss record 569 of 570
   at 0x4C2779D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x7821E3B: driConcatConfigs (utils.c:560)
   by 0x7827CF2: dri_fill_in_modes (dri_screen.c:224)
   by 0x782831E: dri_init_screen_helper (dri_screen.c:405)
   by 0x7826C03: drisw_init_screen (drisw.c:266)
   by 0x782225F: driCreateNewScreen (drisw_util.c:69)
   by 0x4826E2: __glXDRIscreenProbe (glxdriswrast.c:451)
   by 0x4812FA: GlxExtensionInit (glxext.c:327)
   by 0x41FB14: InitExtensions (miinitext.c:471)
   by 0x568622: main (main.c:208)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-24 17:40:01 -02:00
Paulo Zanoni
d26fae246d glx: don't leak fbconfigs
29,952 (208 direct, 29,744 indirect) bytes in 1 blocks are definitely lost in loss record 573 of 573
   at 0x4C2779D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4829BC: createModeFromConfig (glxdricommon.c:131)
   by 0x482C09: glxConvertConfigs (glxdricommon.c:185)
   by 0x482788: __glXDRIscreenProbe (glxdriswrast.c:468)
   by 0x4812FA: GlxExtensionInit (glxext.c:327)
   by 0x41FB14: InitExtensions (miinitext.c:471)
   by 0x568636: main (main.c:208)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-24 17:40:01 -02:00
Paulo Zanoni
305a8bcb2f glx: fix memory leak when destroying screen
1,152 bytes in 1 blocks are definitely lost in loss record 536 of 575
   at 0x4C25E84: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x483820: __glXScreenInit (glxscreens.c:357)
   by 0x48271C: __glXDRIscreenProbe (glxdriswrast.c:469)
   by 0x4812BE: GlxExtensionInit (glxext.c:327)
   by 0x41FB14: InitExtensions (miinitext.c:471)
   by 0x5685AE: main (main.c:208)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-24 17:40:01 -02:00
Alan Coopersmith
71a89d9733 Convert glx/single2.c:DoGetString() to use asprintf()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Matt Turner
40a47bd628 Remove unnecessary #undefs of [f]abs and old comments
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21 17:12:04 -04:00
Jon TURNEY
42bc198775 glx: Remove a few lingering traces of __GLXscreen.GLXVersion
The GLXversion member of the __GLXscreen struct
is just cruft since commit ad5c0d9efa,
when we started returning the minimum GLX version supported by all
of the screens on the display, rather than the maximum version supported
by the server.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:09:21 +01:00
Keith Packard
61f87a75f2 Merge remote-tracking branch 'jturney/master' 2011-06-29 20:14:51 -07:00
Keith Packard
0d2153a46c Merge remote-tracking branch 'jbarnes/master' 2011-06-29 20:08:32 -07:00
Jon TURNEY
1d7f3a0031 glx: Move GLX extension string utility functions
Move GLX extension string utility functions from the DRI1 convenience library
into the GLX extension convenience library, so other DDX which don't have DRI
can use them.

This is probably also needed if anyone actually tries to build an Xorg DDX
with only DRI2 support...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2011-06-29 19:09:23 +01:00
Jesse Barnes
932513e23b DRI2/GLX: use new swap event types
Use the new event types so we can pass a valid SBC value to clients.
Fix up the completion calls to use CARD32 instead of CARD64 to match
the new field size.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-06-29 11:05:36 -07:00
Jesse Barnes
a3cb7d097a GLX/DRI2: pass drawable correctly for indirect swap events
Pass the right drawable pointer as data to the swap complete function.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-06-29 10:56:43 -07:00
Adam Jackson
3e8270b869 glx: Fix fbconfigs with no corresponding visual
There are, in general, more fbconfig depths than visual depths.
fbconfigs need not support Window rendering, however any that do must
have an associated visual ID (which we got right), and any that do not
must not claim GLX_WINDOW_BIT in GLX_DRAWABLE_TYPE (which we got
wrong).

Fixes piglit/glx-fbconfig-sanity, assuming you have a sufficiently
recent piglit, as that test formerly wrongly required pixmap-capable
fbconfigs to have a visual.

v2: Additional check for fbconfigs that didn't have GLX_WINDOW_BIT in
    the first place, from previous patch by Jon TURNEY; also, also clear
    ->visualID.

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-29 18:22:18 +01:00
Jon TURNEY
38d55f06cf Guard use of backtrace() with HAVE_BACKTRACE
Guard the use of backtrace() with HAVE_BACKTRACE, since we already
have the autoconf machinery for setting that.

For the moment, assume dladdr() is available when backtrace() is

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-28 13:07:20 -07:00
Jeremy Huddleston
ecec578e35 glx: Add _glapi_create_table_from_handle
_glapi_create_table_from_handle was recently added to mesa to ease creation of
a _glapi_table.  This commit brings this API over to xserver for use in
XQuartz (next commit).

The API was generated with scripts from current mesa followed by various
script-foo to remove entries that are not in the server and add those which
are still in the server but not in mesa (CullParameterdvEXT and
CullParameterfvEXT)

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-06-15 14:00:35 -07:00
Keith Packard
5cb31cd0cb Merge remote-tracking branch 'jturney/remove-opengl-spec-download' 2011-04-29 09:59:49 -07:00
Keith Packard
ec9ea40178 Merge remote-tracking branch 'jeremyhu/master' 2011-04-27 12:01:56 -07:00
Jon TURNEY
c5a612fc18 configure: Let configure --enable/disable-aiglx control building of AIGLX for all DDXs
Let configure --enable/disable-aiglx control building of AIGLX for all DDXs. Currently
we can't use --enable/disable-aiglx to control if Xwin DDX is built with AIGLX enabled,
as at the moment it's forced off if we aren't building the X.Org DDX DRI or DRI2 loader

Rearrange things a bit, introducing a new automake conditional, AIGLX_DRI_LOADER to
specifically indicate if the X.Org DDX DRI/DRI2 loader convenience library should be
built, and replace the previous X.Org DDX-specific uses of the AIGLX conditional with that

As before, AIGLX_DRI_LOADER is only enabled if --enable-glx, --enable-aiglx and at least one
of --enable-dri or --enable-dri2 are enabled

This allows the general conditional AIGLX to control if AIGLX is built for the XWin DDX as
well

The C #define AIGLX set by AC_DEFINE(AIGLX) seems to be obsolete, I can't find anything
which checks it

Updated for ajax's "glx: Make --disable-dri not disable AIGLX" patch, which allows DRI2
to be enabled independently of DRI1

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-26 10:40:56 +01:00
Jeremy Huddleston
bb4d145bd2 glx: Silence warnings when building with clang
This replaces AX_TLS (GPL3) with XORG_TLS (MIT)

In file included from glapi.c:46:
In file included from ./glapi.h:51:
./glthread.h:237:20: error: unknown attribute 'tls_model' ignored [-Werror,-Wunknown-attributes]
    __attribute__((tls_model("initial-exec")));
                   ^
In file included from glapi.c:46:
./glapi.h:92:20: error: unknown attribute 'tls_model' ignored [-Werror,-Wunknown-attributes]
    __attribute__((tls_model("initial-exec")));
                   ^
glapi.c:82:20: error: unknown attribute 'tls_model' ignored [-Werror,-Wunknown-attributes]
    __attribute__((tls_model("initial-exec"))) = NULL;
                   ^
glapi.c:85:20: error: unknown attribute 'tls_model' ignored [-Werror,-Wunknown-attributes]
    __attribute__((tls_model("initial-exec")));
                   ^
4 errors generated.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jamey Sharp <jamey@minilop.net>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-25 18:56:56 -07:00
Søren Sandmann Pedersen
61a92a78cd Add RegionInitBoxes(), and fix some buggy callers of RegionInit().
The interface to RegionInit():

    RegionInit (RegionPtr pReg, BoxPtr rect, int size);

is very confusing because it doesn't take a list of boxes, it takes
*one* box, but if that box is NULL, it initializes an empty region
with 'size' rectangles preallocated.

Most callers of this function were correctly passing either NULL or
just one box, but there were three confused cases, where the code
seems to expect a region to be created from a list of boxes.

This patch adds a new function RegionInitBoxes() and fixes those
instances to call that instead.

And yes, the pixman function to initialize a region from a list of
boxes is called init_rects() because pixman is also awesome.

V2: Make RegionInitBoxes() return a Bool indicating whether the call
    succeeded, and fix the callers to check this return value.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2011-04-22 21:39:31 -04:00
Adam Jackson
001b6b8b70 glx: Make --disable-dri not disable AIGLX
Either the DRI1 or DRI2 loaders are sufficient.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-04-15 17:47:20 -04:00
Adam Jackson
f8540b9dcc glx: Use 0 rather than garbage for unknown INTEL_swap_event types
Otherwise the garbage you return could well be numerically identical to
one of the swap type tokens, and apps which rely on us to tell the truth
would be in trouble.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-04-15 12:57:05 -04:00
Adam Jackson
6a433b67ca glx: Fix lifetime tracking for pixmaps
GLX pixmaps take a reference on the underlying pixmap; X and GLX pixmap
IDs can be destroyed in either order with no error.  Only windows need
to be tracked under both XIDs.

Fixes piglit/glx-pixmap-life.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-04-15 12:55:47 -04:00
Adam Jackson
3e0b311aba glx: minor cast cleanup
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Adam Jackson
501506cf9d glx: dead variable removal
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Adam Jackson
10317682e2 glx: Remove some obfuscatory macros
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Adam Jackson
c327d07cc6 glx: Remove ->forceCurrent from the context vtable
All the implementations of makeCurrent and forceCurrent are identical,
so just use makeCurrent everywhere.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Adam Jackson
a48dadc98a glx: Reimplement context tags
This would let you do a constant-time context lookup, but if that's your
performance problem you have two problems.  Just use the context's XID
as the tag value instead.

In order to do this, we have to defer destroying a context until it
actually goes unreferenced, as you're allowed to mention a context tag
after you've (ostensibly) destroyed the context, as long as it's still
your current context.  Thus, change DestroyContext to merely mark the
context as dead if it's a current context, and call down to actual
resource destruction (and XID reclamation) in StopUsingContext.

Also, stop trying to delete context state from DrawableGone.  This was
always broken, as GLX does not say that contexts are destroyed when
their drawables are destroyed.  But with the above change to defer
context destruction, this would trigger a server crash on client exit as
we'd free the context state twice.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Adam Jackson
30d6947cee glx: Fix _glapi_add_dispatch
We never need to generate stubs, because those conditions can't happen
in the server.  Yank that code out, but keep the bookkeeping for which
extension functions are registered so the DRI driver doesn't get
confused.

As a pleasant bonus, we're now friendlier for environments like selinux
that make runtime code generation difficult, and we're portable to more
arches since we don't have to port the assembly stubs.

Fixes the following clutter conformance tests (indirect rendering,
llvmpipe driver):

    test-cogl-backface-culling
    test-cogl-materials
    test-cogl-readpixels
    test-cogl-texture-mipmaps
    test-cogl-texture-get-set-data
    test-cogl-viewport
    test-cogl-offscreen

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Adam Jackson
0cb44cec7b glx: Flatten -DXFree86Server
Always defined by the makefile, so, just get rid of it.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Adam Jackson
ed6c13c01e glx: Update some glapi comments
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Adam Jackson
17d9e37472 glx: Lobotomize _glapi_get_proc_address
This isn't a meaningful thing in the indirect glx loader, so just warn
if it ever happens and move on.

But also, mark it PUBLIC, so if the driver does ever call it we merely
warn instead of aborting because ld.so can't find the symbol.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Adam Jackson
b0c665ac0f glx: Remove noop dispatch table
We can never hit this, because the indirect GLX dispatch code always
forces a current context and checks that it's non-NULL before calling
into the dispatch table.  If it's _not_ null, then _glapi_set_context
will call into the driver, which is responsible for calling
_glapi_set_dispatch to make sure the dispatch table is non-NULL.

Also remove _glapi_set_warning_func and friends, since we can no longer
call them even from dead code.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Jeremy Huddleston
c55baebf4e GLX: Support TLS with better portability
AX_TLS detects when toolchains support __thread or __declspec(thread),
but existing code assumed __thread.

This also adds a check to configure.ac to error out if TLS is requested
but unsupported.

Found-by: Tinderbox
http://tinderbox.x.org/builds/2011-03-22-0007

Regression-from: 82b1eaa6ca

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Tom Fogal <tfogal@alumni.unh.edu>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-03-23 09:11:33 -07:00
Christopher James Halse Rogers
7ca75abbbd glx: Use PATH_MAX as size of filename buffer
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2011-03-14 13:42:55 -04:00
Christopher James Halse Rogers
021393d1b8 glx: Factor out glxProbeDriver function.
DRI, DRI2 and swrast all had near-identical driver probing logic.
Pull it into glxdricommon.

[ajax: warning fix]
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2011-03-14 13:42:32 -04:00
Adam Jackson
1ad9f01c31 glx: Add texbuffer2 support to swrast
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-14 13:13:58 -04:00
Adam Jackson
b73ebe65cd glx: Remove unused _glapi_get_proc_name
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:25:15 -05:00
Adam Jackson
4377288abd glx: Simplify _glapi_check_multithread
We can guarantee that the X server does not call DRI driver services
from multiple threads, so _glapi_check_multithread need never do
anything special.  As a result, ThreadSafe is always false, so remove it
and simplify expressions where it appeared to match.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:25:04 -05:00
Adam Jackson
d5e8bb2150 glx: unifdef BEOS_THREADS
We don't support BeOS, so, no.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:24:38 -05:00
Adam Jackson
3692ff0b35 glx: unifdef USE_XTHREADS
xthreads is an ancient wrapper around a half dozen or so common thread
APIs, including pthreads.  Just use pthreads directly if you have it; if
you don't, get with the times.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:22:09 -05:00
Adam Jackson
2371b44f9e glx: unifdef SOLARIS_THREADS
Solaris 7 and older are not supported; Solaris 8 and later have (and
use) pthreads.

Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:22:01 -05:00
Adam Jackson
a5fdd1aa06 glx: Remove unused _glapi_get_proc_offset and friends
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:21:56 -05:00
Julien Cristau
402b329c3a glx: Work around wrong request lengths sent by mesa
mesa used to send too long requests for GLXDestroyPixmap,
GLXDestroyWindow, GLXChangeDrawableAttributes, GLXGetDrawableAttributes
and GLXGetFBConfigsSGIX.

Fixes a regression introduced in ec9c97c6bf
X.Org bug#33324 <https://bugs.freedesktop.org/show_bug.cgi?id=33324>

Reported-by: xunx.fang@intel.com
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-02-15 12:19:59 +01:00
Julien Cristau
1137c11be0 glx: fix BindTexImageEXT length check
The request is followed by a list of attributes.

X.Org bug#33449

Reported-and-tested-by: meng <mengmeng.meng@intel.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-02-15 12:19:59 +01:00
Julien Cristau
a883cf1545 glx: fix request length check for CreateGLXPbufferSGIX
The request is followed by an attribute list.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-02-15 12:19:59 +01:00
Julien Cristau
d9225b9602 glx: validate numAttribs field before using it
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10 15:36:09 +01:00
Julien Cristau
62319e8381 glx: swap the request arrays entirely, not just half of them
Various glx requests include a list of pairs of attributes.  We were
only swapping the first half.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10 15:36:01 +01:00
Julien Cristau
6c69235a9d glx: check request length before swapping
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10 15:31:40 +01:00
Julien Cristau
ec9c97c6bf glx: validate request lengths
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10 15:31:30 +01:00
Julien Cristau
3f0d3f4d97 glx: make sure screen is non-negative in validGlxScreen
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10 15:31:12 +01:00
Adam Jackson
63ccaec2c3 glx: warning fixes
render2.c: In function ‘__glXDisp_Map2d’:
render2.c:127: warning: ‘u1’ may be used uninitialized in this function
render2.c: In function ‘__glXDisp_Map1d’:
render2.c:90: warning: ‘u1’ may be used uninitialized in this function

Remove unnecessary test, and change memcpy to memmove as all users were
doing overlapping copies.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31 12:52:24 +00:00
Daniel Stone
32c85ad4b8 GLX: DRI2: Fix mismatched-types warning
All the DRI extension types have a base extension type as their first
member to avoid exactly these types of warning.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
2010-12-31 12:36:44 +00:00
Adam Jackson
a80780a763 glx: Remove swap barrier and hyperpipe support
Never implemented in any open source driver.  The implementation
assumed explicit DDX driver knowledge of how the client-side driver
worked, since at the time the server's GL renderer was not a DRI driver.
But now, it is, so any implementation of these should be done with
additional DRI driver API, like the swap control extension.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 12:54:47 -05:00
Keith Packard
4ed4915bc0 Merge remote branch 'whot/for-keith' 2010-11-10 16:58:21 -08:00
Eric Anholt
f36153e3ef Replace usage of DamageRegionAppend with DamageDamageRegion to fix reportAfter.
In all these cases, any rendering implied by this damage has already
occurred, and we want to get the damage out to the client.  Some of
the DamageRegionAppend calls were explicitly telling damage to flush
the reportAfter damage out, but not all.

Bug #30260. Fixes the compiz wallpaper plugin with client damage
changed to reportAfter.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-10 15:51:03 -08:00
Cyril Brulebois
68e4a628d6 Remove more superfluous if(p!=NULL) checks around free(p).
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@
- if (E != NULL) {
-   free(E);
- }
+ free(E);

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11 08:30:26 +10:00
Cyril Brulebois
b142b0d274 Remove more superfluous if(p!=NULL) checks around free(p).
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@
- if (E != NULL)
-   free(E);
+ free(E);

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11 08:29:54 +10:00
Kristian Høgsberg
2f0abd7d69 glx: Fix use after free in DrawableGone
(note that nearly identical patches were proposed by Kristian and Chris)

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-28 08:01:28 -07:00
Jamey Sharp
0f48e362c5 glxdriswrast: Use CreateGC, not CreateScratchGC.
Since this code was using CreateScratchGC and not GetScratchGC,
FreeScratchGC would always call FreeGC, so just call it directly.

As long as the drawable provided to CreateGC has the same screen and
depth as were passed to CreateScratchGC, these functions are basically
identical. There are two differences:

- CreateGC gives you a non-null stipple. You probably don't care.

- CreateGC passes the gcid and client to XACE. There are several
  internal GCs allocated in the server, and they all pass 0 and
  serverClient. I expect XACE will never reject that combination.

The callers of createDrawable all verify that pDraw has the same screen
that driScreen does. In short, this should have no behavioral change.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-09-13 15:58:08 -07:00
Chris Wilson
7e58178060 glx: Prevent NULL context deref in __glXGetDrawable() (bug 29184)
During a SwapBuffers request, we may end up querying an unknown drawable
outside of an active context, and so need to report this error prior to
attempting to dereference the NULL context.

Also fixes:

  [Bug 29184] glXSwapBuffers with no GLX context crashes X.
  https://bugs.freedesktop.org/show_bug.cgi?id=29184

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-08-19 18:03:11 -07:00
Keith Packard
d75e8146c4 Unwrap/rewrap EnterVT/LeaveVT completely, Fixes 28998
Because some EnterVT code needs to remove it self from the
call chain, we need to fix all of the wrappers to correctly
unwrap/rewrap during the call chain. This is a follow-on to the fix
for bug 27114 in commit 68a9ee8370.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Jesse Barnes <jesse.barnes@intel.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-07-13 09:58:04 -07:00
Dave Airlie
c6bc52cb66 dri2: avoid crash with old dri drivers.
I built latest server and copied over a mesa 7.8 dri2 driver to use with it,
and it crashed in here starting compiz. Looks like we need to validate the
flush extension is registered before calling invalidate.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-22 11:40:15 -07:00
Mikhail Gusarov
6592db6bb5 Get rid of xstrdup when argument is definitely non-NULL
Replace xstrdup with strdup when either constant string is
being duplicated or argument is guarded by conditionals and
obviously can't be NULL

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-11 19:04:23 +07:00
Jamey Sharp
353e32d371 glxdriswrast bugfix: configure swapgc, not gc.
I got this wrong in e2929db7b7.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10 06:50:47 -07:00
Mikhail Gusarov
7287ef9e6c Remove unnecessary parentheses around return values in functions
This patch was generated by the following Perl code:

perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;'

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10 06:42:42 -07:00
Mikhail Gusarov
0a4d8cbdcd Remove more superfluous if(p) checks around free(p)
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@

-if(E) { free(E); }
+free(E);

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06 20:27:18 +07:00
Keith Packard
faeebead7b Change the devPrivates API to require dixRegisterPrivateKey
This patch only changes the API, not the implementation of the
devPrivates infrastructure. This will permit a new devPrivates
implementation to be layed into the server without requiring
simultaneous changes in every devPrivates user.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05 19:23:03 -07:00
Keith Packard
2dc138922b Rename region macros to eliminate screen argument
This is a combination of a huge mechanical patch and a few small
fixups required to finish the job. They were reviewed separately, but
because the server does not build without both pieces, I've merged
them together at this time.

The mechanical changes were performed by running the included
'fix-region' script over the whole tree:

$ git ls-files | grep -v '^fix-' | xargs ./fix-region

And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.

$ sh ./fix-patch-whitespace

Thanks to Jamey Sharp for the mighty fine sed-generating sed script.

The hand-done changes involve removing functions from dix/region.c
that duplicate inline functions in include/regionstr.h, along with
their declarations in regionstr.h, mi.h and mispans.h.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 18:59:00 -07:00
Jamey Sharp
8033fb6c97 Set event sequence number in WriteEventsToClient instead of at callers.
TryClientEvents already did this; this commit just moves the assignment
one level down so that no event source has to worry about sequence
numbers.

...No event source, that is, except XKB, which inexplicably calls
WriteToClient directly for several events.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:34 -07:00
Jamey Sharp
92ed75ac59 Eliminate boilerplate around client->noClientException.
Just let Dispatch() check for a noClientException, rather than making
every single dispatch procedure take care of it.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-05-13 17:14:07 -07:00
Jamey Sharp
a3d948ddbb clientErrorValue is never used outside dix. Stop importing it.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:14:07 -07:00
Jamey Sharp
6a84cd9434 Replace dixChangeGC with calls directly to the right variant.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:14:07 -07:00
Jamey Sharp
e2929db7b7 dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.
The exceptions are ProcChangeGC and CreateGC.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:13:48 -07:00
Kristian Høgsberg
421606a8ef dri2: Send out event when auxillary buffers are invalidated
This lets the DRI2 clients rely on the server to notify them when they
need to get new buffers.  Without this, OpenGL clients poll the server
in glViewport() which can be a performance problems and also isn't
completely correct behaviour.

We bump the DRI2 protocol minor to indicate the availability of the
event, which the DRI2 clients can use to avoid polling.  This speeds up
various piglit and oglc test cases as well as real applications.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13 06:32:04 -07:00
Mikhail Gusarov
3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Kristian Høgsberg
9de0e31746 dri2: Take an XID for tracking the DRI2 drawable
Some pixmaps (window pixmaps and scratch pixmaps) don't have the
drawable->id set and thus DRI2 gets confused when using that field
for looking up the DRI2 drawable.  Go back to using privates for getting
at the DRI2 drawable from a DrawablePtr.  We need to keep the resource
tracking in place so we can remove the DRI2 drawable when the X resource
it was created for goes away.  Additionally, we also now track the DRI2
drawable using a client XID so we can reclaim the DRI2 drawable even if
the client goes before the drawable and doesn't destroy the DRI2 drawable.

Tested-by: Owen W. Taylor <otaylor@fishsoup.net>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-05-11 11:01:35 -04:00
Kristian Høgsberg
4a8a615d01 glxdri2: Hard-code the extension version we need
If we use the #define'd version from dri_interface.h, the server will
require at least that version of the extension.  If we're compiling against
a dri_interface.h with a newer version we don't really require, glxdri2
will require a too high version of the extension.

The right approach is to just hard-code the version we need instead of
using the #defines.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-11 11:01:35 -04:00
Jamey Sharp
35761d5f81 Introduce dixLookupFontable for "FONT or GC" parameters.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07 21:56:36 -07:00
Kristian Høgsberg
a92b2c2c8d glx: Drop DestroyWindow hook
Now that glx doesn't call DRI2DestroyDrawable anymore, we don't need to
force a specific resource destruction order in the DestroyWindow hook.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Michel Dänzer <michel@daenzer.net>

https://bugs.freedesktop.org/show_bug.cgi?id=26394
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-16 14:53:35 -07:00
Kristian Høgsberg
1da1f33f2d DRI2: Track DRI2 drawables as resources, not privates
The main motivation here is to have the resource system clean up the
DRI2 drawable automatically so glx doesn't have to.  Right now, the
glx drawable resource must be destroyed before the X drawable, so that
calling DRI2DestroyDrawable doesn't crash.  By making the DRI2
drawable a resource, GLX doesn't have to worry about that and the
resource destruction order becomes irrelevant.

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

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-16 14:53:31 -07:00
Kristian Høgsberg
22da7aa9d7 glx: Let the resource system destroy pixmaps
GLX pbuffers are implemented using a pixmap allocated by the server.
With the change to DRI2 to track DRI2 drawables as resources, we need to make
sure that every drawable we create a DRI2 drawable for has an XID.  By
using the XID of the pbuffer, the resource system will automatically
reclaim the hidden pixmap and the DRI2 drawable when the pbuffer is
destroyed or the client exits.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-16 14:53:25 -07:00
Kristian Høgsberg
f0006aa58f glx: Track GLX 1.3 style GLX drawables under their X drawable ID as well
This ensures that the DrawableGone callback gets called as necessary
when the X drawable goes away.  Otherwise, using a GLX drawable
(say, glXSwapBuffers) in indirect mode after the X drawable has been
destroyed will crash the server.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-16 14:53:17 -07:00
Kristian Høgsberg
1760d2bef9 glx: Set the pbuffer bit for dri2 fbconfigs
They've been implemented for a while, but we never advertised them.  All we
need to do is set the GLX_PBUFFER_BIT in the drawable type fbconfig
field when we're using DRI2.

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

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-12 21:42:14 -07:00
Keith Packard
a7698a6776 Merge remote branch 'jbarnes/master' 2010-04-06 12:36:15 -07:00
Jesse Barnes
165a4a9c7d GLX/DRI2: expose swap control extensions if DDX support is present
Export DDX swap control status from the DRI2 module and check for it in
GLX when initializing extensions.

Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-29 10:03:12 -07:00
Jeremy Huddleston
73b3b67aac GLX: Remove a redundant initialization
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Acked-by: Adam Jackson <ajax@redhat.com>
2010-03-29 09:37:14 -07:00
Tomas Carnecky
0c2fde5c8a Fix typos in the swap functions
This should fix bug #3539.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-23 03:52:14 +01:00
Kristian Høgsberg
018b177591 glx: Compile fix to let server compile with new and old mesa
We broke the __DRI2_FLUSH API since it was never released, but since it's
taking a little longer than expected to get the X server side of the changes
ready, fix things up so it compiles.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-24 09:16:46 -08:00
Rami Ylimaki
5b9a52be7e os: Prevent core dump from being truncated.
The problem fixed by this patch can be reproduced on Linux with the
following steps.
- Access NULL pointer intentionally in ProcessOtherEvent on key press.
- Instead of saving core dump to a file, write it into a pipe.
  echo "|/usr/sbin/my-core-dumper" > /proc/sys/kernel/core_pattern
- Dump the core by pressing a key.

While the core is being dumped into the pipe, the smart schedule timer
will cause a pending SIGALRM. Linux kernel stops writing data to the
pipe when there are pending signals. This causes the core dump to be
truncated. On my system I'm expecting a 6 MB dump but the size will be
60 kB instead. The problem is solved if we block the SIGALRM caused by
expired smart schedule timer.

I haven't been able to reproduce this problem in the following cases.
- Save core dump to a file instead of a pipe.
- kill -SEGV `pidof Xorg`
- Press a key to dump core while gdb is attached to Xorg.
- Give option -dumbSched to Xorg.

Also note that the fix works only when NoTrapSignals has the default
value FALSE. The problem can still be reproduced if error signals
aren't trapped. In addition to pending SIGALRM, there is a similar
problem with pending SIGIO from the keyboard driver during core dump.

Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-17 23:20:52 -08:00
Keith Packard
0b21a0416b Merge remote branch 'alanc/master' 2010-01-27 14:14:15 -08:00
Eric Anholt
0688dca044 dri2: Fix order of operations issue in __glXdriSwapEvent test.
Clients would have received swap events regardless of asking for it.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27 14:06:59 -08:00
Alan Coopersmith
138d4c1670 glx: Sun compilers now support some gcc __attribute__ values
Sun cc 5.9 and later (__SUNPRO_C >= 0x590) support __attribute__
calls for aligned, always_inline, noinline, pure, const, and malloc.

This commit consists of the related updates to files that were
regenerated by gl_XML.py in mesa after adding the __SUNPRO_C checks to it

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-25 11:10:00 -08:00
Jesse Barnes
84956ca43b GLX/DRI2: add INTEL_swap_event support
This allows clients to easily check for swap completion status in their
main loop.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Adam Jackson <ajax@nwnk.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-01-11 16:17:15 -05:00
Jesse Barnes
04a54f69a8 DRI2: add support for new DRI2 protocol requests
Support the new DRI2 2.2 protocol requests: DRI2SwapBuffers, DRI2GetMSC,
DRI2WaitMSC, DRI2WaitSBC and DRI2SwapInterval.

These requests allow the server to support the SGI_video_sync,
SGI_swap_interval, and OML_sync_control GLX extensions if DDX support is
present.  The new DDX APIs are documented in dri2.h.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Adam Jackson <ajax@nwnk.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-01-11 16:16:35 -05:00
Alan Coopersmith
895f40792a Add type name argument to CreateNewResourceType
Convert all calls of CreateNewResourceType to pass name argument

Breaks DIX ABI.

ABI versions bumped:

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18 17:44:12 -08:00
Alan Coopersmith
eb750f8b5e Check for failures from CreateNewResourceType
Make sure to check return value before setting bitmask flags.
For most calls, just fails to init the extension.   Since Xinput
already calls FatalError() on initialization failure, so does
failure to allocate Xinput's resource type.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-18 16:51:45 -08:00
Adam Jackson
77221c9155 glx: swrast can do GLX 1.4 too
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-14 14:34:15 -08:00
Mikhail Gusarov
d306373399 Supply all code using dl*() with DLOPEN_LIBS
Previously DLOPEN_LIBS was managed in top-level configure.ac.
Instead bundle it with the code using dl*() functions to
avoid breakages in uncommon configurations.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-29 14:15:02 -07:00
Jamey Sharp
fab74d1081 Suppress certain GCC warnings in auto-generated code.
- Don't warn for references to deprecated functions in xorg_symbols.
- Ignore functions generated by gl_apitemp.py that are never used.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-28 18:59:07 -07:00
Jamey Sharp
e8c48fd8f7 Suppress GCC warnings like "the address of u1' will always evaluate as true'".
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-28 18:56:09 -07:00
Jamey Sharp
b0dd6be2c8 Cast small-int values through intptr_t when passed as pointers
On 64-bit systems, int and pointers don't have the same size, so GCC gives
warnings about casts between int and pointer types. However, in the cases
covered by this patch, it's always a value that fits in int being stored
temporarily as a pointer and then converted back later, which is safe.
Casting through the pointer-sized integer type intptr_t convinces the
compiler that this is OK.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-10-08 13:38:44 +11:00
Jamey Sharp
9bf2ff4faf Fix "possibly uninitialized" warnings in glx
In both functions, "answer" was uninitialized if "compsize" was 0, but in
that case __GLX_SEND_VOID_ARRAY(compsize) results in a call to
WriteToClient for 0 bytes, which returns immediately without examining the
"answer" argument. So initializing to a null pointer is as good as
anything else.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-10-08 13:36:44 +11:00
Ian Romanick
4c6bfa2c09 GLX: More clearly document the GLX protocol version handling
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-01 23:13:40 -07:00
Dave Airlie
cb54cf1b3e glx: fixup deref of null pointer when glx screen init fails.
I think this is what the original author wanted.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2009-10-02 08:47:13 +10:00
Dave Airlie
6ffda5aae7 dix/glx/composite: consolidate visual resize in one place.
The previous code was copied and in both cases incorrectly fixed
up the colormaps after resizing the visuals, this patch consolidates
the visual resize + colormaps fixups in one place. This version
also consolidates the vid allocation for the DepthPtr inside the
function.

I'm not 100% sure colormap.[ch] is the correct place for this but
visuals are mostly created in fb and I know thats not the place to
be resizing them.

Fixes fd.o bug #19470.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-30 10:00:07 +10:00
Ian Romanick
ad5c0d9efa GLX: Enable GLX 1.4 on DRI2
Return the minimum GLX version supported by all screens.  Assume that
DRI2 screens have all the required features for GLX 1.4.  Assume that
everyone else can only support GLX 1.2.

Reviewed-by: Kristian Høgsberg <krh@redhat.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-09-29 16:46:39 -07:00
Peter Hutterer
55747d256d input: define server-supported protocol versions in one single file.
include/protocol-versions.h specifies each extension version as supported by
the server and sent back on the wire to the client.

This fixes up several issues with the server potentially reporting a higher
version of the protocol if recompiled against a newer version of the
protocol.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Rémi Cardona <remi@gentoo.org>
Acked-by: Julien Cristau <jcristau@debian.org>
2009-09-21 21:47:35 +10:00
Alan Coopersmith
fe31f9c646 Change xf86dristr.h includes to use xf86driproto.h instead
Clears warnings about obsolete headers, but raises minimum
required version of xf86driproto to 2.1.0

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-16 12:06:07 +10:00
Michel Dänzer
120286aef5 glx: Add screen DestroyWindow wrapper to destroy the GLX drawable.
Fixes crashes exitting MacSlow's rgba-glx demo.
2009-09-03 08:05:59 +02:00
Peter Hutterer
c20304226b glx: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 10:13:44 +10:00
RALOVICH, Kristóf
73abdc94c3 glx: damage is only used with DRI
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-07-06 17:57:27 +03:00
RALOVICH, Kristóf
7208a0f032 glx: remove Xgl leftover
GlxSetRenderTables was only used by the long gone Xgl.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-07-06 17:57:23 +03:00
Eric Anholt
fd4eed69e4 dri2: Enable GLX_SGI_make_current_read when the DRI driver supports it.
This matches idr's 82f150d73c for DRI1.
2009-07-05 10:19:03 -07:00
Dave Airlie
184deb9bc3 GLX: make function static.
This function isn't called from anywhere else and I don't think it shuold be.
2009-06-24 10:41:47 +10:00
Dave Airlie
9d85b56078 GLX: note the implicit flushes with ReadPixels in indirect contexts.
This just notes the flush has occured when readpixels returns, and
fixes the glean test.
2009-06-24 10:41:47 +10:00
Michel Dänzer
3020b1d43e glx: Clean up more thoroughly if the drawable of a current context goes away.
Fixes crash when restarting compiz, due to cl->currentContexts[x] being stale.
2009-06-23 16:45:40 +02:00
Dave Airlie
918923e285 glx: fix open-coded linked list removal function
OMG stab stab stab, YALL.

removal function was made of crack, actually truncated the list from
the one after the find point.

However fixing this makes glean makecurrent fail with a GLX error.
2009-06-11 11:09:40 +10:00
Jeremy Huddleston
07c5941181 GLX: Make sure the types match for ALIAS in indirect_reqsize.c
(cherry picked from commit 31a20a573b)
2009-06-06 22:24:18 -07:00
Adam Jackson
ab5d1ae82e Remove some libXfont leftovers 2009-06-02 13:40:14 -04:00
Jeremy Huddleston
5c8540d8cf GLX: Purge glxint.h usage
Change (__GLXvisualConfig *) to (void *) in ABI compat stubs.
(cherry picked from commit b4adec886c)
2009-05-29 14:49:05 -07:00
Jeremy Huddleston
da2aaee24a GLX: Purge some glxint.h usage in glxcmds.c
This is related to d0b249f1c5 in the 1.4 branch and was ok'd by krh
(cherry picked from commit e587436cf2)
2009-05-29 14:48:24 -07:00
Eamon Walsh
22a33a7250 glx: Register names for the GLX resource types.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-05-19 22:49:25 -04:00
Michel Dänzer
2075d4bf9e glx: If a destroyed window is bound to the current context, make it not current.
Avoids subsequent crashes due to stale pointers to the DrawableRec, see
https://bugs.freedesktop.org/show_bug.cgi?id=21132#c15 and previous comments.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-05-14 11:46:41 +02:00
Pierre Willenbrock
40a8f2f408 Fix obvious copypasta
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2009-04-27 13:36:39 -07:00
Ian Romanick
ff6c7764c2 DRI2: Implement protocol for DRI2GetBuffersWithFormat
This change implements the protocol for DRI2GetBuffersWithFormat, but
the bulk of the differences are the changes to the extension / driver
interface to make this function work.  The old CreateBuffers and
DeleteBuffers routines are replaced with CreateBuffer and DeleteBuffer
(both singular).

This allows drivers to allocate buffers for a drawable one at a time.
As a result, 3D drivers can now allocate the (fake) front-buffer for a
window only when it is needed.  Since 3D drivers only ask for the
front-buffer on demand, the real front-buffer is always created.  This
allows CopyRegion impelemenations of SwapBuffers to continue working.
As with previous version of this code, if the client asks for the
front-buffer for a window, we instead give it the fake front-buffer.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-24 12:49:19 -07:00
Ian Romanick
d1e916d29b DRI2: Add missing front-buffer flush callback.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-20 20:58:56 -07:00
Werner LEMBERG
335c63fcd6 Add newline to some LogMessage strings.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-20 12:38:08 +10:00
Ian Romanick
de1e43181b DRI2: Don't leave empty entries in private->buffers
This should fix bug #21130.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-15 11:14:58 -07:00
Kristian Høgsberg
7b6400a1b8 glx: Fix drawable private leak on destroy
When a drawable goes away, we don't destroy the GLX drawable in full,
since it may be current for a context.  This means that when the drawable
is destroyed in full later, the backend doesn't get a chance to
destroy resources associated with the drawable (the DRI2Drawable).

With this patch, we destroy the GLX drawable in full when it goes away
and then track down all contexts that reference it and NULL their
pointers.
2009-04-13 13:17:53 -04:00
Ian Romanick
f1a995d149 DRI2: Do not send the real front buffer of a window to the client
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-10 12:00:36 -07:00
Michel Dänzer
7b3982eb65 glx: Test the error value, not its address... 2009-04-09 08:21:09 +02:00
Ian Romanick
03aebed519 Use a #define instead of a magic number
The number of buffers is likely to change in the future, so having
this as a define is the right way to go.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-08 15:10:21 -07:00
Ian Romanick
0d9f3ca7ea Allow GLX sources to build against Mesa 7.4 sources
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-08 15:10:21 -07:00
Kristian Høgsberg
df27b870a8 Convert remaining GLX LookupIDByType() calls 2009-04-07 16:28:26 -04:00
Kristian Høgsberg
92562747a0 Add validGlxDrawable() and use dixLookupResourceByType().
Fixes deprecation warnings, and fixes a couple of GLX error codes
for failing drawable lookups.
2009-04-07 16:28:26 -04:00
Kristian Høgsberg
f70cfc8f90 Don't stomp on dixLookupDrawable() return value in DoCreateGLXPixmap(). 2009-04-07 16:28:26 -04:00
Kristian Høgsberg
30d81ad72e Make GLX context lookup use dixLookupResourceByType() 2009-04-07 16:28:26 -04:00
Kristian Høgsberg
91b697efde Support setTexBuffer2 in AIGLX.
Fixes broken GLX_tfp, specifically, lets compositors ignore un-defined
alpha channel for pixmaps.
2009-04-02 13:39:52 -04:00
Ian Romanick
4039603413 glx: Inialize best_score before calculating visual scores
This bug was pointed out by Peter Åstrand.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-02-17 08:27:32 -08:00
Ian Romanick
51ae4d6bbf glx: Add comments around some extension string weirdness 2009-02-16 12:08:56 -08:00
Alan Hourihane
2a8b8077d8 dri2: support glXWaitGL & glXWaitX by copying fake front to front and
vice-versa.
2009-02-16 11:45:55 +00:00
Alan Hourihane
a26c77ff43 glx: fix retval checks when failures occur for drawable creation. 2009-02-13 13:45:08 +00:00
Ian Romanick
d1ad43a8bc Enable pbuffers
If a driver does not actually support pbuffer rendering, it can just
not enable any pbuffer fbconfigs.
2009-02-12 14:05:10 -08:00
Eric Anholt
619c4d60eb glx: Replace broken GLX visual setup with a fixed "all" mode.
With trying to match depths so that you didn't end up with a depth 24
fbconfig for the 32-bit composite visual, I broke the alpha bits on the depth
24 X visual, which angered other applications.  But in fixing that, the
pickFBconfigs code for "minimal" also could end up breaking GLX visuals if
the same FBconfig was chosen for more than one X visual.
We have no reason to not expose as many visuals as possible, but the old
"all" mode didn't match any existing X visuals to GLX visuals, so normal
GL apps didn't work at all.

Instead, replace it with a simple combination of the two modes: Create GLX
visuals by picking unique FBconfigs with as many features as possible for
each X visual in order.  Then, for all remaining FBconfigs that are
appropriate for display, add a corresponding X and GLX visual.

This gets all applications (even ones that aren't smart enough to do FBconfigs)
get all the options to get the visual configuration they want.  The only
potential downside is that the composite ARGB visual is unique and gets a
nearly full-featured GLX visual (except that the root visual might have taken
the tastiest FBconfig), which means that a dumb compositing manager could
waste resources. Write compositing managers using FBconfigs instead, please.
2009-02-10 17:59:03 -08:00
Tomas Carnecky
dd3f4e8292 Fix "warning: cast to pointer from integer of different size"
Add parenthesis around the whole expression.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-04 09:42:02 +10:00
Eric Anholt
5100d829a4 glx: Don't match fbconfigs to visuals with mismatched channel masks.
This fixes at least one known bug, where the depth 32 visual would end up
with a depth 24 fbconfig attached, angering compiz.
2009-02-02 11:07:09 -08:00
Pierre Willenbrock
29b3b88dc7 Prevent double unref of glxdrawables
Found by valgrind. Bug #18917.
2009-02-01 09:06:43 -08:00
Yaakov Selkowitz
7f781e780e Cygwin/X: Cygwin doesn't have RTLD_LOCAL
RTLD_LOCAL is not defined on Cygwin

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-01-19 14:46:06 +00:00
Dan Nicholson
e1c8ee2157 Don't reuse PKG_CHECK_MODULES identifiers
Using GL for the PKG_CHECK_MODULES identifier multiple times means only
the first call will actually be used. Later calls will be skipped due to
GL_CFLAGS and GL_LIBS already being set. This changes DRI to using a
different identifier and DMX to just reusing GL_CFLAGS.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2009-01-18 09:49:06 -08:00
Jon TURNEY
c745db1674 GLX: Avoid a crash when we have an uninitialized GL context
If the GL dispatch table pointer points to glapi_noop_table,
(due to some kind of GL initialization failure), DoGetString(GL_VERSION)
(for example as invoked by glxinfo) will crash as it tries to
do atof() on the null pointer returned by the noop dispatch function

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-01-15 14:23:48 +00:00
Paulo Cesar Pereira de Andrade
295a3fa721 Ensure symbols required by swrast_dri.so are visible. 2008-12-17 02:04:12 -02:00
Ian Romanick
f1c9b5ab23 GLX: Changes resulting from changes to Mesa generator scripts / data
Several recent Mesa commits (listed below) make modifications to the
protocol generator data and scripts.  This commit represents the
changes to the generated files resulting from the previous changes.

    - 0f73302d24f4201813da2939742c5bcb6964b3b1
      GLX: Fix protocol for glTexSubImage#D

    - 1709ab01ef24279c782e420568e9257b4b92b224
      Return 0 as the request size when the pixels parameter is NULL

    - 63cca2ba10ce7dcc8481cfa4be3872dfc269dded
      GLX: Include glapi.h before glapitable.h

This is the server-side part of the fix for bugzilla #11003.
2008-12-14 18:58:33 -08:00
Eric Anholt
49d38ab232 Warning fix: Remove dead glXDisp{,Swap}_DrawArraysEXT definitions.
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2008-12-12 10:37:40 -08:00
Eric Anholt
2c5bfffc83 Warning fix (GL likes to call strings GLubyte * instead of char *).
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2008-12-12 10:37:40 -08:00
Peter Hutterer
cb95642dc8 Remove #define NEED_EVENTS and NEED_REPLIES
A grep on xorg/* revealed there's no consumer of this define.

Quote Alan Coopersmith:
"The consumer was in past versions of the headers now located
in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h,
all the event definitions were only available if NEED_EVENTS were
defined, and all the reply definitions required NEED_REPLIES.

Looks like Xproto.h dropped them by X11R6.3, which didn't have
the #ifdef's anymore, so these are truly ancient now."

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-12 11:43:32 +10:00
Kristian Høgsberg
110a71d11a Test for DRI2 extension in dri_internal.h and only enable AIGLX DRI2 if found. 2008-12-03 11:22:38 -05:00
Eric Anholt
85d84c7cf2 Fix GLX after 180bad8477.
Sigh.
2008-12-02 17:36:49 -08:00
Paulo Cesar Pereira de Andrade
180bad8477 Add visibility flags to XSERVER_CFLAGS.
This is done to actually change DIX_CFLAGS, as not all "modules" use
XORG_CFLAGS.
  Also export the symbols that are required by other modules after
the change.
2008-12-02 02:50:45 -02:00
Kristian Høgsberg
8ff62ea5ba CopySubBuffer expects GL style coordinates. 2008-11-12 15:21:04 -05:00
Michel Dänzer
a4d62bbf21 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.
2008-11-04 11:27:53 +01:00
Michel Dänzer
27f1ad466c AIGLX: Don't truncate offset returned by driver texOffsetStart hook on 32 bit. 2008-11-04 11:26:03 +01:00
Michel Dänzer
a7951a4dad AIGLX: Allow 2D driver to prevent zero-copy texturing of a pixmap.
The driver can return ~0ULL to achieve this, e.g. if the pixmap doesn't fit
into offscreen storage or if its pixel format isn't supported by the 3D engine
for texturing.

See http://bugs.freedesktop.org/show_bug.cgi?id=17723 or
http://bugs.freedesktop.org/show_bug.cgi?id=12385 .
2008-11-03 10:00:54 +01:00
Jerome Glisse
084ae9e388 dri2: fail at context creation if driver fail to create it's context 2008-10-23 11:28:53 +02:00
Adam Jackson
81e197b2a5 Bug #18159: Spell "anisotropic" correctly 2008-10-21 16:00:32 -04:00
Luc Verhaegen
0195d31846 GLX: fix build when dri2 _is_ available.
Caught by Julien Cristau.
2008-10-15 21:46:27 +02:00
Luc Verhaegen
398cdf959a GLX: fix build when dri2 is not available. 2008-10-15 18:24:10 +02:00
Kristian Høgsberg
ced6690284 dri2: Update to latest protocol draft.
Mainly rename SwapBuffers to CopyRegion, which adds the xfixes region
argument and the bitmask argument to let us extend it in the future.
2008-10-15 00:00:44 -04:00
Adam Jackson
8a5b89e8e1 xalloc+memset(0) -> xcalloc 2008-10-06 15:36:51 -04:00
Ian Romanick
82f150d73c GLX: Make sure GLX_SGI_make_current_read is enabled when possible 2008-09-24 16:56:45 -07:00
Adam Jackson
ad14239a35 Upgrade GLX Public License 1.0 to FreeB 2.0.
According to the press release:

    Previous SGI contributions to the free and open source community
    are now available under the new license. These contributions
    include the SGI® OpenGL® Sample Implementation, the GLX™ API and
    other GLX extensions.

    [...]

    "SGI has been one of the most ardent commercial supporters of free
    and open source software, so it was important to us that we continue
    to support the free software development community by releasing our
    earlier OpenGL-related contributions under this new license," said
    Steve Neuner, director of Linux, SGI. "This license ensures that all
    existing user communities will benefit, and their work can proceed
    unimpeded. Both Mesa and the X.org Project can continue to utilize
    this code in free software distributions of GNU/Linux. Now more than
    ever, software previously released by SGI under earlier GLX and SGI
    Free Software License B is free."

"The GLX API" is here read to include the original GLX source release
from:

http://www.sgi.com/products/software/opensource/glx/download.html
ftp://ftp.sgi.com/sgi/opengl/glx/glx1_2.1.tgz

which includes glxext.c as included in XFree86, from which our copies
in glx/ and hw/dmx/glxProxy/ are derived.
2008-09-22 11:26:49 -04:00
Adam Jackson
69b79c1a66 Update to SGI FreeB 2.0.
Under the terms of version 1.1, "once Covered Code has been published
under a particular version of the License, Recipient may, for the
duration of the License, continue to use it under the terms of that
version, or choose to use such Covered Code under the terms of any
subsequent version published by SGI."

FreeB 2.0 license refers to "dates of first publication".  They are here
taken to be 1991-2000, as noted in the original license text:

 ** Original Code. The Original Code is: OpenGL Sample Implementation,
 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
 ** Copyright in any portions created by third parties is as indicated
 ** elsewhere herein. All Rights Reserved.

Official FreeB 2.0 text:

http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.2.0.pdf

As always, this code has not been tested for conformance with the OpenGL
specification.  OpenGL conformance testing is available from
http://khronos.org/ and is required for use of the OpenGL logo in
product advertising and promotion.
2008-09-19 12:02:28 -04:00
Maarten Maathuis
f4e9a1a98f damage: choose less ambiguous function names 2008-08-31 17:46:26 +02:00
Jeremy Huddleston
45def7f0a3 Removed dead glcontextmodes
(cherry picked from commit c6d0ac7471)
2008-08-30 14:20:49 -07:00
Maarten Maathuis
1861250cd7 {damage,exa}: sanitise damage
- Redo damage naming for more consistency.
- Call post submission functions only where appropriate.
- EXA can now live without it's odd damage workarounds.
2008-08-29 22:15:23 +02:00
Kristian Høgsberg
5af77d43fe DRI2: Drop sarea use, implement server side swap buffers. 2008-08-29 12:33:28 -04:00
Tomas Carnecky
ebea78cdba Prepare for array-index based devPrivates.
TODO: static indices can be made just an int; some indices
can be combined.
2008-08-28 18:05:40 -04:00
Kristian Høgsberg
fd94651fc3 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 11:07:32 -04:00
Jie Luo
99583b43a9 glx: avoid possible NULLptr deref, fix #16884 2008-08-17 23:13:22 +02:00
Dave Miller
5968634996 glx: fix crash in driGetConfigAttribIndex
Don't access GLboolean via int pointers
2008-08-09 16:45:59 +10:00
Jeremy Huddleston
bf084a0769 glcontextmodes.[hc] were not added with the removal of the meas symlinks patch. Copied from mesa head 2008.08.06.
(cherry picked from commit 409e1dd1e9)
2008-08-06 13:37:28 -07:00
Michel Dänzer
ec10eccd56 GLX: Unreference drawables bound to the old context, not the new one.
Apart from the obvious reference counting issue, this fixes
http://bugs.freedesktop.org/show_bug.cgi?id=16867 .
2008-07-28 09:33:04 +02:00
Michel Dänzer
6ab8d6010a AIGLX/DRI1: Pay more attention to return value from DRIGetDrawableInfo().
Could have crashed otherwise if the num(Back)ClipRects variables referenced by
the caller weren't pre-initialized to 0.
2008-07-28 09:32:59 +02:00
Kristian Høgsberg
2ce434f54b Clean up unused definitions from glx headers. 2008-07-25 14:29:25 -04:00
Daniel Drake
eff25430b4 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.
2008-07-24 21:06:34 -05:00
Kristian Høgsberg
dff1a609bb Drop the glx resize hook and stop chaining PositionWindow. 2008-07-24 13:34:24 -04:00
Kristian Høgsberg
24dddcd0ef Drop unnecessary linked list of contexts from GLXDrawable. 2008-07-24 13:34:24 -04:00
Kristian Høgsberg
facb255fa9 Need to unref pixmaps backing pbuffers too. 2008-07-21 16:05:53 -04:00
Kristian Høgsberg
d5ae85b5b7 Fix embarrasing GLXPixmap leak. 2008-07-21 15:32:12 -04:00
Julien Cristau
43c6d5a6f8 distcheck fixes
Still seems to fail because hw/xquartz has too long filenames
2008-07-20 16:30:24 +02:00
Ian Romanick
b84a27fd9f VBO: Regenerate files based on recent changes to gl_API.xml
Since GL_ARB_vertex_buffer_object protocol isn't supported yet, these
changes are innocuous.
2008-07-02 06:25:03 -07:00
George Sapountzis
3108980f5e glx: drop unused cleargc 2008-06-13 16:00:15 +03:00
Michel Dänzer
23b55a61f8 AIGLX/DRI1: Switch to server context for calling pScreen->GetImage.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16292 .
2008-06-13 11:13:56 +02:00