Dave Airlie [Thu, 23 Feb 2017 01:05:54 +0000 (11:05 +1000)]
Merge tag 'drm-tinydrm-2017-02-18' of https://github.com/notro/linux into drm-next
Add tinydrm
* tag 'drm-tinydrm-2017-02-18' of https://github.com/notro/linux:
drm/tinydrm: Add support for Multi-Inno MI0283QT display
dt-bindings: Add Multi-Inno MI0283QT binding
dt-bindings: display/panel: Add common rotation property
of: Add vendor prefix for Multi-Inno
drm/tinydrm: Add MIPI DBI support
drm/tinydrm: Add helper functions
drm: Add DRM support for tiny LCD displays
Noralf Trønnes [Sun, 22 Jan 2017 14:23:48 +0000 (15:23 +0100)]
drm/tinydrm: Add support for Multi-Inno MI0283QT display
Add driver to support the Multi-Inno MI0283QT display panel.
It has an ILI9341 MIPI DBI compatible display controller.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Noralf Trønnes [Sun, 22 Jan 2017 14:02:26 +0000 (15:02 +0100)]
dt-bindings: Add Multi-Inno MI0283QT binding
Add device-tree binding documentation for the MI0283QT display panel.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Rob Herring <robh@kernel.org>
Noralf Trønnes [Tue, 31 Jan 2017 15:05:57 +0000 (16:05 +0100)]
dt-bindings: display/panel: Add common rotation property
Display panels can be oriented many ways, especially in the embedded
world. The rotation property is a way to describe this orientation.
The counter clockwise direction is chosen because that's what fbdev
and drm use.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Rob Herring <robh@kernel.org>
Noralf Trønnes [Sun, 22 Jan 2017 13:58:49 +0000 (14:58 +0100)]
of: Add vendor prefix for Multi-Inno
Multi-Inno Technology Co.,Ltd is a Hong Kong based company offering
LCD, LCD module products and complete panel solutions.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Rob Herring <robh@kernel.org>
Noralf Trønnes [Sat, 21 Jan 2017 23:30:47 +0000 (00:30 +0100)]
drm/tinydrm: Add MIPI DBI support
Add support for MIPI DBI compatible controllers.
Interface type C option 1 and 3 are supported (SPI).
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Noralf Trønnes [Sat, 21 Jan 2017 23:19:51 +0000 (00:19 +0100)]
drm/tinydrm: Add helper functions
Add common functionality needed by many tinydrm drivers.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Thierry Reding <treding@nvidia.com>
Noralf Trønnes [Sat, 21 Jan 2017 23:15:00 +0000 (00:15 +0100)]
drm: Add DRM support for tiny LCD displays
tinydrm provides helpers for very simple displays that can use
CMA backed framebuffers and need flushing on changes.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Thierry Reding <treding@nvidia.com>
Dave Airlie [Fri, 17 Feb 2017 20:35:25 +0000 (06:35 +1000)]
Merge tag 'drm-intel-next-fixes-2017-02-17' of git://anongit.freedesktop.org/git/drm-intel into drm-next
i915 and GVT fixes for v4.11 merge window
* tag 'drm-intel-next-fixes-2017-02-17' of git://anongit.freedesktop.org/git/drm-intel: (32 commits)
drm/i915: Fix not finding the VBT when it overlaps with OPREGION_ASLE_EXT
drm/i915: Pass timeout==0 on to i915_gem_object_wait_fence()
drm/i915/gvt: Disable access to stolen memory as a guest
drm/i915: Avoid spurious WARNs about the wrong pipe in the PPS code
drm/i915: Check for timeout completion when waiting for the rq to submitted
drm/i915: A hotfix for making aliasing PPGTT work for GVT-g
drm/i915: Restore context and pd for ringbuffer submission after reset
drm/i915: Let execlist_update_context() cover !FULL_PPGTT mode.
drm/i915/lspcon: Fix resume time initialization due to unasserted HPD
drm/i915/gen9+: Enable hotplug detection early
drm/i915: Reject set-tiling-ioctl with stride==0 and a tiling mode
drm/i915: Recreate internal objects with single page segments if dmar fails
drm/i915/gvt: return error code if dma map iova failed
drm/i915/gvt: optimize the inhibit context mmio load
drm/i915/gvt: add sprite plane flip done support.
drm/i915/gvt: add missing display part reset for vGPU reset
drm/i915/gvt: Fix shadow context descriptor
drm/i915/gvt: Fix alignment for GTT allocation
drm/i915/gvt: fix crash at function release_shadow_wa_ctx
drm/i915/gvt: enable IOMMU for gvt
...
Dave Airlie [Fri, 17 Feb 2017 07:43:07 +0000 (17:43 +1000)]
Merge branch 'linux-4.11' of git://github.com/skeggsb/linux into drm-next
- Rework of the secure boot code, in preparation for GP10x secure boot.
- Improvements to channel recovery
- Initial power budget code
- Some preparation for an upcoming MMU rework (probably 4.12)
- Misc other fixes.
* 'linux-4.11' of git://github.com/skeggsb/linux: (88 commits)
drm/nouveau/tmr: provide backtrace when a timeout is hit
drm/nouveau/pci/g92: Fix rearm
drm/nouveau/drm/therm/fan: add a fallback if no fan control is specified in the vbios
drm/nouveau/hwmon: expose power_max and power_crit
drm/nouveau/iccsense: Parse max and crit power level
drm/nouveau/bios/power_budget: Add basic power budget parsing
drm/nouveau/fifo/gk104-: preempt recovery
drm/nouveau/fifo/gk104-: trigger mmu fault before attempting engine recovery
drm/nouveau/fifo/gk104-: ACK SCHED_ERROR before attempting CTXSW_TIMEOUT recovery
drm/nouveau/fifo/gk104-: directly use new recovery code for ctxsw timeout
drm/nouveau/fifo/gk104-: directly use new recovery code for mmu faults
drm/nouveau/fifo/gk104-: reset all engines a killed channel is still active on
drm/nouveau/fifo/gk104-: refactor recovery code
drm/nouveau/fifo/gk104-: better detection of chid when parsing engine status
drm/nouveau/fifo/gk104-: separate out engine status parsing
drm/nouveau/fifo: add an api for initiating channel recovery
drm/nouveau/top: add function to translate subdev index to mmu fault id
drm/nouveau/gr/gf100-: implement chsw_load() method
drm/nouveau/gr: implement chsw_load() method
drm/nouveau/core: add engine method to assist in determining chsw direction
...
Ben Skeggs [Fri, 17 Feb 2017 05:08:10 +0000 (15:08 +1000)]
drm/nouveau/tmr: provide backtrace when a timeout is hit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Karol Herbst [Sat, 11 Feb 2017 11:58:17 +0000 (12:58 +0100)]
drm/nouveau/pci/g92: Fix rearm
704a6c008b7942bb7f30bb43d2a6bcad7f543662 broke pci msi rearm for g92 GPUs.
g92 needs the nv46_pci_msi_rearm, where g94+ gpus used nv40_pci_msi_rearm.
Reported-by: Andrew Randrianasulu <randrianasulu@gmail.com>
Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
Martin Peres [Thu, 29 Sep 2016 00:41:35 +0000 (03:41 +0300)]
drm/nouveau/drm/therm/fan: add a fallback if no fan control is specified in the vbios
This seems to be absolutely necessary for a lot of NV40.
Reported-by: gsgf on IRC/freenode
Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Karol Herbst [Mon, 23 Jan 2017 22:10:13 +0000 (23:10 +0100)]
drm/nouveau/hwmon: expose power_max and power_crit
Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Karol Herbst [Mon, 23 Jan 2017 22:10:12 +0000 (23:10 +0100)]
drm/nouveau/iccsense: Parse max and crit power level
Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Karol Herbst [Mon, 23 Jan 2017 22:10:11 +0000 (23:10 +0100)]
drm/nouveau/bios/power_budget: Add basic power budget parsing
v2: Set entry to 0xff if not found
Add cap entry for ver 0x30 tables
Rework to fix memory leak
v3: More error checks
Simplify check for invalid entries
v4: disable for ver 0x10 for now
move assignments after the second last return
Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 Jan 2017 08:40:48 +0000 (18:40 +1000)]
drm/nouveau/fifo/gk104-: preempt recovery
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 Jan 2017 05:37:24 +0000 (15:37 +1000)]
drm/nouveau/fifo/gk104-: trigger mmu fault before attempting engine recovery
Greatly improves the chances of recovering the GPU from a CTXSW_TIMEOUT.
Tested with piglit's arb_shader_image_load_store-atomicity, which causes
GR to hang in such a way that recovery failed (CTXSW_TIMEOUT continually
re-triggers).
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 Jan 2017 06:05:15 +0000 (16:05 +1000)]
drm/nouveau/fifo/gk104-: ACK SCHED_ERROR before attempting CTXSW_TIMEOUT recovery
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 Jan 2017 06:03:44 +0000 (16:03 +1000)]
drm/nouveau/fifo/gk104-: directly use new recovery code for ctxsw timeout
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 Jan 2017 06:01:11 +0000 (16:01 +1000)]
drm/nouveau/fifo/gk104-: directly use new recovery code for mmu faults
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 Jan 2017 05:35:16 +0000 (15:35 +1000)]
drm/nouveau/fifo/gk104-: reset all engines a killed channel is still active on
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 Jan 2017 05:22:43 +0000 (15:22 +1000)]
drm/nouveau/fifo/gk104-: refactor recovery code
This will serve as a basis for implementing some improvements to how
we recover the GPU from channel errors.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 16 Jan 2017 00:36:00 +0000 (10:36 +1000)]
drm/nouveau/fifo/gk104-: better detection of chid when parsing engine status
The previous commit simply changes the interface, but should result in
the same behaviour as previously. This commit has been split out from
it as it can result in a different channel being selected.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 16 Jan 2017 00:14:36 +0000 (10:14 +1000)]
drm/nouveau/fifo/gk104-: separate out engine status parsing
We'll be wanting to reuse this logic in more places.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 26 Jan 2017 02:10:24 +0000 (12:10 +1000)]
drm/nouveau/fifo: add an api for initiating channel recovery
This will be used by callers outside of fifo interrupt handlers.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 Jan 2017 04:57:01 +0000 (14:57 +1000)]
drm/nouveau/top: add function to translate subdev index to mmu fault id
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 16 Jan 2017 00:28:54 +0000 (10:28 +1000)]
drm/nouveau/gr/gf100-: implement chsw_load() method
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 16 Jan 2017 00:25:10 +0000 (10:25 +1000)]
drm/nouveau/gr: implement chsw_load() method
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 16 Jan 2017 00:22:59 +0000 (10:22 +1000)]
drm/nouveau/core: add engine method to assist in determining chsw direction
FIFO gives us load/save/switch status, and we need to be able to determine
which direction a "switch" is failing during channel recovery.
In order to do this, we apparently need to query the engine itself.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 24 Jan 2017 06:56:52 +0000 (16:56 +1000)]
drm/nouveau: check for dead channel before trying to idle
This prevents *very* long waits while attempting to destroy channels
after a fault has occurred.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sat, 5 Nov 2016 03:31:25 +0000 (13:31 +1000)]
drm/nouveau: request notifications for channels that have been killed
These will be used to improve error recovery behaviour.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sat, 5 Nov 2016 03:05:14 +0000 (13:05 +1000)]
drm/nouveau/fifo/gf100-: provide notification to user if channel is killed
There are instances (such as non-recoverable GPU page faults) where
NVKM decides that a channel's context is no longer viable, and will
be removed from the runlist.
This commit notifies the owner of the channel when this happens, so
it has the opportunity to take some kind of recovery action instead
of hanging.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 24 Jan 2017 06:08:14 +0000 (16:08 +1000)]
drm/nouveau/fifo/g84-: rename non-stall interrupt event
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sat, 5 Nov 2016 03:12:57 +0000 (13:12 +1000)]
drm/nouveau/fifo: tidy up channel creation event code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sat, 5 Nov 2016 04:14:20 +0000 (14:14 +1000)]
drm/nouveau/core: increase maximum number of notifies that a client can request
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres [Wed, 18 Jan 2017 21:49:21 +0000 (23:49 +0200)]
drm/nouveau/drm/nouveau/led: prevent a possible use-after-free
If the led class registration fails, we free drm->led but do not reset
it to NULL, which means that the suspend/resume/fini function will act
as if everything went well in init() and will likely crash the kernel.
This patch adds the missing drm->led = NULL.
Reported-by: Emmanuel Pescosta <emmanuelpescosta099@gmail.com>
Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Karol Herbst [Sat, 19 Nov 2016 23:43:15 +0000 (00:43 +0100)]
drm/nouveau/pci/g92: Enable changing pcie link speeds
Tested on a G92, seems to work. Confirmed by 8 mmiotraces.
Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Karol Herbst [Sat, 19 Nov 2016 23:43:14 +0000 (00:43 +0100)]
drm/nouveau/pci: Rename g94 to g92
Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 16 Jan 2017 03:44:11 +0000 (13:44 +1000)]
drm/nouveau/devinit/nv50: return error code if pll calculation fails
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ilia Mirkin [Thu, 5 Jan 2017 06:13:15 +0000 (01:13 -0500)]
drm/nouveau: fix bug id typo in comment
The issue was recorded in fd.o bug 27501, not 25701.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 23 May 2016 02:34:49 +0000 (12:34 +1000)]
drm/nouveau: size is u64 everywhere
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 17 May 2016 01:13:37 +0000 (11:13 +1000)]
drm/nouveau: s/mem/reg/ for struct ttm_mem_reg variables
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 May 2016 03:57:42 +0000 (13:57 +1000)]
drm/nouveau: allocate device object for every client
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 23 May 2016 01:25:17 +0000 (11:25 +1000)]
drm/nouveau: create userspace clients as subclients
This will allow the DRM to share memory objects between clients later
down the track.
For the moment, the only immediate benefit is less logic required to
handle suspend/resume.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 May 2016 03:36:34 +0000 (13:36 +1000)]
drm/nouveau: tidy up the client init/fini interfaces
These were a little insane.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 24 May 2016 07:29:55 +0000 (17:29 +1000)]
drm/nouveau: pass nvif_client to nouveau_gem_new() instead of drm_device
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 24 May 2016 07:26:48 +0000 (17:26 +1000)]
drm/nouveau: pass nvif_client to nouveau_bo_new() instead of drm_device
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 10 May 2016 02:42:26 +0000 (12:42 +1000)]
drm/nouveau/core/memory: distinguish between coherent/non-coherent targets
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sat, 3 Oct 2015 07:34:25 +0000 (17:34 +1000)]
drm/nouveau/core/mm: replace region list with next pointer
We never have any need for a double-linked list here, and as there's
generally a large number of these objects, replace it with a single-
linked list in order to save some memory.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sun, 22 May 2016 10:35:16 +0000 (20:35 +1000)]
drm/nouveau/core/client: allow creation of subclients
We want a supervisor client of NVKM (such as the DRM) to be able to
allow sharing of resources (such as memory objects) between clients.
To allow this, the supervisor creates all its clients as children of
itself, and will use an upcoming ioctl to permit sharing.
Currently it's not possible for indirect clients to use subclients.
Supporting this will require an additional field in the main ioctl.
This isn't important currently, but will need to be fixed for virt.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 25 May 2016 07:08:21 +0000 (17:08 +1000)]
drm/nouveau/core/client: pass notification callback to nvkm_client_new
Preparation for supporting subclients.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 25 May 2016 07:02:11 +0000 (17:02 +1000)]
drm/nouveau/core/client: destroy client objects over nvif
Preparation for supporting subclients, and also good for consistency.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sun, 22 May 2016 22:42:54 +0000 (08:42 +1000)]
drm/nouveau/core/client: use standard object dtor/init/fini paths
Preparation for supporting subclients, and also good for consistency.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 25 May 2016 22:43:00 +0000 (08:43 +1000)]
drm/nouveau/core/client: modify prefix on nvif structures, for consistency
Preparation for supporting subclients.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 25 May 2016 07:47:18 +0000 (17:47 +1000)]
drm/nouveau/core/object: pass more args in oclass
The fields were already in struct nvkm_oclass for some reason (probably
as an accidental left-over).
Preparation for supporting subclients.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 25 May 2016 07:33:36 +0000 (17:33 +1000)]
drm/nouveau/core/object: pass client directly to ioctl handlers
nvkm_object::client refers to the client that created the object, which,
is currently always the same as the ioctl caller.
Upcoming patches introduce the concept of subclients, where a parent is
able to access the object trees of its children, making the above no
longer true.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 17 May 2016 09:40:29 +0000 (19:40 +1000)]
drm/nouveau/dma: lookup objects with nvkm_object_search()
Custom code is no longer needed here.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 22 Dec 2016 05:23:04 +0000 (15:23 +1000)]
drm/nouveau/core/client: lookup client objects with nvkm_object_search()
Custom code is no longer needed here.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 22 Dec 2016 05:22:25 +0000 (15:22 +1000)]
drm/nouveau/core/object: support lookup of specific object types
It turns out we have a nice and convenient way of looking up a specific
object type already, by using the func pointer as a key.
This will be used to remove the separate object trees for each type we
need to be able to search for.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Geliang Tang [Tue, 20 Dec 2016 14:02:11 +0000 (22:02 +0800)]
drm/nouveau/dma: use rb_entry()
To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 3 Mar 2016 02:56:33 +0000 (12:56 +1000)]
replace BUG_ON(1) with BUG()
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 21 Dec 2016 02:46:50 +0000 (12:46 +1000)]
drm/nouveau/gr/nv50-mcp89: add defines for gr classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 22 Dec 2016 00:07:49 +0000 (10:07 +1000)]
drm/nouveau/gr/gf100-: fix ccache error logging
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 22 Dec 2016 00:07:27 +0000 (10:07 +1000)]
drm/nouveau/disp/g94: remove unused sor implementation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 22 Dec 2016 00:06:54 +0000 (10:06 +1000)]
drm/nouveau/fb/ram/gk104: remove unused best_clk variable
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:52 +0000 (17:02 +0900)]
drm/nouveau/secboot: clear halt interrupt after ACR is run
The halt interrupt must be cleared after ACR is run, otherwise the LS
PMU firmware will not be able to run.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:50 +0000 (17:02 +0900)]
drm/nouveau/secboot: add lazy-bootstrap flag
When the PMU firmware is present, the falcons it manages need to have
the lazy-bootstrap flag of their WPR header set so the ACR does not boot
them. Add support for this.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:49 +0000 (17:02 +0900)]
drm/nouveau/secboot: fix WPR descriptor generation
Generate the WPR descriptor closer to what RM does. In particular, set
the expected masks, and only set the ucode members on Tegra.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:48 +0000 (17:02 +0900)]
drm/nouveau/secboot: set default error value in error register
Set a default error value in the mailbox 0 register so we can catch
cases where the secure boot binary fails early without being able to
report anything.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:47 +0000 (17:02 +0900)]
drm/nouveau/secboot: add missing fields to BL structure
Since DMEM was initialized to zero, these fields went unnoticed. Add
them for safety.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:46 +0000 (17:02 +0900)]
drm/nouveau/secboot: safer zeroing of BL descriptors
Perform the zeroing of BL descriptors in the caller function instead of
trusting each generator will do it. This could avoid a few pulled hairs.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:45 +0000 (17:02 +0900)]
drm/nouveau/secboot: abstract LS firmware loading functions
The WPR and LSB headers, used to generate the LS blob, may have a
different layout and sizes depending on the driver version they come
from. Abstract them and confine their use to driver-specific code.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:44 +0000 (17:02 +0900)]
drm/nouveau/secboot: remove ls_ucode_mgr
This was used only locally to one function and can be replaced by ad-hoc
variables.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:43 +0000 (17:02 +0900)]
drm/nouveau/secboot: remove unneeded ls_ucode_img member
ucode_header is not used anywhere, so just get rid of it.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:42 +0000 (17:02 +0900)]
drm/nouveau/secboot: disable falcon interrupts when running blob
Make sure we are not disturbed by spurious interrupts, as we poll the
halt bit anyway.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:41 +0000 (17:02 +0900)]
drm/nouveau/secboot: split reset function
Split the reset function into more meaningful and reusable ones.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:40 +0000 (17:02 +0900)]
drm/nouveau/secboot: add LS flags to LS func structure
Add a flag that can be set when declaring how a LS firmware should be
loaded. This allows us to remove falcon-specific code in the loader.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:39 +0000 (17:02 +0900)]
drm/nouveau/secboot: reorganize into more files
Split the act of building the ACR blob from firmware files from the rest
of the (chip-dependent) secure boot logic. ACR logic is moved into
acr_rxxx.c files, where rxxx corresponds to the compatible release of
the NVIDIA driver. At the moment r352 and r361 are supported since
firmwares have been released for these versions. Some abstractions are
added on top of r352 so r361 can easily be implemented on top of it by
just overriding a few hooks.
This split makes it possible and easy to reuse the same ACR version on
different chips. It also hopefully makes the code much more readable as
the different secure boot logics are separated. As more chips and
firmware versions will be supported, this is a necessity to not get lost
in code that is already quite complex.
This is a big commit, but it essentially moves things around (and split
the nvkm_secboot structure into two, nvkm_secboot and nvkm_acr). Code
semantics should not be affected.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:38 +0000 (17:02 +0900)]
drm/nouveau/secboot: generate HS BL descriptor in hook
Use the HS hook to completely generate the HS BL descriptor, similarly
to what is done in the LS hook, instead of (arbitrarily) using the
acr_v1 format as an intermediate.
This allows us to make the bootloader descriptor structures private to
each implementation, resulting in a cleaner an more consistent design.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:37 +0000 (17:02 +0900)]
drm/nouveau/secboot: add low-secure firmware hooks
Secure firmwares provided by NVIDIA will follow the same overall
principle, but may slightly differ in format, or not use the same
bootloader descriptor even on the same chip. In order to handle
this as gracefully as possible, turn the LS firmware functions into
hooks that can be overloaded as needed.
The current hooks cover the external firmware loading as well as the
bootloader descriptor generation.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:36 +0000 (17:02 +0900)]
drm/nouveau/secboot: remove fixup_hs_desc hook
This hook can be removed if the function writing the HS
descriptor is aware of WPR settings. Let's do that as it allows us to
make the ACR descriptor structure private and save some code.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Wed, 14 Dec 2016 08:02:35 +0000 (17:02 +0900)]
drm/nouveau/secboot: rename init() hook to oneinit()
The init() hook is called by the subdev's oneinit(). Rename it
accordingly to avoid confusion about the lifetime of objects allocated
in it.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:31 +0000 (17:11 +0900)]
drm/nouveau/secboot: remove nvkm_secboot_start()
Since GR has moved to using the falcon library to start the falcons,
this function is not needed anymore.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:30 +0000 (17:11 +0900)]
drm/nouveau/gr/gf100: instantiate and reserve GR falcons
Create instances for the FECS and GPCCS falcons and use the init() and
fini() hooks to reserve them for as long as GR controls them.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:29 +0000 (17:11 +0900)]
drm/nouveau/gr/gf100: split gf100_gr_init_ctxctl()
gf100_gr_init_ctxctl() is basically two different functions (one for
use of internal firmware, the other for use of external firmware), but
its current layout makes it look more complex than it is. Split it to
better reflect that fact.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:28 +0000 (17:11 +0900)]
drm/nouveau/gr: add fini() hook
Add a fini() hook to the GR engine. This will be used by gf100+ to
properly release the FECS and GPCCS falcons.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:27 +0000 (17:11 +0900)]
drm/nouveau/secboot: use falcon library
Use the falcon library functions in secure boot. This removes a lot of
code and makes the secure boot flow easier to understand as no register
is directly accessed.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:26 +0000 (17:11 +0900)]
drm/nouveau/secboot: fix functions definitions
These functions should use the nvkm_secboot_falcon enum. Fix this.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:25 +0000 (17:11 +0900)]
drm/nouveau/gm20b: add dummy PMU device
Add a dummy PMU device so the PMU falcon is instanciated and can be used
by secure boot.
We could reuse gk20a's implementation here, but it would fight with
secboot over PMU falcon's ownership and secboot will reset the PMU,
preventing it from operating afterwards. Proper handout between secboot
and pmu is coming along with the actual gm20b PMU implementation, so
use this as a temporary solution.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:24 +0000 (17:11 +0900)]
drm/nouveau/pmu/gk20a: use falcon library functions
Use the falcon library functions where relevant.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:23 +0000 (17:11 +0900)]
drm/nouveau/pmu/gk20a: simplify code a bit
Some functions always succeed - change their return type to void and
remove the error-handling code in their caller.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:22 +0000 (17:11 +0900)]
drm/nouveau/pmu/gk20a: use nvkm_pmu_ctor()
Use the PMU constructor so that all base members (in particular the
falcon instance) are initialized properly.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:20 +0000 (17:11 +0900)]
drm/nouveau/pmu: instanciate the falcon in PMU device
Have an instance of nvkm_falcon in the PMU structure, ready to be used
by other subdevs (i.e. secboot).
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:21 +0000 (17:11 +0900)]
drm/nouveau/pmu: add nvkm_pmu_ctor() function
Add a PMU constructor so implementations that extend the nvkm_pmu
structure can have all base members properly initialized.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:19 +0000 (17:11 +0900)]
drm/nouveau/core: add falcon library functions
Falcon processors are used in various places of GPU chips. Although there
exist different versions of the falcon, and some variants exist, the
base set of actions performed on them is the same, which results in lots
of duplicated code.
This patch consolidates the current nvkm_falcon structure and extends it
with the following features:
* Ability for an engine to obtain and later release a given falcon,
* Abstractions for basic operations (IMEM/DMEM access, start, etc)
* Abstractions for secure operations if a falcon is secure
Abstractions make it easy to e.g. start a falcon, without having to care
about its details. For instance, falcons in secure mode need to be
started by writing to a different register.
Right now the abstractions variants only cover secure vs. non-secure
falcon, but more will come as e.g. SEC2 support is added.
This is still a WIP as other functions previously done by
engine/falcon.c need to be reimplemented. However this first step allows
to keep things simple and to discuss basic design.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:18 +0000 (17:11 +0900)]
drm/nouveau/mc: add nvkm_mc_enabled() function
Add a function that allows us to query whether a given subdev is
currently enabled or not.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Alexandre Courbot [Tue, 13 Dec 2016 08:11:17 +0000 (17:11 +0900)]
drm/nouveau/core: constify nv*_printk macros
Constify the local variables declared in these macros so we can pass
const pointers to them.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Dave Airlie [Fri, 17 Feb 2017 02:38:46 +0000 (12:38 +1000)]
Revert "drm: Resurrect atomic rmfb code, v3"
This reverts commit
1592364de3912dad264262f4bcc61552984c9523.
This apparantly causes some regressions so pull it out for now.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 17 Feb 2017 02:04:09 +0000 (12:04 +1000)]
Merge tag 'omapdrm-4.11-fixes' of git://git./linux/kernel/git/tomba/linux into drm-next
omapdrm fixes for v4.11
Fix regressions:
- Planes might have been left enabled
- Scaling checks did not use the new config
Also limit downscaling decimation to prevent HW underflows.
* tag 'omapdrm-4.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats
drm/omapdrm: Move commit_modeset_enables() before commit_planes()
Revert "drm: omapdrm: Let the DRM core skip plane commit on inactive CRTCs"