Commit Graph

3209 Commits

Author SHA1 Message Date
Jesse Barnes 7ad9c0bebf add cscope files to gitignore 2010-07-02 12:39:27 -07:00
Chris Wilson afcd41820d Reduce front buffer stride prior to rejection
If we reject the front buffer because it has too large a stride, repeat
the allocation using untiled for the cases where we can utilize laxer
hardware restrictions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-01 22:10:49 +01:00
Chris Wilson f8778b66a9 drmmode: Add missing newlines at the end of log messages.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-01 21:58:43 +01:00
Chris Wilson 690fbd1a64 drmmode: Use a copy of the converted mode on resize
Avoid a potential use-after-free of the copied mode string by reusing
the converted kernel mode on resize.

==19897== Invalid read of size 8
==19897==    at 0x661C330: ??? (strcpy.S:1308)
==19897==    by 0x8618AE7: drmmode_set_mode_major (drmmode_display.c:293)
==19897==    by 0x8618E6F: drmmode_xf86crtc_resize (drmmode_display.c:1299)
==19897==    by 0x529A77: xf86RandR12ScreenSetSize (xf86RandR12.c:708)
==19897==    by 0x4BD528: ProcRRSetScreenSize (rrscreen.c:301)
==19897==    by 0x42B820: Dispatch (dispatch.c:432)
==19897==    by 0x4254C9: main (main.c:289)
==19897==  Address 0x72e91e0 is 0 bytes inside a block of size 9 free'd
==19897==    at 0x4C23DBC: free (vg_replace_malloc.c:325)
==19897==    by 0x48424F: xf86DeleteMode (xf86Mode.c:1921)
==19897==    by 0x4942B7: xf86ProbeOutputModes (xf86Crtc.c:1572)
==19897==    by 0x5290BB: xf86RandR12GetInfo12 (xf86RandR12.c:1551)
==19897==    by 0x5313AE: RRGetInfo (rrinfo.c:202)
==19897==    by 0x4BCCAA: rrGetScreenResources (rrscreen.c:337)
==19897==    by 0x42B820: Dispatch (dispatch.c:432)
==19897==    by 0x4254C9: main (main.c:289)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-01 21:55:04 +01:00
Chris Wilson 772f8236d5 dri: Handle errors during GetBuffers() gracefully.
Unwind the array of Pixmaps already allocated and report failure for the
old dri GetBuffers() path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-30 13:58:05 +01:00
Chris Wilson 17884af4ed Repair the damage to 'make distcheck' after splitting out i810
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-28 17:44:45 +01:00
Chris Wilson 28c0ca676c Remove unused inclusion of <sys/mman.h>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-25 13:40:22 +01:00
Chris Wilson 2306e675c4 configure: Remove check for unused function, mprotect
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-25 13:32:02 +01:00
Chris Wilson 6695296ca2 configure: Remove unused checks for xext
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-25 13:31:11 +01:00
Chris Wilson 5c663ce844 Rename common infrastructure to the intel namespace.
After splitting out the i810 driver into its own legacy directory, we
can identify the common routines not as i830 but as intel. This
clarifies the code which *is* i830 specific.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-25 13:18:01 +01:00
Chris Wilson 797d173a9a i810: Move into a legacy directory.
The driver is still built but is no longer under active development so
move it and supporting files to a new directory.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-25 13:18:01 +01:00
Chris Wilson cd61531a78 Remove unused configure option: --enable-video-debug
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-25 12:44:25 +01:00
Carl Worth ca16e31336 Update version to 2.12.0
For the imminent 2.12.0 release.
2010-06-24 14:07:15 -07:00
Carl Worth 8caf1564a7 NEWS: Add notes for the 2.12.0 release.
Let it ship!
2010-06-24 14:06:43 -07:00
Chris Wilson b58a6a39c1 uxa: Fallback to pixman if source is out-of-bounds
If the source is outside the drawable, then CopyArea will fail to
initialise the source correctly. The simplest fix in this case is to
fallback to pixman to generate the source texture.

