platform/upstream/xf86-video-intel.git
10 years agosna: Fix typo in sna_blt_fill_begin()
Chris Wilson [Thu, 21 Nov 2013 14:48:23 +0000 (14:48 +0000)]
sna: Fix typo in sna_blt_fill_begin()

Reported-by: intelgraphics7@gmx-topmail.de
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Set supported rotations on virtual outputs
Chris Wilson [Wed, 20 Nov 2013 18:50:40 +0000 (18:50 +0000)]
sna: Set supported rotations on virtual outputs

As the virtual outputs are created later, they do not get automatically
populated with RR properties and we must do that instantiation
ourselves.

Reported-by: Kirill Müller <mail@kirill-mueller.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71846
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen7: Try to reduce flushes between primitive continuations
Chris Wilson [Wed, 20 Nov 2013 11:17:20 +0000 (11:17 +0000)]
sna/gen7: Try to reduce flushes between primitive continuations

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-virtual-output: Check for failure to create a clone
Chris Wilson [Tue, 19 Nov 2013 12:15:24 +0000 (12:15 +0000)]
intel-virtual-output: Check for failure to create a clone

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-virtual-output: Fix trivial and unlikely fd leak from bumblebee failure
Chris Wilson [Tue, 19 Nov 2013 12:13:26 +0000 (12:13 +0000)]
intel-virtual-output: Fix trivial and unlikely fd leak from bumblebee failure

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Fix use before assignment
Chris Wilson [Tue, 19 Nov 2013 12:09:35 +0000 (12:09 +0000)]
sna: Fix use before assignment

mono.sna was being used the line before it was assigned.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Free composite boxes in the unlikely all-invalid path
Chris Wilson [Tue, 19 Nov 2013 12:03:33 +0000 (12:03 +0000)]
sna: Free composite boxes in the unlikely all-invalid path

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Correct check for overwriting last BLT fill
Chris Wilson [Tue, 19 Nov 2013 12:01:33 +0000 (12:01 +0000)]
sna: Correct check for overwriting last BLT fill

Typo crept in from the reloc rework.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen4+: Clear redirect bo before falling back to BLT paths
Chris Wilson [Tue, 19 Nov 2013 12:00:08 +0000 (12:00 +0000)]
sna/gen4+: Clear redirect bo before falling back to BLT paths

Just in case we later try to take action on the already freed
redirection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotest: Fix compilation of render-trapezoid-image
Chris Wilson [Tue, 19 Nov 2013 09:47:15 +0000 (09:47 +0000)]
test: Fix compilation of render-trapezoid-image

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71768
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen7: Rework random GPU flushing
Chris Wilson [Mon, 18 Nov 2013 16:59:08 +0000 (16:59 +0000)]
sna/gen7: Rework random GPU flushing

There seems to be no clear rationale for these flushes. They have been
empirically derived to pass test/render-copyarea and rendercheck,
without impacting upon a few simple benchmarks.

References: https://bugs.freedesktop.org/show_bug.cgi?id=68410
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Tell valgrind about the returned mode list
Chris Wilson [Mon, 18 Nov 2013 14:16:07 +0000 (14:16 +0000)]
sna: Tell valgrind about the returned mode list

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Process Damage relative to dst->pDrawable not its pixmap->drawable
Chris Wilson [Mon, 18 Nov 2013 12:33:05 +0000 (12:33 +0000)]
sna: Process Damage relative to dst->pDrawable not its pixmap->drawable

References: https://bugs.freedesktop.org/show_bug.cgi?id=32734
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotests: Avoid dependence on undefined C
Chris Wilson [Mon, 18 Nov 2013 12:04:29 +0000 (12:04 +0000)]
tests: Avoid dependence on undefined C

