Jerome Glisse [Thu, 10 Dec 2009 16:16:27 +0000 (17:16 +0100)]
drm/ttm: Convert ttm_buffer_object_init to use ttm_placement
Convert ttm_buffer_object_init to use struct ttm_placement and
rename to ttm_bo_init for consistency with function naming. This
allow to give more complex placement at buffer creation. For
instance you ask to allocate bo into vram first but if there is
not enough vram you can give system as a second possible
placement. It also allow to create buffer in a specific range.
Also rename ttm_buffer_object_validate to ttm_bo_validate.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Thu, 10 Dec 2009 05:59:32 +0000 (15:59 +1000)]
drm/radeon/kms: fix warning about cur_placement being uninitialised.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Thu, 10 Dec 2009 05:47:57 +0000 (15:47 +1000)]
Merge remote branch 'korg/drm-radeon-next' of into drm-linus
This merges some TTM overhauls to allow us to do better object placement
for certain radeon GPUs that need scanout+cursor within range of each other,
along with an API change to not return ERESTART to userspace, but to use
ERESTARTSYS properly internally and have it convert to EINTR and catch that
correctly. Also lots of radeon fixes across the board.
Dave Airlie [Thu, 10 Dec 2009 05:44:11 +0000 (15:44 +1000)]
Merge remote branch 'anholt/drm-intel-next' into drm-linus
Pull more Intel changes in, especially one to init the GTT properly
Jerome Glisse [Wed, 9 Dec 2009 20:55:10 +0000 (21:55 +0100)]
drm/ttm: Print debug information on memory manager when eviction fails
This add helper function to print information on eviction placements
and memory manager status when eviction fails to allocate memory
space.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Wed, 9 Dec 2009 20:55:09 +0000 (21:55 +0100)]
drm: Add memory manager debug function
drm_mm_debug_table will print the memory manager state
in table allowing to give a snapshot of the manager at
given point in time. Usefull for debugging.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 9 Dec 2009 04:15:38 +0000 (14:15 +1000)]
drm/radeon/kms: restore surface registers on resume.
On resume on my rv530 laptop surface cntl was left disabled, so
wierd stuff would happen with rendering to a tiled front buffer.
This checks if the surface regs are assigned to bos and reprograms
the surface registers on resume using the same path that clears
them all on init.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Thu, 10 Dec 2009 00:31:44 +0000 (19:31 -0500)]
drm/radeon/kms/r600/r700: fallback gracefully on ucode failure
Sent the wrong patch earlier.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Wed, 9 Dec 2009 21:14:27 +0000 (22:14 +0100)]
drm/ttm: Initialize eviction placement in case the driver callback doesn't
This would allow to catch driver callback error of not properly
setting the eviction placement structure.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Jerome Glisse [Wed, 9 Dec 2009 17:21:55 +0000 (18:21 +0100)]
drm/radeon/kms: cleanup structure and module if initialization fails
This would allow us to properly unload others module like TTM if
initialization fails after we initiliazed TTM structure.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Jerome Glisse [Wed, 9 Dec 2009 20:57:37 +0000 (21:57 +0100)]
drm/radeon/kms: actualy set the eviction placements we choose
Stupid bug, somehow copying the eviction placements into the
result structure was missing.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Jerome Glisse [Wed, 9 Dec 2009 16:39:16 +0000 (17:39 +0100)]
drm/radeon/kms: Fix NULL ptr dereference
radeon_atombios_fini might be call while there is not valid
atombios structure allocated, thus test for a not null ptr
before trying to access this structure.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Alex Deucher [Wed, 9 Dec 2009 22:44:25 +0000 (17:44 -0500)]
drm/radeon/kms/avivo: add support for new pll selection algo
Supported on all AVIVO-based asics.
Can be disabled via the new_pll module parameter:
new_pll=0 - disable
new_pll=1 - enable
enabled by default
[airlied: fixed to use do_div]
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Alex Deucher [Wed, 9 Dec 2009 19:40:06 +0000 (14:40 -0500)]
drm/radeon/kms/avivo: fix some bugs in the display bandwidth setup
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Dave Airlie [Wed, 9 Dec 2009 05:32:23 +0000 (15:32 +1000)]
drm/radeon/kms: fix return value from fence function.
We only want to return here for errors, the wait functions return
a positive timeout otherwise, which gets back to userspace and
causes X to crash here.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Mon, 7 Dec 2009 17:36:19 +0000 (18:36 +0100)]
drm/radeon: Remove tests for -ERESTART from the TTM code.
Also sets affected TTM calls up to not wait interruptible, since
that would cause an in-kernel spin until the TTM call succeeds, since
the Radeon code does not return to user-space when a signal is received.
Modifies interruptible fence waits to return -ERESTARTSYS rather than
-EBUSY when interrupted by a signal, since that's the (yet undocumented)
semantics required by the TTM sync object hooks.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Mon, 7 Dec 2009 17:36:18 +0000 (18:36 +0100)]
drm/ttm: Have the TTM code return -ERESTARTSYS instead of -ERESTART.
Return -ERESTARTSYS instead of -ERESTART when interrupted by a signal.
The -ERESTARTSYS is converted to an -EINTR by the kernel signal layer
before returned to user-space.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Mon, 7 Dec 2009 14:52:58 +0000 (15:52 +0100)]
drm/radeon/kms: Convert radeon to new TTM validation API (V2)
This convert radeon to use new TTM validation API, it doesn't
really take advantage of it beside in the eviction case.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Tue, 8 Dec 2009 14:33:32 +0000 (15:33 +0100)]
drm/ttm: Rework validation & memory space allocation (V3)
This change allow driver to pass sorted memory placement,
from most prefered placement to least prefered placement.
In order to avoid long function prototype a structure is
used to gather memory placement informations such as range
restriction (if you need a buffer to be in given range).
Range restriction is determined by fpfn & lpfn which are
the first page and last page number btw which allocation
can happen. If those fields are set to 0 ttm will assume
buffer can be put anywhere in the address space (thus it
avoids putting a burden on the driver to always properly
set those fields).
This patch also factor few functions like evicting first
entry of lru list or getting a memory space. This avoid
code duplication.
V2: Change API to use placement flags and array instead
of packing placement order into a quadword.
V3: Make sure we set the appropriate mem.placement flag
when validating or allocation memory space.
[Pending Thomas Hellstrom further review but okay
from preliminary review so far].
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Mon, 7 Dec 2009 14:52:56 +0000 (15:52 +0100)]
drm: Add search/get functions to get a block in a specific range
These are required for changes to TTM.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Tue, 8 Dec 2009 05:45:13 +0000 (15:45 +1000)]
drm/radeon/kms: fix avivo tiling regression since radeon object rework
The object rework moved the tiling flag setup around wrongly,
so tiling we getting setup then overwritten by fb format.
Fixes regression with drm-radeon-next on rv530 laptop tiling test.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Chris Wilson [Tue, 8 Dec 2009 22:12:06 +0000 (22:12 +0000)]
drm/i915: Remove a debugging printk from hangcheck
A residual bare printk survived the merger of the hang detector, remove
this debugging left-over.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Alex Deucher [Tue, 8 Dec 2009 19:30:49 +0000 (14:30 -0500)]
drm/radeon/kms: make sure i2c id matches
Entries in the i2c table aren't always ordered
by id. This allows us to remove some quirks
that are no longer needed.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Tue, 8 Dec 2009 19:07:03 +0000 (14:07 -0500)]
drm/radeon/kms: make sure ss id matches
entries in the ss table aren't always ordered
by id.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Tue, 8 Dec 2009 17:48:20 +0000 (12:48 -0500)]
drm/radeon/kms: connector fixes
- Don't add dac load detection property to DVI-D
- Make sure i2c info is valid before adding DP aux chan bus
- Don't create scaling_mode_property twice
- fix typo that prevented coherent and load detection from working
- add coherent prop to DP (for dp->dvi adapters)
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Tue, 8 Dec 2009 05:58:08 +0000 (15:58 +1000)]
drm/ttm: fix memory leak noticed by kmemleak.
If we don't need the zone we need to free it.
Acked-By: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Zhao Yakui [Wed, 9 Dec 2009 03:23:42 +0000 (11:23 +0800)]
drm: disable all the possible outputs/crtcs before entering KMS mode
Sometimes we will use a crtc for integerated LVDS, which is different with
that assigned by BIOS. If we want to get flicker-free transitions,
then we could read out the current state for it and set our current state
accordingly.
But it is true that if we aren't reading current state out, we do need
to turn everything off before modesetting. Otherwise the clocks can get very
angry and we get things worse than a flicker at boot.
In fact we also do the similar thing in UMS mode. We will disable all the
possible outputs/crtcs for the first modesetting.
So we disable all the possible outputs/crtcs before entering the KMS mode.
Before we configure connector/encoder/crtc, the function of
drm_helper_disable_unused_function can disable all the possible outputs/crtcs.
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rafal Milecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Andrew Lutomirski [Sun, 8 Nov 2009 18:49:51 +0000 (13:49 -0500)]
drm/i915: restore render clock gating on resume
Rather than restoring just a few clock gating registers on resume,
just reinitialize the whole thing.
Signed-off-by: Andy Lutomirski <luto@mit.edu>
[anholt: Fixed up for RC6 support landed since the patch was written]
Signed-off-by: Eric Anholt <eric@anholt.net>
Dave Airlie [Tue, 8 Dec 2009 04:29:15 +0000 (14:29 +1000)]
Merge remote branch 'korg/drm-radeon-dp' into drm-linus
This merges the radeon KMS DisplayPort and hotplug detect support.
Tested on RV635 DP card with a Dell 2408 monitor.
Conflicts:
drivers/gpu/drm/drm_fb_helper.c
Dave Airlie [Tue, 8 Dec 2009 04:06:07 +0000 (14:06 +1000)]
Merge remote branch 'korg/drm-radeon-next' into drm-linus
This merges all the radeon changes that weren't reliant on core-next.
Dave Airlie [Tue, 8 Dec 2009 04:03:47 +0000 (14:03 +1000)]
Merge remote branch 'anholt/drm-intel-next' into drm-linus
This merges the upstream Intel tree and fixes up numerous conflicts
due to patches merged into Linus tree later in -rc cycle.
Conflicts:
drivers/char/agp/intel-agp.c
drivers/gpu/drm/drm_dp_i2c_helper.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/i915_suspend.c
Dave Airlie [Tue, 8 Dec 2009 03:52:41 +0000 (13:52 +1000)]
Merge branch 'drm-core-next' into drm-linus
Bring all core drm changes into 2.6.32 tree and resolve
the conflict that occurs.
Conflicts:
drivers/gpu/drm/drm_fb_helper.c
Ben Skeggs [Tue, 8 Dec 2009 01:15:10 +0000 (11:15 +1000)]
drm/kms: fix fb cmap allocation to use modeset->crtc not crtc
crtc may be undefined at this point.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 4 Dec 2009 21:56:37 +0000 (16:56 -0500)]
drm/radeon/kms: enable hpd support
This enabled interrupt driven hpd support for all
radeon chips. Assuming the hpd pin is wired up
correctly, the driver will generate uevents on
digital monitor connect and disconnect and retrain
DP monitors automatically.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 4 Dec 2009 20:26:55 +0000 (15:26 -0500)]
drm/radeon/kms: add asic callbacks for hpd
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 4 Dec 2009 20:12:21 +0000 (15:12 -0500)]
drm/radeon/kms: add hpd support for r6xx/r7xx/rs780/rs880 asics
This just adds the functionality, it's not hooked up
yet.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 4 Dec 2009 20:04:19 +0000 (15:04 -0500)]
drm/radeon/kms: add hpd support for r5xx/rs600/rs690/rs740 asics
This just adds the functionality, it's not hooked up
yet.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 4 Dec 2009 19:53:41 +0000 (14:53 -0500)]
drm/radeon/kms: add hpd support for r1xx-r4xx asics
This just adds the functionality, it's not hooked up
yet.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Thu, 3 Dec 2009 18:08:53 +0000 (13:08 -0500)]
drm/radeon/kms: add regs and irq tracking bits for hpd
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 4 Dec 2009 19:45:27 +0000 (14:45 -0500)]
drm/radeon/kms: get HPD info for connectors
This populates the connectors with HPD (Hot Plug Detect)
information. This will be used in subsequent patches
for automatic digital monitor connect/disconnect handling.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 27 Nov 2009 18:14:37 +0000 (13:14 -0500)]
drm/radeon/kms: clean up DP debugging
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Fri, 27 Nov 2009 18:01:46 +0000 (13:01 -0500)]
drm/radeon/kms: fix DP detect
only return connected if there is actually a
monitor connected.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 25 Nov 2009 22:57:23 +0000 (08:57 +1000)]
drm/radeon/kms: drop unused array to fix warning.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 25 Nov 2009 22:56:35 +0000 (08:56 +1000)]
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>
Dave Airlie [Wed, 25 Nov 2009 22:55:18 +0000 (08:55 +1000)]
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>
Dave Airlie [Wed, 25 Nov 2009 22:49:17 +0000 (08:49 +1000)]
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>
Alex Deucher [Tue, 24 Nov 2009 21:13:23 +0000 (16:13 -0500)]
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>
Alex Deucher [Tue, 24 Nov 2009 18:32:59 +0000 (13:32 -0500)]
drm/radeon/kms: add support for DP modesetting
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Mon, 23 Nov 2009 23:40:40 +0000 (18:40 -0500)]
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>
Alex Deucher [Mon, 23 Nov 2009 23:02:35 +0000 (18:02 -0500)]
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>
Alex Deucher [Mon, 23 Nov 2009 22:39:28 +0000 (17:39 -0500)]
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>
Alex Deucher [Sat, 21 Nov 2009 00:40:13 +0000 (19:40 -0500)]
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>
Dave Airlie [Mon, 7 Dec 2009 21:07:28 +0000 (07:07 +1000)]
drm/radeon/kms: initial radeon displayport porting
This is enough to retrieve EDID and DPCP.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Chris Wilson [Wed, 2 Dec 2009 15:15:30 +0000 (15:15 +0000)]
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>
Chris Wilson [Wed, 2 Dec 2009 16:48:57 +0000 (16:48 +0000)]
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>
David Woodhouse [Wed, 2 Dec 2009 11:00:05 +0000 (11:00 +0000)]
agp/intel-agp: Clear entire GTT on startup
Some BIOSes fail to initialise the GTT, which will cause DMA faults when
the IOMMU is enabled. We need to clear the whole thing to point at the
scratch page, not just the part that Linux is going to use.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
[anholt: Note that this may also help with stability in the presence of
driver bugs, by not drawing to memory we don't own]
Signed-off-by: Eric Anholt <eric@anholt.net>
Dave Airlie [Mon, 7 Dec 2009 23:25:45 +0000 (09:25 +1000)]
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>
Dave Airlie [Fri, 4 Dec 2009 00:55:24 +0000 (10:55 +1000)]
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>
Alex Deucher [Mon, 7 Dec 2009 00:45:17 +0000 (19:45 -0500)]
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>
Adam Jackson [Thu, 3 Dec 2009 22:14:42 +0000 (17:14 -0500)]
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>
Alex Deucher [Fri, 4 Dec 2009 21:35:57 +0000 (16:35 -0500)]
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>
Alex Deucher [Fri, 4 Dec 2009 15:55:12 +0000 (10:55 -0500)]
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>
Alex Deucher [Fri, 4 Dec 2009 15:40:41 +0000 (10:40 -0500)]
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>
Dave Airlie [Mon, 16 Nov 2009 20:29:46 +0000 (06:29 +1000)]
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>
Adam Jackson [Thu, 3 Dec 2009 22:14:41 +0000 (17:14 -0500)]
agp/intel: 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>
Signed-off-by: Eric Anholt <eric@anholt.net>
Dave Airlie [Mon, 7 Dec 2009 21:03:55 +0000 (07:03 +1000)]
Merge remote branch 'origin/drm-core-next' into test
Conflicts:
drivers/gpu/drm/drm_fb_helper.c
Chris Wilson [Mon, 7 Dec 2009 11:34:08 +0000 (11:34 +0000)]
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>
Jesse Barnes [Thu, 3 Dec 2009 17:52:43 +0000 (09:52 -0800)]
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.
Jesse Barnes [Wed, 2 Dec 2009 21:42:53 +0000 (13:42 -0800)]
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>
Thomas Hellstrom [Sun, 6 Dec 2009 20:46:28 +0000 (21:46 +0100)]
drm: Export symbols needed for the vmwgfx driver.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Sun, 6 Dec 2009 20:46:27 +0000 (21:46 +0100)]
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>
Thomas Hellstrom [Sun, 6 Dec 2009 20:46:26 +0000 (21:46 +0100)]
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>
Thomas Hellstrom [Sun, 6 Dec 2009 20:46:25 +0000 (21:46 +0100)]
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>
Thomas Hellstrom [Sun, 6 Dec 2009 20:46:24 +0000 (21:46 +0100)]
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>
Dave Airlie [Mon, 7 Dec 2009 03:29:51 +0000 (13:29 +1000)]
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>
Alex Deucher [Sat, 5 Dec 2009 22:55:37 +0000 (17:55 -0500)]
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>
Dave Airlie [Fri, 4 Dec 2009 01:51:34 +0000 (11:51 +1000)]
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>
Alex Deucher [Thu, 3 Dec 2009 21:28:02 +0000 (16:28 -0500)]
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>
Alex Deucher [Thu, 3 Dec 2009 21:18:19 +0000 (16:18 -0500)]
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>
Alex Deucher [Thu, 3 Dec 2009 17:15:54 +0000 (12:15 -0500)]
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>
Alex Deucher [Wed, 2 Dec 2009 16:46:52 +0000 (11:46 -0500)]
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>
Alex Deucher [Tue, 1 Dec 2009 19:49:50 +0000 (14:49 -0500)]
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>
Alex Deucher [Wed, 2 Dec 2009 05:59:37 +0000 (00:59 -0500)]
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>
Rafał Miłecki [Tue, 10 Nov 2009 21:26:21 +0000 (22:26 +0100)]
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>
Rafał Miłecki [Wed, 4 Nov 2009 22:34:10 +0000 (23:34 +0100)]
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>
Rafał Miłecki [Fri, 6 Nov 2009 10:38:34 +0000 (11:38 +0100)]
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>
Dave Airlie [Fri, 4 Dec 2009 00:18:02 +0000 (10:18 +1000)]
drm/mm: fixup typo in debug functions.
Free and used were reversed.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jakob Bornecrantz [Thu, 3 Dec 2009 23:25:47 +0000 (23:25 +0000)]
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>
Martin Michlmayr [Thu, 19 Nov 2009 16:29:45 +0000 (16:29 +0000)]
drm/ttm: Fix build failure due to missing struct page
drm/ttm fails to build on MIPS because "struct page" is not known:
| In file included from drivers/gpu/drm/ttm/ttm_memory.c:28:
| include/drm/ttm/ttm_memory.h:154: warning: 'struct page' declared inside parameter list
| include/drm/ttm/ttm_memory.h:154: warning: its scope is only this definition or declaration, which is probably not what you want
| include/drm/ttm/ttm_memory.h:156: warning: 'struct page' declared inside parameter list
| drivers/gpu/drm/ttm/ttm_memory.c:540: error: conflicting types for 'ttm_mem_global_alloc_page'
| include/drm/ttm/ttm_memory.h:154: error: previous declaration of 'ttm_mem_global_alloc_page' was here
| drivers/gpu/drm/ttm/ttm_memory.c:561: error: conflicting types for 'ttm_mem_global_free_page'
| include/drm/ttm/ttm_memory.h:156: error: previous declaration of 'ttm_mem_global_free_page' was here
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Cc: stable@kernel.org
Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dan Carpenter [Sat, 28 Nov 2009 10:30:32 +0000 (12:30 +0200)]
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>
Kristian Høgsberg [Wed, 2 Dec 2009 17:13:48 +0000 (12:13 -0500)]
drm: Add compatibility #ifdefs for *BSD
This let's use use the linux drm headers as the canonical source for
libdrm on all platforms.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Wed, 2 Dec 2009 18:15:25 +0000 (18:15 +0000)]
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>
Adam Jackson [Thu, 3 Dec 2009 22:44:40 +0000 (17:44 -0500)]
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>
Adam Jackson [Thu, 3 Dec 2009 22:44:39 +0000 (17:44 -0500)]
drm/edid: Add new detailed block types from EDID 1.4
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Adam Jackson [Thu, 3 Dec 2009 22:44:38 +0000 (17:44 -0500)]
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>
Adam Jackson [Thu, 3 Dec 2009 22:44:37 +0000 (17:44 -0500)]
drm/modes: Add drm_mode_hsync()
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Adam Jackson [Thu, 3 Dec 2009 22:44:36 +0000 (17:44 -0500)]
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>
Linus Torvalds [Thu, 3 Dec 2009 03:51:21 +0000 (19:51 -0800)]
Linux 2.6.32
Julia Lawall [Sun, 9 Aug 2009 09:42:32 +0000 (11:42 +0200)]
VIDEO: Correct use of request_region/request_mem_region
request_region should be used with release_region, not request_mem_region.
Geert Uytterhoeven pointed out that in the case of drivers/video/gbefb.c,
the problem is actually the other way around; request_mem_region should be
used instead of request_region.
The semantic patch that finds/fixes this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r1@
expression start;
@@
request_region(start,...)
@b1@
expression r1.start;
@@
request_mem_region(start,...)
@depends on !b1@
expression r1.start;
expression E;
@@
- release_mem_region
+ release_region
(start,E)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Atsushi Nemoto [Thu, 3 Sep 2009 13:59:01 +0000 (22:59 +0900)]
SPI: spi_txx9: Fix bit rate calculation
TXx9 SPI bit rate is calculated by:
fBR = (spi-baseclk) / (n + 1)
Fix calculation of min_speed_hz, max_speed_hz and n.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>