Commit Graph

479 Commits

Author SHA1 Message Date
Michel Dänzer
6358a60065 EXA: Pad size of system memory copy for 1x1 pixmaps (bug #32803).
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-06 08:37:27 -08:00
Ville Syrjälä
e41e907b3c Add subWindowMode parameter to SourceValidate
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>
2011-01-05 11:56:28 -08:00
Michel Dänzer
e06fa80400 EXA: Fix crash with fill using 1x1 tile of depth < 8 (bug #24703).
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-12-22 11:38:05 -08:00
Eric Anholt
f36153e3ef Replace usage of DamageRegionAppend with DamageDamageRegion to fix reportAfter.
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-11-10 15:51:03 -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
Keith Packard
a41d6e9bff Merge remote branch 'dottedmag/for-keithp' 2010-06-11 10:08:13 -07:00
Éric Piel
7e8f100121 exa: fix ExaCheckCopyNtoN for exa_classic when source = dest
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-11 09:16:32 -07:00
Matt Turner
f4190feb25 Remove more superfluous if(p) checks around free(p)
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-11 19:05:46 +07:00
Mikhail Gusarov
0a4d8cbdcd Remove more superfluous if(p) checks around free(p)
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-06 20:27:18 +07:00
Keith Packard
6bd5f0d75b Fix exa_priv.h declarations of privates
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-05 21:12:41 -07:00
Keith Packard
faeebead7b Change the devPrivates API to require dixRegisterPrivateKey
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-05 19:23:03 -07:00
Keith Packard
2dc138922b Rename region macros to eliminate screen argument
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-05 18:59:00 -07:00
Keith Packard
9b6f5f549d Change region implementation names to eliminate the 'mi' prefix
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-06-05 17:47:32 -07:00
Michel Dänzer
a1c2bdb6ab EXA: Wrap Glyphs even without Composite acceleration.
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-20 07:48:51 -07:00
Mikhail Gusarov
3f3ff971ec Replace X-allocation functions with their C89 counterparts
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-05-13 00:22:37 +07:00
Keith Packard
25d1c6cd37 Exa screen private has SavedSourceValidate, not SourceValidate
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-26 11:04:38 -07:00
Jerome Glisse
b557571dbf exa: avoid calling non existent SourceValidate callback
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-26 09:15:22 -07:00
Keith Packard
0e6e75b04e Revert "exa: avoid calling non existent SourceValidate callback"
This reverts commit daa6f9308f.

This one checked pScreen->SourceValidate instead of
pExaScr->SourceValidate which would cause a segfault when
pExaScr->SourceValidate was NULL.
2010-04-26 09:14:22 -07:00
Jerome Glisse
daa6f9308f exa: avoid calling non existent SourceValidate callback
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-26 08:42:57 -07:00
Keith Packard
7ac6a6b7d0 Merge remote branch 'vignatti/for-keith'
Conflicts:
	exa/exa.c

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 16:07:38 -07:00
Tiago Vignatti
471f350c99 exa: don't need to check for NULL pointer if we already assumed it has a value
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-21 18:07:22 +03: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
Keith Packard
28b7b2b8d0 unifdef -B -DRENDER to always include RENDER code
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-19 09:26:10 -07:00
Michel Dänzer
7b65175266 EXA: Check sys_ptr isn't NULL before passing it to the UploadToScreen hook.
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-04-14 17:10:07 -07:00
Oliver McFadden
d9ee31ab05 exa: exaFinishAccess: Overrun of static array "pExaScr->access" of size 6 at 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-03-21 15:20:07 -07:00
Michel Dänzer
03ef00ae79 EXA/mixed: Clean up exaPrepareAccessReg_mixed() a little.
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-17 23:22:36 -08:00
Maarten Maathuis
9623daad7c exa/mixed: fix gnome-panel corruption
- 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-02-17 23:22:33 -08:00
Michel Dänzer
e707612e9d EXA: Restore migration call in exaDoPutImage().
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>
2010-01-04 08:28:12 -08:00
Michel Dänzer
db2c6f7c91 EXA: Don't use UTS/DFS directly for Put/GetImage when there's a system copy.
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-29 11:10:41 -08:00
Thomas Hellstrom
f28ca728e9 EXA: Restrict the regions that need to be migrated for composite fallback 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-29 11:05:08 -08:00
Michel Dänzer
0c1f43c0f3 EXA/mixed: Handle results of software fallbacks in DamageReport hook.
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-29 11:04:51 -08:00
Michel Dänzer
08bf26c28f EXA: Fix migration avoidance for 1x1 pixmaps.
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-29 11:04:40 -08:00
Michel Dänzer
0bd8f0cd7f EXA/classic: Fix crash with migration heuristic "smart".
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-29 11:04:07 -08:00
Thomas Hellstrom
40453bf771 EXA: Limit src prepareAccess regions for a number of unaccelerated operations.
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-29 11:03:14 -08:00
Michel Dänzer
aa9ce8ab34 EXA: Use relevant source region to minimize migration on CopyWindow 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-29 11:02:56 -08:00
Thomas Hellstrom
39cc110caa EXA: Fix bugs in exaGetImage / ExaCheckGetImage migration.
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-29 11:02:40 -08:00
Michel Dänzer
661630f909 EXA/mixed: Don't clear deferred status of pixmaps if migration is limited.
* 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-28 22:01:38 -08:00
Michel Dänzer
df2635d464 EXA/mixed: Don't consider devKind for detecting dimension change.
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-10 09:11:14 -08:00
Michel Dänzer
955b9f23a3 EXA: ModifyPixmapHeader_mixed fixes.
* 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-08 13:06:42 -08:00
Michel Dänzer
c1503861cf EXA: ExaDoPrepareAccess return value fixes.
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-08 13:06:37 -08:00
Maarten Maathuis
fd86738733 exa/mixed: pixmaps that succeed prepare access have no need for a cpu copy
- 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-04 22:10:13 -08:00
Michel Dänzer
bb7acfbcfb EXA: Use correct coordinate system for calculating Composite fallback region.
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-04 07:46:15 -08:00
Maarten Maathuis
0f4ef7123d exa/mixed: setting devKind 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-12-03 16:45:08 -08:00
Maarten Maathuis
8ea415d417 Revert "exa: a few small pitch related changes"
This reverts commit 99d88ef69d.

- 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-12-03 08:41:48 -08:00
Michel Dänzer
8754db77d8 EXA: Don't defragment offscreen memory at allocation time.
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-30 08:37:06 -08:00
Michel Dänzer
0e555a1033 Revert "EXA: Accumulate arbitrary number of glyphs without flushing."
This reverts commit c11678cc18.

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-30 08:36:54 -08:00
Maarten Maathuis
99d88ef69d exa: a few small pitch related changes
- 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-28 12:45:08 -08: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
Maarten Maathuis
55f60e1923 Revert "exa/mixed: be more thorough about setting fb_pitch when needed"
This reverts commit d4fc245115.

- 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-24 00:38:52 -08:00
Michel Dänzer
b8b8db9835 EXA: Don't use UploadToScreen for CopyNtoN with mixed pixmaps.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-11-19 11:39:27 -08:00
Maarten Maathuis
d4fc245115 exa/mixed: be more thorough about setting fb_pitch when needed
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Acked-by: Michel Dänzer <michel@daenzer.net>
2009-11-18 13:32:56 -08:00
Maarten Maathuis
647b79f87a exa/mixed: avoid copying back pixmap data when no migration took place
- 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>
2009-11-18 13:28:41 -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
Maarten Maathuis
412c56ef33 exa: remove some outdated comment
- This comment is still in exa_driver.c and there it makes sense.

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-02 08:11:27 -08:00
Michel Dänzer
1088073b11 EXA: Fix exaTryDriverSolidFill() for solid source pictures.
Solid pictures have a NULL pFormat field, but their format is always
PICT_a8r8g8b8.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-09 18:04:30 -07:00
Ben Skeggs
55305cf8db EXA: fix exaGetRGBAFromPixel to not loop forever on PICT_a8 picture
Easily reproducible by running "rendercheck -t fill".

It should be safe to just test against rbits for all colour components
as we should always have values for r/g/bbits for PICT_FORMAT_COLOR
formats.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Michel Dänzer <daenzer@vmware
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-09 16:08:15 -07:00
Michel Dänzer
b5fcc5553e exa: avoid infinite loops if UTS sw fallbacks.
The upload in finish access can cause an infinite loop if
UTS returns FALSE in here.

Fixes fd.o bug #24246.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-01 15:52:28 +10:00
Michel Dänzer
73ae547d5e EXA: Fix mixed pixmaps crash with missing / failing UploadToScreen hook.
For the recent mixed pixmaps changes, I failed to realize (or hit in my
testing) a problem which can occur if the driver doesn't provide an
UploadToScreen hook or provides one which can fail: There can be a crash
in exaMemcpyBox() because exaCopyDirtyToFb() passes pExaPixmap->fb_ptr to
exaCopyDirty(), but that's normally NULL with driver allocated pixmaps.

The solution is to make exaCopyDirty*() no longer rely on pExaPixmap->fb_ptr
but use pPixmap->devPrivate.ptr after PrepareAccess instead.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24167 .
2009-09-27 02:08:10 +02:00
Michel Dänzer
abb8108fb4 EXA: Only calculate cache position once for each glyph. 2009-09-26 02:05:24 +02:00
Michel Dänzer
c11678cc18 EXA: Accumulate arbitrary number of glyphs without flushing. 2009-09-26 02:05:06 +02:00
Michel Dänzer
0369eeeb6b EXA: Try to minimize UploadToScreen calls for mixed pixmaps.
If there are several software fallbacks affecting the system memory copy of the
same pixmap, only copy the results back to the driver pixmap when it's used for
acceleration again, or in the BlockHandler, whichever happens first.
2009-09-26 02:04:48 +02:00
Michel Dänzer
1818cbd70f EXA: Extend mixed pixmaps scheme to allow driver PrepareAccess hook to fail.
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-09-26 01:59:39 +02:00
Michel Dänzer
096f21bb7a EXA: Fix some issues pointed out by clang.
Remove dead variables, fix use of uninitialized values, that kind of thing.
2009-09-23 08:24:06 +02:00
Michel Dänzer
d3ad1804a5 EXA: Only take special code path for 1x1 fill for pixmaps.
It doesn't make sense for windows.

Also double-check that the data pointer is valid.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=23461 (not sure that could
happen on master even without this, but just in case)
2009-09-08 15:25:19 +02:00
Michel Dänzer
be37f339a9 EXA: Stop hiding solid or gradient pictures from the driver.
Add support for solid pictures in exaTryDriverSolidFill(), but otherwise just
pass solid and gradient pictures to the driver Composite hook.

While we're at it, clean up the logic to detect Composite operations which are
effectively solid fills or copies. This should also fix some false negatives
and positives.
2009-09-04 23:11:13 +02:00
Michel Dänzer
8e873185f4 EXA: Preserve pPixmap->devPrivate.ptr in exaPixmapIsOffscreen_mixed.
Otherwise we may incorrectly clobber it to NULL on repeated PrepareAccess
calls.
2009-09-03 19:11:02 +02:00
Dave Airlie
1373c2ea87 exa: clarify createpixmap2 new pitch return 2009-08-15 12:14:26 +10: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
d573cc46d3 exa: more safety 2009-08-08 11:38:51 +02:00
Maarten Maathuis
8b652435cd exa: minor cleanup 2009-08-08 11:38:51 +02:00
Maarten Maathuis
a73f95aa93 exa: Fix the broken upload fallback for "mixed"
- Replace it with something wfb friendly while i'm at it.
2009-08-08 11:38:51 +02:00
Maarten Maathuis
3943df7f76 exa: one can never be too careful 2009-08-07 20:38:14 +02:00
Maarten Maathuis
1548e8ae5d exa: fix a potential loophole in "mixed"
- Always free sys_ptr before setting the pixmap to pinned.
2009-08-07 20:38:14 +02:00
Maarten Maathuis
3047bd0674 exa: delay malloc for "mixed" 2009-08-06 23:48:14 +02:00
Maarten Maathuis
e8ac2ed5dc exa: implement exaMoveInPixmap for "mixed"
- This can be used to force creation of driver pixmap.
- Not for 1 or 4 bpp.
- Driver can still fail (driver) pixmap creation.
2009-08-06 23:48:14 +02:00
Maarten Maathuis
9d2a7128d3 exa: Use damage to optimise away useless copies. 2009-08-06 23:48:14 +02:00
Maarten Maathuis
03ecb164f2 exa: A simple 3rd backend implementation.
- Based on driver pixmaps with some changes (completely transparent to driver).
- It helps with the problem of known software fallbacks, such as trapezoids.
- exaDoMigration is now called for all cases that provide a do_migration hook.
- exa_migration.c is renamed to exa_migration_classic.c
2009-08-06 23:48:14 +02: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
Michel Dänzer
a6ce6c70cf EXA: Simplify exaGetPixmapFirstPixel using GetImage. 2009-08-04 23:23:21 +02:00
Michel Dänzer
842373104d Add support for RENDER BGRA formats. 2009-08-04 23:23:21 +02:00
Michel Dänzer
268e227ba0 EXA: Make Prepare/FinishAccess tracking resilient to repeated / nested calls.
Use reference counting and do nothing unless the reference count transitions
to/from 0.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=22822 .

As a bonus, this avoids calling the driver Prepare/FinishAccess hooks more than
once per pixmap and operation.

Also update the Doxygen documentation for the PrepareAccess driver hook to
better match current reality.
2009-07-21 14:34:13 +02:00
Michel Dänzer
de7a14ca92 EXA: Fix up some issues introduced by 00fe4a2977.
* Check all pixmaps involved for damage records, fixes visual corruption due to
  the screen pixmap never having one.
* Fix an array size and remove a now superfluous assignment.
2009-07-21 12:55:27 +02:00
Michel Dänzer
2415e2dce9 EXA: Bail earlier from exaDoPutImage if the driver has no UploadToScreen hook.
Also remove dead code associated with access_prepared local variable.
2009-07-20 02:08:31 +02:00
Michel Dänzer
00fe4a2977 EXA: Completely eliminate exaDoMigration calls for drivers that manage pixmaps. 2009-07-20 02:04:40 +02:00
Peter Hutterer
dc82e11e50 exa: switch to byte counting functions.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Michel Dänzer <michel@daenzer.net>
2009-07-14 10:13:26 +10:00
Michel Dänzer
3575854481 EXA: Only pass CT_YXBANDED to RECTS_TO_REGION() if that is really true.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=22642 .
2009-07-10 20:06:02 +02:00
Ben Skeggs
fa18c569ed exa: driver pixmaps enabled if either CreatePixmap or CreatePixmap2 present 2009-06-09 09:24:32 +10:00
Michel Dänzer
4addfcd633 EXA: Allocate from the end of free offscreen memory rather than from the start.
This way we don't always need to scan over previously allocated areas when
looking for an available one, and there might be less fragmentation.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-05-18 17:53:35 +02:00
Michel Dänzer
510cbd43cd EXA: Defragment offscreen memory.
At most once per second, under the following circumstances:

* We can't satisfy an offscreen memory allocation, but there seems to be enough
  offscreen memory available in total.

or

* The server has been idle for at least 100ms, and there is more than one
  available offscreen area.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-05-18 17:48:57 +02:00
Michel Dänzer
7c8327f0a7 EXA: Always damage glyph cache pixmap manually after uploading a glyph.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-05-15 15:48:37 +02:00
Michel Dänzer
850675d4de EXA: Take GC client clip type into account for migration.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=18950 .

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-05-15 15:48:37 +02:00
Dave Airlie
8dc8812c22 exa: add missing exa.h header include 2009-04-23 12:13:35 +10:00
Dave Airlie
3ec6a121e1 exa: missed exa.h change 2009-04-23 12:13:05 +10:00
Dave Airlie
02ae85c4c9 exa: add CreatePixmap2 hook for driver pixmaps.
This adds a revised pixmap hook for driver pixmaps, which is
required to support tiling on various chips.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-04-23 12:04:17 +10:00
Dave Airlie
9d684ba0bc exa: avoid offscreen pixmap swapped out flag for driver pixmaps 2009-04-23 11:42:53 +10:00
Maarten Maathuis
1b5758bef0 exa: implement UTS based upload through CopyArea
- Some image viewers (eog, gqview) trigger the CopyArea path of Xext/shm.c
- I'm not aware of any code path that wouldn't like UTS and trigger this code.
- miDoCopy should handle src coordinate clipping.
- Overlapping blits are obviously not an issue (both would have to be offscreen or not).
2009-04-10 21:14:47 +02:00
Michel Dänzer
346e71525f EXA: If the driver can't composite to an a8 mask, try an argb mask for glyphs.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-04-09 09:36:41 +02:00
Maarten Maathuis
12aeddf5ad exa: Accept scratch pixmaps with offscreen memory as such. 2009-03-19 20:40:03 +01:00
Maarten Maathuis
a635bb5357 exa: round of fb_pitch to the next byte 2009-03-18 19:36:18 +01:00