Right-shifting by a negative value is undefined.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/damage: Tidy up a tail return
Chris Wilson [Mon, 18 Nov 2013 11:58:43 +0000 (11:58 +0000)]
sna/damage: Tidy up a tail return

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/damage: Guard against integer overflow before malloc
Chris Wilson [Fri, 15 Nov 2013 21:20:30 +0000 (21:20 +0000)]
sna/damage: Guard against integer overflow before malloc

Check that the multiplication to compute the allocation will not
overflow.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Include valgrind leakchecks for --enable-debug=memory
Chris Wilson [Fri, 15 Nov 2013 11:55:51 +0000 (11:55 +0000)]
sna: Include valgrind leakchecks for --enable-debug=memory

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Add the missing braces around the conditional block
Chris Wilson [Thu, 14 Nov 2013 16:14:09 +0000 (16:14 +0000)]
sna: Add the missing braces around the conditional block

Fixes regression from
commit f3225fcb38686f3b9701725bf3a11ecf1c100c3f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Nov 5 08:38:22 2013 +0000

    sna: Be move conservative with tiling sizes for older fenced gen

Reported-by: Jay Little <jaylittle@jaylittle.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71605
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotests: Exercise render copies under a mask
Chris Wilson [Thu, 14 Nov 2013 10:17:49 +0000 (10:17 +0000)]
tests: Exercise render copies under a mask

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen6+: Only substitute SRC for CLEAR if using the correct source
Chris Wilson [Wed, 13 Nov 2013 16:25:54 +0000 (16:25 +0000)]
sna/gen6+: Only substitute SRC for CLEAR if using the correct source

If the source has not been verified to be clear, then using the SRC
operator will paint the wrong color.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen6+: Improve debug PREFER_RENDER to cover all decision points
Chris Wilson [Wed, 13 Nov 2013 15:28:37 +0000 (15:28 +0000)]
sna/gen6+: Improve debug PREFER_RENDER to cover all decision points

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotests: Add render-composite-solid-mask
Chris Wilson [Wed, 13 Nov 2013 15:27:05 +0000 (15:27 +0000)]
tests: Add render-composite-solid-mask

Another reference test to exercise simple composite pathways clearly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Eliminate a compiler warning for a shadowed variable
Chris Wilson [Wed, 13 Nov 2013 14:17:51 +0000 (14:17 +0000)]
sna: Eliminate a compiler warning for a shadowed variable

sna_driver.c: In function 'sna_load_palette':
sna_driver.c:86:12: warning: declaration of 'index' shadows a global declaration [-Wshadow]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Eliminate a compiler warning for a shadowed variable
Chris Wilson [Wed, 13 Nov 2013 14:17:51 +0000 (14:17 +0000)]
sna: Eliminate a compiler warning for a shadowed variable

We don't strictly need that local structure, so do without and keep the
compiler quiet.

sna_driver.c: In function 'fb_supports_depth':
sna_driver.c:414:23: warning: declaration of 'close' shadows a global declaration [-Wshadow]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years ago2.99.906 snapshot 2.99.906
Chris Wilson [Tue, 12 Nov 2013 14:43:28 +0000 (14:43 +0000)]
2.99.906 snapshot

10 years agoBump experimental ioctl command numbers
Chris Wilson [Wed, 13 Nov 2013 09:52:14 +0000 (09:52 +0000)]
Bump experimental ioctl command numbers

In the meantime a new ioctl has snuck in.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Discard cached upload proxy when writing to the pixmap via the CPU
Chris Wilson [Tue, 12 Nov 2013 18:59:54 +0000 (18:59 +0000)]
sna: Discard cached upload proxy when writing to the pixmap via the CPU

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-virtual-output: Manually adjust screen size
Chris Wilson [Sun, 10 Nov 2013 10:28:01 +0000 (10:28 +0000)]
intel-virtual-output: Manually adjust screen size

When we modify the outputs and end up with a different screen size, we
need to actually tell the display to resize with an explicit
XRRSetScreenSize.

