From: Lyude Paul <lyude@redhat.com>
To: nouveau@lists.freedesktop.org
Cc: "Alexandre Courbot" <acourbot@nvidia.com>,
"David Airlie" <airlied@linux.ie>,
"Rhys Kidd" <rhyskidd@gmail.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
"Karol Herbst" <karolherbst@gmail.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ben Skeggs" <bskeggs@redhat.com>,
"Ilia Mirkin" <imirkin@alum.mit.edu>,
"Martin Peres" <martin.peres@free.fr>,
"Philippe Ombredanne" <pombredanne@nexb.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Lyude Paul" <lyude@redhat.com>,
"Kate Stewart" <kstewart@linuxfoundation.org>
Subject: [RFC 0/4] Implement full clockgating for Kepler1 and 2
Date: Mon, 15 Jan 2018 17:06:50 -0500 [thread overview]
Message-ID: <20180115220755.16780-1-lyude@redhat.com> (raw)
It's here! After a lot of investigation, rewrites, and traces, I present
the patch series to implement all known levels of clockgating for
Kepler1 and Kepler2 GPUs.
Starting with Fermi GPUs (this is probably present on earlier GPUs as
well, but with a far less easy to manage interface), nvidia added two
clockgating levels that are handled mostly in firmware (with the
exception of course, of the driver initially programming all of the
register values containing engine delays and that stuff):
- CG_CTRL - Main register for enabling/disabling clockgating for
engines and hw blocks
- BLCG - "Block-level clockgating", a deeper level of clockgating
Starting with kepler2 as well, nvidia also introduced:
- SLCG - "??? clockgating" even deeper level of clockgating
Originally this patchset was going to include work for making this work
on Fermi, however on closer investigation it seems that Fermi has one
pretty big difference in it's requirements that we don't entirely
understand yet. On Fermi the CG_CTRL register for the gr needs to be
adjusted during reclocking, while kepler and later generations need no
such adjustments. Since this requires more research; the current plan is
to leave fermi out of this patchset, and then just rework the code at a
later point in time to support Fermi once we understand more.
For the time being however, we put as much code we're sure Fermi will be
sharing into gf100 files for the future.
For the time being; this patchset supports every GPU in the kepler1 and
kepler2 family. The main kernel config option to enable this is
config=NvPmEnableGating=<level>
Where <level> is the deepest level of powersaving to enable. The levels
being:
0. NOCG
1. CG (just CG_CTRL)
2. BLCG
3. SLCG
Additionally, we leave a couple of small TODO comments to mark spots
we'll eventually need to add code for the final level of power saving we
have yet to implement or understand: ELPG (engine-level powergating).
Here's some very lazily done benchmarks on how much power this saves as
well. It should be noted that chances are, these patches save a lot more
power then you see here since clockgating works best when the GPU is
under load. I have a feeling this will be especially true with SLCG.
GK104 stats:
Idle (1 4k display @ fbcon):
NOCG:
07: 20.53W
0a: 44.12W
0e: 61.23W
0f: 62.23W
CG:
07: 18.95W-19.02W
0a: 34.95W-37.48W
0e: 52.70W-54.32W
0f: 53.53W-55.68W
BLCG:
07: 18.64W-19.02W
0a: 32.68W-34.78W
0e: 49.14W-50.51W
0f: 49.75W-51.73W
GK110 stats:
Idle (1 4k display @ fbcon):
NOCG:
07: 25.68W
0a: 36.16W
0d: 64.71W
0f: 64.99W
CG:
07: 25.68W
0a: 35.58W
0d: 61.54W-61.74W
0f: 61.93W-62.12W
BLCG:
07: 25W-25.2W
0a: 33.85W-34.04W
0d: 59.25W-59.44W
0f: 59.35W-59.54W
SLCG:
07: 25W-25.2W
0a: 33.85W-33.95W (spikes to 34.04W briefly every now and then)
0d: 59.15W-59.35W
0f: 59.35W-59.54W
For the time being, this will be disabled by default in the kernel as we
wait to get more widespread testing with this patchset. If you're
willing to put up with the potential of instability, please feel free to
try this patchset and let us know how well it works for you!
Lyude Paul (4):
drm/nouveau: Add support for basic clockgating on Kepler1
drm/nouveau: Add support for BLCG clockgating for Kepler1
drm/nouveau: Add BLCG clockgating for Kepler2
drm/nouveau: Add SLCG clockgating for Kepler2
drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h | 1 +
.../gpu/drm/nouveau/include/nvkm/subdev/therm.h | 25 +++
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 25 +--
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h | 1 +
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk104.c | 215 ++++++++++++++++++++-
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk104.h | 55 ++++++
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110.c | 176 +++++++++++++++++
drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild | 1 +
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c | 6 +
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk104.c | 53 +++++
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk104.h | 35 ++++
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk110.c | 77 ++++++++
drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h | 3 +
drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild | 2 +
drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 84 +++++++-
drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf100.c | 77 ++++++++
drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf100.h | 35 ++++
drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf119.c | 8 +-
drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c | 136 +++++++++++++
drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.h | 56 ++++++
drivers/gpu/drm/nouveau/nvkm/subdev/therm/gt215.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/subdev/therm/priv.h | 23 ++-
22 files changed, 1069 insertions(+), 27 deletions(-)
create mode 100644 drivers/gpu/drm/nouveau/nvkm/engine/gr/gk104.h
create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk104.h
create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk110.c
create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf100.c
create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf100.h
create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c
create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.h
--
2.14.3
next reply other threads:[~2018-01-15 22:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-15 22:06 Lyude Paul [this message]
2018-01-15 22:06 ` [RFC 1/4] drm/nouveau: Add support for basic clockgating on Kepler1 Lyude Paul
2018-01-21 20:49 ` Martin Peres
2018-01-15 22:06 ` [RFC 2/4] drm/nouveau: Add support for BLCG clockgating for Kepler1 Lyude Paul
2018-01-15 22:06 ` [RFC 3/4] drm/nouveau: Add BLCG clockgating for Kepler2 Lyude Paul
2018-01-15 22:06 ` [RFC 4/4] drm/nouveau: Add SLCG " Lyude Paul
[not found] ` <CACY=MfW3b0qXALO1Y7bt=F7jMCfrdgi3qmmzKOXehJK5Xc5MmQ@mail.gmail.com>
[not found] ` <CACY=MfVkNPsvNWGiy9o9A=YAZciV5k=jCJ4hrNUBocThgA56sQ@mail.gmail.com>
2018-01-16 0:03 ` [Nouveau] [RFC 0/4] Implement full clockgating for Kepler1 and 2 Brock York
2018-01-16 3:34 ` Lyude Paul
2018-01-17 21:11 ` Mikko Perttunen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180115220755.16780-1-lyude@redhat.com \
--to=lyude@redhat.com \
--cc=acourbot@nvidia.com \
--cc=airlied@linux.ie \
--cc=bskeggs@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=imirkin@alum.mit.edu \
--cc=karolherbst@gmail.com \
--cc=kstewart@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.peres@free.fr \
--cc=nouveau@lists.freedesktop.org \
--cc=pombredanne@nexb.com \
--cc=rhyskidd@gmail.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox