Instead of using a NULL type depth buffer, it is strongly suggested to
use a 1x1 16-bit depth buffer instead (with address 0).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The earlier query of cursor (simply to find out the hw size) was
replaced by an invariant determined when the cursor was first set.
However, not all uses of cursor->size were fixed.
Fixes regression from
commit f98b2e1646
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Apr 2 08:36:14 2014 +0100
sna: Prevent signal re-entrancy into cursor update routines
Reported-by: Christoph Haag <haagch.christoph@googlemail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77053
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When dereferences priv, make sure it exists first. ShmPixmaps for
example, may not have one, nor do very small buffers.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the composite reads entirely from within a large pixmap which is a
clear color, just replace the source with a solid.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As we may need to allocate from within the cursor update, we are prone
to re-entrancy issues within malloc()/free(). To avoid these we need to
block SigIO (for pointer updates) whilst in the critical section.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The assertion was checking that the invalid condition was true, rather
than that it never happened. Oops.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the pixmap is already partially on the GPU, and the next operation
touches the entire pixmap, promote that operation back to the whole GPU.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
sna_display.c: In function '__sna_get_cursor':
sna_display.c:3153:6: warning: assignment from incompatible pointer type [enabled by default]
src = sna->cursor.ref->bits->argb;
^
sna_display.c:3209:10: warning: comparison of distinct pointer types lacks a cast [enabled by default]
if (src != sna->cursor.ref->bits->argb)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As we need to recompute them for each CRTC, we need to reset the
computation each time or else we screw up the coordinates and hide
the cursors at random.
Breakage from commit 25ca8f136c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Mar 27 14:15:30 2014 +0000
sna: Support variable sized cursors
Reported-by: Jan Alexander Steffens <jan.steffens@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76724
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We know that all the virtual CRTCs are at the end of the CRTC array, so
when we see the first one, we can stop the processing of real CRTCs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Search for an exact match first, before looking for a cursor we can
reuse. This should help reuse with multiple rotated screens not stealing
the others' cursor on every pass.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the cursor does not completely fill the size of the hardware cursor,
we will retain whatever contents already filled that area.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
One of the downsides with supporting large cursors is that the full size
is very rarely used leading to a waste of permanently allocated
resources. Refactor our cursor handling so that we can allocate fresh
cursors on the fly that are appropriately sized.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Under a host, we naturally will not setup the cursor capability, and
this provides a safeguard in case we have a machine that does not
support hardware cursors.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we are given an fd by the Xserver, then it is not our responsibility
to close it during CloseScreen.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Hans de Goede <hdegoede@redhat.com>
Since we already lookup the device path if we do not know it after
opening the fd, we can remove the special case along the legacy PCI
probe path.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Based on the patch by Kenneth Graunke,
"Several places (such as intel_cache_expire) call intel_emit_batch_flush,
so it needs to work on Broadwell. Sometimes the batch is empty, in
which case current_batch may not yet be BLT_RING.
The PIPE_CONTROL code has not been ported to work on Broadwell, so
trying to do a render ring flush will hang the GPU. It also doesn't
make any sense to do a render ring flush, given that we never use the
render ring for UXA on Broadwell."
Cc: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
I hit this corner case when testing a single X server spanning both intel
gfx + an usb display link adapter driven by xf86-video-modesetting.
In this scenario the intel driver gets its platformProbe method called first,
and if it then closes the server managed fd, the xf86-video-modesetting gets
EBADFD errors.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Based on the patch by Hans de Goede, this removes the handling of
drmOpen() and DRM_MASTER from within uxa and instead uses the common
routines. This reduces the duplicate code from within uxa, and enables
new features such as server managed fds.
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Whilst hosted, which is very similar to being headless, we do not even
have the kmode pointer and so checking kmode->count_crtcs is fatal.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
An accidental drop of the if (!is_translation) broke composite copies
under a transform.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76244
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Under PictFilterNearest, we can ignore fractional translations (not all
renderers discard those.) And if we are being approximate, we can loosen
our tolerance as well.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Normally, we try to render into the CPU bo of a SHM pixmap. However, under
the right circumstances we may try to do a series of rendering into the
GPU bo and then copy it back to the CPU bo. In that case, we need to be
sure to mark the pixmap as requiring the flush.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This supports solid, copy, put_image, and get_image acceleration via the
BLT engine. RENDER acceleration (composite) and Xv would be piles of work,
which is not worth doing since SNA exists, and Glamor is coming.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>