Commit Graph

3029 Commits

Author SHA1 Message Date
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
Daniel Vetter 086c0e25ca i830_memory: rename i830_bind_all_memory to reflect code reality
It doesn't bind anything anymore, but does a few random things.
Give it a hopefully vague enough name to cover all cases ;)

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 2a989aa057 i830_memory: rip out the old video memory allocator
Besides the debug stuff the went away in the previous patch,
this stuff was 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 bf83b9a102 i830_memory: kill i830_desribe_allocations
Totally useless debug function from the pre-gem era. No point
to occasionally spam Xorg.log with a bogus "No memory allocations"
message.

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 ff8a1e1cf7 i830_memory: rip out field "offset"
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 e18ffceb14 i830_memory: rip out field "end"
It's a left-over from the non-gem era and no longer used at all.

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 5018fd3097 libIntelXvMC: kill ums leftovers
On i965 class hw, kernel_exec_fencing was 1 always, anyway. And on
i945, this patch kills a memory leak (dunno how, but it does).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-03-04 09:38:17 -08:00
Daniel Vetter cb06aa32d4 Xv: fixup XvMC on i915
I've accidentally broken i915 xvmc due to alignment constrains that
break my assumption that Y-pitch == UV-pitch*2. Fix this up by consistenly
using dstPitch2 for the Y-pitch. This also unifies the dst pitch
computation slightly, now that the i915 xvmc special case is gone.

Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=25949

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

(Minor edit to support compilation without INTEL_XVMC defined by
Carl Worth <cworth@cworth.org>)
2010-03-04 09:38:11 -08:00
Daniel Vetter 80f2a1f3b5 Xv: fixup YUV plane offset for xvmc case
In my previous cleanup I've inadvertedly dropped the offset adjustment
code for the xvmc passthrough case. Fix this up.

Also reimplement that ugly hack I've accidently killed to keep i915 class
xvmc a tad bit longer on life support.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: xunx.fang@intel.com
2010-03-04 09:36:21 -08:00
Carl Worth d540930312 Remove dead code: fill_detailed_lvds_block
All callers of this function were recently removed, so it can join
them in the bit bucket.
2010-02-26 16:13:25 -08:00
Adam Jackson 7d0e6ff4da kms: Fix LVDS mode list construction.
Rather than mangle the EDID block and hope the server does the right
thing, just build a sensible mode list up front.  Do this for LVDS where
there is no EDID or where it does not claim to be continuous-frequency
(since in the latter case, the server will add reasonable modes for us).

Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-02-26 16:10:34 -08:00
Eric Anholt 529bf185fb In frame event handling, track drawable id instead of drawable pointer.
Windows aren't refcounted, so if the event came in after the window
was destroyed, we'd dereference garbage and segfault.
2010-02-24 17:54:13 -08:00
Eric Anholt 633c703317 Fix up a bunch of inconsistent 4-space indentation in i830_dri.c 2010-02-24 17:41:08 -08:00
Eric Anholt 9291828a56 Add new mobile Sandybridge PCI IDs. 2010-02-23 17:09:25 -08:00
Eric Anholt 3c71f98b9e Add initial defines and probing for Sandybridge 2010-02-23 17:09:20 -08:00
Eric Anholt c2c670ef18 Remove more DRI1 dead code. 2010-02-20 12:57:21 -05:00
Eric Anholt b320449f75 Remove dead i830_ring.h. 2010-02-20 12:55:13 -05:00
Eric Anholt 6d48b26098 Remove dead i830_display.h. 2010-02-20 12:55:13 -05:00
Eric Anholt 4126f73051 Remove dead i830_bios.h. 2010-02-20 12:55:13 -05:00
Eric Anholt ca173c1eaf Remove the last tool now that it's been moved to gpu_tools. 2010-02-20 12:55:13 -05:00
Eric Anholt 6da7cda583 Remove swf_dumper. We have intel_mmio_read in gpu_tools to do this. 2010-02-20 12:55:13 -05:00
Eric Anholt 71c613c847 Remove bios_reader now that it's moved to gpu_tools. 2010-02-20 12:55:13 -05:00
Eric Anholt 7ada4eb383 Remove intel_hotplug tool now that it won't work with KMS.
We'd want to put something like it in sysfs or something if we wanted
this tool to exist again.
2010-02-20 12:55:13 -05:00
Eric Anholt 3284aacfe0 Remove dead i830_bios.c.
Things that used it are now either in the kernel or stashed off in
gpu_tools.
2010-02-20 12:55:13 -05:00
Eric Anholt 761d386a94 Remove intel_gtt and intel_lid now that they're in gpu_tools. 2010-02-20 12:55:13 -05:00
Eric Anholt 6199af00cb Remove xprintf.c from the old "I can't believe it's not an X Server" tools. 2010-02-20 12:55:13 -05:00
Eric Anholt cba8e3136a Remove intel_statuspage, now that we have /debug/dri/0/i915_gem_hws 2010-02-20 12:55:13 -05:00
Eric Anholt 40f5f72e30 Remove dead main.c from reg_dumper/ 2010-02-20 12:55:13 -05:00
Eric Anholt 0c5e4a65f5 Delete the audio dumping tool now that it lives in gpu_tools. 2010-02-20 12:55:13 -05:00
Eric Anholt a86869e6c3 Fix an unused variable warning for !INTEL_XVMC. 2010-02-20 12:55:13 -05:00
Eric Anholt ec5deb2bcb Remove dead assignments noticed by clang. 2010-02-20 12:55:13 -05:00
Eric Anholt a4180eabfa Remove stale junk in VideoRam setup, noticed by clang. 2010-02-20 12:55:13 -05:00
Eric Anholt 03657d4a69 Remove dead UMS CRTC resize code. 2010-02-20 12:55:13 -05:00
Chris Wilson 1c3aaad09d dri2: Silence the compiler for an unused function with proto < 4
Move the unused function into the #if DRI2INFOREC_VERSION >= 4 block.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-02-17 17:49:48 +00:00
Jesse Barnes 00e7312dc4 DRI2: handle full height blits without tearing in CopyRegion
On 965 and up, if we detect a full height blit, we should just wait for
vblank, rather than try to do a scanline wait for the whole display.

On pre-965, doing a scanline wait followed by a blit works, but in the
full height case we need to give the blitter time to start up, so we
wait until the bottom line of the blit minus 2 padding scanlines to
accommodate.

Fixes FDO bug #22475.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-11 09:46:12 -08:00
Jesse Barnes f0d760bfd7 Disable bo reuse on shadow framebuffer
This keeps us from trying to set tiling on it while pinned, which also
keeps us from trying to unpin it in the kernel, causing an error.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-10 11:24:46 -08:00
Jesse Barnes 6610bcbac5 DRI2: only use version 4 APIs if kernel support exists
Check for page flipping support before enabling flip and vblank event
support needed for the new DRI2 APIs.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-05 17:18:50 -08:00
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
Chris Wilson 646b4a9483 Cleanup a few compiler warnings.
Simple warnings for unused variables and C99-style declarations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-29 10:54:29 +00:00
Daniel Kahn Gillmor eda2bb2678 Makefile.am: Add missing .g4i to be included in the tar file.
Apparently Debian packages were having to manually add these files
back in. Distribute them in the first place like we meant to.
2009-11-20 01:53:13 +01:00
Gaetan Nadon bb994ce018 .gitignore: use common defaults with custom section # 24239
Using common defaults will reduce errors and maintenance.
Only the very small or inexistent custom section need periodic maintenance
when the structure of the component changes. Do not edit defaults.
2009-11-14 09:23:55 -05:00
Gaetan Nadon 67bbda0bdd .gitignore: use common defaults with custom section # 24239
Using common defaults will reduce errors and maintenance.
Only the very small or inexistent custom section need periodic maintenance
when the structure of the component changes. Do not edit defaults.
2009-11-14 09:23:55 -05:00
Chris Wilson c180baf43b i915: Derive the correct target color from the pixmap by checking its format
Particularly noting to route alpha to the green channel when blending
with a8 destinations.

Fixes:

  rendercheck/repeat/triangles regressed
  http://bugs.freedesktop.org/show_bug.cgi?id=25047

introduced with commit 14109a.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-13 20:20:52 +00:00
Chris Wilson 14109abf28 i915: Fix texture sampling coordinates.
RENDER specifies that texels should sampled from the pixel centre. This
corrects a number of failures in the cairo test suite and a few
off-by-one bug reports.

  Grey border around images
  https://bugs.freedesktop.org/show_bug.cgi?id=21523

