Commit Graph

8588 Commits

Author SHA1 Message Date
Chris Wilson bf7b5a24bb sna/dri2: Exchange pitches as well
When swapping over the names, we also need to swap the pitches exposed
through the protocol as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-18 10:13:31 +01:00
Chris Wilson 6b98f16241 sna: Allow TearFree updates to continue even when the GPU is wedged
Even if we cannot render using the GPU, we should still be able to
request that the outputs be flipped. So try, and only if that fails,
resort to writing directly into the scanout.

References: https://bugs.freedesktop.org/show_bug.cgi?id=85058
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-16 09:39:50 +01:00
Chris Wilson c896f249c7 sna: Fixup a failed per-CRTC TearFree flip
If we fail to flip onto a new per-CRTC bo, first try a normal modeset.
This catches instances where the pitch changes for example.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-16 08:17:09 +01:00
Chris Wilson 3812dfce17 sna: Replace GPU render operations with CPU callbacks after wedged
If we find the GPU is wedged, replace some of the lowlevel render
operations with CPU equivalents to simplify some fallbacks that still
need to operate on GPU bo (such as copying DRI buffers).

References: https://bugs.freedesktop.org/show_bug.cgi?id=85058
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-16 07:48:27 +01:00
Chris Wilson 9a5ca59d2b sna: Prevent recursion during last-gasp disabling of outputs
If we fail an execbuffer, we disable outputs and try again. (In case we
have severe fragmentation issues and need to rearrange the scanouts in
GTT.) Afterwards we re-enable the outputs, but this causes us to flush
the pending rendering and so recurse into the execbuffer. Prevent this
with a slight hack during enabling of outputs.

References: https://bugs.freedesktop.org/show_bug.cgi?id=85058
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-15 16:56:02 +01:00
Rodrigo Vivi 49cf2803d3 sna: a bit of cleanup on gen8_render.h
Removing bits that become reserved on bdw and organizing 3DSTATE_PS header.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-10-14 08:01:00 +01:00
Rodrigo Vivi f5935aa4bb sna: Fix URB offset shift on 3DSTATE_SBE
Unfortunatelly this doesn't the bug I was hunting, but let's follow
the spec.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-10-14 08:00:16 +01:00
Chris Wilson 2c227f391a sna: Drain all udev events before checking output status
As libudev only pulls off events one by one and we may need to process
several for a MST topology change, keep polling until complete.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-13 09:26:12 +01:00
Chris Wilson 49376ba3bd backlight: Open bl_power using WRONLY for writing.
Jan spotted that we open the bl_power file using O_RDONLY and then attempt
to write the new power state into it. This fails...

Reported-by: Jan Steffens
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-11 21:36:11 +01:00
Chris Wilson 70a1710e18 sna/trapezoids: Sacrifice precision to avoid 64bit overflow
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c71
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-11 16:15:56 +01:00
Chris Wilson 069f7878dc sna/trapezoids: Treat mono-edges within a single column as vertical
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-11 16:15:56 +01:00
Chris Wilson 0c1b4f913c sna: Log if we disable the backlight after failure to switch it on
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-11 16:15:56 +01:00
Chris Wilson f7f7383de0 compat: Hide changes in miHandleExposures() interface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84901
2014-10-11 16:15:46 +01:00
Chris Wilson c139e2fb95 intel: Store pointer to struct intel_device
Beware the barbarians at the gate, who invade and steal your ScrnInfoPtr
and its Entity from underneath you. In some configurations, we lose
access to the struct intel_device stored on the Entity after
initialisation, causing havoc. Workaround this by storing the
intel_device that we open in our driverPrivate.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-08 13:59:55 +01:00
Chris Wilson 57c48e4973 sna: Fix the TearFree flip handler for the change in argument order
From the last commit c481254c17,
we need to pass along the private pointer as the flip data as we no
longer pass it down from the caller.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-07 21:09:23 +01:00
Chris Wilson c481254c17 sna: Retrieve private pointer from vblank cookie
When using ZaphodHeads, we share the /dev/dri/card0 fd between both
screens. So when we read an event back from the fd, it could be for
either head and we cannot assume that our private pointer is valid for
the data passed along with the event. Instead, we need to retreive that
pointer from the event.

Fixes regression from

commit 8369166349 [2.99.912]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 4 08:29:51 2014 +0100

    sna/dri2: Enable immediate buffer exchanges

although the design bug is actually older.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84744#c15
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-07 16:30:03 +01:00
Chris Wilson 9ed1ac8b50 sna: Wrap rrGetInfo so that we can probe when udev is not active
If the ddx is configured without udev support, we do not receive
notifications when the MST topology is changed. This leads us to query
the kernel for bad connectors, and so we end up reporting an unknown
connection status for them, which the user and client often find
confusing. However, we can not simply act upon the detection failure as
we are too deep inside the callback chain and cannot change the arrays of
known connectors whilst iterating over them. A neat compromise is to
hook into the rrGetInfo call chain and poll for MST changes before we
report back the current configuration.

