Commit Graph

3029 Commits

Author SHA1 Message Date
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
Ma Ling ea0b00e675 Provide mode line from VBT to xorg.
If sdvo get modes function can't find modes from EDID,
transmit sdvo lvds modes from VBT to xorg.

Signed-off-by: Ma Ling <ling.ma@intel.com>
2009-06-03 09:49:29 +08:00
Ma Ling 9e7ee50bea Fetch mode line from VBT, then keep it.
Parse SDVO LVDS option section, then according to panel type
fetch fixed mode line from SDVO LVDS DTDS section .

Signed-off-by: Ma Ling <ling.ma@intel.com>
2009-06-03 09:49:29 +08:00
Ma Ling 88f766be00 Wait doubled regis to be stable for load pipe detection
We have two approaches for VGA detections: hot plug detection for 945G onwards
and load pipe detection for Pre-945G. load pipe detection will get one free
pipe ,and set border color as red and blue, then check CRT status by
swf register. Because pipe registers in hires mode are double buffered,
once set force border bit in pipeconf register, we have to wait for
a vblank until it is effective, otherwise result is unstable.

It fixed freedesktop bug #20463

Signed-off-by: Ma Ling <ling.ma@intel.com>
2009-06-03 09:49:29 +08:00
Ma Ling 6a635be5ea Set activation periods as 64 cdclk sync up with KMS
We use force CRT detect trigger bit(1 << 3) to detect VGA in hot plug mode,
which triggers a CRT hotplug/unplug detection cycle independent of the
interrupt enable bit(1 << 9), so keep bit 9.
And although spec says CRT_HOTPLUG_ACTIVATION_PERIOD_64(1 << 8) is only useful
for mobile platform, it is also required to detect vga on G4x platform correctly.
Tested the patch on G45/G43/Q45 platforms with no regressions

It fixed freedesktop.org bug #21120 and part of bug #21210.

Signed-off-by: Ma Ling <ling.ma@intel.com>
2009-06-03 09:49:29 +08:00
Jesse Barnes ec2fde7c82 Sync DRI2 CopyRegion to vertical retrace
Akin to the Xv code, wait for the scanline to be outside the range to be
copied by the DRI2 CopyRegion hook.

Fixes fdo bug #20664.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-06-02 16:45:12 +01:00
Adam Jackson 704771f1c5 Remove useless loader symbol lists. 2009-05-28 15:03:45 -04:00
Carl Worth 8e942b70cb Revert "Rely on BO pixmaps being present in acceleration paths."
This reverts commit 4653a7db62.

Eric was getting a little too ambitious about our brave, new world.
We do still want the driver to work with old, non-GEM kernels
after all.
2009-05-26 16:12:17 -07:00
Eric Anholt 1a039f4371 Fold GEM detection into DRM master open.
We don't have anything to do with the DRM unless it's GEM-enabled, unless
we were to support GEM-but-not-DRI2, which doesn't seem useful.

Compilation fixes by Carl Worth <cworth@cworth.org>
2009-05-26 16:12:16 -07:00
Eric Anholt a04a51c9bb Open the DRM and keep the handle throughout server startup to finish.
This will let us configure the server from start to finish with the
most pertinent information available (KMS vs UMS, DRI2 vs non-DRI).  Also,
we now close the DRI2 fd at terminate, which we didn't before.

