platform/upstream/xf86-video-intel.git
10 years agosna: Reduce assertion when using asynchronous CPU access
Chris Wilson [Mon, 30 Jun 2014 10:05:33 +0000 (11:05 +0100)]
sna: Reduce assertion when using asynchronous CPU access

If we are not actually accessing the memory through the pointer, we do
not care if it not currently coherent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Silence snarky compliers
Chris Wilson [Mon, 30 Jun 2014 09:55:20 +0000 (10:55 +0100)]
sna: Silence snarky compliers

0 != (void *)0

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Mollify assert to be consistent with the scanout flush
Chris Wilson [Mon, 30 Jun 2014 09:46:00 +0000 (10:46 +0100)]
sna: Mollify assert to be consistent with the scanout flush

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotest/lowlevel-blt-bench: Exercise masks
Chris Wilson [Mon, 30 Jun 2014 07:44:33 +0000 (08:44 +0100)]
test/lowlevel-blt-bench: Exercise masks

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotest/lowlevel-blt-bench: Exercise SHM pixmaps
Chris Wilson [Mon, 30 Jun 2014 07:44:33 +0000 (08:44 +0100)]
test/lowlevel-blt-bench: Exercise SHM pixmaps

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-virtual-output: Remove one redundant cleanup on error
Chris Wilson [Mon, 30 Jun 2014 06:44:25 +0000 (07:44 +0100)]
intel-virtual-output: Remove one redundant cleanup on error

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-virtual-output: Cleanup singleton on failure
Chris Wilson [Sun, 29 Jun 2014 14:25:19 +0000 (15:25 +0100)]
intel-virtual-output: Cleanup singleton on failure

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-virtual-output: Convert debugging messages to verbosity
Chris Wilson [Sun, 29 Jun 2014 07:29:36 +0000 (08:29 +0100)]
intel-virtual-output: Convert debugging messages to verbosity

Original patch by main.haarp:
"A verbose switch is quite useful for debugging, it shouldn't require
editing and recompilation to gain more useful output. I added it."

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80664
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Ensure CPU bo is synchronized before writing
Chris Wilson [Sun, 29 Jun 2014 08:26:10 +0000 (09:26 +0100)]
sna: Ensure CPU bo is synchronized before writing

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Update allocation of CPU bo to avoid creating active buffers
Chris Wilson [Sun, 29 Jun 2014 06:02:44 +0000 (07:02 +0100)]
sna: Update allocation of CPU bo to avoid creating active buffers

Since we now prefer CPU detiling, exactly when we want active/inactive
buffers is a little more complex - and we also need to take into account
when we want to use the CPU bo as a render target.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Sync CPU bo before writes
Chris Wilson [Sun, 29 Jun 2014 06:00:58 +0000 (07:00 +0100)]
sna: Sync CPU bo before writes

Fixes regression from

commit 961139f5878572ebea268a0bbf47caf05af9093f [2.99.912]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri May 30 09:45:15 2014 +0100

    sna: Use manual detiling for downloads

Reported-by: Harald Judt <h.judt@gmx.at>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80560
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Only preferentially upload through the GTT for large transfers
Chris Wilson [Sat, 28 Jun 2014 20:07:08 +0000 (21:07 +0100)]
sna: Only preferentially upload through the GTT for large transfers

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Prefer linear if below tile_width
Chris Wilson [Sat, 28 Jun 2014 16:38:54 +0000 (17:38 +0100)]
sna: Prefer linear if below tile_width

Be stricter in order to allow greater use of CPU bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/io: Prefer CPU copies on LLC
Chris Wilson [Sat, 28 Jun 2014 13:23:29 +0000 (14:23 +0100)]
sna/io: Prefer CPU copies on LLC

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Don't discard damage for SHM pixmaps
Chris Wilson [Sat, 28 Jun 2014 13:22:17 +0000 (14:22 +0100)]
sna: Don't discard damage for SHM pixmaps

