Commit Graph

97 Commits

Author SHA1 Message Date
Chris Wilson e5c971e763 uxa: Spans! OMG!
Use composite rather than solid blits in order to bring performance on
a par with the CPU when using GEM and relocations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-23 18:43:29 +01:00
Chris Wilson 2c00297bc3 uxa: Replace solid planemask [0xffffffff] with FB_ALLONES
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-16 20:19:22 +01:00
Chris Wilson 21b5fd427f uxa: Tidy uxa_solid_rects()
Move the operator reduction after a few fallbacks, closer to its use.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-16 13:52:35 +01:00
Chris Wilson 61835701fd uxa: Patterns are acquired at 0,0
Set the correct offset for the gradients patterns after rendering to a
local Picture.

Fixes cairo/test/huge-radial and friends

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-16 13:51:35 +01:00
Chris Wilson 89f43f69a9 uxa: Force an alpha channel when rendering source fallbacks
As the source may not cover the extents, we need to represent those
areas as transparent in the fallback picture, ergo we need an alpha
channel. We could be smarter and force a format conversion when
necessary, and we could let the backend choose the most appropriate
format.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-15 18:34:54 +01:00
Chris Wilson 524fd2dd0d uxa: Apply clip for solid rectangles.
References:

  Bug 28120 - Tint2's tooltip borders end up at 0,0 and do not disappear
  https://bugs.freedesktop.org/show_bug.cgi?id=28120

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-15 18:28:05 +01:00
Chris Wilson 58b089febc uxa: Avoid using blits when with PictFilterConvolution
References:

  Bug 28098 Compiz renders shadows wrong, garbage line of pixels along left
            and top edge of windows
  https://bugs.freedesktop.org/show_bug.cgi?id=28098

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-15 09:11:46 +01:00
Chris Wilson ef95899f5b uxa: Check the w-scaling component is 1 for an translation matrix
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-15 09:02:07 +01:00
Chris Wilson 95654cffa8 uxa: Fix order of conditionals to only run fill_region for SRC or opaque
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-15 00:50:42 +01:00
Chris Wilson f67b45965b uxa: Expand the range of compatible formats to cover all bpp.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-15 00:50:20 +01:00
Chris Wilson 82d07fdf10 uxa: Only use 1x1R as a solid with an opaque format or SRC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-15 00:49:39 +01:00
Chris Wilson 3bca186a7e uxa: Call check_solid before running the solid blitter.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-15 00:48:31 +01:00
Chris Wilson 737de9a779 uxa: Disable compatible src xrgb and dst argb
I'm seeing garbage alpha for rendercheck blend:

  x8r8g8b8a 10x10 SRC ar8g8b8a

so disable blitting until I work out if we can fast-path it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-14 23:56:26 +01:00
Chris Wilson a7c318d21c uxa: Parse BGRA pixel formats.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-14 23:32:44 +01:00
Chris Wilson f7bbcc492a Split the prepare blitter functions into check + prepare.
Allow us to check whether we can handle the operation using the blitter
prior to doing any work.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-14 23:31:57 +01:00
Chris Wilson b9a5e36f95 uxa: enable solid rects for backends that require pixmaps
Convert the color into a (cached) pixmap if the backend cannot handle
the SolidFill natively.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-14 21:16:50 +01:00
Chris Wilson 8de09a0707 uxa: Convert 1x1R back to solid_fill
In the change to prevent blitting between incompatible sources, we also
prevented 1x1R pixmaps from being used for solid fills. Reorder the
sequence of conditions to enable this fast path again.
2010-05-13 17:17:54 +01:00
Chris Wilson 92e9cf8af7 uxa: Only use solid_fill for SRC. 2010-05-13 17:17:54 +01:00
Chris Wilson d1bd14e8b6 uxa: Replace source for CLEAR with a transparent solid
This means that we will hit the faster try_solid_fill path instead.
2010-05-13 17:17:54 +01:00
Chris Wilson cdab72c405 uxa: Fallback early if compositing with alphaMaps 2010-05-13 17:17:54 +01:00
Chris Wilson 6c27f6e4f7 uxa: Avoid glyph ping-pong with !offscreen destination
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-12 12:50:31 +01:00
Chris Wilson d5383c2073 uxa: Avoid ping-pong with !offscreen destination and traps
If we are destined to target an !offscreen drawable, then uploading the
trapezoid mask to a bo is the last thing we actually want to do...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-12 12:50:31 +01:00
Chris Wilson 00664b8f9d uxa: Fallback when compositing to a !offscreen destination
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-12 12:50:31 +01:00
Chris Wilson 244b7cbfff uxa: Use accelerated PutImage for uploading pixman images.
Short-circuits the current use of PutImage from CopyArea, bypassing all
the temporary allocations.
2010-05-12 12:50:31 +01:00
Chris Wilson cb887cfc67 uxa: solid rects
The cost of performing relocations outweigh the advantages of using the
blitter for solids with lots of rectangles.

