Commit Graph

3029 Commits

Author SHA1 Message Date
Evan McClain 75850e824b Add mbp_backlight support.
Acked-by: Julien Cristau <jcristau@debian.org>
2010-07-05 17:08:35 +01: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 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 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 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
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
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 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 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
Chris Wilson e6acbc7632 uxa: Setup acceleration functions prior to the damage layer
We need to install the acceleration functions so that they are wrapped
by the Damage layer. This fixes the corruption under a compositing WM
introduced in commit 8700673157.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-and-tested-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
2010-06-07 18:23:17 +01:00
Chris Wilson 1788b16eb2 i915: Fix typo from previous commit.
A trivial change, I thought, having tested it before rebasing, unworthy
even of a perfunctory compile test. How wrong I was.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-07 15:31:47 +01:00
Chris Wilson d9bc36ae03 i915: Remove screen size limit from video setup.
The i915 textured video routine know how to handle drawing on an output
larger than the 3D pipe, so allow them to do so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-07 15:30:07 +01:00
Chris Wilson 6555ef5fd1 i915: Replace structure passing with macros for shader generation.
gcc is horribly bad at collapsing the constants:

  text     data     bss     dec     hex filename
282336     8720     256  291312   471f0 intel_drv.so.old
269280     8720     256  278256   43ef0 intel_drv.so

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-07 14:23:11 +01:00
Chris Wilson d56ea7a852 Use the direct dixGevPrivate() API when available
This is quicker and smaller than the old indirect function call to
dixLookupPrivate().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-07 00:20:35 +01:00
Chris Wilson 8700673157 Adapt glyphs for changes in devPrivates API
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-07 00:17:32 +01:00
Keith Packard 42ddc39430 Adapt to DevPrivate API changes
This allows the driver to be built against either the old or new
DevPrivate API.

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-06 16:00:12 -07:00
Eric Anholt 2c1fda08e8 Use libc instead of deprecated libc wrappers for malloc/calloc/free. 2010-06-06 15:56:35 -07:00
Chris Wilson 6db1e5231b dri: Protect against NULL dereference following GPU hang.
References:

  Bug 28361 - "glresize" causes server segfault with single buffering.
  https://bugs.freedesktop.org/show_bug.cgi?id=28361

[ 14528.767] (EE) intel(0): Failed to submit batch buffer, expect rendering corruption or even a frozen display: Input/output error.
[ 14528.767] (EE) intel(0): Disabling acceleration.
[ 14528.788] Backtrace:
[ 14528.858] 0: /usr/bin/X (xorg_backtrace+0x28) [0x491818]
[ 14528.858] 1: /usr/bin/X (0x400000+0x65ca9) [0x465ca9]
[ 14528.858] 2: /lib/libpthread.so.0 (0x7f9df2dc9000+0xedf0) [0x7f9df2dd7df0]
[ 14528.858] 3: /usr/local/lib/libdrm_intel.so.1 (drm_intel_bo_flink+0x0) [0x7f9defd60c60]
[ 14528.858] 4: /usr/local/lib/xorg/modules/drivers/intel_drv.so (0x7f9deff6a000+0x2fdfd) [0x7f9deff99dfd]
[ 14528.858] 5: /usr/lib/xorg/modules/extensions/libdri2.so (0x7f9df01b8000+0x19e7) [0x7f9df01b99e7]
[ 14528.858] 6: /usr/lib/xorg/modules/extensions/libdri2.so (0x7f9df01b8000+0x1fdb) [0x7f9df01b9fdb]
[ 14528.858] 7: /usr/lib/xorg/modules/extensions/libdri2.so (DRI2GetBuffersWithFormat+0x10) [0x7f9df01ba250]
[ 14528.858] 8: /usr/lib/xorg/modules/extensions/libdri2.so (0x7f9df01b8000+0x3834) [0x7f9df01bb834]
[ 14528.858] 9: /usr/bin/X (0x400000+0x2fc2c) [0x42fc2c]
[ 14528.858] 10: /usr/bin/X (0x400000+0x24da5) [0x424da5]
[ 14528.858] 11: /lib/libc.so.6 (__libc_start_main+0xe6) [0x7f9df1d60a26]
[ 14528.858] 12: /usr/bin/X (0x400000+0x24959) [0x424959]
[ 14528.858] Segmentation fault at address 0x20
[ 14528.858] Fatal server error:
[ 14528.858] Caught signal 11 (Segmentation fault). Server aborting

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-02 20:43:49 +01:00
Chris Wilson 2989f51caf i830: Remove unused coord-adjust.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-01 23:15:02 +01:00
Chris Wilson dc402334f4 i915: Centre sampling.
Use centre sampling of textures to match pixman, and remove numerous
off-by-one and visual artefacts when rendering. The classic example for
this is cairo/text/xcomposite-projection where the edge of the rotated
rectangle is jaggy due to the incorrect sample position.

Fixes:

  Bug 16917  - [i915] Blur on y-axis also when only x-axis is scaled
               billiear
  https://bugs.freedesktop.org/show_bug.cgi?id=16917

And about 15 tests from the Cairo test suite.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-01 23:15:02 +01:00
Chris Wilson f74b3f82ba i915; Avoid the implicit flush on changing BUF_INFO
3DSTATE_BUF_INFO is an implicit flush of the piepline, so avoid emitting
that and associated state unless the destination pixmap has actually
changed. This is a win of around 3-5% for cairo-perf-trace, notably for
firefox.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-01 23:15:02 +01:00
Jesse Barnes f227240203 DRI2: fix new buffer exchange check
Chris's new buffer exchange check is a good one, but we don't want to
hit the immediate blit fallback path if it fails.  We still want to
schedule a blit for sometime in the future, and we need to use it
wherever an exchange might occur (like the secondary flip check or the
currently disabled CanExchange check).

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=28252.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-06-01 13:46:15 -07:00
Chris Wilson cd38b705be Disable acceleration if we detect a hardware error.
This is wildly optimistic, but it should work in a surprising number of
error situations and some output in those cases will be hopefully be
better than none...

If we submit a batchbuffer and the kernel reports the GPU is hung (which
will be caused by an earlier execbuffer, and so the kernel should have
had enough time to determine whether or not it could reset the GPU) then
disable any further attempt to accelerate gfx and force fallbacks to map
the buffers and use the CPU. We cannot normally map any more buffers if
the GPU is hung, so only those already mapped prior to the hang can be
written to, or those allocated in system memory. However, we can expect
that the framebuffer is already mapped, and so have a reasonable
expectation to continue to see the display update.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-31 18:00:11 +01:00
Chris Wilson 5fff430046 uxa: Mega-Glyphs!
Rewrite glyph rendering to avoid the intermediate buffer, accumulating
the glyph rectangles directly in the backend composite routines. And
modify the glyph cache routines to fully utilise the allocated size of
the tiled buffer on older hardware. To do this we alias all glyph sizes
into the same texture using a technique suggested by Keith Packard.