We don't really want to rendering into SHM pixmaps except for copying
back due to the strict serialisation requirements.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Check for a mappable GPU bo before migrating damage
Chris Wilson [Sat, 28 Jun 2014 13:21:36 +0000 (14:21 +0100)]
sna: Check for a mappable GPU bo before migrating damage

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Skip adding damage if it is already contained
Chris Wilson [Sat, 28 Jun 2014 13:20:00 +0000 (14:20 +0100)]
sna: Skip adding damage if it is already contained

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Tidy calling memcpy_from_tiled
Chris Wilson [Sat, 28 Jun 2014 13:19:22 +0000 (14:19 +0100)]
sna: Tidy calling memcpy_from_tiled

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Micro-optimise unswizzling tiling/detiling
Chris Wilson [Sat, 28 Jun 2014 13:18:23 +0000 (14:18 +0100)]
sna: Micro-optimise unswizzling tiling/detiling

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/trapezoids: Handle mono traps just in case
Chris Wilson [Sat, 28 Jun 2014 06:05:55 +0000 (07:05 +0100)]
sna/trapezoids: Handle mono traps just in case

I disabled a few paths and ended up in an assert that mono trapezoids
shouldn't get that far...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agouxa: Update Screen Pixmap width/height first
Chris Wilson [Fri, 27 Jun 2014 15:26:24 +0000 (16:26 +0100)]
uxa: Update Screen Pixmap width/height first

Since commit dd6db82680b05cde4a47116b7096c054f3837e20 [2.99.912]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri May 9 20:26:19 2014 +0100

    uxa: Add DRI3 and miSyncShm support

we verify that the attaching bo meets the constraints required for the
Pixmap. However, when updating the ScreenPixmap following a resize, we
did not update the Pixmap size until after we tried to update the bo,
resulting in a validation failure when shrinking the screen.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotest: Expand number of sources for basic benchmarking
Chris Wilson [Fri, 27 Jun 2014 15:12:35 +0000 (16:12 +0100)]
test: Expand number of sources for basic benchmarking

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/dri2: DBG compile fixes
Chris Wilson [Fri, 27 Jun 2014 15:00:03 +0000 (16:00 +0100)]
sna/dri2: DBG compile fixes

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/glyphs: Add DBG option for glyph tolerance
Chris Wilson [Fri, 27 Jun 2014 12:42:37 +0000 (13:42 +0100)]
sna/glyphs: Add DBG option for glyph tolerance

And bump it to 3 so that glyph filtering doesn't force us to use the
mask too often.

References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/glyphs: Add DBG option for forcing glyphs-to-dst
Chris Wilson [Fri, 27 Jun 2014 11:56:43 +0000 (12:56 +0100)]
sna/glyphs: Add DBG option for forcing glyphs-to-dst

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Check source bo is suitable for BLT before doing so
Chris Wilson [Fri, 27 Jun 2014 09:38:59 +0000 (10:38 +0100)]
sna: Check source bo is suitable for BLT before doing so

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Only reuse pinned batches for 830/845
Chris Wilson [Thu, 26 Jun 2014 19:19:52 +0000 (20:19 +0100)]
sna: Only reuse pinned batches for 830/845

