Commit Graph

5549 Commits

Author SHA1 Message Date
Chris Wilson 257abfdabe sna/gen4: Presume we need a flush upon state change similar to gen5+
References: https://bugs.freedesktop.org/show_bug.cgi?id=55627
References: https://bugs.freedesktop.org/show_bug.cgi?id=55500
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-18 12:44:04 +01:00
Chris Wilson 8238c67298 sna: secure batches accepted upstream, so simply use runtime detection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-17 22:19:01 +01:00
Chris Wilson 540666a0a8 sna/overlay: Move bo out of GTT domain after binding to overlay plane
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-17 17:01:17 +01:00
Chris Wilson 891bae4aa9 sna: Use the secure batches to program scanline waits on gen6+
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-17 14:37:11 +01:00
Chris Wilson 41be80a8ca sna: Enable support for SECURE batch buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-17 14:02:15 +01:00
Chris Wilson ba6c82cd9d sna/dri: Defensively check for GTT mmap failure during fallback
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-17 14:00:39 +01:00
Chris Wilson 7927f9a351 sna/gen7: Filter BLEND flags for CA glyphs
Fixes regression from commit c51aaa731e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Oct 11 11:36:00 2012 +0100

    sna/gen7: Replace bogus state tracking assertion

The assumption being that we only used the encoded flags for determining
the composite state is false for the magic CA pass.

Reported-by: Oleksij Rempel <bug-track@fisher-privat.net>
Reported-by: Eyal Lotem <eyal.lotem@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56037
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-16 17:56:30 +01:00
Chris Wilson 2ad4aa1955 sna: Drop fake tiled CPU mapping
The only path where this is correct already handles it as the special
case that it is, everywhere else it just nonsense.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-16 11:59:28 +01:00
Chris Wilson 877e9c57c7 sna/overlay: Trim suggested BestSize to fit within the overlay constraints
As the maximum reported image sizes are for the source image, we should
be careful not to recommend the application use an output Window larger
than can be handled by the overlay hardware. So shrink it to fit, whilst
preserving the aspect ratio.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-12 17:57:28 +01:00
Paulo Zanoni 1ec41590c9 Fix possible_clones computation for shared encoders between outputs
Libdrm's possible_clones is a mask of encoders. Xorg's possible_clones
is a mask of outputs, so we just can't do the following:

  output->possible_clones = kencoder->possible_clones;

This is a problem on Haswell because, at least with the current
patches floating on the mailing list, there is more than one connector
per encoder.

This patch writes the code to properly translate libdrm's encoder mask
into Xorg's output mask.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-12 09:45:37 +01:00
Chris Wilson 0b92a5a306 sna: Correct a bogus assertion after inplace PutImage
If we are forced to use the GPU bo as the target because the CPU bo is
busy, the priv->cpu flag is likely to remain set, so we need to clear it
rather than fail the assertion that is false.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 12:16:03 +01:00
Chris Wilson c51aaa731e sna/gen7: Replace bogus state tracking assertion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 11:53:44 +01:00
Chris Wilson a56fa2fb4a sna: Rearrange switch to suppress a compiler warning in sna_copy_plane_blt()
Hide the impossible default case so that static analyzers are not
confused.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 10:55:34 +01:00
Chris Wilson 94a98d1c47 sna: Limit available space for gen2
Since pre-g33 chipsets impose massive alignment restrictions on objects
within the aperture we need to further restrict the amount of available
space to be sure we have sufficient room to accommodate the alignment.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 09:24:56 +01:00
Chris Wilson d3ae85dd01 sna: Use high/low watermarks for fenced aperture counting
This helps with fitting larger operations into the small apertures of
gen2, which due to the lax accounting could trigger ENOSPC.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 09:24:56 +01:00
Dave Airlie dadffd0061 intel: fix fullscreen damage posting on pageflip
While playing with MPX and sw cursor I noticed page flips won't
end up misrendering some bits, so the sw cursor was replacing the
bits on the wrong pixmap.

Fix the damage handling to be correct and append damage before swapping
the pointers and process damage after.

This fixes misrendering with MPX cursors under a fullscreen compositor,
that pageflips.

Signed-off-by: Dave Airlie <airlied@redhat.com>
[ickle: The secret is that damage is sometimes reported before the
rendering in DamageRegionAppend, and sometimes afterwards in
DamageRegionProcessPending. For instance, the software cursor operates
prior to being rendered over.]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 09:24:12 +01:00
Chris Wilson a1ea19a3ed sna: Prevent sign-extension when manipulating strides
Reported-by: Prit Laes <plaes@plaes.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55823
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-10 23:20:13 +01:00
Chris Wilson d73f5b5bb1 sna/gen6+: Initialize the damage for fill-boxes
In case we need to redirect the rendering for a large render target, we
need to initialize the damage pointer.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: ttps://bugs.freedesktop.org/show_bug.cgi?id=55812
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-09 19:41:10 +01:00
Chris Wilson ae6ae91baa sna: Check the map exists before trying to release it
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: ttps://bugs.freedesktop.org/show_bug.cgi?id=55812
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-09 18:36:59 +01:00
Chris Wilson 8bbfa88a86 sna: Also check the bg rrop for reads when deciding upon fallback placement
Reported-and-tested-by: chr.ohm@gmx.net
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55810
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-09 17:26:39 +01:00
Chris Wilson f8a005d1f9 sna: Pass the region, not its pointer, when moving the GC to the CPU
Fortunately, the sgc->region was not used along that particular fallback
path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-09 00:23:24 +01:00
Chris Wilson fb5205a86d sna/gen5: Flush pipelined ops when changing state
When is a pipelined operation, not pipelined? That is the mystery posed
by our hardware!

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51422
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-08 09:12:33 +01:00
Chris Wilson bed64c998d sna: Fix check_reloc_and_exec typo
Garbage xorg includes hiding genuine compiler warnings ftl once again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-08 00:13:03 +01:00
Chris Wilson 2ac3776be8 sna: Check that we have sufficient space for a copy when replacing a fill
Reported-by: Timo Kamph <timo@kamph.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55700
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-07 22:43:45 +01:00
Chris Wilson 1a5d5b9ae5 sna: Check that for batch overflows after advancing a BLT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-07 22:41:02 +01:00
Chris Wilson b41ecda69f sna: Only reduce the maximum batch size for old kernels
Be careful we not increase the batch size to span multiple pages on 865g!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-07 22:39:36 +01:00
Chris Wilson 3ca7f8be5b sna/gen2: Count the number of dwords required for the invariant
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-07 22:39:10 +01:00
Chris Wilson 4d2dba0ba7 Use path for intel-gen4asm derived from pkg-config
As we use pkg-config to determine whether to use intel-gen4asm, we
should also use it to locate the right version of intel-gen4asm to use.
This allows the user to install the assembler in a non-standard path for
cross-builds and similar.

