summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau (follow)
Commit message (Collapse)AuthorAgeFilesLines
* drm/nouveau: initial pass at moving to struct nvif_deviceBen Skeggs2014-08-0941-388/+459
| | | | | | | 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>
* drm/nouveau: kill nouveau_dev() + wrap register macrosBen Skeggs2014-08-0917-219/+228
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: fix some usages of the wrong print functionBen Skeggs2014-08-098-50/+54
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/nvif: import library functions for the ioctl/event interfacesBen Skeggs2014-08-0914-2/+1350
| | | | | | | | | | | | This is a wrapper around the interfaces defined in an earlier commit, and is also used by various userspace (either by a libdrm backend, or libpciaccess) tools/tests. In the future this will be extended to handle channels, replacing some long-unloved code we currently use, and allow fifo/display/mpeg (hi Ilia ;)) engines to all be exposed in the same way. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/client: add method to retrieve device listBen Skeggs2014-08-094-0/+72
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core: remove NV_D0 familyBen Skeggs2014-08-096-34/+37
| | | | | | | The one place where it mattered has been replaced with a class check, which is more appropriate anyway. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/device: add method to retrieve some basic device infoBen Skeggs2014-08-094-37/+171
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core: import ioctl/event interfacesBen Skeggs2014-08-0913-4/+831
| | | | | | | | | | | | | | | | | | This forms the basis for the new APIs that will be exposed to userspace, giving it access to: - Object method calls, the immediately useful of which is performance counters and the abiity to manipulate the ZBC tables. - Information on the child classes an object supports, in order to avoid having to try all supported classes until successful. - Notifications, which will be used in the future to inform the client if its channel was killed due to a lockup, etc. This commit imports the interfaces, but are not currently used. The DRM portion of the driver will be ported to speak to the core using these interfaces as much as possible. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core: add function to return list of supported childrenBen Skeggs2014-08-092-0/+34
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core: rework event interfaceBen Skeggs2014-08-0952-517/+875
| | | | | | | | | | | | | | | This is a lot of prep-work for being able to send event notifications back to userspace. Events now contain data, rather than a "something just happened" signal. Handler data is now embedded into a containing structure, rather than being kmalloc()'d, and can optionally have the notify routine handled in a workqueue. Various races between suspend/unload with display HPD/DP IRQ handlers automagically solved as a result. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core: move handle-based object apis to handle.cBen Skeggs2014-08-094-120/+135
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core: fail creation of zero-argument objects, when arguments are ↵Ben Skeggs2014-08-091-30/+6
| | | | | | passed Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: store a pointer to vm in nouveau_cliBen Skeggs2014-08-095-19/+24
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: store vblank event handler data in nv_crtcBen Skeggs2014-08-093-29/+29
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/kms: create ctxdma objects for framebuffers as requiredBen Skeggs2014-08-094-163/+126
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/kms: move framebuffer wrangling out of common codeBen Skeggs2014-08-093-47/+81
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Bump version from 1.1.1 to 1.1.2Mario Kleiner2014-08-091-1/+3
| | | | | | | | | | | | | | | | | | Linux 3.16 fixed multiple bugs in kms pageflip completion events and timestamping, which were originally introduced in Linux 3.13. These fixes have been backported to all stable kernels since 3.13. However, the userspace nouveau-ddx needs to be aware if it is running on a kernel on which these bugs are fixed, or not. Bump the patchlevel of the drm driver version to signal this, so backporting this patch to stable 3.13+ kernels will give the ddx the required info. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: <stable@vger.kernel.org> #v3.13+ Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50-/sw: use nv50_software_context_dtor....Ben Skeggs2014-08-092-2/+2
| | | | | | You would not believe the troubles this caused me... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50-/fb: use dma_mapping_error() to check dma_map_page() resultBen Skeggs2014-08-092-3/+3
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Dis/Enable vblank irqs during suspend/resume.Mario Kleiner2014-08-091-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vblank irqs don't get disabled during suspend or driver unload, which causes irq delivery after "suspend" or driver unload, at least until the gpu is powered off. This could race with drm_vblank_cleanup() in the case of nouveau and cause a use-after-free bug if the driver is unloaded. More annoyingly during everyday use, at least on nv50 display engine (likely also others), vblank irqs are off after a resume from suspend, but the drm doesn't know this, so all vblank related functionality is dead after a resume. E.g., all windowed OpenGL clients will hang at swapbuffers time, as well as many fullscreen clients in many cases. This makes suspend/resume useless if one wants to use any OpenGL apps after the resume. In Linux 3.16, drm_vblank_on() was added, complementing the older drm_vblank_off() to solve these problems elegantly, so use those calls in nouveaus suspend/resume code. For kernels 3.8 - 3.15, we need to cherry-pick the drm_vblank_on() patch to support this patch. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: <stable@vger.kernel.org> #v3.16 Cc: <stable@vger.kernel.org> #v3.8+: f275228: drm: Add drm_vblank_on() Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: platform: update moved Tegra headerAlexandre Courbot2014-08-091-1/+1
| | | | | | | Header for tegra_powergate functions has moved to soc/tegra/pmc.h. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/gk20a: reclocking supportAlexandre Courbot2014-08-095-0/+669
| | | | | | | | | Add support for reclocking on GK20A, using a statically-defined pstates table. The algorithms for calculating the coefficients and setting the clocks are directly taken from the ChromeOS kernel. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/clk: support for non-BIOS pstatesAlexandre Courbot2014-08-099-20/+30
| | | | | | | | | | | | Make nouveau_clock_create() take new two optional arguments: an array of pstates and its size. When these are specified, nouveau_clock_create() will use the provided pstates instead of probing them using the BIOS. This is useful for platforms which do not provide a BIOS, like Tegra. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/clk: make therm and volt devices optionalAlexandre Courbot2014-08-091-14/+22
| | | | | | | | Allow the clock subsystem to operate even if voltage and thermal devices are not set for the device (for people with watercooling! ;)) Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/perfmon: do not forget to destroy the engine contextSamuel Pitoiset2014-08-091-0/+1
| | | | | | | This fixes a crash when we reload Nouveau DRM. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: map pages using DMA APIAlexandre Courbot2014-08-095-41/+26
| | | | | | | | | | The DMA API is the recommended way to map pages no matter what the underlying bus is. Use the DMA functions for page mapping and remove currently existing wrappers. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/pwr/macros: Stop playing Russian roulette on data memoryRoy Spliet2014-08-095-663/+663
| | | | | Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nve4/graph: do not crash if no power device presentAlexandre Courbot2014-08-091-1/+2
| | | | | | | | Detect and workaround the absence of a power device so chips that do not feature one (e.g. GK20A) can still use this driver. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/gk20a: add BAR instanceAlexandre Courbot2014-08-096-4/+66
| | | | | | | | GK20A's BAR is functionally identical to NVC0's, but do not support being ioremapped write-combined. Create a BAR instance for GK20A that reflect that state. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
* drm/nouveau/bar: add noncached ioremap propertyAlexandre Courbot2014-08-092-5/+15
| | | | | | | | Some BARs (like GK20A's) do not support being ioremapped write-combined. Add a boolean property to the BAR structure and handle that case in the Nouveau BO implementation. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
* drm/nouveau: support for probing platform devicesAlexandre Courbot2014-08-096-16/+291
| | | | | | | | | | | | | | | | | Add a platform driver for Nouveau devices declared using the device tree or platform data. This driver currently supports GK20A on Tegra platforms and is only compiled for these platforms if Nouveau is enabled. Nouveau will probe the chip type itself using the BOOT0 register, so all this driver really needs to do is to make sure the module is powered and its clocks active before calling nouveau_drm_platform_probe(). Heavily based on work done by Thierry Reding. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/kms: restore acceleration before fb_set_suspend() resumesBen Skeggs2014-08-091-3/+3
| | | | | | This *should* be safe these days. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/kms: take more care when pulling down accelerated fbconBen Skeggs2014-08-093-39/+61
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: expose pstate selection per-power source in sysfsBen Skeggs2014-08-093-18/+52
| | | | | | | | echo ac:id >> pstate # select mode when on mains power echo dc:id >> pstate # select mode when on battery echo id >> pstate # select mode for both Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/clk: allow selection of different power state for ac vs batteryBen Skeggs2014-08-094-30/+96
| | | | | | | v2: - s/init/fini/ typo, reported by Alex Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/clk: schedule pstate changes through a workqueueBen Skeggs2014-08-092-11/+39
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/device: register for acpi eventsBen Skeggs2014-08-095-2/+94
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/gk208-/gr: stop touching 0x260 inappropriatelyBen Skeggs2014-08-0915-45/+113
| | | | | | | As a side note.. It's a bit hard to figure out how to name this commit.. GK20A is NVEA, which is before NV108 (GK208).. Confusing. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/gk110b/gr: initvals differ from gk110Ben Skeggs2014-08-099-14/+244
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/gk104/gr: disable PGOB at init timeBen Skeggs2014-08-092-25/+7
| | | | | | This removes the previous hack that worked on some boards. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/gk104/pwr: implement PGOB disable methodBen Skeggs2014-08-096-3/+86
| | | | | | | | | | | | | | | | | As documented at: ftp://download.nvidia.com/open-gpu-doc/gk104-disable-graphics-power-gating/1/gk104-disable-graphics-power-gating.txt NVIDIA were not able document the steps necessary to detect whether this is required or not at this time. However, they did confirm that this procedure is safe to perform unconditionally on GK104/6. GK107 does not have the power gating feature, and it was recommended that we do not perform these steps there as the effects were not verified. The disable path is from observing the binary driver, and not documented in the link above. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/pwr: tidyBen Skeggs2014-08-0912-193/+133
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* Merge tag 'v3.16' into drm-nextDave Airlie2014-08-0511-34/+32
|\ | | | | | | | | | | | | | | | | | | Linux 3.16 backmerge requested by i915, nouveau and radeon authors Conflicts: drivers/gpu/drm/i915/i915_gem_render_state.c drivers/gpu/drm/i915/intel_drv.h
| * Merge branch 'linux-3.16' of ↵Dave Airlie2014-07-151-3/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes deadlock fix. * 'linux-3.16' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/nouveau/therm: fix a potential deadlock in the therm monitoring code
| | * drm/nouveau/therm: fix a potential deadlock in the therm monitoring codeMartin Peres2014-07-151-3/+3
| | | | | | | | | | | | | | | | | | Signed-off-by: Martin Peres <martin.peres@free.fr> Tested-by: Stefan Ringel <mail@stefanringel.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * | Merge branch 'drm-nouveau-next' of ↵Dave Airlie2014-07-1010-31/+29
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes A couple of DP regression fixes, kepler memory reclocking fixes, and a fix for an annoying display issue that can pop up on resume. * 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/nouveau/ram: fix test for gpio presence drm/nouveau/dp: workaround broken display drm/nouveau/dp: fix required link bandwidth calculations drm/nouveau/kms: restore fbcon after display has been resumed drm/nv50-/kms: pass a non-zero value for head to sor dpms methods drm/nouveau/fb: Prevent inlining of ramfuc_reg drm/gk104/ram: bash mpll bit 31 on
| | * drm/nouveau/ram: fix test for gpio presenceBen Skeggs2014-07-081-1/+1
| | | | | | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| | * drm/nouveau/dp: workaround broken displayBen Skeggs2014-07-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The display in fdo#76483 pulses the hotplug line for link retraining after we cut power to the main link on the source, even while it's in D3. fdo#76483 Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| | * drm/nouveau/dp: fix required link bandwidth calculationsBen Skeggs2014-07-083-9/+11
| | | | | | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| | * drm/nouveau/kms: restore fbcon after display has been resumedBen Skeggs2014-07-083-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under some complicated circumstances (boot, suspend, resume, attach second display, suspend, resume, suspend, detach second display, resume, suspend, attach second display, resume), the fb_set_suspend() call can somehow result in a modeset being attempted before we're ready for it and things blow up in fun ways. Running display init first fixes the issue. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>