Commit Graph

39 Commits

Author SHA1 Message Date
Michel Dänzer
6b96281100 EXA: Fix exaGetPixmapFirstPixel() crash if the driver has a CreatePixmap hook.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16243
2008-06-06 11:01:03 +02:00
Michel Dänzer
29586101dc EXA: Only record damage generated by rendering operations.
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.
2008-05-24 20:01:41 +02:00
Alan Hourihane
56cc24ffb2 EXA: Don't crash in ExaCheckPolyArc.
See https://bugs.freedesktop.org/show_bug.cgi?id=12286 .
2007-09-17 20:40:06 +02:00
Tilman Sauerbeck
3876c6c805 EXA: Fixed compiler warnings. 2007-09-17 18:47:45 +02:00
Tilman Sauerbeck
d5738ff2e0 EXA: Added missing exaPrepare/FinishAccess calls in ExaCheckPushPixels. 2007-09-17 17:42:55 +02:00
Eric Anholt
e4d11e58ce Remove the PaintWindow optimization.
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-13 00:08:53 +00:00
Michel Dänzer
be922b3048 EXA: exa(Shm)PutImage improvements.
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-07 18:41:33 +02:00
Michel Dänzer
ea92ea4156 EXA: exaGetImage improvements.
Use the new migration infrastructure to cache FB bits we need in the system
copy, for the benefit of repeated calls.
2007-09-07 18:41:32 +02:00
Michel Dänzer
aa2ed73e0e EXA: Remove superfluous manual damage tracking.
These should all be covered by damage wrappers.
2007-09-07 18:41:32 +02:00
Michel Dänzer
a634c9b034 EXA: RENDER improvements.
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-07 18:41:32 +02:00
Michel Dänzer
1f457ff3db EXA: Improvements for 1x1 pixmaps.
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-07 18:41:31 +02:00
Michel Dänzer
8cfcf9973c EXA: Migrate out pixmap in exaPrepareAccess.
Also fix exaFinishAccessGC not to use the same index for tile and stipple.
2007-09-07 18:41:29 +02:00
Dave Airlie
e510a77ba4 EXA: Add a couple of missing exaPrepare/FinishAccess calls. 2007-09-07 18:41:29 +02:00
Adam Jackson
ae7f71a8b3 Implement core protocol backing store exclusively in terms of Composite.
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-25 15:08:20 -04:00
Fredrik Höglund
3c448b0eb6 EXA: Fix a couple of logic errors in exaGetPixmapFirstPixel.
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-08-18 19:02:18 +02:00
Adam Jackson
486fd4145a exaGetPixmapFirstPixel: avoid framebuffer readbacks if possible.
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.
2007-07-27 13:10:39 -04:00
Michel Dänzer
0880aaac9c EXA: PutImage improvements.
* Migrate for fallbacks when appropriate.
* Add damage tracking in ExaCheckPutImage.
2007-04-29 23:48:19 +02:00
Michel Dänzer
0c8905ebc9 EXA: PolyFillRect improvements.
* Convert rects to region and use it for damage tracking.
* When possible, defer to exaFillRegion{Solid,Tiled} using converted region.
* Always migrate for fallbacks.
* Move damage tracking out of ExaCheckPolyFillRect.
2007-04-29 23:47:08 +02:00
Michel Dänzer
9563b2eea2 EXA: Lots of damage tracking fixes.
Mostly due to exaDrawableDirty() now calculating the backing pixmap coordinates
internally, for cases where they aren't trivially known. There's a new
exaPixmapDirty() function for the other cases.
2006-12-19 18:57:22 +01:00
Michel Dänzer
f9f33b72e3 Track per-drawable damage to minimize UTS and DFS transfers.
Based on work by Eric Anholt.
2006-06-12 20:19:11 +02:00
Eric Anholt
8738bc295b Improve EXA fallback debugging output to include the locations of pixmaps.
This is being used in tracking down recent compositing performance
    regressions.
2006-04-27 20:27:27 +00:00
Eric Anholt
83b061776a Add trivial PolySegment acceleration for 0-width horizontal/vertical lines,
which still happen somewhat frequently and were cluttering up my
    fallback debugging output. x11perf says it's a major performance win in
    those cases (though probably irrelevant), and it passes Xlib9.
2006-04-27 19:17:34 +00:00
Eric Anholt
771b366abe Fix exaGetPixmapFirstPixel to migrate as unaccelerated. Also adds a bit of
fallback debugging info to PolyGlyphBlt.
2006-04-18 18:50:35 +00:00
Eric Anholt
5f95146fcf Export exaPrepare/FinishGC to the rest of EXA, and use it in the ImageGlyph
implementation to avoid unprepared access to the tile. Also, relocate
    the fbGetDrawable to avoid using a stale dest pointer after
    exaSolidBoxClipped() may have migrated it. Revealed by xtest.
2006-04-01 22:35:16 +00:00
Eric Anholt
d1e90113fc Don't attempt to Prepare/FinishAccess NULL pDrawables. Exposed by new
gradient testing in rendercheck.
2006-03-31 23:22:29 +00:00
Eric Anholt
2e38fedd29 Add an option to EXA for the DDX to request that EXA hide the pixmap's
devPrivate.ptr when pointing at offscreen memory, outside of
    exaPrepare/FinishAccess(). This was used with fakexa to find (by NULL
    dereference) many instances of un-Prepared CPU access to the
    framebuffer:
