Commit Graph

8689 Commits

Author SHA1 Message Date
Chris Wilson 574ab948af sna: Add mmap(wc) handling to has_coherent_ptr assertion
Extend the debuging sanity checks to also cover WC mappings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 19:40:29 +00:00
Chris Wilson 9bbbcc2f42 sna/trapezoids: Fix typo in construction of polygon lines
Fixes regression from a missed replacement in:

commit 191c6b6ca7 [2.99.917]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 5 09:05:20 2014 +0100

    sna/trapezoids: Improve sample locations for imprecise rasterisation

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 13:53:27 +00:00
Chris Wilson 7b7f71a7d5 sna/video: Reuse fallback colorkey filler from overlay for sprites
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 10:41:26 +00:00
Chris Wilson 362d455947 sna/video: Provide fallback support for filling the colorkey
If the GPU is wedged, we cannot use the blitter for filling the
colorkey, so provide an interface to write the value using the GTT
instead.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 09:58:37 +00:00
Chris Wilson 5d4b00032c sna: Copy mode.vrefresh between kernel and X
The value is typically used only for human readable output, though some
kernel modules do use it for preferred mode matching (notably not
i915.ko today). Let us not second guess the desired vrefresh if it is
known.

Suggested-by: "Jasper St. Pierre" <jstpierre@mecheye.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 16:50:55 +00:00
Chris Wilson ac40532680 sna: Allow scanouts to be directly accessed via the GTT even when wedged
We only want to prefer shadow access to ordinary pixmaps (to avoid
reading back via the GTT). However, since we must use the GTT for
scanouts, we may as well take advantage of direct writes even if the GPU
is wedged.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 14:26:00 +00:00
Chris Wilson fdb3a008e9 sna: Clip copy to CRTC shadow
If the user sets the CRTC position before resizing the framebuffer, we
end up with an out-of-bounds CRTC and install a shadow (as the current
framebuffer does not cover the CRTC). In this case, we copy the visible
region before displaying on the CRTC. However, this needs to be clipped
for self-consistency.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 14:11:40 +00:00
Chris Wilson 25581f63cf sna: Allow scanouts to force late attachment
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 13:37:10 +00:00
Chris Wilson 61ab528b16 sna: Disable GPU preferences when marking it as wedged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 13:37:10 +00:00
Chris Wilson cc9d7f6777 sna: Reject CPU blits that require format conversions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 13:37:10 +00:00
Chris Wilson e44e57d4cd sna/video: Do an early check for a wedged GPU before texturing
If we don't have a GPU available, we can not do the colour space
conversion and compositing with the GPU, so bail early.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 12:58:18 +00:00
Chris Wilson 986cb2335c sna: Enable mmap(wc) support by default
Now included in upstream kernels as of

commit 1816f92363036600f2387bb8273b1e5e1f5b304e
Author: Akash Goel <akash.goel@intel.com>
Date:   Fri Jan 2 16:29:30 2015 +0530

    drm/i915: Support creation of unbound wc user mappings for objects

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 10:45:05 +00:00
Chris Wilson c4428532f6 sna: Don't force a batch flush at the start of a BLT fill op
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-05 13:46:33 +00:00
Chris Wilson 19a95be5e9 sna: Don't record old vblank events
When we read vblank events back from the fd, we have to be wary in case
they are older than the most recent vblank query. If they are stale, we
do not want to record them as being the last-known vblank event.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-31 11:55:24 +00:00
Chris Wilson 0d42b0ed25 sna/gen7: Limit threads on HSW GT1
For whatever reason, it seems that for HSW GT1 we cannot specify the
maximum value of the field and leave it to the hardware to clamp the
value to the maximum supported. The impact should be zero other than the
possibilty it workarounds an issue if the hardware doesn't apply the
limit.

