Commit Graph

7917 Commits

Author SHA1 Message Date
Chris Wilson b259cbffcf sna: Avoid copying from tiled source for an overwritten fill
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-21 08:22:44 +01:00
Chris Wilson 935ec0abcb uxa: Remove misnomer from ATI logs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-21 08:22:44 +01:00
Chris Wilson 08e71e1820 sna: Initialise thread->arg
If we launch less than the maximum number of threads, we may read the
thread->arg value never having set it after a malloc.

==8207== Conditional jump or move depends on uninitialised value(s)
==8207==    at 0xA986B7F: sna_threads_wait (sna_threads.c:216)
==8207==    by 0xA986EFE: sna_image_composite (sna_threads.c:350)
==8207==    by 0xA93DD0D: sna_composite_fb (sna_composite.c:598)
==8207==    by 0xA93E66C: sna_composite (sna_composite.c:742)
==8207==    by 0x23A773: damageComposite (damage.c:503)
==8207==    by 0x2309A9: ProcRenderComposite (render.c:708)
==8207==    by 0x15D86D: Dispatch (dispatch.c:433)
==8207==    by 0x161689: dix_main (main.c:294)
==8207==    by 0x6FB1B44: (below main) (libc-start.c:287)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-19 18:47:00 +01:00
Chris Wilson 58a757b649 sna: Do not reuse physical cursors for the kernel is broken, harder
commit 154f7e9668
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Apr 18 09:28:02 2014 +0100

    sna: Do not reuse physical cursors for the kernel is broken

was insufficient as it ended up reusing a stale cursor that was still
attached, and so after updating the cursor the second pipe found itself
with a valid cursor. Hey presto, we had a shared physical cursor, once
again demonstrating the buggy kernel.

This time, disable all cursor reuse except for the once currently
attached to the pipe - this should prevent all sharing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77351
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-19 07:55:18 +01:00
Chris Wilson fb0ed43cbc sna: Refine detection of when shadow is active during BlockHandler
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-18 21:09:01 +01:00
Chris Wilson 2d9ae02c64 sna/video: Provide a fallback path for pwrite failure
Stranger things have happened.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-18 11:56:40 +01:00
Chris Wilson fdc28205d5 sna: Always flush the shadow scanout
When the shadow scanout is active, make sure we call the BlockHandler
every time, not just when we about to sleep. This is in case we are
swamped by clients trying to render and forgo the important step of
ensuring that their output reaches the screen.

Reported-by: Ildar Nurislamov <absorbb@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-18 11:36:28 +01:00
Chris Wilson 924237efbd sna: Fix some DBG formats
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-18 11:36:28 +01:00
Chris Wilson fa56f1062b sna/video: Only try to set the color key once
So that we only report the error to the user a single time, and not
every frame.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-18 09:53:37 +01:00
Chris Wilson 154f7e9668 sna: Do not reuse physical cursors for the kernel is broken
Big bug in the kernel that prevents the sharing of cursors across pipes
when they are backed by a phys_obj. To prevent hitting that bug, don't
do that!

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77351
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-18 09:30:07 +01:00
Chris Wilson 83f49767f8 sna: Pre-emptively bind framebuffers into the GTT
In order to avoid rendering to the bo and then stalling before we can
pin it the display plane, bind the framebuffer into the GTT (by using a
GTT mmap) during the initial allocation.

References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-17 09:35:14 +01:00
Chris Wilson fd0579016b sna: Pre-emptively move framebuffers into the DISPLAY cache domain
In order to avoid rendering to the bo and then stalling before we can
pin it the display plane, allocate bo for fb from uncached and change
the cache level during the initial allocation.

References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-15 16:34:20 +01:00
Chris Wilson b0472af1f3 sna: Mark partial composite operations upfront
Rather than guess in the backend when we are going to be called for
multiple boxes, rely on the frontend declaring it correctly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-15 16:34:06 +01:00
Chris Wilson 49e72bd4e5 sna: Discard TearFree readback when overdrawing
References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-15 16:33:59 +01:00
Chris Wilson 13054a00da sna: Fix up cut'n'paste typo in assertion
sna_display.c:3176:43: error: 'struct <anonymous>' has no member named 'rotation'
      assert(cursor->rotation != sna->cursor.rotation);

