History log of /drivers/gpu/drm/radeon/radeon_combios.c
Revision Date Author Comments
080cbcb4f81299ff86e99f8ba12b692a58d0aa65 23-Sep-2014 Michele Curti <michele.curti@gmail.com> drm/radeon/combios: declare legacy_connector_convert as static

legacy_connector_convert is used in radeon_combios.c only, so declare it as static.

Signed-off-by: Michele Curti <michele.curti@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
0091fc13c737e1c72fea1cea96b312d3ff86a321 07-Jan-2014 Rashika Kheria <rashika.kheria@gmail.com> drivers: gpu: Move prototype declarations to header file radeon_mode.h from radeon_atombios.c and radeon_combios.c

Move prototype declarations of functions radeon_get_encoder_enum() and
radeon_link_encoder_connector() to header file drm/radeon/radeon_mode.h
because they are used by more than one file.

This eliminates the following warnings in drm/radeon/radeon_encoders.c:
drivers/gpu/drm/radeon/radeon_encoders.c:86:1: warning: no previous prototype for ‘radeon_get_encoder_enum’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_encoders.c:162:1: warning: no previous prototype for ‘radeon_link_encoder_connector’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
a38eab52ff14345b336278e92d2ac1d1c8f92777 07-Jan-2014 Rashika Kheria <rashika.kheria@gmail.com> drivers: gpu: Move prototype declaration to header file radeon_mode.h

Move prototype declaration of functions radeon_add_atom_connector() and
radeon_add_legacy_connector() to header file drm/radeon/radeon_mode.h
because they are used by more than one file.

This eliminates the following warning in drm/radeon/radeon_connectors.c:
drivers/gpu/drm/radeon/radeon_connectors.c:1588:1: warning: no previous prototype for ‘radeon_add_atom_connector’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_connectors.c:2020:1: warning: no previous prototype for ‘radeon_add_legacy_connector’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
cef1d00cd56f600121ad121875655ad410a001b8 21-Jul-2013 Mark Kettenis <kettenis@openbsd.org> drm/radeon: fix combios tables on older cards

Noticed that my old Radeon 7500 hung after printing

drm: GPU not posted. posting now...

when it wasn't selected as the primary card the BIOS. Some digging
revealed that it was hanging in combios_parse_mmio_table() while
parsing the ASIC INIT 3 table. Looking at the BIOS ROM for the card,
it becomes obvious that there is no ASIC INIT 3 table in the BIOS.
The code is just processing random garbage. No surprise it hangs!

Why do I say that there is no ASIC INIT 3 table is the BIOS? This
table is found through the MISC INFO table. The MISC INFO table can
be found at offset 0x5e in the COMBIOS header. But the header is
smaller than that. The COMBIOS header starts at offset 0x126. The
standard PCI Data Structure (the bit that starts with 'PCIR') lives at
offset 0x180. That means that the COMBIOS header can not be larger
than 0x5a bytes and therefore cannot contain a MISC INFO table.

I looked at a dozen or so BIOS images, some my own, some downloaded from:

<http://www.techpowerup.com/vgabios/index.php?manufacturer=ATI&page=1>

It is fairly obvious that the size of the COMBIOS header can be found
at offset 0x6 of the header. Not sure if it is a 16-bit number or
just an 8-bit number, but that doesn't really matter since the tables
seems to be always smaller than 256 bytes.

So I think combios_get_table_offset() should check if the requested
table is present. This can be done by checking the offset against the
size of the header. See the diff below. The diff is against the WIP
OpenBSD codebase that roughly corresponds to Linux 3.8.13 at this
point. But I don't think this bit of the code changed much since
then.

For what it is worth:

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
03ed8cf9b28d886c64c7e705c7bb1a365fd8fb95 19-Jul-2013 Alex Deucher <alexander.deucher@amd.com> drm/radeon: improve dac adjust heuristics for legacy pdac

