summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_atombios.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* drm/radeon: additional gcc fixes for radeon_atombios.cAlex Deucher2013-09-201-23/+43
| | | | | | | | | | | | | | | Newer versions of gcc seem to wander off into the weeds when dealing with variable sizes arrays in structs. Rather than indexing the arrays, use pointer arithmetic. Fix up spread spectrum tables. See bugs: https://bugs.freedesktop.org/show_bug.cgi?id=66932 https://bugs.freedesktop.org/show_bug.cgi?id=66972 https://bugs.freedesktop.org/show_bug.cgi?id=66945 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: gcc fixes for radeon_atombios.cAlex Deucher2013-08-301-14/+28
| | | | | | | | | | | | | | Newer versions of gcc seem to wander off into the weeds when dealing with variable sizes arrays in structs. Rather than indexing the arrays, use pointer arithmetic. See bugs: https://bugs.freedesktop.org/show_bug.cgi?id=66932 https://bugs.freedesktop.org/show_bug.cgi?id=66972 https://bugs.freedesktop.org/show_bug.cgi?id=66945 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: fix handling of variable sized arrays for router objectsAlex Deucher2013-08-301-3/+6
| | | | | | | | | | | | | | | | | | | The table has the following format: typedef struct _ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT //usSrcDstTableOffset pointing to this structure { UCHAR ucNumberOfSrc; USHORT usSrcObjectID[1]; UCHAR ucNumberOfDst; USHORT usDstObjectID[1]; }ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT; usSrcObjectID[] and usDstObjectID[] are variably sized, so we can't access them directly. Use pointers and update the offset appropriately when accessing the Dst members. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
* drm/radeon: fix LCD record parsingAlex Deucher2013-08-301-1/+3
| | | | | | | | | | If the LCD table contains an EDID record, properly account for the edid size when walking through the records. This should fix error messages about unknown LCD records. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
* drm/radeon: check firmware overrides for mclk/sclk ssAlex Deucher2013-08-301-0/+9
| | | | | | | | | | Check the overrides in the firmware info table before enabling spread spectrum on the engine or memory clocks. Some boards may have valid spread spectrum tables, but shouldn't necessarily have it enabled. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: add dpm support for CI dGPUs (v2)Alex Deucher2013-08-301-1/+1
| | | | | | | | | | | | | | | This adds dpm support for btc asics. This includes: - dynamic engine clock scaling - dynamic memory clock scaling - dynamic voltage scaling - dynamic pcie gen switching Set radeon.dpm=1 to enable. v2: remove unused radeon_atombios.c changes, make missing smc ucode non-fatal Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: add support for thermal controller on KB/KVAlex Deucher2013-08-301-0/+5
| | | | | | No support for reading temperature back yet. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/cik: implement some more atom helpers for DPMAlex Deucher2013-08-301-0/+115
| | | | | | Required for DPM on CIK. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/atom: fix fb when fetching engine paramsAlex Deucher2013-07-301-1/+1
| | | | | | | | For correctness. The fb divider isn't actually used in any of the relevant dpm code. It's calculated from the other parameters. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/dpm/atom: fix broken gcc harderAlex Deucher2013-07-171-3/+6
| | | | | | | | | See bugs: https://bugs.freedesktop.org/show_bug.cgi?id=66932 https://bugs.freedesktop.org/show_bug.cgi?id=66972 https://bugs.freedesktop.org/show_bug.cgi?id=66945 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/dpm/atom: restructure logic to work around a compiler bugAndre Heider2013-07-171-2/+3
| | | | | | | | | | | | It seems gcc 4.8.1 generates bogus code for the old logic causing part of the function to get skipped. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66932 https://bugs.freedesktop.org/show_bug.cgi?id=66972 https://bugs.freedesktop.org/show_bug.cgi?id=66945 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/dpm: fix atom vram table parsingAlex Deucher2013-07-171-16/+10
| | | | | | | Parsing the table in incorrectly led to problems with certain asics with mclk switching. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: fix an endian bug in atom table parsingAlex Deucher2013-07-171-1/+1
| | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: set default clocks for SI when DPM is disabledAlex Deucher2013-07-061-0/+4
| | | | | | | | | Fix patching of vddc values for SI and enable manually forcing clocks to default levels as per NI. This improves the out of the box performance with SI asics. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: fix endian bug in radeon_atom_get_mclk_range_table()Alex Deucher2013-07-031-1/+1
| | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: fix typo in radeon_atom_init_mc_reg_table()Alex Deucher2013-07-011-1/+2
| | | | | | | Bad pointer math. Fixes hangs in state transitions with BTC+ asics. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/atom: fix endian bug in radeon_atom_init_mc_reg_table()Alex Deucher2013-07-011-1/+1
| | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: fix endian issues in atombios dpm codeAlex Deucher2013-06-281-5/+5
| | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/atom: fix voltage table parsingAlex Deucher2013-06-281-150/+170
| | | | | | The arrays items are variable sized. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: fix typo in atom voltage table handling (si+)Alex Deucher2013-06-281-2/+2
| | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: fix typo in atom voltage table handling (6xx-ni)Alex Deucher2013-06-281-4/+4
| | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: update radeon_atombios_get_default_voltages for mvddAlex Deucher2013-06-281-4/+7
| | | | | | Add a way to look up the bootup mvdd. Required for DPM on SI. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/dpm: validate voltages against dispclk requirementsAlex Deucher2013-06-281-0/+1
| | | | | | | | | Validate the voltages against the voltage requirements of the dispclk. We currently don't adjust the disp clock so it never changes, but we need to filter out voltage levels that are too low none the less. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: add atom get leakage vddc functionAlex Deucher2013-06-281-0/+7
| | | | | | Required for DPM on SI. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: update radeon_atom_get_voltage_table() for SIAlex Deucher2013-06-281-25/+65
| | | | | | SI uses a new atom table revision. Required for DPM on SI. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: update radeon_atom_is_voltage_gpio() for SIAlex Deucher2013-06-281-21/+50
| | | | | | SI uses a new atom table. Required for DPM on SI. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/atom: add helper to calcuate mpll paramsAlex Deucher2013-06-281-0/+51
| | | | | | | There's a new table for calculating the memory pll parameters on SI. Required for SI DPM support. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/kms: add dpm support for rv6xx (v3)Alex Deucher2013-06-271-2/+2
| | | | | | | | | | | | | | | | | This adds dpm support for rv6xx asics. This includes: - clockgating - dynamic engine clock scaling - dynamic memory clock scaling - dynamic voltage scaling - dynamic pcie gen1/gen2 switching Set radeon.dpm=1 to enable. v2: remove duplicate line v3: fix thermal interrupt check noticed by Jerome Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* drm/radeon/kms: add atom helper functions for dpm (v3)Alex Deucher2013-06-271-7/+653
| | | | | | | | | | dpm needs access to atombios data and command tables for setup and calculation of a number of parameters. v2: endian fix v3: fix mc reg table bug Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: update radeon_atom_get_clock_dividers for CIKAlex Deucher2013-06-261-1/+19
| | | | | | | CIK uses a slightly different variant of the table structs and params. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: update radeon_atom_get_clock_dividers() for SIAlex Deucher2013-06-261-1/+5
| | | | | | | SI uses v5 of the command table and uses a different table for memory PLLs. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: add SS override support for KB/KVAlex Deucher2013-06-261-0/+17
| | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: update power state parsing for CIAlex Deucher2013-06-261-0/+10
| | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: handle the integrated thermal controller on CIAlex Deucher2013-06-261-0/+6
| | | | | | No support for reading the temperature yet. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: fix handling of v6 power tablesAlex Deucher2013-05-021-6/+5
| | | | | | | | The code was mis-handling variable sized arrays. Reported-by: Sylvain BERTRAND <sylware@legeek.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
* drm/radeon: clarify family checks in pm table parsingAlex Deucher2013-05-021-3/+3
| | | | | | | We actually care about the chip family rather than the DCE version although functionally they are the same. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: fix possible segfault when parsing pm tablesAlex Deucher2013-05-021-1/+9
| | | | | | | | | | | If we have a empty power table, bail early and allocate the default power state. Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=63865 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
* drm/radeon: fix endian bugs in radeon_atom_get_clock_dividers() (v3)Alex Deucher2013-04-241-4/+2
| | | | | | | | | v2: fix copy paste typo. v3: clarify new union member Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: add radeon_atom_get_clock_dividers helperChristian König2013-04-091-0/+107
| | | | | | Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds2012-10-041-2/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull drm merge (part 1) from Dave Airlie: "So first of all my tree and uapi stuff has a conflict mess, its my fault as the nouveau stuff didn't hit -next as were trying to rebase regressions out of it before we merged. Highlights: - SH mobile modesetting driver and associated helpers - some DRM core documentation - i915 modesetting rework, haswell hdmi, haswell and vlv fixes, write combined pte writing, ilk rc6 support, - nouveau: major driver rework into a hw core driver, makes features like SLI a lot saner to implement, - psb: add eDP/DP support for Cedarview - radeon: 2 layer page tables, async VM pte updates, better PLL selection for > 2 screens, better ACPI interactions The rest is general grab bag of fixes. So why part 1? well I have the exynos pull req which came in a bit late but was waiting for me to do something they shouldn't have and it looks fairly safe, and David Howells has some more header cleanups he'd like me to pull, that seem like a good idea, but I'd like to get this merge out of the way so -next dosen't get blocked." Tons of conflicts mostly due to silly include line changes, but mostly mindless. A few other small semantic conflicts too, noted from Dave's pre-merged branch. * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (447 commits) drm/nv98/crypt: fix fuc build with latest envyas drm/nouveau/devinit: fixup various issues with subdev ctor/init ordering drm/nv41/vm: fix and enable use of "real" pciegart drm/nv44/vm: fix and enable use of "real" pciegart drm/nv04/dmaobj: fixup vm target handling in preparation for nv4x pcie drm/nouveau: store supported dma mask in vmmgr drm/nvc0/ibus: initial implementation of subdev drm/nouveau/therm: add support for fan-control modes drm/nouveau/hwmon: rename pwm0* to pmw1* to follow hwmon's rules drm/nouveau/therm: calculate the pwm divisor on nv50+ drm/nouveau/fan: rewrite the fan tachometer driver to get more precision, faster drm/nouveau/therm: move thermal-related functions to the therm subdev drm/nouveau/bios: parse the pwm divisor from the perf table drm/nouveau/therm: use the EXTDEV table to detect i2c monitoring devices drm/nouveau/therm: rework thermal table parsing drm/nouveau/gpio: expose the PWM/TOGGLE parameter found in the gpio vbios table drm/nouveau: fix pm initialization order drm/nouveau/bios: check that fixed tvdac gpio data is valid before using it drm/nouveau: log channel debug/error messages from client object rather than drm client drm/nouveau: have drm debugging macros build on top of core macros ...
| * drm/radeon: implement bounds checking on thermal controller lookupAlex Deucher2012-09-201-2/+9
| | | | | | | | | | | | | | Don't read past the end of the array if we encounter an unknown thermal controller. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * drm/radeon: track whether the GPU controls the backlight (v2)Alex Deucher2012-09-201-0/+4
| | | | | | | | | | | | | | | | | | | | A table in the vbios tells us whether the GPU backlight controller is used or not. If the bit is set, the GPU backlight controller is used; if it is not set, an off-chip backlight controller is used. v2: store all the firmware flags, not just BL control Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* | UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/David Howells2012-10-021-2/+2
|/ | | | | | | | | | | 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>
* drm/radeon/kms: extend the Fujitsu D3003-S2 board connector quirk to cover ↵Tvrtko Ursulin2012-08-201-1/+1
| | | | | | | | | | | | later silicon stepping There is a more recent APU stepping with a new PCI ID shipping in the same board by Fujitsu which needs the same quirk to correctly mark the back plane connectors. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
* drm/radeon: properly handle SS overrides on TN (v2)Alex Deucher2012-08-131-12/+37
| | | | | | | | | The IntegratedSystemInfo table changed versions on TN. Update the SS override lookup to handle it. v2: fix copy-paste typo. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: fix XFX quirkAlex Deucher2012-05-291-1/+3
| | | | | | | | | | | | | | Only override the ddc bus if the connector doesn't have a valid one. The existing code overrode the ddc bus for all connectors even if it had ddc bus. Fixes ddc on another XFX card with the same pci ids that was broken by the quirk overwriting the correct ddc bus. Reported-by: Mehdi Aqadjani Memar <m.aqadjanimemar@student.ru.nl> Cc: stable@vger.kernel.org Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: update power table parsing for SIAlex Deucher2012-03-211-0/+21
| | | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms/atom: add support for SI SetVoltage tableAlex Deucher2012-03-211-6/+33
| | | | | Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: fix up atom HPD gpio parsing for DCE6Alex Deucher2012-03-211-1/+3
| | | | | Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: upstream power table updatesAlex Deucher2012-03-211-7/+7
| | | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>