PineView:
  885/856-> 1150/1110 kglyph/s (aa/rgb)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-31 14:03:42 +01:00
Chris Wilson d31abccd41 i915: Support textured video on an extended desktop.
Handle rendering textured video onto an extended desktop (>2048) by
using a temporary pixmap. Note that we still cannot handle rendering to
a greater than 2048 destination region, for that we will need to tile.
Hmm, time to request a 2560x1600, 10bpc monitor...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-31 12:23:29 +01:00
Chris Wilson 2cfd5bc134 dri: Compilation fix.
17:53 < arekm> ickle: i830_dri.c:630:28: error: ‘DrawableRec’ has no member named ‘bpp’
17:53 < arekm> ickle: i830_dri.c:630:57: error: ‘DrawableRec’ has no member named ‘bpp’

* sigh. I need to fix this machine to have the right version of the
* headers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-29 17:55:19 +01:00
Chris Wilson e2615cdeef dri: Only flip if the front and back pixmaps match.
An unredirected window (thanks Michel for the reminder) is backed by the
Screen pixmap, and so uses a reference of that as its front buffer. The
back buffer is a pixmap appropriately sized for the drawable. When the
application requests to swap its buffers, obviously we cannot simply
exchange the front and back buffer as they do not match, but need to copy
the appropriate region from the back to the front.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-29 16:40:06 +01:00
Chris Wilson 8b2039187f Revert "dri: Use size from backing pixmap when creating buffers."
This reverts commit 44d45d3fa5.

Michel Dänzer pointed out the flaw in using the pixmap size instead of
the drawable size:

  Using the backing pixmap dimensions for this is not desirable. In
  particular, it means that the DRI2 buffers of non-redirected windows
  always have the same size as the screen. But even for redirected windows
  it wastes some graphics memory with a re-parenting window manager, that
  is if it doesn't break in various ways due to the top left corner of the
  DRI2 buffers no longer corresponding to the top left corner of the window.
2010-05-29 12:14:55 +01:00
Chris Wilson 44d45d3fa5 dri: Use size from backing pixmap when creating buffers.
This avoid using the garbage values stored in the Screen drawable,
instead of the true values which are only maintained in its backing
pixmap. The consequence of using the wrong size was to hand a 1x1
pixmap to metacity/mutter and have it believe it was a full screen
drawable; GPU hangs ensued if using page flipping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-29 10:39:28 +01:00
Chris Wilson 90c74a4314 i915: Don't re-emit vertex size unless it has changed.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-28 21:50:04 +01:00
Chris Wilson 73111cf2a2 Decouple non-reusuable pixmaps from batch lists on unref.
==7596== Invalid write of size 4
==7596==    at 0x491ACA8: intel_batch_teardown (i830_batchbuffer.c:118)
==7596==    by 0x491C9D6: I830CloseScreen (i830_driver.c:1419)
==7596==    by 0x8103A9C: RRCloseScreen (randr.c:105)
==7596==    by 0x80DE794: xf86CrtcCloseScreen (xf86Crtc.c:759)
==7596==    by 0x80BEBA3: DGACloseScreen (xf86DGA.c:268)
==7596==    by 0x80D044B: DPMSClose (xf86DPMS.c:134)
==7596==    by 0x488B050: XvCloseScreen (xvmain.c:320)
==7596==    by 0x81841B1: VidModeClose (xf86VidMode.c:110)
==7596==    by 0x80EB12F: CursorCloseScreen (cursor.c:191)
==7596==    by 0x810CA17: AnimCurCloseScreen (animcur.c:108)
==7596==    by 0x816937E: compCloseScreen (compinit.c:86)
==7596==    by 0x48D39B9: glxCloseScreen (glxscreens.c:221)
==7596==  Address 0x49c1a50 is 24 bytes inside a block of size 52 free'd
==7596==    at 0x4024866: free (vg_replace_malloc.c:325)
==7596==    by 0x80B023C: Xfree (utils.c:1096)
==7596==    by 0x4927CFD: i830_set_pixmap_bo (i830_uxa.c:647)
==7596==    by 0x491C9B4: I830CloseScreen (i830_driver.c:1413)
==7596==    by 0x8103A9C: RRCloseScreen (randr.c:105)
==7596==    by 0x80DE794: xf86CrtcCloseScreen (xf86Crtc.c:759)
==7596==    by 0x80BEBA3: DGACloseScreen (xf86DGA.c:268)
==7596==    by 0x80D044B: DPMSClose (xf86DPMS.c:134)
==7596==    by 0x488B050: XvCloseScreen (xvmain.c:320)
==7596==    by 0x81841B1: VidModeClose (xf86VidMode.c:110)
==7596==    by 0x80EB12F: CursorCloseScreen (cursor.c:191)
==7596==    by 0x810CA17: AnimCurCloseScreen (animcur.c:108)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26 21:07:46 +01:00
Chris Wilson a6fb6aa5f9 Add vertex bo to the list of buffers to be torn down.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26 20:31:45 +01:00
Chris Wilson 5dce69002d i965: Remove ATOMIC_BATCH.
This paranoid check is deceased; pining for the fjords.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26 20:27:29 +01:00
Eric Anholt 06ebb55d30 Add a workaround for Ironlake errata relating to disabling the clipper. 2010-05-26 12:21:09 -07:00
Eric Anholt 158a158dad Add a workaround for Ironlake errata regarding blits and other engines. 2010-05-26 12:21:09 -07:00
Eric Anholt 3461f8f4bc Remove remaining REG_DUMPER build stuff. 2010-05-26 12:21:09 -07:00
Chris Wilson 309bd3a299 i830: Skip an empty fill.
In the extremely unlikely event that the higher layer erroneous gave us
an empty fill, skip it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26 10:21:03 +01:00
Chris Wilson ea07535240 i915: Emit CA over using OutReverse + Add passes
On PineView:
  578/621 -> 610/617 kglyphs/sec [rgb/aa]
2010-05-24 18:31:16 +01:00
Chris Wilson 80a9e64f50 uxa: Use temporary dest when target is too large for compositor
If the destination cannot fit into the 3D pipeline when we need to
composite, we fallback to doing the operation on the CPU. This is very
slow, and quite easy to trigger on i915 by plugging in an external
display.

An alternative is to extract the extents of the operation from the
destination using the blitter which can usually handle much larger
operations. This gives us a temporary target that can fit into the 3D
pipeline and thus be accelerated, before copying back into the larger
real destination.

