Commit Graph

11 Commits

Author SHA1 Message Date
Alan Coopersmith
0a6085aaf3 dri3: unvalidated lengths in DRI3 extension swapped procs [CVE-2014-8103 1/2]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-08 18:09:48 -08:00
Keith Packard
33aeec8a11 dri3: Don't enable the DRI3 extension unless some screen supports it
There's no reason to advertise this extension unless one of the
hardware drivers actually supports it. Not listing it means it's
slightly easier for users to tell what's going on.

On the other hand, not listing it means we may have applications that
only check for the extension and not for appropriate per-screen
support. I don't think that's a real risk as DRI3 is only useful for
systems with deep knowledge of the hardware.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-17 14:37:44 -07:00
Keith Packard
90803042bc Fix files including xorg-server.h by mistake
A few files in the server are including xorg-server.h, which is only
for use by Xorg server drivers. This fixes those errors and then adds
a check to make sure it doesn't happen again.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-07-30 12:17:27 -07:00
Keith Packard
6ec04a75de dri3: Fix dri3_open API change by adding new dri3_open_client
Xwayland will eventually need the current client in dri3_open. Simply
changing that API is not an option though as other drivers that
implement DRI3 will not have a matching function signature and will
crash when called.

Add a new dri3_open_client function pointer and bump
DRI3_SCREEN_INFO_VERSION so that drivers can be aware of the new
function which will be used in preference to the old function when
available.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anhole <eric@anholt.net>
2014-04-08 13:53:58 -07:00
Kristian Høgsberg
9ba2084321 dri3: Allow asynchronous implementation for dri3_open
By passing the client pointer to the dri3_open implementation, we allow
the clients to implement the open callback asynchronously.  If the
client ignore count is positive after returning from dri3_open, we
assume that authentication is in progress and doesn't send the reply.
The code to send the reply is moved into a helper function, which the
implementation can call upon receiving its authenticaion reply.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-04-01 10:31:09 -07:00
Keith Packard
60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Adam Jackson
ec6087bf07 dri3: Don't use the major/minor version from the protocol headers
We want to advertise the version we implement, not the version the
protocol headers happen to describe.

Reviewed-by: Jasper St. Pierre <<jstpierre@mecheye.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-13 14:59:03 -05:00
Adam Jackson
e6fafd3de7 dri3: Guard against buggy clients
There's nothing to stop a client from sending these requests to screens
without DRI3 support, and if they do, we'll crash.  Let's not do that.

Reviewed-by: Jasper St. Pierre <<jstpierre@mecheye.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-13 14:58:40 -05:00
Adam Jackson
66310ea289 dri3: Disable when Xinerama is active
Pretty sure this can't work.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Keith Packard
aaf0e29619 Disable DRI3 and sync fence FD functions if xshmfence isn't available
Make sure the server can build when the xshmfence library isn't present

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-04 18:53:36 -08:00
Keith Packard
5631382988 dri3: Add DRI3 extension
Adds DRM compatible fences using futexes.
Uses FD passing to get pixmaps from DRM applications.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:30 -07:00