Note that the earlier attempt to fix this was subverted by the buggy use
of 1x1R textures for solid sources -- which caused the majority of text
to disappear.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-10 15:30:49 +00:00
Chris Wilson e581ceb738 i915: Use the color channels to pass along solid sources and masks.
Instead of allocating and utilising the texture samplers for 1x1R
solid sources and masks we can simply use the default diffuse and
specular colour channels and adjust the fragment shader appropriately.
The big advantage is the reduction in size of batches which should give
a good boost to glyph performance, irrespective of the additional boost
from using simpler shaders.

However, the motivating factor behind the switch is that our use of 1x1
textures turns out to be buggy...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-10 15:19:23 +00:00
Chris Wilson 33cabbfca6 i915: Check for overflow before overflowing.
As the immediate victim of the overflow would be to overwrite the maximum
permissible value, the test was optimistic.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-10 15:19:17 +00:00
Chris Wilson 67af5a9925 Check that batch buffers are atomic.
Since batch buffers are rarely emitted by themselves but as part of a
sequence of state and vertices, the whole sequence is emitted atomically.

Here we just enforce that batches are marked as being part of an atomic
sequence as appropriate.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-10 15:19:08 +00:00
Eric Anholt dbb68168dc Revert "configure: make --disable-dri work even if the server supports DRI"
This reverts commit a851139c21.
It broke the build, and I don't see why we should be supporting this
anyway.

Conflicts:

	configure.ac
	src/Makefile.am
2009-11-05 16:02:02 -08:00
Eric Anholt 4c8e783d84 Fix "Remove flow-control macros for fallbacks in the 2D driver."
I guess this is the sort of failure due to rebase-happiness that makes
Linus yell at us for rebasing.
2009-11-05 16:01:32 -08:00
Daniel Vetter d0e08fe611 Kill some more #defines only needed for User-Modesetting
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-11-05 14:22:59 -08:00
Eric Anholt 8ff2a64964 Remove flow-control macros for fallbacks in the 2D driver.
It's poor style, and has confused new developers.
2009-11-05 14:22:56 -08:00
Jesse Barnes c87585229b Increase stride limit for IGDNG
It can go up to 32k.  Upping this lets me use my 2560x1600 and 1920x1200
monitors in an extended desktop configuration.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-11-05 13:35:34 -08:00
Rémi Cardona 3c0a43b24c configure: use CWARNFLAGS from xorg-macros.m4
Signed-off-by: Rémi Cardona <remi@gentoo.org>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-05 16:58:35 +01:00
Rémi Cardona a851139c21 configure: make --disable-dri work even if the server supports DRI
XF86DRI is defined by the SDK so not defining it here just breaks the
build. Define HAVE_DRI instead to avoid collisions.

Note: DRI2 is still enabled/disabled entirely by SDK defines.

Signed-off-by: Rémi Cardona <remi@gentoo.org>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-05 16:58:34 +01:00
Thomas Arnhold 751e0a3e45 Fix 64-bit compiler warnings in intel_xvmc_dump_render().
Bug #24396.
2009-10-19 11:35:30 -07:00
Eric Anholt 3e8f2eae3a XVMC: Use XCB DRI2 instead of cargo-culting our own copy of Xlib stuff. (v2)
v2: Incorporate comments from Jamey on device name handling and extension
detection.
2009-10-19 10:36:30 -07:00
Eric Anholt 38ab403d7a Enable XVMC by default on gen4. 2009-10-15 12:36:17 -07:00
Zhenyu Wang f171069608 i965 XvMC cleanup
Remove bo pin for surface buffer access, and remove access
attempt for possible unmapped framebuffer. Using xv buffer
pointer to pass current xvmc surface bo handler, which is
assigned to src image bo and handle that the same way as in Xv.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
[anholt: Fixed up for conflict against the XV rework.  Not tested, because
both mplayer and xine segfault with XVMC currently.]
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-15 12:36:17 -07:00
Daniel Vetter aaedeffe00 Xv overlay: fix planar YUV copy for right rotated crtcs
While copying and rotating the buffer, array access was out of bounds when
rotated to the right (RR_Rotate_270).  My buffer handling changes probably
made this bug much more likely to actually result in a SIGSEGV.

I've checked the logs and the bug exists since rotation has been supported,
i.e.  this looks like a candidate for cherry-picking for all supported
releases.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-15 12:36:17 -07:00
Daniel Vetter 703e3326bb Xv overlay: further cleanups
Kill some unnecessary stuff. Small code changes, but no functional ones.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-15 12:36:17 -07:00
Daniel Vetter 1c2aedfce9 Xv: fixup the disabled drmmode overlay code
This code didn't survive the global renaming of vars to saner names.
Fix it up.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-15 12:36:17 -07:00
Daniel Vetter 909990f40a Xv overlay: remove some more dead stuff from ums overlay support
Mostly unused definitions and variables, but also some strange ums
debug code. Also kill some now obsolete comments.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-15 12:36:17 -07:00
Chris Wilson 86bc23ab5d debug: Enable cache flushing after every operation
If DEBUG_FLUSH_CACHES is enabled then emit a MI_FLUSH after every
rendering operation. This is intended to 'fix' cases where we are
missing a required flush in the middle of a sequence of operations, such
as switching between 2D to 3D and render to sampler.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-14 12:06:01 +01:00
Chris Wilson 3c0815abf2 conf: Add debugging flush options
Make the following options available via xorg.conf:
  Section "Driver"
    Option "DebugFlushBatches" "1" # Flush the batch buffer after every
                                   # single operation;

    Option "DebugFlushCaches" "1" # Include a MI_FLUSH at the end of every
                                  # batch buffer to force data to be
                                  # flushed out of cache and into memory
                                  # before the completion of the batch.

    Option "DebugWait" "1" # Wait for the completion of every batch buffer
                           # before continuing, i.e. perform synchronous
                           # rendering.
  EndSection

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-14 11:53:20 +01:00
Zhao Yakui 2f134b8444 Return failure when the enum-type output property values are not found
Failure to do so causes xrandr to report incorrect property values.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-13 12:30:21 -07:00
Albert Damen fcc2ee48b8 Drop frontbuffer from crtc in I830CloseScreen
By dropping the frontbuffer from the crtc, the new frontbuffer
can be properly added to the crtc when the xserver is reset.

Signed-off-by: Albert Damen <albrt@gmx.net>
2009-10-13 10:51:24 -07:00
Dave Airlie 8a77877f9c drmmode: with 1.7 server, set mode major doesn't get gamma setup.
Noticed this on Fedora, where 1.7 server does gamma via the randr
codepaths however kms doesn't have this call which happens in the
non set_mode_major path.

probably should be backported to released drivers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-10-13 09:19:31 +10:00
Jesse Barnes d8c7678dda DRI2 compat build fix: it's drawable->pScreen not drawable->screen
Fallout from the conversion; DRI2 compat path was broken.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-10-12 14:02:12 -07:00
Eric Anholt 8b2d2ff0d0 Clean up more i830_memory.c madness.
It was cooking up insane alignment values for buffers that new libdrm was
justifiably complaining about, but it turns out we don't need the alignment
values anywhere because the only case they're needed, they're computed
entirely by the kernel.  Also, the XVMC code was passing a completely unused
flag in.
2009-10-08 15:34:10 -07:00
Eric Anholt d525a0e993 Rename pScreen to screen. 2009-10-08 15:34:10 -07:00
Eric Anholt b6262dcd27 Rename pGC to gc. 2009-10-08 15:34:10 -07:00
Eric Anholt fdcfeb822d Rename pDraw to plain old drawable. 2009-10-08 15:34:10 -07:00
Eric Anholt 7bbf4ac713 Rename the xv pPriv to adaptor_priv to reflect whose private it is. 2009-10-08 15:34:09 -07:00
Eric Anholt f309d47524 Call pPixmaps plain old pixmaps. 2009-10-08 15:34:09 -07:00
Eric Anholt da0f6616ad de-pCamelHungarian the Render pictures and pixmaps. 2009-10-08 15:34:09 -07:00
Eric Anholt 050a141b7b Share several render fields between render implementations.
Also, start settling on the cairo naming for things: source, mask, and dest.
2009-10-08 15:34:09 -07:00
Eric Anholt af27a3a0a5 Rename the xf86 screen private from pScrn to scrn. 2009-10-08 15:34:09 -07:00
Eric Anholt cc5d3ba3c3 Rename the screen private from I830Ptr pI830 to intel_screen_private *intel.
This is the beginning of the campaign to remove some of the absurd use of
Hungarian in the driver.  Not that I don't like Hungarian, but I don't need
to know that pI830 is a pPointer.
2009-10-08 15:34:09 -07:00
Eric Anholt 5e44a0fa42 Remove more dead UMS code. 2009-10-06 18:08:51 -07:00
Eric Anholt 6a716a25ab Remove the reg_dumper code, now that it's been moved to intel_gpu_tools. 2009-10-06 17:58:32 -07:00
Eric Anholt e9aff787a5 Remove the stepping debug app, replaced by version in intel_gpu_tools. 2009-10-06 17:55:10 -07:00
Eric Anholt 71b9cdaa86 Trim down the hotplug debug app. 2009-10-06 17:53:21 -07:00
Eric Anholt e95eb483e2 Remove intel_idle, replaced by intel_gpu_top in intel_gpu_tools. 2009-10-06 17:51:58 -07:00
Eric Anholt 8ae0e44e42 Move to kernel coding style.
We've talked about doing this since the start of the project, putting it off
until "some convenient time".  Just after removing a third of the driver seems
like a convenient time, when backporting's probably not happening much anyway.
2009-10-06 17:10:31 -07:00
Eric Anholt b9b159c498 Remove UMS support.
At this point, the only remaining feature regressions should be the lack of
overlay support (about to land), and the need to update the XVMC code to work
in the presence of KMS.

