BO allocations for pixmaps must be aligned to the tile height, but at
some point the code was changed to align them to twice the tile
height. This overallocates pixmaps, wasting memory, but more
importantly, for buffers allocated by DRM and shared through DRI3, the
stricter alignment check causes sharing to fail.
From reading through the history of the code and related bugs, it
seems like this change was part of a set of changes trying to address
what turned out to be a kernel regression. Reverting this change
solves the DRI3 problem and saves a bit of memory for pixmap
allocations.
Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Let the kernel send these back to us so that DIX hears about them in
the usual way.
Mode setting while Present has a flip active will trigger an unflip
before the mode is changed. The event from that unflip will not get
processed before the mode switch is executed. Clearing the driver
queue at mode switch time will discard the connection between the
kernel event and the present callback so that DIX will never know that
the flip pixmap is idle.
Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
sna_trapezoids_precise.c:566:1: warning: unused function
'polygon_add_line' [-Wunused-function]
gen4_vertex.c:3093:1: warning: unused function
'gen4_choose_spans_vertex_buffer' [-Wunused-function]
Reported-by: Zdenek Kabelac <zkabelac@redhat.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
./xassert.h:24:9: warning: '__XASSERT_H___' is used as a header guard
here, followed by #define of a different macro [-Wheader-guard]
^~~~~~~~~~~~~~
./xassert.h:25:9: note: '__XASSERT_H__' is defined here; did you mean
'__XASSERT_H___'?
^~~~~~~~~~~~~
__XASSERT_H___
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
virtual.c:1081:6: warning: variable 'width' is used uninitialized
whenever 'if' condition is true [-Wsometimes-uninitialized]
if (clone->dst.mode.id == 0) {
^~~~~~~~~~~~~~~~~~~~~~~
virtual.c:1092:6: note: uninitialized use occurs here
if (width == clone->width && height == clone->height)
^~~~~
virtual.c:1081:2: note: remove the 'if' if its condition is always false
if (clone->dst.mode.id == 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
virtual.c:1079:11: note: initialize the variable 'width' to silence this warning
int width, height;
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In particular, the promotion of an active snooped bo into an uncached
linear GPU bo was being performed on a busy buffer and forcing a stall.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Another missed gcc warning resulting in a crash due to a missing
kgem_batch_space() initialisation.
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
commit 6554cf0a69
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Aug 11 12:22:17 2014 +0100
sna: Parse output options early during initialisation
rearranged the monitor query to before the num_outputs increment. The
result was that it choose the second output as the default and not the
intended first.
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=522500
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Current testing says that it is stable now... Let's see how long that
holds.
References: https://bugs.freedesktop.org/show_bug.cgi?id=79053
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As the miSpans will continue to overdraw the Pixmap, it's final state
will no longer be that clear value. We need to be much more careful when
allowing that optimisation.
Reported-by: Tyler Foo <tftylerfoo@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=77074
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When we turn off the screen, either at the user request or when
disabling an output, request that the associated backlight (which may
only be known to userspace) also be disabled.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
A feature in recent kernels is to disambiguate between the meaning of
brightness=0, between disabling the the backlight entirely or setting
the lowest valid brightness. As such, we now have an extra knob in sysfs
to explicitly request that the backlight be turned off.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As the caller will apply the damage afterwards, we do not need to do the
accumulation in the miSpans callbacks and it presumes that its damage is
unaltered.
References: https://bugs.freedesktop.org/show_bug.cgi?id=77074
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The intention is to be able to capture the assertion in the Xorg.0.log
(journald equivalent). At the moment, it is emitted to stderr which is
difficult to capture and defeats the goal of only asking the reporter to
upload one log file.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Unlike the other drm getters, GETBLOB insists on the exact length rather
than being told the buffer size.
Reported-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Requires running a PRIME setup with Intel loaded as the secondary GPU
and attempting to execute an empty glyph string.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
commit 30932a7b9d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Sep 8 12:41:06 2014 +0100
sna: Avoid u16 underflow when computing reserved batch space
relied on gcc a little to much to warn me when I missed initialising 'rem'
References: https://bugs.freedesktop.org/show_bug.cgi?id=77074
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we filled the batch exactly, then subtract -1 for the reserved
BATCH_BUFFER_END, it would underflow to a large value - convincing us
that we had sufficient room to stuff many, many more commands in.
However, all the callsites should be guarded by checking already that
they had sufficient space to emit at least one operation...
References: https://bugs.freedesktop.org/show_bug.cgi?id=77074
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we only hide the planes, we do not turn off any outputs and so can
skip resetting the backlight entirely.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This will cause problems with MST displays which need to update the
connector list after topology changes.
Signed-off-by: Dave Airlie <airlied@redhat.com>
If we have no pinned batches available, use the kernel w/a if available
rather than stall waiting for an active batch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Currently we turn off the CRTCs when switching away from X in order to
not leak our framebuffer. With the new drm_plane support, we can simply
unset the framebuffer, which should be a lighterweight operation than
disabling the CRTC.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The clones are indices into the output arrays, so recompute the clones
if we reorder the outputs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
IGNORE_DAMAGE is used by sna_drawable_use_bo to ignore both CPU/GPU
damage. It used to only ignore CPU damage, but now is a more general
hint. However, here we were intending to only say ignore the cpu damage
that we explicitly discarded anyway.
References: https://bugs.freedesktop.org/show_bug.cgi?id=81973
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
These outputs are already marked as disconnected and so should be
excluded from the CRTC set, but to be safe skip over them.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The rule for the origin of the CompositeTrapezoids routine is the
upper-left corner of the first trapezoid. Care must be taken in case the
trapezoid edge is upside down to consider the upper vertex.
Reported-by: "Jasper St. Pierre" <jstpierre@mecheye.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Given a ridiculous CopyArea, say copying from (-32000,-32000), the
region extents will wrap around when translated before the final clip
and reject test. To overcome this, do source based rejection earlier
before the potential underflow.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the client and drawable destroys are racing, we may trigger the event
removal twice.
References: https://bugs.freedesktop.org/show_bug.cgi?id=83183
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Instead of checking for a particular version of GCC check for
a cpuid.h with __cpuid_count. This allows cpuid.h to be
provided for older/different compilers.
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
[ickle: Delete the bare and redundant config.h]
We only automount debugfs for Linux, but sys/mount.h on BSD has unmet
dependencies breaking the build.
Reported-by: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Future commit "pixmap: fix reverse optimus support with multiple heads"
will allow for tracking within pixmaps (i.e. break the presumption that
everything starts at offset 0,0 in the target pixmap).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Third one-line patch to fix copying from the tainted user argument into
the socket's path buffer. This time, give in and just use snprintf() as
it guarrantees that it will not write more than 'n' characters and that
the last is a NUL byte.
Suggested-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>