Hopefully avoid more quirks in the future due to bogus
vbios dac data.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
f7929f34fa0e0bb6736a2484fdc07d77a1653081 19-Jul-2013 Ondrej Zary <linux@rainbow-software.org> drm/radeon: Another card with wrong primary dac adj

Hello,
got another card with "too bright" problem:
Sapphire Radeon VE 7000 DDR (VGA+S-Video)

lspci -vnn:
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices [AMD] nee ATI RV100 QY [Radeon 7000/VE] [1002:5159] (prog-if 00 [VGA controller])
Subsystem: PC Partner Limited Sapphire Radeon VE 7000 DDR [174b:7c28]

The patch below fixes the problem for this card.
But I don't like the blacklist, couldn't some heuristic be used instead?
The interesting thing is that the manufacturer is the same as the other card
needing the same quirk. I wonder how many different types are broken this way.

The "wrong" ps2_pdac_adj value that comes from BIOS on this card is 0x300.

====================
drm/radeon: Add primary dac adj quirk for Sapphire Radeon VE 7000 DDR

Values from BIOS are wrong, causing too bright colors.
Use default values instead.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
e8fc41377f5037ff7a661ea06adc05f1daec1548 27-Feb-2013 Alex Deucher <alexander.deucher@amd.com> drm/radeon: add primary dac adj quirk for R200 board

vbios values are wrong leading to colors that are
too bright. Use the default values instead.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
9200ee4941a6e5d1ec5df88982243686882dff3f 29-Jan-2013 Alex Deucher <alexander.deucher@amd.com> drm/radeon: add quirk for RV100 board

vbios says external TMDS while the board is actually
internal TMDS.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
cafa59b9011a7790be4ddd5979419259844a165d 20-Dec-2012 Alex Deucher <alexander.deucher@amd.com> drm/radeon: add connector table for Mac G4 Silver

Apple cards do not provide data tables in the vbios
so we have to hard code the connector parameters
in the driver.

Reported-by: Albrecht Dreß <albrecht.dress@arcor.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2ef9bdfe64079c9d0b98dc89af3af52918b818a0 02-Dec-2012 Daniel Vetter <daniel.vetter@ffwll.ch> drm/radeon: add W|RREG32_IDX for MM_INDEX|DATA based mmio accesss

Just refactoring to make the next patche simpler. Now all indirect register
access in the new modesetting driver should go through the r100_mm_(w|r)reg
fucntions.

RADEON_READ_MM from the old driver seems to be totally unused, so just kill
it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
760285e7e7ab282c25b5e90816f7c47000557f4f 02-Oct-2012 David Howells <dhowells@redhat.com> UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/

Convert #include "..." to #include <path/...> in drivers/gpu/.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Dave Jones <davej@redhat.com>
e9e2fbe975a1938b1acadb94ac7d5934298974ac 31-Jul-2012 Lauri Kasanen <cand@gmx.com> drm/radeon: Remove unused functions

This applies on top of drm/radeon: Mark all possible functions / structs as static.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1109ca09b9e2f2766d64d037a88ea8816559b3b3 31-Aug-2012 Lauri Kasanen <cand@gmx.com> drm/radeon: Mark all possible functions / structs as static

Let's allow GCC to optimize better.

This exposed some five unused functions, but this patch doesn't remove them.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3d61bd42135a5801ce6c2bc47f33277fde74e5ea 20-Jul-2012 Alex Deucher <alexander.deucher@amd.com> drm/radeon: fix handling for ddc type 5 on combios

When ddc type is 5, need to look up the i2c channel
in the i2c table.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6a556039e7823d27a0a7f7724d4d455053ea9253 02-May-2012 Alex Deucher <alexander.deucher@amd.com> drm/radeon: add connector table for SAM440ep embedded board

RV250 found on ppc embedded boards.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4de833c337509916b7931982734d858191cf0700 05-Apr-2012 Arnd Bergmann <arnd@arndb.de> drm/radeon: replace udelay with mdelay for long timeouts

Some architectures require that delays longer than a few
miliseconds are called through mdelay. This was triggered
on ARM randconfig builds.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
a7c36fd8c5ee6dcca584137cb81aeefd785a0721 12-Nov-2011 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms/combios: fix dynamic allocation of PM clock modes

