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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>