Commit Graph

1233 Commits (4d3a8534bdbcf4843fc8ad05c9a81a964fc65237)

Author SHA1 Message Date
Dave Airlie e8696330e2 drm/radeon/kms: drop unused array to fix warning.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 10:22:48 +10:00
Dave Airlie 58682f107a drm/radeon/kms: do dp link training at dpms on time not mode set.
This moves the radeon DP link training call to happen when we
dpms on the encoder not when we set the mode.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 10:22:47 +10:00
Dave Airlie 5fbfce7fc9 drm/radeon/kms: make displayport work by reorganising vsemph setup.
This fix reorganises the initial DP link training slightly, and
actually makes DP work under kms here.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 10:22:46 +10:00
Dave Airlie 54d9cb47dd drm/radeon/kms/dp: fix return in dpcd retrival.
Not returning here caused us to get a display port version of 0 for everything
this caused power up to not get sent which ends up in a black screen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 10:22:45 +10:00
Alex Deucher ffd09c648a drm/radeon/kms: free aux channel i2c adapter on destroy
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 10:22:44 +10:00
Alex Deucher 5801ead6bd drm/radeon/kms: add support for DP modesetting
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 10:22:44 +10:00
Alex Deucher f92a8b6758 drm/radeon/kms: handle dp sinks in atom encoder/transmitter tables
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 10:22:43 +10:00
Alex Deucher 4143e919ea drm/radeon/kms: store sink type in atom dig connector
This will be used laster when the encoder and transmitters
are set up.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 10:22:42 +10:00
Alex Deucher 6a93cb250a drm/radeon/kms: i2c reorg
- keep the atom i2c id in the i2c rec
- fix gpio regs for GPIO and MDGPIO on pre-avivo chips
- track whether the i2c line is hw capable
- track whether the i2c line uses the multimedia i2c block

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 10:22:41 +10:00
Alex Deucher 1a66c95a64 drm/radeon/kms: DP fixes and cleanup from the ddx
- dpcp -> dpcd
- fix up dig encoder routing
- aux transaction table takes delay in 10 usec units

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 10:22:40 +10:00
Dave Airlie 746c1aa4d1 drm/radeon/kms: initial radeon displayport porting
This is enough to retrieve EDID and DPCP.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 10:22:31 +10:00
Chris Wilson 5618ca6abc drm/i915: Set the error code after failing to insert new offset into mm ht.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-07 15:44:30 -08:00
Chris Wilson fcffb94766 drm/i915: Report purgeable status in buffer lists.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-07 15:39:32 -08:00
Dave Airlie 447aeb907e drm/ttm: fix unreachable code.
None of the in-tree drivers use user objects yet so this wasn't hitting
us.

Stanse found unreachable code in ttm_bo_add_ttm:
http://decibel.fi.muni.cz/~xslaby/stanse/error.cgi?db=32&id=714#l238

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 09:25:45 +10:00
Dave Airlie ab2c067298 drm/intel: refactor DP i2c support and DP common header to drm helper
Both radeon and nouveau can re-use this code so move it up a level
so they can. However the hw interfaces for aux ch are different
enough that the code to translate from mode, address, bytes
to actual hw interfaces isn't generic, so move that code into the
Intel driver.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 09:24:23 +10:00
Alex Deucher 22dd50133a drm/radeon/kms: fix vram setup on rs600/rs690/rs740
Don't remap vram to 0 on IGP chips.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 08:58:33 +10:00
Adam Jackson f2b115e69d drm/i915: Fix product names and #defines
IGD* isn't a useful name.  Replace with the codenames, as sourced from
pci.ids.

Signed-off-by: Adam Jackson <ajax@redhat.com>
[anholt: Fixed up for merge with pineview/ironlake changes]
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-07 14:55:56 -08:00
Alex Deucher 2a008d0ccd drm/radeon/kms: more r4xx lvds fixes
Grab pll ref div from regs at driver init.  r4xx seems very
picky about the dividers for the pll driving lvds.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 08:53:25 +10:00
Alex Deucher 92cde00cba drm/radeon/kms/legacy: set common regs to sane value
The DDX and radeonfb always set these regs to a sane value.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 08:51:12 +10:00
Alex Deucher 6b02af1c1f drm/radeon/kms/legacy: set overscan regs on modeset
These can end up with garbage otherwise.