I missed the combios path when I updated the atombios pm code.

Reported by amarsh04 on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
286e0c94f9c3f292cb38a977fbbde3433347a868 06-Oct-2011 Jean Delvare <jdelvare@suse.de> drm/radeon/kms: Fix I2C mask definitions

Commit 9b9fe724 accidentally used RADEON_GPIO_EN_* where
RADEON_GPIO_MASK_* was intended. This caused improper initialization
of I2C buses, mostly visible when setting i2c_algo_bit.bit_test=1.
Using the right constants fixes the problem.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Jerome Glisse <j.glisse@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
302a8e8b06d312dcb3b718dfeb42aa912b5f426b 29-Aug-2011 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms: add s/r quirk for Compaq Presario V5245EU

Fixes resume on Compaq Presario V5245EU.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=41642

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
c41b9ee901bb2c7e3eacfa7e171de50c15d61c0b 30-Jul-2011 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms: add thermal chip quirk for asus 9600xt

The board has an lm63 compatible thermal chip, but no
thermal chip entry in the vbios tables.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6dd666333ddee39903d86f870d5c40d9f100e0cc 23-Jul-2011 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms: fix i2c map for rv250/280

Those chips have crt2_ddc bus.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=39672

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
7c88d2b80ba5c175398013842782461a3b980130 14-Jun-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: be more pedantic about the g5 quirk (v2)

I don't think Apple offered any other cards for
this mac, so I doubt this will be an issue, but just
to be on the safe side, check the pci ids as well.

v2: fix spelling in commit message

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: Joachim Henke <j-o@users.sourceforge.net>
Cc: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
ab21e60beaa96f2c55604f633dfe74076c531df7 06-Jun-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix mac g5 quirk

Apple uses the same subsystem pci ids for lots of
hardware much of which is wired up differently. In
this case, the G5 imac and the G5 tower.

Only apply the quirk configuration to G5 towers.

Reported-by: Joachim Henke <j-o@users.sourceforge.net>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: Joachim Henke <j-o@users.sourceforge.net>
Cc: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
b20f9bef8d9ff54be266062eae365ebf4b12ca64 08-Jun-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: check modes against max pixel clock

Filter out modes that are higher than the max pixel
clock.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
776f2b7cb473baa52cdeee9804073342dee7d7cb 04-May-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix some logic errors in combios i2c mapping

The virtual i2c to real i2c channel mappings weren't setting
the right id in some cases.

Spotted by: Andrew Randrianasulu

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
508c8d60bd08640db39146edbbfdbf01a802163d 04-May-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix up r1xx-rs4xx i2c buses

Fix the vbios mapping and only add the actual
buses that the cards have. The existing code was
mostly correct. Just clean up a few cases on r2xx/r3xx
and document that buses the hw actually has.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
63f7d9828bf55cc8ee6f460830c5285fe06bef3e 03-May-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: add support for thermal chips on combios asics

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
beb47274116b36e17cf52869a2004e7d12a4ef1d 02-Apr-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: Add support for tv-out dongle on G5 9600

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
fafcf94e2b5732d1e13b440291c53115d2b172e9 23-Mar-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix hardcoded EDID handling

On some servers there is a hardcoded EDID provided
in the vbios so that the driver will always see a
display connected even if something like a KVM
prevents traditional means like DDC or load
detection from working properly. Also most
server boards with DVI are not actually DVI, but
DVO connected to a virtual KVM service processor.
If we fail to detect a monitor via DDC or load
detection and a hardcoded EDID is available, use
it.

Additionally, when using the hardcoded EDID, use
a copy of it rather than the actual one stored
in the driver as the detect() and get_modes()
functions may free it if DDC is successful.

This fixes the virtual KVM on several internal
servers.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
9fad321ac6bedd96f449754a1a25289ea1789a49 07-Feb-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: add connector table for mac g5 9600

