Commit Graph

6583 Commits

Author SHA1 Message Date
Chris Wilson 59f030dd27 sna/gen3: Perform alpha-fixup upon copy sources
This is required for copying from depth-15 surfaces onto other depths.

Reported-by: Reinis Danne
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-04 10:10:39 +00:00
Chris Wilson 48a733a35a sna: Only destroy the cached CLEAR picture if it exists
Reported-by: Reinis Danne
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-03 15:32:23 +00:00
Chris Wilson 2583232773 sna: Nullify cache pointers upon server regen
To make sure we don't chase dangling pointers on the next pass.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-03 15:25:01 +00:00
Chris Wilson 4dec895b69 sna/gen3: Correct typo in assertion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-03 14:44:13 +00:00
Chris Wilson 862601c05e sna/gen3: Add some debug around rendercopies of the fbcon
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-03 14:04:29 +00:00
Chris Wilson 995abb4675 sna: CPUID return ISA features in ecx/edx
Whereas we were wrongly looking in eax.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61733
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-03 12:12:56 +00:00
Chris Wilson f9f2b5152f sna: Undo preferred depth for gen3
Mesa is buggy. Qt is buggy. Everything is buggy.

References: https://bugs.freedesktop.org/show_bug.cgi?id=61441
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-03 11:10:51 +00:00
Chris Wilson ef5edbf616 sna: Probe for kernel support of framebuffer formats
References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1135403
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-03 09:32:41 +00:00
Chris Wilson cd313a8d5d sna/dri: Guard against failed batch submission
Avoid dereferencing a NULL bo if we do not submit a batch for the copy
operation.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61708
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-03 09:32:41 +00:00
Chris Wilson e4df4e03b1 sna: Eliminate a few used-once local variables
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-03 09:32:41 +00:00
Chris Wilson ae3531c3a1 Fix Haswell CRW PCI-IDs
As we missed the PCI-ID for the CRW GT1 variant, we would not have enabled
render support for those particular Haswell machines.

Reported-by: Kenneth Graunke <kenneth@whitecape.org>
2013-03-01 23:47:01 +00:00
Chris Wilson fef6cdae9e sna: Chain up CloseScreen
Remember to call into the chained CloseScreen destructors!

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56608
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-01 15:58:42 +00:00
Chris Wilson 8c2dedaa4d sna: Assert that inplace operations are done on coherent maps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-01 15:49:57 +00:00
Chris Wilson d8296412b8 sna: Assert that when caching a pixmap header the pScreen match
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-01 15:42:38 +00:00
Chris Wilson 904af32391 sna: Assert that we do not resurrect stale pixmap across a server regen
References: https://bugs.freedesktop.org/show_bug.cgi?id=56608
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-01 15:34:45 +00:00
Chris Wilson d4164de5cc sna: Assert that the ScrnInfo and ScreenPtr relationship is correct
References: https://bugs.freedesktop.org/show_bug.cgi?id=56608
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-01 13:49:18 +00:00
Chris Wilson 8d97c192a3 sna: Move some conditional code out-of-line
Just to reduce the number of ifdefs, one at a time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-01 11:59:49 +00:00
Chris Wilson 4174c7bb14 sna: Use depth-15 rather than depth-16 for reduced bw devices
Keeping the number of bits identical between the RGB channels helps
prevent discoloration.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-01 09:21:03 +00:00
Chris Wilson e05d2e4814 sna: Track number of pixmaps allocated whilst counting bo leaks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-01 09:08:19 +00:00
Chris Wilson 89038ddb96 sna/video: Correct scaling of source offsets
When applying pan and zoom to a mismatched video, it would inevitably
miscompute the origin and scale factors.

Reported-by: Matti Hamalainen <ccr@tnsp.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61610
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-28 21:18:49 +00:00
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