Commit Graph

39 Commits

Author SHA1 Message Date
Chris Wilson 5d6dd9c5a7 Convert generation counter to octal
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-30 12:12:49 +00:00
Chris Wilson 6211d0914e uxa: Flush batch immediately after queuing a WAIT_FOR_EVENT
We still encounter hangs with kernel-3.5 with the culprit being a wait
on a disabled pipe. As we thoroughly check before that the pipe is still
disabled and flush before a modeset, the only possibility that remains
is that DPMS is disabling the pipe before we submit. Close that race by
always submitting the batch immediately after a WAIT_FOR_EVENT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-05 12:33:08 +01:00
Dave Airlie b580abdfa6 intel: fix video xvPipe range check
Pointed out by Russell King on irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-08-12 20:52:12 +10:00
Chris Wilson 0c32be15b0 uxa: Remove Shadow hack
This was an incomplete hack so deprecate in favour of Shadow-on-Steriods,
SNA.

References: https://bugs.freedesktop.org/show_bug.cgi?id=47324
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-15 20:56:58 +01:00
Chris Wilson 06634604ab Initialise adaptors to 0 in case xf86XVListGenericAdaptors does not
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-19 15:28:43 +01:00
Chris Wilson 5fea2478cd Lots of trivial semantic fixes
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:14:40 +01:00
Chris Wilson ba0eb23083 uxa: Fix reallocation of XVAdaptors array
Prevent the leak and remove some unsightly code in the process.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 08:38:21 +01:00
Dave Airlie 43a34186d1 intel: convert to new screen conversion APIs
The compat header takes care of the old server vs new server.

this commit was autogenerated from util/modular/x-driver-screen-scrn-conv.sh

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-23 11:02:20 +01:00
Chris Wilson b817200371 Don't issue a scanline wait while VT switched
Be paranoid and check that we own the VT before emitting a scanline
wait. If we attempt to wait on a fb/pipe that we do not own, we may
issue an illegal command and cause a lockup.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-17 17:56:05 +01:00
Chris Wilson 4db1bb3fd8 Removed deprecated xf86PciInfo.h includes
The driver should and does provide its own PCI-IDs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 17:34:48 +00:00
Chris Wilson a8fe50ab65 uxa: Explicitly check for libdrm_intel in configure
And remove the excess dependencies from the common files.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-17 21:26:34 +00:00
Chris Wilson 33f17b996d Remove a couple of trivial compile warnings for unused variables
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-14 12:01:34 +01:00
Chris Wilson 0056bfd11e video: Stop advertising unsupported Xv attributes
We have yet to implement a yuv-shader that applies
contrast/brightness/saturation and so should not advertise such
features, potentially allowing the client to fallback and perform the
adjustments itself.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-13 14:44:48 +01:00
Chris Wilson 0a74cd77a3 video: check that the pixmap exists before use
Now, the pixmap being used is meant to the Screen pixmap and by rights
that has to exists in a GPU buffer! Evidence contrary to the above
exists and so we had better check that we have a bo before using...

Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40439
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-29 10:41:26 +01:00
Chris Wilson 0b4ca9313c video: Flush the batch on the next blockhandler after queuing
In order to avoid video lag and jerky playback we need to ensure that
any queued video is flushed before we go to sleep.

Fixes regression from 6f104189bb.

Reported-and-tested-by: Edward Sheldrake <ejsheldrake@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37068
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-05-10 20:36:18 +01:00
Chris Wilson 59ed6b05db Revert "i965: Convert to relative relocations for state"
This reverts commit d2106384be.

Breaks compiz (but not mutter/gnome-shell) on gen6. Not sure if this is
not seem deep interaction issue with multiple clients sharing the GPU or
just with compiz, but for now we have to revert and suffer the inane
performance hit. It looks suspiciously like another deferred damage
issue...

Bugzilla: 51a27e88b073cff229fff4362cb6ac22835c4044
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-07 16:16:58 +01:00
Chris Wilson d2106384be i965: Convert to relative relocations for state
References: https://bugs.freedesktop.org/show_bug.cgi?id=35733
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-04 15:57:28 +01:00
Chris Wilson 972569f6fd MI_LOAD_SCAN_LINES_INCL are inclusive and range [0, display height-1]
We have seen GPU hangs with:

batchbuffer at 0x0f9b4000:
0x0f9b4000:      0x09000000: MI_LOAD_SCAN_LINES_INCL
0x0f9b4004:      0x00000300:    dword 1
0x0f9b4008:      0x09000000: MI_LOAD_SCAN_LINES_INCL
0x0f9b400c:      0x00000300:    dword 1
0x0f9b4010:      0x01820000: MI_WAIT_FOR_EVENT
0x0f9b4014: HEAD 0x02000006: MI_FLUSH

on a 1366x768 display. That according to the specs an invalid command
for the pipe.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35576
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-04 13:58:48 +01:00
Xiang, Haihao 5baa63c634 Fix an error in 4c4ad55556.
See the original patch at https://bugs.freedesktop.org/show_bug.cgi?id=24767

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-01-21 09:02:16 +08:00
Xiang, Haihao 4c4ad55556 Correct offset of planes within clipped window
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=24767
Reported-and-tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-19 15:25:45 +00:00
Adam Jackson b0d10ff04a xv: Fix interlace computation
scrn->currentMode is a hack for xf86vidmode and in general is wrong for
RANDRful drivers.  Use the mode on the associated CRTC instead.

