Commit Graph

479 Commits

Author SHA1 Message Date
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
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
Michel Dänzer
b26c136ee9 EXA: Stop tracking damage for pixmaps subject to ModifyPixmapHeader.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-26 10:35:44 +01:00
Michel Dänzer
170cf1270d EXA: Handle separate alpha maps properly in Composite fallback.
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-24 09:22:09 +01:00
Maarten Maathuis
b2ceea3635 Revert "exa: the extent of the valid region is probably much larger than that of the pending damage."
This reverts commit 97c1cbc702.

- Sorry for the thinko, pending damage is often not fragmentated.
- Should the dst region become fragmentated, you actually want to copy more to unfragmentate it.
2009-02-17 19:40:59 +01:00
Maarten Maathuis
3175646b10 exa: exaPixmapDirty should use official damage functions.
- Otherwise other users will not be notified of damage.
2009-02-17 19:25:35 +01:00
Maarten Maathuis
97c1cbc702 exa: the extent of the valid region is probably much larger than that of the pending damage.
- Since the default has been changed from nothing to everything.
2009-02-17 19:25:35 +01:00
Maarten Maathuis
caa5310e16 exa: reintroduce src rect optimisation, with a slightly higher threshold.
- I got some feedback on gtkperf line test regression.
- The increased threshold should ensure the destination optimisation is dominant.
2009-02-16 20:41:14 +01:00
Maarten Maathuis
46eeaf82e2 exa: fix performance regression from 736b6fbd2c
- The src optimisation is more aggressive and possibly harmful in light of the new initial state of pixmaps.
- There is now actually a performance improvement by almost always keeping the number of rects low.
2009-02-16 17:41:51 +01:00
Michel Dänzer
736b6fbd2c EXA: Try to prevent the valid regions from growing too many rects.
This helps contain region management overhead in some pathological cases, see
e.g. http://bugs.freedesktop.org/show_bug.cgi?id=16647 .

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-15 17:44:51 +01:00
Maarten Maathuis
1cb5afdf1e dix: always NULL pGC->tile.pixmap in Create{Scratch}GC. 2009-02-08 18:59:17 +01:00
Maarten Maathuis
6fd8fe9cb9 exa: fix exaValidateGC.
- use DEST in the createPixmap wrapper, because stipple already takes MASK (in case someone uses swappers).
- Anticipate some of the less common situations when fbValidateDrawable will access tile related pixmaps.
2009-02-08 18:43:15 +01:00
Maarten Maathuis
30daba6903 exa: All fallbacks should have a GC, remove some code.
- 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-08 02:08:13 +01:00
Maarten Maathuis
ffa72793e2 exa: Calling exaMarkSync after UTS is the drivers responsibility. 2009-02-07 21:58:17 +01:00
Maarten Maathuis
68665d78e7 exa: don't use fbCopyNtoN 2009-02-06 18:42:39 +01:00
Maarten Maathuis
2e76958d30 fb: move some code to mi 2009-02-06 18:42:39 +01:00
Maarten Maathuis
f06bde3d4b exa: create ExaCheckGetImage 2009-02-06 18:42:39 +01:00
Maarten Maathuis
258fc4b106 exa: wrap the remainder of exa_unaccel.c 2009-02-06 18:42:38 +01:00
Maarten Maathuis
6fabf24949 exa: use proper wrapping in exa.c 2009-02-06 18:42:38 +01:00
Maarten Maathuis
015c99a4ad exa: properly wrap GC functions 2009-02-06 18:42:38 +01:00
Maarten Maathuis
5e6a06fe69 exa: add GC private 2009-02-06 18:42:38 +01:00
Maarten Maathuis
5cc67ae94c exa: kill of exaImageGlyphBlt
- It serves no obvious purpose, yet it directly accesses many fb
symbols.
2009-02-06 18:42:38 +01:00
Maarten Maathuis
6483834200 exa: Remove one of the many calls directly into the fb layer. 2009-02-06 18:42:38 +01:00
Michel Dänzer
f112d6bf59 EXA: Try harder to keep current pixmap copy up to date in exaMigrateToward*.
This is probably required, but apparently not sufficient, for making migration
heuristics other than "always" work correctly again. Not that I really care
about them...
2009-02-06 18:30:43 +01:00
Michel Dänzer
3948b52389 EXA: Guard empty pending region warning by DEBUG_MIGRATE.
It isn't very useful yet while the damage layer calls us for empty operations,
mostly confuses users.
2009-02-06 11:37:53 +01:00
Michel Dänzer
639f289dcd EXA: Declare glyph cache picture as component-alpha when necessary.
Without this, rendering component-alpha glyphs may break without a mask.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=19233 .
2009-01-13 13:05:32 +01:00
Maarten Maathuis
3534a5e5d9 exa: Allow drivers to set non-NULL devPrivate.ptr for !offscreen pixmaps. 2008-12-26 16:38:27 +01:00
Maarten Maathuis
027b440d4f exa: preparing as source and finishing access as mask is a bad idea 2008-12-26 15:51:55 +01:00
Maarten Maathuis
1567b7243f exa: A more correct fix. 2008-12-21 00:08:56 +01:00
Maarten Maathuis
2db7b66863 exa: a few cleanups
- Some warnings silenced.
- Some whitespace cleanup.
2008-12-19 23:12:37 +01:00
Peter Hutterer
cb95642dc8 Remove #define NEED_EVENTS and NEED_REPLIES
A grep on xorg/* revealed there's no consumer of this define.

Quote Alan Coopersmith:
"The consumer was in past versions of the headers now located
in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h,
all the event definitions were only available if NEED_EVENTS were
defined, and all the reply definitions required NEED_REPLIES.

Looks like Xproto.h dropped them by X11R6.3, which didn't have
the #ifdef's anymore, so these are truly ancient now."

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-12 11:43:32 +10:00
Paulo Cesar Pereira de Andrade
49f77fff14 Rework symbol visibility for easier maintenance
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-12-03 05:43:34 -02:00
Paulo Cesar Pereira de Andrade
d6cbd4511e Export symbols defined in the sdk.
This is the biggest "visibility" patch. Instead of doing a "export"
symbol on demand, export everything in the sdk, so that if some module
fails due to an unresolved symbol, it is because it is using a symbol
not in the sdk.

  Most exported symbols shouldn't really be made visible, neither
advertised in the sdk, as they are only used by a single shared object.

  Symbols in the sdk (or referenced in sdk macros), but not defined
anywhere include:
XkbBuildCoreState()
XkbInitialMap
XkbXIUnsupported
XkbCheckActionVMods()
XkbSendCompatNotify()
XkbDDXFakePointerButton()
XkbDDXApplyConfig()
_XkbStrCaseCmp()
_XkbErrMessages[]
_XkbErrCode
_XkbErrLocation
_XkbErrData
XkbAccessXDetailText()
XkbNKNDetailMaskText()
XkbLookupGroupAndLevel()
XkbInitAtoms()
XkbGetOrderedDrawables()
XkbFreeOrderedDrawables()
XkbConvertXkbComponents()
XkbWriteXKBSemantics()
XkbWriteXKBLayout()
XkbWriteXKBKeymap()
XkbWriteXKBFile()
XkbWriteCFile()
XkbWriteXKMFile()
XkbWriteToServer()
XkbMergeFile()
XkmFindTOCEntry()
XkmReadFileSection()
XkmReadFileSectionName()
InitExtInput()
xf86CheckButton()
xf86SwitchCoreDevice()
RamDacSetGamma()
RamDacRestoreDACValues()
xf86Bpp
xf86ConfigPix24
xf86MouseCflags[]
xf86SupportedMouseTypes[]
xf86NumMouseTypes
xf86ChangeBusIndex()
xf86EntityEnter()
xf86EntityLeave()
xf86WrapperInit()
xf86RingBell()
xf86findOptionBoolean()
xf86debugListOptions()
LoadSubModuleLocal()
LoaderSymbolLocal()
getInt10Rec()
xf86CurrentScreen
xf86ReallocatePciResources()
xf86NewSerialNumber()
xf86RandRSetInitialMode()
fbCompositeSolidMask_nx1xn
fbCompositeSolidMask_nx8888x0565C
fbCompositeSolidMask_nx8888x8888C
fbCompositeSolidMask_nx8x0565
fbCompositeSolidMask_nx8x0888
fbCompositeSolidMask_nx8x8888
fbCompositeSrc_0565x0565
fbCompositeSrc_8888x0565
fbCompositeSrc_8888x0888
fbCompositeSrc_8888x8888
fbCompositeSrcAdd_1000x1000
fbCompositeSrcAdd_8000x8000
fbCompositeSrcAdd_8888x8888
fbGeneration
fbIn
fbOver
fbOver24
fbOverlayGeneration
fbRasterizeEdges
fbRestoreAreas
fbSaveAreas
composeFunctions
VBEBuildVbeModeList()
VBECalcVbeModeIndex()
TIramdac3030CalculateMNPForClock()
shadowBufPtr
shadowFindBuf()
miRRGetScreenInfo()
RRSetScreenConfig()
RRModePruneUnused()
PixmanImageFromPicture()
extern int miPointerGetMotionEvents()
miClipPicture()
miRasterizeTriangle()
fbPush1toN()
fbInitializeBackingStore()
ddxBeforeReset()
SetupSprite()
InitSprite()
DGADeliverEvent()

  SPECIAL CASES
o defined as _X_INTERNAL
	xf86NewInputDevice()
o defined as static
	fbGCPrivateKey
	fbOverlayScreenPrivateKey
	fbScreenPrivateKey
	fbWinPrivateKey
o defined in libXfont.so, but declared in xorg/dixfont.h
	GetGlyphs()
	QueryGlyphExtents()
	QueryTextExtents()
	ParseGlyphCachingMode()
	InitGlyphCaching()
	SetGlyphCachingMode()
2008-11-29 23:56:06 -02:00
Paulo Cesar Pereira de Andrade
31285d063e Make visible symbols required by xorg modules.
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-11-28 01:55:11 -02:00
Dave Airlie
08cd361234 exa: avoid doing prepare/done without intervening copies in exaFillRegionTiled
This does a precursor check to make sure the copies are required before
entering the prepare/done code.
2008-11-17 19:15:20 +10:00
Dave Airlie
8f8a9c19ad EXA: avoid copy operations if no boxes in use
Simple fix for now, I'm sure damage shouldn't be calling us with nbox = 0.
2008-11-17 10:24:39 +10:00
Michel Dänzer
21c116219c Fix typos which caused exaCompositeRects() to use an incorrect damage region.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=18065 .

Also, it can bail if either width or height of the bounding box is <= 0, not
only if both of them are.
2008-11-08 01:25:14 +01:00
Keith Packard
8767fc8d47 Wrap AddTraps in exa and damage.
This fine (and unused) function wasn't ever wrapped which made it not work
under exa.

(cherry picked from commit 06e7e1d048)
2008-10-23 09:56:45 -04:00
Adam Jackson
3891dd8924 exa: Add exaDrawableIsOffscreen() to the driver API. 2008-10-21 13:11:16 -04:00
Michel Dänzer
2188582e5e EXA: Avoid excessive syncing in PutImage 2008-10-20 09:55:24 -04:00
Maarten Maathuis
87a016ae00 exa: restore {x,y}{Src,Dst} to their original values when !done 2008-10-15 00:03:16 +02:00
Dave Airlie
717c7492a0 exa: don't call composite routines with no buffer.
We can get a case with gnome-terminal + links, where we get two arrays
of glyphs all with 0 width and 0 heights in them. If this happens
we manage to get to this case without any buffer setup and segfault.
2008-10-07 02:38:44 +10:00
Maarten Maathuis
a29af64658 exa: remove "direct" case for exa{Trapezoids,Triangles}
- By adding a small hack to the xserver i was able to easily test the performance of the normally rare direct case (using cairo).
- It turned out to be 70% slower for me (large test on an otherwise idle computer), which seems enough of a reason to remove it.
- AddTraps could also use a 2nd look, but since noone is using that it's a bit hard and less useful to test.
2008-10-03 23:59:06 +02:00
Maarten Maathuis
416870d8c9 exa: remove some excessive whitespace 2008-10-03 23:59:06 +02:00
Dave Airlie
5bf3f0fd4e exa: make sure pixmap devPrivate.ptr is NULL at create time 2008-09-26 08:59:30 +10:00
Julien Cristau
b4762c0245 exa: disable shared pixmaps
They got re-enabled in ee7c684f21
("Reimplement ShmPutImage.")
2008-09-16 17:13:42 +02:00
Dave Airlie
0466b8811c exa: drop cw.h inclusion
this doesn't seem to be needed, at least I can't see any warning without it.

I'd like to build EXA into a driver and cw.h isn't exported
2008-09-01 09:57:25 +10:00
Maarten Maathuis
f4e9a1a98f damage: choose less ambiguous function names 2008-08-31 17:46:26 +02:00
Maarten Maathuis
1861250cd7 {damage,exa}: sanitise damage
- Redo damage naming for more consistency.
- Call post submission functions only where appropriate.
- EXA can now live without it's odd damage workarounds.
2008-08-29 22:15:23 +02:00
Tomas Carnecky
ebea78cdba Prepare for array-index based devPrivates.
TODO: static indices can be made just an int; some indices
can be combined.
2008-08-28 18:05:40 -04:00
Adam Jackson
ee7c684f21 Reimplement ShmPutImage.
There's no reason to not just dispatch this straight into the GC.  As a
bonus, if you do so, damage wraps correctly, and thus swcursor works.
The side effect is it's no longer possible to override ShmPutImage with
ShmRegisterFuncs().

Also remove the (broken) damage tracking for same from EXA, since it didn't
work right, and is now superfluous.
2008-08-28 10:12:28 -04:00
Maarten Maathuis
dd1e54d6ee exa: fix thinko from 988725f32e
- the drawable of the pixmap is not the same as the original drawable (possibly a DRAWABLE_WINDOW)
2008-08-26 20:02:55 +02:00
Maarten Maathuis
7c14fdbacf exa: some minor cleanup
- Fix compile warning
- Order exa.h by source file that exports the function.
- Move the function i created earlier to private headers.
2008-08-26 17:56:40 +02:00
Maarten Maathuis
de79edbd9f exa: report damage manually for exa{Trapezoids,Triangles} when needed
- Plus a micro cleanup of unused variables.
2008-08-26 17:56:40 +02:00
Maarten Maathuis
988725f32e exa: move destination damage for internal calls to a special function
- This should improve clarity for someone who isn't familiar with the code.
2008-08-26 17:56:40 +02:00
Maarten Maathuis
ce19347680 exa_glyphs: remove useless offset 2008-08-26 17:56:39 +02:00
Maarten Maathuis
bc4cef1d0a exa: remove useless cache{X,Y}off from UploadToScreen() arguments. 2008-08-19 23:24:33 +02:00
Michel Dänzer
f227fbf74f EXA: Inline Prepare/FinishAccessWindow into only caller, ChangeWindowAttributes.
Also check the requested mask in addition to the GC state before doing work.
2008-08-19 11:36:12 +02:00
Michel Dänzer
825b3fe11d EXA: Don't use exaGlyphs if the driver doesn't provide a PrepareComposite hook.
It's buggy without Composite acceleration (leading to cropped glyphs) and not
really useful in that case anyway. The bug probably still needs to be found and
fixed for drivers that provide a PrepareComposite hook but can't accelerate
text rendering though.
2008-08-19 11:22:40 +02:00
Maarten Maathuis
421b7e8f12 exa: fix assert logic thinko from 361a9eb953
- I guess failing PrepareAccess is rare, since this a 3 year old bug.
2008-08-17 19:57:02 +02:00
Michel Dänzer
4212599c92 EXA: Make sure damage tracking code is inactive if the driver manages pixmaps.
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-08-08 12:17:58 +02:00
Daniel Stone
e882ee7056 EXA: Remove unnecessary #includes
There wasn't actually any font code here, so no problem.
2008-08-05 01:17:32 +03:00
Michel Dänzer
148175fb8b EXA: Do still return FALSE if the driver PrepareCopy hook failed...
Thanks to Stuart Bennett for pointing out the problem on IRC.
2008-07-31 16:54:33 +02:00
Michel Dänzer
64ebeeb526 EXA: Fix exponential growth logic for GXcopy tiled fills.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16908 .
2008-07-31 10:58:52 +02:00
Michel Dänzer
8405c25d9d EXA: Simplify exaFillRegionTiled() control flow.
Also only call REGION_TRANSLATE() when necessary.
2008-07-31 10:55:44 +02:00
Michel Dänzer
a3afa6f2fb EXA: Optimize GXcopy tiled fills. 2008-07-30 18:30:37 +02:00
Michel Dänzer
37087bc106 EXA: Replace open coded CopyArea logic with GC op call. 2008-07-30 18:27:33 +02:00
Alan Hourihane
528b4e36ad Set driverPriv immediately on CreatePixmap.
If it's NULL anyway, we bail, if not, it lets
ModifyPixmapHeader know about the private.
2008-06-18 22:34:02 +01:00
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
Michel Dänzer
f6d61d3d86 EXA: Don't migrate twice in exaImageGlyphBlt.
exaPrepareAccess already handles migration.
2008-05-24 20:01:36 +02:00
Michel Dänzer
d733043982 EXA: Don't suggest exaCopyDirty be inlined.
Leave the decision to the compiler toolchain.
2008-05-24 20:01:31 +02:00
Michel Dänzer
3baf3b42e0 EXA: Specify region used for source pixmap migration in exaCopyNtoN.
Avoids excessive migration overhead in some pathological cases. See
http://bugs.freedesktop.org/show_bug.cgi?id=15845 .
2008-05-24 20:01:21 +02:00
Michel Dänzer
3b8d53452c EXA: Fall back in CompositeRects if the driver can't accelerate Composite.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=15780 .
2008-05-01 15:10:52 +02:00
Michel Dänzer
8349732a67 EXA: Try to accelerate non-antialiased text via the glyph cache as well.
Treat 1 bit glyphs and masks as PICT_a8 in the glyph cache. We're not able to
accelerate them otherwise.
2008-04-28 21:09:35 +02:00
Michel Dänzer
a65d530040 EXA: Accumulate glyphs whenever possible, for full benefits of the glyph cache. 2008-04-28 21:03:12 +02:00
Michel Dänzer
e7eaac59c4 EXA: Glyph cache upload tweaks.
Track damage after using UploadToScreen directly.

Don't waste any effort on empty glyphs.
2008-04-28 21:00:55 +02:00
Owen Taylor
cc08c06665 EXA: Use UploadToScreen() for uploads to glyph cache
When possible, use UploadToScreen() rather than CompositePicture()
to upload glyphs onto the glyph cache pixmap. This avoids allocating
offscreen memory for each glyph making management of offscreen
areas much more efficient.
2008-04-28 21:00:55 +02:00
Owen Taylor
13fd225630 EXA: Clean up debug messages 2008-04-28 21:00:55 +02:00
Owen Taylor
fcb5949928 EXA: Fix overlapping glyphs in glyph cache
Allocate each cache at a different vertical position in the
per-format pixmap. Fix width/height confusion when choosing
the cache for a glyph.
2008-04-28 21:00:54 +02:00
Owen Taylor
40eb14c948 EXA: Add exaCompositeRects()
Add a function to composite multiple independent rectangles
from the same source to the same destination in a single
operation: this is useful for building a glyph mask.
2008-04-28 21:00:54 +02:00
Owen Taylor
54184110f6 EXA: Use a single large glyph cache pixmap
Add back exaGlyphs(); the new version copies the glyph images
onto a single large glyph pixmap and draws from their to the
destination surface. This reduces the management of small
offscreen areas and will allow us to avoid texture unit setup
between each glyph.
2008-04-28 21:00:54 +02:00
Tilman Sauerbeck
3f081b4de5 EXA: Set pixmap->accel_blocked on the screen pixmap, too. 2008-04-21 23:07:39 +02:00
Tilman Sauerbeck
26c1801a27 EXA: Update sys_pitch/fb_pitch in exaModifyPixmapHeader.
exaModifyPixmapHeader now also only evaluates arguments that have a
meaningful value.
2008-04-21 23:07:39 +02:00
Michel Dänzer
6c95fae1e9 EXA: Offscreen memory eviction improvements.
* Make sure available areas are considered to have no eviction cost. This seems
  to help for https://bugs.freedesktop.org/show_bug.cgi?id=15513 but I'm afraid
  that may just be coincidence.
* Only calculate eviction cost of each area once for each eviction pass.
  Safeguard against potential (though unlikely) division by zero.
* Cosmetic enhancements: Name eviction cost related variables 'cost' instead of
  'score' to emphasize that smaller values are better, update Doxygen file
  comment to the way eviction works now.
2008-04-21 10:45:11 +02:00