Acked-by: Keith Packard <keithp@keithp.com> (in principle)
Acked-by: Carl Worth <cworth@cworth.org> (in principle)
2009-10-06 16:22:31 -07:00
Eric Anholt d26f4c4937 Remove UMS overlay support.
The replacement code is now landed, and the rest of UMS is about to disappear.
2009-10-05 13:41:39 -07:00
Eric Anholt 33c488e836 Remove error state dumping code.
This is replaced by intel_gpu_dump, and would no longer be used once UMS is
gone.
2009-10-05 13:19:57 -07:00
Daniel Vetter 2370af32fe Implement drmmode overlay
This does not restore the overlay on EnterVT/disable it on LeaveVT.
Does not look like this is necessary.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[anholt: Hacked in avoiding the actual kernel calls with
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:17:47 -07:00
Daniel Vetter 9923086405 Xv: introduce an overlay hal
This is the last preparatory step for overlay support with drmmode.
Safe two (specially marked) function calls in the setup code, all
hw accessing code goes now through these three new functions with
the ums_overlay prefix.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:08:42 -07:00
Daniel Vetter bb04e184fd Xv: rework overlay buffer management
The basic idea is to only pin the buffer into the gtt when
the overlay hw is actually using it. This results in a few changes:

- Unify data copied/buffer handling with textured video. Now offsets
  are always buffer relative and we just use drm_bo_map to access a
  buffer.
- Implement double buffering using two bo's. This is necessary because
  we can't pin the same buffer to the gtt and map it as normal memory.
- Kill XV_DOUBLE_BUFFER. With the above changes, overlay video is always
  doubel buffered.

There is still the XvMC passthrough case, which makes the code slightly
ugly. Unfortunately we can't get at the bo behind this buffer.

Changes since the last review-round:
- Don't overallocate by a factor of 2.
- Prevent possible use-after-free issue.

Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:08:42 -07:00
Daniel Vetter 60462eb5b5 Xv: create xvmc_passthrough helper
This way all thes strange special cases make much more sense.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:08:42 -07:00
Daniel Vetter 71276dff94 Xv: scrap overlay offscreen pixmap support
The code looks like it's been bitrotting since being copied over
from the i810 driver. Furthermore painting rgb pixmaps with the overlay
engine is in these days of modern compositing X an absolute no-go. And
textured video doesn't support it neither, so its likely never ever
used by applications.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:08:42 -07:00
Daniel Vetter 99afdf985f Xv: small cleanups in I830PutImage
- scrap unused variable overlay
- scrap an superflous if and attach the code to the preceeding else
- tiny layout fix.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter d598456f1f Xv I830PutImage splitup: extract i830_wait_for scanline
Also scrap the unecessary variable sync in I830PutImage and the
accompanying obfuscated logic.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 2ba03fa781 Xv I830PutImage splitup: extract i830_copy_video_data
Just moves the code and passes back allocation failures.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 81fc74cc4c Xv I830PutImage splitup: extract i830_setup_video_buffer
Just move the code and pass back allocation failures.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 0bf4cc5130 Xv I830PutImage splitup: extract i830_dst_pitch_and_size
Just moves the code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter c20ef59193 Xv: kill destId in I830PutImage
It's only used to remember that XvMC has ỲV12 as output. is_planar_fourcc
already takes care of that in all necessary cases.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 5ce944994d Xv: kill hw double buffering logic
The idea for the hw double buffering support is to program two fixed
buffers and then only switch buffers in the OCMD register. But the driver
as-is always programs the new buffer address (in both register sets
when double buffered). Therefore we gain nothing by using this hw
capability. Scrap the software support for it.

When double buffered, we now allocate just a buffer of size 2*size and
switch between the two parts purely in software.

To make reviewing this easier, I'll shortly explain the differences of how
double-buffering (i.e. tear-free video) is achieved before and after this
change:

- When double buffer, allocate a buffer twice the size (unchanged).
- Depending upon the currently shown buffer-half, copy the new frame into
  the other buffer-half. In the old code this is done by using the right
  set of buffer offsets, either *Buf0Offset or *Buf1Offset. The new code
  simply programs the offset for the right buffer-half into the single set
  of offsets. The end-result is unchanged.

Now the big difference in hw-programming:

Old: Programm new buffer offset into both sets of _hw_ buffer offset
registers. Depending upon the current _sw_ buffer, select the _hw_ buffer
and program this into the OCMD register. This just complicates matters
unnecessarly.

New: Just always use the hw buffer 0.

And then it's again the same story in both old and new code:

- Execute an overlay flip (MI_OVERLAY_FLIP) to read in the contents of the
  hw registers into the shadow hw registers (which are actually being used
  by the overlay, not the ones we write stuff into). This is synchronized
  with the respective crtc vblank by the hw.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 232418d72e Xv: use is_planar_fourcc helper some more
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 219b14310e Xv: introduce planar memcpy helper
Reduced 3 copies of the same code to one.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter b90171f166 Xv: rename i830_display_video to i830_display_overlay
This function only programs the overlay and is never called for textured
video. Make this obvious.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 857e40a6e0 Xv i830_display_video splitup: extract i830_overlay_cmd
This slightly moves around (and simplifies) the OSTRIDE reg programming,
too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Daniel Vetter 50d70e644e Xv i830_display_video splitup: extract i830_calc_src_regs
Also introduce an is_planar_fourcc helper. I'll use that one later.

In i830_display_video this changeset moves the XVMC case (previously
obscured as the default case) around. I've figured this default case
does not make sense, here's why:

XvMC is everywhere else handled as a planar format (e.g. in the register
programming a few lines down). Furthermore the id variable gets mapped
to FOURCC_YV12 if IS_I915(pI830) is true in I830PutImage. There's a
second caller in the offscreen overlay support code.  But I think that
code is bitrotten and not reliable as an information source.

So we have a different behaviour only for id=FOURCC_XVMC and i965 class
hw (i830 class doesn't have xvmc). I've crawled through various
sources/intel documentations. Finally in the textured video implemention
for i965 class hw (src/i965_video.c) I've found a switch statement that
puts XVMC into the same case as I420 and YV12. So also in i965 class hw
xvmc uses a planar format.

In conclusion I claim that this code was bogus and XvMC on i965 class hw
over Xv overlay was most likely broken.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-05 13:07:42 -07:00
Matthias Hopf 7e7db7ac53 Add new backlight driver "samsung". 2009-09-22 17:47:14 +02:00
Zhao Yakui 7ae1d0dde6 Skip setting tv format property if output crtc is NULL
When TV is not connected and X start, after plugging TV cable again,
system will crash because output crtc is NULL. This patch will return,
do not handle crtc immediately, meanwhile set value will be effective
until user really enable output by xrandr command.

Signed-off-by: Ma Ling <ling.ma@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-09-22 10:59:00 +08:00
Zhao Yakui 02fe9be695 Check whether the DVI-I/D is connected or disconnected based on EDID
When the monitor is digital type for SDVO-DVI D, there should exist the EDID. If
there is no EDID, it should be detected as disconnected.

Signe-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-09-22 10:58:38 +08:00
Chris Wilson 762e406d13 Revert "8xx: Fallback for any non-affine transformation."
This reverts commit 505025053d.

In theory, the non-affine paths work -- at least for the stated test case,
so re-enable them and avoid the slow work-around.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-09-22 01:36:09 +01:00
Keith Packard 2cc1f3cb60 i8xx: Format projective texture coordinates correctly.
Projective texture coordinates must be delivered as TEXCOORDFMT_3D
using TEXCOORDTYPE_HOMOGENOUS. This meant selecting the correct type
in i830_texture_setup, the correct format in i830_emit_composite_state
and sending only 3 coordinates in i830_emit_composite_primitive.

Signed-off-by: Keith Packard <keithp@keithp.com>
[ickle: tweaked to fix up a couple of use-before-initialised]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-09-22 01:30:59 +01:00
Keith Packard bd817e2d73 Split i915/i830 composite_emit_primitive into two functions.
The i915 and i830 take similar but different data when emitting the
primitives, instead of trying to share code here, just split this
apart and avoid potentially breaking things later on.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-21 17:24:11 -07:00
Keith Packard 5e80297d08 Remove DGA support from the driver.
The xf86DiDGA code required that the scanout buffer always be
mappable, stay be at a fixed address in the aperture and have a
constant size. With frame buffer resizing, the latter two are no
longer true, and with KMS, we'd really prefer to not allow the former.

The only option available to the driver is to completely disable DGA
as the modes code has internal calls to the xf86DiDGA code when
fetching new modes from the hardware.

A fix for the DiDGA code will be added to the X server which will
automatically initialize DGA for mode switching and input, but not
frame buffer access, and not require any driver cooperation.

Thus, the correct solution is for the driver to not call xf86DiDGAInit
at all. For old servers, this eliminates a potential catastrophic
problem where random memory is written by the X server. New servers
will get the DIX-based behaviour automatically.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-21 17:24:11 -07:00
Keith Packard 4758311842 Remove vestigial internal rotation which broke KMS DGA/VidMode modesetting.
Pre-2.0, the driver supported rotation internally, rather than relying
on the X server rotation support. The last piece of this dealt with
rotating the mouse coordinates and also tried to preserve rotation
across DGA/VidModeExtension modesetting requests.

That latter bit of code broke under KMS as the rotation value was
never initialized, and when set to zero would create an invalid
configuration. This would confuse xrandr which would bail before
making any changes, leaving the user without a way to recover.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-21 17:24:11 -07:00
Carl Worth 505025053d 8xx: Fallback for any non-affine transformation.
There are definitely bugs in the 8xx code dealing with non-affine
transformations. Disable that code for now to get things working.

Fixes bug #22947 ([855GM, xf86-video-intel-2.8.0] "Freeze" when RENDER extension is being used)
2009-09-21 15:46:51 -07:00
Zhenyu Wang b4d29452b9 More dumps for Arrandale LVDS
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-09-21 15:28:09 +08:00
Keith Packard 33f98e4056 Don't destroy bufmgr at CloseScreen time
Under KMS, the bufmgr is not initialized at InitOutput time and so it
won't be re-initialized during server regen. Thus we must leave the
bufmgr running during regen and cannot destroy it in CloseScreen.

Under UMS, each place the bufmgr is initialized, it checks to see if
it has already happened. Hence, we can safely leave the bufmgr running
across server regen for UMS too.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-17 18:16:02 -07:00
Keith Packard ee9ad85357 Make sure DRM output properties are freed after we're done with them.
drmmode_output_get_modes was fetching output properties but only
freeing some of them.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-17 17:57:40 -07:00
Jesse Barnes b8c5c996e8 Eliminate cursor flicker
We can update the cursor without hiding and showing it.  In fact, doing the
hide/show causes noticable flicker when running in KMS mode.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-09-15 19:46:43 -07:00
Chris Wilson c2abfa8e54 Avoid fallbacks for compositing gradient patterns
Currently when asked to composite using a gradient source or mask, we
fallback to using fbComposite().  This has the side-effect of causing a
readback on the destination surface, stalling the GPU pipeline.  Instead,
like uxa_trapezoids(), we can use pixman to fill a scratch pixmap and then
copy that to an offscreen pixmap for use with uxa_composite().

Speedups on i915:
firefox-talos-svg:  710378.14 -> 549262.96:  1.29x speedup

No slowdowns.

Thanks to Søeren Sandmann Pedersen for spotting the missing
ValidatePicture().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-09-14 16:26:57 +01:00
Chris Wilson 1a77ca74bc i915: Restore nearest sampling
My recent commit [94fc93] to use the pixel centre for sampling with the i830
broke the i915. This restores the previous sampling coordinates for the
i915 whilst preserving the correct coordinates for i830.

Fixes: gnome characters disappear
       http://bugs.freedesktop.org/show_bug.cgi?id=23803

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-09-09 12:40:15 +01:00
Zhenyu Wang ce10b5b6fc Add B43 chipset support
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-09-08 00:56:34 +08:00
Chris Wilson 94fc93d4e2 i830/i915: Set the sample position to the pixel center.
And in particular we apply the nearest sample bias separately for
src/mask.

Fixes cairo/test:
	device-offset-scale
	finer-grained-fallbacks
	mask-transformed-{similar,image}
	meta-surface-pattern
	pixman-rotate
	surface-pattern-big-scale-down
	text-transform

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-09-05 11:06:44 +01:00
Chris Wilson ced0cc8bb2 i830: Update comments
i830_composite() is no longer shared with i915 but
i830_emit_composite_primitive() is.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-09-05 11:06:44 +01:00
Chris Wilson 8863706e25 i830: Trim composite setup
Remove a couple of redundant NOOPs from the setup and correct the required
space checking for atomic batch operation.
2009-09-05 11:06:11 +01:00
Chris Wilson a9b12111f9 i830: remove padding NOOPs from composite
Bumps aa10text up from 249k to 260k!

These NOOPs have existed uncommented since
04d1584737.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-09-05 01:58:03 +01:00
Chris Wilson 9c1bf6d01c i830: do not use stale mask transform
Not only were incorrectly falling back if we had non-affine
transformations, but we made the decision based on a stale transformation
matrix.

Related bug 22877:
   batch_start_atomic horribly breaks performance after a while
   https://bugs.freedesktop.org/show_bug.cgi?id=22877

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Maximilian Grothusmann <maxi@own-hero.net>
2009-09-05 01:34:59 +01:00
Matthias Hopf e903b3ebad Don't set backlight level if going on->on.
Otherwise changed backlight will be reset upon DPMS switch off, because first
this function is called with DPMSModeOn.
2009-09-03 16:34:08 +02:00
Matthias Hopf 91f26937c1 Use "Backlight" as backlight brightness property.
BACKLIGHT is now deprecated, though still usable.
2009-09-03 16:14:56 +02:00
Matthias Hopf dbc8944ee9 Add get_property support.
So far only BACKLIGHT is changed.
2009-09-03 16:14:56 +02:00
Matthias Hopf c18fc7955d Don't ignore backlight level change to the same level.
If set externally to a different level, this would result in a no-op.
OTOH if the display is switched off (DPMS) you do not want the change to take
place immediately, but rather to be saved and set later when the display is
active again.
2009-09-03 16:14:56 +02:00
Zhenyu Wang fe7693c94a Make DGA optional
As DGA is optional in xserver, we should check this too instead
of always trying to init DGA.

Found when update xserver to 6fffcd5825454a7fe58ffbcfb219f007cf38e731,
but not update xf86dgaproto, which caused X fails to start.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-09-02 07:14:57 -07:00
Carl Worth 5812531e08 debug: i830_valid_command: Return invalid for subopcodes with no name
Previously the code would always return the count, before ever looking
into the _3d_cmds table to see if there was actually a valid command.

Thanks to Alan Coopersmith who reported that the code was confusing
parfait:

https://bugs.freedesktop.org/show_bug.cgi?id=21666
2009-08-31 09:30:40 -07:00
Zou Nan hai 7c48c21b22 set correct value for indirect access check bound 2009-08-27 09:47:12 +08:00
Keith Packard 2786a66719 KMS: allocate one bo per crtc for cursor
The KMS API doesn't provide for sharing a single bo for multiple
cursor images, so allocate one bo for each crtc to hold the cursor
image. KMS also only supports ARGB cursors, so don't bother to
allocate buffers for two color cursors.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-08-25 18:37:45 -07:00
Keith Packard e51126c571 Add cursor registers to debug dump output.
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-08-25 18:37:45 -07:00
Keith Packard 5fa8d04d9c Reload cursors as needed when setting new modes.
Cursor images may need rotation, or positions updated when new modes
are set. The server provides a convenience function,
xf86_reload_cursors for precisely this purpose. Just call it after the
new mode is set.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-08-25 18:37:44 -07:00
Jesse Barnes 1fc3f467ab Add KMS only build flag
Rather than refactoring all our init code only to have it go away when
we remove UMS, this patch adds a build time flag to allow the driver to
assume KMS support.

With this flag active, the driver will not request that I/O or MEM be
enabled at probe time, which can allow the server (if other drivers also
cooperate) to run as a non-root user.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-08-25 09:48:10 -07:00
Wu Fengguang 5dccd1be3a Add HDMI audio registers
Dump some of the audio registers at server startup time.

(II) intel(0):           AUD_CONFIG: 0x00000004
(II) intel(0):     AUD_HDMIW_STATUS: 0x00000000
(II) intel(0):       AUD_CONV_CHCNT: 0x00000000
(II) intel(0):        VIDEO_DIP_CTL: 0x20000600
(II) intel(0):        AUD_PINW_CNTR: 0x00000040
(II) intel(0):          AUD_CNTL_ST: 0x00002000
(II) intel(0):          AUD_PIN_CAP: 0x00000094
(II) intel(0):         AUD_PINW_CAP: 0x004073bd
(II) intel(0):   AUD_PINW_UNSOLRESP: 0x80000008
(II) intel(0):     AUD_OUT_DIG_CNVT: 0x00000001
(II) intel(0):        AUD_OUT_CWCAP: 0x00006211
(II) intel(0):          AUD_GRP_CAP: 0x00000004

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
2009-08-21 15:10:46 +08:00
Wu Fengguang 38e97d2366 Add intel_audio reg dumping program
It can dump HDMI audio registers for G45.

Signed-off-by: "Wang, Zhenyu Z" <zhenyu.z.wang@intel.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
2009-08-21 13:23:40 +08:00
Kristian Høgsberg 6955fc7a74 kms: Don't use fb offset when using shadow buffer 2009-08-20 17:15:13 -04:00
Eric Anholt 465a4ab416 Align the height of untiled pixmaps to 2 lines as well.
The 965 docs note, and it's probably the case on 915 as well, that the
2x2 subspans are read as a unit, even if the bottom row isn't used.  If
the address in that bottom row extended beyond the end of the GTT, a
fault could occur.

Thanks to Chris Wilson for pointing out the problem.
2009-08-18 18:00:46 -07:00
Jesse Barnes a3962e6f74 Print block length of backlight table
For debugging VBIOS dumps
2009-08-18 10:57:18 -07:00
Jesse Barnes 320f216699 Dump LVDS backlight info from bios_reader
Add LVDS backlight and power VBT structures and dump from the BIOS reader.
2009-08-18 10:57:18 -07:00
Matthias Hopf a509165304 Add BACKLIGHT property support in KMS case. 2009-08-18 13:55:46 +02:00
Zhenyu Wang 376397c21e Fix VGA plane disabling
Only apply on G4X with SR01 bit5 workaround for VGA plane disable, and
restore behavior back for other chips to make sure other modes got disabled
too.

For bug #17235, #19715, #21064, #23178

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-08-18 10:01:12 +08:00
Matthias Hopf 926c7e7d30 Add HP Mini 5101 to quirks list. 2009-08-13 15:48:21 +02:00
Adam Jackson 7138201977 Fix the chip names printed in the log to be less obnoxious.
Names taken from pci.ids.  Pineview appears to be a platform not a GMCH,
so use the G/GM convention to distinguish.
2009-08-11 14:50:03 -04:00
Eric Anholt e8f0763d40 Fix math in the tiling alignment fix. 2009-08-07 18:24:44 -07:00
Eric Anholt 222b52ef16 Align tiled pixmap height so we don't address beyond the end of our buffers. 2009-08-07 18:20:24 -07:00
Zhenyu Wang 62494407e5 Fix typo in bios_reader for invalid pointer cast
Fixed locally for af45482a52, but pushed
wrong commit.
2009-08-06 13:52:54 +08:00
Eric Anholt 79b6851148 Fix sampler indexes on i965 planar video.
We only set up one sampler, because all of our sampling is the same.  By
using a non-zero index for the other two samplers, we'd dereference (likely)
zeroed data, resulting in using NEAREST filtering.  This was a regression in
40671132cb which incidentally switched from
having 6 samplers to 1.

Bug #22895, #19856
2009-08-05 15:07:14 -07:00
Zou Nan hai f4e4c1a854 It seems that indirect data upper bound check in STATE_BASE_ADDRESS
is not acting like what bspec told on 965gm.
  G45+ follow bspec, but we have to set it to a large value for 965gm.
2009-08-05 15:00:37 +08:00
Zhao Yakui af45482a52 Calculate the DVO relative offset in LVDS data entry to get the DVO timing
Now the DVO timing in LVDS data entry is obtained by using the
following step:
    a. get the entry size for every LVDS panel data
    b. Get the LVDS fp entry for the preferred panel type
    c. get the DVO timing by using entry->dvo_timing

    In our driver the entry->dvo_timing is related with the size of
lvds_fp_timing. For example: the size is 46.

    But it seems that the size of lvds_fp_timing varies on the differnt
platform. In such case we will get the incorrect DVO timing because of
the incorrect DVO offset in LVDS panel data entry.

Calculate the DVO timing offset in LVDS data entry to get the DVO timing
    a. get the DVO timing offset in the LVDS fp data entry by using the
pointer definition in LVDS data ptr
    b. get the LVDS data entry
    c. get the DVO timing by adding the DVO timing offset to data entry

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-08-04 11:32:26 +08:00
Dave Airlie 50e2a6734d intel: drop RES_SHARED_VGA not needed anymore 2009-07-28 18:26:25 +10:00
Dave Airlie f3387310f3 xserver: fix up for stable build
reported by Arkadiusz Miskiewicz <arekm@maven.pl>
2009-07-28 18:27:10 +10:00
Dave Airlie 9bc0096f9d intel: since driver depends on newer server don't need to wrap this
drop resource/RAC interactions
2009-07-28 13:55:39 +10:00
Dave Airlie 9a3b568d62 intel: update for resources/RAC API removal 2009-07-28 13:42:07 +10:00
Krzysztof Halasa 3418c6c16b h/v bias in 3DSTATE_DEST_BUFFER_VARIABLES is 4-bits wide
Fixes bug #22370
2009-07-28 10:47:44 +08:00
Dave Airlie 3784457384 intel: remove unneeded includes
none of these need the resource includes
2009-07-28 10:10:13 +10:00
Keith Packard 8084f76d86 Allow DRM mode setting to include transformations
This removes the explicit transform disabling code in drm_set_mode_major.
Without a fixed X server, transforms will still be broken, but even a fixed
X server can't work around this driver bug.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-26 13:17:13 -07:00
Xiang, Haihao 9a45ace207 XvMC: enable XvMC/XvMC-VLD on IGDNG 2009-07-24 10:48:00 +08:00
Xiang, Haihao 043b4a866a add compiled shader programs for XvMC/XvMC-VLD on IGDNG 2009-07-24 10:47:39 +08:00
Xiang, Haihao 7dc95b4f1d XvMC: pin XvMC buffers under KMS.
Under KMS, the buffer allocated by i830_allocate_memory
isn't pinned anymore. However currently 915 XvMC needs
static offsets.

Fixes bug #22872
2009-07-24 10:39:05 +08:00
Eric Anholt 12c5aeca7a 8xx render: Add limited support for a8 dests.
This improves aa10text performance from 74k to 569k on my 855 laptop.
This also causes my 865 to hang on aa10text like it does on rgb10text,
thanks to actually hitting render accel.
2009-07-22 09:58:17 -07:00
Eric Anholt 6b7728491c Only align DRI2 tiled pixmaps to the DRI2 tiled pixmap alignment requirement.
This should save significant amounts of memory for glyph and other small
pixmap storage.

Bug #21387
2009-07-22 09:16:00 -07:00
Eric Anholt 22f7cbc32b uxa: Tell the driver when we're just going to immediately map the pixmap.
This lets the driver allocate a nice idle buffer object instead of a
busy one, reducing runtime of firefox-20090601 on my G45 from 50.7 (+/- .41%)
to 48.4 (+/- 1.1%).
2009-07-22 09:16:00 -07:00
Keith Packard 6f3fc6b20f drmmode_output_get_modes: Replace existing EDID property blob with new one
This synchronizes the X EDID data with the kernel EDID data each time the
kernel data may have changed. Otherwise, X ends up stuck with the first EDID
data it sees, failing to accomodate to different monitors.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-21 12:38:28 -07:00
Peter Hutterer 0a4c4c5fe8 Update to xextproto 7.1 support.
DPMS header was split into dpms.h (client) and dpmsconst.h (server). Drivers
need to include dpmsconst.h if xextproto 7.1 is available.

SHM is now shm.h instead of shmstr. Requires definition of ShmFuncs that's
not exported by the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-18 12:10:18 +10:00
Eric Anholt bb30073842 Really fix i915 render. Fail at commit --amend. 2009-07-16 12:56:07 -07:00
Eric Anholt 8dd7ccf37e Fix 915-class Render after the 8xx-class Render fix.
The two shared i830_composite.c, so giving i830 atomic batch support
triggered anger about starting i830's atomic area while in i915's atomic
area.  Instead, split the emit-a-primitive stuff from the state emission.
2009-07-16 11:48:33 -07:00
Eric Anholt a1e6abb5ca Use batch_start_atomic to fix batchbuffer wrapping problems with 8xx render.
Bug #22483.
2009-07-15 15:11:21 -07:00
Keith Packard e386e7b14b Reset framebuffer offset when rebinding aperture (22760).
scrn->fbOffset may be changed when binding objects to the aperture during
server initialization or VT enter. This was accidentally removed when the
NoAlloc option was eliminated.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-15 09:47:40 -07:00
Barry Scott b74bf3f9a6 Fix XV scan line calculation when rotated. 2009-07-13 16:38:34 -07:00
Keith Packard 34c674dd45 Remove vestiges of NoAccel options from i830_driver.c
The enum and OptionInfoRec weren't removed in the initial patch

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-11 22:53:42 -07:00
Keith Packard ed8a9a94e1 i830_uxa_prepare_access: Flush and wait for idle for non-bo pixmaps
Without kernel support and explicit knowledge about where in the ring the
last rendering operation for a specific pixmap was, we must synchronize with
any outstanding rendering before accessing a pixmap which does not have a
buffer object.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-10 18:26:59 -07:00
Keith Packard cb19ac207b KMS: Keep screen pixmap devPrivate.ptr NULL during init and resize
The frame buffer only has a valid address between prepare_access and
finish_access calls, so remove all other attempts to compute an address from
the driver.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-10 18:26:59 -07:00
Keith Packard 704b88dd50 i830_bind_memory: Under UMS: Bind GEM bos with dri_bo_pin, else through the GART
We only need to get static offsets for objects when not running KMS,
otherwise the kernel will manage those as needed for us.

Binding objects is done in one of two ways. For GEM buffer objects, we use
dri_bo_pin. For GART allocated memory, we bind that to the GART.
2009-07-10 18:26:59 -07:00
Keith Packard 7b273732f7 Allocate GTT space for GEM only under UMS
GEM requires GTT space to map objects. Under KMS, the kernel driver has
already provided all available GTT space to GEM, so the X server need not do
anything.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-10 18:26:59 -07:00
Keith Packard 56bfee8705 Always set screen pixmap data pointer at init and resize times
For non-DRM environments, the screen pixmap will be GART allocated memory
and not a libdrm buffer object and so uxa will only use devPrivate.ptr to
find the associated memory. Make sure devPrivate.ptr is set each time the
framebuffer is allocated so that uxa will be able to draw to it.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-10 18:26:59 -07:00
Keith Packard 98087a0b96 Make xorg.conf DRI option work under KMS. Fix name of I830AccelMethodInit
KMS mode does not call I830AccelMethodInit as that does the user
modesetting initialization (yes, it was misnamed), but that means that the DRI option
was ignored. Create a new i830_check_dri_option function to do the option
detection, then remove that from I830AccelMethodInit, which is renamed
i830_user_modesetting_init to reflect what it actually does.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-10 18:26:59 -07:00
Keith Packard d655a3ff42 Remove NoAccel support
This removes yet another 'debugging' option that hasn't seen real use in a
long time, and wasn't supported under KMS in any case.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-10 18:26:58 -07:00
Eric Anholt 4e4b947f0b Remove bad comment about 3DSTATE_DRAWING_RECTANGLE size. 2009-07-09 15:52:16 -07:00
Eric Anholt 9155cfca75 Fix lols in trying to figure out whether this is a 64-bit build.
Noticed by:	Michel Dänzer <michel@daenzer.net>
2009-07-09 14:16:07 -07:00
Eric Anholt 40e7c95052 Refuse to allocate giant BOs on 32-bit systems.
The overcommit of address space combined with these buffers hitting SW
fallbacks all the time means that we're probably better off telling the
application "no" instead of likely silently failing later.

Bug #22601.
2009-07-08 08:57:33 -07:00
Eric Anholt 6337cd23e6 Initialize the other argument to drmSetInterfaceVersion.
The kernel ignores it if dd_major is -1, anyway.
2009-07-08 08:57:33 -07:00
ling.ma@intel.com 216d939858 enable sdvo lvds scaling function
Currently we implemented basic sdvo lvds function,
But except for sdvo lvds fixed mode, we can not switch
to other modes, otherwise display get black. The patch
intends to work for all modes whose HDisplay and VDisplay
are lower than fixed mode.

Signed-off-by: Ma Ling <ling.ma@intel.com>
2009-07-08 09:22:40 +08:00
Simon Farnsworth 0402f4f331 Raise XV limit to 2048x2048 to match hardware limits.
The bigrequests limit isn't present in current X servers (tested using
textured video on a 965 with both image and window at 2048x2048 on a
1920x1200 display, and image at 2048x2048, window at 1024x1024).

Remove the artificial limit, enabling full-screen HD video when
rotated.
2009-07-07 15:55:48 -07:00
Keith Packard a663578323 non-DRI FB resize failed to assign the screen pixmap devPrivate.ptr (22328)
When not using DRI, the screen pixmap is not in a bo, and so the usual
enable/disable access functions don't adjust the pixmap devPrivate field,
leaving it to the frame buffer allocation code to assign this correctly.

During mode setting and fb resizing, FB access is disabled, and the
screen pixmap devPrivate is stashed away by xf86EnableDisableFBAccess,
to be restored when FB access is turned back on. This means that we have to
set the pixmap devPrivate.ptr (in case xf86EnableDisableFBAccess doesn't
do this), along with storing the address in the scrn->pixmapPrivate field.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-07-07 14:22:50 -07:00
Chris Wilson c889b34e43 Check for a valid I830Ptr before closing master.
After failing to become DRM master, the X server dies attempting to close
the master fd during free:

(EE) intel(0): [drm] failed to set drm interface version.
(EE) intel(0): Failed to become DRM master.
(EE) intel(0): failed to get resources: Bad file descriptor
(EE) intel(0): Kernel modesetting setup failed

Backtrace:
0: X(xorg_backtrace+0x3b) [0x8133a3b]
1: X(xf86SigHandler+0x55) [0x80c7945]
2: [0xb805d400]
3: /usr/lib/xorg/modules/drivers//intel_drv.so [0xb7b4bfcc]
4: X(xf86DeleteScreen+0x6b) [0x80d465b]
5: X(InitOutput+0x548) [0x80b0158]
6: X(main+0x1cb) [0x807220b]
7: /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb7d107a5]
8: X [0x8071881]
Saw signal 11.  Server aborting.
 ddxSigGiveUp: Closing log
 ddxSigGiveUp: re-raising 11