Reported-by: Jethro Beekman <freedesktop-bugs@jbeekman.nl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71441
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoAdd identification strings for new Atoms
Chris Wilson [Tue, 12 Nov 2013 14:36:38 +0000 (14:36 +0000)]
Add identification strings for new Atoms

All of the new Atom (Baytrail) products ship with "HD Graphics".

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Factor available memory into available aperture estimation
Chris Wilson [Tue, 12 Nov 2013 13:15:25 +0000 (13:15 +0000)]
sna: Factor available memory into available aperture estimation

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Apply drawable offset to glyph bbox prior to checking for clipping
Chris Wilson [Tue, 12 Nov 2013 00:05:11 +0000 (00:05 +0000)]
sna: Apply drawable offset to glyph bbox prior to checking for clipping

This is a correction to

commit ec0866e86d365ae3fd9790b1b263d49fc4981220
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Oct 16 22:39:54 2013 +0100

    sna/glyphs: Fix computation of extents for long strings

in order for us to correctly detect when we need to clip.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71191
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agoxvmc: Handle allocation failure around batch submission
Chris Wilson [Mon, 11 Nov 2013 14:56:22 +0000 (14:56 +0000)]
xvmc: Handle allocation failure around batch submission

If we fail to allocate a new batch, just stall and reuse the old one
rather than crashing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agointel-virtual-output: Fix format specifiers for Visual DBG
Chris Wilson [Mon, 11 Nov 2013 13:15:07 +0000 (13:15 +0000)]
intel-virtual-output: Fix format specifiers for Visual DBG

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agointel-virtual-output: Fix cut'n'paste DBG error
Chris Wilson [Mon, 11 Nov 2013 12:56:30 +0000 (12:56 +0000)]
intel-virtual-output: Fix cut'n'paste DBG error

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Assert that gc->funcs is never set to NULL
Chris Wilson [Mon, 11 Nov 2013 11:44:17 +0000 (11:44 +0000)]
sna: Assert that gc->funcs is never set to NULL

References: https://bugs.freedesktop.org/show_bug.cgi?id=71415
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Add a couple more asserts to track a potential NULL gc->pCompositeClip
Chris Wilson [Mon, 11 Nov 2013 11:38:46 +0000 (11:38 +0000)]
sna: Add a couple more asserts to track a potential NULL gc->pCompositeClip

References: https://bugs.freedesktop.org/show_bug.cgi?id=71415
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agointel-virtual-output: Avoid the infinite loop around XPending
Chris Wilson [Mon, 11 Nov 2013 10:47:24 +0000 (10:47 +0000)]
intel-virtual-output: Avoid the infinite loop around XPending

XPending() reports if there are any events pending and does not perform
any dequeuing itself - ergo for a remote display while (XPending()) ;
becomes an infinite loop should there be an event pending.

References: https://bugs.freedesktop.org/show_bug.cgi?id=71345
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agoconfigure: Use proper variables set by PKG_CHECK_MODULES
Rémi Cardona [Fri, 8 Nov 2013 19:14:59 +0000 (20:14 +0100)]
configure: Use proper variables set by PKG_CHECK_MODULES

$DRI_CFLAGS does not actually exist. The PKG_CHECK_MODULES call creates
a $DRI1_CFLAGS variable instead. This doesn't break often because
"recent" versions of xorg-server.pc indirectly depend on xf86driproto.pc
thus bringing in the required CFLAGS through $XORG_CFLAGS.

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=490342
Signed-off-by: Rémi Cardona <remi@gentoo.org>
11 years agointel-virtual-output: Do not hide the cursor on the local/source display
Chris Wilson [Sun, 10 Nov 2013 10:34:06 +0000 (10:34 +0000)]
intel-virtual-output: Do not hide the cursor on the local/source display

Whilst we want to take over and hide the cursor on the remote displays,
on the source we need to not interfere with the host.

