Commit Graph

246 Commits

Author SHA1 Message Date
Eric Anholt
744aa34ca5 Add an additional meaning to the "dirty" flag. Now, if !dirty && !area, the
pixmaps's contents are undefined, so we won't need to upload the
    undefined contents in MoveIn. Use the ExaCheck* for async ops as well,
    so that dirty is always tracked. While the performance impact for my ls
    -lR test was not significant (though the avoiding-upload path was being
    hit), it's likely to be important for the upcoming Get/PutImage
    acceleration from ajax.
2005-10-15 02:19:09 +00:00
Benjamin Herrenschmidt
35a767590e Fix stupid mistake in yesterday's allocator commit, would cause exa to
consider a random available memory size
2005-10-13 01:13:58 +00:00
Benjamin Herrenschmidt
e573b272bf Use proper access size when reading pixel based on bpp of the source pixmap 2005-10-12 07:46:36 +00:00
Eric Anholt
55efb41f6c If a window background is a 1x1 pixmap, read the value out and go to
exaFillRegionSolid rather than sending piles and piles of Copies to the
    hardware.
2005-10-12 07:35:20 +00:00
Benjamin Herrenschmidt
12994b9afb Fix a couple of bugs in the offscreen allocator. One mostly harmless was
causing our search loop for evictable blocks to possibly skip a good
    candiate, and another was the allocator would occasionally use
    area->offset as if it was the base of the pixmap, while for a pixmap
    that is not in available state, it is not. This caused some funny
    miscalculation leading to overlapping pixmaps and accesses beyond the
    end of the framebuffer. To make things cleared, I renamed save_offset
    to base_offset, made sure it's the one used everywhere in the
    allocator, and only align "offset" for the client at the end of
    exaOffscreenAlloc().
2005-10-11 23:11:37 +00:00
Benjamin Herrenschmidt
13f958fbe8 Add missing {Prepare,Finish}Access() wrappers for the tile pixmap in the
fallback case
2005-10-10 05:58:41 +00:00
Eric Anholt
046234b3eb Don't try the accelerated glyphs path for component-alpha text (which I
don't expect drivers to be able to accelerate without exa assistance).
    Instead, drop back to plain old miGlyphs for a 62.5% +/- 1.5% reduction
    in runtime of my ls -lR test (n=5) with component alpha. While a
    reasonable approach would seem to be making a better test to see
    whether the entire path would be accelerated and force migration
    appropriately, my attempt at this made the situation much worse.
2005-10-09 02:03:22 +00:00
Benjamin Herrenschmidt
ff258ac278 Clients tend to set picture->repeat when not necessary. Most HW cannot
accelerate repeat NPOT thus triggering software fallback (this is the
    case with gnome desktop for example). This adds a simple optimisation
    to exa that removes "repeat" when it's obviously useless, that is, the
    single picture instance covers the entire rectangle beeing used
2005-10-06 23:45:29 +00:00
Eric Anholt
1614a31a9d Bug #4699: Correct some memory leaks in EXA and damage related to region
handling.
2005-10-06 21:55:41 +00:00
Eric Anholt
f47f00ab74 Mark the temporary pixmap dirty if UploadToScreen succeeds. Failure to do
so resulted in a solid black glyph if the font rendering actually
    resulted in a fallback (subpixel AA, for example) and the temporary got
    migrated after 10 or so glyphs.
2005-10-04 11:24:09 +00:00
Eric Anholt
8814896da8 Fix include path for commit of bug #4616. 2005-10-02 08:53:18 +00:00
Eric Anholt
ecaa46380e Bugzilla #4616:
- Merge various fb/ bits of COMPOSITE support from xserver, which weren't
    necessary before due to cw hiding the issues. Fixes offset calculations
    for a number of operations, and may pull some fixes that cairo has
    wanted for XAA as well.
- Add a new call, miDisableCompositeWrapper(), which a DDX can call to keep
    cw from getting initialized from the damage code. While it would be
    cleaner to have each DDX initialize it if it needs it, we don't have
    control over all of them (e.g. nvidia).
- Use the miDisableCompositeWrapper() to keep cw from getting set up for
    screens using EXA, because EXA is already aware of composite. Avoiding
    cw improved performance 0-35% on operations tested by ajax in x11perf.
2005-10-02 08:28:27 +00:00
Adam Jackson
aa74468aa5 sparse cleanups. s/0/NULL/ and mark a few things static. 2005-09-30 02:03:45 +00:00
Eric Anholt
58abce3f90 - Use the dirty flag (which should be set correctly all the time,
particularly thanks to Prepare/FinishAccess) to avoid DFS/memcpy on
    pixmap move-out if it's unnecessary. This was disabled in KAA because
    cache misuse on ATI made me guess that this code was wrong.
