Commit Graph

6883 Commits

Author SHA1 Message Date
Chris Wilson 04d2cad65d 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>
2013-11-12 14:43:56 +00:00
Chris Wilson a6bd301171 sna: Factor available memory into available aperture estimation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-12 14:43:56 +00:00
Chris Wilson 4493fb8d21 sna: Apply drawable offset to glyph bbox prior to checking for clipping
This is a correction to

commit ec0866e86d
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>
2013-11-12 08:41:49 +00:00
Chris Wilson 29fcc15efa 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>
2013-11-11 11:44:41 +00:00
Chris Wilson aa140ef1e6 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>
2013-11-11 11:39:34 +00:00
Chris Wilson b3b02a879b sna: Assert that we do setup the gc->pCompositeClip upon ValidateGC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-10 10:35:27 +00:00
Chris Wilson 3ec663bf1c Merge branch 'master' of hsw:/usr/src/xf86-video-intel 2013-11-09 11:06:12 +00:00
Chris Wilson 84d667b94a 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>
2013-11-08 09:56:18 +00:00
Chris Wilson d9ecb91ef1 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>
2013-11-07 14:58:08 +00:00
Chris Wilson cb579a4444 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>
2013-11-07 14:54:39 +00:00
Chris Wilson 68cef6cd28 sna/gen7: Request secure batches for Haswell vsync
Since commit 8ff8eb2b38
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>
2013-11-07 13:10:16 +00:00
Chris Wilson b796c33411 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>
2013-11-06 16:24:28 +00:00
Chris Wilson ace764501e 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>
2013-11-06 15:44:33 +00:00
Chris Wilson 7a9c1e153a sna: Add a DBG breadcrumb to kgem_bo_convert_to_gpu()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-06 15:04:24 +00:00
Chris Wilson ae380a960d 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>
2013-11-06 14:51:42 +00:00
Chris Wilson 7578809ddc sna: Trim create flags if tiled sizes are too large
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-06 13:42:27 +00:00
Chris Wilson 073465817f sna: Fences are power-of-two sizes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-06 13:42:24 +00:00
Chris Wilson a6b008d692 sna: Fixup unwind checks for future BLT commands
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-06 11:38:53 +00:00
Chris Wilson 22b6a331d0 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>
2013-11-06 11:26:01 +00:00
Chris Wilson c3d5b1d8fc 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 587c486665
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>
2013-11-06 09:40:56 +00:00
Chris Wilson 1a31335954 sna: Clear the execlist if we completely unwind a batch after using 8x8 tiling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-06 09:05:05 +00:00
Chris Wilson ef842d2cee 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>
2013-11-06 09:01:17 +00:00
Chris Wilson f2f9019bae 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>
2013-11-06 09:01:17 +00:00
Chris Wilson 7f901495cd 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>
2013-11-06 09:01:17 +00:00
Chris Wilson 736b496b45 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>
2013-11-06 09:00:33 +00:00
Chris Wilson 723f17ca4f sna: Submit execution on the bo before changing its caching status
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-05 18:36:45 +00:00
Chris Wilson 10b573c508 sna: Clear snoop flag after converting from a CPU bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-05 18:29:46 +00:00
Chris Wilson dc61705a6e 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>
2013-11-05 09:06:19 +00:00
Chris Wilson f3225fcb38 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>
2013-11-05 08:38:22 +00:00
Chris Wilson 93193aaf7d test 2013-11-04 22:14:05 +00:00
Chris Wilson a0d1de962a 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>
2013-11-04 17:07:53 +00:00
Chris Wilson fcd081ca77 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>
2013-11-04 15:18:08 +00:00
Chris Wilson 587c486665 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>
2013-11-04 15:12:37 +00:00
Chris Wilson 8f6e227ba8 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>
2013-11-04 13:56:37 +00:00
Chris Wilson 82b646a42f 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>
2013-11-04 11:48:04 +00:00
Chris Wilson e678cead11 sna: Update DBG formats for larger BO offset integers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-04 11:47:29 +00:00
Chris Wilson 94f9beb8fb 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>
2013-11-04 11:30:39 +00:00
Chris Wilson ad3959324c 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>
2013-11-04 11:12:30 +00:00
Chris Wilson 8d067e9619 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>
2013-11-04 09:34:25 +00:00
Chris Wilson 7050c8da56 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>
2013-11-04 09:31:05 +00:00
Chris Wilson 10023bf8f5 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>
2013-11-03 22:07:22 +00:00
Chris Wilson 08d8a47e7c sna: Wrap staging buffer access with sigtrap handler
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-03 19:51:56 +00:00
Chris Wilson 4a7217b05c sna: Discard bo->exec when unwinding a glyph no-op
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-02 21:45:00 +00:00
Chris Wilson add663919e sna: Eliminate the redundancy between is_mappable/can_map
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-02 21:39:13 +00:00
Chris Wilson d41f847c75 sna: Jump to the right escape target when bypassing a self-copy
Another fix for

commit e3f15cbf39 [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>
2013-11-02 21:09:01 +00:00
Chris Wilson 7c143ba65c sna: Add some more asserts around inactive VMA lists
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-02 15:46:39 +00:00
Chris Wilson 1c34ea0894 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>
2013-11-02 15:46:04 +00:00
Chris Wilson d507b6b982 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>
2013-11-02 13:50:15 +00:00
Chris Wilson 9681b1422e sna: Fallback when wedged and trying to use the BLT copy routines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-02 13:38:07 +00:00
Chris Wilson 6cb84c8d55 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>
2013-11-01 15:57:56 +00:00