For x11perf this boosts glyph rendering on PineView, from 38kglyphs/s to
480kglyphs/s. Just a little shy of the native performance of 601kglyphs/s

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24 18:31:16 +01:00
Chris Wilson e3ece83f57 i915: compute normalized texcoords using a scale factor.
500 -> 580kglyphs/s on i945.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24 09:42:18 +01:00
Chris Wilson 2adf823b80 i915: Add special case primitive emitters for glyphs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24 09:40:26 +01:00
Chris Wilson f64ab9e0d9 i915: Move vertices into a vertex buffer object.
In theory this should allow us to pack far more operations into a single
batch buffer, and reduce our overheads.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24 09:36:23 +01:00
Chris Wilson 2b050f330f Use pwrite to upload the batch buffer
By using pwrite() instead of dri_bo_map() we can write to the batch buffer
through the GTT and not be forced to map it back into the CPU domain and
out again, eliminating a double clflush.

Measing x11perf text performance on PineView:

Before:
16000000 trep @   0.0020 msec (511000.0/sec): Char in 80-char aa line (Charter 10)
16000000 trep @   0.0021 msec (480000.0/sec): Char in 80-char rgb line (Charter 10)
After:
16000000 trep @   0.0019 msec (532000.0/sec): Char in 80-char aa line (Charter 10)
16000000 trep @   0.0020 msec (496000.0/sec): Char in 80-char rgb line (Charter 10)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24 09:33:37 +01:00
Chris Wilson dcef703a7c Kill paranoid assertions on every write into the batchbuffer.
On my PineView box these represent ~5% overhead on x11perf text:

Before:
16000000 trep @   0.0020 msec (495000.0/sec): Char in 80-char aa line (Charter 10)
12000000 trep @   0.0022 msec (461000.0/sec): Char in 80-char rgb line (Charter 10)

After:
16000000 trep @   0.0020 msec (511000.0/sec): Char in 80-char aa line (Charter 10)
16000000 trep @   0.0021 msec (480000.0/sec): Char in 80-char rgb line (Charter 10)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24 09:33:35 +01:00
Chris Wilson bc41f84e01 i915: Emit composite primitive with specialised functions.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24 09:32:30 +01:00
Chris Wilson 4a3476ea09 i915: amalgamate composite into a single primitive list
Combine all the calls to composite between prepare_composite and
done_composite into a single primitive list, rather than a primitive
call per composite().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-23 18:52:15 +01:00
Kristian Høgsberg 509df27c74 dri: Clean up DRI2 API #ifdefs a bit
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-05-18 10:01:52 -04:00
Chris Wilson 5e04a81369 i830: Remove vestigal debugging ALWAYS_FLUSH and ALWAYS_SYNC
These are now debugging options exposed in Xorg.conf, and now unused int
the source code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-17 15:16:25 +01:00
Chris Wilson 723cc45b27 dri: Check error code from GetScratchGC()
It may fail so be prepared, and do use the right drawable!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-17 15:14:55 +01:00
Chris Wilson 2c69709d8a i830: Encode surface bpp into format
References:

  Bug 28135 - [855GM] Slowdown/High CPU-Usage after Git-Commit
              926fbc7d90
  https://bugs.freedesktop.org/show_bug.cgi?id=28135

The simple answer is that I had assumed that 0 was a reserved value.
However, without the bbp encoded into the format 0 was used for a8r8g8b8
and r5g6b5, which are very common formats!

The other possibility for the slowdown is that gtkperf is using of the
now verboten xrgb formats -- but would in fact be valid if the source
covers the clip and we could fixup the alpha value in the fixed function
combine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-16 18:41:52 +01:00
Chris Wilson 9c3da71349 i830: Remove xrgb conversion to argb, no longer required.
All textures are now properly declared so that the alpha swizzling
occurs in the sampler or not at all. The downside is that for quite a
few composite operations we have to fallback to software on older
hardware. There is scope for more performing the alpha expansion in
shaders or combiners when we know the picture covers the clip - which is
almost all of the time for normal operations especially those
constructed by Cairo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-15 01:09:26 +01:00
Chris Wilson 926fbc7d90 i830: Remove incorrectly mapped tex formats.
We no longer workaround the lack of alpha expansion for xrgb textures as
this interferes with EXTEND_NONE, though we could if we know the source
covers the clip...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-15 01:09:13 +01:00
Chris Wilson 213816c30b i915: Load texture into directly into OC when possible.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-15 00:48:19 +01:00
Chris Wilson 271240fd47 i915: Remove a couple of unsupported 16bpp no-alpha tex formats
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-14 23:56:05 +01:00
Chris Wilson f7bbcc492a Split the prepare blitter functions into check + prepare.
Allow us to check whether we can handle the operation using the blitter
prior to doing any work.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-14 23:31:57 +01:00
Chris Wilson 4be8d7eb89 i915: Don't force alpha=1 for RGB drawables in the shader.
I was blindly fixing rendercheck without thinking. We need to force the
alpha value to be in the blend unit and not before -- otherwise we
generate the incorrect result whilst blending. D'oh.
2010-05-14 21:16:51 +01:00
Chris Wilson a21297d7cc drm: Remove pin(); unpin() sync
GEM handles serialisation of the new front buffer with respect to page
flipping and rendering and reports back when the flip is complete.
Adding a sync point here is then redundant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-14 17:52:22 +01:00
Chris Wilson 7ee73d2c6f drm: Remove unused old_front parameter from drmmode_do_pageflip.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-14 17:51:40 +01:00
Chris Wilson 030d56279b drm: don't overwrite the old intel->front_buffer
It's now handled in the common ExchangeBuffers() path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-14 17:30:23 +01:00
Chris Wilson 5bd0227395 i830: Teardown batch entries on reset.
By not cleaning up the batch entries when resetting the X server, we left
the pointers in an inconsistent state and caused X to crash.
2010-05-14 15:50:05 +01:00
Chris Wilson 0d2392d44a dri: Hold reference to buffers across swap
As we schedule swaps for some time in the future and may process a
detachment prior to receiving the vblank notification from the kernel,
we need to hold a reference to the buffers for our swap event handler.

Fixes:
  Bug 28080 - "glresize" causes X server segfault with indirect rendering.
  https://bugs.freedesktop.org/show_bug.cgi?id=28080

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-14 10:32:12 +01:00
Chris Wilson 25811dc7b7 i915: Force output alpha to 1. if dst has no alpha channel.
Ensure that garbage is not stored in the unused alpha channel so that
we can rely on it being currently initialiased when used as a source or
returning via GetImage.

Partial fix for rendercheck -t blend
2010-05-13 17:17:10 +01:00
Chris Wilson 0e726b85ca i915: Add a2r10g10b10 format and friends
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-13 09:40:27 +01:00
Chris Wilson 9f54107f86 dri2: Handle reference counting across page flipping
1. Instead of swapping bos, swap the entire private structure.

2. If we update the pixmap bo for the Screen, make sure we update the
reference inside intel->front_buffer so that xrandr still functions.