Reported-by: Jethro Beekman <freedesktop-bugs@jbeekman.nl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71439
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Assert that we do setup the gc->pCompositeClip upon ValidateGC
Chris Wilson [Sat, 9 Nov 2013 11:15:39 +0000 (11:15 +0000)]
sna: Assert that we do setup the gc->pCompositeClip upon ValidateGC

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agoMerge branch 'master' of hsw:/usr/src/xf86-video-intel
Chris Wilson [Sat, 9 Nov 2013 11:06:12 +0000 (11:06 +0000)]
Merge branch 'master' of hsw:/usr/src/xf86-video-intel

11 years agointel-virtual-output: Only track the most recent visibility status of the cursor
Chris Wilson [Fri, 8 Nov 2013 17:09:35 +0000 (17:09 +0000)]
intel-virtual-output: Only track the most recent visibility status of the cursor

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agointel-virtual-output: Fix forced synchronisation of clones
Chris Wilson [Fri, 8 Nov 2013 14:04:32 +0000 (14:04 +0000)]
intel-virtual-output: Fix forced synchronisation of clones

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agointel-virtual-output: Tighten bad_visual() checks
Chris Wilson [Fri, 8 Nov 2013 13:53:48 +0000 (13:53 +0000)]
intel-virtual-output: Tighten bad_visual() checks

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agointel-virtual-output: Disable event tracking after a failure
Chris Wilson [Fri, 8 Nov 2013 13:00:11 +0000 (13:00 +0000)]
intel-virtual-output: Disable event tracking after a failure

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agointel-virtual-output: Add DBG for the latest XSync
Chris Wilson [Fri, 8 Nov 2013 12:58:06 +0000 (12:58 +0000)]
intel-virtual-output: Add DBG for the latest XSync

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agointel-virtual-output: Perform an explicit sync
Chris Wilson [Fri, 8 Nov 2013 12:54:01 +0000 (12:54 +0000)]
intel-virtual-output: Perform an explicit sync

If we fail to track rendering using ShmCompletionEvents and begin to
drop frames, insert an explicit XSync.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agointel-virtual-output: Check for pending events before skipping draw
Chris Wilson [Fri, 8 Nov 2013 12:46:08 +0000 (12:46 +0000)]
intel-virtual-output: Check for pending events before skipping draw

Make sure we check if the destination display has caught up before
skipping a frame.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agointel-virtual-output: Add some DBG for bad_visual()
Chris Wilson [Fri, 8 Nov 2013 12:30:21 +0000 (12:30 +0000)]
intel-virtual-output: Add some DBG for bad_visual()

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Always schedule upload buffers for retirement after use
Chris Wilson [Fri, 8 Nov 2013 08:53:55 +0000 (08:53 +0000)]
sna: Always schedule upload buffers for retirement after use

Even if they are multiply referenced due to cached references.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Skip an unmappable linear bo when searching through a cache for a GTT mapping
Chris Wilson [Thu, 7 Nov 2013 14:58:08 +0000 (14:58 +0000)]
sna: Skip an unmappable linear bo when searching through a cache for a GTT mapping

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Only assert that the bo is small enough to be mmapped
Chris Wilson [Thu, 7 Nov 2013 14:54:39 +0000 (14:54 +0000)]
sna: Only assert that the bo is small enough to be mmapped

Not that is currently in a position to be mapped without eviction.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna/gen7: Request secure batches for Haswell vsync
Chris Wilson [Thu, 7 Nov 2013 13:09:25 +0000 (13:09 +0000)]
sna/gen7: Request secure batches for Haswell vsync

Since commit 8ff8eb2b38dc705f5c86f524c1cd74a811a7b04c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Sep 9 16:23:04 2013 +0100

    sna/hsw: Scanline waits require both DERRMR and forcewake

