Commit Graph

8478 Commits

Author SHA1 Message Date
Chris Wilson aca0bf6387 sna/gen2: Fallback to kernel batch w/a rather than incur a stall
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>
2014-09-07 17:26:33 +01:00
Chris Wilson 57bf3d5f0f sna: Disable the fb on switching away from X
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>
2014-09-07 17:22:31 +01:00
Chris Wilson c17d3b5d5c sna: Compute clones on final ordering
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>
2014-09-07 17:22:12 +01:00
Chris Wilson aa10f480c5 sna: Drop false IGNORE_DAMAGE hint
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>
2014-09-03 10:24:19 +01:00
Chris Wilson 51e364ded2 sna: Trace move-to-gpu overrides with extra DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-03 10:23:18 +01:00
Chris Wilson ee7ed478a2 sna: Skip over hotunplugged outputs during CRTC set
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>
2014-09-03 08:37:39 +01:00
Chris Wilson 48a33fc379 sna/trapezoids: Use the corrected trapezoid origin for aligned boxes
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>
2014-09-02 19:15:54 +01:00
Chris Wilson 84333f6213 sna: Leave more Pixmap breadcrumbs in DBG
Add the Pixmap id to various DBG messages to make it easier to track
rendering.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-02 19:15:49 +01:00
Chris Wilson 407817ebb9 sna: Reject invalid CopyArea based on source clipping earlier
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>
2014-09-01 17:02:44 +01:00
Chris Wilson 92b37783eb test/README: Add missing trailing characters from cut'n'paste
When copying the command from the terminal I failed to highlight the
last character.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-01 15:05:05 +01:00
Chris Wilson ab01c1211e sna: Fallback to normal composite if the blt redisplay fails
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-01 13:37:30 +01:00
Chris Wilson 21cc987ca8 sna: Only decouple the event once
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>
2014-09-01 07:20:00 +01:00
Jonathan Gray 2c564c04bc configure: check for cpuid.h
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]
2014-08-31 11:51:46 +01:00
Chris Wilson e8ad453a0a intel: Only include sys/mount.h on Linux
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>
2014-08-31 11:47:18 +01:00
Chris Wilson 2086965e5c gen8: Refresh video render programs
Reported-by: Timo Aaltonen <tjaalton@ubuntu.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=83207
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 10:45:03 +01:00
Chris Wilson b822bc8c2c sna/gen8: Check instead of asserting for a hang whilst setting up video state
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 10:14:35 +01:00
Chris Wilson 8f584f83dc tests: Add a couple of gstreamer pipeline hints
Having worked out how to use gstreamer, record the pipelines for
posterity.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 09:55:49 +01:00
Chris Wilson 69d584c6ac sna: Prepare fr changes in dirty tracking api (Prime)
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>
2014-08-29 07:29:49 +01:00
Chris Wilson f95d04b75b intel-virtual-output: Use snprintf() for simplicity
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>
2014-08-27 10:24:35 +01:00
Chris Wilson 011f04ff8e intel-virtual-output: Fix invocation of strncpy()
Somebody (me) confused it with snprintf() and put the string length in
the wrong location. Also note that strncpy() does not NUL terminate long
strings.

Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-26 18:31:05 +01:00
Chris Wilson 016599783c intel: Limit read to always fit in the buffer
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Suggested-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-26 12:46:50 +01:00
Chris Wilson e827f80e5c intel-virtual-output: Sanity check length on user supplied socket path
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Suggested-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-26 12:46:41 +01:00
Chris Wilson 51037706b0 sna: Fix attaching to a headless configuration
ADDFB fails with a headless config (as any fb size is invalid).
Fortunately, with headless we can use any depth we like.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-26 11:43:28 +01:00
Chris Wilson 8c5229cf8f sna: Make one last gasp at submitting the execbuffer before bailing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-24 16:25:05 +01:00
Chris Wilson d209b03915 configure: Add guards for os.h redefines
os.h redefines a few common libc functions, so check if the host
provides them first and inform os.h if that is the case.

Suggested-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-24 07:05:35 +01:00
Chris Wilson 12c051d5c6 sna/dri2: Unhook event from draw list upon client destruction
When the client goes away, we need to free its events. However, we
have to defer the freeing of any pending event (ones currently routed
through the kernel) for those we need to remember to decouple the event
from the Drawable's list before they are freed.

