Commit Graph

6090 Commits

Author SHA1 Message Date
Chris Wilson b84db39edb intel: Relax the has-kms test slightly
Do not rely on a fully populated set of CRTCs, but merely note that the
GETRESOURCES ioctl returns an error if KMS is not enabled.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-07 09:07:19 +00:00
Chris Wilson c6a59bee3b sna: Disable read-read optimisations
There is still a lurking issue, so punt on the optimisation for now.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61628
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-06 19:02:52 +00:00
Chris Wilson 9a7577902e sna: Lighten the wakeup handler slightly
As the wakeup handler is called more frequently, we want to avoid any of
the more heavyweight processing. So trim the wakeup handler down to the
check to see if the GPU is idle and so we should immediately flush what
we have currently queued.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-06 15:11:56 +00:00
Chris Wilson 779fc0b20c sna: Typo ('unsuported') in DBG messages
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-05 22:29:54 +00:00
Chris Wilson e67aece463 sna: Assert that the pixmap is not pinned before releasing the GPU bo
Nothing suspicious in this set, just an extra dab of paranoia.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-05 21:44:42 +00:00
Chris Wilson bc5f81901f sna: The GPU bo submit is still required before mapping for inplace operations
As we may choose to force the stall as we would be doing a read-back in
any event...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-05 15:55:01 +00:00
Chris Wilson 43e3886c6d sna: Use drawable_gc_flags() to select placement for PolyArc
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-05 15:32:35 +00:00
Chris Wilson 99b30203ba sna: Fix deference of just nullified GPU bo in previous commit
One last minute refactor too far, combining the too if(priv->gpu_bo)
blocks forgot that the first block tried to free gpu_bo...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-05 13:45:45 +00:00
Chris Wilson d31dc1343d sna: Refactor the is-mappable test for inplace operations
By moving the test into the common function for creating a mappable GPU
bo, we can also consider recreating that bo when desirable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-05 13:30:37 +00:00
Chris Wilson 9fa9234c70 sna: Prefer GPU for self-copies when undamaged on the CPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-05 11:34:49 +00:00
Chris Wilson 60ec35b8d2 sna: Be explicit when checking for an idle bo after CPU synchronisation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-05 11:14:37 +00:00
Chris Wilson ad4901a035 sna: Ensure that the tearfree swap is unmapped afterwards
After swapping the bo for the screen pixmap, we need to make sure that
we don't chase any dangling pointers.

References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1133490
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-05 10:44:01 +00:00
Chris Wilson 007a95d62f sna: Drop a local variable only used to hold a constant
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-04 14:44:23 +00:00
Chris Wilson 4be725333c sna: Ensure we do not attempt to operate inplace on a very large pixmap
Otherwise we will fail to map it into the GTT. In theory, this should
just result in the same fallback paths, but pushing that knowledge up
further should help us make better decisions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-04 11:56:44 +00:00
Chris Wilson ad05039cc8 sna/gen3: Always prefer BLT for copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-04 10:11:22 +00:00
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