Segmentation fault

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-07-07 18:17:57 +01:00
Keith Packard 705042f497 Handle DRI2INFOREC version 3
This DRI2 version does not support the old CreateBuffers/DestroyBuffers
interface anymore.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-06 13:50:34 -07:00
Keith Packard 2ebc7d32e4 Update to multi-API DRI2 interface
The DRI2 interface was changed to support both old and new drivers in an
API/ABI compatible fashion. This change syncs the intel driver with the new
version of the DRI2 API.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-06 13:50:34 -07:00
Rémi Cardona f6f79eb629 remove unused shader program
This file is not even referenced by any Makefile.am

Acked-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-07-06 11:01:31 +02:00
Zhenyu Wang 7e722ada53 Disable FBC on IGDNG
Don't make FBC count for memory allocation.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-07-06 16:25:13 +08:00
Barry Scott 7422714192 Fix segv for clipped movie window
When playing a movie that is clipped on its left and right edges the Xorg
server will SEGV sometimes. This is because the intel driver ignores the
clipping info when it copies the planes out of the XV data.

The check for the optimised copy was wrong to ignore the width required.
Which leads to too much data being copied by the memcpy. It the source buffer
happens to end exactly on a page boundary the server will SEGV.

As we reviewed the code we checked the calculation of src1, src2 and src3.
The patch includes additional comments to make it clear what the elements of
the calculation are.

