summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau
Commit message (Collapse)AuthorAgeFilesLines
* drm/nouveau/pm: swap perfmon/perfdom code to avoid forward decl in next commitBen Skeggs2015-08-281-175/+175
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/pm/nv50: add compute and graphics signals/sourcesSamuel Pitoiset2015-08-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>
* drm/nouveau/pm: allow the userspace to configure sourcesSamuel Pitoiset2015-08-283-10/+95
| | | | | Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/pm: allow to configure domains instead of simple countersSamuel Pitoiset2015-08-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>
* drm/nouveau/pm: allow the userspace to schedule hardware countersSamuel Pitoiset2015-08-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>
* drm/nouveau/pm: implement NVIF_PERFMON_V0_QUERY_SOURCE methodSamuel Pitoiset2015-08-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>
* drm/nouveau/pm: allow to query the number of sources for a signalSamuel Pitoiset2015-08-282-4/+21
| | | | | Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/pm: add concept of sourcesSamuel Pitoiset2015-08-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>
* drm/nouveau/pm: allow to monitor hardware signal index 0x00Samuel Pitoiset2015-08-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>
* drm/nouveau/pm: use hardware signals indexes instead of user-readable namesSamuel Pitoiset2015-08-282-44/+19
| | | | | Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/pm: change signal iter to u16Samuel Pitoiset2015-08-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>
* drm/nouveau/pm: allow to query signals by domainSamuel Pitoiset2015-08-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>
* drm/nouveau/pm: implement NVIF_PERFMON_V0_QUERY_DOMAIN methodSamuel Pitoiset2015-08-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>
* drm/nouveau/pm: prevent creating a perfctr object when signals are not foundSamuel Pitoiset2015-08-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>
* drm/nouveau/pm: reorganize the nvif interfaceSamuel Pitoiset2015-08-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>
* drm/nouveau/pm: remove unused nvkm_perfsig_wrap() functionSamuel Pitoiset2015-08-282-24/+0
| | | | | | Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Martin Peres <martin.peres@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/pm: remove pmu signalsSamuel Pitoiset2015-08-288-151/+1
| | | | | | | | PDAEMON signals don't have to be exposed by the perfmon engine. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Martin Peres <martin.peres@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/clk/nv50: Enable user reclocking for NVA0Roy Spliet2015-08-281-1/+2
| | | | | | | | Tested on a few cards. Probably works quite well for most, given they should all be GDDR3. Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fb/gddr3: Add a few CL and WR entries observed on GTX260Roy Spliet2015-08-281-4/+4
| | | | | Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fb/ramnv50: GDDR3 script for NVA0Roy Spliet2015-08-281-25/+104
| | | | | | | | | This looks surprisingly similar to scripts on earlier cards as well but they don't seem to work just yet. That... and I don't have any, which makes it a tough job to reverse engineer. Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bios/ramcfg: Separate out RON pull valueRoy Spliet2015-08-284-3/+9
| | | | | Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bios/rammap: Parse perf mode as if it's a rammap entryRoy Spliet2015-08-284-0/+24
| | | | | | | Some of the bits in there are similar to the bits in the gt215 rammap. Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fb/ramnv50: Ressurect timing code, use proper timing/rammap handlersRoy Spliet2015-08-284-33/+182
| | | | | | | Might need some generalisation to < GT200. For those: use at your own risk! Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fb/ramgt215: No need to cuss like thatRoy Spliet2015-08-281-1/+1
| | | | | Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fb/ramnv50: Make 0x100da0 per-partitionRoy Spliet2015-08-281-7/+13
| | | | | | | Like on GT215 Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bios/rammap: Pull DLLoff bit out of version 0x10 structRoy Spliet2015-08-286-8/+8
| | | | | | | In preparation of NV50 reclocking, where there is no version Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* remove unnecessary includeBen Skeggs2015-08-281-30/+0
| | | | | | | This was merged with core/device.h in an earlier commit, but somehow never got removed. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* Merge tag 'v4.2-rc7' into drm-nextDave Airlie2015-08-1715-13/+139
|\ | | | | | | | | | | Linux 4.2-rc7 Backmerge master for i915 fixes
| * Revert "drm/nouveau/fifo/gk104: kick channels when deactivating them"Alexandre Courbot2015-08-141-21/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1addc1264852 This commit seems to cause crashes in gk104_fifo_intr_runlist() by returning 0xbad0da00 when register 0x2a00 is read. Since this commit was intended for GM20B which is not completely supported yet, let's revert it for the time being. Reported-by: Eric Biggers <ebiggers3@gmail.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Tested-by: Afzal Mohammed <afzal.mohd.ma@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/nouveau/nouveau/ttm: fix tiled system memory with MaxwellAlexandre Courbot2015-07-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | Add Maxwell to the switch statement that sets node->memtype, otherwise all tiling information is ignored for buffers in system memory. While we are at it, make that switch statement explicitly complain the next time we meet a non-handled card family. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/kms/nv50-: guard against enabling cursor on disabled headsBen Skeggs2015-07-281-1/+1
| | | | | | | | | | | | | | Userspace has started doing this, which upsets the display class hw error checking in various unpleasant ways. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/fbcon/g80: reduce PUSH_SPACE alloc, fire ring on accel initIlia Mirkin2015-07-271-1/+2
| | | | | | | | | | | | | | | | | | Only 58 words get written to the ring, not 59. Also, normalize the accel init wrt nvc0 and nv04 fbcon impls by firing the ring at accel init time rather than waiting until "later". Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/fbcon/gf100-: reduce RING_SPACE allocationIlia Mirkin2015-07-271-1/+1
| | | | | | | | | | | | | | We only emit 58 words to the ring, not 60. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/fbcon/nv11-: correctly account for ring space usageIlia Mirkin2015-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | The RING_SPACE macro accounts how much space is used up so it's important to ask it for the right amount. Incorrect accounting of this can cause page faults down the line as writes are attempted outside of the ring. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: stable@vger.kernel.org Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/bios: add proper support for opcode 0x59Ilia Mirkin2015-07-271-4/+20
| | | | | | | | | | | | | | | | | | More analysis shows that this is identical to 0x79 except that it loads the frequency indirectly from elsewhere in the VBIOS. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91025 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/bios: add 0x59 and 0x5a opcodesIlia Mirkin2015-07-271-0/+24
| | | | | | | | | | | | | | | | | | | | | | Opcode 0x5a is a register write for data looked up from another part of the VBIOS image. 0x59 is a more complex opcode, but we may as well recognize it. These occur on a single known instance of Riva TNT2 hardware. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91025 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/disp: Use NULL for pointersThierry Reding2015-07-271-1/+1
| | | | | | | | | | | | | | | | | | The return type of exec_lookup() is struct nvkm_output *, so it should return NULL rather than 0. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/pm: fix a potential race condition when creating an engine contextSamuel Pitoiset2015-07-271-4/+3
| | | | | | | | | | | | | | | | | | | | | | There is always the possiblity that the ppm->context pointer would get partially updated and accidentally would equal ctx. This would allow two contexts to co-exist, which is not acceptable. Moving the test to the critical section takes care of this problem. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Martin Peres <martin.peres@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/pm: prevent freeing the wrong engine contextSamuel Pitoiset2015-07-271-2/+5
| | | | | | | | | | | | | | | | This fixes a crash when multiple PM engine contexts are created. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Martin Peres <martin.peres@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/gr/gf100: wait for GR idle after GO_IDLE bundleAlexandre Courbot2015-07-272-0/+38
| | | | | | | | | | | | | | | | | | | | After submitting a GO_IDLE bundle, one must wait for GR to effectively be idle before submitting the next bundle. Failure to do so may result in undefined behavior in some rare cases. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reported-by: Kary Jin <karyj@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/gr/gf100: wait on bottom half of FE's pipelineAlexandre Courbot2015-07-271-1/+1
| | | | | | | | | | | | | | | | | | When emitting the ICMD bundle, wait on the bottom half (bit 3 of the GR_STATUS register) instead of upper half (bit 2) to make sure methods are effectively emitted. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/fifo/gk104: kick channels when deactivating themAlexandre Courbot2015-07-271-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Kicking channels is part of their deactivation process. Maxwell chips are particularly sensitive to this, and can start fetching the previous pushbuffer of a recycled channel if this is not done. While we are at it, improve the channel preemption code to only wait for bit 20 of 0x002634 to turn to 0, as it is the bit indicating a preempt is pending. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/ibus/gk20a: increase SM wait timeoutAlexandre Courbot2015-07-271-0/+8
| | | | | | | | | | | | | | | | Increase clock timeout for SYS, FPB and GPC in order to avoid operation failure at high gpcclk rate. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/platform: fix compile error if !CONFIG_IOMMUAlexandre Courbot2015-07-271-0/+16
| | | | | | | | | | | | | | | | | | | | The lack of IOMMU API support can make nouveau_platform_probe_iommu() fail to compile because struct iommu_ops is then empty. Fix this by skipping IOMMU probe in that case - lack of IOMMU on platform devices is sub-optimal, but is not an error. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau: Do not leak client objectsThierry Reding2015-07-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The memory allocated for a nouveau_cli object in nouveau_cli_create() is never freed. Free the memory in nouveau_cli_destroy() to plug this leak. kmemleak recorded this after running a couple of nouveau test programs. Note that kmemleak points at drm_open_helper() because for some reason it thinks that skipping the first two stack frames is a good idea. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/clk/gt215: u32->s32 for difference in req. and set clockRoy Spliet2015-07-271-1/+2
| | | | | | | | | | | | | | This difference can of course be negative too... Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau/drm/nv04-nv40/instmem: protect access to priv->heap by mutexKamil Dudka2015-07-271-0/+8
| | | | | | | | | | | | | | This fixes the list_del corruption reported at <https://bugzilla.redhat.com/1205985>. Signed-off-by: Kamil Dudka <kdudka@redhat.com>
| * drm/nouveau: hold mutex when calling nouveau_abi16_fini()Kamil Dudka2015-07-271-0/+2
| | | | | | | | | | | | This was the only access to cli->abi16 without holding the mutex. Signed-off-by: Kamil Dudka <kdudka@redhat.com>
* | drm/plane: Use consistent data types for format countThierry Reding2015-08-121-1/+1
| | | | | | | | | | | | | | | | Rather than a mix of the the sized uint32_t and signed integer, use an unsized unsigned int to specify the format count. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* | drm/nouveau: Don't take dev->struct_mutex in ttm_finiDaniel Vetter2015-08-111-2/+0
| | | | | | | | | | | | | | | | | | This is only called in driver load/unload paths, no need to grab any locks at all. Also, ttm takes care of itself anyway. Cc: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>