Commit Graph

7891 Commits

Author SHA1 Message Date
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
Chris Wilson 02862faeae sna: Remove unitialized use of 'cursor'
The earlier query of cursor (simply to find out the hw size) was
replaced by an invariant determined when the cursor was first set.
However, not all uses of cursor->size were fixed.

Fixes regression from
commit f98b2e1646
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Apr 2 08:36:14 2014 +0100

    sna: Prevent signal re-entrancy into cursor update routines

Reported-by: Christoph Haag <haagch.christoph@googlemail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77053
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-04 16:05:23 +01:00
Chris Wilson 938eea6dee sna/gen2+: Beware the unattached ShmPixmap
When dereferences priv, make sure it exists first. ShmPixmaps for
example, may not have one, nor do very small buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-04 15:56:38 +01:00
Chris Wilson 564e4a9878 sna/gen7: Move constants MOCS into chipset specific info blocks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-04 14:04:38 +01:00
Chris Wilson 6e86e84da1 sna: Precompute OVER/ADD with solids to convert it into a BLT operation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-04 12:57:50 +01:00
Chris Wilson 31a4c7bc13 sna/gen2+: Replace composite sources with solids where possible
If the composite reads entirely from within a large pixmap which is a
clear color, just replace the source with a solid.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-04 11:45:53 +01:00
Chris Wilson f0565852b6 sna: Short-circuit repeated clearing to the same color
Spotted in amongst a KDE debug log was a series of clear; copy; repeat
using Composite().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-03 16:49:27 +01:00
Chris Wilson baef2201f7 sna: Silence compiler warning
Simplify the dependency logic so that even the compiler can understand
what is going on.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-02 11:37:17 +01:00
Chris Wilson f98b2e1646 sna: Prevent signal re-entrancy into cursor update routines
As we may need to allocate from within the cursor update, we are prone
to re-entrancy issues within malloc()/free(). To avoid these we need to
block SigIO (for pointer updates) whilst in the critical section.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-02 09:49:53 +01:00
Chris Wilson a926d9f682 sna: Update tiling flags after reusing inactive VMA
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-31 14:07:41 +01:00
Chris Wilson 644c274b2c sna: Fix predicate inversion for assertion
The assertion was checking that the invalid condition was true, rather
than that it never happened. Oops.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-31 14:03:49 +01:00
Chris Wilson 4b97bf7e6e sna: Use a cheaper check for a replacement operation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-31 13:37:38 +01:00
Chris Wilson 76380bcc3c sna: Allow reassignment of inactive VMA if not mapped into the GTT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-31 13:37:38 +01:00
Chris Wilson c4c8a1b180 sna: Discard damage tracking for operations to the whole pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-31 11:23:45 +01:00
Chris Wilson 8f796d4586 sna: Promote to the GPU operations that cover the whole pixmap
If the pixmap is already partially on the GPU, and the next operation
touches the entire pixmap, promote that operation back to the whole GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-31 11:14:46 +01:00
Chris Wilson 27c086a89d sna: Regularly check that damage does exceed the pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-31 10:15:39 +01:00
Chris Wilson a8a5a5a587 sna: Search cursor cache first
We can reuse the current cursor size rather than determine it every
time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-31 09:36:05 +01:00
Chris Wilson e892b789c4 sna: Suppress a compiler warning
sna_display.c: In function '__sna_get_cursor':
sna_display.c:3153:6: warning: assignment from incompatible pointer type [enabled by default]
  src = sna->cursor.ref->bits->argb;
      ^
sna_display.c:3209:10: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  if (src != sna->cursor.ref->bits->argb)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-28 11:34:03 +00:00
Chris Wilson 5c0623b5f3 sna: Only transform the temporary cursor coordinates
As we need to recompute them for each CRTC, we need to reset the
computation each time or else we screw up the coordinates and hide
the cursors at random.

Breakage 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: Jan Alexander Steffens <jan.steffens@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76724
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-28 09:56:03 +00:00
Chris Wilson 80792a3f49 sna: Our cursors are always square.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-28 09:43:34 +00:00
Chris Wilson 35b03b3fe6 sna: Virtual CRTCs are last, so break loops early
We know that all the virtual CRTCs are at the end of the CRTC array, so
when we see the first one, we can stop the processing of real CRTCs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-28 09:14:59 +00:00
Chris Wilson 929ac66558 sna: Cursors are invariant
Once created, a Cursor has a fixed size and content, so avoid upload
unnecessarily.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-28 08:48:06 +00:00
Chris Wilson 26cc3cec98 sna: drmGetCap is too recent for our supported versions of libdrm
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-28 08:46:25 +00:00
Chris Wilson 78805163c5 sna: RefCursor is too recent
Replace RefCursor with the simple refcnt manipulation for compilation
against older stacks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-28 08:46:25 +00:00
Chris Wilson e07f8e2e62 sna: Fix 2-color to ARGB cursor conversion
It helps to remember to advance through the source/mask images after
each row.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27 23:06:15 +00:00
Chris Wilson e501aa6676 sna: Cursors only need to be cleared when they are shrunk
If we completely overwrite the old contents, we do not need to clear it
first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27 21:59:08 +00:00
Chris Wilson 5c4d6d1ad7 sna: Reorder the cursor cache search
Search for an exact match first, before looking for a cursor we can
reuse. This should help reuse with multiple rotated screens not stealing
the others' cursor on every pass.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27 21:39:58 +00:00