This bug exists in git head and we also see it in 2.4.1.

Barry

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2009-07-02 13:36:56 -07:00
Jesse Barnes c1755599db Clear the bo on the rotate scratch pixmap
Since the scratch pixmap header will be re-used after allocation, we
need to clear its bo attachment when we stop using it, otherwise a later
user will use a bogus bo.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-07-02 13:08:15 -07:00
Daniel Vetter 324b468620 Xv i830_display_video splitup: extract i830_update_scaling_factors
Just moved the code, no other changes.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2009-07-02 11:10:55 -07:00
Daniel Vetter c2410addbf Xv i830_display_video splitup: extract i830_update_polyphase_coeffs
To slightly clean up the implementation of i830_update_polyphase_coeffs,
introduce the two small helper functions i830_limit_coeff and
i830_store coeffs_in_overlay_regs.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2009-07-02 09:39:58 -07:00
Daniel Vetter 795c11c49c Xv i830_display_video splitup: extract i830_update_dst_box_to_crtc_coords
Just moved the code ouf of line.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2009-07-02 09:24:19 -07:00
Daniel Vetter 4100abdf5d Xv: kill !textured condition
This is in the overlay path and therefore always true.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2009-07-01 15:38:54 -07:00
Daniel Vetter b0df0fe91e Xv overlay: implement GAMMA5 errata
- also ensure that the most significant byte is zero
- while I was looking at the code, add the Overlay suffix to
SetPortAttribute like in the textured case.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2009-07-01 15:38:54 -07:00
Daniel Vetter 5ef4d3cde1 Xv: kill unneeded indirection
overlay and textured video have the exact same QueryImageAttributes
function.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2009-07-01 15:38:54 -07:00
Zhenyu Wang 7e79fc8aa9 Fix 945GM VT switch in UMS
Bug #19578. We should set private intel_crtc state according
to current, as fail to do so pipe A needs active won't be taken
care of. Also make sure pipe swap operation always set during
VT switch.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-07-01 10:17:01 +08:00
Zhenyu Wang 50392ac823 Load fbcon too if kernel mode setting is checked on
If i915 module has already been loaded and kms check is true,
it would be nice to load fbcon module too.

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
2009-07-01 10:15:45 +08:00
Jesse Barnes 058ad9e6ab Don't try to pin buffers in KMS mode
The only things we try to pin in KMS mode are the cursor objects and
front buffer, and those are taken care of by the kernel anyway, so we
shouldn't even bother trying to pin them (well, not entirely true,
XvMC tries to pin as well, but it needs work w/KMS anyway).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-30 16:02:19 -07:00
Jesse Barnes cec9fc6f6c Make KMS set_resource function return TRUE
This is what's expected by the server, and allows the EDID for example
to be exported in the KMS case.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-30 12:27:59 -07:00
Jesse Barnes 53e248af43 Use DVO timing block instead of fp_timing when parsing LFP data
The KMS side was correct, but the UMS patch was broken.  We need to use
the DVO timing block of the LFP data to get the timing, not the
fp_timing block.

