aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_ttm.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2014-08-10drm/nouveau/device: add method to retrieve some basic device infoBen Skeggs4-37/+171
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau/core: import ioctl/event interfacesBen Skeggs13-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>
2014-08-10drm/nouveau/core: add function to return list of supported childrenBen Skeggs2-0/+34
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau/core: rework event interfaceBen Skeggs52-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>
2014-08-10drm/nouveau/core: move handle-based object apis to handle.cBen Skeggs4-120/+135
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau/core: fail creation of zero-argument objects, when arguments are passedBen Skeggs1-30/+6
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau: store a pointer to vm in nouveau_cliBen Skeggs5-19/+24
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau: store vblank event handler data in nv_crtcBen Skeggs3-29/+29
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nv50/kms: create ctxdma objects for framebuffers as requiredBen Skeggs4-163/+126
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nv50/kms: move framebuffer wrangling out of common codeBen Skeggs3-47/+81
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau: Bump version from 1.1.1 to 1.1.2Mario Kleiner1-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>
2014-08-10drm/nv50-/sw: use nv50_software_context_dtor....Ben Skeggs2-2/+2
You would not believe the troubles this caused me... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nv50-/fb: use dma_mapping_error() to check dma_map_page() resultBen Skeggs2-3/+3
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau: Dis/Enable vblank irqs during suspend/resume.Mario Kleiner1-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>
2014-08-10drm/nouveau: platform: update moved Tegra headerAlexandre Courbot1-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>
2014-08-10drm/nouveau/gk20a: reclocking supportAlexandre Courbot5-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>
2014-08-10drm/nouveau/clk: support for non-BIOS pstatesAlexandre Courbot9-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>
2014-08-10drm/nouveau/clk: make therm and volt devices optionalAlexandre Courbot1-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>
2014-08-10drm/nouveau/perfmon: do not forget to destroy the engine contextSamuel Pitoiset1-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>
2014-08-10drm/nouveau: map pages using DMA APIAlexandre Courbot5-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>
2014-08-10drm/nouveau/pwr/macros: Stop playing Russian roulette on data memoryRoy Spliet5-663/+663
Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nve4/graph: do not crash if no power device presentAlexandre Courbot1-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>
2014-08-10drm/gk20a: add BAR instanceAlexandre Courbot6-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>
2014-08-10drm/nouveau/bar: add noncached ioremap propertyAlexandre Courbot2-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>
2014-08-10drm/nouveau: support for probing platform devicesAlexandre Courbot6-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>
2014-08-10drm/nouveau/kms: restore acceleration before fb_set_suspend() resumesBen Skeggs1-3/+3
This *should* be safe these days. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau/kms: take more care when pulling down accelerated fbconBen Skeggs3-39/+61
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau: expose pstate selection per-power source in sysfsBen Skeggs3-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>
2014-08-10drm/nouveau/clk: allow selection of different power state for ac vs batteryBen Skeggs4-30/+96
v2: - s/init/fini/ typo, reported by Alex Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau/clk: schedule pstate changes through a workqueueBen Skeggs2-11/+39
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau/device: register for acpi eventsBen Skeggs5-2/+94
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/gk208-/gr: stop touching 0x260 inappropriatelyBen Skeggs15-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>
2014-08-10drm/gk110b/gr: initvals differ from gk110Ben Skeggs9-14/+244
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/gk104/gr: disable PGOB at init timeBen Skeggs2-25/+7
This removes the previous hack that worked on some boards. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/gk104/pwr: implement PGOB disable methodBen Skeggs6-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>
2014-08-10drm/nouveau/pwr: tidyBen Skeggs12-193/+133
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-09Documentation: SubmittingPatches: overhaul changelog descriptionJohannes Weiner1-7/+31
Maintainers often repeat the same feedback on poorly written changelogs - describe the problem, justify your changes, quantify optimizations, describe user-visible changes - but our documentation on writing changelogs doesn't include these things. Fix that. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-08-09Documentation: freefall: simplify pathnamesPavel Machek1-5/+1
Copying to local variable is actually not neccessary, if all we need to do is snprintf(). This also removes problem where devname could be missing zero termination. Reported-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-08-09Documentation: add How to avoid botching up ioctlsMichael Ellerman2-0/+221
I pointed some folks at this and they wondered why it wasn't in the kernel Documentation directory. So now it is. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-08-09ARM: dts: exynos5420: remove disp_pdStephen Rothwell1-1/+0
This was caused by commit 5a8da524049c ("ARM: dts: exynos5420: add dsi node"), which conflicted with d51cad7df871 ("ARM: dts: remove display power domain for exynos5420"). The DTS addition should never have been merged through the DRM tree in the first place, and it lacked an ack from the platform maintainer (who would have known that the disp_pd reference got removed). Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Olof Johansson <olof@lixom.net>
2014-08-09ARM: EXYNOS: Fix suspend/resume sequencesTomasz Figa2-108/+80
Due to recent consolidation of Exynos suspend and cpuidle code, some parts of suspend and resume sequences are executed two times, once from exynos_pm_syscore_ops and then from exynos_cpu_pm_notifier() and thus it breaks suspend, at least on Exynos4-based boards. In addition, simple core power down from a cpuidle driver could, in case of CPU 0 could result in calling functions that are specific to suspend and deeper idle states. This patch fixes the issue by moving those operations outside the CPU PM notifier into suspend and AFTR code paths. This leads to a bit of code duplication, but allows additional code simplification, so in the end more code is removed than added. Fixes: 85f9f90808b4 ("ARM: EXYNOS: Use the cpu_pm notifier for pm") Cc: Kukjin Kim <kgene.kim@samsung.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Olof Johansson <olof@lixom.net> Cc: arm@kernel.org Signed-off-by: Tomasz Figa <t.figa@samsung.com> [b.zolnierkie: ported patch over current changes] [b.zolnierkie: fixed exynos_aftr_finisher() return value] Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2014-08-09ARM: dts: Fix the sort ordering of EHCI and HSIC in rk3288.dtsiDoug Anderson1-20/+20
The EHCI and HSIC device tree nodes were added in the wrong place. Fix them. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Olof Johansson <olof@lixom.net>
2014-08-10drm/ttm: expose CPU address of DMA-allocated pagesAlexandre Courbot3-5/+12
Pages allocated using the DMA API have a coherent memory mapping. Make this mapping visible to drivers so they can decide to use it instead of creating their own redundant one. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: David Airlie <airlied@linux.ie> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-09ARM: wire up memfd_create syscallRussell King2-0/+2
Add the memfd_create syscall to ARM. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-08-09ARM: wire up getrandom syscallRussell King3-1/+3
Add the new getrandom syscall for ARM. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-08-09ARM: 8114/1: LPAE: load upper bits of early TTBR0/TTBR1Konstantin Khlebnikov1-4/+3
This patch fixes booting when idmap pgd lays above 4gb. Commit 4756dcbfd37 mostly had fixed this, but it'd failed to load upper bits. Also this fixes adding TTBR1_OFFSET to TTRR1: if lower part overflows carry flag must be added to the upper part. Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-08-08MAINTAINERS: update nomadik patternsJoe Perches1-1/+3
Commit 3a19805920f1 ("pinctrl: nomadik: move all Nomadik drivers to subdir") move the files, update the patterns Signed-off-by: Joe Perches <joe@perches.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Alessandro Rubini <rubini@unipv.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-08-08MAINTAINERS: update usb/gadget patternsJoe Perches1-6/+6
Several commits have moved files around, update the section patterns. Signed-off-by: Joe Perches <joe@perches.com> Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Li Yang <leoli@freescale.com> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Haojian Zhuang <haojian.zhuang@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-08-08MAINTAINERS: update DMA BUFFER SHARING patternsJoe Perches1-1/+3
One pattern per F: line please... Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-08-08kexec: verify the signature of signed PE bzImageVivek Goyal5-0/+72
This is the final piece of the puzzle of verifying kernel image signature during kexec_file_load() syscall. This patch calls into PE file routines to verify signature of bzImage. If signature are valid, kexec_file_load() succeeds otherwise it fails. Two new config options have been introduced. First one is CONFIG_KEXEC_VERIFY_SIG. This option enforces that kernel has to be validly signed otherwise kernel load will fail. If this option is not set, no signature verification will be done. Only exception will be when secureboot is enabled. In that case signature verification should be automatically enforced when secureboot is enabled. But that will happen when secureboot patches are merged. Second config option is CONFIG_KEXEC_BZIMAGE_VERIFY_SIG. This option enables signature verification support on bzImage. If this option is not set and previous one is set, kernel image loading will fail because kernel does not have support to verify signature of bzImage. I tested these patches with both "pesign" and "sbsign" signed bzImages. I used signing_key.priv key and signing_key.x509 cert for signing as generated during kernel build process (if module signing is enabled). Used following method to sign bzImage. pesign ====== - Convert DER format cert to PEM format cert openssl x509 -in signing_key.x509 -inform DER -out signing_key.x509.PEM -outform PEM - Generate a .p12 file from existing cert and private key file openssl pkcs12 -export -out kernel-key.p12 -inkey signing_key.priv -in signing_key.x509.PEM - Import .p12 file into pesign db pk12util -i /tmp/kernel-key.p12 -d /etc/pki/pesign - Sign bzImage pesign -i /boot/vmlinuz-3.16.0-rc3+ -o /boot/vmlinuz-3.16.0-rc3+.signed.pesign -c "Glacier signing key - Magrathea" -s sbsign ====== sbsign --key signing_key.priv --cert signing_key.x509.PEM --output /boot/vmlinuz-3.16.0-rc3+.signed.sbsign /boot/vmlinuz-3.16.0-rc3+ Patch details: Well all the hard work is done in previous patches. Now bzImage loader has just call into that code and verify whether bzImage signature are valid or not. Also create two config options. First one is CONFIG_KEXEC_VERIFY_SIG. This option enforces that kernel has to be validly signed otherwise kernel load will fail. If this option is not set, no signature verification will be done. Only exception will be when secureboot is enabled. In that case signature verification should be automatically enforced when secureboot is enabled. But that will happen when secureboot patches are merged. Second config option is CONFIG_KEXEC_BZIMAGE_VERIFY_SIG. This option enables signature verification support on bzImage. If this option is not set and previous one is set, kernel image loading will fail because kernel does not have support to verify signature of bzImage. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Matt Fleming <matt@console-pimps.org> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>