Fixes:

  Bug 27922 - i965: Rapidly resizing OpenGL window causes GPU to hang.
  https://bugs.freedesktop.org/show_bug.cgi?id=27922

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-12 21:37:49 +01:00
Chris Wilson 0c6372a77f i830: Prevent allocation of bo larger than half the aperture
We need to prevent overcommitting the aperture, and in particular if we
allocate a buffer larger than available space we will fail to mmap it in
and rendering will fail. Trying to allocate multiple large buffers in
the aperture, often the case when falling back, causes thrashes and
eviction of useful buffers. So from the outset simply do not allocate a
bo if the the required size is more than half the available aperture
space.

Fixes allocation failure in ocitymap.trace for instance.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-12 12:50:31 +01:00
Chris Wilson 6ea8ce640f xvmc: Build fix with -pedantic
Fixes:

  Bug 27352 - RPMLINT error causes build breakage
  https://bugs.freedesktop.org/show_bug.cgi?id=27352

Reported-by: Johannes Obermayr <johannesobermayr@gmx.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-11 19:39:01 +01:00
Chris Wilson e1b7e8bf1d drmmode: Reorder i830_set_pixmap_bo() so that the correct stride is used.
The pitch needs to be set on the pixmap prior to the private
intel_pixmap structure being created so that it can record the correct
value from the pixmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-11 15:54:18 +01:00
Chris Wilson dfbaf9aab8 i830: Never create a bo for depth=1 pixmaps.
As we can not accelerate these either as a destination or a source,
don't bother allocating a buffer object for them.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-11 15:01:00 +01:00
Chris Wilson 5b7efe375a i830: Use set_pixmap_bo() instead of open-coding.
The advantage is that this enables in-flight reuse of the old pixmap if
possible.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-11 15:00:59 +01:00
Chris Wilson ad8af95dd3 i830: Do not cache in-flight non-reusable buffers.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-11 15:00:59 +01:00
Chris Wilson f1048e14d5 i965: Add texformats mapping for additional pixman formats
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-11 13:07:19 +01:00
Keith Packard d745cab6c4 Must call ValidateGC in i830_uxa_put_image for scratch GC
Always need to call ValidateGC or the scratch GC will not get the
right composite clip.

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-10 22:59:52 -07:00
Chris Wilson 3eded4202e i915: Fix pixmap based masks.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-10 23:38:17 +01:00
Chris Wilson a8761585ef i830: Minor cleanup
Remove some extraneous prototypes and unused variables.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-10 19:38:24 +01:00
Chris Wilson 9e9b0d85da i830: Update stride when swapping bo for PutImage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-10 18:37:26 +01:00
Chris Wilson 0d4dd00aea uxa,i915: Handle SourcePict through uxa_composite()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-10 12:29:26 +01:00
Chris Wilson 21c1c3c7f6 i915: Use 1x1R pixmap for solid drawables
x11perf has a regression
  https://bugs.freedesktop.org/show_bug.cgi?id=25068

caused by

  commit e581ceb738
  i915: Use the color channels to pass along solid sources and masks.

Do not convert 1x1R pixmaps into a solid color as the readback from the
bo negates all the performances advantages of using a smaller vertex
buffer and fewer samplers.

Before (PineView):
  aa=66800 glyph/s, rgb=28800 glyphs/s

Now:
  aa=96800 glyphs/s, rgb=48500 glyphs/s

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-10 10:36:15 +01:00
Chris Wilson f52b6e8322 uxa: Rearrange checking and preparing of composite textures.
x11perf regression caused by 2D driver
  https://bugs.freedesktop.org/show_bug.cgi?id=28047

caused by

  commit a7b800513f
  uxa: Extract sub-region from in-memory buffers.

The issue is that as we extract the region prior to checking whether the
composite can in fact be accelerated, we perform expensive surplus
operations. This is particularly noticeable for ComponentAlpha text,
such as rgb10text. The solution here is to rearrange the
check_composite() prior to acquiring the sources, and only extracting
the subregion if the render path can not actually handle the texture.

Performance (on PineView):
a7b800513^: aa=68600 glyphs/s, rgb=29900 glyphs/s
a7b800513: aa=65700 glyphs/s, rgb=13200 glyphs/s
now: aa=66800 glyph/s, rgb=28800 glyphs/s

The residual lossage seems to be from the extra function call and
dixPrivate lookups. Hmm. More warning is the extremely low performance,
however the results are consistent so the improvement looks real...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-10 10:36:14 +01:00
Chris Wilson 8562b7bc67 i830: prepare the uxa pixmap for fbCopyArea.
Complete the prepare access for the PutImage fallback via fbCopyArea(),
by remembering to set the private pointer to the GTT mapping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-04-27 10:29:16 +01:00
Chris Wilson 9a5cd65b59 i830: if pixman_blt() fails fallback to fbCopyArea()
On older versions of pixman, pixman_blt() can return false if the images
are <= 8bpp. If we are being called from CopyArea, then we cannot return
FALSE here as that will trigger an infinite recursion. Instead we must
manually perform the fallback using fbCopyArea().

Reported-by: Peter Clifton <pcjc2@cam.ac.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-04-26 09:14:17 +01:00
Chris Wilson 86d349aa7b i830: tidy in flight bo reuse.
A left-over cleanup patch for c374c94. *sigh*

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-04-26 09:13:54 +01:00
Daniel Vetter 72fd7d191c Fix "make dist"
This is some fallout from my xvmc cleanup.

Original-Patch-by: Rico Tzschichholz <ricotz@t-online.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-19 21:56:57 +02:00
Daniel Vetter 9494f4e91f i810: adjust the pitch for DRI rendering
Current code forgot to adjust the pitch of the frontbuffer.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=16729
2010-04-16 22:24:01 +02:00
Chris Wilson c374c94e41 uxa: Reuse in-flight bo
When we need to allocate a new bo for use as a gpu target, first check
if we can reuse a pixmap that has already been relocated into the
aperture as a temporary target, for instance a glyph mask or a clip mask.

Before:
backend                      test   min(s) median(s) stddev.
xlib         firefox-planet-gnome   50.568   50.873   0.30%
 xcb         firefox-planet-gnome   49.686   53.003   3.92%
xlib                    evolution   40.115   40.131   0.86%
 xcb                    evolution   28.241   28.285   0.18%

After:
backend                      test   min(s) median(s) stddev.
xlib         firefox-planet-gnome   47.759   48.233   0.80%
 xcb         firefox-planet-gnome   48.611   48.657   0.87%
xlib                    evolution   38.954   38.991   0.05%
 xcb                    evolution   26.561   26.654   0.19%

And even more dramatic improvements when using a font size larger than
the maximum size of the glyph cache:
 xcb firefox-36-20090611:  1.79x speedup
xlib firefox-36-20090611:  1.74x speedup
 xcb firefox-36-20090609:  1.62x speedup