References: https://bugs.freedesktop.org/show_bug.cgi?id=84718
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-07 10:27:35 +01:00
Chris Wilson dff59000d4 sna/trapezoids: Remove stale assert
The variable changed meaning, but the assert did not. Fix that up.

Reported-by: Matti Hämäläinen <ccr@tnsp.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-07 07:26:11 +01:00
Chris Wilson 11c7f2d2f4 sna: Add pixmap id to DBG hints inside rende migration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-07 07:26:11 +01:00
Chris Wilson ec2b9ac81a sna: Avoid the intermediate allocation for PRIME pixmaps
If we attempt to share an unused Pixmap, we first create an ordinary GPU
bo when migrating onto the GPU. Add a flag here to cause the migration
to create a Pixmap suitable for PRIME instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-06 08:55:27 +01:00
Chris Wilson 649b233f12 sna/trapezoids: Remove redundant coverage scaling
Since we do not perform an analytical pass, we can count samples directly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-05 11:14:52 +01:00
Chris Wilson 191c6b6ca7 sna/trapezoids: Improve sample locations for imprecise rasterisation
We need to sample at the mid-point of each subrow rather than at the
top and preserve the full precision of the edge gradients.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-05 10:44:25 +01:00
Chris Wilson aa89ef69ac sna: Double check for no residual CPU damage along redisplay fast path
If we are using a CRTC source pixmap, it is possible that it is on the
CPU with a GPU bo and so requires flushing prior to the copy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-05 10:44:23 +01:00
Chris Wilson e50e1bb3fd sna: Only use copy redisplay fast path if we have a source GPU bo
Odd as it may seem, but we can end up attempting to copy from a source
CRTC pixmap that is not on the GPU. Here we need to use the heavyweight
path to handle its composition normally.

Reported-by: Christoph Haag <haagch@frickel.club>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84653
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-05 08:12:52 +01:00
Chris Wilson 7d60a9be3d sna: Update vblank interval after enabling outputs
In a couple of cases we can re-enable CRTC. After doing so we should
recompute the minimum vblank interval.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-03 17:20:31 +01:00
Chris Wilson a797c192ad sna/dri2: Disable tracking stale back buffers without reuse-notifications
If the Xorg does not support the ReuseNotify callback, and we use
double-bufferred pageflips, we set the stale flag on the backbuffer but
never clear it. This results in, for example, a compositor with Xorg-1.15
and Prime active from updating the framebuffer.

Reported-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-02 07:29:13 +01:00
Chris Wilson de7185bbf4 sna/trapezoids: Fix comparison on right edge of trapezoids
We need to compare the fixed ceiling rather the floor for accuracy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-01 10:28:51 +01:00
Chris Wilson c6d9303303 sna/trapezoids: Consistently use NO_GPU_THREADS to disable threading for DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-01 10:28:51 +01:00
Chris Wilson bca08dc415 sna/trapezoids: Fix loss of precision through projection onto sample grid
Preserve the original precision for the line vectors of the trapezoids,
and leave the final projection onto the x-cell until last.

Finishes accidental wip commit in 8aff3898c3.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-30 07:59:39 +01:00
Chris Wilson 6284ca5a7e sna: Fix SHOW_BATCH_AFTER debugging aide
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-29 16:32:30 +01:00
Chris Wilson 8aff3898c3 sna: Clear padding in rotation properties for valgrind
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-29 16:30:39 +01:00
Chris Wilson 4a23d24db6 sna; Markup that we are ignoring errors from early ScreenCreateResources
In the early move-to-gpu in ScreenCreateResources we purposefully ignore
any errors from the move-to-gpu as they will be fixed up later when we
try to bind to the CRTCs. Mark it as ignored for future readers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-29 07:39:06 +01:00
Chris Wilson d036cdedf0 sna: Use move-to-gpu for explicit handling of damage during fbcon copy
Whilst it is unlikely that we do have any damage queued to the
frontbuffer prior to the copy, it is safer to use the migration tracking
machinery rather than guess.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-28 18:00:25 +01:00
Chris Wilson ac492b9af9 man: Mention Option "AccelMethod" "none"
Currently we only refer to "off" to disable the acceleration, but "none"
is probably more familar to users of other drivers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-27 16:40:19 +01:00
Chris Wilson 38e8c91042 man: Document the extended values supported by Option "DRI"
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-27 16:39:40 +01:00
Chris Wilson f785035d5b sna: Allow move-to-gpu to fail during ScreenCreateResources
Before we attach the Screen Pixmap to the scanout, we will have to
create a GPU bo and apply any fixups as required. Therefore failing to
pre-emptively move it during ScreenCreateResource is not fatal and the
failure can be simply ignored.

