Commit Graph

5488 Commits

Author SHA1 Message Date
Chris Wilson b260ca44b3 Drop some unused includes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 10:02:51 +01:00
Chris Wilson f517bdb12b sna: Do not perform batch compaction on old kernels
As they will reject the delta pointing outside of the target batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 09:21:17 +01:00
Chris Wilson ce69a1e868 sna: Add some DBG for selecting glyph path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 09:21:17 +01:00
Chris Wilson b68b2d9091 sna: Add some DBG for short-circuiting choice of source bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 09:21:17 +01:00
Chris Wilson ad4786b285 sna: Aim for consistency and use stdbool except for core X APIs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 09:21:12 +01:00
Chris Wilson a05c3547bb sna/gen4: Simplify comparing the pipeline-pointers against the previous
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-13 15:06:15 +01:00
Chris Wilson ea9ec18505 sna: Split CloseScreen into two phases
In order to get the ordering correct we need to free the xf86_cursors
before calling the miPointerCloseScreen. This requires us to insert a
hook at the top of the CloseScreen chain. However we still require the
final CloseScreen hook in order to do the fundamental clean up, hence
split the CloseScreen callback into two phases.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-13 11:46:09 +01:00
Chris Wilson 0f03f7b435 sna: Only try to enable DRI2 if the module is available at runtime
Blatantly cribbed from Michel Danzer's patch for ati...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-13 10:35:27 +01:00
Chris Wilson b5d6a57f12 Enable compilation of SNA by default
But only if we meet the required versions of Xorg and leave UXA as the
default AccelMethod for the time being.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 22:16:55 +01:00
Chris Wilson 6c2975ab29 Fix the reporting of whether SNA is configured
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 22:14:59 +01:00
Chris Wilson fd15ce65ab sna: Fix build without DRI2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 22:13:50 +01:00
Chris Wilson 22be9988b9 sna: Check for failure to initialize the sprite pointers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 19:49:34 +01:00
Chris Wilson 32e7f4ee64 sna/glyphs: Fix array allocation for list_extents
Originally I intended to skip assigning the box on the last list.
However, loop simplicity failed and now we run the risk of writing
beyond the end of stack_extents, and overwriting the list_extents
pointer.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 19:39:10 +01:00
Chris Wilson 0477b5fb6f sna/glyphs: Apply mask reduction along fallback paths as well
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 19:37:02 +01:00
Chris Wilson 16aaa51b5d sna: Rearrange the tests for dropping the glyph mask
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 15:34:39 +01:00
Chris Wilson 600746f923 i810: Remove vestigial reference to xaa.h
i810_hwmc.c can pull it in via i810.h like everybody else. As for
xaalocal.h, I have no idea what that is... Both appear to be cut'n'paste
includes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 14:18:28 +01:00
Zhigang Gong 1d9ab2e710 uxa/dri: Fix a buffer leak on pageflipping when enabling glamor.
We need to put current front_buffer to back buffer thus we
don't need to create a new back buffer next time. This behaviou
should be the same with or without glamor. Previous code
incorrectly discard the previous front_buffer and cause a
big buffer leak problem.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 12:46:16 +01:00
Zhigang Gong fa89e06145 uxa/glyphs: Bypass uxa glyphs operations if using glamor.
glamor_glyphs will never fallback. We don't need to keep a
uxa glyphs cache picture here. Thus simply bypass the
corresponding operations.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 12:46:06 +01:00
Chris Wilson d25000e1f3 i810: Tidy configure detection for XAA/DGA
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 11:59:44 +01:00
Chris Wilson 44a1528c15 sna: Remove unused cached partials list
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-11 15:05:32 +01:00
Chris Wilson 94d489ae43 sna: Minor tweak to upload in place if the CPU bo is busy
Since we have to pay the price of the stall anyway...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-11 14:38:19 +01:00
Chris Wilson b5db90aa52 sna: Discard the mask for "non-overlapping" glyphs
If we can acheive the same rasterisation results without the mask,
rendering the glyphs-to-dst is so much faster that it outweighs the cost
of checking for overlapping glyphs.