fixes rh bug 537140

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 08:50:54 +10:00
Dave Airlie d904ef9b00 drm/radeon/kms: add support to atom parser for FB read/write
FB read/write really doesn't need to access the actual VRAM, we
can just use a scratch area. This is required for using atom displayport
calls later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-08 07:33:04 +10:00
Dave Airlie f846761853 Merge remote branch 'origin/drm-core-next' into test
Conflicts:
	drivers/gpu/drm/drm_fb_helper.c
2009-12-08 07:03:55 +10:00
Chris Wilson ffb4728095 drm/i915: Drop a some common DRM_ERROR()
These are handled by the error return being propagated to user-space and
do not any add any information to the original error, so are useless.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-07 12:18:28 -08:00
Jesse Barnes 85364905f9 drm/i915: warn if Pineview CxSR can't be enabled
If we don't detect a supported memory configuration, we can't enable
CxSR.  Warn the user in this case so they can file a bug.
2009-12-07 12:11:52 -08:00
Jesse Barnes 22fd0fab3b drm/i915: pageflip fixes
This patch brings the tree up to date with some fixes that were in a
more recent version of the page flipping patch you applied.  It fixes
pre-965 flip support, removes a leftover hack that forced alignment,
and initializes the pipe & plane CRTC mappings.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-07 12:06:00 -08:00
Jiri Kosina d014d04386 Merge branch 'for-next' into for-linus
Conflicts:

	kernel/irq/chip.c
2009-12-07 18:36:35 +01:00
Thomas Hellstrom 85bb0c377f drm: Export symbols needed for the vmwgfx driver.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-07 15:22:08 +10:00
Thomas Hellstrom 4bfd75cb08 drm/ttm: Export symbols needed for the vmwgfx driver.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-07 15:22:07 +10:00
Thomas Hellstrom c078aa2fc4 drm/ttm: Add TTM execbuf utilities.
Utilities to reserve, unreserve and fence a list of TTM
buffer objects in a deadlock-safe manner.

Used by the vmwgfx driver.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-07 15:22:05 +10:00
Thomas Hellstrom 4aff1013f5 drm/ttm: Add ttm lock functionality.
This is intended to be used by ttm-aware drivers to
1) Block clients to inactive masters when
they try to validate buffers for GPU use.
2) Optionally block clients to the current master when
there is thrashing due to GPU memory shortage.

Used by the vmwgfx driver.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-07 15:22:03 +10:00
Thomas Hellstrom 88071539a3 drm/ttm: Add user-space objects.
Add objects needed for user-space to maintain reference counts on ttm objects.
This is used by the vmwgfx driver which allows user-space to maintain
map-counts on dma buffers, lock-counts on the ttm lock and ref-counts on
gpu surfaces, gpu contexts and dma buffer.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-07 15:22:01 +10:00
Dave Airlie 64bffd0375 drm/radeon/kms: fix RS600 MC setup.
Again we try to put VRAM at 0, and it didn't work on this chipset,
reports of corrupt RAM appeared on irc and bugzilla.

Fix the vram location according to what the BIOS setup, I'm not 100%
sure we don't need the same thing on rs690/rs780/rs880, we probably
should do it there just in case as its what the DDX does.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-07 13:29:51 +10:00
Alex Deucher 4f15d24adb drm/radeon/kms: fix up gart setup on rs600
Set up rs600 gart like r600:
- set gart system aperture to vram
- inside gart system aperture is unmapped*
- outside gart system aperture is mapped*

*mapped refers to memory handled by page tables

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-07 08:01:52 +10:00
Adam Buchbinder 6070d81eb5 tree-wide: fix misspelling of "definition" in comments
"Definition" is misspelled "defintion" in several comments; this
patch fixes them. No code changes.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 23:41:47 +01:00
André Goddard Rosa af901ca181 tree-wide: fix assorted typos all over the place
That is "success", "unknown", "through", "performance", "[re|un]mapping"
, "access", "default", "reasonable", "[con]currently", "temperature"
, "channel", "[un]used", "application", "example","hierarchy", "therefore"
, "[over|under]flow", "contiguous", "threshold", "enough" and others.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 15:39:55 +01:00
Dave Airlie aa1a750ecb drm/radeon/kms: quirk for Gigabyte RV515 card, DVI+VGA not 2xDVI.
Similiar to other quirks for RV515, this card has no second DVI port.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 11:56:28 +10:00
Alex Deucher 0088dbdb80 drm/radeon/kms: rs6xx/rs740: clamp vram to aperture size
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 10:32:35 +10:00
Alex Deucher 722f29434e drm/radeon/kms: fix vram setup on rs600
also fix up rs690 mem width.

