Commit Graph

8565 Commits

Author SHA1 Message Date
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
Chris Wilson 4e00cbe35d traps 2014-09-22 08:54:57 +01:00
Chris Wilson 376037e633 sna: Skip present unflip if the output is rotated
With a rotated output and shadow buffers, we never perform the flip in
the first place and so can ignore the unflip request as well.

Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=84105
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-21 19:52:48 +01:00
Chris Wilson 061785b168 sna/dri2: Decouple the Client event link on Drawable free
We need to keep the two lists in check across asynchronous client/window
destruction.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-21 16:44:25 +01:00
Chris Wilson cae4f4af2a sna/trapezoids: Thread tristrip rasterisation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-21 14:25:01 +01:00
Chris Wilson 12fc668794 sna/gen8: Update DBG output of surface offset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-19 11:00:39 +01:00
Chris Wilson 5ddd106e8f uxa/glamor: Silence compiler warnings
Mark the stub intel_glamor_fd_from_pixmap() as inline to silence the
compiler warnings about unused function definitions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-18 10:34:36 +01:00
Chris Wilson 2a4855a633 sna: Constify argument to box_from_seg()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-16 20:26:28 +01:00
Chris Wilson 1cc9762b08 uxa: Fix conversion of Segments into Rectangles
The trick is to make sure we consider the CapLast setting in the
direction the line is being drawn and adjust the inked pixels
accordingly.

Testcase: DrawSegments/hv0
Reported-by: Russell King
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-16 12:37:23 +01:00
Chris Wilson db157b42aa test: Add DrawSegments
Compare fb/ddx for many DrawSegments operations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-16 12:10:57 +01:00
Chris Wilson e453f276da sna/io: Initialise return code to catch early segfaults
In case we are ever given an invalid buffer that we then attempt to read
past the end.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-15 12:08:59 +01:00
Chris Wilson d470f0f520 sna: Last ditch attempt to make extra large batches fit
If we have unfortunate fragmentation, e.g. a cursor is pinned in the
middle of an aperture, we can struggle to fit large objects, especially
fenced objects on gen2/gen3. We do have one last trick up our sleeves
that we can try: disable all of the outputs and cursors and try
submitting the batch in as pristine an aperture as we can arrange. We
can only hope that the subsequent restoration of the outputs is more
conducive to future batches (and so not lead us into continual flicker).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-15 11:41:38 +01:00
Chris Wilson 435fe185e3 sna: Update the list of outputs after a failed modeset
In case we have a hotplug at just the wrong time, we can fail a modeset
with a stale connector. Before attempting to recover, probe the kernel
for the current state.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-15 09:09:19 +01:00
Chris Wilson 067115a51b uxa: Stub out intel_sync_init|fini when not compiled in
In order to fix the build without DRI3, we need to stub out the
functions not compiled in, such as intel_sync_fini().

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-15 08:46:46 +01:00
Chris Wilson 0d451ee389 configure: Require the presence of xorg/glamor.h for --enable-glamor
Check that we have the required Xorg headers for glamor if the user
requests --enable-glamor. There is a possiblity that the headers
mismatch as they don't have internal versioning, but this should catch
the majority of errors early on.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-15 08:46:46 +01:00
Keith Packard 1144461945 glamor: Do version check for fd <-> pixmap functions
glamor_pixmap_from_fd and glamor_fd_from_pixmap were added before
version 1.15.99.902, so check for that version before trying to use them.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Fabio Pedretti <fabio.ped@libero.it>
2014-09-13 10:53:02 -07:00
Keith Packard 48f6406a62 Use intel_uxa.h in all uxa-specific files
Instead of always including intel_uxa.h from intel.h, and including
uxa.h from some files directly, use intel_uxa.h directly from .c files
that have UXA-specific code in them.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-09-12 13:51:16 -07:00
Keith Packard 8b59a88c23 intel_present.c does not need to include uxa.h
There aren't any symbols from uxa.h used in this file, remove the #include.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-09-12 13:51:16 -07:00
Keith Packard d83b30b704 Move some UXA-specific code under #if USE_UXA.
This makes the UXA-specific elements of intel_screen_private and a bit
of code in intel_driver covered under #if USE_UXA

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-09-12 13:51:16 -07:00
Keith Packard e3c06746c7 Move UXA hardware initialization into intel_uxa_init
Pull this uxa-specific step out of I830ScreenInit

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-09-12 13:51:16 -07:00
Keith Packard 876185ccee Add intel_flush to abstract flushing pending acceleration operations
intel_flush flushes any pending acceleration operations to the
hardware, just like intel_uxa_batch_submit does today except that it is
not uxa-specific.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-09-12 13:51:16 -07:00
Keith Packard 616dea2c67 Rename uxa-specific functions and structs
This starts to separate uxa from the rest of the driver by renaming
uxa-specific functions and structs to make it clear which portions of
the driver are uxa-specific and which are common.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-09-12 13:51:14 -07:00
Keith Packard 57c67199d0 Move intel_alloc_framebuffer to intel_memory.c
UXA and Glamor both share this function, so move it out of the UXA file.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-09-12 13:50:37 -07:00
Keith Packard ff67a8d885 Do more checks for proposed flip pixmaps
Make sure the pitch matches the current framebuffer.
Make sure there's a BO we can get at.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-09-12 13:50:37 -07:00