The penalty is then for code that correctly declared that it required
a mask, who now have an extra ~10% overhead in the processing of their
glyphs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-11 13:18:32 +01:00
Chris Wilson 665c9cbdcf sna: Disable periodic scanout refresh if all outputs are disconnected
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-10 19:01:12 +01:00
Chris Wilson 85fdc3143b sna: Avoid the expensive recomputation of the region when copying
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-10 18:37:04 +01:00
Chris Wilson 747ed0ca28 sna: Only promote to full GPU if we already have a GPU bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-10 17:08:15 +01:00
Daniel Stone 232217eef8 i810: Make DGA optional
Don't build DGA when it's not available, or when we don't want it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-10 09:36:40 +01:00
Daniel Stone 78dc0c0474 i810: Make XAA optional
Don't build XAA when it's not available, or when we don't want it.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-10 09:32:01 +01:00
Chris Wilson 45ab003a58 sna: Check for overlapping glyphs within each list, then overlapping lists
Spotted by Zhigang Gong is this optimisation to avoid the problem with
multiple lines passed in a single request (using multiple lists). As the
start of line will overlap with the previous line when we use the simple
bbox comparison, we always declare those runs as overlapping and so we
cannot substitute a glyph mask. However, we can reduce the problem to
only checking for overlapping glyphs within a list and then checking for
overlapping lists. Very, very clever.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 21:35:06 +01:00
Chris Wilson 8066bc33d7 sna: Fix reversal of inside logic for BitmapToRegion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 11:41:17 +01:00
Chris Wilson 8a9a17cd09 sna: Improve the check for assertions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 11:41:17 +01:00
Chris Wilson b11bc37684 sna: Simplify the DBG incarnation
It was only ever used in conjunction with HAS_DEBUG_FULL. For debug
purposes it is as easy to redefine DBG locally. By simplifying the DBG
macro we can create it consistently and so reduce the number of compiler
warnings.

Long term, this has to be dynamic. Sigh.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 11:41:17 +01:00
Chris Wilson 21798a8867 sna: Promote large operations to use the whole GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 09:57:00 +01:00
Chris Wilson 1b6ad7a6ae sna: Only consider large clears as candidates for GPU migration
If we only operating on a small region of the pixmap and have require
damage migration in the past, we are likely to require migration again
at some point. So keep track of small damage areas.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 09:57:00 +01:00
Chris Wilson d8a75538ea sna: PadPixmap only writes to the out-of-bounds bits
So we only need to delcare it as reading the source pixmap and not mark
it as damaged.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 09:57:00 +01:00
Chris Wilson eafb454edf sna: Rename conflicting symbols with uxa
Reported-by: Christoph Reiter <reiter.christoph@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51887
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 09:57:00 +01:00
Chris Wilson 0af29175a0 sna: Just use a linear scan to find the terminating clip box
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 01:24:23 +01:00
Chris Wilson 2941a5fe15 sna: Remove the consideration of CPU damage for overwriting FillRect
We consideer a singular FillRect to be a sequence point in the rendering
commands, that is it is usually used to clear the background as the first
operation in a drawing sequence. So it is useful to ask if we can move
the sequence to the GPU at that point.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 00:47:21 +01:00
Chris Wilson 8be00b6d47 sna: Substitute the reduce clip region for fallback ops
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 22:29:43 +01:00
Chris Wilson 0457935a70 sna: Review placement hints for fallback operations
Look for those operations that maybe better via the GTT and those that
are preferred to be in CPU cache. The wonders of multiple layers of
heuristics.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 22:29:43 +01:00
Chris Wilson b7f0b0e7e3 sna: Remove function for force-to-gpu
This is now enitrely done in the core move-to-gpu as a special case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 22:29:43 +01:00
Chris Wilson bb8770158c sna: Apply the clear color when resizing the front buffer
If the existing front buffer is clear, just apply the clear color to
then new buffer rather than copy the old one across.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:22 +01:00
Chris Wilson 8dd14855d7 sna/dri: Review stale comments
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:22 +01:00
Chris Wilson 3bb7a530e7 sna/dri: Fix cross-chaining of pageflip vs vblank
And double-check that the drawable is still flippable before completing
the delay exchange.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 1454df8caa sna/dri: Use draw ref directly
As we hook into the DestroyWindow notification, we can reliably use the
original Drawable reference and avoid the secondary object lookups.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 9abb6c09bd sna/dri: Remove dead code for 'old_fb'
The member still exists but is never set and is unused.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson ad877abdc7 sna/dri: Attach the chain of frame events to the Window, not pixmap
So that we can have multiple clients swapping in separate windows
concurrently.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 81cd9aa800 sna: Tweak start/stop of the deferred flush
As we now emit work whenever we wakeup and find the GPU idle, we rarely
actually have pending work in the deferred flush queue, so try to avoid
installing a timer if we are not accumulating work.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 6cb0c631e4 sna/dri: Clarify the message for one failure case
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 9a314d18ce sna/dri: Add a couple of missing VG_CLEAR on vblanks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 66a53c15cb sna/dri: Couple the frame events into DestroyWindow
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00