Commit graph

92 commits

Author SHA1 Message Date
Alex Deucher 68b61a7fd2 drm/radeon/kms/combios: match lvds panel info parsing to ddx
Should work better on some panels.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 15:54:22 +10:00
Dave Airlie c9c2625ff4 Merge branch 'drm-edid-fixes' into drm-core-next
* drm-edid-fixes:
  drm/edid: When checking duplicate standard modes, walked the probed list
  drm/edid: Fix sync polarity for secondary GTF curve
  drm/modes: Fix interlaced mode names
  drm/edid: Add secondary GTF curve support
  drm/edid: Strengthen the algorithm for standard mode codes
  drm/edid: Fix the HDTV hack.
  drm/edid: Extend range-based mode addition for EDID 1.4
  drm/edid: Add test for monitor reduced blanking support.
  drm/edid: Fix preferred mode parse for EDID 1.4
  drm/edid: Remove some silly comments
  drm/edid: Remove arbitrary EDID extension limit
  drm/edid: Add modes for Established Timings III section
  drm/edid: Reshuffle mode list construction to closer match the spec
  drm/edid: Remove a redundant check
  drm/edid: Remove some misleading comments
  drm/edid: Fix secondary block fetch.
2010-04-20 13:14:38 +10:00
Alex Deucher 3a89b4a9ca drm/radeon/kms/combios: verify dac_adj values are valid
Some vbios dac_adj tables are all zeros.  Check for that
case and use the default table if so.

Should fix fdo bug 27478.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-07 10:13:18 +10:00
Adam Jackson 7466f4cc50 drm/edid: Remove arbitrary EDID extension limit
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-06 10:40:20 +10:00
Dave Airlie 3595be778d Merge branch 'v2.6.34-rc2' into drm-linus 2010-03-31 14:55:14 +10:00
Alex Deucher b28ea41164 drm/radeon/kms/r1xx: enable hw i2c
fixing the i2c prescale in the last patch
gets it working on r1xx.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-15 09:58:46 +10:00
Alex Deucher 86cb2bbfda drm/radeon/kms: use lcd pll limits when available
The bios has alternate pll output limits for LCD panels.
If available, use these for pll divider calculations.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-15 09:56:46 +10:00
Linus Torvalds 03a2c4d76c Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (151 commits)
  vga_switcheroo: disable default y by new rules.
  drm/nouveau: fix *staging* driver build with switcheroo off.
  drm/radeon: fix typo in Makefile
  vga_switcheroo: fix build on platforms with no ACPI
  drm/radeon: Fix printf type warning in 64bit system.
  drm/radeon/kms: bump the KMS version number for square tiling support.
  vga_switcheroo: initial implementation (v15)
  drm/radeon/kms: do not disable audio engine twice
  Revert "drm/radeon/kms: disable HDMI audio for now on rv710/rv730"
  drm/radeon/kms: do not preset audio stuff and start timer when not using audio
  drm/radeon: r100/r200 ums: block ability for userspace app to trash 0 page and beyond
  drm/ttm: fix function prototype to match implementation
  drm/radeon: use ALIGN instead of open coding it
  drm/radeon/kms: initialize set_surface_reg reg for rs600 asic
  drm/i915: Use a dmi quirk to skip a broken SDVO TV output.
  drm/i915: enable/disable LVDS port at DPMS time
  drm/i915: check for multiple write domains in pin_and_relocate
  drm/i915: clean-up i915_gem_flush_gpu_write_domain
  drm/i915: reuse i915_gpu_idle helper
  drm/i915: ensure lru ordering of fence_list
  ...

Fixed trivial conflicts in drivers/gpu/vga/Kconfig
2010-03-04 07:49:37 -08:00
Linus Torvalds 6ebdc661b6 Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: (41 commits)
  of: remove undefined request_OF_resource & release_OF_resource
  of/sparc: Remove sparc-local declaration of allnodes and devtree_lock
  of: move definition of of_chosen into common code.
  of: remove unused extern reference to devtree_lock
  of: put default string compare and #a/s-cell values into common header
  of/flattree: Don't assume HAVE_LMB
  of: protect linux/of.h with CONFIG_OF
  proc_devtree: fix THIS_MODULE without module.h
  of: Remove old and misplaced function declarations
  of/flattree: Make the kernel accept ePAPR style phandle information
  of/flattree: endian-convert members of boot_param_header
  of: assume big-endian properties, adding conversions where necessary
  of: use __be32 for cell value accessors
  of/flattree: use OF_ROOT_NODE_{SIZE,ADDR}_CELLS DEFAULT for fdt parsing
  of/flattree: use callback to setup initrd from /chosen
  proc_devtree: include linux/of.h
  of: make set_node_proc_entry private to proc_devtree.c
  of: include linux/proc_fs.h
  of/flattree: merge early_init_dt_scan_memory() common code
  of: add 'of_' prefix to machine_is_compatible()
  ...
