Commit Graph

9007 Commits

Author SHA1 Message Date
Chris Wilson dbfbbcb4b3 sna: Mark GPU as wholly damage when replacing a drawable
References: https://bugs.freedesktop.org/show_bug.cgi?id=90725#c37
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-02 11:50:40 +01:00
Chris Wilson c692691029 sna: Ensure damage is set to full when marking as clear
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-02 11:42:08 +01:00
Chris Wilson 2fa48450c7 sna: Avoid using NULL pointer inside DBG
When pretty printing the format for DBG, make sure it is not NULL!

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90725#c32
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-02 09:15:09 +01:00
Chris Wilson 189ad44c94 sna/dri2: Only attempt to change tiling when required
If we have no fence, we then try to discard the tiling. However, the
change_tiling routine assumes that it is only called when a change is
actually required. Make it so for dri2.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-01 17:10:08 +01:00
Chris Wilson d1bf75f155 sna: Compilation fixes for stable distros
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-01 11:02:15 +01:00
Chris Wilson 7a371f6bef Merge branch 'master' of 192.168.1.213:/usr/src/xf86-video-intel 2015-06-01 08:50:31 +00:00
Chris Wilson b792b2c0b8 sna/dri2+: The DRI2/DRI3 protocol requires fenced tiling
If we export a surface over DRI2/DRI3, we have to use explicit tiling
via the kernel. :(

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-01 09:11:59 +01:00
Chris Wilson 085efe6817 sna: Force Linear FB when swizzling is unknown and fencing disabled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-01 08:59:30 +01:00
Chris Wilson e08589de09 sna: Disable tiling assertion with unknown swizzling and white lies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-01 08:54:19 +01:00
Chris Wilson d1479d8d03 sna: Double check that a tiling change request results in a change
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-01 08:42:28 +01:00
Chris Wilson 67185f54ba sna: Disable existing GTT mmap when switching to unknown swizzle + tiling
As a consequence of using GPU swizzling without telling the kernel is
that we must disable GTT access -- especially if we already have a
linear mmapping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-01 08:35:10 +01:00
Chris Wilson 14b5ab3fef sna: Enable use of GPU tiling even when SET_TILING fails
On gen4+, we no longer need to setup a fence for tiled operations and so
can program the GPU irrespective of the kernel tiled settings. However,
this means that we then cannot access the object through a GTT mmapping
(as we have no fence to do detiling) and nor can we use a WC mmap as the
swizzle is unknown.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-01 08:25:12 +01:00
Chris Wilson 834bdb0344 sna: Relax a couple of tiling assertions
Along a couple of passes, we have to set pitch back to 0 when reusing a
linear surface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-31 19:11:54 +01:00
Chris Wilson db78a3449c sna: Keep pitch even for I915_TILING_NONE surfaces
We have to ignore the return value of the pitch for untiled 2D surfaces
(since the kernel clears the tiling stride parameter).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-31 12:34:45 +01:00
Chris Wilson 9a6c77d7ad sna: Add a few more asserts for clearing tiling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-31 12:10:32 +01:00
Chris Wilson 0cd01c04fa sna: Always apply the SET_TILING results to the bo
Since the kernel can silently change the tiling on the object
irrespectie of the ioctl's request, we have to double check and remove
any such invalid object from our lists.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-31 09:16:36 +01:00
Chris Wilson ce4836b091 sna: Detect when SET_TILING fails to change tiling
If the swizzling is unknown, the SET_TILING ioctl silently converts the
request back to I915_TILING_NONE. In order to detect this, we need to
double check the ioctl parameters.

References: https://bugs.freedesktop.org/show_bug.cgi?id=90725#c21
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-31 08:58:02 +01:00
Chris Wilson 401b9deef0 sna: Flag disabled CRTC to xrandr
If we disable a CRTC, mark it as such and send an XRR event so that
userspace can do any recovery, and so that hopefully xrandr remains
consistent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-28 11:30:14 +01:00
Chris Wilson 5fa114d945 sna: sna_set_desired_mode() always returns true, make it void
Since sna_set_desired_mode() always returns true, we can make it void
and remove some unreachable code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-28 11:23:35 +01:00
Chris Wilson fb1643f0f9 sna/dri2: Refine ring selection with multiple active rings
The preference given multiple rings is to the previous writer, or if
none, to the render ring if active.

References: https://bugs.freedesktop.org/show_bug.cgi?id=90671
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-27 08:08:11 +01:00
Chris Wilson a6dd2655cb sna: Clear encoders request field when updating properties
Reported-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-25 08:27:18 +01:00
Chris Wilson 8b7bdff750 sna: Initialise no-op callbacks early
In case of error, we try to free up memory before trying again. This
involves callbacks into higher level code - but if we fail early, we
will not have those hooks installed. Set no-ops stubs early to prevent
untimely crashes.

References: https://bugs.freedesktop.org/show_bug.cgi?id=90622#c1
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-25 08:02:46 +01:00
Chris Wilson e617c1941c sna: Force restoration of SW cursor after HW cursor fails
In order to reset the SW cursor, we need to call xf86CursorSetCursor.
However, the parameters we need to call SetCursor with are not exposed
we need to be a little tricky and call a pair of functions that will
save and then restore the cursor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-19 12:44:26 +01:00
Chris Wilson 276a628827 sna: Disable HW cursor if we fail to update it
If we cannot control the HW cursor, flag it as invalid and enable the SW
cursor next time. The flag will remain set until the next modeset and we
then try the HW cursor again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-19 11:20:31 +01:00
Chris Wilson 324ba96520 tests/render-trapezoid: Add edge tests
Check fidelity of edge rendering, just a variant of render-triangle

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-19 10:45:37 +01:00
Chris Wilson 3852977f14 test: Add a fidelity test for triangle edge rendering
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-18 13:14:42 +01:00
Chris Wilson fe64672c83 sna: Wrap GetImage with sigtrap
Mostly for completeness, though it is still remotely possibly for the
dst pointer to raise a SIGBUS (just less likely since it is not a i915
bo).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-18 09:18:41 +01:00
Chris Wilson d4c82a16bc test: Remove the blit through a temporary Pixmap
Originally this was inplace so that we wouldn't simply migrate the
target away from the GPU whenever we inspected results. That is no
longer a problem and so we can speed up the tests by skipping the
temporary.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-18 09:16:12 +01:00
Chris Wilson b10ef9cf5c sna/glyphs: Improve handling of low bitdepth mask format conversions
We shouldn't just discard the mask if the user requests that we render
the glyphs through a low bitdepth mask - and in doing so we should also
be careful not to improve the bitdepth of that mask (since we don't take
into account the extra quantisation desired).

Testcase: render-glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-18 09:05:30 +01:00
Chris Wilson 6d64063750 sna: Markup a couple more potential mmap() accesses
All pointer access into a mmap() arena should be wrapped by sigtrap, in
case the kernel generates a SIGBUS (oom, eio, bugs, etc). Add a couple
more missing annotations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-17 21:47:56 +01:00
Chris Wilson 959598cbff sna: Check and warn if there exists a GPU error state
When we mark the GPU as wedge and disable acceleration, always check if
there is a GPU error state and warn if so - it is increasingly rare to
get a pure EIO from throttling thereby circumventing the current error
state checker.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-17 13:01:04 +01:00
Chris Wilson 335ac8742e sna: Wrap CPU access for composite operations with sigtrap
Anytime we access a mmap() we need to be prepared for the kernel to send
us a SIGBUS, but we were missing a few sigtraps around calls to
pixman_fill and pixman_blt.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-17 12:30:33 +01:00
Chris Wilson a16a7e36ca sna: Only mark wedged checking inside operations as a WARN
These are primarily to serve to detect when we expect to see corruption
as a result of a badly timed EIO rather than fatal, so downgrade the
assertion to a warn.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-17 08:51:57 +01:00
Chris Wilson aa44ba990a intel: Prevent crash with X -configure
When run with -configure, xf86configptr is NULL, so be careful and do
not dereference it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-16 22:15:31 +01:00
Chris Wilson f696867c89 intel-virtual-output: Record the cursor shape in the DBG log
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-16 22:15:31 +01:00
Chris Wilson 63c43dfa63 intel-virtual-output: Only store cursor image on reference display
We only need a single copy of the cursor image, from which we can create
all the cloned cursors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-16 22:15:31 +01:00
Chris Wilson 5054e22712 Remove the driver option to delete connectors on unplugging
With a MST topology change, we can find outputs may disappear. We offered
a choice as to whether to simply disable them or completely remove them
from the listing of available outputs.  However, clients never expected
that their operation on any output could trigger a BadID XError (or that
there is anyway to prevent race conditions). As such an option was made to
disable by default, but allow testing complete removal. Now the RandR
protocol has been clarified such that XID assigned to outputs are now
permanent, as such the option breaks the spec, so drop it.

See randrproto commit 895ee5264524c7c239ee4ef5e39c4e295323fb51
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed Apr 22 10:58:18 2015 +1000

    randrproto: clarify output XID lifetimes.

    This just makes a note that randr won't make outputs disappear
    dynamically.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@redhat.com>
2015-05-04 14:05:27 +01:00
Chris Wilson b400dd22c2 sna: Clear has-pinned-batches if we can no longer actually pin
Insert rant about useful kernel interfaces being removed without
justification.

References: https://bugs.freedesktop.org/show_bug.cgi?id=88411
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-03 12:01:03 +01:00
Olivier Fourdan e7016d30f3 backlight: Do not hang forever if helper pid is -1
Backlight helper PID is set to -1 by default, if for some reason it's
not set, we may end up with waitpid(-1, ...) which will hang forever.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90230
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2015-04-29 10:33:19 +01:00
Chris Wilson 1a67dacd75 sna: Remove conflicting set-purgeable
A couple of stray set-purgeable points were causing eventual assertions
that we didn't try and set-purgeable twice.

Minor regression from
commit 73ae4197d6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Apr 24 14:36:50 2015 +0100

    sna: Defer marking cache objects purgeable

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-27 09:29:33 +01:00
Chris Wilson dafd181441 uxa: Fix compilation for bool
../../../src/uxa/intel_driver.c: At top level:
../../../src/uxa/intel_driver.c:769:1: error: unknown type name 'bool'

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-24 20:48:14 +01:00
Chris Wilson 73ae4197d6 sna: Defer marking cache objects purgeable
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-24 15:21:11 +01:00
Chris Wilson f2807d3b5e sna: Reuse compiler attribute fast to build fast_memcpy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-24 13:08:24 +01:00
Chris Wilson 0bcc3ef02c sna: Mark avx as being a subset of avx2 optimisations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-24 12:32:19 +01:00
Olivier Fourdan 9b96431713 sna: Fix build with gcc 5.0
gcc generates an error at build time because it fails to inline some
functions:

  blt.c: In function 'affine_blt':
  blt.c:980:1: error: inlining failed in call to always_inline
  'bilinear_weight': optimization level attribute mismatch
   bilinear_weight(pixman_fixed_t x)

  blt.c:1164:7: error: called from here
      fy = bilinear_weight(y1);
         ^
  blt.c:980:1: error: inlining failed in call to always_inline
  'bilinear_weight': optimization level attribute mismatch
   bilinear_weight(pixman_fixed_t x)

  blt.c:1163:7: error: called from here
      fx = bilinear_weight(x1);
         ^
  blt.c:989:1: error: inlining failed in call to always_inline
  'bilinear_interpolation': optimization level attribute mismatch
   bilinear_interpolation(uint32_t tl, uint32_t tr,
   ^
  blt.c:1207:11: error: called from here
      b[i] = bilinear_interpolation(tl, tr, bl, br, fx, fy);
           ^

Do not force inlining of these functions and let the compiler decide to
avoid the compilation failure.

v2: fix up the other two force_inlines whilst we are here

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2015-04-24 09:37:24 +01:00
Chris Wilson 09d8e5e1b3 sna/gen6+: Fix BLT src/dst tiling checks
In a couple of the copy paths, src/dst parameters were reversed,
inverting the direction of the tiling flags.

Reported-by: Andy Furniss <adf.lists@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90138
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-23 08:35:52 +01:00
Chris Wilson 64e45993cf sna: Fix interpretation of SWCTRL
Bspec says it is an override for the source format, irrespective of
the tiling bit supplied in the command packet. So we need to apply the
FLUSH+LRI more often.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-22 21:16:01 +01:00
Chris Wilson 52bc0b119c sna/gen6: Do not force a blt switch onto a Y-tiled surface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-22 20:35:07 +01:00
Chris Wilson 45475fb7c9 sna: Update blt fallback to handle Y-tiled surfaces
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-22 20:35:07 +01:00
Chris Wilson 4fdd3a714d sna/gen6+: Discourage use of the BLT with Y-tiling
Somewhere, somehow the first glyph character upload into the Y-tiled
glyph cache is corrupt since

commit 75d8776247
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Apr 17 10:29:28 2015 +0100

    sna: Enable blitting with Y-tiled surfaces

I have not spotted whether it is a missing magic bit or a bad GTT path,
but ideally we don't want to switch to BLT along that path anyway (since
we are in the middle of rendering with the other engine).

Reported-by: Andy Furniss <adf.lists@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=90138
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-22 16:03:31 +01:00