Commit Graph

8502 Commits

Author SHA1 Message Date
Chris Wilson fc4bc3cde9 sna: Initialise remaining batch space
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>
2014-09-12 16:11:25 +01:00
Chris Wilson 9fb399aee9 sna/blt: Fix computation of remainaing boxes on gen8+
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-12 08:24:06 +01:00
Chris Wilson e3edf29484 sna: DBG compile fix
Dereference the right output for the name in the new backlight
functions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-12 07:53:12 +01:00
Chris Wilson 1aefd16964 sna: Use default monitor options on the first output
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>
2014-09-12 07:46:43 +01:00
Chris Wilson 9e397830f5 sna/gen8: Re-enable userptr
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>
2014-09-11 17:03:39 +01:00
Chris Wilson 797369449b sna: Do not mark the pixmap as cleared in the middle of a miSpans decomposition
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>
2014-09-11 09:37:11 +01:00
Chris Wilson fda1ffb07e sna: Request the backlight to be disabled along with DPMS off
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>
2014-09-11 08:11:34 +01:00
Chris Wilson 08921e4bda backlight: Expose interface to switch backlight on/off entirely
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>
2014-09-11 08:09:39 +01:00
Chris Wilson f2b62ab38f sna: Prune damage that covers the entire target Pixmap
Reduce it early and mark it complete.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-10 16:55:14 +01:00
Chris Wilson 9b25eeee85 sna: Do apply damage twice for miSpans.PolyFillRect
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>
2014-09-10 16:37:16 +01:00
Chris Wilson 224af800f6 sna: Emit assertions with FatalError
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>
2014-09-10 11:58:11 +01:00
Chris Wilson 0d1df4762f sna: Relax early failure to set KMS modes
Under the new world order, we may not have KMS rights until we are given
a VT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-10 08:37:02 +01:00
Chris Wilson f39e1d19c1 sna: Fix use of GETBLOB ioctl for grabbing the MST path
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>
2014-09-10 07:17:18 +01:00
Chris Wilson 07fe45b84b sna/glyphs: Prevent NULL vfunc deref with glyphs
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>
2014-09-09 08:12:45 +01:00
Chris Wilson faf0bdd477 sna: Add some DBG spam for BLT boxes
References: https://bugs.freedesktop.org/show_bug.cgi?id=77074
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-09 07:36:40 +01:00
Chris Wilson e0f7e9fc2f sna: Initialise and check for batch space
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>
2014-09-08 16:49:29 +01:00
Chris Wilson 30932a7b9d sna: Avoid u16 underflow when computing reserved batch space
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>
2014-09-08 12:50:29 +01:00
Chris Wilson 692c14d405 2.99.916 snapshot 2014-09-08 08:53:32 +01:00
Dave Airlie 84fb3bb65f uxa: actually create the randr outputs for hotplug connectors
I somehow lost this chunk in my mst patch I sent.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-08 08:49:49 +01:00
Chris Wilson 001c542618 2.99.915 snapshot 2014-09-08 07:54:25 +01:00
Chris Wilson db01c9d627 sna: Fix backlight assertion after only hiding planes
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>
2014-09-08 07:13:47 +01:00
Chris Wilson da0c9638d7 sna: Fix an unreachable piece of code
It doesn't do anything but the static analyzers at bay.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-08 07:07:08 +01:00
Dave Airlie 908520a7da uxa: add MST support.
This adds MST support to the UXA paths in the driver.

Signed-off-by: Dave Airlie <airlied@redhat.com>
[ickle: Restore current output naming scheme]
2014-09-07 18:40:10 +01:00
Dave Airlie b64a8f0e3e uxa: drop mode_res caching.
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>
2014-09-07 18:25:39 +01:00
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