deliverable/linux.git
8 years agodrm/nouveau/platform: recognize GM20B
Alexandre Courbot [Tue, 23 Jun 2015 06:16:06 +0000 (15:16 +0900)] 
drm/nouveau/platform: recognize GM20B

Allow the platform driver to recognize GM20B.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agodrm/nouveau/device: recognize GM20B
Alexandre Courbot [Tue, 23 Jun 2015 06:16:05 +0000 (15:16 +0900)] 
drm/nouveau/device: recognize GM20B

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>
8 years agodrm/nouveau/gr: add GM20B support
Alexandre Courbot [Tue, 23 Jun 2015 06:16:04 +0000 (15:16 +0900)] 
drm/nouveau/gr: add GM20B support

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>
8 years agodrm/nouveau/fifo: add GM20B fifo
Alexandre Courbot [Tue, 23 Jun 2015 06:16:03 +0000 (15:16 +0900)] 
drm/nouveau/fifo: add GM20B fifo

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>
8 years agodrm/nouveau/gr/gk20a: use same initialization sequence as nvgpu
Alexandre Courbot [Tue, 23 Jun 2015 06:16:02 +0000 (15:16 +0900)] 
drm/nouveau/gr/gk20a: use same initialization sequence as nvgpu

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>
8 years agodrm/nouveau/gr: use NVIDIA-provided external firmwares
Alexandre Courbot [Tue, 23 Jun 2015 06:16:01 +0000 (15:16 +0900)] 
drm/nouveau/gr: use NVIDIA-provided external firmwares

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>
8 years agodrm/nouveau/pm/gk104: add compute signals/sources
Samuel Pitoiset [Fri, 19 Jun 2015 15:37:18 +0000 (17:37 +0200)] 
drm/nouveau/pm/gk104: add compute signals/sources

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>
8 years agodrm/nouveau/pm/gk104: re-use gf100_pm_ctor()
Samuel Pitoiset [Fri, 19 Jun 2015 15:37:17 +0000 (17:37 +0200)] 
drm/nouveau/pm/gk104: re-use gf100_pm_ctor()

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>
8 years agodrm/nouveau/pm/nv40: rename pcounter domains to 'pc' instead of 'pm'
Samuel Pitoiset [Fri, 19 Jun 2015 15:36:38 +0000 (17:36 +0200)] 
drm/nouveau/pm/nv40: rename pcounter domains to 'pc' instead of 'pm'

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>
8 years agodrm/nouveau/pm: expose name of domains
Samuel Pitoiset [Fri, 19 Jun 2015 15:36:37 +0000 (17:36 +0200)] 
drm/nouveau/pm: expose name of domains

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>
8 years agodrm/nouveau/drm/nouveau/clk: fix tstate to pstate calculation
Wei Ni [Tue, 16 Jun 2015 09:35:12 +0000 (17:35 +0800)] 
drm/nouveau/drm/nouveau/clk: fix tstate to pstate calculation

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>
8 years agodrm/nouveau/pm: some fixes related to sources
Samuel Pitoiset [Sun, 14 Jun 2015 11:50:06 +0000 (13:50 +0200)] 
drm/nouveau/pm: some fixes related to sources

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agodrm/nouveau/pm: fix signals/sources for GT200+
Samuel Pitoiset [Sun, 14 Jun 2015 11:50:05 +0000 (13:50 +0200)] 
drm/nouveau/pm: fix signals/sources for GT200+

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agodrm/nouveau/pm/gf100: add compute signals/sources
Samuel Pitoiset [Sun, 14 Jun 2015 11:33:55 +0000 (13:33 +0200)] 
drm/nouveau/pm/gf100: add compute signals/sources

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>
8 years agodrm/nouveau/pm/gf100: allow to share GPC, HUB and PART domains
Samuel Pitoiset [Sun, 14 Jun 2015 11:33:54 +0000 (13:33 +0200)] 
drm/nouveau/pm/gf100: allow to share GPC, HUB and PART domains

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agodrm/nouveau/pm: stack perfdom class under perfmon
Ben Skeggs [Sun, 14 Jun 2015 02:20:37 +0000 (12:20 +1000)] 
drm/nouveau/pm: stack perfdom class under perfmon

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agodrm/nouveau/pm: swap perfmon/perfdom code to avoid forward decl in next commit
Ben Skeggs [Sun, 14 Jun 2015 02:10:59 +0000 (12:10 +1000)] 
drm/nouveau/pm: swap perfmon/perfdom code to avoid forward decl in next commit

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agodrm/nouveau/pm/nv50: add compute and graphics signals/sources
Samuel Pitoiset [Sun, 7 Jun 2015 20:40:28 +0000 (22:40 +0200)] 
drm/nouveau/pm/nv50: add compute and graphics signals/sources

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>
8 years agodrm/nouveau/pm: allow the userspace to configure sources
Samuel Pitoiset [Sun, 7 Jun 2015 20:40:27 +0000 (22:40 +0200)] 
drm/nouveau/pm: allow the userspace to configure sources

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agodrm/nouveau/pm: allow to configure domains instead of simple counters
Samuel Pitoiset [Sun, 7 Jun 2015 20:40:26 +0000 (22:40 +0200)] 
drm/nouveau/pm: allow to configure domains instead of simple counters

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>
8 years agodrm/nouveau/pm: allow the userspace to schedule hardware counters
Samuel Pitoiset [Sun, 7 Jun 2015 20:40:25 +0000 (22:40 +0200)] 
drm/nouveau/pm: allow the userspace to schedule hardware counters

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>
8 years agodrm/nouveau/pm: implement NVIF_PERFMON_V0_QUERY_SOURCE method
Samuel Pitoiset [Sun, 7 Jun 2015 20:40:24 +0000 (22:40 +0200)] 
drm/nouveau/pm: implement NVIF_PERFMON_V0_QUERY_SOURCE method

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>
8 years agodrm/nouveau/pm: allow to query the number of sources for a signal
Samuel Pitoiset [Sun, 7 Jun 2015 20:40:23 +0000 (22:40 +0200)] 
drm/nouveau/pm: allow to query the number of sources for a signal

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agodrm/nouveau/pm: add concept of sources