Commit Graph

6799 Commits

Author SHA1 Message Date
Chris Wilson 7ebcf94736 sna: Be explicit in not marking an upload buffer as being on the cpu
Since the upload buffer is special in that it simultaneously exists on
both the CPU and GPU, we need to be extremely careful in marking the cpu
hint flag and asserting it. In particular, the new stricter assert was
firing in the CompositeTrapezoids fallback path.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-15 12:27:19 +01:00
Chris Wilson cafa33a522 sna/gen3+: Remove redundant clearing of clear hint in video playback
The clear hint is correctly updated when performing the move-to-gpu and
so it is being superfluously repeated by the callers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-14 01:07:12 +01:00
Chris Wilson 45ca894bce sna: Tighten a few asserts on pixmap migration
Tracking to track down where the CPU hint may be set to true but the
pixmap remain entirely damaged on the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-14 01:06:40 +01:00
Chris Wilson 8f340f90f4 sna/gen7: Set sampler swizzle for video sources
Otherwise the sampler on Haswell will just read all zeros when trying to
playback a video.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-13 16:10:41 +01:00
Chris Wilson 5f20be8256 sna/gen2+: Promote a conditional dirty into an assertion
If the target bo is not bound when we start to emit the composite state
for the operation, we are screwed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-13 11:18:42 +01:00
Chris Wilson 6655cc1d97 sna: Do not enlarge the read back region if there is already CPU damage
We enlarge the read back into to minimise the number of times we have to
migrate pixmap data. However, if we then enlarge the read so that it
overwrites CPU dirty data, then we can introduce corruption.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-12 18:44:27 +01:00
Chris Wilson 1f180b89db sna/video: Free the private video (adaptor/port) arrays upon CloseScreen
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-12 14:34:05 +01:00
Chris Wilson 04ea469d4f sna/video: Catch allocation failure whilst setting up the TexturedAdaptor
Missing NULL check for calloc of the port private array.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-12 14:20:10 +01:00
Chris Wilson dc8f2def54 sna: Allow the throttling to be woken by SIGINT
Rather than completely starve X from handling input events and raising
the spectre of miEQ overflow, stop throttling upon SIGINT. We will have
waited a small period of time (~100ms) for the GPU to catch up, and will
do so again in the near future. This also preserves the hang detection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-12 08:37:17 +01:00
Chris Wilson 15b92c9875 sna: Make sure the source is coherent on the CPU before uploading
Similar to 7d91051c, but along the render path rather than CopyArea.

Makes the presumption that for the upload path the region is stored on
the CPU explicit.

References: https://bugs.freedesktop.org/show_bug.cgi?id=61628
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-11 23:20:15 +01:00
Chris Wilson 1392f296a3 sna: Mollify an assert to allow us to call busy_ioctl on a GTT write
The code was being careful in making sure that only a BO with an
outstanding GPU write was being flushed. We need to relax that
assertion to allow us to call busy_ioctl after only GTT writes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-11 15:10:06 +01:00
Chris Wilson 7d91051c50 sna: Make sure the source is coherent on the CPU before uploading
Makes the presumption that for the upload path the region is stored on
the CPU explicit.

