summaryrefslogtreecommitdiff
path: root/drm/nouveau
Commit message (Collapse)AuthorAgeFilesLines
* gr/gm20b: don't bypass MMU security checkoldstagingbaserock/gk20aVince Hsu2015-08-061-5/+0
| | | | | | | | The MMU security check was bypassed for non-secure boot earlier. We have to enable it as we have secure boot supported now. Signed-off-by: Vince Hsu <vinceh@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
* gr/gm20b: add MaxwellDmaCopyA classMark Zhang2015-08-062-0/+2
| | | | | | | | | | | This patch adds class MaxwellDmaCopyA which makes GR init gets called during nouveau probing which makes secure boot works. [alex] Looks like a hack rather than an actual fix. Secure boot should just work. Signed-off-by: Mark Zhang <markz@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
* mmu: fix sgt mappings that span multiple pde'sLauri Peltonen2015-08-061-0/+2
| | | | | Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
* plat: turn gpu_ref absence into warningAlexandre Courbot2015-08-061-1/+1
|
* HACK fix gk20aAlexandre Courbot2015-08-063-2/+5
|
* drm/nouveau/clk: add clocking driver for GM20BVince Hsu2015-08-064-0/+1397
| | | | | | | | | | | | | | | | | | This patch adds GPCPLL support for GM20B. The GPCPLL inside GM20B has improvements compared with GK20A - Glitchless post divider - Noise Aware PLL (NA-PLL) - Glitchless Sync Mux The glitchless pdiv is enabled by default. The NA-PLL is only supported on the parts that have GPU speedo ID larger than one and enabled if available. All the the clock programming sequences are from the work and effort by: Alex Frid <afrid@nvidia.com> Signed-off-by: Vince Hsu <vinceh@nvidia.com>
* drm/nouveau/volt: add volt support for GM20BVince Hsu2015-08-064-0/+135
| | | | | | | The CVB calculation equation is the same as GK20A. Only the CVB constants are newly added. Signed-off-by: Vince Hsu <vinceh@nvidia.com>
* drm/nouveau/volt: gk20a: make some reusable functions non-staticVince Hsu2015-08-062-18/+51
| | | | | | | The CVB calculation and voltage setting functions can be reused for the future chips. So move the declaration to gk20a.h. Signed-off-by: Vince Hsu <vinceh@nvidia.com>
* drm/nouveau/volt: add function get_voltage_by_id()Vince Hsu2015-08-062-0/+11
| | | | | | | We need the exact voltage value to calculate the PLL coefficients for GM20B. Signed-off-by: Vince Hsu <vinceh@nvidia.com>
* drm/nouveau/platform: add gpu_speedo_id informationVince Hsu2015-08-063-3/+5
| | | | | | Get GPU speedo ID from fuse to setup clock programming later. Signed-off-by: Vince Hsu <vinceh@nvidia.com>
* drm/nouveau/platform: add one more reference clockVince Hsu2015-08-062-0/+17
| | | | | | | | GM20B and GK20A have different reference clocks. Add one more handle for GM20B so taht the clock subdev can choose which one to use. Signed-off-by: Vince Hsu <vinceh@nvidia.com>
* drm/nouveau: Support fence fd's at kickoffLauri Peltonen2015-08-064-1/+146
| | | | | | | | | | | | | Add a new NOUVEAU_GEM_PUSHBUF_2 ioctl that accepts and emits a sync fence fd from/to user space if the user space requests it by passing corresponding flags. The new ioctl is only supported on relatively new chips, and it does not support relocations or suffix0/suffix1. Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> [acourbot@nvidia.com: carry upstream, fix style] Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
* gem: Split nv50_dma_pushLauri Peltonen2015-08-063-12/+22
| | | | | | | | | Split this function to provide a version allowing to directly specify a PB entry in its hardware format. Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> [acourbot@nvidia.com: split from longer patch] Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
* drm/nouveau: Add fence fd helpersLauri Peltonen2015-08-062-1/+76
| | | | | | | | | | | | | | | | Add nouveau_fence_install, which installs a drm fence as a file descriptor that can be returned to user space. Add nouveau_fence_sync_fd, which pushes semaphore wait commands for each Nouveau fence contained within the sync fd. If the sync fd contains non-Nouveau fences, those are waited on the CPU. Add missing fence_value_str and timeline_value_str callbacks to nouveau fence_ops. Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> [acourbot@nvidia.com: carry patch upstream] Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
* drm/nouveau: Split nouveau_fence_syncLauri Peltonen2015-08-066-59/+54
| | | | | | | | | | | | | | | | Split nouveau_fence_sync to two functions: * nouveau_fence_sync, which only adds a fence wait to the channel command stream, and * nouveau_bo_sync, which gets the fences from the reservation object and passes them to nouveau_fence_sync. This factorizes the code in the new nouveau_fence_sync() which was present twice otherwise. Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> [acourbot@nvidia.com: factorize code some more, fix style] Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
* [STAGING] drm/nouveau: add GEM_SET_TILING staging ioctlAri Hirvonen2015-08-067-21/+95
| | | | | | | | | | Add new NOUVEAU_GEM_SET_TILING ioctl to set correct tiling mode for imported dma-bufs. This ioctl is staging for now and enabled with the "staging_tiling" module option. Signed-off-by: Ari Hirvonen <ahirvonen@nvidia.com> [acourbot@nvidia.com: carry upstream, many fixes] Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
* Some comments for GK20AAlexandre Courbot2015-08-063-0/+25
| | | | This reverts commit 9495a0bcfb62849a1f9a7647c8dd1b9e0dd52a04.
* WAR for 3.18 kernelsAlexandre Courbot2015-08-061-1/+1
| | | | | This function does not exist on 3.18, and we don't need it for Tegra anyway.
* bios: add opcodes 0x73 and 0x77Ilia Mirkin2015-07-281-0/+37
| | | | | | | | No known VBIOSes use these, but they are present in the actual VBIOS table parsing logic. No harm in adding these too. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* platform: recognize GM20BAlexandre Courbot2015-07-281-0/+1
| | | | | | | Allow the platform driver to recognize GM20B. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* device: recognize GM20BAlexandre Courbot2015-07-281-0/+20
| | | | | | | Recognize GM20B and assign the right engines and subdevs. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* gr: add GM20B supportAlexandre Courbot2015-07-2810-6/+217
| | | | | | | | | Add support for GM20B's graphics engine, based on GK20A. Note that this code alone will not allow the engine to initialize on released devices which require PMU-assisted secure boot. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* fifo: add GM20B fifoAlexandre Courbot2015-07-285-1/+41
| | | | | | | GM20B has a 512-channels FIFO similar to GK104. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* gr/gk20a: use same initialization sequence as nvgpuAlexandre Courbot2015-07-285-30/+421
| | | | | | | | | | | | | GK20A's initialization was based on GK104, but differences exist in the way the initial context is built and the initialization process itself. This patch follows the same initialization sequence as nvgpu performs to avoid bad surprises. Since the register bundles initialization also differ considerably from GK104, the register packs are now loaded from firmware files, again similarly to what is done with nvgpu. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* gr: use NVIDIA-provided external firmwaresAlexandre Courbot2015-07-281-12/+19
| | | | | | | | | NVIDIA will officially start providing GR firmwares through linux-firmware for GPUs that require it. Change the GR firmware lookup function to use these files. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm/gk104: add compute signals/sourcesSamuel Pitoiset2015-07-283-1/+93
| | | | | | | | | These signals and sources have been reverse engineered from CUPTI (Linux). Graphics signals exposed by PerfKit (Windows only) will be added later. I need to reverse engineer them and it's a bit painful. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm/gk104: re-use gf100_pm_ctor()Samuel Pitoiset2015-07-283-56/+14
| | | | | | | gk104_pm_ctor() is equal to gf100_pm_ctor(). Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm/nv40: rename pcounter domains to 'pc' instead of 'pm'Samuel Pitoiset2015-07-281-1/+1
| | | | | | | | This trivial patch makes thing more consistent since hardware signals names are prefixed by 'pcXX'. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: expose name of domainsSamuel Pitoiset2015-07-282-0/+2
| | | | | | | | This is going to be very useful for GF100+ because each GPC can have its own domain of counters. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/clk: fix tstate to pstate calculationWei Ni2015-07-281-1/+1
| | | | | | | | | | | | | According to the tstate calculation in nvkm_clk_tstate(), the range of tstate is from -(clk->state_nr - 1) to 0, it mean the tstate is negative value. But in nvkm_pstate_work(), it use (clk->state_nr - 1 - clk->tstate) to limit pstate, it's not correct. This patch fix it to use (clk->state_nr - 1 + clk->tstate) to limit pstate. Signed-off-by: Wei Ni <wni@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: some fixes related to sourcesSamuel Pitoiset2015-07-281-5/+16
| | | | | Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: fix signals/sources for GT200+Samuel Pitoiset2015-07-282-6/+5
| | | | | Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm/gf100: add compute signals/sourcesSamuel Pitoiset2015-07-287-5/+282
| | | | | | | | | | | These signals and sources have been reverse engineered from CUPTI (Linux). Graphics signals exposed by PerfKit (Windows only) will be added later. I need to reverse engineer them and it's a bit painful. This commit also adds a new class for GF108 and GF117. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm/gf100: allow to share GPC, HUB and PART domainsSamuel Pitoiset2015-07-284-19/+34
| | | | | Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: stack perfdom class under perfmonBen Skeggs2015-07-281-7/+31
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: swap perfmon/perfdom code to avoid forward decl in next commitBen Skeggs2015-07-281-175/+175
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm/nv50: add compute and graphics signals/sourcesSamuel Pitoiset2015-07-288-11/+485
| | | | | | | | | | | These signals and sources have been reverse engineered from NVIDIA PerfKit (Windows) and CUPTI (Linux), they will be used to build complex hardware events from the userspace. This commit also adds a new class for GT200. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: allow the userspace to configure sourcesSamuel Pitoiset2015-07-283-10/+95
| | | | | Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: allow to configure domains instead of simple countersSamuel Pitoiset2015-07-286-124/+146
| | | | | | | | | | | | | | | | | | | Configuring counters from the userspace require the kernel to handle some logic related to performance counters. Basically, it has to find a free slot to assign a counter, to handle extra counting modes like B4/B6 and it must return and error when it can't configure a counter. In my opinion, the kernel should not handle all of that logic but it should only write the configuration sent by the userspace without checking anything. In other words, it should overwrite the configuration even if it's already counting and do not return any errors. This patch allows the userspace to configure a domain instead of separate counters. This has the advantage to move all of the logic to the userspace. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: allow the userspace to schedule hardware countersSamuel Pitoiset2015-07-283-25/+48
| | | | | | | | | | | | | This adds a new method NVIF_PERFCTR_V0_INIT which starts a batch of hardware counters for sampling. This will allow the userspace to start a monitoring session using the INIT method and to stop it with SAMPLE, for example before and after a frame is rendered. This commit temporarily breaks nv_perfmon but this is going to be fixed with the upcoming patch. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: implement NVIF_PERFMON_V0_QUERY_SOURCE methodSamuel Pitoiset2015-07-282-0/+89
| | | | | | | | This allows to query the ID, the mask and the user-readable name of sources for each signal. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: allow to query the number of sources for a signalSamuel Pitoiset2015-07-282-4/+21
| | | | | Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: add concept of sourcesSamuel Pitoiset2015-07-283-4/+103
| | | | | | | | | | | | | A source (or multiplexer) is a tuple addr+mask+shift which allows to control a block of signals. The maximum number of sources that a signal can define is arbitrary limited to 8 and this should be large enough. This patch allows to define multi-level of sources for a signal. Each different sources are stored to a global list and will be exposed to the userspace through the nvif interface in order to avoid conflicts. Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: allow to monitor hardware signal index 0x00Samuel Pitoiset2015-07-283-6/+10
| | | | | | | | | This signal index must be always allowed even if it's not clearly defined in a domain in order to monitor a counter like 0x03020100 because it's the default value of signals. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: use hardware signals indexes instead of user-readable namesSamuel Pitoiset2015-07-282-44/+19
| | | | | Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: change signal iter to u16Samuel Pitoiset2015-07-283-9/+10
| | | | | | | | 16 bits is large enough to store the maximum number of signals available for one domain (i.e. 256). Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: allow to query signals by domainSamuel Pitoiset2015-07-282-25/+14
| | | | | | | | This will allow to configure performance counters with hardware signal indexes instead of user-readable names in an upcoming patch. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: implement NVIF_PERFMON_V0_QUERY_DOMAIN methodSamuel Pitoiset2015-07-282-1/+96
| | | | | | | | This allows to query the number of available domains, including the number of hardware counter and the number of signals per domain. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: prevent creating a perfctr object when signals are not foundSamuel Pitoiset2015-07-281-2/+4
| | | | | | | | Since a new class has been introduced to query signals, we can now return an error when the userspace wants to monitor unknown signals. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* pm: reorganize the nvif interfaceSamuel Pitoiset2015-07-283-18/+51
| | | | | | | | | This commit introduces the NVIF_IOCTL_NEW_V0_PERFMON class which will be used in order to query domains, signals and sources. This separates the querying and the counting interface. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>