Commit Graph

2415 Commits

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