References: https://bugs.freedesktop.org/show_bug.cgi?id=61628
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-11 14:42:56 +01:00
Chris Wilson 2e2db4b88f sna: Tidy batch submission around CRTC updates
A few places we were redundantly submitting the same bo, and in others
doing more work than necessary.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-11 00:50:23 +01:00
Chris Wilson b9439a5617 sna: Move the GTT dirty tracking from the pixmap to the bo
This allows us to more accurately track when the GTT is dirty. However,
the only danger is that we may prematurely flush the scanout and clear
the dirty bit and not preserve the flush timer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-10 22:56:20 +01:00
Chris Wilson 5f0c5a4953 sna: s/bo->dirty/bo->gpu_dirty/ to avoid later confusion
The next step is to introduce bo->gtt_dirty.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-10 22:48:03 +01:00
Chris Wilson b443077536 sna: Make sure all sna_write_boxes* flag the GTT is dirty
Better would be to start passing in the sna_pixmap so that we can mark
the GTT as dirty in a single location, and only if we do indeed then do
a GTT update or pwrite.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-10 21:34:52 +01:00
Chris Wilson 005075de9d sna: Keep the cached EDID if it hasn't changed
Rather than reparsing the EDID each time we probe the modes, if the
property hasn't changed keep it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-10 14:50:47 +01:00
Chris Wilson 3d760c9b32 sna: Streamline connector probing
This is a tidy up in preparation for a more controversial patch. In the
meantime, take advantage of information that remains static over the
lifetime of our connectors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-09 20:35:48 +01:00
Chris Wilson b584162e38 sna: Set the needs_flush flag on the bo when the scanout is dirty
Since the call to the busy_ioctl is predicated on whether the bo needs
to be flushed by us, therefore when forcing the call to the busy_ioctl
to flush the GTT we need to mark it as requiring needs_flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-07 16:36:40 +01:00
Chris Wilson 7151e437df sna: Track when we write directly to bo through the GTT
In the future, we may need to explicitly flush GTT writes to the
scanout, so add the infrastructure to do so now.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-07 16:11:46 +01:00
Chris Wilson 79145b70a7 sna/dri: Check rather than assert for a change in back/front sizes
The DRI2 midlayer may, or may not, recreate the back buffer after a
pixmap change. The result is that the back buffer may or may not be
flagged as unsuitable for flipping, so be paranoid and double check.
(This behaviour was first introduced in 1.9.0 and looks to be removed
again in 1.15.0)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-07 15:43:21 +01:00
Chris Wilson 2f91643cde sna/dri: Fix transcription error in commit ab47433b20
Reversed a predicate causing it to fail to blit when it had a
drawable (and worse dereferencing a NULL pointer) instead of terminating
when the Drawable was gone.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-07 14:51:30 +01:00
Chris Wilson e85271e516 sna/dri: Do not decouple the flip after chaining up a blit
Fixes regression from previous patch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-07 13:35:30 +01:00
Chris Wilson ab47433b20 sna/video: Select vsync by default based on "SwapbuffersWait"
To be strictly identical to the DRI code, we should override the user
when the option is set. However, this a baby step for simple bug
testing.

References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1176647
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-06 23:19:18 +01:00
Chris Wilson 7e1e18aca2 sna/video: Fixup formats to select visuals
Fixes regression from
commit 195a51353c [2.21.8]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Apr 9 19:13:46 2013 +0100

	sna/video: Convert to a pure Xv backend

Reported-by: Edward Sheldrake <ejsheldrake@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65479
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-06 21:40:59 +01:00
Chris Wilson 0869acc0a6 sna/dri: Make the fallback blit async again
Previously it was async, and is likely to be anyway as the pageflip
failed due to the change in output. To be safe, once again request that
the copy does not stall the GPU upon the scanline window.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-06 21:40:59 +01:00
Chris Wilson 9b52c852aa sna/dri: Handle fast double flips across mode changes
The tricky nature of the double flip is that there is no SwapComplete
pending and so we must avoid calling it under such circumstances.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-06 16:43:24 +01:00
Chris Wilson 0da5cc23b1 sna: Fix format specifier for mismatching int/long in DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-06 16:43:24 +01:00
Chris Wilson 2770655371 2.21.9 release 2013-06-06 12:23:06 +01:00
Chris Wilson d3345cd269 sna: Only emit an error for terminal mmap failures
If we repeat the mmap, keep quiet. Only emit the ErrorF in case even the
repeated attempts to mmap the bo fail.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-06 12:23:06 +01:00
Chris Wilson 70fa080d02 sna: Include the GT details in the backend name for a chipset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-05 23:35:37 +01:00
Rodrigo Vivi 45c09bfe58 Add more correct names for Haswell.
As we find out more of the final product names for Haswell chipsets, we
need to update the user visible identification strings.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-06-05 23:34:28 +01:00
Chris Wilson a9f9fb8e44 sna/video: Fix redundant initialisation of video->clip
It will be created before use anyway, but this silences a compiler
warning.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-05 09:49:47 +01:00
Chris Wilson 5d0ae71f1d sna: Do not conflate ignoring an output with an allocation failure
If the user explicitly ignores an output through xorg.conf, then
xf86OutputCreate returns NULL. This is not to be confused with an
allocation error that also returns NULL. The latter is terminal, the
former is desired.

