Commit Graph

6563 Commits

Author SHA1 Message Date
Chris Wilson a0a2faefde sna: Fix syntax for __get_cpuid()
It is a function not a macro like cpuid() and takes pointers to its
arguments!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-27 22:27:02 +00:00
Chris Wilson bfc1fda87f sna/dri: Fix use of uninitialised pipe along error path
> sna_dri.c:2018:6: warning: variable 'pipe' is used uninitialized
> whenever 'if' condition is true [-Wsometimes-uninitialized]
>         if (get_private(front)->pixmap != get_drawable_pixmap(draw))
>             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> sna_dri.c:2150:42: note: uninitialized use occurs here
>         DRI2SwapComplete(client, draw, 0, 0, 0, pipe, func, data);

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-27 22:19:06 +00:00
Chris Wilson f08ad3f8ef sna: Prettify GCC version detection in headers
And fixup a basic error in the process.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-27 17:46:55 +00:00
Chris Wilson 8aea4ae127 sna: Improve compatibility of cpuid.h detection
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-27 17:38:46 +00:00
Chris Wilson 5c27307219 sna: Remove the trailing '.' from the previous commit
Good Maarten for reporting the bug, bad Maarten for silently fixing up my
mistakes when testing! Thanks to Colin Walter and his tinderbox.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-27 15:00:33 +00:00
Chris Wilson b8a0acd615 sna: Migrate dirty tracking across ScreenPixmap updates
Otherwise chaos ensues:

Invalid read of size 8
==8647==    at 0x8477BC1: has_offload_slaves.isra.38 (sna_accel.c:14402)
==8647==    by 0x84958E7: sna_accel_block_handler (sna_accel.c:13729)
==8647==    by 0x164B13: BlockHandler (dixutils.c:387)
==8647==    by 0x2B5273: WaitForSomething (WaitFor.c:210)
==8647==    by 0x160790: Dispatch (dispatch.c:357)
==8647==    by 0x14F549: main (main.c:298)
==8647==  Address 0xf3383e8 is 24 bytes inside a block of size 152 free'd
==8647==    at 0x4C2BA6C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8647==    by 0x2403DF: damageDestroyPixmap (damage.c:1549)
==8647==    by 0x1FFD88: XvDestroyPixmap (xvmain.c:372)
==8647==    by 0x1FE789: ShmDestroyPixmap (shm.c:273)
==8647==    by 0x8507C24: _sna_dri_destroy_buffer (sna_dri.c:448)
==8647==    by 0x289986: do_get_buffers (dri2.c:521)
==8647==    by 0x289C0F: DRI2GetBuffersWithFormat (dri2.c:690)
==8647==    by 0x28B68F: ProcDRI2Dispatch (dri2ext.c:306)
==8647==    by 0x160A40: Dispatch (dispatch.c:428)
==8647==    by 0x14F549: main (main.c:298)
==8647==
==8647== Invalid read of size 8
==8647==    at 0x8477BCA: has_offload_slaves.isra.38 (regionstr.h:74)
==8647==    by 0x84958E7: sna_accel_block_handler (sna_accel.c:13729)
==8647==    by 0x164B13: BlockHandler (dixutils.c:387)
==8647==    by 0x2B5273: WaitForSomething (WaitFor.c:210)
==8647==    by 0x160790: Dispatch (dispatch.c:357)
==8647==    by 0x14F549: main (main.c:298)
==8647==  Address 0xdfdfdfdfdfdfdfe7 is not stack'd, malloc'd or (recently) free'd

Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-27 13:53:48 +00:00
Chris Wilson 11b72628cb sna/gen2: Add SSE2 fast paths for vertex emission
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 19:08:58 +00:00
Chris Wilson f2597c89d0 sna: Force GCC to use the SSE unit for SSE2 routines
Merely hinting that it was preferred by using sse+387 was not enough
for GCC to emit the faster SSE2 code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 18:44:45 +00:00
Chris Wilson a18ce0f642 sna: Flatten the glyph emitters
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 18:44:35 +00:00
Chris Wilson 7bb06b02e6 sna/gen3: Expand the number of SSE2 routines for basic composite ops
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 18:44:26 +00:00
Chris Wilson 417c3f9b8c sna/trapezoids: Add a pair of unlikely hints for forced box emission
Overflowing the buffer is unlikely, so pass the hint on to the compiler.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 17:41:57 +00:00
Chris Wilson aa7e11a1a4 sna: Improve handling of migrated userptr bo
Superficially fixes gimp-2.9

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 15:07:12 +00:00
Chris Wilson 32d8908337 sna: Flatten unaligned box emission
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 11:42:03 +00:00
Chris Wilson aa358fad8c sna: Bump required GCC for sse2
gcc-4.4.5 (on squeeze) triggers an ICE when using target(sse2).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 11:37:24 +00:00
Chris Wilson 08747292b7 sna: Conditionally compile sse2 routines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 11:37:10 +00:00
Chris Wilson 9c63ddd9f1 sna: Conditionally compile sse4_2 routines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 11:35:17 +00:00
Chris Wilson dc885d350e sna: Conditionally compile avx routines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 11:28:05 +00:00
Chris Wilson 8cdebf3b72 sna/gen4: Cluster ISA
Otherwise we seem to confuse the poor little compiler. This should also
make it easier to use CPP to turn off blocks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 11:11:07 +00:00
Chris Wilson 8272d849c0 sna/gen4+: All associated CPUs have sse2 at least
So mark up the basic functions as SSE2 in case we are compiling for
32-bit only.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 10:53:20 +00:00
Chris Wilson 76d46201d7 sna: Only use the GPU bo after migrating
If we choose not to migrate the damage to the GPU bo, then it will be
incoherent. This just flattens the logic out as priv->gpu_bo should be
NULL here anyway.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 10:50:52 +00:00
Chris Wilson 1068bf7024 sna: Mention if compiled as 64bit as part of the CPU feature detection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 10:14:23 +00:00
Chris Wilson 27c71027b1 sna: Ignore SSE4a - not an Intel ISA!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 10:00:29 +00:00
Chris Wilson 2a6f3989ba sna/gen3: Allow conditional use of SSE2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 09:59:34 +00:00
Chris Wilson 13461a18b1 sna: Print detected CPU features
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 09:41:14 +00:00
Chris Wilson 528dbf9ebb sna: Fix build on older GCC for cpuid()
We need to double check that the features we look for are supported by
the compiler before doing so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 08:17:44 +00:00
Chris Wilson 49d9c5e9d4 sna: Reverse inverted assertions
Oops, the assertions that we had sufficient free space was inverted.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 00:27:12 +00:00
Chris Wilson 94b95cc2fc sna/gen4+: Begin specialising vertex programs for ISA
Allow use of advanced ISA when available by detecting support at
runtime. This initial work just uses GCC to emit varying ISA, future
work could use hand written code for these hot spots.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26 00:03:28 +00:00
Chris Wilson f095678125 test: Correct ignore path for async.avi
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-25 23:15:02 +00:00
Chris Wilson aa045d80ec sna: Detect available instruction sets at runtime
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-25 23:15:02 +00:00
Chris Wilson 56fd91fc83 sna/gen3+: Restart vertex space checks after lock contention
If we end up contending for the vertex lock, we need to double check
there is sufficient vertex space left for us.