we have been emitting LRI to enable vsync on the render ring. This
requires a privileged batch buffer, and whilst we were checking for
kernel support, we forgot to actually tell the kernel to submit the
batch with the right privileges.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71328
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Always copy from the tile source
Chris Wilson [Wed, 6 Nov 2013 16:24:28 +0000 (16:24 +0000)]
sna: Always copy from the tile source

The first step when tiling with an intermediatory is to copy from the
source bo to the temporary. The alu should only be applied when copying
from the temporary to the destination.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Remove erroneous assertion from sna_tiling_blt_composite
Chris Wilson [Wed, 6 Nov 2013 15:42:35 +0000 (15:42 +0000)]
sna: Remove erroneous assertion from sna_tiling_blt_composite

We have to rely on the caller only calling us for a PictOpSrc equivalent
operation as they don't all set op->op.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Add a DBG breadcrumb to kgem_bo_convert_to_gpu()
Chris Wilson [Wed, 6 Nov 2013 15:04:24 +0000 (15:04 +0000)]
sna: Add a DBG breadcrumb to kgem_bo_convert_to_gpu()

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Use tiling BLT fallback for BLT composite operations
Chris Wilson [Wed, 6 Nov 2013 14:51:42 +0000 (14:51 +0000)]
sna: Use tiling BLT fallback for BLT composite operations

This avoid a circuituous route through the render pathways and multiple
levels of tiling fallbacks to accomplish the same copy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Trim create flags if tiled sizes are too large
Chris Wilson [Wed, 6 Nov 2013 13:42:27 +0000 (13:42 +0000)]
sna: Trim create flags if tiled sizes are too large

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Fences are power-of-two sizes
Chris Wilson [Wed, 6 Nov 2013 13:41:39 +0000 (13:41 +0000)]
sna: Fences are power-of-two sizes

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Fixup unwind checks for future BLT commands
Chris Wilson [Wed, 6 Nov 2013 11:38:53 +0000 (11:38 +0000)]
sna: Fixup unwind checks for future BLT commands

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Clear the execlist if we completely unwind a batch after using 8x8 tiling
Chris Wilson [Wed, 6 Nov 2013 09:05:05 +0000 (09:05 +0000)]
sna: Clear the execlist if we completely unwind a batch after using 8x8 tiling

Another location, but the right function this time!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Move initialisation of loop counter to common code
Chris Wilson [Wed, 6 Nov 2013 09:40:56 +0000 (09:40 +0000)]
sna: Move initialisation of loop counter to common code

It was only being defined in x86-64 and left unitialized for x86-32.

Fixes regression from
commit 587c4866652e40e1e228b333028114766a6d3b08
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Nov 4 15:10:40 2013 +0000

    sna: Promote uint16_t to a full int to avoid overflow in computing w*h in memcpy_xor

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71286
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Clear the execlist if we completely unwind a batch after using 8x8 tiling
Chris Wilson [Wed, 6 Nov 2013 09:05:05 +0000 (09:05 +0000)]
sna: Clear the execlist if we completely unwind a batch after using 8x8 tiling

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Be more pessimistic for tiling sizes on older gen
Chris Wilson [Wed, 6 Nov 2013 08:56:01 +0000 (08:56 +0000)]
sna: Be more pessimistic for tiling sizes on older gen

On the older generation, we have severe alignment penalties for fenced
regions which dramatically reduce the amount of space we can effectively
use in a batch. To accommodate this, reduce the tiling step size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Only operate inplace if no existing CPU damage for a read
Chris Wilson [Tue, 5 Nov 2013 22:41:06 +0000 (22:41 +0000)]
sna: Only operate inplace if no existing CPU damage for a read

With a large object, we try harder to operate inplace (to avoid creating
a second large CPU bo). This introduced an issue where we tried to read
from the GPU bo when there was already existing damage in the CPU -
triggering an assertion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Trim the overestimate of required aperture space for fence alignment
Chris Wilson [Tue, 5 Nov 2013 21:59:37 +0000 (21:59 +0000)]
sna: Trim the overestimate of required aperture space for fence alignment

