Commit Graph

9591 Commits

Author SHA1 Message Date
Chris Wilson 7e9e92c86b sna: No hw scaling for Baytrail sprites
Ville regrets to inform me that we don't have hardware scaling on
Valleyview either and so we need to employ the GPU as a scaler instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
2017-03-13 15:53:26 +00:00
Chris Wilson be913a3336 sna: Don't stall indefinitely for a missing flip event
If we don't see the flip event completion in time for the next Present
flip, just report failure - rather than block indefinitely.

References: https://bugs.freedesktop.org/show_bug.cgi?id=100162
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-12 09:28:56 +00:00
Chris Wilson ead1a0a087 sna: Repeat EDID read if it changes beneath us
If the blob is changed by the kernel between us querying the connector
property and the multi-stage retrieval, start the read afresh.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-10 02:37:21 +00:00
Chris Wilson 999a4dd5db sna: Assert that PolySegment boxes are not empty
There is no point in passing an empty box to the hardware, or to damage
tracking, so we assert if we find such degenerate boxes later. Add an
assertion to check that the generates boxes for PolySegment are not
empty.

References: https://bugs.gentoo.org/show_bug.cgi?id=611926
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-10 00:51:16 +00:00
Chris Wilson 57daa3742e sna: Filter out all degenerate PolySegment
After converting the segment into a box, discard all that are empty and
that we have no overflow.

References: https://bugs.gentoo.org/show_bug.cgi?id=611926
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-10 00:51:07 +00:00
Chris Wilson d1fe45c8f1 sna: Remove stale assert for pixmap dirty tracking
Until recently we would only add dirty tracking for the screen pixmap,
that may change.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-09 11:34:42 +00:00
Chris Wilson 78d7a09b03 intel: Fix checking xf86LoadKernelModule for success
Originally introduced in

commit f66e25def3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jun 23 16:14:28 2014 +0100

    intel: Wait for the DRM device to load

the legacy path was checking the return xf86LoadKernelModule
incorrectly. This error was then copy into the common loader in

commit 6a2dcb388e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jul 31 10:40:32 2015 +0100

    intel: Refactor i915.ko loading support

xf86LoadKernelModule() returns 1 on success and zero on failure.

Reported-by: David Shao <davshao@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100011
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-28 20:52:19 +00:00
Chris Wilson e9cd8c211d pciids: Update for missing Skylake IDs
Sync with kernel commit ca7a45ba6fb9e7ceca56d10b91db29c2f3451a2e
Author: Michał Winiarski <michal.winiarski@intel.com>
Date:   Mon Feb 27 12:22:56 2017 +0100

    drm/i915/skl: Add missing SKL ID

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-27 20:43:06 +00:00
Chris Wilson 880917deee sna: Check link-status after a hotplug event
If the modeset fails, or the link subsequently fails, we need to perform
the modeset again. To signal this the kernel sends us a hotplug uevent
with a new link-status property set to bad. The kernel may have to take
some corrective action which invalidates the current mode and so the
following modeset may fail and we need to go and report to the client
for them to choose the next course of action (reconfigure the displays).
At the very least the kernel *requires* us to reapply the current mode.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-16 07:39:21 +00:00
Chris Wilson 860c3664fe backlight: Provide backlight_find_for_device() stub for BSD
BSD implements a single backlight controller interface and doesn't need
the sysfs searching of Linux. Just report that there is no per-device
backlight to fallback to using the ioctl (and in the process avoid
calling undefined functions inside the BSD block).

Reported-by: David Shao <davshao@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99833
2017-02-16 07:39:00 +00:00
Mike Gilbert 93942b7de8 tools/backlight_helper: #include "config.h"
The file uses defines from config.h but never actually includes it.

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2017-02-10 21:52:47 +00:00
Chris Wilson e4fe79cf0d sna/gen2: Take combined vertex arrays into account for inline limit
When extending the vertex array, we have to remove the currently used
inlined dwords from the available limit.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-05 22:26:00 +00:00
Chris Wilson 38ac6b556d sna/gen2: Cap number of vertices emitted in a single 3DPRIM
There's a maximum of 2^18 dwords in a single command, or else we
overflow the lenth field.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99620
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-05 21:03:35 +00:00
Chris Wilson 8572955b01 Revert "sna: Force CRTC off when DP-MST are unplugged"
This reverts commit 2da23747c6 as it
is already applied by disable_unused_crtc() called when the output is
removed, and now we ensure that a residual active CRTC is disabled.
2017-02-01 15:46:04 +00:00
Chris Wilson 9fe04af4bc sna: Explicitly disable unused CRTC
This should be performed via DisableUnusedFunctions, but whilst we are
sanity checking, checking that the CRTC we believe to be off actually
are seems worthwhile.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-01 10:09:36 +00:00
Chris Wilson fe0846b1e1 sna: Remove bogus assert that the connector is a zombie before reattaching
To know that the connector was unplugged before we discover it was
plugged back in again, requires handing the unplug notification in time.
This does not always happen and we may see the reattachment instead.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99432
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-01 09:05:06 +00:00
Chris Wilson 2da23747c6 sna: Force CRTC off when DP-MST are unplugged
New? modus operandi of the kernel is to keep the DP-MST around after it
is unplugged until the last remaining user is gone - that includes our
residual modeset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-01 09:05:06 +00:00
Mihail Konev 2d6f2e8b70 autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26 14:00:21 +10:00
Emil Velikov 2e6c9e26c0 autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 11:13:26 +10:00
Peter Hutterer dd913354e6 autogen.sh: use exec instead of waiting for configure to finish
Syncs the invocation of configure with the one from the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-26 11:13:26 +10:00
Rodrigo Vivi 028c946df0 intel: Update SKL SRV GT4 pci ids reference.
No functional changes. Apparently spec has been changed
the valid table showing 0x192A as Server GT4
while 0x193A is Server GT4e.

