Created attachment 15707 [details] [review] The patch When we have a repeating source that's non-power-of-two in a dimension, we can't turn on wrap for that dimension, but if we aren't transforming then we can break the destination area up into tiles, each tile contained completely within a single copy of the source, and render the tiles one-by-one. This turns out to make a big difference for the way that cairo handles horizontal and vertical or gradients, which is to render a thin strip (POT in the repeating direction, not-necessarily-POT in the other), then tile it. Not having that as a software fallback makes my desktop much more usable.
Ah, one additional comment: the same optimization is made when there is no mask by the generic EXA code... it actually calls into the code that would handle a tiled-fill with core X rendering. This patch is more general by handling the mask. Non-rectangular shapes with gradients are common in many widget themes.
Created attachment 15709 [details] [review] Additional patch that hopefully gets things working on R100/R200 In the last patch I didn't know how to conditionalize wrapping on R100/R200 because there was no code to turn it on at all! (Something I fixed for R300 in the patch in bug 14333). I think this patch corrects that based on the code in radeon_render.c
Created attachment 15718 [details] [review] More R100/R200 fixes Here's another sequential patch: Further repeat fixes for R100 + R200 - We need to tile in both directions if either is NPOT - It's OK to repeat even if the pixmap is padded (pitch > width) I've also put up a git repo with the three patches here and the patch they depend upon from bug 15334 in it: git://git.fishsoup.net/xf86-video-ati In the npot-repeat branch.
Created attachment 15727 [details] [review] Yet further patch of R100/R200 fixups Upon further investigation, matching pitch is actually needed for R100 and possibly R200 as well. Add back that test and tile if pitch does not match.
(In reply to comment #4) > Upon further investigation, matching pitch is actually needed for R100 and > possibly R200 as well. Pretty sure it's necessary on R200 as well - I was writing and testing those tests on an R200 equipped machine. Also, it might be even better to only flush the 3D cache once after all tiles, if that works. P.S. I think R5xx and newer can actually handle wrapping with arbitrary dimensions.
(In reply to comment #5) > (In reply to comment #4) > > Upon further investigation, matching pitch is actually needed for R100 and > > possibly R200 as well. > > Pretty sure it's necessary on R200 as well - I was writing and testing those > tests on an R200 equipped machine. Thanks ... I got stumped working with agd5f to figure out why the actual drawing-in-tiles wasn't working on R100 (very strange, must be obvious, but not clear to me yet) and we never got back to testing on R200. > Also, it might be even better to only flush the 3D cache once after all tiles, > if that works. Is there any reason the flush can't be moved to DoneComposite? .. not just after all the tiles from a single box passed in by exa, but after all the boxes? > P.S. I think R5xx and newer can actually handle wrapping with arbitrary > dimensions. So I've heard. I'll leave that to someone with the hardware and the interest to figure out. (Maybe requires going through some other texturing path? the TX_FORMAT restriction is still in the R5xx docs.)
(In reply to comment #6) > (In reply to comment #5) > > Also, it might be even better to only flush the 3D cache once after all tiles, > > if that works. > > Is there any reason the flush can't be moved to DoneComposite? Good idea, just needs testing.
Created attachment 15897 [details] [review] Turn on wrapping when repeating on R100 + R200 Actually enable repeats for R100 and R200. This corresponds to a R300 change made in the patch in: http://bugs.freedesktop.org/show_bug.cgi?id=15333 This patch, along with the next one compose my attempt at a final patch ready to commit. They have been tested on R100 and R300, I'm pretty confident that they work on R200, R500, but I haven't tested there.
Created attachment 15898 [details] [review] Radeon: emulate repeats by drawing in tiles When we can't turn on hardware repeats, because the texture is non-power-of-two, or has padding at the ends of lines, try to draw the image in multiple tiles rather than falling back to software. (We can only do this when there is no transform.)
Created attachment 15899 [details] Test case (in pycairo) Here's a test case. It needs to be run with a recent version of cairo (say 1.6.x to be safe), or cairo will fall back to GetImage/PutImage for the repeating source.
Created attachment 15900 [details] Expected output of test case
Patches picked from your Git repository and pushed. Unfortunately, moving the cache flush to DoneComposite locks up my RV350...
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.