We can optimistically only require that we waste the largest fence
region in a batch, as all other fences will then be naturally aligned as
well. So long as the kernel succeeds in defragmenting the aperture...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Mark partial move_area_to_gpu with MOVE_READ on promotion to move_to_gpu
Chris Wilson [Tue, 5 Nov 2013 21:33:18 +0000 (21:33 +0000)]
sna: Mark partial move_area_to_gpu with MOVE_READ on promotion to move_to_gpu

When promoting a partial move_area_to_gpu to a full move_to_gpu, we have
to disable certain optimisations that we try to use if MOVE_READ==0.

Reported-and-tested-by: Matti Hamalainen <ccr@tnsp.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71198
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Submit execution on the bo before changing its caching status
Chris Wilson [Tue, 5 Nov 2013 18:36:45 +0000 (18:36 +0000)]
sna: Submit execution on the bo before changing its caching status

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Clear snoop flag after converting from a CPU bo
Chris Wilson [Tue, 5 Nov 2013 18:29:46 +0000 (18:29 +0000)]
sna: Clear snoop flag after converting from a CPU bo

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Use an inplace exchange for large untiled BO
Chris Wilson [Tue, 5 Nov 2013 08:49:28 +0000 (08:49 +0000)]
sna: Use an inplace exchange for large untiled BO

On older architectures, large BO have to be untiled and so we can reuse
an existing CPU bo by adjusting its caching mode.

References: https://bugs.freedesktop.org/show_bug.cgi?id=70924
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Be move conservative with tiling sizes for older fenced gen
Chris Wilson [Tue, 5 Nov 2013 08:38:22 +0000 (08:38 +0000)]
sna: Be move conservative with tiling sizes for older fenced gen

The older generations have stricter requirements for alignment of fenced
GPU surfaces, so accommodate this by reducing our estimate available
space for the temporary tile.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agotest
Chris Wilson [Mon, 4 Nov 2013 22:14:05 +0000 (22:14 +0000)]
test

11 years agosna: Check for loss of state after setting up a fill BLT op
Chris Wilson [Mon, 4 Nov 2013 16:45:00 +0000 (16:45 +0000)]
sna: Check for loss of state after setting up a fill BLT op

If we install a BLT fill operation early in the drawing sequence (i.e.
before calling a mi routine), we may lose our state to delayed
initialisation of sources and so need to subsequently recheck.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: s/active/busy/ to silence compiler warning
Chris Wilson [Mon, 4 Nov 2013 15:17:51 +0000 (15:17 +0000)]
sna: s/active/busy/ to silence compiler warning

kgem.c: In function 'kgem_check_bo':
kgem.c:4768:7: warning: declaration of 'active' shadows a global declaration [-Wshadow]
kgem.c:692:21: warning: shadowed declaration is here [-Wshadow]
kgem.c: In function 'kgem_check_many_bo_fenced':
kgem.c:4907:7: warning: declaration of 'active' shadows a global declaration [-Wshadow]
kgem.c:692:21: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Promote uint16_t to a full int to avoid overflow in computing w*h in memcpy_xor
Chris Wilson [Mon, 4 Nov 2013 15:10:40 +0000 (15:10 +0000)]
sna: Promote uint16_t to a full int to avoid overflow in computing w*h in memcpy_xor

Reported-by: Conley Moorhous <conleymoorhous@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70527
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Apply the BLT source offset for individual copies
Chris Wilson [Mon, 4 Nov 2013 12:57:01 +0000 (12:57 +0000)]
sna: Apply the BLT source offset for individual copies

Following a complex path through multiple layers of indirections and
tiling fallbacks, resulted in hitting a path where the source offset was
subsequently ignored. This leads to the operation reading from invalid
memory (or hitting the assert warning about the same).