Bugzill: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1124576
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-25 16:13:18 +00:00
Chris Wilson b12f0da0be sna/gen3+: Assert that nbox is not 0
Various assertions to track down a potential programming error.

References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1124576
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-25 16:13:05 +00:00
Chris Wilson 6f9646f5be sna/trapezoids: Instruct the compiler to flatten the callees whilst rasterising
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-25 14:36:32 +00:00
Chris Wilson 421910ca57 sna/gen3: Factor out the per-vertex divide for gradients
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-24 22:15:13 +00:00
Chris Wilson a19da0ea51 sna: Reduce DefaultDepth to 16 on older chipsets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-24 11:22:01 +00:00
Chris Wilson d7bba8512c sna: Tidy a call to set the gamma before setting up a CRTC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-23 10:56:42 +00:00
Carl Worth e2aaf4ed33 Refuse to load driver for depth-8 X server.
The driver is not functional at this depth, so tell the user as much and
bail out.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31375

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-02-22 17:19:21 -08:00
Chris Wilson cbd8f16ea0 sna: Refuse to create larger than max temporary upload bo
The maximum size is determined by available RAM, if we exceed it we
greatly increase the risk of swap thrashing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-22 21:49:42 +00:00
Chris Wilson 7a26479277 sna: Retire before looking for a large 2D buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-22 20:13:58 +00:00
Chris Wilson 630b114f1c sna: Allow search_linear_cache() to reuse large buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-22 20:08:36 +00:00
Chris Wilson d87a0b4c3b sna: Allow picture fixup in channel format if not changing RGB depth
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-22 20:07:56 +00:00
Chris Wilson b129b434f9 sna: Optimise mmap of GPU bo for read-read operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-22 12:13:53 +00:00
Chris Wilson 19bd005056 sna: Avoid migrating and making the GPU bo busy prior to mmapping it
References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1131134
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-22 12:13:27 +00:00
Chris Wilson afb77ffade sna/gen7: Skip CLEAR_PARAMS for the null depthbuffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-22 10:48:06 +00:00
Chris Wilson 1a7262e530 sna/gen7: Only a pipeline stall is required for the CA pass
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-22 10:30:49 +00:00
Chris Wilson b0c83b77d0 sna/dri: Eradicate the DRI2 name exchange mechanism
Thinking about the compositor <-> server <-> client inter-exchange
demonstrates that we cannot prevent the client rendering into the
source texture being show by the compositor. That is a subject for DRI3.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-21 19:37:51 +00:00
Chris Wilson 6172ff3e35 sna: Always enable the solid-cache and gradient-cache
Figuring out when it might not be used is simply too error prone.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-21 15:34:47 +00:00
Chris Wilson b7a96df9b0 sna: Honour LinearFramebuffer
The Option was untested, and unsurprisingly was broken.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-20 18:54:27 +00:00
Chris Wilson d2442c74b8 2.21.3 release 2013-02-20 13:36:43 +00:00
Chris Wilson 2cab7e80eb sna/trapezoids: Clamp cells to valid range
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-20 12:40:01 +00:00
Chris Wilson 14de90b251 sna/trapezoids: Embed a few cells into the stack
Avoid an allocation in the common case where the set of trapezoids is
fairly narrow.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-20 12:00:54 +00:00