Commit Graph

94 Commits

Author SHA1 Message Date
Chris Wilson 65d530b59b Revert "uxa: Refactor early-exit paths of uxa_try_driver_composite()."
This reverts commit fa5c573455 as it
causes a SIGSEGV.

Reported-by: lu hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57389
2012-11-22 08:18:38 +00:00
Eric Anholt fa5c573455 uxa: Refactor early-exit paths of uxa_try_driver_composite().
Saves 200b of code at -O2.
2012-11-20 11:39:47 +00:00
Eric Anholt edefb64d2b uxa: Work around uninitialized-value warning.
The compiler isn't noticing that localDst only diverges from pDst when
the _copy variables have also been set.
2012-11-20 11:39:47 +00:00
Chris Wilson 902391bd79 uxa: Remove dead-code for SourcePictures
All SourcePictures are now converted into Drawables, which had been
assumed by the driver backend. However, the code still existed to
attempt to pass procedural pictures onwards and so set pSrcPix to NULL
which was being flagged by the static analyser as a potential NULL
dereference.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 17:20:39 +01:00
Chris Wilson 25807f472d uxa: Remove hook for CompositeRectangles
It was broken and not flushing damage correctly. With the
improvements made to the kernel, it is no longer a significant advantage
per se and not worth its additional complexity.

Reported-by: Tilman Sauerbeck <tilman@code-monkey.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32547
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-23 15:00:53 +00:00
Chris Wilson a5583165da uxa: Remove concept of global FB ownership made obsolete by GEM and KMS
With the introduction of GEM, we can continue to submit batch buffers
irrespective of ownership of the console, so do so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-28 13:57:09 +00:00
Zhigang Gong f8b9a2a547 uxa/glamor: Enable the rest of the glamor rendering routines
This commit hooks up all the remaining rendering routines to call into
glamor; the takeover is nearly complete! When tested with the latest
glamor master branch, it passes rendercheck.

One thing need to be pointed out is the picture's handling.
Pictures support many different color formats, but glamor's
texture only support a few color formats. And the most common
scenario is that we create a pixmap with a color depth and
then attach it to a picture which has a specific color format
with the same color depth. But there is no way to change a
texture's internal format after the texture was allocated.
If you do that, the OpenGL will allocate a new texture. And
then the glamor side and UXA side will be inconsitent. So
for all the picture related operations, we can't fallback to
UXA path directly, even it is rather a straight forward
operation. So for the get_image, Addtraps.., we have to add
wrappers function for them to jump into glamor firstly.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
[ickle: prefer access; ok = glamor(); finish; if (!ok) goto fallback; return; ]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-14 11:29:29 +00:00
Zhigang Gong c4c2eb1fae uxa/glamor: Introduce additional access modes to wrap glamor acceleration
Integrate glamor acceleration into UXA framework. Add
necessary flushing at the following points:

1. Flush UXA batch buffer before call into glamor.
2. Flush GL operations after return from a glamor function.
3. The point we need to flush UXA batch buffer, we also
   need to flush GL operations, for example, in
   intel_flush_callback and couple of places in intel_display.c.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-16 23:57:57 +00:00
Chris Wilson a26c5d44cc uxa: Ensure that alphaMaps are mapped into the CPU for fallbacks
Reported-by: Hans-Peter Budek <peter.budek@gmx.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 13:11:14 +00:00
Chris Wilson 4c66b28870 uxa: Fallback if the temporary is too large
If the render operation requires a temporary source Picture and the
operation is large, larger than the maximum permitted bo, then we will
fail to allocate the bo. In this case, we need to fallback and perform
the operation on the CPU rather than dereference a NULL bo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34399
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-17 16:52:58 +00:00
Bryce Harrington 6e721e098b Check return value of uxa_acquire_solid() since it can return NULL
uxa_acquire_solid returns NULL under OOM.  Thus the value of solid
must be checked before dereferencing it in the uxa_get_offscreen()
call.

Signed-off-by: Bryce Harrington <bryce@canonical.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-04 08:57:11 +00:00
Chris Wilson da990536ec uxa: Undo damage translation before appending
The region is used to paint onto the backing pixmap (and thus
translated) prior to being passed to the damage layer (wrt to the
drawable). So the local translation needs to be undone first.

Identified by Christopher James Halse Rogers.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33650
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-03 09:41:48 +00:00
Chris Wilson 1ba983034b uxa: Emit the damage after the render for the workaround in uxa_solid_rects
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-07 12:27:29 +00:00
Chris Wilson 81d355a8dc uxa: Fix crash after allocation failure
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31487
Reported-by: Thomas Fjellstrom <tfjellstrom@shaw.ca>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-09 09:30:12 +00:00
Matthias Hopf b84925b9c0 Make driver compile for 1.6 Xserver series again.
Signed-off-by: Matthias Hopf <mhopf@suse.de>
2010-09-22 17:45:06 +02:00
Chris Wilson c57840b272 uxa: Check for failed pixmap allocation
Fixes:

  Bug 29187 - crash in intel_drv
  https://bugs.freedesktop.org/show_bug.cgi?id=29187