Suggested-by: Egbert Eich <eich@freedesktop.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-26 21:01:43 +01:00
Chris Wilson abc9b3f575 Add Skylake PCI IDs
From kernel commit 72bbf0af0c76cbefe9cecbd2ed670b7555e03625
Author: Damien Lespiau <damien.lespiau@intel.com>
Date:   Wed Feb 13 15:27:37 2013 +0000

    drm/i915/skl: Add the Skylake PCI ids

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-26 09:22:50 +01:00
Chris Wilson 7302f8a648 sna: Pass scanout hints along to move-to-gpu
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-25 16:44:08 +01:00
Chris Wilson e9087f50bf sna: Check scanout Pixmaps are the correct pitch and convert if necessary
As a final precaution, fixup the pitch on the bo to be used for
scanout by switching the bo on the Pixmap for a new correctly aligned
scanout bo.

Reported-by: Egbert Eich <eich@suse.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-25 16:41:11 +01:00
Chris Wilson 9f7c1a4c4f sna: Check for scanout pitch restrictions on linear GPU bo
When converting a linear cached CPU bo into an uncached GPU bo, we must
be careful to adhere to the scanout restrictions if they apply for this
transfer or this Pixmap.

Reported-by: Egbert Eich <eich@suse.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-25 16:29:14 +01:00
Chris Wilson 4827c518fe sna: Use shadow CRTC bo if we fail to obtain an framebuffer for the Pixmap
This should mask driver bugs whereby we ask the kernel to make a
framebuffer out of an improper bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-25 16:22:06 +01:00
Chris Wilson f3d27eec52 sna/gen4+: Assert that the offset coordinate is within range if negative
Invalid negative offsets could slip into the drawing rectangle
without triggering the assertion - the assertion being that they were
not greater than the maximum positive coordinate of the 3d engine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24 16:16:25 +01:00
Chris Wilson a60ccd546e sna: Relax constant numCrtcs assertion when ZaphodHeads is active
If ZaphodHeads is active, each screen only has a subset of the CRTC
assigned to it, in fact just the single CRTC associated with the pipe of
that screen. In that case, we only expect to have the single CRTC and so
should not assert that we have a list of all CRTCS.

It should still hold that we dynamically attach ZaphodHeads upon
hotplugging, so it is just the assert that is overzealous.

Reported-by: Nick Bowler <nbowler@draconx.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84281
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24 15:57:18 +01:00
Chris Wilson 7637f547ca sna: Tweak partial Picture extraction to prefer limiting to max 3D coordinates
Where possible, keep the offset of the partial Picture within the 3D
coordinate limit so that we can use the DrawRectangle offset to
automatically adjust the coordinates.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24 15:43:53 +01:00
Chris Wilson 65a23ef909 sna: Reuse the same buffer when panning large CRTCs
Rather than alternating between a pair of fb each time, we can reuse the
last shadow buffer so long as it remains the right size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24 14:08:28 +01:00
Chris Wilson 911a0ad8d0 sna/trapezoids: Flesh out alternate rasterisers for tristrips
And undo the accidental commit of

commit 4e00cbe35d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Sep 22 08:54:57 2014 +0100

    traps

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24 08:10:07 +01:00
Egbert Eich dbe6d105a6 sna: Validate framebuffer tiling before creation
In sna_pixmap_alloc_gpu() a different than the default tiling may be picked
by a usage hint. Before passing the tiling to kgem_create_2d() fix it up
by calling kgem_choose_tiling(). This avoids kgem_surface_size() not being able
to find a surface size for the tiling value.

Fixes regression from

commit a10781b70f [2.99.913]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jul 1 15:11:07 2014 +0100

    sna: Enforce LinearFramebuffer option

Signed-off-by: Egbert Eich <eich@freedesktop.org>
2014-09-24 08:07:37 +01:00
tobias.jakobi1@uni-bielefeld.de b9dddc051d uxa/video: only call intel_xvmc_adaptor_init when xvmc is enabled
Build regression from

commit 616dea2c67
Author: Keith Packard <keithp@keithp.com>
Date:   Thu Jul 24 10:27:55 2014 -0700

    Rename uxa-specific functions and structs

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
2014-09-24 08:00:21 +01:00
Chris Wilson fe6ab444ad sna: Initialise the per-CRTC shadow bo on first use
When we create the shadow pixmap for the CRTC, we should copy the
framebuffer contents into the shadow before we show it the first time.
This saves us from showing stale contents until the next redrawn in the
BlockHandler - with the proviso that we can do the copy on the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24 07:56:31 +01:00
Chris Wilson 1e403716d3 sna/present: Make DBG statements uniform before present_event_notify()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24 07:37:32 +01:00