Commit Graph

5510 Commits

Author SHA1 Message Date
Chris Wilson 6fa059330d sna: Avoid creating a CPU bo for uploads if we already have a large GPU bo
And vice-versa if already have a large CPU bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-15 15:14:47 +01:00
Chris Wilson a253c95ec6 sna: Prefer uploads to be staged in snoopable bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-15 15:13:23 +01:00
Chris Wilson ef6d94a844 sna: Simply reverse all the boxes if dx <= 0 and dy <= 0
In this fairly common case, avoid both the double pass and use a simpler
algorithm as we can simply reverse the order of the boxes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-15 11:46:53 +01:00
Chris Wilson 6601a943ff sna: Keep track of the base pointer for the reordered boxes
So that we avoid freeing an invalid pointer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-15 11:39:56 +01:00
Chris Wilson ef34d5cf41 sna: Make sure we check for a busy CPU bo before declaring is-cpu
Even if the pixmap is entirely damaged on the CPU, we still may be in
the process of transferring it and so cause an unwanted stall.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 23:25:17 +01:00
Chris Wilson 0e397e4a1d sna/glyphs: Perform the fallback mask reduce before moving the glyph pointers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 21:36:45 +01:00
Chris Wilson db1ee13a53 sna/gen7: Check for gradient allocation failure within spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 21:26:01 +01:00
Chris Wilson 86479e9746 sna/gen7: Uses EXTEND_PAD for its alpha-gradient with spans
Fixes regression from 2b94f9a043.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 21:24:04 +01:00
Chris Wilson f17037275c sna: Reorder overlapping boxes for CopyArea/Window
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 20:15:26 +01:00
Chris Wilson 86e09d14bd sna: Tidy sna_copy_boxes
So there appears to be a bug hidden here. But only when we scroll
upwards in a GTK+ application. Hmm.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 19:44:17 +01:00
Chris Wilson 924f596463 sna: Avoid BLT to snoopable bo on older gen
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 19:16:07 +01:00
Chris Wilson 44e226b1d9 sna/glyphs: A repeat of the earlier typo for pixman glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 18:39:09 +01:00
Chris Wilson 797ebf937f sna/glyphs: Fix typo and render glyphs to the small mask
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 16:58:18 +01:00
Chris Wilson 2b94f9a043 sna/gen7: Preselect sampler
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 16:40:06 +01:00
Chris Wilson 50d61c38bd sna/gen4: Fix typo introduced in checking dst format
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 16:07:32 +01:00
Chris Wilson fc91b1f157 sna/gen7: Only emit the render flushes between operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 15:57:32 +01:00
Chris Wilson d30dc59651 sna/gen7: Only fallback to BLT for a redirected target
As we can always use a partial surface for the source.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 15:42:19 +01:00
Chris Wilson 9f05b0c03b sna/gen4+: Fix up card/dest format confusion in previous commit
That would have been much more successful had I not supplied the wrong
opaque formats to the sampler.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 15:10:56 +01:00
Chris Wilson fffbc34e46 sna/gen4+: Translate to card format using a switch
GCC produces faster code than a walk over the format tables.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 14:54:27 +01:00
Chris Wilson 95fdd9af5c sna: Enable pixman_glyphs if available
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 14:15:11 +01:00
Chris Wilson 3f764ee4c5 sna/dri: Presume an unknown chipset will want i965_dri.so
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 12:29:47 +01:00
Chris Wilson 39845280b5 sna: Allow BLT support on future unknown hardware
Assume that if the kernel recognises the chipset and declares it has a
BLT, we can use it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 12:14:28 +01:00
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