Libdrm and Mesa already have this right. So let's fix the ref here.

Kernel is also fixed with commit 5390974f981907.
"drm/i915: Update SKL SRV GT4 pci ids reference."

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2017-01-03 21:03:54 +00:00
Rodrigo Vivi 169c74fa6c intel: Adding Marketing names for Skylake, Kabylake and Apollolake/Broxton.
This commit adding all known marketing names for latest gen9 platforms.

v2: On top of simplified generic string names.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2016-12-06 09:38:57 +00:00
Rodrigo Vivi 2948cf0531 intel: Simplify new platform names.
Modern Intel (R) platforms with integrated graphics comes with common
names varying the range numbers. So instead of listing all supported
platforms let's start using the generic marketing strings without
the numbers.

And for the specific board we list it's actual marketing name if
available on detection.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2016-12-06 09:38:56 +00:00
Chris Wilson ff25ad3402 sna: Reorder frontbuffer resize vs flip event queue draining
If we are not careful, we may process an unflip in the middle of
resizing the frontbuffer - when the ScreenPixmap state is ill-defined.
First flush all the pending flip events, cancel any residual unflips,
then update the screen pixmap. This should be enough to close the race.

References: https://bugs.freedesktop.org/show_bug.cgi?id=98855#c11
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-05 21:37:52 +00:00
Ander Conselvan de Oliveira fcf943f45b Add Geminialke PCI IDs
Same ids from kernel's

commit 8363e3c3947d0e22955f94a6a87e4f17ce5087b4
Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Date:   Thu Nov 10 17:23:08 2016 +0200

    drm/i915/glk: Add Geminilake PCI IDs

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2016-12-05 21:37:52 +00:00
James Clarke a1b39eb6dd sna: Add missing NULL check for readdir result in has_connector_backlight
Signed-off-by: James Clarke <jrtc27@jrtc27.com>
2016-12-05 21:37:52 +00:00
Chris Wilson 4acd4a7d3d sna/gen9: Emit a dummy primitive between VertexElements
References: https://bugs.freedesktop.org/show_bug.cgi?id=98999
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-05 21:37:49 +00:00
Chris Wilson 9ac7a3370a sna: Handle xf86Randr12 gamma changes in xorg-xserver-1.19
commit 17213b74fd7fc4c4e2fe7a3781e7422dd482a0ab
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Tue Jun 21 16:44:20 2016 +0900

    xfree86/modes: Remove xf86RandR12CrtcGetGamma

removed the randr_crtc->palettes allocation and initialisation causing a
later dereference of the gamma table to crash. Looks like that was just
ABI misuse.

References: https://bugs.freedesktop.org/show_bug.cgi?id=98855
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-30 23:54:05 +00:00
Chris Wilson f2901dd34d sna: Always ask the client to reprobe after userspace
This doesn't guarrantee that the client does, but the kernel insists.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-30 23:54:05 +00:00
Chris Wilson 35473dd9c9 sna: Prevent switching to GPU rendering when given a SHM pixmap
If we have a SHM pixmap, we only track rendering via the CPU bo for
synchronisation with the client.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-30 23:54:05 +00:00
Chris Wilson cdd0671764 tools/intel-virtual-output: Check for pending events before blocking
If the xlib/xcb library has pulled events from the fd, then a poll on
that fd will block until new events arrive. If none do, we fail to
process the currently waiting events in a timely fashion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-30 23:54:05 +00:00
Chris Wilson bde946054e backlight: Protect iface writes against signal interruptions
Handle EINTR (and EAGAIN) by repeating until the write is complete.

References: https://bugs.freedesktop.org/show_bug.cgi?id=98759
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-18 16:32:46 +00:00
Chris Wilson 04491bbdaa sna: Set reprobe flag on attached connectors after setcrtc failure
The most common cause of SETCRTC failure is if the connectors disappear.
Force the reprobe on these after a failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-18 16:32:46 +00:00
Matt Roper a1a0f76e55 sna: Ensure we re-calculate fb_to_cursor transform if sharing cursor
If we find that we're sharing the cursor, we wind up bailing out of
__sna_get_cursor() before the fb_to_cursor transform is computed.  For
rotated displays, this can prevent the hotspot transformation from
happening properly, so the cursor's visible position won't match the
software's idea of where it is.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-11-16 06:59:29 +00:00
Chris Wilson 0472b1f0fe sna: Acquire cursor before use in sna_cursor_set_position()
sna_cursor_set_position() requires an already computed cursor
transformation matrix in order to determine whether the cursor is
visible. This is computed in __sna_get_cursor() which is currently only
called for visible cursors - i.e. we were using uninitialised state.