xlib firefox-36-20090609:  1.59x speedup

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-04-15 21:37:32 +01:00
Chris Wilson 96aa7a236a i830: Allocate bo's for glyphs larger than 32x32.
As we only use the glyph cache for small glyphs, those large than 32x32
will first be copied to a bo and used as a mask in a composite
operation. We can avoid the allocation and upload per use by allocating
a bo for the over-sized glyph from the start. As the glyph is large
anyway, the excess memory allocation is less significant.

Using normal font sizes, firefox shows no change - as expected. However,
using the 36 font size traces, we see around a 10% improvement on g45.

Before:
      xcb          firefox-36-20090609  127.333  127.897   0.22%
      xcb          firefox-36-20090611   87.456   88.624   0.66%
      xcb             firefox-20090601   19.522   20.194   1.69%
     xlib          firefox-36-20090609  201.054  201.780   0.18%
     xlib          firefox-36-20090611  133.468  133.717   0.09%
     xlib             firefox-20090601   23.740   23.975   0.49%

With large glyphs in bo:
      xcb          firefox-36-20090609  117.256  118.254   0.42%
      xcb          firefox-36-20090611   79.462   79.962   0.31%
      xcb             firefox-20090601   19.658   20.024   0.92%
     xlib          firefox-36-20090609  185.645  188.202   0.68%
     xlib          firefox-36-20090611  123.592  124.940   0.54%
     xlib             firefox-20090601   23.917   24.098   0.38%

Thanks to Owain G. Ainsworth for the suggestion!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-04-14 17:10:09 +01:00
Chris Wilson 1cc2c2c44a i830: Use pixman_blt directly for performing the in-memory copy
In order to avoid an infinite recursion after enabling CopyArea to use
the put_image acceleration to either stream a blit or to copy in-place,
we cannot call CopyArea from put_image for the fallback path. Instead,
we can simply call pixman_blt directly, which coincidentally is a tiny
bit faster.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-04-14 17:10:05 +01:00
Daniel Vetter 324a2810da i830 render: check aperture space requirements
No point not doing this.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-13 08:39:43 +02:00
Daniel Vetter 804263c10d render: tell the kernel explicitly when fences are needed
This slighlty improves xrender performance on fence reg starved
i8xx hw.

I've also changed a few function calls to the new names from the
compat ones while looking at the code.

The i915 textured video path is not converted because atm the xv
code does not use tiled surfaces.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-13 08:34:20 +02:00
Daniel Vetter a619a78312 i915 render: use tiling bits where possible
This is in preparation to explicit fence allocation with execbuf2.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-13 08:34:20 +02:00
Daniel Vetter 55cd36046e i830 render: use tiling bits where possible
This is in preparation to explicit fence allocation with execbuf2.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-13 08:34:20 +02:00
Chris Wilson 385563417d Review i830_pad_drawable_width()
We appear to have a confusion of stride in terms of pixels, pitch in
terms of bytes and the actual width of the surface.
i830_pad_drawable_width() appears to be operating aligning *pixels* to a
64 pixel boundary and has never used the chars-per-pixel causing
considerable confusion in its callers. Remove the parameter and ensure
that the callers are expecting a value in pixels returned, multiplying
by cpp where necessary to get the pitch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-04-10 18:08:07 +01:00
Daniel Vetter 80f52482c7 XvMC: fix memory overflow
Caught by a malloc library assert.

Note to self: Don't just copy&paste codelines around :(

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27540
Tested-by: Nick Bowler <nbowler@draconx.ca>
Tested-by: Calvin Walton <calvin.walton@gmail.com>
2010-04-08 22:35:10 +02:00
Daniel Vetter 3d7723526b Xv: fixup overlay stride confusion
For some reason I've made a mess out of the overlay stride constrains.
Fix it up.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Calvin Walton <calvin.walton@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27453
2010-04-08 22:21:01 +02:00
Daniel Vetter bdf0ee509c i965 Xv: fix chroma pitch
In my recent fix for the chroma pitch for i915 xvmc I've forgotten about
i965 class hw. For videos with a non-even sized stride (measured in dwords)
the chroma pitch was internally incosistent and one dword off.

Fix this by using pitch2 for the chroma pitch in i965 textured video like
everywhere else.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27417
Tested-by: Nick Bowler <nbowler@draconx.ca>
Tested-by: Sven Arvidsson <sa@whiz.se>
2010-04-08 17:21:18 +02:00
Daniel Vetter f6cb28e909 libXvMC: rip out debug stuff
Almost totatlly unused, but surely totally useless.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:24 +02:00
Daniel Vetter 676028ec0c libXvMC: unify CreateSurface
Simply store the desired bo size in intel_xvmc_context and initialize
it in the driver's create_context function.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:24 +02:00
Daniel Vetter 3f590a4577 libXvMC i915: kill unused context private fields
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:24 +02:00
Daniel Vetter 8a31dacb06 libXvMC: derive driver context from struct intel_xvmc_context
... by putting struct intel_xvmc_surface at the beginning. Also kill
the common context handling code and simply keep a pointer in the
surface private to the context.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:24 +02:00
Daniel Vetter 16e5edde4d libXvMC: unify DestroySurface
Surface bo's can be freed by the common code, then there's nothing
driver specific left.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:24 +02:00
Daniel Vetter 5f64122551 libXvMC: drop get_surface_status driver callback
It's unused. Also drop all related generic code that tries to do
clever stuff with this callback. These are all remnants from a
pre-gem world.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:23 +02:00
Daniel Vetter 6c44ce9e12 libXvMC i915: s/i915XvMCSurface/struct intel_xvmc_surface/
The private surface struct now adds nothing. Drop it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:23 +02:00
Daniel Vetter 583ec1f2f7 libXvMC i915: rip out unneeded surface fields
All of these are also stored in the context. Also kill the context
reference counting. Doesn't serve a purpose besides occupying a
pointer to the context in the private surface struct.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:23 +02:00
Daniel Vetter c9aaaed829 libXvMC: unify PutSurface
Now that the drm bo is in the common structure, do the PutImage
handling in common code, too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:23 +02:00
Daniel Vetter 4edff6c972 libXvMC: move drm_intel_bo to common intel_xvmc_surface
i965 lost the last field in it's private surface struct. Kill it
and any associated headers.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:23 +02:00
Daniel Vetter 9eeabf876d libXvMC: derive driver surfaces from struct intel_xvmc_surface
... by putting struct intel_xvmc_surface at the beginning. This
will allow to consolidate surface and bo handling.

Also kill some now dead code used to handle the common surface
structure.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:23 +02:00
Daniel Vetter a0058369bb XvMC: kill intel_xvmc_command
We only passed around and actually used the gem handle. Don't
need a struct for one field alone ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:23 +02:00
Daniel Vetter 79fe4caafd XvMC: dynamically allocate adaptor
And kill all the static structures. This way it's clearer what's
common and what's specific. And the code is shorter too.