should fix fdo bug 25408

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 10:32:26 +10:00
Alex Deucher 8de2152543 drm/radeon/kms: fix legacy crtc2 dpms
noticed by Matthijs Kooijman on fdo bug 22140

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 10:32:18 +10:00
Alex Deucher 500b758725 drm/radeon/kms: handle vblanks properly with dpms on
avivo chips

Copied from pre-avivo code.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 10:32:06 +10:00
Alex Deucher 4e3f9b78ff drm/radeon/kms: Add quirk for HIS X1300 board
Board is DVI+VGA, not DVI+DVI

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 10:31:53 +10:00
Alex Deucher 4c4f5413c3 drm/radeon/kms: don't use bios dividers for lvds on r4xx
R4xx cards don't have lvds pll dividers since they use atom.

should fix rh bug 541562

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 10:24:11 +10:00
Rafał Miłecki d684076627 drm/radeon/kms: fix ring info in debugfs on r600+
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 10:21:22 +10:00
Rafał Miłecki 93e7de7b37 drm/radeon/kms: fix typo in define: engine -> memory
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 10:20:45 +10:00
Rafał Miłecki c142c3e5e3 drm/radeon/kms/pm: fix typos
Unit typo noticed by taiu on IRC

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 10:20:08 +10:00
Dave Airlie 01d01ba947 drm/mm: fixup typo in debug functions.
Free and used were reversed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 10:18:02 +10:00
Jakob Bornecrantz 884840aa3c drm: Add dirty ioctl and property
This commit adds a ioctl and property to allow userspace
to notify the kernel that a framebuffer has changed. Instead
of snooping the command stream this allows finer grained
tracking of which areas have changed.

The primary user for this functionality is virtual hardware
like the vmware svga device, but also Xen hardware likes to
be notify. There is also real hardware like DisplayLink and
DisplayPort that might take advantage of this ioctl.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 09:25:47 +10:00
Dan Carpenter 46a79fa08a drm/ttm: fix small memory leak in ttm_memory.c
I moved the allocation until after the check for (si->totalhigh == 0).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-By:  Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 09:03:33 +10:00
Thomas Hellstrom 862302ffe4 drm: Add support for drm master_[set|drop] callbacks.
The vmwgfx driver has a per master rw lock around TTM, to guarantee 
mutual exclusion when needed.

This is typically when all evictable buffers are evicted due to

1) vt switch
2) master switch
3) suspend / resume.

In the multi-master case, on master switch the new master takes the 
previously active master lock in write mode, and then evicts all 
buffers. Any clients to previous masters will then block on that lock 
when trying to validate a buffer. fbdev also acts as a virtual master
wrt this.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 08:55:46 +10:00
Adam Jackson 9340d8cfea drm/edid: Decode 3-byte CVT codes from EDID 1.4
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 08:53:47 +10:00
Adam Jackson 07a5e6324a drm/edid: Add DMT modes to the pool if the monitor is GTF-capable
See also: http://bugzilla.redhat.com/539785

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 08:53:32 +10:00
Adam Jackson 7ac96a9cb4 drm/modes: Add drm_mode_hsync()
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 08:53:22 +10:00
Adam Jackson 9cf00977da drm/edid: Unify detailed block parsing between base and extension blocks
Also fix an embarassing bug in standard timing subblock parsing that
would result in an infinite loop.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-04 08:53:07 +10:00
Zhao Yakui 6e36595a21 drm/i915: Declare the new VBT parsing functions as static
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 23:27:20 -08:00
Zhao Yakui 652af9d74e drm/i915: Add the missing clonemask for display port on Ironlake
Add the missing clonemask for display port on Ironlake.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
cc: stable@kernel.org
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 23:26:36 -08:00
Zhao Yakui f24bc39fac drm/i915: fix the incorrect condition judgement in dp_is_present_in_vbt
We were always looking for the PORT_IDPB entry.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 23:25:17 -08:00
Jerome Glisse 4c78867912 drm/radeon/kms: Rework radeon object handling
The locking & protection of radeon object was somewhat messy.
This patch completely rework it to now use ttm reserve as a
protection for the radeon object structure member. It also
shrink down the various radeon object structure by removing
field which were redondant with the ttm information. Last it
converts few simple functions to inline which should with
performances.

