Commit graph

84763 commits

Author SHA1 Message Date
Jerome Glisse 10b06122af drm/radeon/kms: release AGP bridge at suspend
I think it's good to release the AGP bridge at suspend
and reacquire it at resume. Also fix :
https://bugzilla.kernel.org/show_bug.cgi?id=15969

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-24 10:02:08 +10:00
Alex Deucher b486787ee4 drm/radeon/kms/pm/r600: select the mid clock mode for single head low profile
This saves some more power at the expense of performance.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-21 15:47:40 +10:00
Dave Airlie df696a6fe8 Merge remote branch 'nouveau/for-airlied' into drm-next
* nouveau/for-airlied:
  drm/nouveau: fix i2c-related init table handlers
  drm/nouveau: support init table i2c device identifier 0x81
  drm/nouveau: ensure we've parsed i2c table entry for INIT_*I2C* handlers
  drm/nouveau: display error message for any failed init table opcode
  drm/nouveau: fix init table handlers to return proper error codes
  drm/nv50: support fractional feedback divider on newer chips
  drm/nv50: fix monitor detection on certain chipsets
  drm/nv50: store full dcb i2c entry from vbios
  drm/nv50: fix suspend/resume with DP outputs
  drm/nv50: output calculated crtc pll when debugging on
  drm/nouveau: dump pll limits entries when debugging is on
  drm/nouveau: bios parser fixes for eDP boards
  drm/nouveau: fix a nouveau_bo dereference after it's been destroyed
  drm/nv40: remove some completed ctxprog TODOs
  drm/nv04: Implement missing nv04 PGRAPH methods in software.
  drm/nouveau: Use 0x5f instead of 0x9f as imageblit on original NV10.
2010-05-21 15:44:32 +10:00
Dave Airlie 5d9b7e2d2d drm/radeon: fix power supply kconfig interaction.
radeon needs power supply to get correct PM info so select it at the radeon
level not at the kms option.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-21 15:41:20 +10:00
Jerome Glisse e865275335 drm/radeon/kms: record object that have been list reserved
list reservation was too optimistic about ttm object reservation
and could think that an object reserved by some other process
as reserved by the list reservation which was false. Thus when
unreserving the list it might unreserve object that it didn't
reserved in the list. Sorry if it's hard to follow but this
kind of things are just causing headheck.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-21 15:07:24 +10:00
Michel Dänzer 365048ff7f drm/radeon: AGP memory is only I/O if the aperture can be mapped by the CPU.
Fixes AGP initialization failure with Apple UniNorth bridges due to trying to
ioremap() normal RAM.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-21 15:06:45 +10:00
Alex Deucher 45737447ed drm/radeon/kms: don't default display priority to high on rs4xx
Seems to cause issues with the sound hardware.  Fixes kernel
bug 15982:
https://bugzilla.kernel.org/show_bug.cgi?id=15982

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-21 15:06:06 +10:00
Alex Deucher c43ae476a5 drm/edid: fix typo in 1600x1200@75 mode
Spotted by Scott Bertilson.
Fixes fdo bug 28146.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Mark Marshall <mark.marshall@csr.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-21 15:05:15 +10:00
Ben Skeggs 893887ed75 drm/nouveau: fix i2c-related init table handlers
Mutliple issues.  INIT_ZM_I2C_BYTE/INIT_I2C_BYTE didn't even try and
use the register value, and all the handlers were using the wrong
slave address.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 16:22:08 +10:00
Ben Skeggs 04f542c07e drm/nouveau: support init table i2c device identifier 0x81
It appears to be meant to reference the second "default index".

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 16:22:07 +10:00
Ben Skeggs f8b0be1a75 drm/nouveau: ensure we've parsed i2c table entry for INIT_*I2C* handlers
We may not have parsed the entry yet if the i2c_index is for an i2c bus
that's not referenced by a DCB encoder.

This could be done oh so much more nicely, except we have to care about
prehistoric DCB tables too, and they make life painful.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 16:22:05 +10:00
Ben Skeggs 92b9618761 drm/nouveau: display error message for any failed init table opcode
Some handlers don't report specific errors, but we still *really* want to
know if we failed to parse a complete init table.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 16:22:04 +10:00
Ben Skeggs 9170a82438 drm/nouveau: fix init table handlers to return proper error codes
We really want to be able to distinguish between INIT_DONE and an actual
error sometimes.  This commit fixes up several lazy "return 0;" to be
actual error codes, and explicitly reserves "0" as "success, but stop
parsing this table".

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 16:22:00 +10:00
Ben Skeggs e9ebb68b86 drm/nv50: support fractional feedback divider on newer chips
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 16:21:59 +10:00
Ben Skeggs 7e99a9b2b5 drm/nv50: fix monitor detection on certain chipsets
There appears to be some kind of switch on certain chips to control whether
the DP auxch or traditional i2c bus will be operational on a connector,
this commit hopefully fixes nouveau to do the right thing.