Also clean up src/i830_hwmc.c - kill the nonstandard surface types
for i915 and the associated code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:23 +02:00
Daniel Vetter 00b63ecb19 XvMC: directly set driver type in context creation
Instead of threading it through a global variable.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:23 +02:00
Daniel Vetter 411cdcb6fc XvMC: init driver in one function call
No point splitting this up. Gets rid of two #ifdef INTEL_XVMC blocks
in i830_video.c.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:22 +02:00
Daniel Vetter b666e3e29f XvMC: move i965 specific stuff to common context
Like for the i915. With this create_context is now also shared.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:22 +02:00
Daniel Vetter e0068b1e63 XvMC: move i915 specific stuff to common context
Doing the same with the i965 code will allow us to share the
create_context function.

src/i915_hwmc.h is now almost empty. Move the last #defines to
src/xvmv/i915_xvmc.c where they are actually used and delete the
file.

Also rename the ddx context struct to something sane.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:17 +02:00
Daniel Vetter 8cab7b84da XvMC: unify destroy context function
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:17 +02:00
Daniel Vetter 323464b8e2 XvMC: clean up i830_hwmc.c
- Drop unnecessary macros
- Denote i965 specific stuff

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:17 +02:00
Daniel Vetter cfa907adf8 XvMC: unify surface functions
Like for the subpicture stuff, share the "do-nothing" functions ...
And fix function name spelling, too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:17 +02:00
Daniel Vetter 036cd4bb82 i965 XvMC: don't create any surface state in the ddx
Like for i915. Also drop that now totally superflous limit on the
available surfaces.

Move the surface struct into the userspace library header now that
the ddx doesn't use it anymore.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:17 +02:00
Daniel Vetter 69218cc1b5 XvMC: unify subpicture functions
The XvMC driver api in the server is insane. Even for optional stuff
like subpicture support it doesn't check for NULL-pointers. So we
have to retain some dummy functions.

Wonder how many copies of these things exist on fdo ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:17 +02:00
Daniel Vetter 5d104e9c5c XvMC: unify PutImage handling
Both xvmc are handing in the bo in the exact same way. So move the code
to src/i830_video.c and kill this great oeuvre of spaghetti-code.

The xvmc driver ini and fini also lost their last use, kill them, too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:16 +02:00
Daniel Vetter ebc0ffba79 XvMC: merge *_hwmc.c into i830_hwmc.c
After unifying i915 and i965, not much will be left of these files.
Therefore merge them to make the following changes easier.

This creates some warnings about some redefined macros, but when this
is all cleaned up they'll all be gone.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:22:16 +02:00
Daniel Vetter 8199f8f191 i915 XvMC: kill more subpict support remnants
This things just won't die!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-04-08 11:21:08 +02:00
Daniel Vetter 29ba8a84f7 XvMC: everyone's using execbuffer!
XvMC was switched over from batchbuffers a few years ago ...

Signed-off-by: Daniel Vetter <daniel@fliege.ffwll.ch>
2010-04-08 11:13:44 +02:00
Jesse Barnes df3b268479 DRI2: release our private front buffer ref when buffer swapping
Pauli pointed out that we take a ref on the front buffer when exchanging
but forget to release it.  The ref is necessary since the set functions
will drop refs as necessary, but once we set the front buffer to point
at the back pixmap, we ned to release our private ref again, or we'll
leak buffers.

Reported-by: Pauli Nieminen <suokkos@gmail.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-26 10:46:43 -07:00
Chris Wilson 0d1ac4da52 uxa: Perform the xrgb -> argb conversion not inplace
After reports of segmentation faults caused by
d6b7f96fde and vmware, the most obvious
cause would be illegally writing to the src data when performing the alpha
fill inline. So force the image upload to go via a fresh buffer whenever
we need to modify the incoming data.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-and-tested-by: Jeff Chua <jeff.chua.linux@gmail.com>
2010-03-25 13:33:55 +00:00
Chris Wilson 0c47195ca8 i830: Clip solid fills to surface.
There is a reasonable surfeit of evidence to support this error,
for instance: http://bugs.freedesktop.org/attachment.cgi?id=34417

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-24 17:37:39 +00:00
Chris Wilson 2eec53d0b9 uxa: Default to using TILING_X for pixmaps.
On memory constrained hardware, tiling is vital for good performance as
it minimizes cache misses.  The downside is that for older hardware
(which often suffers from the lack of bandwidth) requires the use of
fences for many operations, which are in short supply and so may cause
shorter batchbuffers. However our batch buffers are typically short and
so this is unlikely to be a concern and not affect the performance wins.

A quick bit of testing suggests the effect is inconclusive on
firefox/i945:
                  linear            tiled
  xcb             205.470           206.219
  xcb-render-0.0  404.704           388.413
  xlib            166.410           170.805

A secondary effect of the patch is to workaround a G31 specific hang
when attempting to use linear 2048x2048 surfaces. Bonus!

Fixes:
  Bug 25375 - Performance issue using texture from pixmap (tfp) glx extension on 945
  http://bugs.freedesktop.org/show_bug.cgi?id=25375

  Bug 27100 - GPU Hung copying a 2048x1152 pixmap
  http://bugs.freedesktop.org/show_bug.cgi?id=27100

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: John <jvinla@gmail.com>
2010-03-24 16:37:41 +00:00
Matthias Hopf d1dfab6b16 Clear drmmode_output->mode_output in drmmode_output_destroy(). 2010-03-22 11:48:44 -07:00
Li Peng 10cd04a84b Initialize flip_count before using it
Otherwise it would be a random value and drmmode_page_flip_handler()
won't have a chance to call I830DRI2FlipEventHandler() and indicate
a full page flip is complete.

Signed-off-by: Li Peng <peng.li@intel.com>
2010-03-22 11:31:11 -07:00
Dave Airlie 3d4b3f257f intel: free bus id in error path after printing it out.
the error message prints out a freed string, spotted during
code reappropriation to radeon driver.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-18 12:48:39 +10:00
Chris Wilson 31d5f84bb4 i915: Correct preamble for emit_composite
Fixes:
http://bugs.freedesktop.org/show_bug.cgi?id=27123

Fatal server error:
i915_emit_composite_setup: ADVANCE_BATCH: under-used allocation 100/104

Introduced with commit d6b7f96fde.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-17 09:20:41 +00:00
Chris Wilson d6b7f96fde Fill alpha on xrgb images.
Do not try to fixup the alpha in the ff/shaders as this has the
side-effect of overriding the alpha value of the border color, causing
images to be padded with black rather than transparent. This can
generate large and obnoxious visual artefacts.

Fixes:

  Bug 17933 - x8r8g8b8 doesn't sample alpha=0 outside surface bounds
  http://bugs.freedesktop.org/show_bug.cgi?id=17933

and many related cairo test suite failures.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-16 10:53:29 +00:00
Chris Wilson 910fd171a0 i830: Remove coord-adjust for nearest centre-sampling.
Fixes a number of cairo test suite failures.