Reported-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-15 22:07:35 +00:00
Chris Wilson 01114334dd sna: Recompute the cursor after a modeset
As a modeset may adjust the rotation or the transform of the cursor, we
may need to recompute the cursor image afterwards.

Reported-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-15 22:07:31 +00:00
Sergei Trofimovich d1d14f20cf brw_eu_emit.c: fix wrong test on a register type
Caught by gcc-6 as:
    brw_eu_emit.c:180:49: warning: logical 'and' of equal expressions [-Wlogical-op]

    if (reg.file == BRW_ARCHITECTURE_REGISTER_FILE &&
        reg.file == BRW_ARF_NULL)
        return;

Change uses 'reg.nr' test for 'BRW_ARF_NULL'.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-11 19:39:18 +00:00
Chris Wilson dad64e9f76 sna/video: Mark the bo as clean after a setplane
The kernel will flush it, so we can treat it as clean after a successful
setplane.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-10 15:42:54 +00:00
Chris Wilson 65b680e6cf sna/video: Don't skip setplane if this frame.bo is the same as the last
Always show the image, even if the bo doesn't appear to change as the
client may have put fresh data in the shared buffer and repositioned the
image.

Suggested-by: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-10 15:42:54 +00:00
Chris Wilson 6d7e13f78b sna/video: Add tiling modifiers for addfb2
In case we do end up with a tiled buffer, create the framebuffer
appropriately.

Suggested-by: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-10 15:42:54 +00:00
Chris Wilson f3809df493 sna/video: Pass the dst extents to xf86XVClipVideoHelper()
xf86XVClipVideoHelper wants to measure from the origin of the target
extents to the clip in order to determine the right offset into the
source.

Suggested-by: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-10 15:42:54 +00:00
Chris Wilson 6c8fc44343 sna: Mark up CPU writes for scanout flush
When we flip to a bo, the kernel will flush it from the CPU write domain
and so afterwards we need to do a new set-domain to mark up a subsequent
CPU write (and flush before another flip).

References: https://bugs.freedesktop.org/show_bug.cgi?id=95414
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-05 23:50:10 +00:00
Chris Wilson bf7316a453 sna/dri2: Don't request a signal following a dead flip completion
If we do flip to restore the bo after the current Window is destroyed,
we should not request that we send an event back to the client.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-03 10:39:56 +00:00
Chris Wilson 40e3be3436 sna/dri2: Complete the final flip in a chain after the window is destroyed
When the pending flip is queued, we update all the Windows to use the
next bo as their rendering target. However, that bo is not yet the
scanout until the future flip is performed. If the current fullscreen
Window is destroyed, we still must allow that flip to proceed or else
the old bo is left on the scanout.

And yes, this is indeed a fix to one of the debug patches that intended
to detect the error causing #93844. Irony.

Fixes: 7817949314 ("sna/dri2: Avoiding marking a pending-signal on a dead Drawable")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93844
Reported-by: Diego Viola <diego.viola@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-03 10:25:00 +00:00
Chris Wilson 47da17fe74 sna: Load DRI3 if try to load DRI2 and fail
As a backup in case DRI2 is disabled due to the presence of vgaarb, make
sure we have DRI3 loaded.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-28 08:05:50 +01:00
Chris Wilson 714052fb32 sna: Keep the backlight iface name on the heap
When finding the per-connector backlight interface, we have to take a
copy of the interface name for later use, as in this case it is not
constant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-24 22:22:44 +01:00
Chris Wilson 325570e731 sna: Check for the per-connector backlight sysfs interface
Modern kernels include a link from the sysfs connector directory to the
backlight interface on that connector. Try to find that link first as
this should allow us to enable backlight interfaces on connectors other
than the presumed solitary panel.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-24 15:42:34 +01:00
Chris Wilson 388fd4a654 sna: Check current fb id before flip as well as after
More debug sanity checks that pageflips work.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-23 20:54:03 +01:00
Chris Wilson 90172d81ea sna: Allow Option DPMS to switch on (but not off)
We start off the system with the screens blanked, waiting the first
dixSaveScreen unblank, where we then apply the accumulated modesets.
This means we have to allow that even if Option DPMS off, and so we
restrict the Option to only enable DPMS (then once enabled they will not
turn off).

References: https://bugs.freedesktop.org/show_bug.cgi?id=98375
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-22 21:06:11 +01:00
Chris Wilson b7d6f695dd sna: Disable screen saver if Option "DPMS" is specified
The defacto standard is that the screensaver only blanks the screen but
keeps the outputs alive. We differ by actually disabling the CRTC when
the screen saver kicks in (to save power), however this circumvents
Option "DPMS".

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98375
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-21 23:11:42 +01:00