summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
AgeCommit message (Collapse)Author
2015-01-22drm/nouveau/pmu: rename from pwr (no binary change)Ben Skeggs
Switch to NVIDIA's name for the device. 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/clk: rename from clock (no binary change)Ben Skeggs
Rename to match the Linux subsystem responsible for the same kind of things. Will be investigating how feasible it will be to expose the GPU clock trees with it at some point. 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: remove symlinks, move core/ to nvkm/ (no code changes)Ben Skeggs
The symlinks were annoying some people, and they're not used anywhere else in the kernel tree. The include directory structure has been changed so that symlinks aren't needed anymore. NVKM has been moved from core/ to nvkm/ to make it more obvious as to what the directory is for, and as some minor prep for when NVKM gets split out into its own module (virt) at a later date. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau: merge nouveau_platform.ko into nouveau.koAlexandre Courbot
Having the two modules separated causes various unneeded complications, including having to export symbols accessed between the modules. Make things simpler by compiling platform device support into nouveau.ko. Platform device support remains optional and is only compiled on Tegra. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Vince Hsu <vinceh@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau: dont switch vt on suspendMaarten Lankhorst
Restore the nv50 cursor bo on resume, and load the lut in nv50_display_display_init so it gets set on resume too. Tested on a fermi and a curie. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/dispnv04: Remove some unused functionsRickard Strandqvist
Removes some functions that are not used anywhere: nv04_display_late_takedown() nv04_display_early_init() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/gem: Remove unused functionRickard Strandqvist
Remove the function domain_to_ttm() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/bo: Remove unused functionRickard Strandqvist
Remove the function nouveau_bo_rd16() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/clk: allow users to enable auto mode when loading driverVince Hsu
This patch adds one option for the boot config strings "NvClkMode*", so that we can enable the "auto" mode when loading module. Signed-off-by: Vince Hsu <vinceh@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/pwr: add support for GK20AVince Hsu
This patch adds PWR support for GK20A. But instead of adding the PWR features like firmware loading and communication with PMU firmware, we add the DVFS (Dynamic Voltage and Frequency Scaling), which is one of the PMU firmware's jobs on dGPUs, in this patch. This refers to the idle signals provided by the NVIDIA hardware and tries to adjust the performance level based on the calculated target. The reclocking policy can be fine-tuned later when we have more real use cases. Signed-off-by: Vince Hsu <vinceh@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/pwr: make nouveau_pwr_pgob() non-staticVince Hsu
The platform device does not use the common nouveau_pwr_init() to initialize the PWR, but it does need the .pgob() be assigned to avoid NULL pointer dereference in graph/nve4.c. Signed-off-by: Vince Hsu <vinceh@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/clk: allow non-blocking for nouveau_clock_astate()Vince Hsu
There might be some callers of nouveau_clock_astate(), and they are from inetrrupt context. So we must ensure that this function can be atomic in that condition. This patch adds one parameter which is subsequently passed to nouveau_pstate_calc(). Therefore we can choose whether we want to wait for the pstate work's completion or not. Signed-off-by: Vince Hsu <vinceh@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/mc: add missing bracesVince Hsu
Several braces were misplaced unintentionally. That caused the msi handling became part of the default case of the first switch statement. So add the missing ones. Signed-off-by: Vince Hsu <vinceh@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nv50-/kms: reject attempts at flipping to incompatible framebufferBen Skeggs
Looks like a userspace bug can trigger this somehow during a mode switch, causing: EVO complaint -> semaphores get out of sync -> entire display stalled. We likely want to be even stricter than this (or at least deal better if EVO rejects our request), but I'll save that for the drm_plane/atomic conversion and just fix the bug that I already know can be triggered. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/kms: default to panel scaling, except for fixed panels prior to nv50Ben Skeggs
On NV50 and up, we'll allow fixed panels to use EDID-provided modes without the GPU scaler, and force scaling (even for NONE) otherwise. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/kms: untangle connector property logic a littleBen Skeggs
Should be the same defaults as before, just easier to follow. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/kms: avoid adding scaler-only modes the same as the panel's ↵Ben Skeggs
native mode Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nv50-/kms: allow disabling of gpu scaling on fixed panelsBen Skeggs
The hilarious part is that, under X, this won't work anyway because the server decides to construct its own modes for some reason. Tested with modetest, which isn't quite as insane. I'd hope that wayland is more sensible. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nv50-/kms: move identical scaler mode fixup code into a functionBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau: sgdma: add comment around suspiscious error handlerAlexandre Courbot
Common programming sense dictates that resources allocated by a function are freed by this function should it fails, but this is not the case for the allocated structure of nouveau_sgdma_create_ttm(). It seems that n00b contributors attempt to fix this one like bugs flying towards a bug zapper, so add a comment to hopefully prevent this from happening anymore. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau: sgdma: remove unused nouveau_sgdma_be::devAlexandre Courbot
nouveau_sgdma_be::dev is only set once during init and never used anywhere, so remove it. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/core: object.engine is always a nouveau_engine nowBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/core: can now assume client/device object tree based on ↵Ben Skeggs
object.engine Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/disp: outp/conns do not have an engineBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/bar: barobjs may not have an engineBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/fb: ram impl does not have an engineBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/i2c: pad/ports do not have an engineBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/instmem: instobjs may not have an engineBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/core: fix subdev/engine/device lookup to not require engine pointerBen Skeggs
It's about to not be valid for objects that aren't in the client object tree. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/core: uninline subdev/engine/device lookup functionsBen Skeggs
These are a tad more complex than a direct cast with paranoia safeties. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/core: prepare printk for NULL engine pointer on device object treeBen Skeggs
The [ SUBDEV] specified in log output will be a bit different for children of a subdev now. Previously this reports whatever subdev is specified by object.engine, now it reports the subdev that owns the object (so, up object.parent somewhere). Later patches will append object and class identifiers to messages, which will help clarify where it's coming from. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/core: drop the pointer value in debug printk outputBen Skeggs
Makes the output slightly less useful, in that objects with the same class handle can't be distinguished from each other now. Upcoming commits will name objects with user-readable strings to fix this problem. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/i2c: fix some blatant abuseBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/gf100-/bar: don't fill in bar->alloc until after all vm setup doneBen Skeggs
gpuobj has a condition of (bar && bar->alloc) around usage to avoid some nasty ordering issues (which, i've now been reminded to add a todo about fixing...) between bar and vm. The bar->alloc part of the condition isn't currently necessary (it used to be, another change made bar always NULL where it matters), so we got lucky. That won't be the case for much longer. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/core: rename parent to handle, use parent for nouveau_parentBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/core: rename subclass.base to subclass.superclassBen Skeggs
Makes things a bit more readable. This is specially important now as upcoming commits are going to be gradually removing the use of macros for down-casts, in favour of compile-time checking. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/subdev: always upcast through nouveau_subdev()/nouveau_engine()Ben Skeggs
Has additional safeties for one. For two, needed for an upcoming commit that removes abuse of nouveau_object.engine. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-22drm/nouveau/fb: remove some (now) unnecessary hacksBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-01-21drm/fb-helper: Propagate errors from initial config failureThierry Reding
Make drm_fb_helper_initial_config() return an int rather than a bool so that the error can be properly propagated. While at it, update drivers to propagate errors further rather than just ignore them. v2: - cirrus: No cleanup is required, the top-level cirrus_driver_load() will do it as part of cirrus_driver_unload() in its cleanup path. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Reviewed-by: Christian König <christian.koenig@amd.com> [danvet: Squash in simplification patch from kbuild.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-08Merge branch 'linux-3.19' of ↵Dave Airlie
git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes - Fix BUG() on !SMP builds - Fix for OOPS on pre-NV50 that snuck into -next - MCP7[789A] hang fix where firmware hasn't already setup NISO pollers - NV4x IGP MSI disable, it doesn't appear to work correctly - Add GK208B to recognised boards (no code change aside from adding chipset recognition) * 'linux-3.19' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/nouveau/nouveau: Do not BUG_ON(!spin_is_locked()) on UP drm/nv4c/mc: disable msi drm/nouveau/fb/ram/mcp77: enable NISO poller drm/nouveau/fb/ram/mcp77: use carveout reg to determine size drm/nouveau/fb/ram/mcp77: subclass nouveau_ram drm/nouveau: wake up the card if necessary during gem callbacks drm/nouveau/device: Add support for GK208B, resolves bug 86935 drm/nouveau: fix missing return statement in nouveau_ttm_tt_unpopulate drm/nouveau/bios: fix oops on pre-nv50 chipsets
2014-12-24Revert "drm/gem: Warn on illegal use of the dumb buffer interface v2"Dave Airlie
This reverts commit 355a70183848f21198e9f6296bd646df3478a26d. This had some bad side effects under normal operation, and should have been dropped earlier. Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-12-23nouveau: bring back legacy mmap handlerDave Airlie
nouveau userspace back at 1.0.1 used to call the X server DRIOpenDRMMaster interface even for DRI2 (doh!), this attempts to map the sarea and fails if it can't. Since 884c6dabb0eafe7227f099c9e78e514191efaf13 from Daniel, this fails, but only ancient drivers would see it. Revert the nouveau bits of that fix. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: <stable@vger.kernel.org> # 3.18 Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-12-22drm/nouveau/nouveau: Do not BUG_ON(!spin_is_locked()) on UPBruno Prémont
On !SMP systems spinlocks do not exist. Thus checking of they are active will always fail. Use assert_spin_locked(lock); instead of BUG_ON(!spin_is_locked(lock)); to not BUG() on all UP systems. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-22drm/nv4c/mc: disable msiIlia Mirkin
Several users have, over time, reported issues with MSI on these IGPs. They're old, rarely available, and MSI doesn't provide such huge advantages on them. Just disable. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87361 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74492 Fixes: fa8c9ac72fe ("drm/nv4c/mc: nv4x igp's have a different msi rearm register") Cc: stable@vger.kernel.org Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-22drm/nouveau/fb/ram/mcp77: enable NISO pollerPierre Moreau
Signed-off-by: Pierre Moreau <pierre.morrow@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-22drm/nouveau/fb/ram/mcp77: use carveout reg to determine sizeBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-22drm/nouveau/fb/ram/mcp77: subclass nouveau_ramBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-22drm/nouveau: wake up the card if necessary during gem callbacksBen Skeggs
The failure paths if we fail to wake the card are less than desirable, but there's not really a graceful way to handle this case currently. I'll keep this situation in mind when I get to fixing other vm-related issues. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-22drm/nouveau/device: Add support for GK208B, resolves bug 86935Sven Köhler
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-12-22drm/nouveau: fix missing return statement in nouveau_ttm_tt_unpopulateAlexandre Courbot
nouveau_ttm_tt_unpopulate() is supposed to return right after calling ttm_dma_unpopulate() in the case of a coherent buffer. The return statement was omitted, leading to the pages being unmapped twice. Fix this. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>