- Unwrap Glyphs on closescreen.
2005-09-28 20:01:37 +00:00
Eric Anholt
56e7766c77 Bug #4541: Fix text drawing in the case where a list contains no
non-zero-sized glyphs. Several variables weren't updated, resulting in
    rendering simply stopping when this case was hit. (Anders Kaseorg)
2005-09-21 22:26:07 +00:00
Eric Anholt
361a9eb953 - Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
    you got moved in. Instead, do the above-threshhold check separate from
    score starting out less than max. While this will likely make thrashing
    cases worse, I hope it will fix some issues with long term performance
    (think of an xcompmgr with a backbuffer it's doing only accelerated
    operations to. If some new pixmap comes in and bumps it out, even once,
    it will never get a chance to re-migrate because its score will be
    maxed). Change migration-out to be the same way for symmetry, though it
    shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
    completeness. The fallback debugging covers a lot more now, pointing
    out new areas for improvement. Debugging toggles are now centralized in
    exaPriv.h.
2005-09-21 10:27:53 +00:00
Eric Anholt
6a29c4cec1 Add support for hardware accelerating tiled background painting. One
example of this is the root weave, which paints slightly slower on SiS
    now in my testing. However, according to keithp some apps use this
    feature for a sort of cheap backing store, which this could help with
    significantly. While I haven't done much performance testing with it,
    it will at least rule out one possible source of terrible performance.
2005-09-21 07:43:01 +00:00
Eric Anholt
a1bcf25a1f Break EXA ABI while we still can. Add coordinates to the UploadToScreen
hook so we can upload a subset of a pixmap, and convert the current
    drivers to respect that. Use this support to directly UploadToScreen in
    exaGlyphs, providing a 47.4% +/-2.4% decrease in wall time for ls -lR
    programs/Xserver in an antialiased gnome-terminal on an M6 (n=3, caches
    hot). I would have bumped major version, only I can't tell what the
    EXA_VERSION_* is supposed to be doing as opposed to the module version.
2005-09-18 02:32:23 +00:00
Eric Anholt
074913c8a9 - Don't try to upload 0 byte-per-pixel (PICT_a1) data using
RADEONHostDataBlit.
- Disable the shortcut for switching from 3d to 3d in radeon_exa.c. It
    appears that we do need the cache flush here, thought it's not clear
    why. Disable the 2d to 2d shortcut while here, since I'm unsure of what
    we're doing. Exposed by the following bit:
- Bug #4485: Add a new routine, exaGlyphs, to handle font drawing. Glyphs
    were being accumulated in from non-migratable scratch pixmaps, causing
    the destination pixmap to move towards screen but the migration
    necessary for source never to happen, leading to abysmal performance.
    Instead, copy the scratch glyph data into a real pixmap first, then
    composite from that into the destination, allowing for migration. time
    ls -lR from programs/Xserver showed 26.9% (+/- 6.3%) decrease in wall
    time (n=3).
- Create exaDrawableUse* wrapping exaPixmapUse*, but which are aware of
    windows needing backing store. Makes migration code prettier, and
    ensures that composited windows will be migrated as normal when we turn
    off cw for EXA. (issue brought up by keithp)
2005-09-17 20:02:02 +00:00
Daniel Stone
c3d6799cee Bug #594: CAN-2005-2495: Fix exploitable integer overflow in pixmap
creation, where we could create a far smaller pixmap than we thought,
    allowing changes to arbitrary chunks of memory. (Søren Sandmann
    Pedersen)
2005-09-13 01:33:19 +00:00
Eric Anholt
b0f6fe1f38 Add some optional (disabled) fallback debugging code to the async code, for
better tracking of when we're hitting software.
2005-09-11 21:38:41 +00:00
Eric Anholt
1c003ccf5d Add a pair of hooks, PrepareAccess() and FinishAccess(), which get called
around CPU access to the framebuffer. This allows the hardware to set
    up swappers to deal with endianness, or to tell EXA to move the pixmap
    out to framebuffer if insufficient swappers are available (note: must
    not fail on front buffer!).
Submitted by: benh
2005-09-11 19:08:10 +00:00
Adam Jackson
ca210830bd Simplify life for EXA drivers by reducing some {Con,Dis}joint ops. 2005-09-11 18:43:55 +00:00
Eric Anholt
0c74799af4 Remove existing broken maxX/maxY code for composite (results in infinite
loops, doesn't deal with failure, doesn't present the interface to
    drivers that I expected) and instead replace it with a simple fallback
    to software when coordinate limits could be violated. Act similarly in
    other acceleration cases as well.
The solution I want to see (and intend to do soon) is to (when necessary)
    create temporary pictures/pixmaps pointing towards the real ones' bits,
    with the offsets adjusted, then render from/to those using adjusted
    coordinates.