Fixes:

  Bug 28497 - Graphics corruption after opening a specific website
  https://bugs.freedesktop.org/show_bug.cgi?id=28497

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-23 23:56:44 +01:00
Chris Wilson 6d33e578de Limit maximum tiled stride to 8k and untiled to 32k.
Tiling on gen 2/3 hardware is only supported for pitches up to 8192
bytes, so above this limit the surface will be untiled and we will no
longer have to comply with the power-of-two pitch alignment. So
disabling tiling for these too wide surface should ~halve the memory
requirement for the full surface.

Also the absolute limit for the 2D blitter is 32,768 bytes. The
documentation says "up to 32,768 bytes" and my PineView box was
malfunction with a surface stride of 32,768 so set the limit to be
32,767.

References:

  Bug 28497 - Graphics corruption after opening a specific website
  https://bugs.freedesktop.org/show_bug.cgi?id=28497

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-23 21:33:36 +01:00
Chris Wilson 5bf470bd38 i965: Compile fix.
Oops, I spent more time discussing these flushing bugs than I spent
paying attention to what I was actually doing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-21 22:28:58 +01:00
Chris Wilson 0203cf91b5 Do not clear need_mi_flush within the batch.
This is a situation that should not be possible, need_mi_flush being
true but the list of pending flush pixmaps being clear. However, an
earlier bug in doing just that revealed this minor bug. So for
correctness, be careful not to clear need_mi_flush without emitting a
MI_FLUSH.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-21 22:25:08 +01:00
Chris Wilson 5107b6fa26 i965: Mark the render target as dirty within composite_setup()
The key difference between i965 and earlier, is that the surfaces passed
to the samplers through an indirect table and so the batch and render
target was not being marked dirty by the relocation (since the
relocation only happens within prepare_composite() which may have been
in another batch.) Simply call intel_pixmap_mark_dirty() when binding
the sampler table into the batch to ensure that the dirty is tracked
appropriately.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-21 22:21:58 +01:00
Chris Wilson bebd64d821 Also submit any pending flush for *this* batch in the BlockHander.
We still need to submit an additional flush if we have further writes
since the last flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-21 22:05:19 +01:00
Chris Wilson c4d2005177 Only append the pixmap to the flushing list if we are writing to it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-21 21:57:21 +01:00
Chris Wilson c942585098 Emit the flush after a potential draw from the BlockHandler.
As the batch submit may not trigger further drawing through flushing the
vertices, pass the requirement to emit the flush down to the submission
routine so that the flush can be appended after the final commands.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-21 21:45:04 +01:00
Chris Wilson e8783869ad uxa: Apply the source offsets to the pixmap source, not target.
A slight confusion in computing the correction image location resulted
in the application of the source offsets to the pixel location in the
target and not in the source as intended.

Fixes the visual corruption of the scrollbar in Chromium, and hopefully
the crash reported by Robert Hooker when starting gdm after plymouth.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-20 00:10:43 +01:00
Chris Wilson 4b7142baa0 uxa: Enable SHM pixmaps
Now with streaming uploads and downloads for composite operations in
place, shared memory pixmaps are no longer that dire performance wise.
With careful use these can in fact be the most efficient means of
transfer between a wholly software renderer in the client and a backing
store. For instance, Chromium renders internally to an ARGB32 image
buffer and uses a shared pixmap to composite dirty regions into the
backing store. Thereby using the GPU to either perform the blit or the
format conversion. Enabling shared pixmaps, reduces our CPU overhead
whilst scrolling by a factor of 5 or so.

And this is achieved simply by deleting obsolete code!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-19 13:39:48 +01:00
Chris Wilson d748f8e6fc uxa: Use accelerated get_image for copying to !offscreen
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-19 13:39:48 +01:00
Chris Wilson 78ee25f005 uxa: Match depth 30 to format.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-19 13:39:48 +01:00
Chris Wilson af5c4fc96d uxa: Check for allocation failure.
Check for the NULL Picture prior to passing it to the backends for
inspection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-19 13:39:48 +01:00
Chris Wilson be55066c64 i830: Remove domain tracking from pixmaps.
The 4 integers can be reduced to a single boolean value, so do so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-17 14:23:21 +01:00
Chris Wilson c187da9a24 i830: GetImage acceleration.
The presumption is that we wish to keep the target hot, so
copy to a new bo and move that to the CPU in preference to
causing ping-pong of the original.

