Commit Graph

16 Commits

Author SHA1 Message Date
Eric Anholt
96a28e9c91 glx: Clear new FBConfig attributes to 0 by default.
The visualSelectGroup wasn't getting set (since our DRI drivers don't
use it), and and since it's the top priority in the sort order, you
got random sorting of your visuals unless malloc really returned you
new memory.  This manifested as Xephyr -glamor rendering to a
multisampled window on my system, which as you might guess was
slightly lower performance than expected.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-10 13:57:21 -07:00
Keith Packard
9e45a1a030 Warning fixes in glx
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-27 11:34:02 -08:00
Eric Anholt
6e926b18ca glx: Fix incorrect use of dri_interface.h version defines in extensions.
Those defines are so you can compile-time check "do I have a
dri_interface.h that defines this new field of the struct?"  You don't
want the server to claim it implements the new struct just because you
installed a new copy of Mesa.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-05 10:50:53 -08:00
Adam Jackson
2eedf42c22 dri: Fix GLX_Y_INVERTED_EXT fbconfig attribute
We're Y-inverted from GL's coordinates, so this is correct.  gnome-shell
doesn't seem to check this - somewhat reasonable since the only server
that answered the other way around was Xglx - but kwin does, and
upside-down hilarity ensues.

Tested-by: maelcum on #xorg-devel
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31 08:13:26 -07:00
Daniel Czarnowski
ccc8bb1153 glx: Handle float config types in glxConvertConfigs
Replaces old use of floatMode attribute with new, extended range of
values in __DRI_ATTRIB_RENDER_TYPE. Also adds new conditions, where the
float modes support requires it. Enables support for not only float
configs, but packed float configs as well.

v2 (idr): Whitespace and formatting fixes.  Refactor render type
vs. pbuffer checking to a separate function that includes a quote from
the spec.  Re-write commit message.  Fix compiler warnings:

glxdricommon.c: In function 'glxConvertConfigs':
glxdricommon.c:212:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:212:35: note: expected 'unsigned int *' but argument is of type 'int *'
glxdricommon.c:230:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:230:35: note: expected 'unsigned int *' but argument is of type 'int *'

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-24 11:47:42 -07:00
Eric Anholt
7ecfab47eb glx: Add support for the new DRI loader entrypoint.
This is going to be exposed (and not the old entrypoint) for some DRI
drivers once the megadrivers series lands, and the plan is to
eventually transition all drivers to that.  Hopefully this is
unobtrusive enough to merge to stable X servers so that they can be
compatible with new Mesa versions.

v2: typo fix in the comment

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-23 08:12:28 +08:00
Tomasz Lis
cf89aa5374 Full support of sRGB capable fbconfigs.
Changes to correctly initialize the sRGB capability attribute and
transfer it between XServer and the client. Modifications include
extension string, transferring visual config attribs and fbconfig
attribs. Also, attribute is initialized in the modules which do not
really use it (xquartz and xwin).
This version advertises both ARB and EXT strings, and initializes
the capability to default value of FALSE. It has corrected required
GLX version and does not influence swrast. The sRGB capable attribute
is attached only to those configs which do have this capability.
Both ARB and EXT versions share the same GLX extension enabling bit.

Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-03-18 10:02:00 -07:00
Daniel Stone
854c1fa4a1 Add a common ARRAY_SIZE macro to dix.h
Does what it says on the box, replacing those from Xi/ and glx/.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:06:41 -07:00
Keith Packard
9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -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
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
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
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
Dave Miller
5968634996 glx: fix crash in driGetConfigAttribIndex
Don't access GLboolean via int pointers
2008-08-09 16:45:59 +10:00
Kristian Høgsberg
c3eb5b80d8 Move GL/glx on level up now that it's the only thing left under GL. 2008-05-21 13:33:36 -04:00