Fixes fdo bug #22529.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-30 12:02:12 -07:00
Jesse Barnes 362883c2f9 Add a few error messages for DRM initialization
Makes it easier to see where things go wrong.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-30 12:02:12 -07:00
Zhenyu Wang afac333bef Remove unused packed yuv sampler shader programs
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-30 11:12:12 +08:00
Zhenyu Wang 150c9adebc Xv: fix domain usage for binding table on i965+ chips
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-30 11:12:12 +08:00
Zhenyu Wang 7770958e42 Add XV support on IGDNG
This brings necessary change for IGDNG for texture video support
from 2D render code.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-30 11:12:12 +08:00
Xiang Haihao f806fe7d67 Enable 2D composite on IGDNG
This patch enables 2D composite on IGDNG. IGDNG requires
new compiled shader programs for Gen5 and some command changes.
The most notable is the layout of vertex element has changed,
but we tried to keep it as origin to not change shader programs.
Also vertex buffer state requires end address of vertex buffer
instead of origin max index.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-30 11:12:12 +08:00
Zhenyu Wang 9fb34012f6 Add new compiled shader program for IGDNG
Also check intel-gen4asm tool here for new -g option, which is
required to compile new programs.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-30 11:12:12 +08:00
Zhenyu Wang 488acc4595 Move shader programs under its own subdirectory
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-30 11:12:12 +08:00
Jesse Barnes 170cae0c8d Only get the VBIOS in non-KMS mode
In KMS mode, the kernel takes care of this for us, so don't bother.
2009-06-29 12:55:43 -07:00
Jesse Barnes 6511c08245 Output error info if we fail to get DRM resources
Useful for debugging.
2009-06-29 12:53:51 -07:00
Jesse Barnes 00eb73286c Use swapbuffers_wait control
Commit 1eec83a203, which added the new
SwapbuffersWait option, didn't actually include the code which used it.  So
add a test to DRI2's CopyRegion call, only emitting the scanline wait
command if the swapbuffers_wait option is set.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-29 09:15:19 -07:00
Zhenyu Wang f53b3239db Disable XvMC on 915G/GM in KMS
These chips require physical address for XvMC surface, which
is not available in KMS case. Instead of crashing X, disable it now.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-29 13:44:58 +08:00
Jesse Barnes f0270bbb47 Fix i830_crtc_on to only check outputs associated with the given CRTC
Otherwise we may end up returning a false positive if some other output & crtc
are on, but not the one in question, again leading to hangs.

