Commit Graph

5343 Commits

Author SHA1 Message Date
Chris Wilson 2dc93b2a6c sna: Check results from syscalls
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-19 15:34:09 +01:00
Chris Wilson 06634604ab Initialise adaptors to 0 in case xf86XVListGenericAdaptors does not
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-19 15:28:43 +01:00
Chris Wilson 8bfea58dbc sna: Minor cleanups from sematic analyser in DBG
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-19 15:26:18 +01:00
Chris Wilson 0a43d42567 uxa: Implement glyphs-to-dst to avoid fallbacks
An earlier version was buggy and introduced corruption as it failed to
fallback gracefully with ComponentAlpha glpyhs. This is a much simpler
implementation that composites each glyph individually, leaving it to the
backend to optimise away state changes. It should still be many times
faster than incurring the fallback...

Reported-by: Oleksandr Natalenko <pfactum@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50508
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-19 15:21:43 +01:00
Chris Wilson 64a4bcb8ce uxa: Use (white IN glyph) ADD mask to compose the glyph mask
As pointed out by Soren Sandmann and Behdad Esfahbod, it is essential to
use white IN glyph when adding to the mask so that the channel expansion
is correctly performed when adding to an incompatible mask format.

For example, loading alpha as the source results in the value 000a being
added to the rgba glyph mask (for mixed subpixel rendering with
grayscale glyphs), whereas the desired value is aaaa.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-19 14:05:12 +01:00
Chris Wilson 99845dcb3b Post Damage on the Screen Pixmap after a pageflip
This issue was raised by Dave Airlie as he is trying to integrate
multiple GPUs into the xserver, and a particular setup has a slave
rendering device that copies the contents from the GPU over a
DisplayLink USB adaptor. As such the slave device is listening for
Damage on the Screen Pixmap and needs the update following pageflips.
Since we already are posting damage for all the SwapBuffers paths other
than pageflip, for consistency we should post damage along the pageflip
path as well.

