Commit Graph

2643 Commits

Author SHA1 Message Date
Keith Packard 1a76fa5574 Initialize DRI2 info rec version 4 list of driver names
With DRI2 supporting multiple subsystems, the video driver must
initialize the list of driver names instead of just passing the single
driver name used by Mesa. Without this, the X server will fail to
initialize DRI2 as the numDrivers field in this structure will be
uninitialized.

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-31 18:08:23 -08:00
Eric Anholt 93cd943d41 intel: Use the compositing-aware colorkey filler instead of homebrew fail.
Of course, it's still fail since you can't correctly composite
colorkey overlay, but at least this doesn't spam colorkey to the root
window.

Tested-by: Daniel Vetter <daniel@ffwll.ch>
2010-01-17 12:36:13 -08:00
Jesse Barnes 96f45c66ee DRI2: if the swap condition is satisfied, complete it immediately
If we get to the point where we check the divisor/remainder equation and
it's satisfied, we should complete the swap immediately.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-01-13 13:25:45 -05:00
Jesse Barnes 51c7590632 DRI2: support new DRI2 APIs
The new interfaces allow for improved buffer swap, and support for the
SGI_swap_control, SGI_video_sync and OML_sync_control GLX extensions.

The Intel implementation allows page flipping to occur for swaps that
are full screen and not rotated.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-01-13 13:25:45 -05:00
Chris Wilson 4902f546be i965: Ensure that URB_FENCE is aligned to 64-bytes
The PRM (Vol 1, p32) specifies that the URB_FENCE command must not cross
a cache-line boundary (64-bytes) in order to workaround a silicon issue.
Ensure that it does not by inserting an alignment point before the atomic
section.

This is a slightly too large hammer, but the easiest method to work with
the current BEGIN_BATCH/ADVANCE_BATCH protections.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-08 19:21:31 +00:00
Chris Wilson 83626aba35 uxa-glyphs: Enable TILING_X on glyph caches.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-08 19:21:31 +00:00
Chris Wilson 50e07da809 i830: Do not use vtSema when chosing mapping type.
The mapping type to use is determined by the tiling of the underlying
object, not by whether or not not we control the vt. This was a
left-over wart that was intended to mean that we had GEM and so could
use GTT mappings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-08 19:21:31 +00:00
Chris Wilson 7a2b7cfab5 Consolidate determining maximum sizes for use with GEM
Add a small wrapper function so that the callsites need only call the
single function when checking the available aperture size for
determining the maximum viable size for operations. This will allow us
to easily extend this set in the future by only needing to adding the
check to a single location.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-08 19:21:31 +00:00
Daniel Vetter 229d23fb18 Xv: don't enable XVMC port on unsupported configs
This just makes it _really_ clear, what's supported. No other changes.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2010-01-07 10:26:01 -08:00
Daniel Vetter ce7ba18f57 Xv: consolidate xmvc passthrough handling
It's now all in I830PutImageTextured. Also kill some leftovers
from XVMC-on-overlay support and ums-XVMC-on-i915 support. Plus
a small comment as a reminder for where to add i915 xvmc support
back in.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2010-01-07 10:25:07 -08:00
Daniel Vetter 1ac7c94083 Xv: hide ugly semantics in i830_clip_video_helper
I'm still curious as to why fixed-point semantics are necessary
for this generic XV helper function that's been causing all this.
Can modern X really run on hw without floating-point support?

Anyway, the ugliness is now all nicely under the carpet (in
i830_clip_video_helper).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2010-01-07 10:25:07 -08:00
Daniel Vetter 31f13fa8a0 Xv: move users of x1, x2, y1, y2 to PutImage
After this there are no other external users of these strange variables,
so we can nicely hide them somewhere in the next changeset.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2010-01-07 10:25:07 -08:00
Daniel Vetter ce6526b9b4 Xv: kill unnecessary parameters for hw PutImage functions
This is the first part of my small crusade to rip out x1, x2, y1, y2
from I830PutImage*. These variables have strange semantics (they
change from simple integers to fixed-point values somewhere in
the middle) and don't really seem to be what we actually need.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2010-01-07 10:25:07 -08:00
Daniel Vetter cf74caaa91 Xv: kill an unnecessary if
We always pass a non-null pointer for crtc_ret, no point to check
for this.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2010-01-07 10:25:07 -08:00
Daniel Vetter d8353c737b Xv: split up I830PutImage into textured and !textured case
This wasn't making much sense anymore, and further cleanups will
make this even more apparent. This change just makes two copies of
I830PutImage and kills the not-applicable if-clauses in both
versions.

