Commit Graph

362 Commits

Author SHA1 Message Date
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
Maarten Maathuis
ec32878359 exa: check if the pixmap is pinned for unsupported AUX indices. 2009-03-18 19:36:18 +01:00
Maarten Maathuis
89d7b88f32 exa: allow exaModifyPixmapHeader to set sys_ptr for EXA_HANDLES_PIXMAPS
- exaModifyPixmapHeader would save sys_ptr if needed, but it would be NULL'ed afterwards.
- This is needed to support pixmaps that are not offscreen.
2009-03-13 00:44:48 +01:00
Maarten Maathuis
ce6e1771be exa: fix a serious issue in exaChangeWindowAttributes (and some more related things)
- fbChangeWindowAttributes can create pixmaps (and access them) without use preparing access.
- Also handle the destroyed pixmaps by finishing them first.
- Switch to DEST indices again in exaCreatePixmapWithPrepare, because they are obviously being rendered to.
- Also avoid calling FinishAccess on pixmaps that are destroyed (and their memory potentially invalid).
2009-03-04 16:51:10 +01:00
Maarten Maathuis
7fb68e8b31 exa: remove a few pExaPixmap checks.
- And make some fatal for a debug build.
2009-03-04 16:51:10 +01:00
Maarten Maathuis
bd2f35ef0d exa: fix unwrapping of ModifyPixmapHeader upon CloseScreen.
- Cleanup wrapping too.
2009-03-04 16:51:10 +01:00
Maarten Maathuis
da8ea41a54 exa: increase/rework safety checks in Prepare/FinishAccess. 2009-03-04 16:51:09 +01:00
Maarten Maathuis
3ea3d505e8 exa: avoid a potential Prepare/FinishAccess inbalance. 2009-03-04 16:51:09 +01:00
Maarten Maathuis
10334cf7e6 exa: simplify exaPixmapIsOffscreen
- This includes properly handling the framebuffer.
2009-03-04 16:51:09 +01:00
Maarten Maathuis
7bfad37f77 exa: fixup aux indices and ensure that the indices are used as they should be.
- 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-27 22:26:52 +01:00
Maarten Maathuis
f028b14876 exa: whitespace 2009-02-27 17:11:47 +01:00
Maarten Maathuis
ed00515ec5 exa: fixup exaAssertNotDirty.
- Do the right thing based on prepare access.
2009-02-27 17:11:35 +01:00
Maarten Maathuis
2e88b6004f exa: minor glyphs cleanup.
- This should fix subtle coordinate bugs and make the code a bit cleaner to read.
2009-02-27 16:58:30 +01:00
Michel Dänzer
265d20068a EXA: Fix check for whether the glyph we're evicting from the cache is in use.
Since commit f07f18231a ('EXA: Allow using
exaCompositeRects also when we can't use a mask in exaGlyphs.') we were
checking the wrong set of coordinates in the buffer where glyphs to be rendered
are accumulated when no mask is used in exaGlyphs.

This fixes occasional glyph corruption which can be corrected with redraws, in
particular with Qt4.

Thanks to Maarten Maathuis for asking the right question: 'where do we protect
against evicting glyphs that are still needed?'

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-27 16:41:39 +01:00
Michel Dänzer
9d5141f7bc EXA: No longer use the driver UploadToScratch hook.
See http://bugs.freedesktop.org/show_bug.cgi?id=20213 .

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-27 16:37:28 +01:00
Michel Dänzer
4cfb36f6ad EXA: Handle separate alpha maps properly in Composite fallback, take two.
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-27 16:37:28 +01:00
Michel Dänzer
de022f8e63 Revert "EXA: Handle separate alpha maps properly in Composite fallback."
This reverts commit 170cf1270d.

Conflicts:

	exa/exa_render.c
2009-02-27 16:37:27 +01:00
Michel Dänzer
f07f18231a EXA: Allow using exaCompositeRects also when we can't use a mask in exaGlyphs.
This should give the full benefits of the glyph cache even when we can't use a
mask.

This also means we no longer need to scan the glyphs to see if they overlap,
we can just use a mask or not as the client asks.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-26 10:35:44 +01:00