In the near future we will be dealing with dynamic discovery of
connectors, and so we cannot assume that the mode resources will be
static for our lifetime. The first step is to not keep that struct
around, but pull out the useful information and discard it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The major change here is not do a full promotion if we are filling
through a clip region. The original intention was to catch doing the
initial clear of the background, but it was also triggering for drawing
rectangular outlines etc.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The BLT paths are only taken when we know we are overwriting the target
contents, and so we do not have to worry about reads along those paths.
However, in terms of migrating the damage for a pixmap, we have to be
careful in case we do not write to the full area of the composite
rectangle, in which case we have to treat it as a read to that area and
migrate the damage.
Regression from
commit a13781d19d [2.20.10]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun Aug 19 09:45:12 2012 +0100
sna: Enable BLT composite functions to target CPU buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-by: Matti Hämäläinen
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we are overwriting part of the framebuffer, we know we do not need to
read that portion back from the scanout.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
A side-effect of the workaround for incoherent physical cursors is that
we never reused a cursor after disabling. As such moving the cursor off
the pipe and back on would eventually consume all the preallocated
structs leading to a segfault.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78002
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
commit 534a0e6433
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Apr 28 07:53:13 2014 +0100
sna: Factor in destination sizes for choosing intermediate tiling bo size
assumed that the target bo was being initialisation for the tiling
composite; it was not.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we cross the high water mark, first flush the batch, then check the
remaining pages to see if they fit into the aperture.
Reported-by: Bruno Prémont
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When tiling, factor in the destination usage of the aperture in case
that reduces the available aperture for the intermediate bo.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We need to avoid all allocations within the signal handlers, so
preallocate the cursor structs.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77975
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We need to avoid all allocations within the signal handlers, so
preallocate the transfer buffer.
References: https://bugs.freedesktop.org/show_bug.cgi?id=77975
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We can update the priv->cpu flag more accurately by accounting for the
early exits for the INPLACE accessors.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
On older architectures, we can only do the inplace upload into a GPU bo
into a new unused bo (that is still in the GPU domain).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If an overlay video (using the sprite interface) is visible on multiple
outputs, we have to create and show a sprite for each.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77802
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
So the sna_set_cursor_postion() assertion was reported to have caught us
trying to adjust the position of an absent cursor. That should be
impossible as we should only arrive there if we claim we can support a
HW cursor and so have a registered cursor. However, changing the
assertion into a guard is trivial, and preserves peace of mind.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Submit a dummy batch so that we still build, submit batches and perform
relocations, but do not actually invoke the GPU. This can be useful when
looking at mysterious hardware hangs.
References: https://bugs.freedesktop.org/show_bug.cgi?id=77263
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In Zaphod mode, we use a common pool of glyph images but insert them
individually into a cache for each head. However, we only remove the
image from the first cache, leaving a stale slot in the second head.
Upon subsequent reuse of the glyph id, the second head renders garbage.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54707
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we launch less than the maximum number of threads, we may read the
thread->arg value never having set it after a malloc.
==8207== Conditional jump or move depends on uninitialised value(s)
==8207== at 0xA986B7F: sna_threads_wait (sna_threads.c:216)
==8207== by 0xA986EFE: sna_image_composite (sna_threads.c:350)
==8207== by 0xA93DD0D: sna_composite_fb (sna_composite.c:598)
==8207== by 0xA93E66C: sna_composite (sna_composite.c:742)
==8207== by 0x23A773: damageComposite (damage.c:503)
==8207== by 0x2309A9: ProcRenderComposite (render.c:708)
==8207== by 0x15D86D: Dispatch (dispatch.c:433)
==8207== by 0x161689: dix_main (main.c:294)
==8207== by 0x6FB1B44: (below main) (libc-start.c:287)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
commit 154f7e9668
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Apr 18 09:28:02 2014 +0100
sna: Do not reuse physical cursors for the kernel is broken
was insufficient as it ended up reusing a stale cursor that was still
attached, and so after updating the cursor the second pipe found itself
with a valid cursor. Hey presto, we had a shared physical cursor, once
again demonstrating the buggy kernel.
This time, disable all cursor reuse except for the once currently
attached to the pipe - this should prevent all sharing.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77351
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When the shadow scanout is active, make sure we call the BlockHandler
every time, not just when we about to sleep. This is in case we are
swamped by clients trying to render and forgo the important step of
ensuring that their output reaches the screen.
Reported-by: Ildar Nurislamov <absorbb@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Big bug in the kernel that prevents the sharing of cursors across pipes
when they are backed by a phys_obj. To prevent hitting that bug, don't
do that!
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77351
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In order to avoid rendering to the bo and then stalling before we can
pin it the display plane, bind the framebuffer into the GTT (by using a
GTT mmap) during the initial allocation.
References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In order to avoid rendering to the bo and then stalling before we can
pin it the display plane, allocate bo for fb from uncached and change
the cache level during the initial allocation.
References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Rather than guess in the backend when we are going to be called for
multiple boxes, rely on the frontend declaring it correctly.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
sna_display.c:3176:43: error: 'struct <anonymous>' has no member named 'rotation'
assert(cursor->rotation != sna->cursor.rotation);
Reported-by: Ildar Nurislamov
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Try not to steal a rotated cursor that is currently in use, or else we
may see a brief flash of corruption.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>