References:

  Bug 22127 - [UXA] 50% performance regression for XRenderFillRectangles
  https://bugs.freedesktop.org/show_bug.cgi?id=22127

By using the 3D pipeline we improve our performance by around 4x on
i945, measured by the jxbench microbenchmark, and a factor of 10x by
short-cutting to the 3D pipeline for blended rectangles.

Before, on a i945GME:
  19982.412060 Ops/s; rects (!); 15x15
  9599.131693 Ops/s; rects (!); 75x75
  3803.654743 Ops/s; rects (!); 250x250
  6836.743772 Ops/s; rects blended; 15x15
  1443.750000 Ops/s; rects blended; 75x75
  495.335821 Ops/s; rects blended; 250x250
  23247.933884 Ops/s; rects composition (!); 15x15
  10993.073048 Ops/s; rects composition (!); 75x75
  3595.905172 Ops/s; rects composition (!); 250x250

After:
  87271.145975 Ops/s; rects (!); 15x15
  32347.744361 Ops/s; rects (!); 75x75
  5884.177215 Ops/s; rects (!); 250x250
  73500.000000 Ops/s; rects blended; 15x15
  33580.882353 Ops/s; rects blended; 75x75
  5858.811749 Ops/s; rects blended; 250x250
  25582.317073 Ops/s; rects composition (!); 15x15
  6664.728682 Ops/s; rects composition (!); 75x75
  14965.909091 Ops/s; rects composition (!); 250x250 [suspicious]

This has no impact on Cairo, but I have a suspicion from watching xtrace
that Qt likes to blit thousands of 1x1 rectangles with the same colour.
However, we are still around 2-3x slower than the reported figures for
EXA!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-12 12:50:31 +01:00
Chris Wilson c8e10f7791 debug: Add names for operators
Most useful for confirming my worst fears: unwarranted use of
OutReverse + Add.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-12 12:48:21 +01:00
Chris Wilson a35afd4a2d uxa: Recheck texture after acquiring pattern.
As the first step to handling unsupported texture formats, double check
that the converted pattern can be used as a texture by the card.

Fixes: rendercheck -t repeat

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-11 13:07:03 +01:00
Chris Wilson 1ecd89be03 uxa: Protect against valid SourcePict in uxa_acquire_mask()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-10 23:33:52 +01:00
Chris Wilson 0d4dd00aea uxa,i915: Handle SourcePict through uxa_composite()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-10 12:29:26 +01:00
Chris Wilson f52b6e8322 uxa: Rearrange checking and preparing of composite textures.
x11perf regression caused by 2D driver
  https://bugs.freedesktop.org/show_bug.cgi?id=28047

caused by

  commit a7b800513f
  uxa: Extract sub-region from in-memory buffers.

The issue is that as we extract the region prior to checking whether the
composite can in fact be accelerated, we perform expensive surplus
operations. This is particularly noticeable for ComponentAlpha text,
such as rgb10text. The solution here is to rearrange the
check_composite() prior to acquiring the sources, and only extracting
the subregion if the render path can not actually handle the texture.

Performance (on PineView):
a7b800513^: aa=68600 glyphs/s, rgb=29900 glyphs/s
a7b800513: aa=65700 glyphs/s, rgb=13200 glyphs/s
now: aa=66800 glyph/s, rgb=28800 glyphs/s

The residual lossage seems to be from the extra function call and
dixPrivate lookups. Hmm. More warning is the extremely low performance,
however the results are consistent so the improvement looks real...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-10 10:36:14 +01:00
Chris Wilson 848ab66384 uxa: Transform composites with a simple translation into a blit
We can also convert a composite with an integer translation into a
blit, so long as the sample extents remains within the source.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-08 19:35:28 +01:00
Chris Wilson a7b800513f uxa: Extract sub-region from in-memory buffers.
If the buffer is too large or not suitable for a GPU operation, we
currently fallback and perform the composite on the CPU. An alternative
is too extract the small region out of the source (as usually the
sample extents are much smaller than the actual surface size) and try
the composite with the new surface.

The effect is particularly noticeable on pathological websites that use
very large background images. For example, http://www.woodtv.com/ uses a
1299x15000 pattern that is obscured by another opaque pattern.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-08 19:35:07 +01:00
Chris Wilson 2d17bd50af Revert "Revert "uxa: Try using put_image when copying from a memory buffer.""
This reverts commit 6d50553e8f.