References: https://bugs.freedesktop.org/show_bug.cgi?id=87564
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-24 15:20:55 +00:00
Chris Wilson baec802b21 2.99.917 snapshot 2014-12-21 14:41:12 +00:00
Chris Wilson 01ce7efe73 sna: Fix Drawable offsets prior to performing shadow discard
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-20 13:36:50 +00:00
Chris Wilson c27e6306e8 sna/dri2: Check for implicit flushing after updating a Pixmap buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-20 12:46:52 +00:00
Chris Wilson 5c16a4ec9b sna: Skip allocation of new TearFree buffer if not actually flipping
After showing the new front buffer, we have to avoid writing to the back
buffer whilst the flip is still pending (as it may still be being shown
by the display). To do this we check if there are any outstanding flips,
and reallocate if so. However, with a CRTC override, we may just be
flipping that one CRTC and not the current TearFree back buffer and in
that case we can avoid the reallocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-20 12:33:28 +00:00
Chris Wilson 9b3b591476 sna/dri2: Preserve the shadow CRTCs when copying to other areas
In the Composite setup, if we are doing a DRI2 copy onto the front
buffer, we are fully cognizant that the copy will not go onto the
unredirected Windows of another Client. So we can preserve the shadow
CRTC mapping for those Clients, and prevent ping-ponging between CRTC
modes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-19 20:08:44 +00:00
Chris Wilson 391b50c81d sna/dri2: Report changes in pitch when swapping bo
As we have relaxed the pitch restriction between front/back buffers when
swapping, we need to make sure that any change is also reported back
along with the change in front/back names.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-19 20:07:56 +00:00
Chris Wilson ada97d2725 sna/dri2: Look for preferred CRTC for visible portion of the window
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-19 09:43:33 +00:00
Chris Wilson 6f99bbe67e sna/dri2: Prevent NULL pointer dereference of Window private
In case we receive quick successive calls to DRI2GetBuffers on the same
Window, we need to check that the private exists before dereferencing
it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-19 08:37:07 +00:00
Chris Wilson fdd7508e53 sna/dri2: Decouple Window cache on Pixmap changes
If the Pixmap for a Window is changed (i.e. Composite
redirection/unredirection), we also need to decouple any associated DRI2
front buffer for the Pixmap (e.g. used for single CRTC flipping).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-19 07:59:24 +00:00
Chris Wilson 82e4802670 intel-virtual-output: Do not attempt to tidy up the local display if it fails
Just fix the segfault dereferencing the primary display if we bail
during its setup.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-17 08:01:30 +00:00
Chris Wilson c211b3bc61 intel-virtual-output: Add version number to verbose output
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-17 08:00:00 +00:00
Chris Wilson 123754de41 sna: Make error debug tracing available at normal debug levels
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-16 10:34:20 +00:00
Chris Wilson 9953708934 sna: Tune handling of kernel error detection during intial setup
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-12 15:37:07 +00:00
Chris Wilson 01692b8cf2 sna: Fix TearFree multi-monitor operation whilst wedged
The crtc flip (for when the kernel can't do a pageflip) made the mistake
of setting the shadow buffer to the scanout - nullifying the effect of
the TearFree.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-12 15:13:04 +00:00
Chris Wilson 343299c78b sna/trapezoids: Check the pixmap is wrapped before deferencing it
When we AddTraps to a low resolution bitmap, we need to fallback as we
don't wrap it with a GPU pixmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-12 09:40:51 +00:00
Chris Wilson 60ebac5915 sna: Add another Xinerama vs RandR guard
Another place used rrScrPriv without checking for its validity.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87257
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-12 07:55:51 +00:00
Chris Wilson f587d71f3c sna: Catch NULL RandR screen private
If Xinerama is enabled, than RandR12 will be silently disabled. Be
careful not to dereference the rrScrPiv when it doesn't exist.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87207
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-11 08:53:54 +00:00
Chris Wilson 04a09d353f uxa/dri: Remove defunct intel->back_pixmap
This was only required for glamor support.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-09 20:43:52 +00:00
Chris Wilson 08ee9a75df uxa/dri: Fix triple buffer swapping
Fixes regression from

commit 0aa2edbd29
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Nov 5 11:56:20 2014 +0000

    Remove defunct glamor support

where the wrong branch of pixmap exchange upon SwapBuffers was kept when
removing the glamor paths.

Reported-by: Rui Matos
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-09 20:43:44 +00:00
Chris Wilson fc984e8953 sna/dri3: Mesa relies upon implicit fences for X/Compositor synchronisation
The decision has been made that DRI3/intel shall continue with DRI2-style
implicit fencing for synchronisation between X and clients using pixmaps
as texture sources. (The other way around uses explicit fencing!)

References: https://bugs.freedesktop.org/show_bug.cgi?id=81551
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-09 08:08:01 +00:00
Chris Wilson d247cb7d0c sna/gen6: Poke PSMI control around WAIT_FOR_EVENT to prevent idling
The bspec recommends preventing the hardware from going to sleep around
a WAIT_FOR_EVENT, and tells us to use disable sleep bit in PSMI control
to accomplish this.

References: https://bugs.freedesktop.org/show_bug.cgi?id=62373
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-08 11:09:23 +00:00
Chris Wilson d39dc73a80 sna: Inline check for pending events before reading from drm fd
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-08 08:33:11 +00:00
Chris Wilson f8aecdffad sna: Clear the read flags for the shared drm fd after use
In ZaphodHeads, we may reuse the same select read flags and attempt to
read from a blocking drm fd multiple times. However, if we clear the
read flags after first exhausting the fd, we shouldn't then block on
subsequent heads.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-04 11:25:55 +00:00
Chris Wilson 594470c809 sna: Update the fence marker after submitting a new batch
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-04 11:16:58 +00:00
Chris Wilson 9c2c485df9 sna: Validate that the reg/insn size is well defined
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-01 14:31:34 +00:00
Chris Wilson 263d109986 sna: Clamp downsampling tile size
For very large scale factors, it is possible for the current calculation
to underflow and try negative tile sizes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-01 13:26:46 +00:00
Chris Wilson 88e9bb760f sna: Explicitly disable unused pipes after an output reconfiguration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-01 10:54:14 +00:00
Chris Wilson ddf5feba78 sna: Generate a backtrace on assertion failures
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-01 10:00:32 +00:00
Chris Wilson e12ec452a9 sna: Cancel pending mode change notification
Along a couple of paths, we either do not care about the notification
(i.e. during suspend) or do it explicitly. There we should mark the work
as done.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-01 09:46:20 +00:00
Chris Wilson 700c036d18 sna: Reject modesets with 0 outputs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-01 09:31:41 +00:00
Chris Wilson dd421005ca sna: Add a few more asserts to sna_crtc_flip()
Check that we are updating an active CRTC with a valid mode and
associated outputs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-01 09:29:07 +00:00
Chris Wilson 104517507f sna: Do not post shadow updates in the middle of output reconfiguration
Wait until the screens and framebuffers settle before we start updating.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-01 09:26:29 +00:00
Chris Wilson faef6e5e1a sna: Clean up DBG compile warnings
Including a potential crash due to using a unspecified string, oops.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-01 08:29:47 +00:00
Chris Wilson 0bec625cc4 sna: Report when we disable TearFree due to an error in operation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-01 08:13:18 +00:00
Chris Wilson 6059b51b59 sna: Reject attempts to set an invalid mode
Let's be sure the mode has been established before we attempt to apply
it to a CRTC - just in case the kernel tries to use the invalid mode and
blows up.

References: https://bugs.freedesktop.org/show_bug.cgi?id=86679
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-11-28 07:35:26 +00:00