Also the gpu is much faster at detiling.

Before (PineView):
 400000 trep @   0.1128 msec (  8860.0/sec): GetImage 10x10 square
  18000 trep @   1.3839 msec (   723.0/sec): GetImage 100x100 square
    800 trep @  30.0987 msec (    33.2/sec): GetImage 500x500 square

After: (PineView)
 180000 trep @   0.1478 msec (  6770.0/sec): GetImage 10x10 square
  60000 trep @   0.4545 msec (  2200.0/sec): GetImage 100x100 square
   4000 trep @   8.0739 msec (   124.0/sec): GetImage 500x500 square

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-17 14:08:11 +01:00
Chris Wilson 0e01017584 i830: Tidy i830_uxa_put_image()
Use a single code path to upload the image data after selecting the
right bo, and take advantage of pwrite() when possible.

Fixes:

  Bug 28569 - [i965] IGN's flash-based video player crashes X
  https://bugs.freedesktop.org/show_bug.cgi?id=28569

  Bug 28573 - [i965] Fullscreen flash and windowed SDL games fail to
              update the screen
  https://bugs.freedesktop.org/show_bug.cgi?id=28573

Reported-and-tested-by: Brian Rogers <brian@xyzw.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-17 14:08:11 +01:00
Chris Wilson 2ff7a2fc9d i915: Force the emission of BUF_INFO on every composite_setup
We should be able to eliminate these as the drawable remains unchanged.
However, the implicit flush of BUF_INFO fixes the rendering in KDE.
Alternatively, we need an MI_FLUSH | INHIBIT_RENDER_CACHE_FLUSH between
composites. (Note that it is not stale cache data causing the rendering
corruption and that a pipelined flush is not sufficient either.) Also,
having tried varies points at which to flush, the only place where the
flush is effective seems to be between composite operations - that is a
flush after 2D is not sufficient.

Reported-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-17 14:08:07 +01:00
Chris Wilson a25573d5c4 drmmode: Use the tiled stride for the rotated pixmap.
After d41684d545 we now allocate all framebuffers as tiled bo, and so
we must be careful to use the appropriate stride as returned from the
allocation, instead of assuming that it is just an aligned width.

Fixes:

  Bug 28461 - screen rotation results in corrupted output.
  https://bugs.freedesktop.org/show_bug.cgi?id=28461

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-by: Till Matthiesen <entropy@everymail.net>
2010-06-15 20:30:41 +01:00
Julien Cristau 23ddcf4534 Merge commit '2.11.901' 2010-06-15 17:46:52 +01:00
Chris Wilson 254bcc40fc configure: Bump drm requirement to 2.4.21
We depend upon the recent introduction of drm_intel_bo_is_reusable().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-by: Julien Cristau <jcristau@debian.org>
2010-06-15 10:28:19 +01:00
Carl Worth ffc689767f Update version to 2.11.901
For the 2.12 RC1 snapshot we're making now.
2010-06-14 17:35:20 -07:00
Carl Worth 68c8b3f124 NEWS: Add notes for 2.11.901
This is the 2.12 RC1 snapshot we're making now.
2010-06-14 17:34:38 -07:00
Carl Worth 8899cd03e2 Fix to require libdrm 2.4.19 or newer.
This is necessary for the drm_intel_bo_emit_reloc_fence function which
did not exist in 2.4.16 which is all we were requiring earlier.
2010-06-14 16:26:02 -07:00
Chris Wilson 995a4b2b1d i965: Sanity check ComponentAlpha status in prepare_composite
Fixes:

  Bug 28446 - Garbled Font with Mathematica 7
  https://bugs.freedesktop.org/show_bug.cgi?id=28446

