summaryrefslogtreecommitdiff
path: root/exa/exa_unaccel.c
AgeCommit message (Collapse)AuthorFilesLines
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-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änzer1-0/+2
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-06-05Rename region macros to eliminate screen argumentKeith Packard1-28/+28
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-05-20EXA: Wrap Glyphs even without Composite acceleration.Michel Dänzer1-0/+22
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-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-19unifdef -B -DRENDER to always include RENDER codeKeith Packard1-10/+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>
2009-12-29EXA: Restrict the regions that need to be migrated for composite fallback ↵Thomas Hellstrom1-41/+190
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: 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 Hellstrom1-1/+1
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-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-11-28exa: handle pixmap create/destroy in lower layersMaarten Maathuis1-35/+38
- 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-09-26EXA: Extend mixed pixmaps scheme to allow driver PrepareAccess hook to fail.Michel Dänzer1-22/+30
If the PrepareAccess hook fails, use the DownloadFromScreen hook to retrieve driver pixmap contents to a system RAM copy, perform software rendering on that and copy the results back using the UploadToScreen hook. Use the classic migration logic to minimize transfers (which as a bonus allows slightly cleaning up some of the existing mixed pixmap code). This enables things that weren't possible before with driver-allocated pixmap storage: If some (or all) GPU pixmap storage can't be mapped directly by the CPU, this can be handled between the PrepareAccess and DownloadFrom/UploadToScreen hooks, e.g.: * Radeon KMS on big endian machines can fail PrepareAccess if the pixmap requires byte-swapping and swap bytes in DownloadFrom/UploadToScreen. * Environments where GPU and CPU don't have a shared address space at all. Here the driver PrepareAccess hook will always fail and leave all transfers between GPU / CPU storage to the Download/From/UploadToScreen hooks. Drivers which can handle all pixmaps in the PrepareAccess hook should notice little if any difference.
2009-08-04EXA: Simplify exaGetPixmapFirstPixel using GetImage.Michel Dänzer1-45/+24
2009-05-15EXA: Take GC client clip type into account for migration.Michel Dänzer1-1/+1
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=18950 . Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-03-04exa: avoid a potential Prepare/FinishAccess inbalance.Maarten Maathuis1-5/+7
2009-02-27exa: fixup aux indices and ensure that the indices are used as they should be.Maarten Maathuis1-7/+7
- In a previous patch i forgot to add a FALSE somewhere it seems. - Rename AUX indices so the driver (think of driver managed pixmaps) can do optimisations based upon them. - Fix one abuse of DEST index now that we have the AUX indices (same reason as above).
2009-02-27EXA: Handle separate alpha maps properly in Composite fallback, take two.Michel Dänzer1-1/+24
Preserve the EXA ABI by introducing a new driver flag EXA_SUPPORTS_PREPARE_AUX. If the driver doesn't set this flag, we have to assume any Prepare/FinishAccess driver hooks can't handle the EXA_PREPARE_AUX* indices, so we move out such pixmaps at PrepareAccess time. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 . Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-27Revert "EXA: Handle separate alpha maps properly in Composite fallback."Michel Dänzer1-19/+1
This reverts commit 170cf1270dff38d3cce7f5ba5b940d1c0d70eff5. Conflicts: exa/exa_render.c
2009-02-24EXA: Handle separate alpha maps properly in Composite fallback.Michel Dänzer1-1/+19
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 . As this can't work without new EXA_PREPARE_AUX* indices, this requires a major version bump, so we can also drop the UploadToScratch driver hook and ExaOffscreenSwap*(). So this also fixes http://bugs.freedesktop.org/show_bug.cgi?id=20213 . Moreover, introduce EXA_DRIVER_KNOWN_MAJOR to break compilation of drivers which may not be able to handle EXA_PREPARE_AUX*, giving instructions how to make them build again in the #error message. Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-08exa: All fallbacks should have a GC, remove some code.Maarten Maathuis1-14/+1
- I did some testing with full fallbacks forced by the driver. - I ran rendercheck, expedite and the (full) x11perf test suite. - Thanks to ajax for pointing out this should be unneeded.
2009-02-06exa: don't use fbCopyNtoNMaarten Maathuis1-0/+50
2009-02-06exa: create ExaCheckGetImageMaarten Maathuis1-0/+30
2009-02-06exa: wrap the remainder of exa_unaccel.cMaarten Maathuis1-3/+27
2009-02-06exa: properly wrap GC functionsMaarten Maathuis1-46/+52
2008-12-26exa: preparing as source and finishing access as mask is a bad ideaMaarten Maathuis1-2/+2
2008-12-03Rework symbol visibility for easier maintenancePaulo Cesar Pereira de Andrade1-1/+1
Save in a few special cases, _X_EXPORT should not be used in C source files. Instead, it should be used in headers, and the proper C source include that header. Some special cases are symbols that need to be shared between modules, but not expected to be used by external drivers, and symbols that are accessible via LoaderSymbol/dlopen. This patch also adds conditionally some new sdk header files, depending on extensions enabled. These files were added to match pattern for other extensions/modules, that is, have the headers "deciding" symbol visibility in the sdk. These headers are: o Xext/panoramiXsrv.h, Xext/panoramiX.h o fbpict.h (unconditionally) o vidmodeproc.h o mioverlay.h (unconditionally, used only by xaa) o xfixes.h (unconditionally, symbols required by dri2) LoaderSymbol and similar functions now don't have different prototypes, in loaderProcs.h and xf86Module.h, so that both headers can be included, without the need of defining IN_LOADER. xf86NewInputDevice() device prototype readded to xf86Xinput.h, but not exported (and with a comment about it).
2008-11-28Make visible symbols required by xorg modules.Paulo Cesar Pereira de Andrade1-1/+1
This patch exports all symbols required by the compilable (in a x86 linux computer) xorg/driver/* modules. Still missing symbols worth mentioning are: sunleo miFindMaxBand no longer available intel (uxa/uxa-accel.c) fbShmPutImage no longer available (and should have been static) mga MGAGetClientPointer (should come from matrox's libhal) This is not a definitive "visibility" patch, as all it does is to export missing symbols, but the modules that current don't compile, may require more symbols once fixed, and third party drivers should also require more symbols exported. A "definitive" patch should export symbols defined in the sdk.
2008-10-23Wrap AddTraps in exa and damage.Keith Packard1-0/+14
This fine (and unused) function wasn't ever wrapped which made it not work under exa. (cherry picked from commit 06e7e1d0486e8c516a9b3219a2c86026f88825fc)
2008-08-08EXA: Make sure damage tracking code is inactive if the driver manages pixmaps.Michel Dänzer1-8/+7
It was always supposed to be like that... It was only recently pointed out (in a rather convoluted way) that it was not in fact the case.
2008-06-06EXA: Fix exaGetPixmapFirstPixel() crash if the driver has a CreatePixmap hook.Michel Dänzer1-1/+3
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16243
2008-05-24EXA: Only record damage generated by rendering operations.Michel Dänzer1-1/+4
Recording damage from other operations (e.g. creating a client damage record) may confuse the migration code resulting in corruption. Option "EXAOptimizeMigration" appears safe now, so enable it by default. Also remove it from the manpage, as it should only be necessary on request in the course of bug report diagnostics anymore.
2007-09-17EXA: Don't crash in ExaCheckPolyArc.Alan Hourihane1-0/+7
See https://bugs.freedesktop.org/show_bug.cgi?id=12286 .
2007-09-17EXA: Fixed compiler warnings.Tilman Sauerbeck1-2/+2
2007-09-17EXA: Added missing exaPrepare/FinishAccess calls in ExaCheckPushPixels.Tilman Sauerbeck1-0/+2
2007-09-13Remove the PaintWindow optimization.Eric Anholt1-17/+0
This was an attempt to avoid scratch gc creation and validation for paintwin because that was expensive. This is not the case in current servers, and the danger of failure to implement it correctly (as seen in all previous implementations) is high enough to justify removing it. No performance difference detected with x11perf -create -move -resize -circulate on Xvfb. Leave the screen hooks for PaintWindow* in for now to avoid ABI change.
2007-09-07EXA: exa(Shm)PutImage improvements.Michel Dänzer1-5/+5
Improve exaShmPutImage performance and reuse its core in exaPutImage as it seems faster than the previous code when the driver doesn't provide an UploadToScreen hook. Make sure all damage records are notified of the damage incurred by actual ShmPutImage calls. Remove superfluous manual damage tracking for actual PutImage calls.
2007-09-07EXA: exaGetImage improvements.Michel Dänzer1-13/+0
Use the new migration infrastructure to cache FB bits we need in the system copy, for the benefit of repeated calls.
2007-09-07EXA: Remove superfluous manual damage tracking.Michel Dänzer1-1/+0
These should all be covered by damage wrappers.
2007-09-07EXA: RENDER improvements.Michel Dänzer1-1/+28
Exclude bits that will be overwritten from migration. Use exaGlyphs even when Composite can't be accelerated, to avoid PolyFillRect roundtrip via offscreen memory. Initialize mask pixmap in exaGlyphs in FB in addition to system if the driver provides Composite hooks to avoid migration overhead. Remove manual damage tracking where superfluous.
2007-09-07EXA: Improvements for 1x1 pixmaps.Michel Dänzer1-4/+18
Initialize system and FB copy in exaFillRegionSolid and adapt exaGetPixmapFirstPixel to the new migration infrastructure. This should mostly eliminate migration overhead for these, whether they are used for acceleration or fallbacks.
2007-09-07EXA: Migrate out pixmap in exaPrepareAccess.Michel Dänzer1-7/+2
Also fix exaFinishAccessGC not to use the same index for tile and stipple.
2007-09-07EXA: Add a couple of missing exaPrepare/FinishAccess calls.Dave Airlie1-0/+7
2007-08-25Implement core protocol backing store exclusively in terms of Composite.Adam Jackson1-28/+0
Composite's automatic redirection is a more general mechanism than the ad-hoc BS machinery, so it's much prettier to implement the one in terms of the other. Composite now wraps ChangeWindowAttributes and activates automatic redirection for windows with backing store requested. The old backing store infrastructure is completely gutted: ABI-visible structures retain the function pointers, but they never get called, and all the open-coded conditionals throughout the DIX layer to implement BS are gone. Note that this is still not a strictly complete implementation of backing store, since Composite will throw the bits away on unmap and therefore WhenMapped and Always hints are equivalent.
2007-08-18EXA: Fix a couple of logic errors in exaGetPixmapFirstPixel.Fredrik Höglund1-12/+12
The fb pointer would be left uninitialized when exaPixmapIsOffscreen returned false. When it returned true and the pixmap was damaged, fb would be initialized from the pixmap's devPrivate.ptr before the exaDoMigration and exaPrepareAccess calls, at which point devPrivate.ptr would still be pointing at offscreen memory.
2007-07-27exaGetPixmapFirstPixel: avoid framebuffer readbacks if possible.Adam Jackson1-10/+27
If the pixel in framebuffer memory isn't modified since we uploaded it, we can just read from the system memory copy, wihch avoids both a readback and an accelerator stall. In principle this function is still wrong, and all the framebuffer pixel access should be going through (w)fb so we can get pixel layout corrections.