References: https://bugs.freedesktop.org/show_bug.cgi?id=70924
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Only use the simple stipple upload path if wholly contained
Chris Wilson [Mon, 4 Nov 2013 11:48:04 +0000 (11:48 +0000)]
sna: Only use the simple stipple upload path if wholly contained

If the stipple box is outside of the stipple pixmap, we need to
carefully upload the stipple using the modulus operation.

Buzilla: https://bugs.launchpad.net/bugs/1247785
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Update DBG formats for larger BO offset integers
Chris Wilson [Mon, 4 Nov 2013 11:47:29 +0000 (11:47 +0000)]
sna: Update DBG formats for larger BO offset integers

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Remove the replace indirection prior to performing write_boxes
Chris Wilson [Mon, 4 Nov 2013 11:30:39 +0000 (11:30 +0000)]
sna: Remove the replace indirection prior to performing write_boxes

As write_boxes itself decides whether or not to stage the upload into
the destination bo, we can destroy the temporary allocation along the
write_boxes fallback path (i.e. after failing to map the destination
bo).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Only destroy the old GPU after successfully replacing it
Chris Wilson [Mon, 4 Nov 2013 11:12:30 +0000 (11:12 +0000)]
sna: Only destroy the old GPU after successfully replacing it

Along the sna_replace__xor path we destroyed the priv->gpu_bo twice upon
successfully replacing it.

References: https://bugs.freedesktop.org/show_bug.cgi?id=70527
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Rename the two variants of pwrite so very relative dangers are obvious
Chris Wilson [Mon, 4 Nov 2013 09:34:25 +0000 (09:34 +0000)]
sna: Rename the two variants of pwrite so very relative dangers are obvious

Since we extend the write in the cache-aligned routine, it runs the risk
of reading from beyond the end of the allocation. As such, callers
should be carefully vetted to make sure that their allocations are
already cache-aligned (typically page-aligned). To make it obvious that
this complexity exists, rename the routine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Use the unoptimized pwrite for general buffers
Chris Wilson [Mon, 4 Nov 2013 09:31:05 +0000 (09:31 +0000)]
sna: Use the unoptimized pwrite for general buffers

When we call kgem_bo_write() we have less control over the allocation of
the buffer, and do not ensure it meets the alignment criteria required
for the cacheline optimisation. So use the simple pwrite routine to
avoid reading beyond the end of the allocation.

Reported-and-tested-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Use fast-path target placement if we are also IGNORE_CPU
Chris Wilson [Sun, 3 Nov 2013 22:07:22 +0000 (22:07 +0000)]
sna: Use fast-path target placement if we are also IGNORE_CPU

If we are ignoring CPU damage, we also need only to check GPU damage
when considering placement of the target bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Wrap staging buffer access with sigtrap handler
Chris Wilson [Sun, 3 Nov 2013 19:51:56 +0000 (19:51 +0000)]
sna: Wrap staging buffer access with sigtrap handler

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Discard bo->exec when unwinding a glyph no-op
Chris Wilson [Sat, 2 Nov 2013 21:45:00 +0000 (21:45 +0000)]
sna: Discard bo->exec when unwinding a glyph no-op

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Eliminate the redundancy between is_mappable/can_map
Chris Wilson [Sat, 2 Nov 2013 21:13:45 +0000 (21:13 +0000)]
sna: Eliminate the redundancy between is_mappable/can_map

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Jump to the right escape target when bypassing a self-copy
Chris Wilson [Sat, 2 Nov 2013 21:01:26 +0000 (21:01 +0000)]
sna: Jump to the right escape target when bypassing a self-copy

Another fix for

commit e3f15cbf39696edae9f716bdcfbb7032ec7d7e3f [2.99.905]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Oct 22 15:19:15 2013 +0100

    sna: Move gc back to GPU after failure to move it to CPU

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Add some more asserts around inactive VMA lists
Chris Wilson [Sat, 2 Nov 2013 15:12:51 +0000 (15:12 +0000)]
sna: Add some more asserts around inactive VMA lists

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Tweak estimate of maximum usable aperture for strict fencing
Chris Wilson [Sat, 2 Nov 2013 14:43:49 +0000 (14:43 +0000)]
sna: Tweak estimate of maximum usable aperture for strict fencing