Reported-by: Josh Tripplet <josh@freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55646
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-07 10:49:07 +01:00
Chris Wilson 249051d90f sna/gen2: And the other compile failure
Typing on Sunday before coffee is a very bad idea.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-07 09:33:06 +01:00
Chris Wilson d11a15f04d sna/gen2: Compile fix
Be careful when cutting and pasting assertions!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-07 09:30:38 +01:00
Chris Wilson d2a26adc8e sna/gen2: Add a couple of assertions to track down a batch overflow
References: https://bugs.freedesktop.org/show_bug.cgi?id=55700
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-07 08:59:32 +01:00
Chris Wilson 3680aa4976 sna: Do not create an unsnooped CPU mapping for readbacks
Otherwise we notice that we have a CPU mmap during read synchronized and
presume that we need not take any further action. However...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-05 12:43:55 +01:00
Josh Triplett 5b74a2dc52 Fix out-of-tree builds with intel-gen4asm installed
The make rules to compile shaders with intel-gen4asm referenced the .g4a
source files without using $(srcdir), which broke out-of-tree builds.
Reference .g4a source files via $(srcdir), and add $(srcdir) to m4's
include path, fixing out-of-tree builds.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55645
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
2012-10-05 10:28:05 +01:00
Chris Wilson 07a4633347 sna: Refactor the fallback CopyArea to use the common region computation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-05 10:17:45 +01:00
Chris Wilson 3ad3a2d839 sna/gen2: Tidy DBG code for disabling composite operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-04 15:14:08 +01:00
Chris Wilson 6054f8e112 sna: Remove another sna_pixmap->cpu assertion that was not true
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-04 14:40:59 +01:00
Chris Wilson acf354d7fb sna: Propagate failures from compositing glyph masks
So that we can fallback correctly. This is primarily using for debugging
failure paths...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-04 14:35:14 +01:00
Chris Wilson c7ad655359 sna/gen2: Prevent using the GTT maps with I915_TILING_Y on 855gm
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-04 13:52:55 +01:00
Chris Wilson 0a2c5eb766 sna: Once again look into assertions around sna_pixmap->cpu
Revert back to basics, and clear the CPU flag everytime we use the GPU,
rather than try to avoid clearing it along some paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-04 13:51:23 +01:00
Chris Wilson 4d3b849c57 sna: Avoid using the gpu for uploads whilst wedged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-04 12:16:33 +01:00
Chris Wilson 4608e48261 sna/gen2: Allow fine damage tracking for render operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-04 11:23:36 +01:00
Chris Wilson 83b8669abc sna/gen2: Setup invariant blend arguments
I thought these were completely specified via the LOAD_STATE_IMMEDIATE
commands we used whilst seting up the render pipeline. I was wrong.

Reported-by: Timo Kamph <timo@kamph.org>
References: https://bugs.freedesktop.org/show_bug.cgi?id=55455
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 23:45:28 +01:00
Chris Wilson b71af5dc62 sna: Clear sna_pixmap->cpu when destroying the CPU damage
So that we keep the assertion checks that without CPU damage we can not
be on the cpu.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55591
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 22:53:57 +01:00
Chris Wilson 0d42872d1e sna: Protect against undefined O_CLOEXEC
Reported-by: Giovanni Mariani <mc2374@mclink.it>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 14:42:19 +01:00
Chris Wilson a683643ebf sna: Fix an instance of undamaged tracking
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 14:13:13 +01:00
Chris Wilson 47c76bb968 sna/gen7: Tidy detection of unbounded render op
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 14:12:50 +01:00
Chris Wilson 3e770f09db sna/dri: Delay the deactivation of the pageflipping
As we need to clflush the scanout buffer as we return it to the bo cache
on SNB+, it is costly to terminate the pageflipping as soon as we drop a
frame as mesa often fails to keep up to the vrefresh rate.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 13:02:04 +01:00
Chris Wilson b3a502a705 sna: Review sna_pixmap->cpu tracking
Notably 52b211cb15 was triggering a few assertions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 11:46:57 +01:00
Chris Wilson bf44d9965b sna: Prevent sna_damage_contains_box__no_reduce() from a NULL deref
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 12:22:51 +01:00
Chris Wilson 0ae6c2ccb0 sna: Actually upload the damage when replacing a busy CPU bo for PutImage
Reported-by: Roman Jarosz <kedgedev@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55508
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 11:44:16 +01:00