2010-02-25 15:38:37 -08:00
Rafał Miłecki 9038dfdf69 drm/radeon/kms: simplify storing current and requested PM mode
We kept pointers to requested and current clock modes in every power state.
That was useless, more /global/ pointers in power struct are enough.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-23 09:46:51 +10:00
Rafał Miłecki 2745932495 drm/radeon/kms: accept slightly overclocked power modes
Fixes fdo bug #26329

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Tested-by: Tobias Jakobi <liquid.acid@gmx.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-18 14:25:08 +10:00
Michel Dänzer 03047cdf72 drm/radeon/kms: Test rdev->bios centrally in combios_get_table_offset().
It's happened time and time again (most recently with the support for EDID
hardcoded in the BIOS ROM) that new code didn't check for rdev->bios being
non-NULL before triggering dereferences of it. This would result in an
oops/panic on setups with no BIOS ROM. Hopefully this central test will be
more robust.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-11 19:04:06 +10:00
Grant Likely 71a157e8ed of: add 'of_' prefix to machine_is_compatible()
machine is compatible is an OF-specific call.  It should have
the of_ prefix to protect the global namespace.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Michal Simek <monstr@monstr.eu>
2010-02-09 08:33:00 -07:00
Alex Deucher bcc1c2a1d2 drm/radeon/kms: add initial Evergreen support (Radeon HD 5xxx)
This adds initial Evergreen KMS support, it doesn't include
any acceleration features or interrupt handling yet.

Major changes are DCE4 handling for PLLs for the > 2 crtcs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-09 09:44:02 +10:00
Alex Deucher 0ec0e74f78 drm/radeon/kms: add a power state type based on power state flags
The idea is to flag a power state with a certain type and use
that type to decide on what state to select.  On r6xx+, we
select a state and then transition between clock modes in that
state.  On pre-r6xx, we transition between states directly.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-09 09:32:28 +10:00
Alex Deucher 56278a8eda drm/radeon/kms: pull power mode info from bios tables (v3)
The general idea is to validate the current hw state
against the set of power states and select a power
state based on that.  This patch just pulls the power
states from the bios and prints the information.  It
is not currently hooked up in the actual power management
code.  Hooking it up will require reworking the the current
power state selection code and will be handled in a future
patch.

Additionally, we'd need to decide on some default lower
power states for cards without power tables.

v2 - increment state_index after checking for default state
v3 - fix typo in pm init on pre-atom cards, handle pre-atom
cards without x86 bioses

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-09 09:32:27 +10:00
Alex Deucher 3c537889e1 drm/radeon/kms: add support for hardcoded edids in rom (v2)
Some servers hardcode an edid in rom so that they will
work properly with KVMs.  This is a port of the relevant
code from the ddx.