Reported-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-19 10:43:09 +01:00
Chris Wilson 4acf727941 sna: Initialize the color value for fallback unaligned boxes
Reported-by:Zdenek Kabelac <zkabelac@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=5047
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-19 10:24:24 +01:00
Chris Wilson b0b2d3c966 sna: Avoid copying unintialised data during source picture upload
If we have never written to a pixmap, then there will be neither a GPU
or shadow pointer and we would attempt to copy a NULL pointer. In this
case as the user is expecting to copy unintialised data we are at
liberty to replace those undefined values with the clear color.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-19 00:41:35 +01:00
Chris Wilson 38472fcc53 sna: Double check that the source is busy before performing indirect reads
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-19 00:40:04 +01:00
Chris Wilson 8cdfb8c24c sna: Fix up the shadow pointer on the source when copying
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-19 00:40:04 +01:00
Chris Wilson 17f3a83fdc sna: Review sna_copy_boxes
A couple of ordering issue and more assertions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-18 23:50:04 +01:00
Chris Wilson a9045699b9 sna: Reset region after transferring to cpu
If we adjust the region for the pixmap offset, be sure that we reset it
before returning it back to the caller.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-18 23:50:03 +01:00
Chris Wilson 9f51311a7d sna: Check if the busy is truly busy before commiting to an indirect upload
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-18 23:50:03 +01:00
Chris Wilson 291b3c4367 sna: Align upload buffers to 128
This seems to be a restriction (observed on 965gm at least) that we
have incoherent sampler cache if we write within 128 bytes of a busy
buffer. This is either due to a restriction on neighbouring cachelines
(like the earlier BLT limitations) or an effect of sampler prefetch.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50477
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-18 23:50:03 +01:00
Chris Wilson 39e5c74915 sna: Assert damage is valid after every addition
Even more paranoia than just checking upon migration.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-18 22:20:01 +01:00
Chris Wilson 92e1693e5f sna: Validate cpu/gpu damage never overlaps
References: https://bugs.freedesktop.org/show_bug.cgi?id=50477
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-18 21:29:51 +01:00
Chris Wilson d2312c8f95 sna: Fixup tracking of vmap upload buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-18 21:30:58 +01:00
Chris Wilson 75e9eeca7e sna: Remove overlapping CPU damage when operating inplace on the GPU
Otherwise we gradually introduce garbage into the picture.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50477
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-18 16:39:20 +01:00
Chris Wilson a936466dd4 sna: Prefer to attempt a Composite operation rather than use pixman composite
As pixman composite performance is atrocious for anything other than
solids, prefer to upload the mask and attempt a composite operation on
the GPU unless we are forcing the fallback.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-18 11:36:53 +01:00
Chris Wilson 4b325d6e2b sna: Fix rendering of unaligned boxes through pixman
Not only do we need to make sure the source is available to the CPU, we
need to actually check the right conditions for clipping the box.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-18 11:29:56 +01:00
Chris Wilson caef27492b sna: convert another instance of applying the clear to the CPU pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 21:00:34 +01:00
Chris Wilson 8695c4c776 sna: Fix the blt composite op with no-ops
When returning early because the operation is a no-op, we still need to
fill in the function pointers to prevent a later NULL dereference.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 17:14:06 +01:00
Chris Wilson 7905ddae1d sna: Further refine choice of placement when uploading source data.
The goal is cheaply spot a simple copy operation that can be performed
on the CPU without having to load both parties onto the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 17:14:06 +01:00
Chris Wilson 5a675b61f2 sna: Correct typo forcing everything to be clear to 0!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 15:42:17 +01:00
Chris Wilson b55bf1abbe sna: Fix cut'n'paste errors in tiling debug
Rename for different variables

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 15:05:33 +01:00
Chris Wilson 9756c60b4a sna/gen7: Enable non-rectilinear spans
Seems we have enough GPU power to overcome the clumsy shaders. Just
imagine the possibilities when we have a true shader for spans...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 11:39:33 +01:00
Chris Wilson 41aff56a1f sna: Add tiling for spans
Semmingly only advisable when already committed to using the GPU. This
first pass is still a little naive as it makes no attempt to avoid empty
tiles, nor aims to be efficient.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 10:59:55 +01:00
Chris Wilson 222e6ff43e sna: Read inplace for fallback copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:30 +01:00
Chris Wilson 79d468925b sna: Decrease latency for 1x1 GetImage by using an inplace mapping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:30 +01:00
Chris Wilson 2c2a8d3780 sna: Allow reads to be performed inplace
If we can guess that we will only readback the data once, then we can
skip the copy into the shadow.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson bc6997f6f7 sna: Cleanup damage processing after operating inplace
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson 937ca8a5d8 sna: Use memset for simple clears
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson de4572b0b5 sna: Inspect CPU damaged state when deciding upon Composite placement
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson b689cd924c sna: Composite traps inplace if the CPU is already all-damaged
One outcome is that inspecting the usage patterns afterwards indicated
that we were missing an opportunity to reduce unaligned boxes to an
inplace operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson ae3c096379 sna: Composite glyphs inplace if the CPU is already all-damaged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson eaed58b2ba sna: Tweak placement of operations
Take in account busyness of the damaged GPU bo for considering placement
of the subsequent operations. In particular, note that is_cpu is only
used for when we feel like the following operation would be better on
the CPU and just want to confirm that doing so will not stall.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson 8eac098962 sna/gen3: Add another DBG for dropping vbo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson 515c8b19d6 sna: Prefer to operate inplace if already mapped of the GPU is wholly dirty
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 15:41:14 +01:00
Chris Wilson d1713941e9 sna: Tweaks for DBG missing glyphs through fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 15:41:08 +01:00
Chris Wilson 2b23605efb sna: Don't trim prepare for glyphs_via_mask
If we pass the expected width/height without passing the per-glyph
offset into the preparation function, we make the erroneous mistake of
analysing the glyph cache only for the mask extents and so will miss
glyphs that we need to upload for the operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 15:28:31 +01:00
Chris Wilson 9f66b27114 sna: Remove mark-as-cpu after gem_pread
The kernel no longer moves the read bo into the CPU domain, so remove
the last vestiges of that tracking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 13:47:33 +01:00
Chris Wilson bfd88d5429 sna: Silence a few compiler warnings
Nothing harmful, just noise.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 11:21:29 +01:00
Chris Wilson b3659beec8 sna: Check for zero-sized damage regions after trimming Windows to their pixmaps
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 11:21:25 +01:00
Chris Wilson 293a867ea5 sna: Specialise the self-copy blitter to handle vertically overlapping copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 23:21:59 +01:00
Chris Wilson 3b76ab995b sna: Add a little bit more DBG to migration IO paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 22:33:11 +01:00
Chris Wilson 49543522e7 sna: Fix reversed assertion
Darn the double negative! After adding damage we want to assert that
the region is not empty, not !not empty.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 20:25:21 +01:00
Chris Wilson 4e50467b4f uxa: Force the outputs to off for consistency with xf86DisableUnusedFunctions()
Upon a VT switch, we set the desired modes and turn off the DPMS on any
unused output. Make this explicit so that we always maintain consistency
between the kernel and X's list of enabled CRTCs.

References: https://bugs.freedesktop.org/show_bug.cgi?id=50772
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 19:44:22 +01:00
Chris Wilson 3a56a0b10e sna: Make the disable-unused after vt switch distinct from DPMS off
So that we do not lose control over dpms on/off!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 19:26:42 +01:00
Chris Wilson b415ca05c2 sna: Reset damage extents after reduction goes to zero
If the reduction of the damage clears all of the boxes, we need to reset
the -infinite extents so that we continue to accumulate further damage.

Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50744
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 17:08:03 +01:00
Chris Wilson 0df7c48864 sna: Supporting overlapping copies for fallback blits
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50393
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 16:48:52 +01:00