airlied: rebase on top of r600 and other changes.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 14:00:18 +10:00
Dave Airlie 1614f8b17b drm/radeon/kms: add irq mitigation code for sw interrupt.
We really don't need to process every irq that comes in, we only
really want to do SW irq processing when we are actually waiting for
a fence to pass. I'm not 100% sure this is race free esp on non-MSI systems
so it needs some testing.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 14:00:13 +10:00
Alex Deucher d8f60cfc93 drm/radeon/kms: Add support for interrupts on r6xx/r7xx chips (v3)
This enables the use of interrupts on r6xx/r7xx hardware.
Interrupts are implemented via a ring buffer.  The GPU adds
interrupts vectors to the ring and the host reads them off
in the interrupt handler.  The interrupt controller requires
firmware like the CP.  This firmware must be installed and
accessble to the firmware loader for interrupts to function.

MSIs don't seem to work on my RS780.  They work fine on all
my discrete cards.  I'm not sure about other RS780s or
RS880s.  I've disabled MSIs on RS780 and RS880, but it would
probably be worth checking on some other systems.

v2 - fix some checkpatch.pl problems;
     re-read the disp int status reg if we restart the ih;

v3 - remove the irq handler if r600_irq_init() fails;
     remove spinlock in r600_ih_ring_fini();
     move ih rb overflow check to r600_get_ih_wptr();
     move irq ack to separate function;

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 14:00:06 +10:00
Dave Airlie 50dafba685 drm/radeon/kms: call correct atom table for digital output dpms.
found while working on displayport.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:20 +10:00
Jerome Glisse ee2215f0b2 drm/radeon/kms: Don't overwrite crtc_gen_cntl or crtc_gen_cntl2
Don't overwritte  crtc_gen_cntl or crtc_gen_cntl2 or we may loose the
cursor. This especialy happen when changing video mode. Fix bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=529146

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:19 +10:00
Alex Deucher ed160143c6 drm/radeon/kms: add tv standard property to tv connectors
Lets user select tv-standard.  The property was there,
just not hooked up.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:18 +10:00
Dave Airlie 72542d7705 drm/radeon/kms: ignore unposted GPUs with no BIOS.
If we find a GPU but we can't find its BIOS and it isn't posted,
then ignore it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:17 +10:00
Dave Airlie 4b30b87042 drm/radeon/kms: fix divide by 0 in clocks code
If the chip isn't initialised properly this can happen.
also fix return value in combios clocks function.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:16 +10:00
Alex Deucher 7dde8a1965 drm/radeon/kms/atom: pull misc mode info for lvds from bios tables
sync polarity, etc.  This will likely fix LVDS problems
on some laptops.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:15 +10:00
Jerome Glisse 30256a3f6b drm/radeon/kms: Disable agp only if we are dealing with an AGP GPU
On IGP if you pass option agpmode=-1 you would overwrite the set_page
function callback with improper function which endup in non functioning
hw. This patch will disable agp when giving agpmode=-1 parameter only
if we are dealing with an AGP GPU.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:14 +10:00
Pierre Ossman ec51efa9b2 drm/radeon/kms: Disable both CRTCs during mode switch
Reconfiguring one CRTC whilst another is running can cause a hang under
some circumstances. Unfortunately we haven't pinpointed exactly what those
circumstances are, so disable all CRTCs for every mode switch.

Signed-off-by: Pierre Ossman <pierre@ossman.eu>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:13 +10:00
Alex Deucher 32f48ffea9 drm/radeon/kms: fix LVDS setup on r4xx
R4xx mobility chips use atombios, which does not store
the LVDS_GEN_CNTL parameter setup like combios.  Rather,
it's configured in LVDSEncoderControl.  As such,
LVDS_GEN_CNTL is set wrong when on resume.  Call
LVDSEncoderControl to set it properly.

Should fix fdo bug 25336

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:13 +10:00
Dave Airlie 23956dfa82 drm/radeon/kms: add HDP flushing for all GPUs.
rendercheck under kms on r600s was failing due to HDP flushing not happening.

This adds HDP flushing to the object wait function for r100->r700 families.

rendercheck passes basic tests on r600 with this change.