PPC Mac cards do not provide connector tables in
their vbios. Their connector/encoder configurations
must be hardcoded in the driver.

verified by nyef on #radeon

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
0975b16274bad1f0bd5c5fd6ab759c5a9ee11949 03-Feb-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: dynamically allocate power state space

We previously used a static array, but some new systems
had more states then we had array space, so dynamically
allocate space based on the number of states in the vbios.

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

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
c324acd5032f516b8188da99d2ce05cf8d1294d6 09-Dec-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: parse the extended LCD info block

This block may contain various additional LCD info such
as physical size and a stored EDID.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
791cfe2684a74ed7155254816ff9e89e6064277c 21-Nov-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix regression in rs4xx i2c setup

typo in my last i2c rework.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=23222

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
be66305718bee9927e6acc6b75618ce3cd745718 18-Nov-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix i2c pad masks on rs4xx

These got lost in the last i2c cleanup. Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=23222

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
40f76d81fb45c1399f93500afa2aed9f84f7dee6 08-Oct-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: make TV/DFP table info less verbose

Make TV standard and DFP table revisions debug only.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
aa74fbb4c905c6c746b79d4d7d8c95d8bbd4360c 07-Sep-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: add connector table for Mac x800

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

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
5137ee940c3e593ae5578a7a12a604eb8f239ac0 13-Aug-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: rework encoder handling

On most newer asics, digital encoders have two links each
and they can be used independantly. As such, treat them as
separate encoders otherwise the individual links will not
get programmed properly at modeset time.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
179e8078a768be8c18539bebe44dd94447142ccf 06-Aug-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: rework combios i2c handling

Handle asic specific table to hw mappings in
combios_setup_i2c_bus() directly. This allows us
to remove most of the combios quirks and clean up
the i2c bus setup.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
f376b94fbc0a313a606748206340cbef6c2adf6b 06-Aug-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: unify i2c handling

Previously we added i2c buses as needed when enumerating connectors
power management, etc. This only exposed the actual buses used and
could have lead to the same buse getting created more than once if
one buses was used for more than one purpose. This patch sets up
all i2c buses on the card in one place and users of the buses just
point back to the one instance.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4c70b2eae371ebe83019ac47de6088b78124ab36 03-Aug-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/igp: sideport is AMD only

Intel variants don't support it.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
d9fdaafbe912a34ef06ed569c6606fe2811f325b 02-Aug-2010 Dave Airlie <airlied@redhat.com> drm/radeon/kms: move a bunch of modesetting debug to correct debug usage.

This migrates a bunch of DRM_DEBUG->DRM_DEBUG_KMS so we can get more modesetting related info without all the other ioctl handling easily.

Also the PM code moves to DRM_DEBUG_DRIVER mostly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
4ce9198ecf73739104b274c7c6377ef3659b3ca5 30-Jun-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: minor driver cleanups

- Make the logic in r100_pll_errata_after_index() match the other
errata functions
- Use rdev->family rather than rdev->flags & RADEON_FAMILY_MASK for kms
- replace rn50 check using ids with ASIC_IS_RN50 convenience macro

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
52fa2bbc8ec46255039e2048d616bbd0852ee292 22-Jul-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: add quirk to make HP DV5000 laptop resume

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

Reported-by: Andres Cimmarusti <acimmarusti@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2f9c6b0a91a050669dd6df487174de6b96c2774a 30-Jun-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: remove rv100 bios connector quirk

Some RV100 cards with 2 VGA ports show up with DVI+VGA, however
some boards with DVI+VGA have the same subsystem ids. Better
to have a VGA port show up as DVI than having a non-useable
DVI port.

reported by DHR in irc.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
580b4fffbbdc3c899ee1f8189ba321bd60b48840 30-Jun-2010 Dave Airlie <airlied@redhat.com> drm/radeon: add quirk to make HP nx6125 laptop resume.

For some reason on resume, executing the BIOS scripts locks up the whole chipset, by avoiding the dynclk table the machine resumes properly and seems to function okay.