This duplicates some code from DRI1 for getting a master FD like I'd done in
DRI2, but given that we weren't loading DRI1 ourselves, this is also a
bogosity cleanup, and avoids allocating the extra DRI1 private.
2009-05-26 16:12:16 -07:00
Eric Anholt c3bf8b9801 Fix backwards logic on whether to sync to vblank or not.
Thanks to Michel Dänzer for catching it.
2009-05-26 11:04:54 -07:00
Kristian Høgsberg ad2128825b Only return FALSE when dri_bo_map() fails
Small typo in the previous commit.
2009-05-20 12:32:10 -04:00
Eric Anholt 09beee378c Don't do GTT maps on objects bigger than half the available aperture size.
The basic problem is that software fallbacks will do single instructions that
copy from one GTT-mapped BO into another GTT-mapped BO.  If we can't get both
of them bound simultanously, we fault one in, retry the instruction, fault the
other in (kicking out #1), retry the instruction, fault #1 back in
(kicking out #2), etc.

Note that we'll still get into a nasty spot if you do a composite operation
with a mask where all 3 are big-but-less-than-half-available-aperture, where
you'll thrash.  It at least means you'll make progress, though, since each
instruction will only be operating on two BOs at at time, and the situation
seems unlikely.

Bug #20152 (3/3)
2009-05-19 10:09:41 -07:00
Li Shao Hua 52054b6a4c switch XvMC to gem 2009-05-19 16:27:32 +08:00
Eric Anholt 34660fd2df Only sync XV to vblank when drawing to the frontbuffer.
This fixes emitting syncs to random pipes with boxes bigger than that
pipe's vertical, leading to GPU hangs.

Bug #21738
2009-05-18 10:44:34 -07:00
Xiang Hai hao b622860429 DRI2 for XvMC 2009-05-18 17:12:30 +08:00
Zou Nan hai 50c10ededb Merge branch 'master' into xvmc-vld 2009-05-18 17:11:28 +08:00
Keith Packard 87332a7cc1 Use drm_intel_bo_disable_reuse API to flag scanout and cursor buffers
Buffers referenced by the kernel for scanout or cursor display should not be
reused by the driver. Use the new drm API to disable reuse of these buffers.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-15 17:29:13 -07:00
Keith Packard 04772b6c09 If DRM can't figure out which pipe to sync on, then don't sync at all.
Syncing to the wrong pipe can wedge the hardware if the exclusion area is
larger than the vtotal

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-14 17:01:54 -07:00
Carl Worth 128c1c3b7d Use libdrm to lookup pipe for tear-free sync of XV
Previously, the code was trying to examine a driver_private field,
but those fields are only set by the userland-modesetting code so
would fail in the case of KMS. This fixes bug #21076:

[945GME] [KMS] XV_SYNC_TO_VBLANK does not prevent tearing of xv video
https://bugs.freedesktop.org/show_bug.cgi?id=21076
2009-05-14 17:01:53 -07:00
Eric Anholt b9462516d1 Remove dead "avail" variable from XAA stuff. 2009-05-14 14:04:38 -07:00
Jesse Barnes 1c68bc376a Add new have_gem flag
Prior to this patch, code that wanted to check whether GEM was present
would look at pI830->memory_manager.  This turned out to be occasionally
problematic in the KMS case, since memory_manager didn't always get set
correctly.  So add a new pI830->have_gem flag to make things clear in
the various code paths, and set it after GEM initializes or when KMS is
detected.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Magnus Kessler <Magnus.Kessler@gmx.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-05-13 13:19:53 -07:00
Keith Packard 5236784708 Load i915 and fbcon when checking for KMS
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-05-12 14:38:30 -07:00
Keith Packard ff7494b4c4 Add DP link and GMCH M and N registers
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-05-12 14:38:29 -07:00
Keith Packard e54a23bff0 Fallback when VT inactive
While the VT is inactive, pI830->batch_bo will be NULL, so use that as a
simple check for when to not use the accelerator. The alternative is to
ignore VT switch and just keep drawing, which would also be fine.

Bug #21468.

Signed-off-by: Keith Packard <keithp@keithp.com>
[anholt: Removed extra return FALSE -- I830FALLBACK does that.]
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-05-12 14:27:57 -07:00
Wu Fengguang 660bd745c2 Remove the offset parameter from i830_allocator_init()
offset is redundant.  i830_allocator_init() is only called
in one place with offset=0.

Acked-by: Magnus Kessler <Magnus.Kessler@gmx.net>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-05-12 14:25:10 -07:00
Alan Coopersmith f16ee21884 Fix "Unkown" typo in two FatalError messages
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-10 16:25:24 -07:00
Stijn van Drongelen 8d27247829 Fix typo in (unused) INTEL_BIOS_32 macro
Debian bug#527062 <http://bugs.debian.org/527062>

[jcristau: fix same typo in bios_reader.c]
Signed-off-by: Julien Cristau <jcristau@debian.org>
2009-05-05 16:38:59 +02:00
Keith Packard 8255cca2c9 Split i915 textured video commands to fit into batch buffers.
i915 textured video commands are quite long, but must be contained in the
same batch buffer as the 3D setup commands. When the number of clip rects
for the video becomes too large for the associated commands to fit in the
same batch buffer, this change breaks the sequence into pieces, ensuring
that each batch contains the necessary setup sequence.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-01 18:34:43 -07:00
Keith Packard e5e0fb846b Call down to lower CloseScreen before shutting down DRM allocator
Lower level functions will destroy objects that are managed by the DRM
allocator, so make sure those are done before the allocator shuts down.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-01 12:26:04 -07:00
Keith Packard cfb98f3da9 Revert "Leave allocator running until lower-level CloseScreens are done"
Uh, oops -- the FD used to talk to the kernel is closed before the
allocator_fini function is called now.

This reverts commit 1872869e6f.
2009-05-01 12:23:32 -07:00
Keith Packard 11a853bd8e Hold reference to video binding table until all rects are painted.
The optimization of unreferencing the binding table when the relocation is
posted causes the object to be dereferenced for each box in the clip list,
causing general chaos in the buffer manager. It's easier to just hold a
reference to the object until all of the boxes are painted and then drop it.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-01 11:55:13 -07:00
Keith Packard ed492131c1 3D_STATE_VERTEX_BUFFERS takes four 32-bit values, not three.
The spec says this command takes an extra (mbz) 32-bit value, so let's
provide it with one.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-01 11:54:48 -07:00
Keith Packard 66d1536a2e Don't bother to enable VF statistics during 965 video playback
This was used while bringing up the driver to debug vertext fetches.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-01 11:54:42 -07:00
Keith Packard 1872869e6f Leave allocator running until lower-level CloseScreens are done
The lower level close screen functions will free allocated objects, causing
a crash if the allocator isn't still available.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-01 11:54:32 -07:00
Keith Packard 1142353b48 intel_batch_start_atomic: fix size passed to intel_batch_require_space (*4)
intel_batch_start_atomic takes an argument in 32-bit units, and so it must
multiply that by 4 before passing it to intel_batch_require_space, which
takes an argument in bytes.

We should figure out what units we want to use and use the same everywhere...

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-01 11:54:26 -07:00
Keith Packard 8232177a00 Allow cursors to roam past 2048x2048 limit.
There's no reason to clip cursor positions to an artificial limit; the
hardware cursor limits always mirror the hardware display limits.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-04-30 15:30:05 -07:00
Kristian Høgsberg a90cab4320 Remove a handful of pointless comments
CVS keywords, comments about how the source was once reformatted,
and the ad-hoc changelog comment in in i830_driver.c
2009-04-28 13:27:53 -04:00
Eric Anholt c231b41f3f Remove checks for xf86RotateFreeShadow, introduced in server 1.4. 2009-04-27 17:06:00 -07:00
Eric Anholt e5133a94dc unifdef LIBPCIACCESS and XSERVER_LIBPCIACCESS.
Depending on new server means these are always present.
2009-04-27 17:05:59 -07:00
Eric Anholt 4653a7db62 Rely on BO pixmaps being present in acceleration paths. 2009-04-27 17:05:59 -07:00
Eric Anholt 1784efc1f0 Remove XF86DRM_MODE.
We now depend on server 1.6 and current libdrm, so no need to ifdef it.
2009-04-27 17:05:59 -07:00
Eric Anholt d82ea4372f Replace I830Sync's irq emit/wait code with bufmgr use.
This pre-GEM code was all sorts of broken -- see intel_bufmgr_fake.c for
the hoops that must be jumped to use that kernel interface successfully.
Yet we continued to use it even with KMS/DRI2/UXA, which may account for
some hangs.
2009-04-27 17:05:59 -07:00
Eric Anholt 612c1f1f18 Remove I830_XV ifdef.
The developers of the driver don't ever run or test without XV.  Don't do it.
2009-04-27 17:05:59 -07:00
Eric Anholt af6892f2b8 Replace i830WaitSync with just I830Sync(), as nearly all callers had it wrong.
People were trying to BEGIN_BATCH()/ADVANCE_BATCH() then i830WaitSync on the
results, which wouldn't necessarily wait and lead to various painful bugs,
since only EXA called MarkSync and only for certain rendering operations.
2009-04-27 17:05:59 -07:00
Eric Anholt 393abc15b7 Now that video destination pixmaps are always in BOs, no more MarkSync. 2009-04-27 17:05:59 -07:00
Eric Anholt dc71573292 Remove can_resize, which is now always true (except when a bug interfered) 2009-04-27 17:05:59 -07:00
Eric Anholt 96df22740b unifdef I830_USE_UXA.
We only have on acceleration architecture now, and you can always build it
if you're building the driver.
2009-04-27 17:05:59 -07:00
Eric Anholt fa81ae1637 Remove EXA support.
UXA has completely replaced EXA at this point.  UXA is the same rendering
core as EXA, but relying on kernel memory management or a fake bufmgr instead
of trying to manage memory in the X Server.
2009-04-27 17:05:59 -07:00
Eric Anholt 1b10745a25 Remove XAA support.
While EXA/UXA aren't completely good replacements (see bugzilla for
performance and stability problems), we are pretty sure at this point that
it's the right way to go and that having multiple acceleration architectures
is getting in the way of producing a stable codebase.
2009-04-27 17:05:59 -07:00
Eric Anholt 30c226eeb3 Remove DRI1 support.
This was blocked on wide distribution of X Server 1.6 (now in the current or
next version of major distributions) and solutions for a couple of significant
architectural problems (vblank sync and frontbuffer rendering, which we now
have code or good plans for).

This includes disabling XVMC which is DRI1-only currently.
2009-04-27 17:05:55 -07:00
Eric Anholt 47591334a1 Remove pre-server-1.5 support. 2009-04-27 16:50:34 -07:00
Eric Anholt 3187c7698b Fix assert at startup with DRI initialiation failure.
In this path, we'd make it to allocator_init -> init_bufmgr without
GEM and without FbBase being initialized, leading to assertion failure
to catch this mistake.

Comedy ensued when trying to move just the MapMem up, leading to the rest
of the commit.  Some day (like tomorrow after I rebase intel-cleanup) I'll
clean this path up.

Tested with 2 X Servers on 2.6.28 (one gets DRI2, one fails successfully),
2 UMS X Servers on 2.6.30rc2 (each gets DRI2), and 2 KMS X Servers on
2.6.30rc2 (success all around).
2009-04-27 16:32:25 -07:00
Eric Anholt fbaf13c935 Don't clear the framebuffer if it isn't currently bound.
This segfault can be triggered in non-KMS memory init before the EnterVT,
and will happen anyway at EnterVT time.
2009-04-27 16:32:25 -07:00
Eric Anholt ab878118b9 Don't initialize DRI2 if the fd we get is not master-capable. 2009-04-27 16:32:25 -07:00
Eric Anholt 385ac2197b Fix drmSetMaster/DropMaster error messages. 2009-04-27 16:32:25 -07:00
Pierre Willenbrock 5b05a589ef format == 0 means "use default" in I830DRI2CreateBuffer
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2009-04-27 12:00:49 -07:00
Eric Anholt e55d943126 Don't try to do anything for I830Sync when VT switched.
Fixes a crash with fake bufmgr and UXA.
2009-04-27 11:19:00 -07:00
Shuang He 9748aa5594 Free front buffer bo when X exit
It's needed when KMS or DRI2 is enabled, or there will be memory leak.
Also fixes a segfault at startup with fake bufmgr.

Signed-off-by: Eric Anholt <eric@anholt.net>
2009-04-24 16:48:25 -07:00
Alan Coopersmith b8ca146b06 Fix UXA to build with Sun compilers (use __func__ instead of __FUNCTION__)
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-04-24 16:04:13 -07:00
Ian Romanick 5d6f4f6eb7 DRI2: If the SDK supports it, use the DRI2GetBuffersWithFormat interfaces
If DRI2INFOREC_VERSION is defined in the server's dri2.h and has a
value greater than 1, compile to use the CreateBuffer and
DestroyBuffer interfaces.  The format parameter parameter to
CreateBuffer is assumed to be the bits-per-pixel of the buffer.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-24 12:53:16 -07:00
Zhenyu Wang 106e4b44c5 SDVO: switch bus once for i2c transfer
Before sdvo try to get edid by i2c bus, it must do switch control bus to ddc active state from sdvo only state.
However if current state has been ddc active state, redundant switch operation in our driver will cause error-
"Unable to write to SDVOCTRL_E for SDVOB Slave 0x70". The patch will do switch control bus only one time during
whole edid transmission.

It has fixed bug #19937

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
Tested-by: Ma Ling <ling.ma@intel.com>
Signed-off-by: Ma Ling <ling.ma@intel.com>
2009-04-24 10:55:09 +08:00
Shaohua Li 8f64837e56 Disable FBC on IGD for UMS
It appears the new chip doesn't support FBC currently.

Signed-off-by: Shaohua Li<shaohua.li@intel.com>
Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
2009-04-24 08:54:09 +08:00
Eric Anholt 7b01aa5cc4 Revert "fix overflow warning on videoRam"
This reverts commit 08ebde4715, which was
apparently untested and broke KMS.
2009-04-22 09:07:12 -07:00
Zdenek Kabelac ceb3a2eaf9 Remember allocated offscreenImages memory for freeing it in CloseScreen()
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
[anholt: renamed the member to match the variable name]
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-04-21 19:54:21 -07:00
Zdenek Kabelac 701c6bef14 free allocated name inside sdvo_destroy
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-04-21 19:54:21 -07:00
Zdenek Kabelac fe71217ca8 Unreference allocated bos in i965 render error paths
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-04-21 19:54:14 -07:00
Zdenek Kabelac b8b6ca830b Fix leak of some 965 render state on VT switch.
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
[anholt: fixed up unneeded != NULL checks]
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-04-21 18:48:45 -07:00
Albert Damen d7ca870e1c Fix crash with XV with large virtual display
If a virtual display with width > 2048 is used, the first time
an XV buffer is needed will result in a BadAlloc error message,
but the next time X would crash.

Signed-off-by: Eric Anholt <eric@anholt.net>
2009-04-21 16:53:50 -07:00
Eric Anholt 04ed92e3db Remove dead xoffset/yoffset from pre-randr. 2009-04-21 15:28:59 -07:00
Eric Anholt ab2c988767 Remove dead monitor detect debugger.
watch xrandr works fine.
2009-04-21 15:28:59 -07:00
Eric Anholt 928a37041d Replace a bunch of #ifdef debug flushing/syncing with a single function.
This removes it from a callsite where it would have just resulted in a
fatalerror.
2009-04-21 15:28:55 -07:00
Eric Anholt 1fc93ee184 Staticize a bunch of functions and variables in the driver.
This cleans up findstatic.pl output for the i830+ code, which resulted in
removing some code.  The only odd part of this commit is the
if (0) i830_sdvo_dump() in i830_sdvo.c -- it tells the compiler that the code
is used, without using it since we want the code around while debugging.
It's also in a likely place to ask for the dump, so I think it's OK.
2009-04-21 15:25:58 -07:00
Eric Anholt b2d7928f19 Use a static inline to replace if (0) to an unused stub function. 2009-04-21 15:25:58 -07:00
Eric Anholt 093f51646b Remove unused i830_output_type_names 2009-04-21 15:25:58 -07:00
Eric Anholt c774ef282b Remove dead mono cursor load code. 2009-04-21 15:25:58 -07:00
Eric Anholt 75c531b965 Rename EXA rendering functions to UXA, since we're keeping them post-EXA. 2009-04-21 15:25:58 -07:00
Eric Anholt 40dbba5cf7 Remove some dead i830.h struct members. 2009-04-21 15:25:58 -07:00
Julien Cristau 84f69081ab Require xserver 1.3
I don't think anyone tests this against an old server anymore.

Signed-off-by: Eric Anholt <eric@anholt.net>
2009-04-21 15:25:58 -07:00
Zhenyu Wang 08ebde4715 fix overflow warning on videoRam
Note that pScrn->videoRam is an 'int'.

i830_driver.c: In function ‘I830ScreenInit’:
i830_driver.c:3019: warning: overflow in implicit constant conversion

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
2009-04-20 09:43:09 +08:00
Ian Romanick 5a07ab502f DRI2: Respect the src and dst parameters of CopyRegion.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-17 20:59:04 -07:00
Robert Lowery 4b5edde5da Fix typo in comment
Thanks to Robert Lowery for the sharp eyes on this one.
2009-04-15 18:03:31 -07:00
Carl Worth 506c810f8f Clarify that the default acceleration is UXA if KMS is available.
Stale documentation considered harmful of course.
2009-04-15 16:10:52 -07:00
Li Peng 9b615a5267 Turn on front buffer tiling in KMS.
This code disabled front buffer tiling in KMS. Turn it on since kernel
handles all tiling now, this improves performance of x11perf -aa10text
from 97k to 286k on my 945GME.

Should help with #20761, if not totally fix it.

Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Li Peng <peng.li@intel.com>
2009-04-13 12:45:41 -07:00
Ma Ling 62ba7211fe set broadcast RGB mode for integrated HDMI output. 2009-04-13 14:30:45 +08:00
Ma Ling 69388953ce set broadcast RGB mode for HDMI and TMDS from SDVOX output
Almost all digital TVs accept broadcast RGB values from 16 to 235 for each channel,
otherwise for those uncompensated videos, when RGB values are set from 0 to 255,
they will shows black and whiter clamping, which seriously degrades picture quality.
The patch will enable the broadcast RGB mode for hdtv according to user's setting.
It fixed bug #14486
2009-04-13 14:29:44 +08:00
Jesse Barnes 7e516b6d24 Silence warning in i830_dmi_store_field
Just add a dummy ret variable to shut up gcc.
2009-04-08 17:01:57 -07:00
Jesse Barnes 620e97bbd6 Don't enable kernel execbuf fencing w/EXA
If we enable kernel execbuf fence register management, it's best if the
kernel manages all fence registers.  This works fine if the accel
method is managing pixmaps or doesn't use offscreen pixmaps.  However
with EXA, pixmap accesses are done relative to the framebuffer BAR
mapping (pI830->FbBase) and the Screen pixmap address.  So if we try to
set the screen pixmap to point at a GTT mapped (and therefore properly
fenced) address, later calls to intel_get_pixmap_offset() will call
into EXA, which will use the pseudo-random pixmap addr and the EXA
offscreen base addr (which is really just FbBase) to calculate the
offset.  This will fail.  So disable kernel fence reg management in the
EXA case (this is easier than adding proper EXA pixmap management to
xf86-video-intel, and makes more sense since we'll be removing EXA soon
anyway).

Fixes FDO #21027.

Also happens to fix FDO #21029 (as tested by Carl Worth <cworth@cworth.org).
2009-04-08 15:49:00 -07:00
Shuang He 0a0731c11d Fix value for MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW
Since the change to scan-line based video sync, (rather than vblank-
based), we've only been getting tear-free video on one of the two
pipes. This fixes that bug by using the correct constant for waiting
on PIPEA.
2009-04-07 12:32:59 -07:00
Carl Worth 940c2aad4d Don't clip video to CRTC in the case of textured video
Since we're not limited by a single overlay plane on a single pipe,
we want to not clip at all, (so that the correct video appears on
both pipes).

This fixes bug #20980 which shows a video spanning two pipes
being rendered incorrectly.
2009-04-07 12:32:58 -07:00
Zhenyu Wang 63b4b5efac quirk LVDS on ibase MB890 855GM board
fix bug #19529
2009-04-07 10:55:35 +08:00
Carl Worth 5d9d9a2e46 Fix new video sync-to-blank code for multi-head
We need to account for a non-zero Y offset for the CRTC. Without
this, we don't sync to the correct region, so tearing becomes
visible again.
2009-04-06 14:02:08 -07:00
Carl Worth 3d4ee3cac1 Remove support for 'auto'(-1) value of XV_SYNC_TO_VBLANK
We previously had a heurstic here where we would only sync to vblank
for windows that covered more than 25% of the screen. We don't need
this anymore since the new approach to sync, (WAIT_FOR_SCANLINE_WINDOW),
is not excessively costly for small windows.
2009-04-06 11:31:20 -07:00
Carl Worth bc3312fd7c Use WAIT_FOR_SCAN_LINE instead of WAIT_FOR_VBLANK
Either way, the goal is tear-free video playing. But waiting for
a scan-line window not only has the advantage of being cheaper
for small windows, but also avoids hanging the GPU in the case
of the pipe getting turned off, (by screensaver, for example),
while a batch is waiting for a VBLANK that will never occur.

This fixes that GPU hang.
2009-04-06 11:16:53 -07:00
Jesse Barnes 6cd914ef31 Fix offset in begin_gtt_access case
Don't use bo->virtual in the begin_gtt_access case, use the framebuffer
mapping and bo offset instead.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-04-03 11:15:18 -07:00
Zou Nan hai 13c730e003 fix
1.multiple instance
 2.memory leak
2009-04-01 15:12:55 +08:00
Zhenyu Wang fad714c400 SDVO: fix output flag dumping for unknown type
Found by Hugo Jacques <hugo.jacques@verint.com>
2009-04-01 10:11:35 +08:00
Hugo Jacques 00de1757dd SDVO: add composite TV out support 2009-04-01 10:10:05 +08:00
Jesse Barnes 087f72e1f5 Match GTT unmap with map in KMS rotation case
Missed this when the GTT unmap call was added.  If we don't do this we
trigger an assertion in libdrm, since the buffer has never been mapped
normally.

Fixes bug #20943.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-03-31 07:51:35 -07:00
Zhenyu Wang 4f046af760 Disable LVDS detect methods
Both methods ACPI lid and SWF bit have issues in LVDS detect from
wider testing. Fallback to origin code.
2009-03-31 14:32:43 +08:00
Albert Damen e964d4e53a Non-GEM allocations incorrectly force TILE_NONE (bug 20797)
With -intel 2.6.3 performance was very bad when using a non gem enabled kernel
(2.6.27) and EXA. For example sauerbraten ran with 4 fps and screensaver GLBlur
with 1 fps. With -intel 2.6.1 performance was good using the same kernel.

Git bisecting led me to commit f1ed73c1ef3e3daa9f695194dcc813167cbcb53d (in 2.6
branch) "Make i830_allocate_memory take tiling parameters" as first bad commit.

Using gdb I found tiling was set exactly the same in 2.6.3 as in 2.6.1, so that
was good (TILE_XMAJOR for front, back and depth buffers).
Looking further I found the line mem->tiling = TILE_NONE; (line 961 in
src/i830_memory.c) at the end of i830_allocate_memory suspicious, as
mem->tiling now already gets set via i830_allocate_aperture and some buffers do
have tiling. Removing that line indeed fixed the performance issue. Now
sauerbraten runs with 30+ fps and GLBlur runs smoothly.
2009-03-30 11:38:02 -07:00
Jesse Barnes 8dabcc4074 Tiling fixes, third set
Hopefully this concludes the fixes necessary to deal with the various
combinations of kernel and user level tiling.  We have several cases to
handle:
  1) KMS (kernel handles all tiling)
  2) UMS w/memory management + kexec fencing (kernel handles all tiling)
  3) UMS w/memory mangement but no kexec fencing (userland handles tiling)
  4) UMS w/o memory management (userland handles tiling)