Fixes regression from commit a9acc8dbb4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu May 30 12:09:52 2013 +0100

    sna: Cleanup up error reporting after failure to init KMS interface

Reported-by: David Rosca <nowrep@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65381
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-05 09:19:39 +01:00
Chris Wilson 6dacaddb6a sna: Always populate the CPU features string
So that we don't print random contents of the stack on ancient 32-bit
CPUs with no extended instruction sets.

References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1186800
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-03 15:35:43 +01:00
Chris Wilson 8a88c01c37 sna: Make copying the glyph size more compact
The assembly was ugly with an unwarranted AGU stall.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-03 14:16:45 +01:00
Chris Wilson 66ad4d6f3c sna/dri: Undo any COW before performing a copy with DRI2CopyRegion
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65250
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-02 12:14:05 +01:00
Chris Wilson 9a8ff7861c sna: Add some more DBG hints to copy-on-write cloning
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-02 12:14:05 +01:00
Chris Wilson c4ad7b14ca sna: Prevent adding damage to an already all-damaged GPU bo
Keep the bookkeeping straight after propagating the source clear colour:
commit 810a0ce2f8 [2.21.7]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri May 10 12:02:10 2013 +0100

    sna: Propagate clear color when replacing by a CopyArea

Reported-by: Roman Jarosz <kedgedev@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65247
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-01 17:01:47 +01:00
Chris Wilson be84b69297 sna/dri: Reorder assert not to fail on a pageflip deferred to after a modeset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-01 16:52:26 +01:00
Chris Wilson 2e11b520bb sna: Compile fix for non-debug builds
sna_display.c: In function 'get_fb':
sna_display.c:181:3: warning: implicit declaration of function 'assert_scanout' [-Wimplicit-function-declaration]
sna_display.c:181:3: warning: nested extern declaration of 'assert_scanout' [-Wnested-externs]

* sigh

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-30 15:35:11 +01:00
Chris Wilson 3a9975729c sna: Restore GPU promotion for large fills
Fix another regression from
commit ef9dc6fae5 [2.21.7]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon May 20 11:08:51 2013 +0100

    sna: Undo a few more overwritten operations upon a bo

The REPLACES predicate was meant to complement the existing tests, not
be compulsory.

Found whilst investigating why performance seemed to have dropped off in
Phoronix's benchmarks.

Reported-by: Michael Larabel <michael@phoronix.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-30 15:06:42 +01:00
Chris Wilson 08b33ba8f1 sna: Assert that an existing scanout is the desired size
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-30 15:06:42 +01:00
Chris Wilson a9acc8dbb4 sna: Cleanup up error reporting after failure to init KMS interface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-30 13:08:10 +01:00
Chris Wilson f4fcb0e7d2 sna: Report allocations failures during Screen initialisation
Just abort instead of trying to limp on if we fail to even allocate
memory during initialisation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-30 13:08:10 +01:00
Chris Wilson 7f7c8087db sna: Log which outputs are being configured during a modeset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-29 12:29:40 +01:00
Daniel Vetter fc1e0702b2 sna: fixup up possible_clones kms->X impedance mismatch
We need to be a notch more careful with remapping the possible clones
mask from the kernel:
- SDVO and Haswell DDI have multiple connectors mapping to the same encoder.
- The connector list can be reordered compared to the encoder list.
  This is used to move eDP/LVDS to the front.

Also add even more debug output.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-05-29 12:29:40 +01:00
Chris Wilson b7aa05e44b sna: Sanity check that CRTC / output combination is valid
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-29 09:53:09 +01:00
Chris Wilson b507796679 Add the known marketing names for the performance Haswell parts
Start filling in the names for the parts that have been announced, the
Iris branded Haswell GT3 parts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-28 23:16:31 +01:00
Chris Wilson b3169768dd sna: Make the backend identifier more informative
This is useful, for example, with the multiple gen7 variants.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-28 23:16:31 +01:00