aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_bios.c
AgeCommit message (Collapse)Author
2024-05-02drm: nv04: Fix out of bounds accessMikhail Kobuk
[ Upstream commit cf92bb778eda7830e79452c6917efa8474a30c1e ] When Output Resource (dcb->or) value is assigned in fabricate_dcb_output(), there may be out of bounds access to dac_users array in case dcb->or is zero because ffs(dcb->or) is used as index there. The 'or' argument of fabricate_dcb_output() must be interpreted as a number of bit to set, not value. Utilize macros from 'enum nouveau_or' in calls instead of hardcoding. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 2e5702aff395 ("drm/nouveau: fabricate DCB encoder table for iMac G4") Fixes: 670820c0e6a9 ("drm/nouveau: Workaround incorrect DCB entry on a GeForce3 Ti 200.") Signed-off-by: Mikhail Kobuk <m.kobuk@ispras.ru> Signed-off-by: Danilo Krummrich <dakr@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240411110854.16701-1-m.kobuk@ispras.ru Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-08-23drm/nouveau/bios: downgrade absence of tmds table to info from an errorRhys Kidd
Absence of a TMDS Info Table is common on Optimus setups where the NVIDIA gpu is not connected directly to any outputs. Reporting an error in this scenario is too harsh. Accordingly, change the error message to an info message. By default the error message also causes a boot flicker for these sytems. Signed-off-by: Rhys Kidd <rhyskidd@gmail.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2019-08-23drm/nouveau: drop use of drmp.hSam Ravnborg
Drop use of the deprecated drmP.h file from drm/nouveau. Build tested using allyesconfig and allmodconfig. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: nouveau@lists.freedesktop.org Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-03drm/nouveau/bios: make const arrays hwsq_signature and edid_sig staticColin Ian King
Don't populate arrays hwsq_signature and edid_sig on the stack but instead make them static. Makes the object code smaller by over 190 bytes: Before: text data bss dec hex filename 35676 3312 64 39052 988c nouveau_bios.o After: text data bss dec hex filename 35319 3472 64 38855 97c7 nouveau_bios.o (gcc version 7.2.0 x86_64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-11-02drm/nouveau/kms: add 8.1Gbps DP link rateIlia Mirkin
This was already done in dcb.c inside nvkm, but the other parser did not get the update. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-08-22drm/nouveau/bios: Demote missing fp table message to NV_DEBUG.Rosen Penev
This warning seems to pop up mainly in laptop cards. Silence it as it is expected behavior. Signed-off by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16drm/nouveau/disp: introduce acquire/release display path methodsBen Skeggs
These exist to give NVKM information on the set of display paths that the DD needs to be active at any given time. Previously, the supervisor attempted to determine this solely from OR state, but there's a few configurations where this information on its own isn't enough to determine the specific display paths in question: - ANX9805, where the PIOR protocol for both DP and TMDS is TMDS. - On a device using DCB Switched Outputs. - On GM20x and newer, with a crossbar between the SOR and macro links. After this commit, the DD tells NVKM *exactly* which display path it's attempting a modeset on. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-02-17drm/nouveau: allocate device object for every clientBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07drm/nouveau/kms: lvds panel strap moved again on maxwellBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Cc: stable@vger.kernel.org
2016-05-20drm/nouveau: rename nouveau_drm.h to nouveau_drv.hBen Skeggs
Fixes out-of-tree build issue where uapi/drm/nouveau_drm.h gets picked up instead. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28drm/nouveau/nvif: simplify and tidy library interfacesBen Skeggs
A variety of tweaks to the NVIF library interfaces, mostly ripping out things that turned out to be not so useful. - Removed refcounting from nvif_object, callers are expected to not be stupid instead. - nvif_client is directly reachable from anything derived from nvif_object, removing the need for heuristics to locate it - _new() versions of interfaces, that allocate memory for the object they construct, have been removed. The vast majority of callers used the embedded _init() interfaces. - No longer storing constructor arguments (and the data returned from nvkm) inside nvif_object, it's more or less unused and just wastes memory. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28drm/nouveau/i2c: transition pad/ports away from being based on nvkm_objectBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28drm/nouveau: use dev_* for loggingBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28drm/nouveau/bios/dcb: accept "maxwell" lane count values for dcb 4.0Ben Skeggs
We previously assumed that the values "2" and "4" were new in DCB 4.1, however, there's at least one GM107 DCB 4.0 board (Quadro K620) that uses the newer values. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau: finalise nvkm namespace switch (no binary change)Ben Skeggs
The namespace of NVKM is being changed to nvkm_ instead of nouveau_, which will be used for the DRM part of the driver. This is being done in order to make it very clear as to what part of the driver a given symbol belongs to, and as a minor step towards splitting the DRM driver out to be able to stand on its own (for virt). Because there's already a large amount of churn here anyway, this is as good a time as any to also switch to NVIDIA's device and chipset naming to ease collaboration with them. A comparison of objdump disassemblies proves no code changes. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/nvif: namespace of nvkm accessors (no binary change)Ben Skeggs
NVKM is having it's namespace switched to nvkm_, which will conflict with these functions (which are workarounds for the fact that as of yet, we still aren't able to split DRM and NVKM completely). A comparison of objdump disassemblies proves no code changes. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02drm/nouveau: add support for gm204Ben Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-02drm/nouveau/i2c: segregate aux channel adapter indices from bit-banged i2cBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nv50-/disp: audit and version DAC_PWR methodBen Skeggs
The full object interfaces are about to be exposed to userspace, so we need to check for any security-related issues and version the structs to make it easier to handle any changes we may need in the future. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau: port to nvif client/device/objectsBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau: initial pass at moving to struct nvif_deviceBen Skeggs
This is an attempt at isolating some of the changes necessary to port to NVIF in a separate commit. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau: kill nouveau_dev() + wrap register macrosBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26drm/nouveau: recognise higher link rate for available dp bw calculationsBen Skeggs
I should resurrect/merge that cleanup branch to remove the weird duplication.. One day. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-03-26support for platform devicesAlexandre Courbot
Upcoming mobile Kepler GPUs (such as GK20A) use the platform bus instead of PCI to which Nouveau is tightly dependent. This patch allows Nouveau to handle platform devices by: - abstracting PCI-dependent functions that were typically used for resource querying and page mapping, - introducing a nv_device_is_pci() function that allows to make PCI-dependent code conditional, - providing a nouveau_drm_platform_probe() function that takes a GPU platform device to be probed. Core code as well as engine/subdev drivers are updated wherever possible to make use of these functions. Some older drivers are too dependent on PCI to be properly updated, but all newer code on which future chips may depend should at least be runnable with platform devices. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-10-09drm: Remove pci_vendor and pci_device from struct drm_deviceVille Syrjälä
We can get the PCI vendor and device IDs via dev->pdev. So we can drop the duplicated information. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-07-01drm/nvd0-/disp: handle case where display engine is missing/disabledMaarten Lankhorst
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-07-01drm/nouveau/kms: don't fail if there's no dcb table entriesBen Skeggs
Fixes module not loading on Tesla K20. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-04-26drm/nv04/disp: hide all the cruft away in its own little holeBen Skeggs
It'd be pretty awesome if someone would care enough to port this all properly to a class interface, perhaps submitting a command stream to the core via a sw object on PFIFO (emulating how EVO works basically, and also what nvidia have done forever..).. But, this seems unlikely given how old this hardware is now, so, lets just hide it away. There's a heap of other bits and pieces laying around that are still tangled. I'll (re)move them in pieces. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-02-20drm/nv50: initial kms support for off-chip TMDS/DP encodersBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-02-20drm/nouveau: use pr_contMarcin Slusarz
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-02-20drm/nouveau: set legacy bios data before parsing the structureEmil Velikov
Commit 767baf82 drm/nouveau: remove some more unnecessary legacy bios code has introduced a regression my misplacing the code that sets the major/chip versions, which are used whist parsing the bmp/bit structure in vbios Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-02-20drm/nouveau: remove some more unnecessary legacy bios codeBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-02-20drm/nouveau: remove legacy vbios type detectionBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29drm/nouveau/dp: remove last bits of VBIOS parsing from DRM codeBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29drm/nouveau: remove (now obsolete) BIT U table parsing from DRM codeBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds
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 ...
2012-10-03drm/nouveau: port remainder of drm code, and rip out compat layerBen Skeggs
v2: Ben Skeggs <bskeggs@redhat.com> - fill in nouveau_pm.dev to prevent oops - fix ppc issues (build + OF shadow) Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03drm/nouveau: flatten nv{Read,Write}{MC,VIDEO,FB,EXTDEV}Ben Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03drm/nouveau/mxm: split up into bios code and a subdev moduleBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03drm/nouveau: implement devinit subdev, and new init table parserBen Skeggs
v2: - make sure not to execute display scripts unless resuming Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03drm/nouveau/clock: pull in the implementation from all over the placeBen Skeggs
Still missing the main bits we use to change performance levels, I'll get to it after all the hard yakka has been finished. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03drm/nouveau/i2c: port to subdev interfacesBen Skeggs
v2/v3: Ben Skeggs <bskeggs@redhat.com> - fix typo in default bus selection - fix accidental loss of destructor v4: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com> - fix typo causing incorrect default i2c port settings when no BMP data Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03drm/nouveau/gpio: port gpio to subdev interfacesBen Skeggs
v2: Ben Skeggs <bskeggs@redhat.com> - rebase on top of v3.6-rc6 with gpio reset patch integrated already Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03drm/nouveau/oldbios: remove shadowing support, use bios subdev's imageBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-03drm/nouveau: restructure source tree, split core from drm implementationBen Skeggs
Future work will be headed in the way of separating the policy supplied by the nouveau drm module from the mechanisms provided by the driver core. There will be a couple of major classes (subdev, engine) of driver modules that have clearly defined tasks, and the further directory structure change is to reflect this. No code changes here whatsoever, aside from fixing up a couple of include file pathnames. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-02UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/David Howells
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>
2012-07-26drm/nouveau: dcb table quirk for fdo#50830Ben Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-05-24drm/nouveau/bios: fix some shadowing issues, particularly acpiBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-05-24drm/nouveau/bios: allow loading alternate vbios image as firmwareBen Skeggs
Useful for debugging different VBIOS versions. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-04-30drm/nouveau/bios: fix regression on some nv4x boardBen Skeggs
We started using the connector table on nv4x a while back, and this VBIOS has bad connector indices which causes the wrong encoders to get paired with connectors. Add a quirk to fix this... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>