Reported-by: Ildar Nurislamov
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-15 10:28:32 +01:00
Chris Wilson 1ed8647aef sna: Add a cursor DBG for a failed pwrite update
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-15 06:55:26 +01:00
Chris Wilson cb35b39739 sna: Rearrange cursor reuse to avoid sharing rotations
Try not to steal a rotated cursor that is currently in use, or else we
may see a brief flash of corruption.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-14 17:12:37 +01:00
Chris Wilson fd700c37ee sna: Add some bounds checking asserts to damage
References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1300640
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-14 16:48:05 +01:00
Chris Wilson 9ae82134ad sna: Restrict WHOLE hint to PutImage on a complete Pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-11 18:36:16 +01:00
Chris Wilson 6883f5a644 sna: Perform 2-color to ARGB cursor conversion inplace
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-11 08:02:49 +01:00
Chris Wilson 2eddc60a5f sna: Don't redraw cursor if the fg/bg colors do not change
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-11 07:52:30 +01:00
Chris Wilson a79eb2e29a sna/gen2: Fix CA/a8 blend factors
This is a revert of

commit 142f846194 [2.99.911]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Mar 10 15:20:16 2014 +0000

    sna/gen2: Tidy blend factor selection for the source

as that broke glyph rendering in firefox for instance.

Reported-by: Carl Eitsger <4607vrfcr84spd21f08@weg-werf-email.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77201
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-10 23:15:32 +01:00
Chris Wilson 25fa4f5bb4 sna: Don't set cursor bits to an invalid pointer
The xf86Cursor core simply frees it, so it has to be NULL.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-10 23:15:32 +01:00
Chris Wilson 7b2753f9cc sna: Only mark the transform_in_use when required for shadow fb
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-10 23:12:16 +01:00
Chris Wilson 4950bc4fea sna: Only reload an active HW cursor
Do not attempt to restore the cursor handle if a SW cursor is currently
active. In particular, this prevents a crash after modesetting if we
never had a real cursor (for example output offloading).

Reported-by: Tomas Pruzina <pruzinat@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77283
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-10 22:57:43 +01:00
Chris Wilson 8e6e7dbc92 sna: Don't create slave pixmaps for the virtual CRTC
They only exist as placeholders for remote outputs in the framebuffer
and do not need to take part in actually output offloading, so we can
forgo creating slave pixmaps and remove the stub function entirely.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-10 22:57:43 +01:00
Chris Wilson f94684db1a sna: Validate the cursor everytime for hw support
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-10 16:08:48 +01:00
Chris Wilson d364a881ef configure: Report which version (lib or module) of glamor is used
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-10 09:14:59 +01:00
Eric Anholt b771b41f0a uxa: Fix load_cursor_argb for the new Xorg ABI.
Returning an undefined value meant we might get sw cursors.
2014-04-10 09:07:38 +01:00
Eric Anholt d812afc1d4 Use fbpict.h instead of defining its prototypes ourselves.
fbpict.h has been an installed header since 2008, shortly after uxa
landed.  This fixes compiler warnings when other headers happen to
include fbpict.h.
2014-04-10 09:07:38 +01:00
Eric Anholt a6919aa980 Update for glamor in the 1.16 server.
We should link against the server's copy, insted of using the external
library.
2014-04-10 09:07:38 +01:00
Chris Wilson be7c166a01 sna: Remove defunct Cursor interface on fake CRTC
As we no longer user the xf86Cursor helper, we can forgo filling in stub
routines for the fake CRTC.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-10 09:07:38 +01:00
Chris Wilson 1d2872dd08 sna: Prepare for an upcoming Cursor API change
1.16 now expects load-cursor-argb to return a boolean reporting
success/failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-10 09:07:38 +01:00
Chris Wilson f9a279b2dc intel-virtual-output: Fix damage bounds
Sigh. A serious mixup of integer promotion rules and wraparound caused
the damage computation for small regions to be completely bogus.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-09 22:15:19 +01:00
Chris Wilson e0c93a3e53 intel: If a non-root user starts X, don't release master
SET_MASTER and DROP_MASTER are only available to the root user. If we
are started as an ordinary user, and we are master by virtue of being
the first user of the device, never release our fd or master.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-09 18:55:18 +01:00
Chris Wilson dba43d370b sna: Use pwrite to update physical cursors
Older hardware uses physical addresses for its cursor, which are
implemented by the kernel in an incoherent fashion. Maybe with stolen
support this would be different...

