Commit Graph

13 Commits

Author SHA1 Message Date
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
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
Matěj Cepl
b27d61e443 Fix UTF-8 encoding
Report to find out all non-UTF-8 files created by

cat extensions |xargs -I XXXX find . -name \*.XXXX |while read FILE ; do
    if ( iconv -f utf8 -t ucs2 $FILE >/dev/null 2>/dev/null ) ; then
        /bin/true
    else
        echo $FILE
    fi
done >>report

Signed-off-by: Matěj Cepl <mcepl@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>

[Daniel: git am failed for me, so I redid it.  The method listed in the
         commit message also failed, so I just used file/grep/iconv.  The
         results are the same though.]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-06-30 16:38:31 +10:00
Keith Packard
d5b16b037b Revert "dix: Remove usage_hint from pixmaps, store it in ->drawable.class"
This reverts commit 1564c82417.

The drivers used the top bits of the usage_hint to store driver
private flags (intel, radeon, nouveau).

With EXA we need to get at this data so if we migrate the pixmap we
can create the correct type of pixmap in the driver, however this
commit truncates the usage_hint into 8-bit class and loses all the
good stuff.

Signed-off-by: Dave Airlie <airlied@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-03-17 23:48:52 -07:00
Adam Jackson
1564c82417 dix: Remove usage_hint from pixmaps, store it in ->drawable.class
The class field was unused for pixmaps, and we don't have enough classes
to justify a whole uint32 anyway.

Reviewed-by: Soren Sandmann <ssp@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:16:50 -05:00
Maarten Maathuis
648d4fe517 exa/driver: set pExaPixmap->use_gpu_copy to the right value
- Not sure if it was causing problems, but you never know.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-02-02 14:53:06 -08:00
Michel Dänzer
0540c46066 EXA: Finish access to pixmap if it's prepared at destruction time.
Previously we assumed every pixmap destroyed during a software fallback was
also created during a software fallback and had access prepared, but that's
not always true.

Fixes a server abort
Reported-by: 邓逸昕 <bupt.dengyixin@gmail.com>

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Acked-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-07-13 10:07:04 -07:00
Tiago Vignatti
49835eec0c exa: check for NULL pointer before dereferences it
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Acked-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-21 18:06:59 +03:00
Maarten Maathuis
a54c23fe64 exa: s/PixmapIsOffscreen/PixmapHasGpuCopy and s/pExaPixmap->offscreen/pExaPixmap->use_gpu_copy
- Fixup some variable names as well.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Acked-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-28 12:44:58 -08:00
Maarten Maathuis
342f3689d1 exa: handle pixmap create/destroy in lower layers
- Pixmaps that are created during a fallback are automatically prepared access.
- During the fallback accelerated ops are blocked to prevent new/scratch gc's
  from triggering accelerated ops on mapped pixmaps.
- A few cases of incorrect wrapping (on the top level pointer instead of
  between damage and (w)fb) have been removed.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Acked-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-28 12:44:21 -08:00
Tiago Vignatti
9640407643 EXA: Preserve pPixmap->devPrivate.ptr in exaPixmapIsOffscreen_driver
It crash the server when the drawable is 32 bit and the framebuffer is 16.

This is pretty much a copy-past from commit 8e873185.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-05 13:27:55 -08:00
Dave Airlie
1545a120df exa: fix CreatePixmap2 to be useful for tiling.
This adds a pitch return so that the driver can align the pitch to any
value it wishes and not just the one it gave to EXA at startup.
2009-08-14 09:33:48 +10:00
Maarten Maathuis
ac7ac913fd exa: Split out some classic and driver allocated pixmap code into seperate files
- Create a few seperate functions and a few private function pointers.
- Replace a few if conditions with a check for pExaPix->pDamage instead.
- This is in preperation of a third scheme that lies somewhere in between.
- Code clarity would have suffered (i started working on it and didn't like the mess).
2009-08-06 23:48:13 +02:00