Commit Graph

397 Commits

Author SHA1 Message Date
Adam Jackson
1597297067 meson: Build libglx.so
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-27 15:19:34 -04:00
Eric Anholt
1549e30372 Add a Meson build system alongside autotools.
This is a work in progress that builds Xvfb, Xephyr, Xwayland, Xnest,
and Xdmx so far.  The outline of Xquartz/Xwin support is in tree, but
hasn't been built yet.  The unit tests are also not done.

The intent is to build this as a complete replacement for the
autotools system, then eventually replace autotools.  meson is faster
to generate the build, faster to run the bulid, shorter to write the
build files in, and less error-prone than autotools.

v2: Fix indentation nits, move version declaration to project(), use
    existing meson_options for version-config.h's vendor name/web.

Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-26 15:25:27 -07:00
Eric Anholt
563b6ee873 Rewrite the byte swapping macros.
The clever pointer tricks were actually not working, and we were doing
the byte-by-byte moves in general.  By just doing the memcpy and
obvious byte swap code, we end up generating actual byte swap
instructions, thanks to optimizing compilers.

         text	   data	    bss	    dec	    hex	filename
before: 2240807	  51552	 132016	2424375	 24fe37	hw/xfree86/Xorg
after:  2215167	  51552	 132016	2398735	 249a0f	hw/xfree86/Xorg

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-04-25 15:01:23 -07:00
Eric Anholt
be80a3cb48 glx: Use the same endian swapping as the rest of the server.
This dumps a ton of configure-time checks for system endian macros.
Given that we're marking the mixed-endian fixup code as cold, getting
at the system macros is a waste of code.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-04-21 11:39:10 -07:00
Adam Jackson
7dfb9608d0 glx: Remove enter/leave server API
Dead code since:

    commit 8aacf47e17
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Fri Oct 4 12:58:19 2013 -0400

        glx: Remove DRI1 AIGLX (v2)

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-04-10 13:55:11 -04:00
Adam Jackson
f4b78286ea glx: Fix MakeCurrent with no drawables
GLX_ARB_create_context, which we aspire to support, allows making GL 3.0
or newer contexts current with null current drawables. Strictly this
might not be legal for pre-3.0 contexts, but there's no harm in allowing
it anyway.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-03-24 11:49:14 -04:00
Adam Jackson
ea483af99a glx: Move Composite's synthetic visuals to a different select group
Should you find yourself using a 16bpp display while also using a
compositor, you poor soul, you may find that your GLX applications
behave strangely; in particular, glxgears will be transparent. This is
because it clears to (0,0,0,0) which is transparent if you honor alpha,
and it will choose the synthetic visual because it has the most
available r/g/b bits.

To avoid this, bump synthetic visuals to a higher (less-preferred)
select group. Unless the client explicitly asks for non-zero alpha bits,
this will prefer any rgb565 visual ahead of the argb8888 visual.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25 11:27:33 -05:00
Adam Jackson
43efaa6e4f glx: Send GLX_VISUAL_SELECT_GROUP_SGIX attribute for visuals
We already send this for fbconfigs. Mesa happens to implement
glXChooseVisual relative to the fbconfig data, but that might not be
true of NVIDIA's libGL.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25 11:27:29 -05:00
Jon Turney
03d99ef729 glx/dri2: Don't build DRI loader if DRI2 isn't enabled
This partially reverts 501d8e2b.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-10-27 14:25:42 +01:00
Adam Jackson
e3f53aa3a8 glx/dri2: Don't include drm headers
They're not needed, and they won't be present on win32.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emil Velikov <emil.l.veikov@gmail.com>
2016-10-10 13:43:09 -04:00
Emil Velikov
501d8e2beb configure.ac: remove --enable-aiglx option
Presently the option guards both direct and accelerated indirect GLX. As
such when one toggles it off they end up without any acceleration.

Remove the option all together until we have the time to split/rework
things.