Acked-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:11 +10:00
Michel Dänzer 38e1492130 drm/radeon: Give userspace more accurate information about available memory.
This patch varies from the original and just removes memory for kernel
pinned objects.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:10 +10:00
Dave Airlie 47381156a8 drm/radeon/kms: pick 8bpp console when 32MB or less VRAM
making the pinned console smaller gives X a bit more room to play with.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:10 +10:00
Dave Airlie 1f3b6a45f0 drm/radeon/kms: add support for encoder cloning.
The RN50 really needs this since its a single crtc card,
however other gpus may benefit from it as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:09 +10:00
Jerome Glisse 2de3b4841f drm/radeon/kms: fix oops when set_base is call with no FB
Just do nothing if crct_set_base() is called with no FB.

The oops happens when the user switches between X & vt or in some case
when changing mode.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:37:08 +10:00
Alex Deucher fd874ad0a0 drm/radeon/kms: add quirk for MSI S270
doesn't have a tv-out port

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:36:45 +10:00
Alex Deucher 71407c46fe drm/radeon/kms: deal with connectors sourced to the same encoder
Some systems have multiple connectors connected to the same encoder;
e.g., DVI and HDMI connected to the same encoder with the same ddc
line. Since we expose connectors as xrandr outputs, randr treats them
separately which results in it trying to source the same encoder to
different crtcs. If we have an HDMI and DVI-D port on the same encoder,
pick the one to be considered connected based on the edid (HDMI if edid
indicates HDMI, DVI otherwise).

Should fix fdo bug 25150

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:36:44 +10:00
Alex Deucher 3e5f8ff3a9 drm/radeon/kms: add quirk for Acer laptop
DVI-I port is actually DVI-D

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:36:44 +10:00
Alex Deucher 80297e87bc drm/radeon/kms: rework scaler handling
Keep requested scaler type in radeon_encoder
and the actual scaler type used in radeon_crtc.
This prevents us from enabling the scaler when it's
not required (i.e., the requested mode is the native
mode).  Also, always set the adjusted mode equal
to the native mode for lvds.

Should fix:
https://bugzilla.redhat.com/show_bug.cgi?id=522271

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Acked-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:36:43 +10:00
Alex Deucher fe6890c3e8 drm/radeon/kms: fix typo in legacy internal tmds mode fixup
Call to set active device was missing.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:36:42 +10:00
Dave Airlie 17e15b0c71 drm/radeon/kms: AGP systems need PCI bus mastering enabled
We might not hit this yet, but when if we do any sort of writeback
we really need to enable PCI bus mastering on these systems from
what I can see.

This enables PCI BM on all radeons that require it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:36:41 +10:00
Alex Deucher fcec570b27 drm/radeon/kms: add support for external tmds on legacy boards
This enables initialization of external tmds chips on pre-atom
and mac systems.  Macs are untested.  Also, some macs have single
link tmds chips while others have dual link tmds chips.  We need
to figure out which ones have which.

This gets external TMDS working on my RS485 and RV380.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:36:40 +10:00
Alex Deucher 9b9fe72488 drm/radeon/kms: clean up i2c
- Change reg/mask names to match what we use internally
and in the bios
- Clarify how i2c over gpio on radeon actually works

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:36:39 +10:00
Alex Deucher ab1e9ea08f drm/radeon/kms: dont't pass a radeon_connector to radeon_i2c_do_lock()
We need this for supporting things other than ddc on i2c.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-02 11:36:38 +10:00
Eric Anholt f0217c42c9 drm/i915: Fix DDC on some systems by clearing BIOS GMBUS setup.
This is a sync of a fix I made in the old UMS code.  If the BIOS uses
the GMBUS and doesn't clear that setup, then our bit-banging I2C can
fail, leading to monitors not being detected.

Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 11:56:30 -08:00
Zhao Yakui d09c23de9f drm/i915: Add 30ms delay to make SDVO TV detection reliable.
Without this, on some boots the TV wouldn't be detected.  Testing
showed 15ms to be insufficient.

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Tested-by: Yan Seiner <yan@seiner.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 10:33:12 -08:00
Li Peng 778c902640 drm/i915: Fix sync to vblank when VGA output is turned off
In current vblank-wait implementation, if we turn off VGA output,
drm_wait_vblank will still wait on the disabled pipe until timeout,
because vblank on the pipe is assumed be enabled. This would cause
slow system response on some system such as moblin.

This patch resolve the issue by adding a drm helper function
drm_vblank_off which explicitly clear vblank_enabled[crtc], wake up
any waiting queue and save last vblank counter before turning off
crtc. It also slightly change drm_vblank_get to ensure that we will
will return immediately if trying to wait on a disabled pipe.