Likely only relevent on chips with DP outputs.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 13:15:16 +10:00
Ben Skeggs 07fee3d561 drm/nv50: store full dcb i2c entry from vbios
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 13:15:16 +10:00
Ben Skeggs afa3b4c377 drm/nv50: fix suspend/resume with DP outputs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 13:15:16 +10:00
Ben Skeggs 17b96cc38d drm/nv50: output calculated crtc pll when debugging on
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 13:15:15 +10:00
Ben Skeggs 4c389f00d5 drm/nouveau: dump pll limits entries when debugging is on
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 13:15:15 +10:00
Ben Skeggs 25908b7797 drm/nouveau: bios parser fixes for eDP boards
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 13:15:15 +10:00
Ben Skeggs 90af89b93c drm/nouveau: fix a nouveau_bo dereference after it's been destroyed
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 13:15:14 +10:00
Ben Skeggs de1f46a4b9 drm/nv40: remove some completed ctxprog TODOs
I actually thought these were gone already when the initial commit was
done.. I guess not!

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 13:15:14 +10:00
Marcin Kościelnicki f23d4cf4bd drm/nv04: Implement missing nv04 PGRAPH methods in software.
Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 13:15:14 +10:00
Marcin Kościelnicki a0e6544089 drm/nouveau: Use 0x5f instead of 0x9f as imageblit on original NV10.
Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-05-19 13:15:14 +10:00
Dave Airlie 669899878c drm/radeon: fix hdmi offset bug reported by smatch.
Reported-by: Dan Carpenter
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-19 10:35:02 +10:00
Alex Deucher 8e36ed0084 drm/radeon/kms: hpd cleanup
- Use radeon hpd enum consistently (in both hotplug and dp)
- Legacy r100 with DVI should be HPD_1 not NONE

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-19 10:31:41 +10:00
Alex Deucher 2bfcc0fc69 drm/radeon/kms: reset ddc_bus in object header parsing
Some LVDS connectors don't have a ddc bus, so reset the
ddc bus to invalid before parsing the next connector
to avoid using stale ddc bus data.  Should fix
fdo bug 28164.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-19 10:31:16 +10:00
Ben Hutchings 6fd0248939 amd64-agp: Probe unknown AGP devices the right way
The current initialisation code probes 'unsupported' AGP devices
simply by calling its own probe function.  It does not lock these
devices or even check whether another driver is already bound to
them.

We must use the device core to manage this.  So if the specific
device id table didn't match anything and agp_try_unsupported=1,
switch the device id table and call driver_attach() again.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-19 10:13:19 +10:00
Ben Hutchings d831692a1a sis-agp: Remove SIS 760, handled by amd64-agp
SIS 760 is listed in the device tables for both amd64-agp and sis-agp.
amd64-agp is apparently preferable since it has workarounds for some
BIOS misconfigurations that sis-agp doesn't handle.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-19 10:11:23 +10:00
Dave Airlie 05ea893c46 Merge remote branch 'anholt/drm-intel-next' into drm-next
* anholt/drm-intel-next: (515 commits)
  drm/i915: Fix out of tree builds
  drm/i915: move fence lru to struct drm_i915_fence_reg
  drm/i915: don't allow tiling changes on pinned buffers v2
  drm/i915: Be extra careful about A/D matching for multifunction SDVO
  drm/i915: Fix DDC bus selection for multifunction SDVO
  drm/i915: cleanup mode setting before unmapping registers
  drm/i915: Make fbc control wrapper functions
  drm/i915: Wait for the GPU whilst shrinking, if truly desperate.
  drm/i915: Use spatio-temporal dithering on PCH
  [MTD] Remove zero-length files mtdbdi.c and internal.ho
  pata_pcmcia / ide-cs: Fix bad hashes for Transcend and kingston IDs
  libata: Fix several inaccuracies in developer's guide
  slub: Fix bad boundary check in init_kmem_cache_nodes()
  raid6: fix recovery performance regression
  KEYS: call_sbin_request_key() must write lock keyrings before modifying them
  KEYS: Use RCU dereference wrappers in keyring key type code
  KEYS: find_keyring_by_name() can gain access to a freed keyring
  ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice)
  ALSA: hda - Add quirk for Dell Inspiron 19T using a Conexant CX20582
  ALSA: take tu->qlock with irqs disabled
  ...