Fixes regression on [845g, 945g] from
commit 25ca8f136c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Mar 27 14:15:30 2014 +0000

    sna: Support variable sized cursors

Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-09 16:17:31 +01:00
Chris Wilson f14d6cbff3 sna: Handle clipped PutImage uploads more carefully
If the upload is clipped, we do not want to apply the WHOLE migration hints.

References: https://bugs.freedesktop.org/show_bug.cgi?id=77178
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-09 13:17:23 +01:00
Chris Wilson 510e5cf3fa sna: Tweak application of WHOLE hint for uploads
This help with the continuing saga of
commit 1de1104064 [2.99.911]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Feb 21 22:43:04 2014 +0000

    sna: Use a hint to do whole image uploads inplace

References: https://bugs.freedesktop.org/show_bug.cgi?id=77178
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-09 12:27:44 +01:00
Chris Wilson f05552cd7a sna: Add some DBG for whole CPU pixmap migration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-09 11:54:49 +01:00
Chris Wilson cf4eb82786 sna: Restore empty region checking
commit 8ef81d676c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Apr 7 07:59:42 2014 +0100

    sna: Simplify checking for singular damage

overlooked that we were also checking for empty regions as well as
singular regions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-09 10:24:26 +01:00
Chris Wilson 9f40d7e912 sna: Fix build for older Xorg without OsBlockSIGIO support
OsBlockSIGIO/OsReleaseSIGIO was only introduced in xorg-server-1.13.0,
so we need a compat layer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-08 18:28:46 +01:00
Chris Wilson 5db8717b8d sna: Refactor 3 similar CPU migration promotion checks into one
References: https://bugs.freedesktop.org/show_bug.cgi?id=77178
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-08 18:17:52 +01:00
Chris Wilson 617e96f3af sna: Add more assertions before dereferencing sna_crtc
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-08 08:47:05 +01:00
Chris Wilson e6b03269d0 sna: Continue to reprobe for ZaphodHeads with a mixed up configuration
Fixes regresion from
commit 35b03b3fe6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Mar 28 09:14:59 2014 +0000

    sna: Virtual CRTCs are last, so break loops early

as the conflicting Zaphod detection requires on searching all potential
CRTCs without finding the match. By breaking early on the virtual CRTC,
we concluded that the setup was actually valid, but disabled.

Reported-by: Nick Bowler <nbowler@draconx.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77156
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-08 08:45:38 +01:00
Chris Wilson bf18751398 intel-virtual-output: Fixup DBG messages
Use the right variables and it may even compile.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-07 08:28:55 +01:00
Chris Wilson 8ef81d676c sna: Simplify checking for singular damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-07 07:59:42 +01:00
Chris Wilson f5014b3fdd sna: Avoid double application of pixel widening for degenerate lines
References: https://bugs.freedesktop.org/show_bug.cgi?id=77074
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-07 07:59:01 +01:00
Chris Wilson 3310ee89c1 sna: Avoid discarding damage when applying WHOLE hint to pixmap migration
Once again, we must be careful when promoting from a region to whole
pixmap migration that we do not discard required damage.

Fixes regression from
commit 27ac9f574f [2.99.911]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Feb 27 08:33:52 2014 +0000

    sna: Avoid promoting region-to-whole migration and discarding damage

Reported-by: gedgon@gmail.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77063
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-05 12:23:27 +01:00
Chris Wilson 7e9ff48ddb sna/gen8: Shrink 3DSTATE_SAMPLE_PATTERN packet
This is now smaller than originally specified.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-05 10:44:48 +01:00
Chris Wilson 878ed2d625 sna/gen8: w/a for NULL depth buffer
Instead of using a NULL type depth buffer, it is strongly suggested to
use a 1x1 16-bit depth buffer instead (with address 0).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-05 10:44:45 +01:00