Reported-by: John Lindgren <john.lindgren@aol.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82979
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-23 16:28:27 +01:00
Chris Wilson 1bbacf80a9 sna/dri2: Assert event is queued when marked as next pending flip
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-23 16:28:21 +01:00
Chris Wilson 48000371c9 sna/dri2: Remove the redundant parameter passed to free event
draw is always the same as event->draw, so just use event->draw.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-23 16:28:21 +01:00
Chris Wilson fef2f4dbae sna: DBG message fix for !xvmc
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-22 18:57:32 +01:00
Chris Wilson 9b2cf5c7ab sna: Propagate failure from changing backlight value
Especially when we delete the output property halfway through and the
ChangeProperty routine then attempts to wire it back up...

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82833
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-21 08:17:41 +01:00
Chris Wilson 61ec162dc9 backlight: Move the fd out of the select range
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-21 07:56:44 +01:00
Chris Wilson 726f1a38a5 sna: Only send the bl change notification if the randr_output exists
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-21 07:56:44 +01:00
Chris Wilson f5469681b6 sna: Be defensive during FreeScreen()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-18 14:37:44 +01:00
Chris Wilson bfacb9d8dc sna: Add some DBG warnings for early PreInit failures
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-18 14:37:19 +01:00
Chris Wilson 02f184e0ef test: Make SHM tests in lowlevel-blt-bench optional
A slightly more complex patch to disable the SHM based tests of
lowlevel-blt-bench when MIT-SHM support is not available at compile
time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-18 07:43:21 +01:00
Chris Wilson 9058dac302 test: Only compile lowlevel-blt-bench if we have shm
Since 37ac34c4e4, lowlevel-blt-bench
requires SHM support, so only compile it if we detect such during
configure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-18 07:29:05 +01:00
Chris Wilson 16b9447c51 intel: Only dump debugfs on linux
Other platforms are not going to have the same debug infrastructure, nor
even the same mount(2).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-18 07:00:48 +01:00
Chris Wilson f8e632f396 sna: Select appropriate tiling mode for TearFree shadow buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:35:34 +01:00
Chris Wilson c3b093b3c0 sna: DBG log invalid surface sizes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:32:48 +01:00
Chris Wilson e59ea828f5 sna: DBG log all bo allocation failure paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:31:32 +01:00
Chris Wilson 9b8f7db5c9 sna: DBG Log all failure paths in allocating CRTC pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:27:34 +01:00
Chris Wilson e461427ad3 sna: Add error message to explain modesetting failures due to allocation
Since this is an error path with a major user visible failure (the
modeset fails), make sure that we log the reason.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:19:10 +01:00
Chris Wilson 72ed21c694 sna: Do not force creation of a linear GPU bo that we don't want
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:15:26 +01:00
Chris Wilson 3bb9311e5d sna: Use a shadow buffer for linear framebuffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 17:38:49 +01:00
Chris Wilson 0f1280bab9 sna/dri2: Fix compilation with Xorg-1.12.4
In Xorg-1.12.4 we have DRI2 version 6 (and so triple buffering support
by Xorg) but we don't yet have Prime. Remove the check for the Prime bug
in the Xserver for that case.

Reported-by: Axel Rohde
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 07:43:15 +01:00
Chris Wilson d974dabc8a sna: Relax the square cursor assumption
Internally only use a square cursor, but 845g/865g actually supports
rectangular cursors (as they have a relaxed cursor height restriction).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-13 07:58:57 +01:00
Chris Wilson ec10cef592 sna: Only apply a DPMS change for an enabled CRTC
Mostly paranoia, but we need to validate that the stored mode is valid
before applying the modeset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-12 10:52:38 +01:00
Chris Wilson 9cc72c2dc7 sna: Suppress "switch to mode" messages for internal CRTC applies
We only want to log a mode change when it is initiated by the user. For
internal updates, such as changing the frame or restoring a mode from
DPMS, we want to silently apply the current mode.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-12 10:49:20 +01:00
Chris Wilson b3138bee8d sna: Separate panel checks from adding default modes
The flags are now separate, so treat them individually.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-12 09:00:04 +01:00
Chris Wilson 6554cf0a69 sna: Parse output options early during initialisation
Before we can query whether an option is set, we first need to generate
the options table. This is done through xf86OutputUseScreenMonitor() so
make sure it is called as early as possible in the proceedings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-11 12:23:24 +01:00