Signed-off-by: Dave Airlie <airlied@redhat.com>
76a7142a083434fe55b14f01aa2624733fea39b2 11-Jun-2010 Dave Airlie <airlied@redhat.com> drm/radeon: add fake RN50 table for powerpc

This works well enough on a js21, but it would be nice if IBM could supply
more tables for the later Power6/7 machines.

Signed-off-by: Dave Airlie <airlied@redhat.com>
d294ed69408b54c18f0420516ea057b2a734624d 08-Jun-2010 Dave Airlie <airlied@redhat.com> drm/radeon: reset i2c valid to avoid incorrect tv-out polling.

We really don't want to be polling tv-out but since we weren't forcing the
i2c lines to invalid (tv-out has no DDC), we were adding tv connectors to the
polling setup and this was causing blinking on secondary displays.

This fixes the regression Torsten reported.

Reported-by: Torsten Kaiser <just.for.lkml@googlemail.com>
Tested-by: Torsten Kaiser <just.for.lkml@googlemail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8de016e2bd8ebce9b3728462085bef51179841a6 04-Jun-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/combios: fix typo in voltage fix

Noticed by Rafał Miłecki.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
84d88f4c92763f519b9e081cdd685a44de14f8c0 27-May-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/pm: voltage fixes

- Enable GPIO voltage for non pm modes as well so resetting
the default voltage works.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8e36ed00842668a39a6ed1b0a00b8ac92b7c4cd5 19-May-2010 Alex Deucher <alexdeucher@gmail.com> 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>
d7311171c4cc8d6231427f7ac5056b939a184b80 03-May-2010 Alex Deucher <alexdeucher@gmail.com> 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>
79daedc942813c0417ff5e277da6f7f35705cde5 22-Apr-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: minor pm cleanups

- remove non_clock_info struct
- track power state misc flags

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
a48b9b4edb8bb87deb13b9f088a595cf71457b69 22-Apr-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/pm: add asic specific callbacks for getting power state (v2)

This also simplifies the code and enables reclocking with multiple heads
active by tracking whether the power states are single or multi-head
capable.

Eventually, we will want to select a power state based on external
factors (AC/DC state, user selection, etc.).