There is one small functional change in here: The textured video
path doesn't munch around with adaptor_priv->videoStatus anymore,
which is only used by the overlay. This could prevent the overlay
from being switched off if someone would use textured video at the
same time.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2010-01-07 10:25:07 -08:00
Tobias Doerffel 8d6faf7dc5 Fix compiler warning in i830_copy_video_data() if XvMC is disabled
The variable "intel" is unused when building i830_video.c without XvMC
support which results in a compiler warning:

  i830_video.c: In function 'i830_copy_video_data':
  i830_video.c:1443: warning: unused variable `intel'

Trivial fix via #ifdef.
2009-12-10 14:07:30 -08:00
Daniel Vetter bd81734465 Xv: enable drmmode overlay
Now that libdrm 2.4.16 is released (and already required) we can
unconditionally enable this.

Please add something like this to the release-notes/NEWS file:

* Overlay support for kernel modesetting. This needs at least kernel
  v2.6.33 to work. A backport to 2.6.32 is available at:

  http://gitorious.org/daniel-s-linux-stuff/linux-kernel/commits/intel-kms-overlay-for-2.6.32

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2009-12-10 13:54:11 -08:00
Chris Wilson 37f631d669 Revert "uxa-glyphs: Enable TILING_X on glyph caches."
This reverts commit 3f11bbec42.

For unknown reasons, enabling tiling for the glyph cache is causing
glyph corruption both across suspend and resume and VT switching, on a
wide range of chipsets (reports include both i8xx and gm45)

This strongly suggests that we are handling tiling, or updates to tiled
buffers, incorrectly across i915_gem_idle(). However, until we can find
the root cause, we want to fix this regression before the next stable
release, so simply revert this patch. :(

Fixes:
  [Bug 25406] fonts garbled after resuming from suspend since 6729b508
  http://bugs.freedesktop.org/show_bug.cgi?id=25406

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-10 08:54:46 +00:00
Chris Wilson 093bb9ebe6 i965: Only use the affine kernels if both src and mask are affine
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-08 23:45:28 +00:00
Chris Wilson 0cf04ea4d7 i965: Set src_filter before testing.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-08 23:44:45 +00:00
Chris Wilson 417ad2712e Assert that we only call OUT_BATCH() inside a BATCH
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-08 23:43:57 +00:00
Chris Wilson 47416b1eea i965: Maximum number of vertices per composite is 24, not 18
Beware the potential buffer overflow.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-08 13:48:48 +00:00
Chris Wilson cd475bad23 batch: Ensure we send a MI_FLUSH in the block handler for TFP
This should restore the previous level of synchronisation between
textures and pixmaps, but *does not* guarantee that a texture will be
flushed before use. tfp should be fixed so that the ddx can submit the
batch if required to flush the pixmap.

A side-effect of this patch is to rename intel_batch_flush() to
intel_batch_submit() to reduce the confusion of executing a batch buffer
with that of emitting a MI_FLUSH.

Should fix the remaining rendering corruption involving tfp [inc compiz]:

  Bug 25431 [i915 bisected] piglit/texturing_tfp regressed
  http://bugs.freedesktop.org/show_bug.cgi?id=25431

  Bug 25481 Wrong cursor format and cursor blink rate with compiz enabled
  http://bugs.freedesktop.org/show_bug.cgi?id=25481

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-07 11:15:42 +00:00
Chris Wilson 415aab474e intel: And remember to flush the batch...
In commit 98e11210

  Remove flush parameter from intel_batch_flush()

Maxi spotted that I had broken screen updating. It appears in my haste
to eliminate the extra parameter I removed a call to intel_batch_flush()
when throttling, i.e. when pushing the updates to the screen before
idling.

Should fix:

  Bug 25409 [bisected] rendering corruption since a938673e
  https://bugs.freedesktop.org/show_bug.cgi?id=25409

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-04 09:08:43 +00:00
Chris Wilson a938673ee8 batch: Downgrade batch submission from a FatalError.
If we wedge the GPU then we will return -EIO for the current batch and
then attempt to reset the GPU. Meanwhile the X server detects the error,
throws a FatalError and to all intents and purposes appears to crash to
the user - whereas before it often just appeared to momentarily freeze.
Of course, on older hardware the server remains frozen until we can find
a way to reset those GPUs at runtime.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-02 20:54:54 +00:00
Chris Wilson 98e1121036 Remove flush parameter from intel_batch_flush()
There is only a single caller that wishes to forcibly append a flush
into the batch: intel_sync(). So move the logic there.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-02 20:49:54 +00:00
Chris Wilson 57336c26f1 Rename I830Sync() to intel_sync()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-02 20:43:05 +00:00
Chris Wilson 370157f493 batch: Avoid flushing a NULL batch
During shutdown from a FatalError during batchbuffer submission, it is
possible for the batch_ptr to be NULL, so we must be careful not to
append a flush on this error path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-02 20:38:51 +00:00
Chris Wilson 49d2ccab2a uxa_prepare_access() don't force a flush.
Only the kernel knows whether the mapping requires a flush, so do not
preempt it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-02 14:13:43 +00:00
Chris Wilson b68d3646f1 Review use of errno after libdrm call
Since drm may not actually set the appropriate errno after a failure, we
must use the return code instead when determining the cause of failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-02 14:12:19 +00:00
Chris Wilson 6be26cae83 i830: Simplify prepare_access / finish_access
Reduce the 3 conditions into the 2 distinct cases. This has the
secondary benefit of also distinguishing between the reported errors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-02 12:23:54 +00:00
Chris Wilson 637f003b04 uxa: Don't treat prepare_access as a flush synchronisation point.
The kernel will only emit a flush iff the buffer is currently owned by
the GPU. Instead of presuming that the kernel must emit a flush, it is
safer to assume that it does not and so cannot mapping the buffer on to
the CPU as a synchronisation point. The most obvious counter-example is
when we map the same buffer twice without using it in a batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-01 13:20:20 +00:00
Carl Worth cd5a9568ce Add i830_bios.h and i830_display.h to EXTRA_DIST.
These files have been dropped from the generated tar file since the
removal of UMS support. However, the bios_reader code still includes
these, so "make distcheck" fails unless these are distributed.

There's probably a cleaner fix possible, but this at least fixes the
build so that the snapshot can be pushed out.
2009-11-30 20:17:04 -08:00
Chris Wilson 00aa4f7a45 uxa: Limit maximum size of tiled objects
On older chipsets (i.e. pre-i965) tiling is very restrictive and imposes
severe size and alignment constraints. Combine that with relatively
small apertures and it is very easy to create a batch buffer that
cannot be mapped into the aperture (but would otherwise fit based purely
on total object size). To prevent this we need to not use tiling for large
buffers (the very same buffers where tiling would be of most benefit!).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 22:21:49 +00:00
Gaetan Nadon 8dd1c9eca0 video-intel: remove i2c_vid.h from src/Makefile.am
make dist failed due to missing i2c_vid.h
Commit b9b159c498 Remove UMS support.
The above commit did not remove this header file from the makefile.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2009-11-30 15:54:03 -05:00
Chris Wilson 6729b508c4 uxa: Initialise lists for private pixmap structure.
When updating a buffer object for the framebuffer, we may need to
allocate a fresh pixmap private structure, for example if the pixmap is
replaced due to resize. When doing so it is then imperative to
initialise the circularly linked lists correctly.

Should fix the fault:
  #0  i830_set_pixmap_bo (pixmap=0x24ab380, bo=0x24ab780) at i830_uxa.c:524
  #1  0x00007f8615c629fd in drmmode_xf86crtc_resize (scrn=0x247a320, width=1280, height=800) at drmmode_display.c:1345
  #2  0x000000000051246c in xf86RandR12ScreenSetSize (pScreen=0x24824f0, width=<value optimized out>, height=<value optimized
 out>, mmWidth=<value optimized out>, mmHeight=<value optimized out>) at xf86RandR12.c:709
  #3  0x0000000000512aa8 in xf86RandR12CreateScreenResources (pScreen=<value optimized out>) at xf86RandR12.c:839
  #4  0x0000000000514ec0 in xf86CrtcCreateScreenResources (screen=0x24824f0) at xf86Crtc.c:727
  #5  0x0000000000424fb3 in main (argc=<value optimized out>, argv=<value optimized out>, envp=<value optimized out>) at main.c:215
as reported by 'buscher'.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 16:56:48 +00:00
Chris Wilson 85fe41126e uxa: Remove cache flush for copy
As the copy uses the 2D blitter, it uses the render cache so the source
should not require flushing if it has previously been used as a
destination.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 16:56:48 +00:00
Kristian Høgsberg 2d434eed09 Use new drmGetDeviceNameFromFd() for mapping to drm device name
Should have been in libdrm to begin with.
2009-11-30 10:27:50 -05:00
Chris Wilson cfcabc4514 i915: Disable centre-point sampling.
I still have no idea how this is triggering failures, but it is. So
revert until the problem is solved.

Should fix once again:

  Bug 23803 [bisected i915] gnome characters disappear
  http://bugs.freedesktop.org/show_bug.cgi?id=23803

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 14:04:25 +00:00
Chris Wilson 8f8b6bd03d i915: Whitespace
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 14:03:40 +00:00
Chris Wilson 47916ea9d3 debug: Enable dumping of batchbuffer [compile-time only]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 14:03:10 +00:00
Chris Wilson b118a52cd1 i915: Remove routing of alpha channel to green.
This modification is redundant since the routing is done in the blend
unit anyway.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 11:14:26 +00:00
Chris Wilson 5e04ded2bc i915: Fix missing texture offset for mask.
In commit e581ceb, I modified the shader generation to accommodate mixed
textures and solids but missed applying the new computed sampler for the
mask.

References:

  Bug 23803 [bisected i915] gnome characters disappear
  http://bugs.freedesktop.org/show_bug.cgi?id=23803

  Bug 25031 rendering and color corruption since 14109abf
  http://bugs.freedesktop.org/show_bug.cgi?id=25031

  Bug 25047 [945GM bisected] rendercheck/repeat/triangles regressed
  http://bugs.freedesktop.org/show_bug.cgi?id=25047

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 11:12:03 +00:00
Chris Wilson a8ea20100d debug: Don't always flush the batch when emitting a debugging flush
I incorrectly changed the logic in 285f286 and caused the batch to
always be flushed when debugging, instead of merely inserting a MI_FLUSH
between operations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 10:13:18 +00:00
Chris Wilson c10850c63f overlay: Fix build after 646b4a9483
The compile cleanup was not without fault... Apparently I don't have
XVMC enabled anymore and so missed that this variable is actually used.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 09:07:57 +00:00
Chris Wilson 3f11bbec42 uxa-glyphs: Enable TILING_X on glyph caches.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 00:58:05 +00:00
Chris Wilson 19d8c0cf50 uxa: PutImage acceleration
Avoid waiting on dirty buffer object by streaming the upload to a fresh,
non-GPU hot buffer and blitting to the destination.

This should help to redress the regression reported in bug 18075:

  [UXA] XPutImage performance regression
  https://bugs.freedesktop.org/show_bug.cgi?id=18075

Using the particular synthetic benchmark in question on a g45:

Before:
   9542.910448 Ops/s; put composition (!); 15x15
   5623.271889 Ops/s; put composition (!); 75x75
   1685.520362 Ops/s; put composition (!); 250x250

After:
  40173.865300 Ops/s; put composition (!); 15x15
  28670.280612 Ops/s; put composition (!); 75x75
   4794.368601 Ops/s; put composition (!); 250x250

which while not stellar performance is at least an improvement. As
anticipated this has little impact on the non-fallback RENDER paths, for
instance the current cairo-xlib backend is unaffected by this change.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 00:36:49 +00:00
Chris Wilson f7540f0609 Only flush batch during prepare access if it may modify the pixmap.
As we track when a pixmap is active inside a batch buffer, we can avoid
unnecessary flushes of the batch when mapping a pixmap back to the CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-29 22:42:07 +00:00
Chris Wilson 9a2c18fb92 batch: Emit a 'pipelined' flush when using a dirty source.
Ensure that the render caches and texture caches are appropriately
flushed when switching a pixmap from a target to a source.

This should fix bug 24315,
  [855GM] Rendering corruption in text (usually)
  https://bugs.freedesktop.org/show_bug.cgi?id=24315

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-29 22:42:07 +00:00
Chris Wilson 285f286597 batch: Track pixmap domains.
In order to detect when we require cache flushes we need to track which
domains the pixmap currently belongs to. So to do so we create a device
private structure to hold the extra information and hook it up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-29 22:42:03 +00:00