Backtrace:
0: /usr/bin/X (xorg_backtrace+0x28) [0x466808]
1: /usr/bin/X (0x400000+0x67c79) [0x467c79]
2: /lib/libpthread.so.0 (0x7ff19b297000+0xef60) [0x7ff19b2a5f60]
3: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7ff197986000+0x34684) => uxa/uxa-render.c:841

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-21 09:08:28 +01:00
Chris Wilson b58a6a39c1 uxa: Fallback to pixman if source is out-of-bounds
If the source is outside the drawable, then CopyArea will fail to
initialise the source correctly. The simplest fix in this case is to
fallback to pixman to generate the source texture.

Fixes:

  Bug 28497 - Graphics corruption after opening a specific website
  https://bugs.freedesktop.org/show_bug.cgi?id=28497

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-23 23:56:44 +01:00
Chris Wilson af5c4fc96d uxa: Check for allocation failure.
Check for the NULL Picture prior to passing it to the backends for
inspection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-19 13:39:48 +01:00
Chris Wilson 35a12f0290 Fallback implementation for trapezoids for hung GPUs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-10 23:02:31 +01:00
Chris Wilson 8c1a8d2297 Revert "xp:trapezoids"
This reverts commit f429fb9d87.

An experimental patch I forgot was on my main branch as I was bugfixing.
ARGH!
2010-06-09 10:03:29 +01:00
Chris Wilson f429fb9d87 xp:trapezoids 2010-06-08 19:52:46 +01:00
Eric Anholt 2c1fda08e8 Use libc instead of deprecated libc wrappers for malloc/calloc/free. 2010-06-06 15:56:35 -07:00
Chris Wilson cd38b705be Disable acceleration if we detect a hardware error.
This is wildly optimistic, but it should work in a surprising number of
error situations and some output in those cases will be hopefully be
better than none...

If we submit a batchbuffer and the kernel reports the GPU is hung (which
will be caused by an earlier execbuffer, and so the kernel should have
had enough time to determine whether or not it could reset the GPU) then
disable any further attempt to accelerate gfx and force fallbacks to map
the buffers and use the CPU. We cannot normally map any more buffers if
the GPU is hung, so only those already mapped prior to the hang can be
written to, or those allocated in system memory. However, we can expect
that the framebuffer is already mapped, and so have a reasonable
expectation to continue to see the display update.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-31 18:00:11 +01:00
Chris Wilson 03bbb4c896 uxa: Perform manual damage for CompositeRects
[xserver-1.8] The damage layer doesn't wrap CompositeRects, so we need to
manually append the damaged region ourselves. This works for
miCompsiteRects since that translates the call into multiple invocations
of either PolyFillRectangle or Composite, which themselves cause damage.

Fixes:

  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-26 10:21:03 +01:00
Chris Wilson b9ada52a30 uxa: Force the alpha value to 0xffff when treating Over as Src
Since we have at most 8 bits of alpha, we treat >= 0xff00 as opaque.
However, being paranoid we should set the alpha value to 0xfff in case
something unexpected happens when converting from the xRenderColor to
the pixel value.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26 10:21:03 +01:00
Chris Wilson b645ec83e0 uxa: Apply the drawable offset to the solid rects
Fixes:

  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-25 09:49:20 +01:00
Chris Wilson 80a9e64f50 uxa: Use temporary dest when target is too large for compositor
If the destination cannot fit into the 3D pipeline when we need to
composite, we fallback to doing the operation on the CPU. This is very
slow, and quite easy to trigger on i915 by plugging in an external
display.

An alternative is to extract the extents of the operation from the
destination using the blitter which can usually handle much larger
operations. This gives us a temporary target that can fit into the 3D
pipeline and thus be accelerated, before copying back into the larger
real destination.

For x11perf this boosts glyph rendering on PineView, from 38kglyphs/s to
480kglyphs/s. Just a little shy of the native performance of 601kglyphs/s

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24 18:31:16 +01:00
Chris Wilson 91f560034f uxa: Composite glyphs directly onto dst when possible.
Without using a mask and compositing directly onto the destination,
takes us from 580 kglyphs/s to 850 kglyphs/s on i945 [x11perf -aa10text].

However, the extra intersection check almost entirely cancels out the
speed up and we discover that the glyphs in x11perf are always
overlapping. Nothing is ever easy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24 18:31:15 +01:00
Chris Wilson c2abf8d659 uxa: translate the region in line for composites
When compositing, we need to convert the box into a rect and so the
advantages of using REGION_TRANSLATE are lost.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24 09:40:28 +01:00
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 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 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