- GC tiles used in several ops when fillStyle == FillTiled were never
    Prepared.
- Migration could lead to un-Prepared access to mask data in render's
    Trapezoids and Triangles
- PutImage's UploadToScreen failure fallback failed to Prepare.
2006-03-31 19:41:28 +00:00
Eric Anholt
f480dc797b Revert mistaken commit to exa_unaccel.c. Should have been to
exa_offscreen.c: Correct a typo in debug-only offscreen validation
    code. (Wang Zhenyu)
2006-03-31 19:25:42 +00:00
Eric Anholt
1a8167c1ba Correct a typo in debug-only offscreen validation code. (Wang Zhenyu) 2006-03-31 19:16:51 +00:00
Eric Anholt
759033703c Remove the exaAsyncPixmapGCOps mostly-unaccelerated ops vector, and always
plug in the accelerated one, even if the destination pixmap is
    currently offscreen. This was a leftover from when kaa originally got
    accelerated offscreen pixmap support, and its only concievable use was
    to avoid a little overhead on ops to in-system pixmaps that weren't
    going to get migrated. At this point, we probably care more about just
    getting everything accelerated that we easily can, which should happen
    with the new migration support.
2006-03-30 21:44:36 +00:00
Eric Anholt
693e42114f Move migration logic to a new function, exaDoMigration(). This is largely a
manual conversion to allow for different migration schemes to be
    implemented reasonably, but does include some minor improvements such
    as accounting for pinned pixmaps not being acceleratable, and for our
    current GetImage and GetSpans not being accelerated.
2006-03-14 21:30:12 +00:00
Eric Anholt
d309054780 Pull code for getting the (0,0) pixel from a pixmap out to a separate
function, since it gets repeated (with bad error handling, in one
    case).
2006-03-14 20:38:06 +00:00
Eric Anholt
3366b68365 Rearrange and rename EXA code to be a bit more logically organized. Also
removes a little bit of debugging leftovers. Summary:
exa.c -> exa.c (miscellaneous code) exa_accel.c (all acceleration code)
    exa_migration.c (migration logic) exaasync.c -> exa_unaccel.c (software
    fallbacks) exapict.c -> exa_render.c (render extension stuff)
    exaoffscreen.c -> exa_offscreen.c exaPriv.h -> exa_priv.h
2006-02-02 20:09:14 +00:00
Eric Anholt
744aa34ca5 Add an additional meaning to the "dirty" flag. Now, if !dirty && !area, the
pixmaps's contents are undefined, so we won't need to upload the
    undefined contents in MoveIn. Use the ExaCheck* for async ops as well,
    so that dirty is always tracked. While the performance impact for my ls
    -lR test was not significant (though the avoiding-upload path was being
    hit), it's likely to be important for the upcoming Get/PutImage
    acceleration from ajax.
2005-10-15 02:19:09 +00:00
Eric Anholt
361a9eb953 - Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
    you got moved in. Instead, do the above-threshhold check separate from
    score starting out less than max. While this will likely make thrashing
    cases worse, I hope it will fix some issues with long term performance
    (think of an xcompmgr with a backbuffer it's doing only accelerated
    operations to. If some new pixmap comes in and bumps it out, even once,
    it will never get a chance to re-migrate because its score will be
    maxed). Change migration-out to be the same way for symmetry, though it
    shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
    completeness. The fallback debugging covers a lot more now, pointing
    out new areas for improvement. Debugging toggles are now centralized in
    exaPriv.h.
2005-09-21 10:27:53 +00:00
Eric Anholt
b0f6fe1f38 Add some optional (disabled) fallback debugging code to the async code, for
better tracking of when we're hitting software.
2005-09-11 21:38:41 +00:00
Eric Anholt
1c003ccf5d Add a pair of hooks, PrepareAccess() and FinishAccess(), which get called
around CPU access to the framebuffer. This allows the hardware to set
    up swappers to deal with endianness, or to tell EXA to move the pixmap
    out to framebuffer if insufficient swappers are available (note: must
    not fail on front buffer!).
Submitted by: benh
2005-09-11 19:08:10 +00:00
Eric Anholt
0711502f18 Bugzilla #4226: Change the pixmap migration strategy for the CopyNtoN case.
Now, if either source or dest were in framebuffer, try to get both
    there, but prefer system memory for both otherwise. Required making
    exaasync.c go through the try-acceleration path. This significantly
    improves window resizing under composite, because previously the
    pattern of creating a new pixmap and copying default contents from the
    screen caused a fallback every time due to the new destination pixmap
    being in system memory.
2005-08-24 23:48:11 +00:00
Zack Rusin
e34f31762e This fixes the close screen mess (crash reported by Thomas). Also hide the
private Exa screen definition. Properly cleanup on screen close and do
    not delete the private screen in the DriverFini call.
2005-07-04 14:15:57 +00:00
Zack Rusin
30c019e847 Adding the new acceleration architecture: Exa. It's meant to replace XAA in
the coming months.
2005-07-01 08:56:12 +00:00