Commit Graph

402 Commits

Author SHA1 Message Date
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