Also affects:
  Bug 16917 - Blur on y-axis also when only x-axis is scaled bilinear
  http://bugs.freedesktop.org/show_bug.cgi?id=16917

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-16 10:53:29 +00:00
Daniel Vetter 318aa9ed79 i915 XvMC: fixup colors
My cleanup accidently created a inconsistency in the YUV plane ordering.
I think we can safely assume that I'm colorblind ;)

As Carl Worth rightly pointed out, this change deserves a more elaborate
explanation:

For Xv planar formats, the three planes are stored consecutively in
memory, ordered Y U V. Now for some totally odd reason (= none at all),
i915 xvmc stored it in Y V U order. Right after the release of 2.10, with
commit "Xv: consolidate xmvc passthrough handling" I've inadvertently
broken xvmc support (which started this whole odyssey into xvmc). When
fixing stuff up, I neglected this special plane ordering and simply
assumed it to be the same as Xv and dropped that special case for i915 in
src/i830_video.c. This patch completes the change to standard YUV plane
ordering by making the corresponding change in src/xvmc/i915_xvmc.c.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-03-08 16:38:46 -08:00
Jesse Barnes 68629b6374 DRI2: make WaitMSC error handling more consistent with ScheduleSwap
Just make it mirror ScheduleSwap: complete the wait on any error
condition so as not to crash the client if the kernel is misbehaving.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-08 15:42:39 -08:00
Jesse Barnes 6df74e61af DRI2: truncate OML values to 32 bits
We can only handle 32 bit values unless we totally virtualize the count,
since the kernel only handles 32 bits itself.  Rather than adding all
that overhead, just tolerate the occasional missed event everytime the
counter runs over.

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-08 15:33:20 -08:00
Jesse Barnes c66d57080d DRI2: more WaitMSC fixes
A couple more niggles: make sure we return a target_msc that at least
matches the current count; this is a little more friendly to clients
that missed an event.  Also check for >= when calculating the remainder
so we'll catch the *next* vblank event when the calculation is
satisfied, rather than the current one as might happen at times.

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-08 15:26:24 -08:00
Jesse Barnes 7845c6ade8 DRI2: fixup stray curly brace
Got left in the wrong column after the last cleanup.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-08 15:19:44 -08:00
Eric Anholt 9656d329e4 Put back the pitch alignment for new framebuffers.
I confused a dead assignment with dead code, because one of the args
to the function was an outvalue.  Fixes corruption under compiz.

Bug #26814.
2010-03-08 14:40:50 -08:00
Jesse Barnes b71ca26a02 DRI2: fixup ScheduleWaitMSC similarly to ScheduleSwap
My merge of Mario's patch for this was botched.  Fix it up so that OML
waits work correctly, and remove a bogus warning from ScheduleSwap.

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-08 11:28:59 -08:00
Robert Hooker 8ece6cf5af Fix build against xserver 1.6 branch.
Signed-off-by: Robert Hooker <sarvatt@ubuntu.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-06 19:51:59 +00:00
Mario Kleiner 1cd5564202 DRI2: handle target_msc, divisor and remainder properly in DRI2ScheduleSwap
The current code in I830DRI2ScheduleSwap() only schedules the correct
vblank events for the case divisor == 0, i.e., the simple
glXSwapBuffers() case.

In a glXSwapBuffersMscOML() request, divisor can be > 0, which would go
wrong.

This modified code should handle target_msc, divisor, remainder and the
different cases defined in the OML_sync_control extension correctly for
the divisor > 0 case.

It also tries to make sure that the effective framecount of swap
satisfies all constraints, taking the 1 frame delay in pageflipping mode
and possible delays in blitting/exchange mode due to
DRM_VBLANK_NEXTONMISS into account.

The swap_interval logic in the X-Servers DRI2SwapBuffers() call expects
the returned swap_target from the DDX to be reasonably accurate,
otherwise implementation of swap_interval for the glXSwapBuffers() as
defined in the SGI_swap_interval extension may become unreliable.

For non-pageflipped mode, the returned swap_target is always correct due
to the adjustments done by drmWaitVBlank(), as DRM_VBLANK_NEXTONMISS is
set.

In pageflipped mode, DRM_VBLANK_NEXTONMISS can't be used without severe
impact on performance, so the code in I830DRI2ScheduleSwap() must make
manual adjustments to the returned vbl.reply.sequence number.

