Commit Graph

9028 Commits

Author SHA1 Message Date
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
Chris Wilson 83b8528773 sna: Fix ancient typo in DEFAULT_TILING == Y
We could just fix the typo, but that whole if block is redundant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-21 15:29:50 +01:00
Chris Wilson d8401806b4 sna/dri2: Don't convert from Y-to-X when exporting pixmaps
If the pixmap's GPU bo is already allocated with Y, expect Mesa to deal
with it rather than convert to X.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-21 15:17:38 +01:00
Chris Wilson 33374755c5 sna: Add a define to change scanout tilings by default
Just for testing, you hear?

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-21 15:07:21 +01:00
Chris Wilson 65cc48757e test/present: Do a double flip to test tiling changes
Since the first flip may require a fixup, we will only really know with
the second flip whether we can start a flip chain with different tiling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-21 15:06:18 +01:00
Chris Wilson 37cf561fd2 sna: Allow flips to continue after successfully fixing up the CRTC
If we receive an error from the pageflip ioctl, we attempt to set the
framebuffer using SETCRTC instead. This is so that we can transition
between pitches and offsets for a CRTC. However, the kernel may reject a
flip also for tiling changes, or for any reason, which we also want to
transparently handle. Rearrange the error message and flip->blit
fallback handling to only do so if we try to flip twice (i.e. after
resetting the CRTC) and we still fail.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-21 14:40:27 +01:00
Chris Wilson 54770d46f1 tools/dri3info: Include compilation instructions for standalone building
Let the read know how to compile dri3info without having to compile the
whole of xf86-video-intel

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-21 10:16:27 +01:00
Chris Wilson 75037efcd7 test/dri3: Add an explicit DRI3 extension check first
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-20 15:00:47 +01:00
Chris Wilson 7eaf593640 sna/present: Reuse last cached swap msc/ust during a flip chain
Querying the known swap values is much slower than not!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-18 12:37:42 +01:00
Chris Wilson 75d8776247 sna: Enable blitting with Y-tiled surfaces
Since gen6, there has been a magic register bit to change the
interpretation of the tiling mode between X and Y for BLT operations.
With the advent of DRI3 and scanouts supporting Y, enabling support at
last appears interesting, perhapss even by default for non-scanouts?

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-17 11:45:03 +01:00
Chris Wilson 432e0775ee sna/present: Check earlier for an incompatilble tiled Pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-17 10:21:30 +01:00
Chris Wilson 4b4bcbfcff intel: Fix inconsistent captilisation of "graphics"
As we treat it as a name we should capitilize each word, but we forgot
that rule (sometimes!) for Broadwell.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-16 21:11:01 +01:00
Chris Wilson 3abc3ce3b5 sna/gen8: reduce CHV VS URB entries to 640
According to BSpec the max number of VS URB entries for CHV is 640.

Based on a patch by Ville Syrjälä.

v2: Start using a GT info block like earlier generations.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> [v1]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-16 21:06:03 +01:00
Ville Syrjälä 1e1a7875cf intel: Add marketing names for CHV
All CHV devices will be branded as "Intel(r) HD Graphics".

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-04-16 21:06:03 +01:00
Ville Syrjälä c43617b739 gen8: Fix the YUV->RGB shader
Use the correct register (Yn_01) with first half of the
Y samples instead of using the register (Yn_23) with the
second half twice when computing the green channel.

Also use the Yn_01 register name instead of Yn for the red
channel as well, just for a bit of extra consistency.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89807
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-16 21:05:51 +01:00
Chris Wilson 57252b63f9 sna: Force GTT fallback if we cannot BLT or RENDER download
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-16 14:30:41 +01:00
Chris Wilson 5df16db52e sna/dri3: Mark incoming sna_pixmap->flags
We use the flags for deciding how to operate on the GPU bo, so we should
set them!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-16 14:24:50 +01:00
Chris Wilson 66f3db6789 sna: Use addfb2.1 for extended scanout support
If at first you don't succeed, try, try again.

The kernel API is lame and requires a new interface for something that
is designed to be supported through the old interface...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-15 08:36:39 +01:00
Chris Wilson c87e80637a sna: Use addfb2.1 for extended scanout support
If at first you don't success, try, try again.

The kernel API is lame and requires a new interface for something that
is designed to be supported through the old inteface...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-15 08:34:26 +01:00
Chris Wilson 37ce4dd0a0 sna: Leak the mmu_notifier for sync userptr
Since creating/destroying the mmu_notifier for sync userptr is fairly
expensive, leak the test userptr object to keep it around for the
lifetime of our process.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-14 23:44:56 +01:00
Chris Wilson 2faf255100 sna: Reverse the size check so that it works
I managed to confuse myself when testing since I had to force the
addition of default modes...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-14 22:01:22 +01:00
Chris Wilson 26fd6bec11 sna: Add common widescreen resolutions
Currently we add fake modes to cater for applications that want to
change the screen size but limit themselves to only those that are
available, and do not wish to either use RandR scaling or their own. For
widescreen panels, these 4:3 aspect ratio modes require panel fitting
and so are less than satisfory. Since we add fake modes, let's add a few
common widescreen modes as well (choosing the right aspect ration for
the panel).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37858
References: https://bugs.freedesktop.org/show_bug.cgi?id=29890
References: https://bugs.freedesktop.org/show_bug.cgi?id=89996
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-14 21:02:12 +01:00
Chris Wilson 4c277bc43d sna: Make ioctl invocation more compiler friendly
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-14 15:35:39 +01:00
Chris Wilson 9c109f3dc5 sna: Mark the GPU as available before doing the mode restore on VT enter
Sometimes we want to render with the GPU when doing a mode switch, e.g.
if we need to initialise an output surface. To do so, we need to prepare
the acceleration layer first.

Lots of thanks to Vasily for tracking this one down.

Reported-by: Vasily Khoruzhick <anarsoul@gmail.com>
Bugzilla: https://bugs.archlinux.org/task/43534
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-12 21:23:11 +01:00
Chris Wilson 5d1ffd6f34 sna: Mark the fallback TearFree flip path as pending
An oversight when enabling efficient sharing of the shadow_crtc (i.e.
clients flipping to one monitor).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-12 20:53:05 +01:00
Chris Wilson f74121e222 sna: Set addr for the 64bit self-relocation
Copy-paste fail.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-12 17:54:49 +01:00
Chris Wilson aff63c65bb sna: Fix self-relocations fixups for 64-bit addressing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-12 16:12:52 +01:00
Chris Wilson 8350f1e073 sna: Tidy DBG_NO_SHRINK_BATCHES code
We can combine the llc-path with the DBG path and trim a little of the
ifdeffery.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-12 16:12:51 +01:00
Olivier Fourdan fbefc8f2bd uxa: Do not register hotplug without RandR
When using Xinerama, RandR is automatically disabled, and calling RR
routines will trigger an assert() because the RR keys/resources are
not set, leading to an Xserver abort.

Hotplug makes little sense without RandR, so no need to install a
udev monitor if RandR is not available, as done in sna.

v3: Rebase onto backwards compatible rrPrivKey detection [ickle]

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-09 11:46:21 +01:00
Chris Wilson 148777f028 sna: Fix RandR detection to work before dixPrivateKeyRegistered
Since dixPrivateKeyRegistered was only introduced in 1.10, we need an
alternative probe for older Xservers.

Suggested-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-09 11:43:37 +01:00