Commit Graph

2750 Commits

Author SHA1 Message Date
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