Now we have taught the fallback path not to infinitely recurse,
re-enable the accelerated path for ShmPutImage and friends.
2010-04-14 17:10:09 +01:00
Eric Anholt 6d50553e8f Revert "uxa: Try using put_image when copying from a memory buffer."
This reverts commit 27195d7dba.
put_image often calls copy_area. Which calls put_image.  Exhausting of
the stack follows.
2010-04-12 13:46:24 -07:00
Chris Wilson 28024f6c5f Revert "uxa: Add fallback warnings for PutImage."
This reverts commit 299b0338d0.
A debugging patch, it was never intended to go into master
2010-04-12 13:44:01 +01:00
Chris Wilson 27195d7dba uxa: Try using put_image when copying from a memory buffer.
Often, for example in the fallback for ShmPutImage, we will attempt to
use uxa_copy_area() copying to a normal pixmap from a memory buffer.
This triggers a fallback, and maps the destination pixmap back into the
GTT. The accelerated put_image path will attempt to stream a blit to the
destination pixmap if it is currently active, avoiding the stall.
2010-04-10 18:50:26 +01:00
Chris Wilson 299b0338d0 uxa: Add fallback warnings for PutImage. 2010-04-10 18:08:07 +01:00
Gaetan Nadon 362a49e71f uxa make: remove unused XORG_INCS and DIX_CFLAGS variables
Most likely copied from xserver makefile.

Acked-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-03-25 15:49:14 -04:00
Chris Wilson 5537079c29 uxa: After filling the alpha channel xrgb src is compatible with argb dst.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-24 16:42:05 +00:00
Chris Wilson 90a971c607 uxa: Only reduce a composite to a BLT if it is wholly contained
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-24 16:42:05 +00:00
Chris Wilson d6b7f96fde Fill alpha on xrgb images.
Do not try to fixup the alpha in the ff/shaders as this has the
side-effect of overriding the alpha value of the border color, causing
images to be padded with black rather than transparent. This can
generate large and obnoxious visual artefacts.

Fixes:

  Bug 17933 - x8r8g8b8 doesn't sample alpha=0 outside surface bounds
  http://bugs.freedesktop.org/show_bug.cgi?id=17933

and many related cairo test suite failures.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-16 10:53:29 +00:00
Carl Worth 1cc35a8ba4 uxa: Fix type mismatch to avoid compiler warning.
The code was using uint32_t where an XID (currently an unsigned long)
was specified in the prototype. Use XID to avoid both the warning and
any potential problem.
2010-03-04 09:46:33 -08:00
Eric Anholt 6bdab84176 uxa: Skip adjusting mask coordinates when no mask is present.
Quiets clang warnings about garbage variable usage.
2010-02-20 12:55:13 -05:00
Eric Anholt ec5deb2bcb Remove dead assignments noticed by clang. 2010-02-20 12:55:13 -05:00
Chris Wilson 918151a795 uxa: Fix compatible_formats() for OVER
In separating the boolean logic out into a separate function, dc6522dd,
I reversed the sense of one particular test:

  src->format == dst->format

The OVER optimisation is only valid if the src and dst formats match,
but not always.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-27 20:35:45 +00:00
Chris Wilson 197cb08a2d Extract pixel value for all formats to avoid hitting fallbacks.
On failing to extract the pixel value for an alpha-only solid we
actually triggered a fallback. Since this path is commonly hitting
whilst fading in images, for example cairo_paint_with_alpha(), the
fallback was detected during the Moblin boot sequence where it was
adding a second to the overall boot time.

See
  fallback intel: Moblin startup is hitting a composite fallback, costing
                  a ton of performance
  https://bugs.freedesktop.org/show_bug.cgi?id=26189

Based on the initial patch by Arjan van de Van.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-25 15:49:38 +00:00
Chris Wilson 5f93d019dc uxa: Adjust uxa_get_color_for_pixmap to match prototype
The prototype says this function returns a Bool and not just an int, so
be pedantic and return TRUE/FALSE.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-25 15:48:48 +00:00
Chris Wilson dc6522dd49 uxa: Protect against a potential NULL src->Drawable reference
One of the convoluted if branches dereferenced Drawable when it is
potentially NULL. Avoid this by explicitly handling the NULL Drawable
cases earlier, and enabling solid fills for solid sources.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-24 09:37:23 +00:00
Chris Wilson 31bbd7f919 uxa/uxa-render: Always remove useless repeats during composite.
I added a jump if there was no src or mask Drawable, but we do actually
need to check for useless src repeats even if we have a source-only
mask.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-24 09:04:16 +00:00
Chris Wilson 326fe00df4 uxa: Increase amount of composite fallback verbage
The fallback log for http://bugs.freedesktop.org/show_bug.cgi?id=26189
does not actually state the reason why we actually fallback. This is
possibly because we need to fallback for reasons other than the
operation cannot be performed in hardware -- such as using an alpha map
or the screen is swapped out, so add this information to the fallback
log.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-24 09:02:05 +00:00