This patch adds the needed adjustments.

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-03-05 12:52:47 -08:00
Mario Kleiner 13119ffc03 DRI2: make MSC waits handle specific target_mscs and divisor/remainders
Previous code only handled divisor == 0 case correctly. This should
honor a given target_msc for the divisor > 0 case and handle the
(msc % divisor) == remainder constraint correctly.

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-03-05 12:52:47 -08:00
Jesse Barnes b6e0b92f39 DRI2: handle offscreen drawables better at swap time
If a drawable isn't visible due to DPMS or redirection, we'll just blit
it rather than schedule a swap event.  However, we didn't reset the
target_msc, so the swap target we receive from the server could get out
of sync with the vblank count of the drawable's display.  So at DPMS on
time, the swap target would be the last good vblank count plus some
large number (since the swaps won't have been throttled).

Solve this by zeroing out the swap target like we should when we fall
back to a blit.  Also make the kernel error cases more friendly by
making them fall back to blits too.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-05 12:52:47 -08:00
Chris Wilson 54ac4e2df9 Rate limit batch buffer error.
Once we hit this error it's unlikely that we're coming back - so don't
flood the logs with redundant information.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-05 09:24:33 +00:00
Daniel Vetter 066d9b64ee i915 XvMC: kill dead code
This kills one wip remnant from my i830_memory cleanup and the last
remainings of the subpicture support.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-03-04 14:33:39 -08:00
Eric Anholt 7b7c724da9 Remove remaining fbOffset setting.
In the long long ago, fbOffset was used for DGA.  The server now has
only one reference to fbOffset, a leftover setting of it in fbdevhw.
We can safely ignore it now, which is good since we weren't updating
it in other places where the front buffer offset could change.
2010-03-04 11:25:14 -08:00
Eric Anholt 15026d64d3 Remove a piece of fbOffset cruft from non-DRM support. 2010-03-04 11:25:14 -08:00
Eric Anholt e8e6152892 Remove i830_allocate_2d_memory() now that it only called one function. 2010-03-04 11:25:14 -08:00
Eric Anholt e37b562083 Init CRTC cursors with CRTC setup instead of i830_memory. 2010-03-04 11:25:12 -08:00
Eric Anholt a36bdaba61 Remove intel_sync() at teardown time.
The kernel's still running after we're gone.  This didn't matter.
2010-03-04 10:13:34 -08:00
Eric Anholt 4ada6d7a85 Remove 3D state clobber on EnterVT, and always clobber at batch start.
We know that it's clobbered at each batchbuffer, anyway.  And even if
this server isn't running DRI2, it can still be clobbered at batch
start in the KMS world.
2010-03-04 10:13:34 -08:00
Eric Anholt d92d42303e Remove pre-2.6.29 error message handling since we require KMS. 2010-03-04 10:13:34 -08:00
Eric Anholt faecd155c4 Move batch and 965 render state setup/teardown to screen init/close.
Whether we're VT switched or not shouldn't impact rendering.
2010-03-04 10:13:34 -08:00
Carl Worth 74e2b69a31 i915_hwmc: Remove dead code.
Daniel recently identified this code as unneeded (with an #if 0).
Here we take the next step and remove it entirely.
2010-03-04 09:51:03 -08:00
Carl Worth 1d6537ec57 i830_video: Remove unused variable.
Certainly just a little leftover from the recent rewrites.
2010-03-04 09:39:28 -08:00
Daniel Vetter 57c0043b9a Xv: fixup relocation in i965_video.c
The previous code made no sense, (multiplying an offset by 4 is
meaningless). It could have onlt worked with the offset being
fortuitously 0.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:38 -08:00
Daniel Vetter e606be463f i830_memory: rip out the remainings of the old allocator
Yeah!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:38 -08:00
Daniel Vetter 371be65fb7 XvMC: kill the pinned batchbuffer in the ddx code
It's been unused for quite a while.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:38 -08:00
Daniel Vetter d5a20c81ab i915 XvMC: kill pinned surface buffer in the ddx code
Like with the per context stuff, also drop the now artificial limit
on surfaces. Again, with that gone, a lot of code can be deleted.

Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:38 -08:00
Daniel Vetter e6eb257ad3 i915 XvMC: kill pinned per-context buffers in the ddx code
There's now not a reason anymore to limit the number of active contexts.
So kill this accounting, too.

With that all gone, per-context state in the ddx is nil, so rip out
all associated code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:38 -08:00
Daniel Vetter 47ae1181f6 i915 XvMC: don't stall the cpu anymore
Proper bo management ensures that the cpu doesn't step on buffers
used by the gpu. Drop the now unnecessary synchronization.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:38 -08:00
Daniel Vetter 9bba123c5f i915 XvMC: drop superflous MI_FLUSH
Cache coherency is now fully under the control of gem.

For lack of hw documentation, I had to find out the correct cache
placements by trial and error:

Backward and forward surfaces: I915_GEM_DOMAIN_RENDER
Correlation data:              I915_GEM_DOMAIN_SAMPLER

Changing any of them leads to visual corruptions, so I think these
are the correct ones.

Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:38 -08:00
Daniel Vetter b11623f20e i915 XvMC: switch surfaces to drm_intel_bo
Now the last user of the fixed buffers provided by the ddx is gone!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:38 -08:00
Daniel Vetter b7f79bfd40 i915 XvMC: switch corrdata buffer to drm_intel_bo
It works!

v2: Correlation data needs to be in the render cache!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:37 -08:00
Daniel Vetter 62846d88d4 i915 XvMC: switch msb to drm_intel_bo
Like for the static indirect state buffer.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:37 -08:00
Daniel Vetter d27955c697 i915 XvMC: switch sis to drm_intel_bo
I've decided to allocate a new buffer for every render command, to
prevent stalling for the gpu. libdrm bo reuse should take care of
not wasting memory in case the buffer is not busy.

Also always emit the full state, it's not worth it to complicate
the code over a few stores to wc memory.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:37 -08:00
Daniel Vetter 3203c66fbf i915 XvMC: switch load_indirect_render_emit to batchbuffer macros
Like with one_time_state_emit, this preps for relocatable bo's.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:37 -08:00
Daniel Vetter d30decae6a i915 XvMC: switch psc to drm_intel_bo
Like with the sampler state buffer.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:37 -08:00
Daniel Vetter b543c355f4 i915 XvMC: switch psp to drm_intel_bo
Like with the sampler state buffer.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:37 -08:00
Daniel Vetter 18c364084c i915 XvMC: switch ssb to drm_intel_bo
This also starts to kill the last remnants of the support for
physical addresses for the indirect state buffers. With gem this
would need kernel support (in the form of a new reloc type in
execbuf2).

This does not change the ABI between ddx and client libIntelXvMC.
I've decided to do this in one swoop when all the buffer rework is
done.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:37 -08:00
Daniel Vetter fc9e44f019 i915 XvMC: kill last_flip and last_render
Seems to be a remnant from i810 XvMC support. last_flip is always 0,
so serves no real purpose anymore. Kill it and the associated code.

With last_flip gone, last_render also lost its purpose. Kill it, too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:37 -08:00
Daniel Vetter 04aa38a639 i915 XvMC: switch one_time_state_emit to batchbuffer macros
This is in preparation for real relocatable drm_bo's instead
of memory at a fixed address. By switching to the batchbuffer
macros (like i965 xvmc) we can use the nice OUT_RELOC macro.

Also align the code more with coding-style elsewhere, i.e. bitops
instead of bitfield structures. The bitfield structures are
quite a mess to work with the batchbuffer macros, so they were
getting in the way, anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:37 -08:00
Daniel Vetter 24d787335a XvMC: kill dead code in i915_xvmc.c
WIP code that hasn't changed for over two years is unlikely to
suddenly start progressing. Drop it. After all, git can easily
resurect it in cases it's needed.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:37 -08:00
Daniel Vetter 13266b152a XvMC: kill i830_memory in 965 class xvmc
Yes, this breaks binary compat of the struct passed around between
X ddx and the client libXvMC. But we always ship both, so they should
not get out of sync.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Carl Worth <cworth@cworth.org>
2010-03-04 09:38:37 -08:00
Daniel Vetter d39d822cf8 i830_memory: hide as much of the old memory allocator as possible
The only user left of this stuff is the xvmc support.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2010-03-04 09:38:37 -08:00
Daniel Vetter 65267d4bfb i830_memory: switch frontbuffer to drm_intel_bo
Yet another user of i830_memory gone for good.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2010-03-04 09:38:37 -08:00
Daniel Vetter 06f147dc04 i830_memory: switch cursors to drm_intel_bo
Minus one user of i830_memory, some more to go.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2010-03-04 09:38:37 -08:00
Daniel Vetter 23d12e3b08 i830_memory: kill field "pitch"
Totally unused.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2010-03-04 09:38:37 -08:00
Daniel Vetter 2fb8feeb56 i830_memory: rip out field "size"
Use the one in the drm bo instead.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2010-03-04 09:38:37 -08:00
Daniel Vetter 4d4d763b3d i830_memory: kill field "tiling_mode"
Totally unused.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2010-03-04 09:38:37 -08:00
Daniel Vetter d0800d0987 i830_memory: no memory allocations without a bo!
Kill the corresponding !bo path in i830_free_memory.

Also kill another remnant of the pre-kms era in the same file, while I
was looking at the code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2010-03-04 09:38:37 -08:00