Reported-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-24 14:42:08 -07:00
Jesse Barnes 5d80e24b5f Treat disabled CRTCs as "not covering" for scanline wait purposes
Now that swapbuffers does a scanline wait to avoid tearing, it's
important to take into account the CRTC status to avoid hangs.  If we
do a scanline wait when the CRTC is off (due to DPMS for example) we'll
hang the GPU.  So add some code to check the CRTC DPMS status to the
i830_covering_crtc function, returning NULL if none of the covering
CRTCs are actually active.  KMS vs UMS logic is hidden in new i830*
functions, cleaning up both DRI2 & video paths a bit.

Fixes fdo bug #22383.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-24 13:13:07 -07:00
Alan Coopersmith 6d025e679a Harden i830 render in case check_composite didn't throw out bad formats.
Fixes a warning in a static analysis program, and the code's a little
clearer.

Bug #21667
2009-06-23 15:35:41 -07:00
Jesse Barnes 1eec83a203 Add option to control swapbuffers behavior
Until we get triple buffering, we'll want this so users can avoid taking a
performance hit on apps that render slower than the refresh rate.

Fixes fdo bug #22234.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-23 15:05:03 -07:00
Zou Nan hai bfeeac6de0 i915 xvmc, fix fd.o bug #22103 2009-06-23 11:31:37 +08:00
Jesse Barnes 15af8ea6ab Fix LFP data block fetch
Apparently the proper way to do this is to use the LFP data pointer block to figure out the LFP data block entry size, then use that plus the panel index to calculate an offset into the LFP data block array.

Fixes fdo bug #19450.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-22 11:13:30 -07:00
Zhao Yakui 534e73ad4f Don't change the blank/sync width when calculating scaled modes
Don't the change the blank/vsync width while doing LVDS scaled modes.
And use the border instead of border minus one.

At the same time, make sure the horizontal border and hsync are even for
the LVDS that works in dual-channel mode. So both horizontal border and hsync
start are also changed to be even, even for the LVDS in single-channel
mode.

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

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-06-19 09:37:45 -07:00
ling.ma@intel.com b5cd2130f9 TV: Set correct voltage level override values
We detect TV connect status by setting DAC voltage level override
values as 0.7 voltage for DAC_A/B/C. The corresponding 2-bits shold be 0x2,
In order correctly to set last bit as 0, at first we must clean it.

It fixed freedesktop.org bug #21204

Signed-off-by: Ma Ling <ling.ma@intel.com>
2009-06-17 10:06:02 +08:00
ling.ma@intel.com a6cdcd9fee Set hot plug interrupt to detect HDMI output
We detect HDMI output connection status by writing to HOT Plug Interrupt
Detect Enable bit in PORT_HOTPLUG_EN. The behavior will generate an specified
interrupt, which is caught by audio driver, but during one detection driver
set all Detect Enable bits of HDMIB, HDMIC and HDMID, which generate wrong
interrupt signals for current output, according to the signals audio driver
misunderstand device status. The patch intends to handle corresponding output
precisely.

It fixed fredesktop bug #21371

Signed-off-by: Ma Ling <ling.ma@intel.com>
2009-06-17 10:05:47 +08:00
Bryce Harrington 6b93afc564 add pipe a force quirk for Dell mini
Add quirk to solve issue with black screen and hang occuring after closing the
lid with attached external monitor, on Dell Mini.