Rewriting the glyphs to render to the destination directly and removing
the more expensive multiple invocations of CompositePicture per picture
was a great performance boost -- except that it needs special handling
in the backend in order to not fallback. Having done so for i915, I
neglected to ensure the sanity checking in i965_prepare_composite() was
sufficient. As it turns out, it was not and so we misrendered CA-glyphs
when rendering directly to the destination. This causes us to fallback
properly, but is a performance regression as we no longer try the 2-pass
magic helper before resorting to s/w. At the moment, I'd rather live
with the temporary regression and fix i965 to do the same magic as i915,
as it critical to fixing the severe performance issues currently
crippling i965, as I believe that this regression only affects the
minority of applications (incorrect, as it turns out, as the glyphs are
overlapping) rendering directly to the destination.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-14 12:14:30 +01:00
Chris Wilson 84d65bace5 Compile fix for alternate list.h from xserver-1.9
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-14 11:31:40 +01:00
Gaetan Nadon 00a54eee8f COPYING: replace stub file with actual Copyright notices.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-06-12 20:24:10 -04:00
Chris Wilson 94217ed5f5 uxa: Always clip glyphs to destination.
Even if there is only a single clip rect, since the clip may be smaller
than the drawing rectangle on the destination we need to actually
compute the clipped glyph rectangle.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-12 18:07:17 +01:00
Chris Wilson 5a0a8a1cf6 i830: Limit disabling acceleration following EIO to !i965
Following a conversation with Owain G. Ainsworth, it was decided that
the second best approach to handling a wedged GPU was to hope that the
kernel could successfully reset it, which currently is only possible for
i965 and later chipsets.

The best approach is of course to prevent such hangs from ever occurring
in the first place.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-10 23:02:34 +01:00
Chris Wilson 3bf4ca2cdc i830: Only emit the disabling GPU error message once.
But emit the warning about rendering corruption every time for the
transient errors like out-of-memory.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-10 23:02:34 +01:00
Chris Wilson 35a12f0290 Fallback implementation for trapezoids for hung GPUs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-10 23:02:31 +01:00
Chris Wilson 8c1a8d2297 Revert "xp:trapezoids"
This reverts commit f429fb9d87.

An experimental patch I forgot was on my main branch as I was bugfixing.
ARGH!
2010-06-09 10:03:29 +01:00
Chris Wilson 994aa1ef57 uxa: Handle all-clipped out case with destination glyphs.
Fixes the crash reported in:

  Bug 28446 - Garbled Font with Mathematica 7
  https://bugs.freedesktop.org/show_bug.cgi?id=28446

pDst=0x3d663c0, src_x=0, src_y=0, xDst=142, yDst=112, nlist=0,
list=0x7fffea026580, glyphs=0x7fffea025d88, extents=0x0)
    at uxa-glyphs.c:809
        dx = 0
        y1 = 101
        x2 = 150
        x1 = 142
        dy = 0
        y2 = 112
        rects = 0x5491000
        this_atlas = 0x2456d00
        mask_y = 128
        glyph = 0x35933a0
        mask_x = 736
        priv = 0x39309e0
        screen = 0x8d2cc0
        uxa_screen = 0x2443eb0
        src_pixmap = 0x37c29e0
        dst_pixmap = 0x45ddbf0
        localSrc = 0x361a450
        glyph_atlas = 0x2456d00
        x = 142
        y = 112
        n = 18
        nrect = -9975128
        box = {x1 = 23152, y1 = -5630, x2 = 32767, y2 = 0}
        __PRETTY_FUNCTION__ = "uxa_glyphs_to_dst"

Though the meat of that bug regarding the incorrect remains unsolved.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-09 09:59:36 +01:00
Chris Wilson f429fb9d87 xp:trapezoids 2010-06-08 19:52:46 +01:00
Chris Wilson 0776a42b70 implicit-flush 2010-06-08 15:00:16 +01:00
Eric Anholt d41684d545 Allocate rotate shadow buffers using the usual framebuffer allocator.
This means we can get tiling on them, which should significantly boost
performance, and also allow for FBC.
2010-06-07 11:18:09 -07:00
Eric Anholt b5c9de10ba Allocate a correctly sized framebuffer when tiling by using libdrm's support.
When I made libdrm stop overallocating so much memory for the purpose
of bo caching, things started scribbling on the bottom of my
frontbuffer (and vice versa, leading to GPU hangs).  We had the usual
mistake of size = tiled_pitch * height instead of size = tiled_pitch *
tile_aligned_height.
2010-06-07 11:15:28 -07:00