Trying to fly too close to the sun. :(

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80558
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/dri2: Slightly improved DBG messages
Chris Wilson [Thu, 26 Jun 2014 19:24:05 +0000 (20:24 +0100)]
sna/dri2: Slightly improved DBG messages

Missing git add from

commit 2e8c09f3fe468abba9c307ba3d7b2d22908e1172
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 25 22:19:23 2014 +0100

    sna/dri2: Hook into ClientGone callback to clear dangling references

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Tidy selection of a near-miss active buffer.
Chris Wilson [Thu, 26 Jun 2014 19:21:12 +0000 (20:21 +0100)]
sna: Tidy selection of a near-miss active buffer.

References: https://bugs.freedesktop.org/show_bug.cgi?id=80560
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Fix userptr defines to match i915_drm.h
Chris Wilson [Thu, 26 Jun 2014 11:42:30 +0000 (12:42 +0100)]
sna: Fix userptr defines to match i915_drm.h

Now that we are starting to see userptr in the headers, we see that the
definitions slightly changed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Remove scare quotes from hotplug detection "enabled"
Chris Wilson [Thu, 26 Jun 2014 08:25:06 +0000 (09:25 +0100)]
sna: Remove scare quotes from hotplug detection "enabled"

Tidy up the log message by improving its formatting, and making it more
accurate.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/dri2: Hook into ClientGone callback to clear dangling references
Chris Wilson [Wed, 25 Jun 2014 21:19:23 +0000 (22:19 +0100)]
sna/dri2: Hook into ClientGone callback to clear dangling references

As the Window may exist for multiple Clients, we cannot rely on the
destruction of the Window decoupling all outstanding events and
preventing chasing a stale Client pointer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80157
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Make output destroy more defensive
Chris Wilson [Thu, 26 Jun 2014 05:59:07 +0000 (06:59 +0100)]
sna: Make output destroy more defensive

We may never create the properties as it may be ignored or the
allocation may fail, so we need to be careful when freeing we do not
stumble over invalid pointers.

References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c28
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/dri2: Compile fixes for ancient Xorg
Chris Wilson [Wed, 25 Jun 2014 17:05:46 +0000 (18:05 +0100)]
sna/dri2: Compile fixes for ancient Xorg

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Fix uninitialisable variable
Chris Wilson [Wed, 25 Jun 2014 16:20:52 +0000 (17:20 +0100)]
sna: Fix uninitialisable variable

sna_render.c: In function 'sna_render_picture_downsample':
sna_render.c:822: warning: 'priv' may be used uninitialized in this function

introduced in

commit ded05e8abb248664124d2b86f77c27497a252c4e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jun 23 22:15:56 2014 +0100

    sna: Allow scratch pixmap to allocate linear GPU bo

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Improve throttling during bo allocation
Chris Wilson [Wed, 25 Jun 2014 13:19:33 +0000 (14:19 +0100)]
sna: Improve throttling during bo allocation

By controlling how long we may block during buffer allocation, we can
relax the throttle elsewhere to prevent render lag buildup.

References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Only mark throttle as done after success
Chris Wilson [Wed, 25 Jun 2014 12:21:58 +0000 (13:21 +0100)]
sna: Only mark throttle as done after success

References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Track desired flushes better after starting a new batch
Chris Wilson [Wed, 25 Jun 2014 10:18:01 +0000 (11:18 +0100)]
sna: Track desired flushes better after starting a new batch

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel: Fix weblinks (again)
Chris Wilson [Wed, 25 Jun 2014 10:45:55 +0000 (11:45 +0100)]
intel: Fix weblinks (again)

Julien pointed out that I fail at checking links.

Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel: Fix weblinks
Chris Wilson [Wed, 25 Jun 2014 10:31:58 +0000 (11:31 +0100)]
intel: Fix weblinks

Matti reported a few outdated links to intellinuxgraphics.org, now
superseded by 01.org.

Reported-by: Matti Hämäläinen <ccr@tnsp.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Tweak scanout flush
Chris Wilson [Wed, 25 Jun 2014 08:00:04 +0000 (09:00 +0100)]
sna: Tweak scanout flush

We now distinguish gpu_dirty whilst the bo is not flushed within a batch
and needs_flush for when it is dirty and still busy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Throttle before doing a TearFree buffer replacement
Chris Wilson [Wed, 25 Jun 2014 07:18:25 +0000 (08:18 +0100)]
sna: Throttle before doing a TearFree buffer replacement

If the client is rendering fast, he may be rendering too fast and
starting to build up a backlog.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: And fix the typo...
Chris Wilson [Wed, 25 Jun 2014 07:05:22 +0000 (08:05 +0100)]
sna: And fix the typo...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Disable userptr for bdw
Chris Wilson [Wed, 25 Jun 2014 07:01:57 +0000 (08:01 +0100)]
sna: Disable userptr for bdw

Something fishy is afoot. But let's kill this particularly worrisome
regression so that we can do a full round of testing.

References: https://bugs.freedesktop.org/show_bug.cgi?id=79053
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Check all connectors for reuse
Chris Wilson [Wed, 25 Jun 2014 06:31:33 +0000 (07:31 +0100)]
sna: Check all connectors for reuse

Do not rely on the MST path being present to indicate a connector that
may be reused.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80355
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoAdd marketing names for Broadwell
Rodrigo Vivi [Tue, 24 Jun 2014 10:14:54 +0000 (03:14 -0700)]
Add marketing names for Broadwell

Even the unknown/reserved ones will stay with HD Graphics.

v2: Add missing names to intel.man and README files as well. (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
10 years agoAdd reserved PCD IDs for Broadwell
Chris Wilson [Tue, 24 Jun 2014 19:51:54 +0000 (20:51 +0100)]
Add reserved PCD IDs for Broadwell

Updating using kernel commit fb7023e0e248a33cb00d0a9cdce0bcedaa1ad284
Author: Rodrigo Vivi <rodrigo.vivi@intel.com>
Date:   Tue Jun 10 10:09:52 2014 -0700

    drm/i915: BDW: Adding Reserved PCI IDs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Add yet more DBG messages to MST discovery
Chris Wilson [Tue, 24 Jun 2014 19:49:18 +0000 (20:49 +0100)]
sna: Add yet more DBG messages to MST discovery

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoconfigure: Display our README before the summary
Chris Wilson [Tue, 24 Jun 2014 15:37:52 +0000 (16:37 +0100)]
configure: Display our README before the summary

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel: Add a note about the myriad places we have identifier strings
Chris Wilson [Tue, 24 Jun 2014 15:33:43 +0000 (16:33 +0100)]
intel: Add a note about the myriad places we have identifier strings

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel: Wait for our expected device node to appear
Chris Wilson [Tue, 24 Jun 2014 10:50:55 +0000 (11:50 +0100)]
intel: Wait for our expected device node to appear

If the path we want to open for the KMS device is not yet available,
wait a short while and try again.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80397
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Add some more DBG around connector discovery
Chris Wilson [Tue, 24 Jun 2014 10:35:23 +0000 (11:35 +0100)]
sna: Add some more DBG around connector discovery

References: https://bugs.freedesktop.org/show_bug.cgi?id=80355
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Ensure serial is not 0 for runtime MST discovery
Chris Wilson [Tue, 24 Jun 2014 10:24:26 +0000 (11:24 +0100)]
sna: Ensure serial is not 0 for runtime MST discovery

We reserve serial==0 for the initial setup that is run before RandR is
configured. After the server is running, we have to take extra steps to
make the outputs visible to userspace.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Fix the usual "x = y" typos in creating boxes
Chris Wilson [Tue, 24 Jun 2014 10:04:01 +0000 (11:04 +0100)]
sna: Fix the usual "x = y" typos in creating boxes

Fixes regression from

commit 1d74b2e07d125ad95b9db6c9c032e90faf2bfa60
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jun 24 08:58:51 2014 +0100

    sna: Decompose self-copy into overlapping/non-overlapping regions

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/glyphs: Clip damage to dst
Chris Wilson [Tue, 24 Jun 2014 09:23:03 +0000 (10:23 +0100)]
sna/glyphs: Clip damage to dst

We only check if the hardware will automatically discard writes outside
of the target pixmap, but we must manually clip the damage before adding
it to our tracker.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c58
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Trim composite region against dst clip extents
Chris Wilson [Tue, 24 Jun 2014 09:17:47 +0000 (10:17 +0100)]
sna: Trim composite region against dst clip extents

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel: Wait for the DRM device to load
Chris Wilson [Mon, 23 Jun 2014 15:14:28 +0000 (16:14 +0100)]
intel: Wait for the DRM device to load

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80397
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Decompose self-copy into overlapping/non-overlapping regions
Chris Wilson [Tue, 24 Jun 2014 07:58:51 +0000 (08:58 +0100)]
sna: Decompose self-copy into overlapping/non-overlapping regions

We only need to stage the copy for the overlapping portion of the
self-copy, for the rest we can do in a single pass.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/dri2: Add a dash more asserts
Chris Wilson [Tue, 24 Jun 2014 06:34:46 +0000 (07:34 +0100)]
sna/dri2: Add a dash more asserts

References: https://bugs.freedesktop.org/attachment.cgi?id=101618
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Disable CRTC after MST topology change
Chris Wilson [Mon, 23 Jun 2014 21:50:23 +0000 (22:50 +0100)]
sna: Disable CRTC after MST topology change

In order to disable CRTC after marking outputs as removed after probing
MST topology updates, we must manually mark the CRTCs as no longer
enabled.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Silence compiler warning for shadowed variable
Chris Wilson [Mon, 23 Jun 2014 14:47:13 +0000 (15:47 +0100)]
sna: Silence compiler warning for shadowed variable

sna_display.c: In function 'sna_mode_redisplay':
sna_display.c:6322:12: warning: declaration of 'fb_id' shadows a global declaration [-Wshadow]
sna_display.c:223:24: warning: shadowed declaration is here [-Wshadow]
  CC     sna_display_fake.lo

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Allow scratch pixmap to allocate linear GPU bo
Chris Wilson [Mon, 23 Jun 2014 21:15:56 +0000 (22:15 +0100)]
sna: Allow scratch pixmap to allocate linear GPU bo

When allocating a scratch pixmap, we do so in the expectation that
rendering on the GPU is always preferrable, so even allocate a small
linear bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Promote to full GPU bo after forced migration away from CPU bo
Chris Wilson [Mon, 23 Jun 2014 13:11:27 +0000 (14:11 +0100)]
sna: Promote to full GPU bo after forced migration away from CPU bo

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Prefer rendering on the CPU to avoid damage migration
Chris Wilson [Mon, 23 Jun 2014 13:02:51 +0000 (14:02 +0100)]
sna: Prefer rendering on the CPU to avoid damage migration

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Force creation of GPU bo for drawing if need be
Chris Wilson [Mon, 23 Jun 2014 11:27:30 +0000 (12:27 +0100)]
sna: Force creation of GPU bo for drawing if need be

Now that we are more eager to transfer to the GPU bo if we expect
rendering to the CPU bo to be either slow or risk potential corruption,
we can find ourselves in a recursive loop when we also decide not to
create the GPU bo. Prevent that by explicitly creating the GPU bo if
desired.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen6+: Initialise src offset before use
Chris Wilson [Mon, 23 Jun 2014 10:44:22 +0000 (11:44 +0100)]
sna/gen6+: Initialise src offset before use

Fixes regression from

commit 30348efd57135edee41fccb87133c572b6473aa8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jun 23 11:14:25 2014 +0100

    sna/gen6+: Avoid adjusting copy coordinates until commited to using them

which assumed that the render state was being zeroed.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Fix flushing empty batches
Chris Wilson [Mon, 23 Jun 2014 10:27:20 +0000 (11:27 +0100)]
sna: Fix flushing empty batches

A logic inversion in

commit 1909910fdf89216d18703e50728f4604f75d5d66
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Jun 22 20:19:22 2014 +0100

    sna: Inject a batch flush before adding a fresh bo

also applied the injection to when the batch was empty.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c48
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Handle old busy_ioctl not reporting the active ring
Chris Wilson [Mon, 23 Jun 2014 10:25:47 +0000 (11:25 +0100)]
sna: Handle old busy_ioctl not reporting the active ring

If we have an old kernel, just presume that the bo was last active on the
render ring.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen6+: Avoid adjusting copy coordinates until commited to using them
Chris Wilson [Mon, 23 Jun 2014 10:14:25 +0000 (11:14 +0100)]
sna/gen6+: Avoid adjusting copy coordinates until commited to using them

If we need to fallback to the BLT unit, we need to pass it the original
source/dest coordinates and not our transformed render coordinates. So
keep the original values intact until we start emitting the render
operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen4+: Add some more asserts around recreating vertex buffers
Chris Wilson [Mon, 23 Jun 2014 09:14:09 +0000 (10:14 +0100)]
sna/gen4+: Add some more asserts around recreating vertex buffers

References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c46
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Allow the CPU bo to be created if GPU rendering is forced
Chris Wilson [Mon, 23 Jun 2014 08:47:34 +0000 (09:47 +0100)]
sna: Allow the CPU bo to be created if GPU rendering is forced

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen6+: Encourage the compiler to inline a couple of key functions
Chris Wilson [Mon, 23 Jun 2014 08:42:37 +0000 (09:42 +0100)]
sna/gen6+: Encourage the compiler to inline a couple of key functions

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Prefer to render over damage into the GPU bo
Chris Wilson [Mon, 23 Jun 2014 08:22:13 +0000 (09:22 +0100)]
sna: Prefer to render over damage into the GPU bo

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Do not set CAN_CREATE_GPU flag for untiled allocations
Chris Wilson [Mon, 23 Jun 2014 08:20:55 +0000 (09:20 +0100)]
sna: Do not set CAN_CREATE_GPU flag for untiled allocations

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Rename IGNORE_CPU to IGNORE_DAMAGE to better reflect its purpose
Chris Wilson [Mon, 23 Jun 2014 08:07:13 +0000 (09:07 +0100)]
sna: Rename IGNORE_CPU to IGNORE_DAMAGE to better reflect its purpose

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Add DBG breadcrumbs to sna_output_discover()
Chris Wilson [Mon, 23 Jun 2014 07:18:23 +0000 (08:18 +0100)]
sna: Add DBG breadcrumbs to sna_output_discover()

References: https://bugs.freedesktop.org/show_bug.cgi?id=80355
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/gen4+: Add box emitters for the generic vertex paths
Chris Wilson [Mon, 23 Jun 2014 06:42:30 +0000 (07:42 +0100)]
sna/gen4+: Add box emitters for the generic vertex paths

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Inject a batch flush before adding a fresh bo
Chris Wilson [Sun, 22 Jun 2014 19:19:22 +0000 (20:19 +0100)]
sna: Inject a batch flush before adding a fresh bo

Fresh bo (those without a reservation already defined, ala
presumed_offset) will cause the kernel to do a full relocation pass. So,
if possible flush the already correct batch in the hope of trimming the
amount of checking the kernel has to perform on this new batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Add missing string for DBG
Chris Wilson [Mon, 23 Jun 2014 06:29:20 +0000 (07:29 +0100)]
sna: Add missing string for DBG

References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c12
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Disable unused CRTC after undock events
Chris Wilson [Sun, 22 Jun 2014 16:53:59 +0000 (17:53 +0100)]
sna: Disable unused CRTC after undock events

If undocking removes output (as the MST topology changes and some
outputs then become unreachable), we may leave dangling CRTC. This
confuses us, so disable any enabled but unconnected CRTC after the
undock event.

Reported-by: Sree Harsha Totakura <freedesktop@h.totakura.in>
References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c5
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Track CRTC mode changes and discard old flips
Chris Wilson [Sun, 22 Jun 2014 16:53:59 +0000 (17:53 +0100)]
sna: Track CRTC mode changes and discard old flips

If we have a pending flip across a modeset we must be careful to drop
the stale flip_bo after the modeset.

Reported-by: Sree Harsha Totakura <freedesktop@h.totakura.in>
References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c8
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Clean up CRTC on CloseScreen
Chris Wilson [Sun, 22 Jun 2014 10:45:35 +0000 (11:45 +0100)]
sna: Clean up CRTC on CloseScreen

We need to do this to stop any stray references escaping through kernel
events now that we are passing the CRTC through the event.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Discard write hint from a couple more move-to-gpu
Chris Wilson [Thu, 19 Jun 2014 09:17:11 +0000 (10:17 +0100)]
sna: Discard write hint from a couple more move-to-gpu

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Clear the transform flag on disabling the CRTC
Chris Wilson [Sat, 21 Jun 2014 14:43:32 +0000 (15:43 +0100)]
sna: Clear the transform flag on disabling the CRTC

In places, we assume that if the flag is set, we must have an active
CRTC. However, we were not clearing when disabling the CRTC.

Reported-by: Sree Harsha Totakura <freedesktop@h.totakura.in>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80325
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Avoid blending with the render engine on snoopable bo
Chris Wilson [Fri, 20 Jun 2014 19:01:23 +0000 (20:01 +0100)]
sna: Avoid blending with the render engine on snoopable bo

This seems slightly weird, as there is nothing to indicate that this
would generate incorrect results only for snoopable bo. But no many of
flushes make my pnv box happy, so adjust the placement logic to move the
blending operation away from the snoopable target. This is sensible for
reasons of avoiding snoops from the render pipeline anyway.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80253
Reported-and-tested-by: Matti Hämäläinen <ccr@tnsp.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Be more flexible in converting random subsamples to 8x8 tiles
Chris Wilson [Fri, 20 Jun 2014 16:06:55 +0000 (17:06 +0100)]
sna: Be more flexible in converting random subsamples to 8x8 tiles

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Mark up const boxes to keep the compiler happy
Chris Wilson [Fri, 20 Jun 2014 15:13:49 +0000 (16:13 +0100)]
sna: Mark up const boxes to keep the compiler happy

Pass around const to suppress a few compiler warnings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Feed more operations into the 8x8 BLT tiler
Chris Wilson [Fri, 20 Jun 2014 13:31:19 +0000 (14:31 +0100)]
sna: Feed more operations into the 8x8 BLT tiler

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Color patterns for BLT are required to be aligned to 256 byte boundaries
Chris Wilson [Fri, 20 Jun 2014 13:29:43 +0000 (14:29 +0100)]
sna: Color patterns for BLT are required to be aligned to 256 byte boundaries

This so far appears to be the most restrictive alignment required, so
simply increase the upload alignment to 256 bytes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80033
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotest: Increase number of tiled sources
Chris Wilson [Fri, 20 Jun 2014 07:28:32 +0000 (08:28 +0100)]
test: Increase number of tiled sources

Significantly improve the stress impose upon the tiled BLT operations.
Also start dumping pngs of the failures.

References: https://bugs.freedesktop.org/show_bug.cgi?id=80033
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/dri2: Don't decouple front buffer tracking for invalid SwapBuffer calls
Chris Wilson [Fri, 20 Jun 2014 06:28:02 +0000 (07:28 +0100)]
sna/dri2: Don't decouple front buffer tracking for invalid SwapBuffer calls

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Mark upload from SHM segment as read-only
Chris Wilson [Thu, 19 Jun 2014 19:39:59 +0000 (20:39 +0100)]
sna: Mark upload from SHM segment as read-only

As this may be mapped by the Xserver using a read-only SHM segment, we
are forced to treat it always as read-only. And this being X, that it is
using a SHM segment is opaque to the driver. Fantastic middlelayer.

This was incorrectly removed in
commit e680e54eab6ffa72e5e1eb6cc0e3fe4b235b06a1
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 11 10:48:26 2014 +0100

    sna: Ignore setting read-only for temporary userptr maps

Also let's not forget the ShmPutImage -> CopyArea path.

Reported-by: Christoph Haag <haagch.christoph@googlemail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78411
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Mark upload from SHM segment as read-only
Chris Wilson [Thu, 19 Jun 2014 19:39:59 +0000 (20:39 +0100)]
sna: Mark upload from SHM segment as read-only

As this may be mapped by the Xserver using a read-only SHM segment, we
are forced to treat it always as read-only. And this being X, that it is
using a SHM segment is opaque to the driver. Fantastic middlelayer.

This was incorrectly removed in
commit e680e54eab6ffa72e5e1eb6cc0e3fe4b235b06a1
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jun 11 10:48:26 2014 +0100

    sna: Ignore setting read-only for temporary userptr maps

Reported-by: Christoph Haag <haagch.christoph@googlemail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78411
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Missed fixing y tile offset in last commit
Chris Wilson [Thu, 19 Jun 2014 11:29:58 +0000 (12:29 +0100)]
sna: Missed fixing y tile offset in last commit

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Use the right pattern origin for tiled 8x8 extraction
Chris Wilson [Thu, 19 Jun 2014 10:51:00 +0000 (11:51 +0100)]
sna: Use the right pattern origin for tiled 8x8 extraction

References: https://bugs.freedesktop.org/show_bug.cgi?id=80033
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Fix up small extents for 8x8 tile construction
Chris Wilson [Thu, 19 Jun 2014 10:14:25 +0000 (11:14 +0100)]
sna: Fix up small extents for 8x8 tile construction

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Wrap pointer access for 8x8 tile construction
Chris Wilson [Thu, 19 Jun 2014 09:49:09 +0000 (10:49 +0100)]
sna: Wrap pointer access for 8x8 tile construction

The kernel can quite happily send a SIGBUS whenever we read from an bo
(due to oom), so catch it and handle it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Always readback shadow damage after replacing the buffer
Chris Wilson [Thu, 19 Jun 2014 08:47:02 +0000 (09:47 +0100)]
sna: Always readback shadow damage after replacing the buffer

Instead track what we explicitly want to discard for the next operation,
so that we don't have to copy back the whole buffer if we have to
replace the shadow and intend to overwrite it all.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna/dri2: Replace assertion with code to skip updating the back buffer
Chris Wilson [Thu, 19 Jun 2014 06:40:16 +0000 (07:40 +0100)]
sna/dri2: Replace assertion with code to skip updating the back buffer

After a window resize or redirection, the DRI2BufferPtr become stale but
it may take a while for the Client to notice and reconfigure. Just
skip touching stale backbuffers and let the Client catch up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agosna: Fix modulus for partial conversion of tiles to 8x8 patterns
Chris Wilson [Wed, 18 Jun 2014 21:15:42 +0000 (22:15 +0100)]
sna: Fix modulus for partial conversion of tiles to 8x8 patterns

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>