[airlied: reworked to validate edid at boot stage - and
remove special quirk, if there is a valid EDID in the BIOS rom
we'll just try and use it.]

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-09 09:31:20 +10:00
Alex Deucher 40bacf1631 drm/radeon/kms: add support for hw i2c on r1xx-r5xx
wire hw i2c support into radeon i2c algo.

fixes merged:
- handle bus probing correctly
- use meaningful error numbers
- abort if transaction fails
- The line mapping is different depending on the asic.
- protect hw i2c engine with a mutex
- rs300 doesn't have a pin select bit
- r200 has a different pin select setup

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-09 09:31:10 +10:00
Alex Deucher 5a6f98f5bf drm/radeon/kms: add radeon i2c algo
Currently just a wrapper around bit algo

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-05 15:10:19 +10:00
Andrew Morton 94cf6434a1 drivers/gpu/drm/radeon/radeon_combios.c: fix warning
drivers/gpu/drm/radeon/radeon_combios.c: In function 'radeon_combios_get_lvds_info':
drivers/gpu/drm/radeon/radeon_combios.c:893: warning: comparison is always false due to limited range of data type

Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-05 11:47:14 +10:00
Michel Dänzer 11f3b59e36 drm/radeon/kms: Fix crash getting TV info with no BIOS.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-13 13:25:10 +10:00
Alex Deucher 06b6476d6b drm/radeon/kms: detect sideport memory on IGP chips
This detects if the sideport memory is enabled and
if it is VRAM is evicted on suspend/resume.

This should fix s/r issues on some IGPs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-08 13:08:56 +10:00
Alex Deucher 246263ccc3 drm/radeon/kms: add primary dac adj values table
Look up primary dac adj values from the table if
there is no bios or bios dac table to reference.

The lookup table may need to be adjusted for certain
families.

Should fix kernel bug 14945.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-06 11:31:55 +10:00
Alex Deucher d79766fab9 drm/radeon/kms: set proper default tv standard
we were just using 1 before.

reported on irc by soreau

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-23 11:14:03 +10:00
Alex Deucher eed45b30cd 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>
2009-12-08 10:46:28 +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
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 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 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 b75fad0682 drm/radeon/kms: store detailed connector info
This will be useful for mode validation and certain
atom tables.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-11-06 11:35:30 +10:00
Alex Deucher fc7f7119d2 drm/radeon/kms: add quirk for hp dc5750
Doesn't have a tv-out port

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-10-28 15:52:17 +10:00
Alex Deucher 790cfb34ad drm/radeon/kms: add quirk for acer 5102
doesn't have a tv-out port

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-10-26 13:28:20 +10:00
Alex Deucher d0c403e950 drm/radeon/kms: fix support for original r100
Original radeon didn't have a connector table in the
bios.  Check for the CRT table and if we have one,
add a VGA connector.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-10-16 18:31:29 +10:00
Alex Deucher 2d152c6ba8 drm/radeon/kms: fix legacy quirk handling
Need to check the return type for the quirk function
to decide whether we add the connectors and encoders.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-10-16 18:31:28 +10:00
Alex Deucher de2103e452 drm/radeon/kms: use drm_mode directly for panel modes
This reduces the number of mode format conversions needed
and makes native panel mode support cleaner.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-10-12 13:42:48 +10:00
Dave Airlie 445282db9e drm/radeon/kms: add initial connector properties
This adds:
coherent mode: TMDS coherent mode for atom cards.
scaling mode: LVDS scaler mode
load detect: DAC load detection, DVI-I, VGA, TV
tmds pll: legacy TMDS pll selection
tv standard: TV standard selection.

for later: other TV ones? dvi subconnector selection using std prop

[contains fixes pointed out on dri-devel for atom bios mixups
 by Michel]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-09-18 16:02:00 +10:00
Michel Dänzer 8dfaa8a777 drm/radeon/kms: Get LVDS native mode details from EDID if necessary.
Fixes RMX problems on older Apple laptops which don't have an x86 BIOS ROM.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-09-16 16:10:19 +10:00
Dave Airlie 6a719e0533 drm/kms/radeon: cleanup combios TV table like DDX.
The fallback case wasn't getting executed properly if there
was no TV table, which my T42 M7 hasn't got.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-08-19 14:11:32 +10:00
Michel Dänzer 8b5c744485 drm/radeon: Fully initialize LVDS info also when we can't get it from the ROM.
This makes the panel on my PowerBook light up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-06-19 09:30:06 +10:00
Alex Deucher 6fe7ac3f5b radeon legacy chips: tv dac bg/dac adj updates
COMBIOS - fallback to table values if there are no tv dac or lvds bios tables
ATOMBIOS - add support for looking up these values from the bios table

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-06-15 12:02:27 +10:00
Jerome Glisse 771fe6b912 drm/radeon: introduce kernel modesetting for radeon hardware
Add kernel modesetting support to radeon driver, use the ttm memory
manager to manage memory and DRM/GEM to provide userspace API.
In order to avoid backward compatibility issue and to allow clean
design and code the radeon kernel modesetting use different code path
than old radeon/drm driver.

When kernel modesetting is enabled the IOCTL of radeon/drm
driver are considered as invalid and an error message is printed
in the log and they return failure.

KMS enabled userspace will use new API to talk with the radeon/drm
driver. The new API provide functions to create/destroy/share/mmap
buffer object which are then managed by the kernel memory manager
(here TTM). In order to submit command to the GPU the userspace
provide a buffer holding the command stream, along this buffer
userspace have to provide a list of buffer object used by the
command stream. The kernel radeon driver will then place buffer
in GPU accessible memory and will update command stream to reflect
the position of the different buffers.

The kernel will also perform security check on command stream
provided by the user, we want to catch and forbid any illegal use
of the GPU such as DMA into random system memory or into memory
not owned by the process supplying the command stream. This part
of the code is still incomplete and this why we propose that patch
as a staging driver addition, future security might forbid current
experimental userspace to run.

This code support the following hardware : R1XX,R2XX,R3XX,R4XX,R5XX
(radeon up to X1950). Works is underway to provide support for R6XX,
R7XX and newer hardware (radeon from HD2XXX to HD4XXX).

Authors:
    Jerome Glisse <jglisse@redhat.com>
    Dave Airlie <airlied@redhat.com>
    Alex Deucher <alexdeucher@gmail.com>

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-06-15 12:01:53 +10:00