2005-08-30 04:41:04 +00:00
Adam Jackson
0926cf79c0 Add diagnostic messages for exaDriverInit failure cases. 2005-08-26 20:21:57 +00:00
Eric Anholt
0711502f18 Bugzilla #4226: Change the pixmap migration strategy for the CopyNtoN case.
Now, if either source or dest were in framebuffer, try to get both
    there, but prefer system memory for both otherwise. Required making
    exaasync.c go through the try-acceleration path. This significantly
    improves window resizing under composite, because previously the
    pattern of creating a new pixmap and copying default contents from the
    screen caused a fallback every time due to the new destination pixmap
    being in system memory.
2005-08-24 23:48:11 +00:00
Eric Anholt
2261710fe0 Fix a bug where NULL could be dereferenced during the pixmap kick-out
process by referencing the correct offscreen area. Also drive-by the
    comments related to these for clarity.
2005-08-24 23:38:25 +00:00
Eric Anholt
55c5c6953a Bugzilla #4090: Introduce getters for pixmap pitch and offset, to
simplify/clarify it for driver writers who probably don't want to know
    what pPixmap->devPrivate.ptr or pPixmap->devKind mean. Converts the sis
    driver to use them, and bumps the EXA module minor version.
2005-08-24 22:43:27 +00:00
Eric Anholt
8fd250e5e4 Bugzilla #4089: Fix crashes in !EXA_OFFSCREEN_PIXMAPS case by not trying to
do migration when the EXA pixmap private is NULL.
2005-08-24 21:51:28 +00:00
Eric Anholt
ebedc8bbb5 - Fix the exa pixmap offset/pitch alignment to deal with non-POT alignment
requirements. MGA, notably, uses a multiple of 3 in some cases.
- Rename the pixmap offset/pitch alignment fields to more clearly state
    their meaning.
2005-08-14 19:46:55 +00:00
Søren Sandmann Pedersen
5849c69db8 Mon Aug 8 13:39:45 2005 Søren Sandmann <sandmann@redhat.com>
Conditionally include xorg-config.h
2005-08-08 18:02:08 +00:00
Keith Packard
4dfc3357a7 Add autogenerated source files and other various non-CVS material to
.cvsignore files
Use XORG_CFLAGS. Ensure that all exa files are in SOURCES
remove _XOPEN_SOURCE as it's always in xtrans.pc these days and gcc whines
libdamage.la needs libcw.la when COMPOSITE is defined, but that
    libdamage.la must be after libcomposite.la, so add libcw.la to
    DAMAGE_LIB instead of EXTENSION_LIBS. Regularize library link order
    across all X servers
2005-08-08 00:38:41 +00:00
Chris Lee
a16357ebc9 Last bits of changes to make exa build properly in the modular server. 2005-08-06 23:46:38 +00:00
Chris Lee
cc67bd187f EXA support in the modular build. 2005-08-06 23:34:09 +00:00
Chris Lee
33326f4ee8 Adding exa support to the modular server. 2005-08-06 23:27:33 +00:00
Zack Rusin
3c92389185 Patch from Thomas Winischhofer to kick out all pixmaps to system ram upon a
VT switch and vice versa when returning.
2005-07-09 14:15:35 +00:00
Zack Rusin
e84648df7d mark drawable as dirty on copying/painting windows 2005-07-08 17:07:52 +00:00
Zack Rusin
4ab73a73f4 heh, oops (thanks Thomas) 2005-07-08 07:43:00 +00:00
Zack Rusin
d0dc574adb Check vtSema before accelerating primitives and sync in fallbacks only if
we got vtSema
2005-07-07 15:05:02 +00:00
Zack Rusin
5e50ae22bf remove the temporary debugging output 2005-07-04 18:55:53 +00:00
Zack Rusin
e34f31762e This fixes the close screen mess (crash reported by Thomas). Also hide the
private Exa screen definition. Properly cleanup on screen close and do
    not delete the private screen in the DriverFini call.
2005-07-04 14:15:57 +00:00
Daniel Stone
e03198972c Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.
Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings.
Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all
    source files in the xserver/xorg tree, predicated on defines of
    HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to
    <X11/fonts/foo.h>.
2005-07-03 07:02:09 +00:00
Zack Rusin
aabb868920 removing all debugging output from the default build :) 2005-07-01 13:30:29 +00:00
Zack Rusin
0fa9d1fb48 Leave debugging output for only the interested parties. 2005-07-01 12:24:30 +00:00
Zack Rusin
0df446ab88 Missed this. Spotted by Thomas. 2005-07-01 10:39:21 +00:00
Zack Rusin
30c019e847 Adding the new acceleration architecture: Exa. It's meant to replace XAA in
the coming months.
2005-07-01 08:56:12 +00:00