(v2) Update for evergreen

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
68b61a7fd21be9df23577d48643ba9e364758200 18-May-2010 Alex Deucher <alexdeucher@gmail.com> 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>
3a89b4a9ca7ce11e3b7d5119aea917b9fc29a302 06-Apr-2010 Alex Deucher <alexdeucher@gmail.com> 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>
7466f4cc508878a8328dff1c328a2b4108888d2e 29-Mar-2010 Adam Jackson <ajax@redhat.com> drm/edid: Remove arbitrary EDID extension limit

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
b28ea41164dc36110dafcdc63783e9b7fb865784 12-Mar-2010 Alex Deucher <alexdeucher@gmail.com> 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>
86cb2bbfda2cf402aee46779ee90bbb7d915482b 08-Mar-2010 Alex Deucher <alexdeucher@gmail.com> 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>
9038dfdf699a3227004f1f6da32a3ef4ef3ba5a4 21-Feb-2010 Rafał Miłecki <zajec5@gmail.com> 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>
2745932495ca3634b11a8662b464d2bf0325ae78 11-Feb-2010 Rafał Miłecki <zajec5@gmail.com> 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>
03047cdf724d8de9fbfd38b53d768c190225290f 10-Feb-2010 Michel Dänzer <daenzer@vmware.com> 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>
71a157e8edca55198e808f8561dd49017a54ee34 02-Feb-2010 Grant Likely <grant.likely@secretlab.ca> 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>
bcc1c2a1d22974215e39dc87ce746ba9a39223e5 12-Jan-2010 Alex Deucher <alexdeucher@gmail.com> 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>
0ec0e74f784ca08eab0354ab1dada46924c39b73 23-Dec-2009 Alex Deucher <alexdeucher@gmail.com> 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>
56278a8edacee9ae9e3bc9d8c8e2d37e9969f3eb 28-Dec-2009 Alex Deucher <alexdeucher@gmail.com> 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>
3c537889e17232e9073f75ae8710ea0f008c5a29 05-Feb-2010 Alex Deucher <alexdeucher@gmail.com> 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>
40bacf1631a3e8654b1128aa9b72e73ca801c9e4 23-Dec-2009 Alex Deucher <alexdeucher@gmail.com> 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>
5a6f98f5bff7f975c61d56b5c756b5a96c4db167 22-Dec-2009 Alex Deucher <alexdeucher@gmail.com> 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>
94cf6434a1bc5958d5da3be62f1272792dada2bf 02-Feb-2010 Andrew Morton <akpm@linux-foundation.org> 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>
11f3b59e3654c66c4e8ef2c48f8138b78bf440da 11-Jan-2010 Michel Dänzer <daenzer@vmware.com> 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>
06b6476d6b291473d0928ed242158a001d50c0f0 05-Jan-2010 Alex Deucher <alexdeucher@gmail.com> 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>
246263ccc31e4ba2886cca17000bf09ea683eac5 29-Dec-2009 Alex Deucher <alexdeucher@gmail.com> 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>
d79766fab9975c6414ebab7d2abf017834a48c35 18-Dec-2009 Alex Deucher <alexdeucher@gmail.com> 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>
eed45b30cd1423f8dc10b4312700773cac13c1c8 04-Dec-2009 Alex Deucher <alexdeucher@gmail.com> 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>
6a93cb250a60af1bb7b4070949f8546a2fdc52ef 23-Nov-2009 Alex Deucher <alexdeucher@gmail.com> 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>
4b30b87042aa71ed8682e4df622a10456796fccd 01-Dec-2009 Dave Airlie <airlied@redhat.com> 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>
fd874ad0a0dcf715333a3f3564c6486a3a90bb22 17-Nov-2009 Alex Deucher <alex@hp.localdomain> 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>
fcec570b27a47e428a9bfc8572ae4c7c230d0488 11-Nov-2009 Alex Deucher <alexdeucher@gmail.com> 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>
9b9fe72488a3a637e0550cc888e3f7a8f70e521e 10-Nov-2009 Alex Deucher <alexdeucher@gmail.com> 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>
b75fad0682caacb16012582deecbd7d19bc2f68e 05-Nov-2009 Alex Deucher <alexdeucher@gmail.com> 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>
fc7f7119d2ed97fff1aaddad6bf7d61ed446cf37 28-Oct-2009 Alex Deucher <alexdeucher@gmail.com> 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>
790cfb34ad645be3bf69265cb05d824aeabcfa11 16-Oct-2009 Alex Deucher <alexdeucher@gmail.com> 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>
d0c403e950d449c8c413a1fbf05dfec45ce03e55 16-Oct-2009 Alex Deucher <alexdeucher@gmail.com> 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>
2d152c6ba81c8a7776103b517fa454b8da0419aa 16-Oct-2009 Alex Deucher <alexdeucher@gmail.com> 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>
de2103e452ec7f2db5db7c44279735688608381d 09-Oct-2009 Alex Deucher <alexdeucher@gmail.com> 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>
445282db9e815e7f5e82761c3c971dc9ea988d85 09-Sep-2009 Dave Airlie <airlied@redhat.com> 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>
8dfaa8a7779ad2667d539aca6ae11cd87f562db6 15-Sep-2009 Michel Dänzer <daenzer@vmware.com> 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>
6a719e05330ef19acd9392dbbfb95a774776dee5 17-Aug-2009 Dave Airlie <airlied@redhat.com> 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>
8b5c744485b75d940ccb1c83c9a358b20eb91346 17-Jun-2009 Michel Dänzer <daenzer@vmware.com> 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>
6fe7ac3f5b544703581f3829c8c950dc721d976e 12-Jun-2009 Alex Deucher <alexdeucher@gmail.com> 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>
771fe6b912fca54f03e8a72eb63058b582775362 05-Jun-2009 Jerome Glisse <jglisse@redhat.com> 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>