Signed-off-by: Li Peng <peng.li@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
[anholt: hand-applied for conflicts with overlay changes]
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 10:27:40 -08:00
Adam Jackson 27dfaf4f58 drm/i915: disable the interrupt hotplug for integrated TV output
Otherwise, I'd get stuck in a loop where (afaict) output scan would
trigger a TV interrupt, which would trigger a scan, etc.  TV load
detection not being the fastest thing in the world, X would process
requests very slowly.

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

Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 09:49:36 -08:00
Chris Wilson 28cf798f5a drm/i915: Don't update the render-clock for every bo.
Only update the render-clock on transition from busy to idle and vice
versa, or else we burn a significant percentage of the cpu just rewriting
the register -- not quite as power-friendly as intended ;-)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 09:42:16 -08:00
Adam Jackson 38b3037ee4 drm/i915: Fix LVDS presence check
Assume that either the presence of an LVDS entry in the VBT or an ACPI
lid device indicates an LVDS device.  ACPI lid alone is not sufficient.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 09:28:58 -08:00
Eric Anholt 05dd8f973f drm/i915: Fix warning introduced with the page flipping ioctl.
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 09:25:23 -08:00
Jesse Barnes e9560f7cb2 drm/i915: add GETPARAM request for page flipping
Add a GETPARAM request for checking if page flipping is supported.
Useful for the 2D driver to enable the flipping path.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 09:19:07 -08:00
Jesse Barnes 7bd4d7be5c drm: use page flip event to signal flip completion
We don't actually know which frame number the flip will complete on, so
userspace needs a specific flip notification to tell it when the last flip
completed.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
2009-12-01 09:11:53 -08:00
Kristian Høgsberg 6b95a207c1 drm/i915: Add intel implementation of the pageflip ioctl
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Thomas Hellström <thomas@shipmail.org>
Review-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jesse "Orange Smoothie" Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 09:10:35 -08:00
Eric Anholt f40d6817a5 Merge remote branch 'airlied/drm-next' into drm-intel-next 2009-12-01 09:01:54 -08:00
Zhenyu Wang 103a196f42 drm/i915: PineView only has LVDS and CRT ports
PineView only has 2 ports for LVDS and CRT. Don't enable other
ports for it.

Cc: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-12-01 09:00:04 -08:00
Zhao Yakui c35614380d drm/i915: Don't set up the TV port if it isn't in the BIOS table.
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-11-30 16:54:42 -08:00
Zhao Yakui 7cf4f69d3f drm/i915: Don't set up the LVDS if it isn't in the BIOS device table.
We not only check the device type, but also check the addin_offset. If the
addin_offset is zero, it won't be initialized.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
[anholt: hand-applied due to conflicts]
2009-11-30 16:54:35 -08:00
Zhao Yakui ae266c98f5 drm/i915: Don't set up DP ports that aren't in the BIOS device table.
Use the child device array to decide whether the given DP output should be
initialized. If the given DP port can't be found in child device array,
it is not present and won't be initialized.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-11-30 16:42:56 -08:00
Zhao Yakui fc81665523 drm/i915: Don't set up HDMI ports that aren't in the BIOS device table.
Use the child device array to decide whether the given HDMI output should be
initialized. If the given HDMI port can't be found in child device array,
it is not present and won't be initialized.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-11-30 16:41:48 -08:00
Zhao Yakui 6363ee6f49 drm/i915: parse child device from VBT
On some laptops there is no HDMI/DP. But the xrandr still reports
several disconnected HDMI/display ports. In such case the user will be
confused.
 >DVI1 disconnected (normal left inverted right x axis y axis)
 >DP1 disconnected (normal left inverted right x axis y axis)
 >DVI2 disconnected (normal left inverted right x axis y axis)
 >DP2 disconnected (normal left inverted right x axis y axis)
 >DP3 disconnected (normal left inverted right x axis y axis)

This patch set is to use the child device parsed in VBT to decide whether
the HDMI/DP/LVDS/TV should be initialized.

Parse the child device from VBT.

The device class type is also added for LFP, TV, HDMI, DP output.

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-11-30 16:36:53 -08:00
Kristian Høgsberg c1b5dea097 drm/i915: Disable pwrctx before unpin and free
Otherwise the chip may scribble over free memory.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-11-30 16:27:23 -08:00