summaryrefslogtreecommitdiff
path: root/exa
AgeCommit message (Collapse)AuthorFilesLines
2012-03-27Introduce a consistent coding styleKeith Packard13-4198/+4106
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> (cherry picked from commit 9838b7032ea9792bec21af424c53c07078636d21)
2011-11-23Convert a bunch of sprintf to snprintf callsAlan Coopersmith1-3/+3
This batch is the straightforward set - others are more complex and need more analysis to determine right size to pass. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-08-10EXA/mixed: Update sys_pitch in MPH even when there's no system memory copy.Michel Dänzer1-10/+13
Otherwise sys_pitch will be stale when a system memory copy is allocated. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38322 and a crash when unlocking the screen with xscreensaver, reported by Janne Huttunen. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Tested-by: Janne Huttunen <jahuttun@gmail.com> Tested-by: Jan Kriho <Erbureth@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-06-30Fix UTF-8 encodingMatěj Cepl8-12/+12
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-20EXA: fix typoRob Clark1-1/+1
The incorrect drawable deltas were applied if dst was a redirected window. Resulting in a bogus region passed to prepare_access_reg(). Signed-off-by: Rob Clark <rob@ti.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-22Add RegionInitBoxes(), and fix some buggy callers of RegionInit().Søren Sandmann Pedersen1-4/+3
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-03-28EXA: Use dixGetPrivate(Addr) instead of dixLookupPrivate.Michel Dänzer1-4/+3
The latter calls the former, let's cut the middle man and eliminate a branch in a hot path. According to Git history, ExaSetPixmapPriv was never used anywhere, just drop it. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-03-17Revert "dix: Remove usage_hint from pixmaps, store it in ->drawable.class"Keith Packard6-13/+13
This reverts commit 1564c82417d201de5b9a5ec5e7aa4ef14c45fbad. 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-08dix: Remove usage_hint from pixmaps, store it in ->drawable.classAdam Jackson6-13/+13
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-02-24EXA/mixed: ModifyPixmapHeader pitch fixes. (bug #33929)Michel Dänzer1-4/+5
If there's a GPU copy and a non-zero devKind was passed in, set the GPU copy pitch to that instead of to a possibly bogus value derived from the new width. This is e.g. used by the radeon driver's drmmode_xf86crtc_resize hook, fixes https://bugs.freedesktop.org/show_bug.cgi?id=33929 . On the other hand, the system memory copy doesn't need the pitch to be aligned beyond the PixmapBytePad of the width. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Cyril Brulebois <kibi@debian.org> Tested-by: Cyril Brulebois <kibi@debian.org> Reported-by: Thierry Vignaud <thierry.vignaud@gmail.com> Tested-by: Thierry Vignaud <thierry.vignaud@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-02-20Revert "exa/mixed: Exclude frontbuffer from deferred pixmap handling."Maarten Maathuis1-13/+4
This reverts commit 541b25038a5de74411a094570b407c5ae018c2ba. - It turns out that the high latency was a driver problem. - catting a large amount of text turns out to look prettier when the throughput is lower, but it's not worth the loss for a minor improvement that may not even exist on someone else's computer. 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-02exa/mixed: Exclude frontbuffer from deferred pixmap handling.Maarten Maathuis1-4/+13
- Apps like xterm can trigger a lot of fallback rendering. - This can lead to (annoyingly) high latencies, because you have to wait for the block handler. - You need a driver that doesn't directly access the front buffer to trigger this (NV50+ nouveau for example). - Repeatingly doing dmesg on an xterm with a bitmap font will reveal that you never see part of the text. - I have recieved at least one complaint in the past of slow terminal performance, which was related to core font rendering. - This does sacrifice some throughput, roughly 33% slower. 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-02exa: Only call driver FinishAccess hook if PrepareAccess hook succeeded.Maarten Maathuis1-1/+2
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-02exa/driver: set pExaPixmap->use_gpu_copy to the right valueMaarten Maathuis1-0/+2
- 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-01-06EXA: Pad size of system memory copy for 1x1 pixmaps (bug #32803).Michel Dänzer1-1/+1
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=32803 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-01-05Add subWindowMode parameter to SourceValidateVille Syrjälä1-2/+3
Pass the subWindowMode from the GC/source Picture to SourceValidate. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-22EXA: Fix crash with fill using 1x1 tile of depth < 8 (bug #24703).Michel Dänzer2-0/+4
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24703 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-10Replace usage of DamageRegionAppend with DamageDamageRegion to fix reportAfter.Eric Anholt1-2/+1
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-07-13EXA: Finish access to pixmap if it's prepared at destruction time.Michel Dänzer5-9/+29
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-06-11Merge remote branch 'dottedmag/for-keithp'Keith Packard1-8/+4
2010-06-11exa: fix ExaCheckCopyNtoN for exa_classic when source = destÉric Piel1-1/+2
In case you want to copy a region with source = dest, you have the same pixmap as source and dest. At the end of exaPixmapIsOffscreen_classic() the devPrivate.ptr is reset to NULL (look at the sources). Now this is what happens in ExaCheckCopyNtoN: exaPrepareAccess( pDst ); Calls IsOffscreen() sets devPrivate.ptr to NULL sets up devPrivate.ptr to real pointer Everything OK exaPrepareAccess( pSrc ); Calls IsOffscreen() sets devPrivate.ptr to NULL BAILS OUT CAUSE OF NESTED OPERATION SINCE DST EQUALS SRC We end up with devPrivate.ptr as NULL, and that is clearly wrong. In particular this fixes a segfault when using the psb driver (bug 28077) Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net> Reviewed-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-11Remove more superfluous if(p) checks around free(p)Matt Turner1-8/+4
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-06-06Remove more superfluous if(p) checks around free(p)Mikhail Gusarov1-2/+1
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-05Fix exa_priv.h declarations of privatesKeith Packard2-9/+10
exa_priv.h exposes the privates to the rest of the exa code, and yet the declarations of the privates wasn't fixed when the exa.c versions were. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard1-9/+15
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-05Rename region macros to eliminate screen argumentKeith Packard7-130/+130
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-05Change region implementation names to eliminate the 'mi' prefixKeith Packard1-1/+1
This prepares the file to be moved from mi to dix. This patch was done mechanically with the included scripts 'fix-miregion' run over the entire X server and 'fix-miregion-private' run over include/regionstr.h and mi/miregion.c. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-20EXA: Wrap Glyphs even without Composite acceleration.Michel Dänzer3-1/+37
In order to avoid migration ping-pong when accumulating glyphs in a mask picture. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov4-21/+21
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-04-26Exa screen private has SavedSourceValidate, not SourceValidateKeith Packard1-1/+1
Need to check the right field to see if there is a wrapped SourceValidate function. Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-26exa: avoid calling non existent SourceValidate callbackJerome Glisse1-3/+5
In unaccel path we were unconditionaly calling the SourceValidate callback but in some case it could be NULL. Check if we have a valid callback before calling it. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-26Revert "exa: avoid calling non existent SourceValidate callback"Keith Packard1-5/+3
This reverts commit daa6f9308fa57e41210f78d92dbdb3f1c8eae6ad. This one checked pScreen->SourceValidate instead of pExaScr->SourceValidate which would cause a segfault when pExaScr->SourceValidate was NULL.
2010-04-26exa: avoid calling non existent SourceValidate callbackJerome Glisse1-3/+5
In unaccel path we were unconditionaly calling the SourceValidate callback but in some case it could be NULL. Check if we have a valid callback before calling it. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21Merge remote branch 'vignatti/for-keith'Keith Packard4-11/+12
Conflicts: exa/exa.c Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21exa: don't need to check for NULL pointer if we already assumed it has a valueTiago Vignatti1-8/+6
the alternative would be to check ps in the beginning of the function. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Michel Dänzer <michel@daenzer.net>
2010-04-21exa: check for NULL pointer before dereferences itTiago Vignatti3-3/+6
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-19unifdef -B -DRENDER to always include RENDER codeKeith Packard4-28/+0
This patch was created with: git ls-files '*.[ch]' | while read f; do unifdef -B -DRENDER -o $f $f; done Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-14EXA: Check sys_ptr isn't NULL before passing it to the UploadToScreen hook.Michel Dänzer1-1/+1
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=27510 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-21exa: exaFinishAccess: Overrun of static array "pExaScr->access" of size 6 at ↵Oliver McFadden1-2/+2
position 6 with index variable "i" Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-17EXA/mixed: Clean up exaPrepareAccessReg_mixed() a little.Michel Dänzer1-12/+19
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-02-17exa/mixed: fix gnome-panel corruptionMaarten Maathuis1-8/+13
- A mapped pixmap can't be used for acceleration, any decent memory manager will refuse this. - Source pixmaps migrated with a bounding region are incomplete (from the gpu point of view), so do the upload unconditionally, instead of just for deferred destination pixmaps. - Fixes fd.o bug #26076. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-04EXA: Restore migration call in exaDoPutImage().Michel Dänzer1-0/+11
Turns out this is still necessary if the driver PrepareAccess hook succeeds. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Tested-by: Maarten Maathuis <madman2003@gmail.com> Tested-by: Andrew Chant <andrew.chant+debian@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-29EXA: Don't use UTS/DFS directly for Put/GetImage when there's a system copy.Michel Dänzer1-34/+8
We want to save the result in the system memory copy, in case we'll need it again for subsequent software fallbacks. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-By: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-29EXA: Restrict the regions that need to be migrated for composite fallback ↵Thomas Hellstrom2-41/+200
for src / mask pictures. [ Michel: Minor fixups to address compiler warnings ] Signed-off-by: Thomas Hellstrom <thellstrom@vmware.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>
2009-12-29EXA/mixed: Handle results of software fallbacks in DamageReport hook.Michel Dänzer4-39/+29
This is more elegant and probably also slightly more correct than doing it at FinishAccess time. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-29EXA: Fix migration avoidance for 1x1 pixmaps.Michel Dänzer2-1/+21
Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-29EXA/classic: Fix crash with migration heuristic "smart".Michel Dänzer1-0/+3
Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-29EXA: Limit src prepareAccess regions for a number of unaccelerated operations.Thomas Hellstrom1-27/+75
When we can trivially calculate the affected source regions, do that before calling region bounded prepareAccess. [ Michel: Minor fixups to address compiler warnings ] Signed-off-by: Thomas Hellstrom <thellstrom@vmware.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>
2009-12-29EXA: Use relevant source region to minimize migration on CopyWindow fallbacks.Michel Dänzer1-2/+12
Signed-off-by: Michel Dänzer <daenzer@vmware.com> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-29EXA: Fix bugs in exaGetImage / ExaCheckGetImage migration.Thomas Hellstrom2-2/+2
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Acked-by: Michel Dänzer <michel@daenzer.net> Acked-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>