Cc: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-10-05 14:15:59 -04:00
Emil Velikov
04ef8558a7 glx: drisw is not accelerated IGLX, reflect that in log messages
The messages from glxdricommon.c (used by drisw) still have the A, but
at least we're don't have it locally.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-10-05 14:15:42 -04:00
Hans de Goede
445271ec00 glx: Always enable EXT_texture_from_pixmap for DRI swrast glx
Prior to commit f95645c6f7 ("glx: Don't enable EXT_texture_from_pixmap
unconditionally") DRI glx would always advertise EXT_texture_from_pixmap.

That commit moved the setting of the extension in the extension bits from
__glXInitExtensionEnableBits to its callers so that
__glXInitExtensionEnableBits can be used more generally, but at the same
time made the setting of EXT_texture_from_pixmap conditionally on
__DRI_TEX_BUFFER being present.

This has result in an unintended behavior change which breaks e.g.
compositors running on llvmpipe. This commit makes the DRI swrast glx code
advertise EXT_texture_from_pixmap unconditionally again fixing this.

Fixes: f95645c6f7 ("glx: Don't enable EXT_texture_from_pixmap unconditionally")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Only add unconditional advertising of GLX_EXT_texture_from_pixmap
 to glxdriswrast.c, do not also add it to glxdri2.c
2016-09-28 14:53:39 -04:00
Jon Turney
f5f4d32ac7 Add Windows-DRI extension
If windowsdriproto headers are available, build a Windows-DRI extension,
which supports requests to enable local clients to directly render GL to a
Windows drawable:

- a query to check if WGL is being used on a screen
- a query to map a fbconfigID to a native pixelformatindex
- a query to map a drawable to a native handle

Windows-DRI can only be useful if we are using WGL, so make an note if WGL
is active on a screen.

Make validGlxDrawable() public

Adjust glxWinSetPixelFormat() so it doesn't require a context, just a
screen and config.

That enables factoring out the deferred drawable creation code as
glxWinDeferredCreateDrawable()

Enhance glxWinDeferredCreateDrawable(), so that pixmaps are placed into a
file mapping, so they exist in memory which can be shared with the direct
rendering process.

Currently, this file mapping is accessed by a name generated from the XID.
This will not be unique across multiple server instances. It would perhaps
be better, although more complicated, to use an anonymous file mapping, and
then duplicate the handle for the direct rendering process.

Use glxWinDeferredCreateDrawable() to ensure the native handle exists for
the Windows-DRI query to map a drawable to native handle.

v2:
Various printf format warning fixes

v3:
Fix format warnings on x86
Move some uninteresting windows-dri output to debug log level

v4:
check for windowsdriproto when  --enable-windowsdri
use windowsdriproto_CFLAGS

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-09-15 20:10:29 +01:00
Adam Jackson
392da389d7 glx: Fix computation of GLX_X_RENDERABLE fbconfig attribute
>From the GLX spec:

    "GLX_X_RENDERABLE is a boolean indicating whether X can be used to
    render into a drawable created with the GLXFBConfig. This attribute
    is True if the GLXFBConfig supports GLX windows and/or pixmaps."

Every backend was setting this to true unconditionally, and then the
core ignored that value and sent true unconditionally on its own. This
is broken for ARB_fbconfig_float and EXT_fbconfig_packed_float, which
only apply to pbuffers, which are not renderable from non-GLX APIs.

Instead compute GLX_X_RENDERABLE from the supported drawable types. The
dri backends were getting _that_ wrong too, so fix that as well.

This is not a functional change, as there are no mesa drivers that claim
to support __DRI_ATTRIB_{UNSIGNED_,}FLOAT_BIT yet.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-09-06 10:29:14 -04:00
Adam Jackson
7d33ab0f8c dri2: Don't make reference to noClientException
noClientException is now never filled in with a meaningful value, it's
always -1. The sole caller of this function disregards the error value
in any case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-09-02 13:41:32 -04:00
Adam Jackson
ce82ae1964 res: Account for GLXPixmap references too
GLX_EXT_tetxure_from_pixmap operates on a GLXPixmap, which takes a
reference on the backing pixmap; that GLXPixmap might be long-lived, so
we should account for it in ResQueryClientPixmapBytes.

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-06-21 11:11:54 -04:00
Guilherme Quentel Melo
a134d1e7ea glx: avoid memory leak when using indirect rendering
When multiple processes are using GL with indirect rendering a race
condition can make drawables refcount never drop to zero.

This situation could happen when there are many X clients using indirect
GLX:

1 - client1: calls glXMakeCurrent

2 - client2: calls glXMakeCurrent
This is the first context switch for this client. So old_context_tag=0

3 - client1: calls glXRender
For the client, its context is already current.
For the server side lastGLContext points to client2's context.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Guilherme Quentel Melo <gqmelo@gmail.com>
2016-06-20 13:25:41 -04:00
Adam Jackson
3f569435e1 glx: Stop tracking hasUnflushedCommands
This is only meaningful for indirect contexts, and all it does is
(maybe) prevent a flush when switching away from an indirect context.
Indirect contexts aren't worth optimizing for, and Mesa tracks whether
a flush is needed anyway.

Careful readers will note that ReadPixels would reset the flag even
though it doesn't imply a flush!

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-05-11 11:23:20 -04:00
Adam Jackson
0ebb58f6b6 glx: Remove some redundant zero-init of GLX context state
The context is already calloc'd.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-05-11 11:23:20 -04:00
Adam Jackson
d5ba095982 glx/dri2: Implement dri2FlushFrontBuffer explicitly
No functional change.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-05-11 11:23:20 -04:00
Adam Jackson
0ba4e251a1 glx: Code motion
No functional change, just rearranging some code to make later commits
more obvious.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-05-11 11:23:20 -04:00
Adam Jackson
b08526eecf glx: Implement GLX_EXT_libglvnd (v2)
For the dri2 backend, we depend on xfree86 already, so we can walk the
options for the screen looking for a vendor string from xorg.conf.  For
the swrast backend we don't have that luxury, so just say mesa.  This
extension isn't really meaningful on Windows or OSX yet (since libglvnd
isn't really functional there yet), so on those platforms we don't say
anything and return BadValue for the token from QueryServerString.

v2: Use xnf* allocators when parsing options (Eric and Emil)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
2e8781ead3 glx: Compute the GLX extension string from __glXScreenInit
Now that the enable bits are in the screen base class we can compute
this in one place, rather than making every backend do it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
e21de4bf3c glx: Move glx_enable_bits up to the GLX screen base class
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
36bcbf76dc glx: Enable GLX 1.4 unconditionally
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
15af78fc56 glx: Enable GLX_SGI_make_current_read in the core
GLX 1.3 implies equivalent functionality, so this is safe to enable
unconditionally, and bindContext always takes both drawable and readable
arguments in any case. Mesa stopped exporting the __DRI_READ_DRAWABLE
extension in 8.0 (when the DRI1 drivers were removed) so this will
restore the extension string.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:07:14 -04:00
Adam Jackson
f95645c6f7 glx: Don't enable EXT_texture_from_pixmap unconditionally
Not all backend servers implement this.  Those that don't happen to not
use __glXInitExtensionEnableBits, but we'd like that to change, so fix
it up before we switch them over.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 10:47:55 -04:00
Adam Jackson
410aec8255 glx: Remove server-side mention of GLX_MESA_swap_control
This extension is direct-only and has no GLX protocol. We don't even
track an enable bit for it, trying to turn it on is pointless.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 10:47:52 -04:00
Adam Jackson
3a21da59e5 glx: Remove default server glx extension string
This existed only to be strdup'd and then immediately freed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 09:37:41 -04:00
Adam Jackson
ef3005da3d glx: Implement GLX_EXT_fbconfig_packed_float
The tokens for this are already defined by GLX_ARB_fbconfig_float, which
we already support, so just add the extension to the list and let the
driver provide those configs if it wants.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-10 15:55:58 -05:00
Adam Jackson
d15cb654b6 glx: Implement GLX_EXT_stereo_tree
This is correct as it is, but only because we know no DRI drivers
implement stereo.

v2: Use new ATTRIB macro

Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-10 15:55:55 -05:00
Adam Jackson
a18238877b glx: Add GLX_SCREEN to the GetDrawableAttributes response
libglvnd would like to use this to map from drawable to screen, so it
can know which driver to dispatch to. Refer to the spec proposal here:

https://lists.freedesktop.org/archives/mesa-dev/2016-March/109543.html

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-10 15:55:52 -05:00
Adam Jackson
47c1d6b7ab glx: Macroize building the attribute list in DoGetDrawableAttributes
No functional change, just a little easier to read and harder to get
wrong.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-10 15:55:46 -05:00
Julien Cristau
59b9c3d5e4 glx: don't call pGlxDraw->destroy() if AddResource fails
AddResource will have called DrawableGone, which takes care of the
destruction.

Reviewed-by: Rémi Cardona <remi@gentoo.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-08 10:19:46 -05:00
Adam Jackson
bc415fb1e0 glx: Fix GLX_EXT_create_context_es2_profile support
As of v4 of this extension, any GLES version number may be requested (to
enable GLES3 and later). To comply with this, simply remove the API
version checks and leave it to the DRI driver to validate. This happens
to also enable using GLES1 in direct contexts, so if that's the dire
situation you find yourself in, your client driver at least stands a
chance of working.

v4 also specifies that both extension strings should be advertised for
compatibility with clients written against v1 of the extension spec, so
add the es_profile bit to the extension list and enable it whenever we
would enable es2_profile.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-01-21 10:11:07 -05:00
Jeremy Huddleston
e09875701b glx: Fix header length error checking in __glXDisp_RenderLarge
glxcmds.c:2206:46: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare,Semantic Issue]
        if ((cmdlen = safe_pad(hdr->length)) < 0)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-10-19 11:51:58 -04:00