For cases (1) & (2) we can use GTT mapping, which will give us good
performance and take care of allocating fence registers as needed.  It's
important *not* to have userland set up fence regs in this case, since
the kernel will be using all of them.

For case (3), we use the begin/end GTT map functions provided by libdrm,
in combination with pinning and fence register setup in i830_memory.c to
deal with tiled surfaces.  This also gives us good performance and
correctness.

For case (4) we use the old style virtual mapping + offset for dealing
with surfaces; note that UXA doesn't seem to work in this configuration
regardless of these fixes.

Fixes bug #20803.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-03-30 09:59:56 -07:00
Zhenyu Wang 375b2e40fc Disable LVDS config parsing from VBT for now
As wider tests showed that this doesn't work for all VBIOS, so
disable it for now and reenable it after we get reliable method.
2009-03-27 14:58:40 +08:00
Zou Nan hai defa6971c6 enable UV half pixel 2009-03-26 15:24:29 +08:00
Zhenyu Wang 69c84f2c82 gitignore intel_lid 2009-03-26 13:53:25 +08:00
Zhenyu Wang fe96e51769 xvmc: add missed vld g4i sources in Makefile and fix distcheck
Don't miss the vld shader programs for dist.
2009-03-26 10:54:02 +08:00
Zhenyu Wang 91886f82a1 xvmc: move 965 mc media programs to shader/mc directory
Also include some missed g4i files in Makefile.am, fix shader build.
2009-03-26 10:51:05 +08:00
Zou Nan hai ebcb64fdc8 XvMC VLD extension support for G4X 2009-03-25 16:11:33 +08:00
Zhenyu Wang e6af995b24 KMS: hook up output properties for randr
This gets output properties from kernel, then hook them up
for randr. So we can control output properties through randr
like in UMS.

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
2009-03-25 22:15:49 +08:00
Ma, Ling b5b3778064 disable center mode for 965GM and G4X platform
When disabling VGA mode, usually we don't need to touch VGA center mode.
However because of hardware reason, for Cresline, Cantiga & Eaglelake platform,
we have to disable center mode as well. The patch fixed bug- TV Out strobing regression,
reported by Robert Lowery in intel-gfx@lists.freedesktop.org mailing list.