Fixes fdo bug #21960.

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
2009-06-16 15:37:48 -07:00
Li Peng eb09014ce1 don't wait for vblank on rotated displays
We may hang or wait for the wrong line if the display is rotated, so just skip
the wait in that case.

Fixes fdo bug #22196.
2009-06-16 15:29:57 -07:00
Bryce Harrington 6c56521bdc pipe-a quirk for thinkpad x30
Fixes freeze when closing lid on ThinkPad X30.

Fixes FDO bug # 21976.

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
2009-06-16 15:25:53 -07:00
Zhao Yakui 246cec9659 Fix EDID for LVDS output device to add the default modes
Fix the EDID for the LVDS output device to add the default modes.This is
similar to what we have done in UMS mode.
a. When there exists the EDID, either find the DS_RANGES block or replace
a DS_VENDOR block, smashing it into a DS_RANGES block with open refresh
to match all the defaults modes.
b. When there is no EDID, we will construct a bogus EDID and add a DS_RANGES
block with the open refresh to match all the default modes.

http://bugs.freedesktop.org/show_bug.cgi?id=20801
http://bugs.freedesktop.org/show_bug.cgi?id=21094
http://bugs.freedesktop.org/show_bug.cgi?id=21346
http://bugs.freedesktop.org/show_bug.cgi?id=21417
http://bugs.freedesktop.org/show_bug.cgi?id=21671

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-06-16 11:27:18 +08:00
Zhao Yakui 5d1dc76770 Get the LVDS panel limit and check whether the given modeline is valid
When the connector type is LVDS, it will traverse the mode list returned by
KMS kernel to get the LVDS panel limit. Then it will use the panel limit to
check whether the given modeline is valid. If the given modeline exceeds
the LVDS panel limit, it will be invalid.

http://bugs.freedesktop.org/show_bug.cgi?id=20801
http://bugs.freedesktop.org/show_bug.cgi?id=21094
http://bugs.freedesktop.org/show_bug.cgi?id=21346
http://bugs.freedesktop.org/show_bug.cgi?id=21417
http://bugs.freedesktop.org/show_bug.cgi?id=21671

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-06-16 11:27:18 +08:00
Zhao Yakui 115e28639f Add the private data for the LVDS connector
Add the private data when the connector type is LVDS.
We can use the private_data to store the LVDS panel limit.
For example: Hdisplay, Vdisplay.

http://bugs.freedesktop.org/show_bug.cgi?id=20801
http://bugs.freedesktop.org/show_bug.cgi?id=21094
http://bugs.freedesktop.org/show_bug.cgi?id=21346
http://bugs.freedesktop.org/show_bug.cgi?id=21417
http://bugs.freedesktop.org/show_bug.cgi?id=21671

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-06-16 11:27:18 +08:00
Zhao Yakui 3da549f5b3 GFX: Initialize the SDVO device based on the valid slave address
When the slave address is found for the SDVO port, the SDVO device will
be initialzied.
When the slave address is not found for the SDVO port, it will return
the slave address by using the following flowchart:
a. If the SDVO device info is found for another SDVO port, it will return
the slave address that is not used. For example: if 0x70 is used, then 0x72
is returned.
b. If no SDVO device info is found for another SDVO port, it will return
0x70 for SDVOB and 0x72 for SDVOC.

http://bugs.freedesktop.org/show_bug.cgi?id=20429

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-06-15 14:56:56 +08:00
Zhao Yakui 51b87b9913 parse general definition block to get the SDVO device info
The general definition block contains the child device tables, which include
the child device info. For example: device slave address, device dvo port,
device type.
We will get the info of SDVO device by parsing the general definition blocks.
Only when a valid slave address is found, it is regarded as the SDVO device.
And the info of DVO port and slave address is recorded.

http://bugs.freedesktop.org/show_bug.cgi?id=20429

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-06-15 14:56:56 +08:00
Zhao Yakui 6ba148bbd7 Dynamically get the number of child device in general definition block
The size of general definition block varies on different platform/machines.
In such case the number of child device is also different.
And it will be better to get the number of child device in general definition
block dynamically.

The number of child device can be calculated by the following formula:
	(block_size - block_header_size) /
		sizeof( struct child_device_config)

http://bugs.freedesktop.org/show_bug.cgi?id=20429

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2009-06-15 14:56:56 +08:00
Keith Packard cdbf84f202 intel_batch_init: test have_gem, not directRenderingType
Under KMS, directRenderingType will get set to DRI_NONE during driver
initialization. When the first batch buffer is allocated, as
directRenderingType is DRI_NONE, the GEM bufmgr would get trashed as
intel_batch_init called a fake-bufmgr specific function.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-06-11 13:57:09 -07:00
Julien Cristau 6d062e9e9f Fix xvmc build
If we don't find xext.pc, disable xvmc instead of failing configure
Also add dependencies on xfixes and dri2proto (src/xvmc/dri2.h includes
<X11/extensions/Xfixes.h> and <X11/extensions/dri2tokens.h>).
2009-06-11 17:51:38 +02:00
Lukasz Kurylo e5bfa2702a DRI2 copyregion: don't wait for scanlines that won't happen
In some configurations, it's possible to wait for a scanline outside of
a given CRTC range.  Make sure that can't happen to fix multihead cases
with dead space.

Fixes fdo bug #22203.

Signed-off-by: Lukasz Kurylo <Lukasz.Kurylo@gmail.com>
2009-06-10 07:55:31 -07:00
Zou Nan hai cda5561716 add missing files for previous commit 2009-06-10 16:43:30 +08:00
Zou Nan hai 6d500be3cd enable MC on g45 for player without vld patch 2009-06-10 15:53:24 +08:00
Zhenyu Wang 88da9b4873 Add new chipset register dumps
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-10 10:46:24 +08:00
Zhenyu Wang 0d56ef94be Disable composite on new chipset for now
This depends on updated intel-gen4asm be ready for new chip.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-10 10:37:33 +08:00
Zhenyu Wang 440ccc44f5 Add new register definitions
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-10 10:37:01 +08:00
Zhenyu Wang 0d8a9e2c6f Update intel_gtt utility for new chipset GTT check
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-10 10:36:46 +08:00
Zhenyu Wang fb524caa3e Remove fixed MMIO size
Use pci resource size instead, which will get the correct MMIO range.
New chipset uses obviously larger MMIO range.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-10 10:26:03 +08:00
Zhenyu Wang 4f40b33ef4 Add new chipsets PCI ids
Desktop and mobile version of new chipsets are added.
Also do memory config like Intel 4 series chipset.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-06-10 10:24:51 +08:00
Carl Worth b5e32c9cf8 Rename i830_exa.c to i830_uxa.c
It was just confusing otherwise, (since the EXA code has all been
removed now).
2009-06-09 17:24:48 -07:00
Kristian Høgsberg ee539e58c3 Fall back to fb pixmaps for backing glyph pictures
GEM pads pixmaps to 512 byte stride and backs them with a kernel side
buffer objects.  We typically don't render out of glyph pictures, so
we're incurring a lot of overhead per glyph by allocating a GEM pixmap
per glyph.  By looking at the usage hint, we can fall back to
fbCreatePixmap for pixmaps backing glyph pictures, which gives us
a nice tight malloced pixmap.  The fast path for text rendering is
compositing from the glyph cache pixmap to the destination, which
shouldn't be significantly affected.

Quick bit of testing:
(firefox-20090601)
    xlib-rgba-before    384512.49:  1.01x
    xlib-rgba-after     389633.94:  1.00x
The difference being within the margin of error for the benchmark.

Signed-off-by: Eric Anholt <eric@anholt.net>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-06-09 10:28:27 -07:00
Xiang, Haihao 4698b3bd79 xvmc: don't include xf86dri.h 2009-06-09 10:28:27 -07:00
root 4d9f3a21ab Merge branch 'xvmc-vld' 2009-06-04 10:27:41 +08:00
Eric Anholt b8e360bf2b Fix segfault in DRI2 vblank syncing if the region isn't onscreen.
Also, fix some weirdness in the checking for whether the target was the
screen.
2009-06-03 10:19:25 +00:00
Eric Anholt 5901a67fc8 Fix some drawable abuse in i830_dri.c
We were casting pixmaps to drawables even if they weren't pixmaps.  They did
happen to work out since we only used the drawable record out of them.
2009-06-03 10:19:25 +00:00
Eric Anholt 5e48146777 Replace some pixmap-related idioms with inline functions to do so. 2009-06-03 10:19:25 +00:00