Old generations have very strict alignment requirements even for
unfenced tiled accesses which restricts the amount of aperture space
available for use, and in the process estimate for the effect of
framebuffer fragmentation on the mappable aperture.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agoPrepare for changes in the BLT unit on future generations
Chris Wilson [Fri, 30 Nov 2012 16:28:02 +0000 (16:28 +0000)]
Prepare for changes in the BLT unit on future generations

Adapt the legacy BLT commands in preparation for future changes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Fallback when wedged and trying to use the BLT copy routines
Chris Wilson [Sat, 2 Nov 2013 13:11:31 +0000 (13:11 +0000)]
sna: Fallback when wedged and trying to use the BLT copy routines

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Guard the replace-with-xor fallback path
Chris Wilson [Fri, 1 Nov 2013 15:57:56 +0000 (15:57 +0000)]
sna: Guard the replace-with-xor fallback path

Before attempting to map the destination for uploading into after a
failure to use the BLT, we need to recheck that it is indeed mappable.

References: https://bugs.freedesktop.org/show_bug.cgi?id=70924
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Process all clip boxes when rastering segments
Chris Wilson [Fri, 1 Nov 2013 14:30:14 +0000 (14:30 +0000)]
sna: Process all clip boxes when rastering segments

The macro still had buried returns which were no longer valid after the
translation to handle clipping. They needed to be breaks from the inner
most loops to the outer clip box instead.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70802
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna/gen7: Undo overzealous flushing
Chris Wilson [Fri, 1 Nov 2013 12:49:36 +0000 (12:49 +0000)]
sna/gen7: Undo overzealous flushing

commit d580a30aaf97687f9669ea72fbc3310c2fea26f1
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Oct 31 15:58:47 2013 +0000

    sna/gen7: Flush render cache when changing CC state

ultimately doesn't prevent the issue and in the process adversely
affects perforamnce.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Scale uses of aperture_mappable by PAGE_SIZE
Chris Wilson [Fri, 1 Nov 2013 10:48:06 +0000 (10:48 +0000)]
sna: Scale uses of aperture_mappable by PAGE_SIZE

After converting aperture_mappable to count in pages, there were a few
residual users expecting a byte count.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71117
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna/gen7: Flush render cache when changing CC state
Chris Wilson [Thu, 31 Oct 2013 15:58:47 +0000 (15:58 +0000)]
sna/gen7: Flush render cache when changing CC state

References: https://bugs.freedesktop.org/show_bug.cgi?id=68410
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna/gen6: Tweak flush around CC state changes
Chris Wilson [Thu, 31 Oct 2013 13:35:59 +0000 (13:35 +0000)]
sna/gen6: Tweak flush around CC state changes

In order to fix some font corruption, it appears that we need an extra
flush in the Sandybridge pipeline when we change the CC stage and the
render cache is dirty. We previously triggered a full pipeline stall
for this case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Tweak deletion of used buffers
Chris Wilson [Thu, 31 Oct 2013 10:32:46 +0000 (10:32 +0000)]
sna: Tweak deletion of used buffers

Make sure we never unwind a used buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agosna: Allow limited recursion within sigtrapped routines
Chris Wilson [Wed, 30 Oct 2013 18:48:10 +0000 (18:48 +0000)]
sna: Allow limited recursion within sigtrapped routines

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agoRevert "sna: Detect and handle mi recursion"
Chris Wilson [Wed, 30 Oct 2013 18:42:06 +0000 (18:42 +0000)]
Revert "sna: Detect and handle mi recursion"

This reverts commit c6b0e3fe0c299488932ba0392847f1faf298d079.