summaryrefslogtreecommitdiff
path: root/exa
AgeCommit message (Collapse)AuthorFilesLines
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>
2009-12-28EXA/mixed: Don't clear deferred status of pixmaps if migration is limited.Michel Dänzer1-1/+2
* With optimized migration, only the pending damage region is synchronized for destination pixmaps. * Migration of source pixmaps can be limited to a bounding region. 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-10EXA/mixed: Don't consider devKind for detecting dimension change.Michel Dänzer1-1/+0
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=25536 . There should be no reason for the pitch to actually change when none of the other dimensions do, and this could lead to incorrectly freeing the system memory copy when allocating a GPU copy, resulting in loss of valid pixmap contents. 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-08EXA: ModifyPixmapHeader_mixed fixes.Michel Dänzer1-3/+40
* Better detection of dimension changes. * Make sure to re-create the system memory copy when the pixmap dimensions change (e.g. the screen pixmap on screen resize). * Clear the valid regions. 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-08EXA: ExaDoPrepareAccess return value fixes.Michel Dänzer2-11/+20
Only return TRUE if the GPU copy is being accessed, and preserve the return value on repeated / nested calls for the same pixmap. exaPrepareAccessReg_mixed could get inconsistent return values e.g. when the same pixmap is both the destination and source of an operation, potentially resulting in a crash. 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-04exa/mixed: pixmaps that succeed prepare access have no need for a cpu copyMaarten Maathuis2-5/+20
- When they have a gpu copy ofcource. - Use the presence of a cpu copy as a hint to fall back instead of UTS'ing in exaHWCopyNtoN. 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-12-04EXA: Use correct coordinate system for calculating Composite fallback region.Michel Dänzer1-1/+3
Fixes incorrectly skipped rendering of some Composite operations to windows. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-03exa/mixed: setting devKind before exaCopyDirty* is not neededMaarten Maathuis1-4/+9
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-12-03Revert "exa: a few small pitch related changes"Maarten Maathuis2-14/+8
This reverts commit 99d88ef69d5f7dbf99ca605eceb92f42230a89f4. - Some pixmaps under classic have a sys_pitch which is 0, no idea why. This is causing rendering corruption. 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-30EXA: Don't defragment offscreen memory at allocation time.Michel Dänzer1-24/+1
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24300 . Offscreen memory allocation can occur from various places, and apparently doing defragmentation from at least some of them can confuse some driver acceleration code. There's still the regular background defragmentation in the WakeupHandler, which should manage to keep fragmentation at a reasonable level. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-30Revert "EXA: Accumulate arbitrary number of glyphs without flushing."Michel Dänzer1-22/+25
This reverts commit c11678cc189551f2a01eaa7a63969c16950739b4. Not sure what I was thinking, turns out alloca() of a size derived from client input is a bad idea. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-28exa: a few small pitch related changesMaarten Maathuis2-8/+14
- Setting pitch before exaCopyDirty* is not needed. 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-28exa: s/PixmapIsOffscreen/PixmapHasGpuCopy and ↵Maarten Maathuis12-94/+96
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-28exa: handle pixmap create/destroy in lower layersMaarten Maathuis7-162/+137
- 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-24Revert "exa/mixed: be more thorough about setting fb_pitch when needed"Maarten Maathuis1-13/+8
This reverts commit d4fc245115eb2cb323e06a82f9dd52518d9b6a16. - This is causing crashes/problems for some. Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-19EXA: Don't use UploadToScreen for CopyNtoN with mixed pixmaps.Michel Dänzer1-3/+9
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-11-18exa/mixed: be more thorough about setting fb_pitch when neededMaarten Maathuis1-8/+13
Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net>
2009-11-18exa/mixed: avoid copying back pixmap data when no migration took placeMaarten Maathuis1-1/+2
- When the driver handles the prepare access no copying is needed. - Delayed pixmap creation should be fine, because it's handled by the first prepare access, but the exaPixmapIsOffscreen check in finish access will return FALSE without a driver pixmap. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net>