2010-05-19 09:35:51 +10:00
Dave Airlie 26481fb156 drm/radeon/pm: fix device_create_file return value checks.
print an error if these fail.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:58:56 +10:00
Alex Deucher 4bff51711c drm/radeon/kms/pm: fix r6xx+ profile setup
This patch is a combination of the previous two profile
patches, but without the index bugs.  It cleans up and
fixes some issues with pm profile setup on r6xx chips.
Some tables have different orderings for the power states,
also, r600 only has 1 clock mode per power state. On
desktop cards there are no battery modes, so the low and high
power states are the same.  For the low profile case, choose
the lower clock mode.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:55 +10:00
Alex Deucher ce8a3eb20c drm/radeon/kms/pm: make pm spam debug only
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:53 +10:00
Alex Deucher ce8f53709b drm/radeon/kms/pm: rework power management
- Separate dynpm and profile based power management methods.  You can select the pm method
  by echoing the selected method ("dynpm" or "profile") to power_method in sysfs.
- Expose basic 4 profile in profile method
  "default" - default clocks
  "auto" - select between low and high based on ac/dc state
  "low" - DC, low power mode
  "high" - AC, performance mode
  The current base profile is "default", but it should switched to "auto" once we've tested
  on more systems.  Switching the state is a matter of echoing the requested profile to
  power_profile in sysfs.  The lowest power states are selected automatically when dpms turns
  the monitors off in all states but default.
- Remove dynamic fence-based reclocking for the moment.  We can revisit this later once we
  have basic pm in.
- Move pm init/fini to modesetting path.  pm is tightly coupled with display state.  Make sure
  display side is initialized before pm.
- Add pm suspend/resume functions to make sure pm state is properly reinitialized on resume.
- Remove dynpm module option.  It's now selectable via sysfs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:52 +10:00
Alex Deucher d7311171c4 drm/radeon/kms/pm: add support for no display power states
The lowest power states often cause display problems, so only enable
them when all displays are off.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:50 +10:00
Alex Deucher ca2af92311 drm/radeon/kms: fix lock ordering in ring, ib handling
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:48 +10:00
Matthew Garrett 01434b4bfb radeon: Use fences to gate entry to reclocking on <r600
GUI idle interrupts don't seem to work terribly well on r500 and earlier,
so let's use a fence instead.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:47 +10:00
Matthew Garrett 91700f3cac radeon: Split out ring locking and allocation
We need to handle the ring while we've already locked it, so split out
the allocation and commit functions in order to allow them to be used.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:45 +10:00
Alex Deucher 78930b1c39 drm/radeon/kms: enable misc pm power state features on r1xx-r4xx
voltage drop, dynamic voltage, dynamic sclk, pcie lane adjust, etc,

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:43 +10:00
Alex Deucher 536fcd5124 drm/radeon/kms: enable misc pm power state features on r5xx, rs6xx
voltage drop, dynamic voltage, dynamic sclk, pcie lane adjust, etc,

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:42 +10:00
Alex Deucher 4f3218cbc3 drm/radeon/kms: re-enable gui idle interrupts on r6xx+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:38 +10:00
Dave Airlie f4b7fb94c5 drm/radeon/kms: take vram mutex pointer before derefing object.
since derefing the object might free it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:37 +10:00
Alex Deucher 539d241817 drm/radeon/kms: more pm fixes
- disable gui idle interrupt use
  Seems to hang some r5xx chips
- move vbl range check into
  existing vbl check function in
  radeon_pm.c
- disable crtc mc acccess for the
  whole reclocking process

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:35 +10:00
Ben Skeggs 68adac5e49 drm: move radeon_fixed.h to shared drm_fixed.h header
Will be used by nouveau driver also in the near future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:33 +10:00
Matthew Garrett 15a7df8db8 radeon: Enable memory reclocking on r100-500
This seems to be relatively stable now, so enable it for these chipsets
too.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:31 +10:00
Matthew Garrett f81f202402 radeon: Try harder to ensure we reclock in vblank
The vblank interrupt on r600 doesn't seem to be especially reliable, so
perform some sanity checks before the actual reclock.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:29 +10:00
Matthew Garrett 612e06ce9c radeon: Fix locking in power management paths
The ttm code could take vram_mutex followed by cp_mutex, while the
reclocking code would do the reverse. Hilarity could ensue.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:27 +10:00
Matthew Garrett c37d230af4 radeon: Make sure that we determine the correct PM state before transition
We need to choose the correct PM state to transition into before starting
the actual change. Call radeon_get_power_state() at the top of the clock
setting to do so.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:26 +10:00
Matthew Garrett 956ac86d92 radeon: Enable memory reclockong on r600
With luck, dynamic memory reclocking on r600 should be stable with
the previous patches. Enable it.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:23 +10:00
Matthew Garrett d9932a3241 radeon: Stop the ttm workqueue while reclocking
The ttm bo workqueue may touch objects while we're reclocking, so make
sure it's blocked until we're done.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:22 +10:00