Signed-off-by: Ma Ling <ling.ma@intel.com>
2009-03-25 15:27:25 +08:00
Kalev Lember 74d0713e00 Fix VT switch with XV overlay video enabled.
drm_intel_bo_unpin() was called with NULL argument.

Signed-off-by: Kalev Lember <kalev@smartlink.ee>
2009-03-20 16:46:13 -07:00
Rémi Cardona b345b4e6ad clean up man page generation and remove all traces of the i810 driver
The i810 compatibility symlink has been broken since libpciaccess, so just
let it die.
2009-03-20 16:31:11 -07:00
Jesse Barnes 48b91e0668 Don't manage fences part two
Don't try to clear fences that were never installed.  Missed this bit in
the last fix for #20265.
2009-03-20 12:33:22 -07:00
Zhenyu Wang 28319d60aa Add a lid status test program "intel_lid" 2009-03-20 13:34:31 +08:00
Jesse Barnes 636d252f3b Don't install fences if the kernel is managing them
If execbuffer is setting up fences, it also means that the kernel is
managing them at pin time, so installing one in the 2D driver in that
case is an error.  The fence should stick around as long as the buffer
is pinned (the kernel won't steal these), though it will be freed at
leavevt and re-allocated at entervt.

On 965+ chips, the pin ioctl will *not* install a fence reg, but that's
also ok because all 965+ operations include tiling bits, and sw
fallbacks will be protected by prepare/finish access hooks, which will
either access the backing store or use the GTT, which will ensure proper
fencing at fault time.

Fixes #20265.

Acked-by: Eric Anholt <eric@anholt.net>
2009-03-19 13:25:29 -07:00
Carl Worth d92e6158c8 Revert the rest of the EXA_VERSION_MAJOR bump
This was mistakenly added in the unrelated change in revision
fe08b81d0f
and wasn't completely reverted in the later revision
78a60e1b66
2009-03-19 10:06:03 -07:00
Ma Ling 85e6b52858 Set SSC frequency for 8xx chips correctly
All 8xx class chips have the 66/48 split, not just 855.

Fixes #18358.
2009-03-19 09:10:19 -07:00
Jesse Barnes bedc894a56 Re-enable disabled outputs after rotation
The server may have made a DPMS call before doing rotation, so after we
do the mode set with the rotated framebuffer, we need to re-enable the
corresponding output(s).

Fixes bug #20573.
2009-03-18 20:19:44 -07:00
Jesse Barnes 6deb26ae7b Create known output configuration at EnterVT time
Since we added the pipe A force quirk (leaving pipe A on all the time),
DPMS calls to disable it have silently returned, leaving the pipe on.
If another driver (like vesafb) has enabled it, we may end up with a bad
configuration, leading to hangs or blank screens at VT switch time.

Fixes bug #19603.
2009-03-18 09:36:58 -07:00
Ma Ling 7c94227dd4 Use best PLL timing values for G4X platform
construct function to find precise parameters from internal spreadsheet
table on G4X platform.

Signed-off-by: Ma Ling <ling.ma@intel.com>
2009-03-17 10:41:38 +08:00
Ma Ling 48db5bde92 Define documented PLL timing limits for G4X platform
These timings on G4X platform were specified by internal spreadsheet from the chipset group.

Signed-off-by: Ma Ling <ling.ma@intel.com>
2009-03-17 10:41:02 +08:00
Keith Packard 78a60e1b66 Revert EXA_DRIVER_KNOWN_MAJOR bump
This was mistakenly added in the unrelated change in revision
fe08b81d0f
2009-03-16 08:41:52 -07:00
Zhenyu Wang 1a6e70cd98 TV: fix contrast and saturation for 945G
Bug #20670.
2009-03-16 15:42:50 +08:00
Zhenyu Wang 4e95327323 TV: force TV as connected with TV_Connector option
In order to bypass failure in TV load detect, TV_Connector option
will always force TV as connected with user specified connector type.
2009-03-16 15:15:26 +08:00
Eric Anholt e0aba04da0 Add DCC register dumping. 2009-03-13 16:15:44 -07:00
Eric Anholt a57814cc13 Add dumping of 915 and 945 fence registers.
The debug dumper functions can now return NULL to indicate no output, so
we get appropriate results on 915, 945, and 965.
2009-03-13 16:15:44 -07:00
Eric Anholt 8166a7ff5c Add PGETBL_CTL to the debug output.
It's nice to know when it gets stomped on.
2009-03-13 16:15:44 -07:00
Keith Packard fe08b81d0f Use CopyArea to load glyphs from per-glyph pixmap to cache pixmap
With glyphs sitting in per-glyph pixmaps, there's no reason to use the CPU
to move them to the cache pixmap, and lots of reasons to use the accelerator.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-03-13 15:03:38 -07:00
Kalev Lember 2026c57cf0 Fix Xv crash with overlay video.
Bug #20585.
2009-03-13 16:01:43 -04:00
Jesse Barnes 3ef9d85371 Use UXA when KMS is active
EXA doesn't support KMS, so force UXA on if KMS is detected.  And warn
the user if they've specified something other than UXA in their
xorg.conf.

Fixes bug #20620.
2009-03-13 12:21:34 -07:00
Zhenyu Wang dc3ff0b514 Revert "SDVO: Switch control bus only before DDC access"
This reverts commit ddedf19f88.

After i2c STOP, control bus will return back to internal
registers. So this brings back to origin code that we switch
to DDC bus before START. But it's ideal to only issue DDC
bus switch after STOP, not before every START, which might eliminate
some complains from SDVO device, that will be another patch later.
2009-03-12 16:32:02 +08:00
Zhenyu Wang c6b0135d20 SDVO: reset privates before output setup
For multifunction encoder, forget to reset these values
will cause wrong output type in later mode setting
operations.
2009-03-12 16:31:01 +08:00
Dan Nicholson 28e7f0d71f Fix dist of xvmc sources
The XVMC AM_CONDITIONAL is only needed around the library expression.
None of the other definitons will cause anything to be built without
libXvMC, but they're needed for 'make dist'.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2009-03-11 15:41:16 -07:00
Kristian Høgsberg 73db44e7ac Drop Legacy3D option, only use fixed texture space with non-gem.
With this change, we always expect the 3D driver to use GEM textures
when the 2D driver uses GEM.  When GEM is not available or disabled,
we fall back to legacy fixed textures.
2009-03-11 11:36:57 -04:00
Zhenyu Wang 2fcf4fcccf SDVO: fix pixel multiplier setting for TV
We should use preferred input timing's clock for correct
pixel multiplier setting, otherwise we might get inconsistent
multiplier setting on pipe and SDVO device for some modes.
2009-03-10 14:21:36 +08:00
Eric Anholt fb6e00f40f Fix XV with non-GEM kernels by allocating a larger fake bufmgr.
Ideally we'd not be using the EXA offscreen memory manager and just hand all
that memory to the fake bufmgr for non-GEM, but the fake bufmgr's too slow for
that, at least currently.  So compromise and take enough memory that it will
succeed at XV allocations but hopefully not anger tiny-aperture systems too
much.

Bug #20563.
2009-03-09 20:06:30 -07:00
Eric Anholt dc12c4b3eb Flip the update_dri_buffers test around to only run when DRI1 is active.
Fixes segfaults at startup with DRI2 and load detection, or with DRI disabled
entirely.
2009-03-09 12:51:29 -07:00
Eric Anholt 73aa23d915 DRI1: Update sarea (and other information) when CRTC configuration changes.
Bug #14423.

Signed-off-by: Eric Anholt <eric@anholt.net>
2009-03-06 14:49:31 -08:00
Eric Anholt 568297d327 Don't allocate the render power saving context in KMS mode.
That would be the kernel's job if it chooses to do it.

Signed-off-by: Eric Anholt <eric@anholt.net>
2009-03-06 14:34:19 -08:00
Eric Anholt 4e11441084 unused variable warning fix.
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-03-06 14:32:04 -08:00
Eric Anholt 043a76a040 clean up arguments to i830_allocate_framebuffer since zaphod removal.
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-03-06 14:31:59 -08:00
Eric Anholt b23f57b310 Use REGION_EQUAL in place of a local implementation.
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-03-06 13:56:16 -08:00
Eric Anholt 6b61f9945f nuke unused define.
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-03-06 13:56:09 -08:00
Eric Anholt d2af21a66d Remove configurable support for disabling XV.
google shows one instance of this being used a year and a half ago.
2009-03-06 13:29:09 -08:00
Eric Anholt 755757669f Remove configured SW cursor support.
Any time we actually need SW cursors, it gets enabled automatically.
2009-03-06 13:26:10 -08:00
Eric Anholt 917b20ead3 Remove StolenOnly support.
We rely on having AGPGART present to successfully allocate video memory as
we configure it by default.  Admit that fact, and remove support for
non-AGPGART/KMS setups.
2009-03-06 13:26:10 -08:00
Eric Anholt 73b7190421 intel: Nuke shared-entity support (zaphod mode).
It's been broken for years now, and KMS offers a much better chance of getting
this working sensibly without making a mess of the 2D driver.
2009-03-06 13:26:10 -08:00
Eric Anholt e9d6bbbe0b remove more page flipping leftovers. 2009-03-06 13:25:45 -08:00
Lukáš Hejtmánek 1cc9b1423c Fix another VT switch leak
The batch_bo buffer object is reallocated on enter VT, so we need to
unref it on leave vt.

Signed-off-by: Lukas Hejtmanek <xhejtman@ics.muni.cz>
2009-03-06 14:44:03 -05:00
Xiang, Haihao 67fef27f4b Xv: free tearing on textured video
Add an Xv attribute XV_SYNC_TO_VBLANK which has three values -1(auto), 0(off)
and 1(on) to control whether textured adapter synchronizes the screen
update to the vblank. The default value is -1(auto).
2009-03-06 09:40:07 +08:00
Zhenyu Wang 0d20bbbc20 SDVO: handle multifunction encoder (try 2)
For SDVO encoder that advertise multiple functions,
we have to get attached display to determine current
output, and update output's name according with
current type.
2009-03-05 14:40:13 +08:00
Lukas Hejtmanek d4c64f01b9 Fix serious memory leak at Enter/LeaveVT
This fixes huge memory leak at each VT switch (about 600 BOs + 6MB
of RSS of Xserver).
2009-03-04 17:33:27 -05:00
Kristian Høgsberg 095a001f75 Use drmSetMaster() and drmDropMaster() in enter/leave VT
This allows multiple X server to use DRI and makes it possible to run
multiple X servers under KMS.  This requires a 2.6.29 kernel to work.
On older kernels it will just log a warning and DRI will fail to
initialize for the second X server.
2009-03-04 17:10:28 -05:00
Zhenyu Wang 14bb61e0c2 SDVO: only check digital monitor when EDID exists 2009-03-03 14:17:50 +08:00
Zhenyu Wang 42e34e90e2 TV: add property control for TV attributes
This is based on Jesse's origin patch for bug #12763.
But export integer range to user instead of hardware float
point format, and fix different real format on 965G and 945G
for contrast and saturation.
2009-03-03 22:55:35 +08:00
Zhenyu Wang aa9da5e393 TV: add option to set TV connector type
This can let user override non-stable driver TV load detect,
and set connector type manually, e.g for s-video to component
converter, this patch seems must needed to use HD modes.
2009-03-03 20:43:39 +08:00
Zhenyu Wang ab1ef05cc0 TV: update output and crtc modes when TV format change (try 3)
This is to fix bug #16566, change TV format will cause BadMatch
error when crtc config apply. Everytime when we change TV format,
we may generate a new list of modelines as TV clock changed. After
randr get info request, new modelines will be probed and randr output's
modes will be renewed too. But crtc's mode failed to be updated,
as it never can find a matching mode now within new modes list.
So get info will return an invalid crtc's mode, later set crtc
config will pass that info, and xserver catches a bad match.

This patch trys to refresh output modes and setup crtc's mode
with new modelines in TV format change. So get info would be
sure to turn valid crtc mode that reference in current new modelines.
2009-03-03 20:43:39 +08:00
Zhenyu Wang a67a911a93 TV: sort input mode lines 2009-03-03 20:43:39 +08:00
Adam Jackson bd360e7517 KMS: Wire up output DPMS. 2009-03-02 10:34:41 -05:00
Zhenyu Wang 2d0aa55360 Skip LVDS config parsing on pre-9xx chips.
855GM laptops seems pretty broken when parsing this block.
2009-03-02 15:26:44 +08:00
Zhenyu Wang 55359ef9ab Update driver feature block definition for missed fields 2009-03-02 15:20:27 +08:00
Eric Anholt 38a7683561 warnings cleanup 2009-02-28 00:51:14 -08:00
Eric Anholt 5bfd73cd31 Only allocate pixmaps aligned for tiling when requested by DRI2 GetBuffers.
This saves massive quantities of memory on pre-965 since the DRI2 tiling
enable caused the minimum size of any pixmap to be 1MB.
2009-02-27 19:09:49 -08:00
Shaohua Li f53bdad141 Intel video driver patch
This is the intel video driver patch for a new chip, which is G33-like
and has some clocking setting related register changes. This patch adds
the pci id and DPLx/FPx register changes.

The gtt tool should just work to me, as the chip hasn't any changes
against G33 on this side.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-02-26 14:47:04 -08:00
Eric Anholt 22dc9a5580 Fix UXA for server 1.4. 2009-02-26 14:20:42 -08:00
Eric Anholt 635eaa511f Regard the screen pixmap as suitable for acceleration.
With UXA on the fake bufmgr, the screen pixmap doesn't have a BO and so
no acceleration was occurring.
2009-02-26 14:20:42 -08:00
Eric Anholt 70e0261208 Disable fb resizing for DRI1-only server so that DRI1 can initialize. 2009-02-26 14:20:42 -08:00
Eric Anholt d7aa330db3 Fix up i915 composite and common solid/copy code to use check_aperture.
This could fix complaints about binding BOs and resulting failure to render.
2009-02-26 14:20:42 -08:00
Xiang, Haihao a625a07022 XvMC: fix broken xvmc on 965 2009-02-25 16:48:22 +08:00
Zhenyu Wang f6d8ae69b0 Use LVDS config in Driver feature BDB for integrated LVDS check
The LVDS config bits in VBT driver feature block is used by vendor
to identify the board implement of integrated LVDS/eDP or SDVO LVDS.
And video bios uses these bits for LVDS enabling or not. So check
these bits for integrated LVDS might eliminate more quirks.
2009-02-25 09:57:00 +08:00
Zhenyu Wang 8718551f14 Update LVDS config bits definition in driver feature block
ALL_LVDS is actually not defined before and include GM45.
Embedded DP bit will be used for newer chips.
2009-02-25 09:54:03 +08:00
Eric Anholt 9d8e5c21a1 Fix distcheck from drmmode_display.h deletion. 2009-02-24 14:07:08 -08:00
Eric Anholt f4e2f522a5 Don't do AdjustFrame in KMS mode.
This was hit by xv86vm's SwitchMode path, and for that the CRTC offsets
get set at mode setting time anyway.
2009-02-24 14:07:08 -08:00
Kristian Høgsberg 170f00e161 Remove a handful of unused variable warnings. 2009-02-24 14:13:04 -05:00
Kristian Høgsberg a6b31f38eb Update kms to work with drmModeModeInfo API update. 2009-02-24 14:13:01 -05:00
Adam Jackson 13ee9402e9 Limit CRT DAC speed better.
Verified against the public docs for i8xx parts, although not 9xx yet.
2009-02-24 11:59:57 -05:00
Keith Packard 668b2352a4 Revert "Limit CRT DAC speed better."
This reverts commit 8fd0e46571.

This doesn't even build. Please try again.
2009-02-23 13:31:51 -08:00
Adam Jackson 8fd0e46571 Limit CRT DAC speed better.
Verified against the public docs for i8xx parts, although not 9xx yet.
2009-02-23 15:46:25 -05:00
Kristian Høgsberg 73bc7f1139 KMS: Fix bug that prevented EDID data from getting propagated. 2009-02-23 15:16:51 -05:00
Kristian Høgsberg ef95276055 Use stat() and the dev_t to find the drm device filename.
Simpler and more robust.  Works when we haven't set the device PCI ID,
ie when not going through the legacy DRI module.
2009-02-23 15:14:56 -05:00
Helge Bahmann 81c652e9a6 Move disable_render_standby to EnterVT instead of startup.
Otherwise, with a pre-2.6.28 older kernel the disable would be lost at
resume time and cause hangs.

Bug #20214
2009-02-21 10:10:57 -08:00
Eric Anholt 0621ba12a3 uxa: Ask for BOs ready for rendering for pixmaps.
The assumption is that we're almost always accelerating our drawing to
new pixmaps (fill, copy, etc.).
2009-02-21 10:03:22 -08:00
Kristian Høgsberg 5018d0f16c KMS: Hook up rotated shadow buffers. 2009-02-20 15:34:29 -05:00
Kristian Høgsberg beca598bc2 Access the Xv buffer through the GTT for the non-KMS case. 2009-02-20 11:25:22 -05:00
Kristian Høgsberg e97e257170 Fix i915 textured video to work with the i830_memory -> bo change.
Forgot to update i915_video.c in 872aadc710.
2009-02-20 11:25:22 -05:00
Kristian Høgsberg 96da26b681 Dont allocate overlay registers in KMS mode. 2009-02-20 11:25:16 -05:00
Kristian Høgsberg 872aadc710 Make Xv used a buffer object instead of i830_memory.
We still pin the buffer object in case of overlay, but for textured video
we're now no longer using i830_memory for Xv anymore.
2009-02-18 17:26:06 -05:00
Zhenyu Wang 527e8177cd bios_reader: parse driver feature BDB 2009-02-18 11:28:01 +08:00
Zhenyu Wang 62ca1c4798 Fix SDVO mulitiplier setting for 945G
Wrong SDVO multiplier setup has been slipped
in SDVO TV patch. Thanks Michael Fu to point this out!
2009-02-18 10:49:00 +08:00
Kristian Høgsberg 723b606509 KMS: Hook up crtc::gamma_set. 2009-02-17 13:48:04 -05:00
Zhenyu Wang 506bbb8341 Safely init SDVO found variable
Found by Michael Fu for my last SDVO detect fix.
2009-02-16 14:09:49 +08:00
Zhenyu Wang 9d464bd5b0 Fix SDVO/HDMI detect
SDVOC detect bit is only valid for HDMIC.
And for SDVO devices, SDVOB detect bit should be used
to probe all possible SDVO outputs.
2009-02-13 11:15:48 +08:00
Zhenyu Wang 48445d2e93 SDVO: remove ForceSDVODetect option
Which is just a hack to hide our SDVO detect drawback,
we will have SDVO/HDMI detect fix later.
2009-02-13 11:11:18 +08:00
Zhenyu Wang ddedf19f88 SDVO: Switch control bus only before DDC access
Instead of set control bus switch before every i2c start,
just set once before doing DDC. This should eliminate some
encoders returning error during that.
2009-02-13 10:09:42 +08:00
Zhenyu Wang f1ca56e17d SDVO: Fix TV support
As SDVO TV uses SDVO_TVClkIn from SDVO encoder for clock reference,
it needs to generate proper PLL for current input clock. This uses
fixed PLL table from vbios for this. And possible sdvo mulitiplier
has to be setup correctly. This makes TV output stable on my 945GCLF2
board with NTSC-M format.
2009-02-13 10:02:02 +08:00
Zhenyu Wang acde0ef683 SDVO: fix CREATE_PREFERRED_INPUT_TIMING command 2009-02-13 09:53:57 +08:00
Zhenyu Wang 824b2f0c55 SDVO: fix usage for SET_TV_FORMAT and GET_SDTV_RESOLUTION_SUPPORT command
They both needs parameters.
2009-02-13 09:50:45 +08:00
Zhenyu Wang 62c0c2f554 SDVO: fix error in modeline and DTD convert 2009-02-13 09:48:34 +08:00
Zhenyu Wang 37c67088a8 SDVO: check EDID info for DVI-I
For SDVO DVI-I, check EDID info for digital output,
otherwise mark it to be disconnected as analog output
is driven by VGA then.
2009-02-13 09:21:45 +08:00
Zhenyu Wang 38079bc0f1 SDVO: Fix for HDMI encode and audio setup (try 5)
SDVO HDMI encode and audio is not setup in detect,
which fails in hotplug case for HDMI audio. Fix to
check current encode type and set flag for HDMI audio
enabling.

Check and set HDMI encode state in get_modes.
2009-02-13 09:21:45 +08:00
Eric Anholt b53977f4c5 uxa: Fix failure to --amend in further changes in previous commit. 2009-02-10 18:23:16 -08:00