Signed-off-by: Adam Jackson <ajax@redhat.com>
[ickle: crtc->mode is a ModeRec]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-03 23:02:49 +00:00
Xiang, Haihao 6ec3ff134b Xv: don't call intel_wait_for_scanline on Sandybridge
MI_LOAD_SCAN_LINE_INCL command is not available on sandybridge.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-01 08:51:55 +08:00
Xiang, Haihao 9e73cbd7ee Xv: enable TextureAdaptor for Sandybridge
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-01 08:51:51 +08:00
Chris Wilson 4083197a44 Include a chipset generation number to clarify device specific paths.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-07 13:26:07 +01:00
Chris Wilson 8784c4f5a1 video: Disable TextureAdaptor for Sandybridge
The acceleration code does not yet exist, so we try to use gen4 shaders
which hangs the chip and makes everybody upset. Disable it until such a
time as support is written for Sandybridge XVideo.

Reported-by: Matthias Hopf <mhopf@suse.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30500
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-01 21:45:15 +01:00
Krzysztof Halasa bfba6d6148 Allow interlaced modes.
This may not the best method, but it should be a good base on which to
build...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-21 22:57:36 +01:00
Chris Wilson 2b96c18165 Enable a shadow buffer and disable GPU acceleration.
An attempt to workaround the incoherency in gen2 chipsets, we avoid
using dynamic reallocation as much as possible.

The first step is to disable allocation of pixmaps using GEM and simply
create them in system memory without a backing buffer object. This
forces all rendering to use S/W fallbacks.

The second step is to allocate a shadow front buffer and assign that to
the Screen pixmap. This ensure that the front buffer remains in the GTT
and pinned for scanout. The shadow buffer will be rendered to in the
normal fashion via the Screen pixmap, and be marked dirty. In the block
handler, the dirty shadow buffer is then blitted (using the GPU) over
the front buffer. This should completely avoid having to move pages
around in the GTT and avoid incurring the wrath of those early chipsets.
Secondly, performance should be reasonable as we avoid the ping-pong
caused by the small aperture and weak GPU forcing software fallbacks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-08 13:33:37 +01:00
Matt Turner b611bced15 Use ALIGN macro instead of open coding it.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-22 09:52:42 +01:00
Chris Wilson fe7dee7fe1 Remove the final references to the drmmode prefix
In particular fix the compile regression for intel_do_pageflip().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-01 14:15:09 +01:00
Chris Wilson db7cd7b9f0 Rename drmmode_display to intel_display
And fixup all the drmmode_* functions to have an intel prefix and
categorise those into intel_mode, intel_crtc, intel_output and
intel_property so that the functions are a little more self-descriptive
and, more importantly, are consistent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-01 11:27:29 +01:00
Daniel Vetter f46a8dfce5 video: kill do { ... } while (ret != -EINTR) loops
Chris Wilson likes to sprinkle these all over, but in this
case it's just misleading. libdrm already does this for us.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-07-26 23:02:02 +02:00
Daniel Vetter 1cb69b9a77 video: kernel overlay needs triple buffering
The kernel overlay code does asynchronous overlay flips. So keep
onto two old buffers, for otherwise the rendering of the next
frame might overwrite the contents of the currently still displaying
one. With ~25fps videos and ~50 Hz screens that's rather unlikely,
still, fix it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-07-26 23:00:20 +02:00
Chris Wilson d48d584a82 video: Free the buffers immediately after turning off.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-16 10:31:58 +01:00
Chris Wilson 24bdfe0d5e video: Reuse the old buffers.
After passing the new buffer to the kernel, the old buffer is unpinned
and becomes available for re-use. So keep hold of the old buffer and
swap after a PutImage. This greatly reduces the amount of CPU time
consumed by the kernel on behalf of the video overlay -- by only
allocating two buffers for an entire sequence, we avoid clflushing and
page allocation on every frame.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-16 10:31:58 +01:00
Chris Wilson 3a7c25ff8d video: Apply overlay stride errata for i830 and i845
Due to an erratum on these chipsets, the overlay stride must be a
multiple of 256 bytes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-12 19:47:46 +01:00
Chris Wilson 56e5816252 video: Copy DummyEncoding into each adapter.
As we use the static DummyEncoding and may attempt to modify it for each
adaptor (on each device), we should use copies instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-12 17:40:55 +01:00
Chris Wilson 141e88c873 video: forgotten amendment to previous commit.
An extra sanity check to skip the wait if all clipped...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-09 12:12:00 +01:00
Chris Wilson 272d1c14a3 video: apply the crtc box checks from dri.
The dri code is much more careful in ensuring that the scan lines that
is waits for are valid. Copy this code to video, with a bit of work this
can be refactored, and perhaps even teach dri how to handle rotated
front buffers.

References:

  Bug 28964 - [i965gm] GPU infinite MI_WAIT_FOR_EVENT while watching video
              in Totem
  https://bugs.freedesktop.org/show_bug.cgi?id=28964

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-09 10:50:52 +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