Jon TURNEY
c877048c85 glx: Synchronize Xserver glx/rensize.c with mesa src/glx/compsize.c
Noticed while investigating https://bugs.freedesktop.org/show_bug.cgi?id=30102

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-10-06 11:15:31 -04:00
Dave Airlie
6da3f5d04f glx: fix regression with copy sub buffer disappearing
So copy sub buffer isn't a core extensions it's a driver extension
which means we are using totally the wrong interface to query for it
here, which means bad things happen when you roll out this code,
for instance MESA_copy_sub_buffer stops working.

This is just the hack I'm sticking in Fedora to avoid the regression
for now, but hopefully will inspire us.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-09-23 17:08:44 -04:00
Adam Jackson
995ff11422 glx: Implement GLX_ARB_context_flush_control
This extension allows clients to opt out of the implicit glFlush on
context release, which is quite nice for performance for clients using
multiple contexts.  The server doesn't really need to be aware of the
client's decision, at least for direct contexts, but it does need to not
reject the context attribute out of hand.

This patch won't do anything unless built against a Mesa that defines
the __DRI2_FLUSH_CONTROL extension (and a new enough glxext.h, but
that's been there since 10.3 at least).

Reviewed-by: James Jones <jajones@nvidia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-08 16:41:28 -04:00
Adam Jackson
2d7194334a glx/swrast: Do more GLX extension setup
This gets you nice things like core contexts when using Xvfb.

Also, no, MESA_copy_sub_buffer is not enabled automatically.

Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-08 16:41:28 -04:00
Keith Packard
bf6344e191 Revert "glx/dri2: Disable AIGLX if indirect GLX is disabled"
This reverts commit d61ae18074.

If the DRI2 provider is disabled, then we don't advertise the correct
GLX extensions to clients, and things like GLES fail.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90442
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-05-14 21:29:40 -07:00
Keith Packard
c39c3a9750 Merge remote-tracking branch 'ajax/xserver-next' 2015-05-11 16:34:48 -07:00
Chris Wilson
d61ae18074 glx/dri2: Disable AIGLX if indirect GLX is disabled
There is no point in setting up the acceleration for indirect GLX if
indirect GLX is itself disabled.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-07 14:06:04 -04:00
Alan Coopersmith
f59236c286 Convert glamor & glx to new *allocarray functions
v2: fixup whitespace

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-04-21 16:58:08 -07:00
Adam Jackson
cadd70c809 glx: Add hack for GLX-1.2-style naked windows to GetDrawableAttributes
Some people like to call this on bare Window XIDs and expect reasonable
results.  I sure wish they wouldn't, but since they do, if we're given
a window without any glx decoration just fill in as much as we can. This
means you won't actually get an answer for GLX_FBCONFIG_ID and friends,
but there's not much to be done about that, and it matches what NVIDIA's
driver seems to do.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54080
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-12-10 11:01:43 -05:00
Adam Jackson
f452b4a47b glx: Dynamically compute attribute slot in GetDrawableAttributes
No functional change.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-12-10 11:01:30 -05:00
Neil Roberts
c1455f76c6 glx: Add implementation of __GLXContext->loseCurrent for direct ctxts
This adds a dummy implementation for the loseCurrent function in
__GLXContext for direct contexts which just returns GL_TRUE. Without
this then the X server can crash if receives a MakeCurrent message for
a direct context because it will attempt to call loseCurrent when
cleaning up the client in the callback for ClientStateGone.

[ajax: added assumed s-o-b line]

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86531
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-12-09 14:15:55 -08:00
Keith Packard
61b17c0f10 glx: Can't mix declarations and code in X.org sources [CVE-2014-8098 pt. 9]
We're using compiler compatibility settings which generate warnings
when a variable is declared after the first statement.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-12-09 11:27:26 -08:00
Robert Morell
7e7630bbb7 glx: Fix mask truncation in __glXGetAnswerBuffer [CVE-2014-8093 6/6]
On a system where sizeof(unsigned) != sizeof(intptr_t), the unary
bitwise not operation will result in a mask that clears all high bits
from temp_buf in the expression:
        temp_buf = (temp_buf + mask) & ~mask;

Signed-off-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-12-08 18:09:50 -08:00