platform/kernel/linux-starfive.git
3 years agodrm/nouveau/msvld: switch to instanced constructor
Ben Skeggs [Wed, 3 Feb 2021 22:40:18 +0000 (08:40 +1000)]
drm/nouveau/msvld: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/msppp: switch to instanced constructor
Ben Skeggs [Wed, 3 Feb 2021 22:39:28 +0000 (08:39 +1000)]
drm/nouveau/msppp: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/mspdec: switch to instanced constructor
Ben Skeggs [Wed, 3 Feb 2021 22:38:32 +0000 (08:38 +1000)]
drm/nouveau/mspdec: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/msenc: switch to instanced constructor
Ben Skeggs [Wed, 3 Feb 2021 22:37:29 +0000 (08:37 +1000)]
drm/nouveau/msenc: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/mpeg: switch to instanced constructor
Ben Skeggs [Wed, 3 Feb 2021 22:36:45 +0000 (08:36 +1000)]
drm/nouveau/mpeg: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/me: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 05:41:33 +0000 (15:41 +1000)]
drm/nouveau/me: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/ifb: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 05:40:42 +0000 (15:40 +1000)]
drm/nouveau/ifb: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/gr: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 05:38:44 +0000 (15:38 +1000)]
drm/nouveau/gr: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo/gk104-: remove use of subdev index in runlist topology info
Ben Skeggs [Sun, 7 Feb 2021 21:49:10 +0000 (07:49 +1000)]
drm/nouveau/fifo/gk104-: remove use of subdev index in runlist topology info

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo/gk104-: switch dev_top fault handling to type+inst
Ben Skeggs [Mon, 8 Feb 2021 01:23:56 +0000 (11:23 +1000)]
drm/nouveau/fifo/gk104-: switch dev_top fault handling to type+inst

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo/gf100-: switch static mmu fault id list to type+inst
Ben Skeggs [Sat, 6 Feb 2021 11:47:44 +0000 (21:47 +1000)]
drm/nouveau/fifo/gf100-: switch static mmu fault id list to type+inst

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo/gf100: use fifo engine id for engine recovery mask
Ben Skeggs [Sat, 6 Feb 2021 08:40:48 +0000 (18:40 +1000)]
drm/nouveau/fifo/gf100: use fifo engine id for engine recovery mask

Instead of subdev index.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo: use type+inst to determine context pointer offsets
Ben Skeggs [Sat, 6 Feb 2021 11:39:41 +0000 (21:39 +1000)]
drm/nouveau/fifo: use type+inst to determine context pointer offsets

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo: turn chan subdev mask into engine mask
Ben Skeggs [Tue, 9 Feb 2021 03:01:01 +0000 (13:01 +1000)]
drm/nouveau/fifo: turn chan subdev mask into engine mask

This data is used to know which engines/classes are reachable on a given
channel's runlist, and needs to be replaced with something that doesn't
rely on subdev index.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo: add id_engine hook
Ben Skeggs [Tue, 9 Feb 2021 03:06:35 +0000 (13:06 +1000)]
drm/nouveau/fifo: add id_engine hook

Will be used by common code in subsequent commits to lookup driver
engine state from HW engine ID.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo: index backend engctx by engine id
Ben Skeggs [Sat, 6 Feb 2021 09:33:36 +0000 (19:33 +1000)]
drm/nouveau/fifo: index backend engctx by engine id

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo: index base engctx by engine id
Ben Skeggs [Sat, 6 Feb 2021 09:27:08 +0000 (19:27 +1000)]
drm/nouveau/fifo: index base engctx by engine id

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo: add engine_id hook
Ben Skeggs [Sat, 6 Feb 2021 08:41:07 +0000 (18:41 +1000)]
drm/nouveau/fifo: add engine_id hook

Will be used by common code in subsequent commits to replace arrays
indexed by subdev index.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 05:29:16 +0000 (15:29 +1000)]
drm/nouveau/fifo: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/dma: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 05:21:35 +0000 (15:21 +1000)]
drm/nouveau/dma: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/disp: switch to instanced constructor
Ben Skeggs [Wed, 3 Feb 2021 22:35:57 +0000 (08:35 +1000)]
drm/nouveau/disp: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/cipher: switch to instanced constructor
Ben Skeggs [Wed, 3 Feb 2021 22:34:38 +0000 (08:34 +1000)]
drm/nouveau/cipher: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/ce: make use of nvkm_subdev.inst
Ben Skeggs [Wed, 3 Feb 2021 22:29:43 +0000 (08:29 +1000)]
drm/nouveau/ce: make use of nvkm_subdev.inst

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/ce: switch to instanced constructor
Ben Skeggs [Wed, 3 Feb 2021 22:30:30 +0000 (08:30 +1000)]
drm/nouveau/ce: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/falcon: use split type+inst when looking up PRI addr
Ben Skeggs [Sat, 6 Feb 2021 01:06:50 +0000 (11:06 +1000)]
drm/nouveau/falcon: use split type+inst when looking up PRI addr

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/bsp,vp: switch to instanced constructor
Ben Skeggs [Wed, 3 Feb 2021 22:33:53 +0000 (08:33 +1000)]
drm/nouveau/bsp,vp: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/volt: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:58:05 +0000 (12:58 +1000)]
drm/nouveau/volt: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/top: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:53:38 +0000 (12:53 +1000)]
drm/nouveau/top: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/tmr: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:51:53 +0000 (12:51 +1000)]
drm/nouveau/tmr: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/therm/gk104: use split subdev type+inst in cg engine lists
Ben Skeggs [Thu, 4 Feb 2021 04:26:38 +0000 (14:26 +1000)]
drm/nouveau/therm/gk104: use split subdev type+inst in cg engine lists

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/therm: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:49:36 +0000 (12:49 +1000)]
drm/nouveau/therm: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/pmu: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:45:01 +0000 (12:45 +1000)]
drm/nouveau/pmu: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/pci: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:40:10 +0000 (12:40 +1000)]
drm/nouveau/pci: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/mxm: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:36:38 +0000 (12:36 +1000)]
drm/nouveau/mxm: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/mmu: index engref by subdev type
Ben Skeggs [Sat, 6 Feb 2021 11:43:22 +0000 (21:43 +1000)]
drm/nouveau/mmu: index engref by subdev type

None of the chipsets we use this on have instanced engines, so this is fine.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/mmu: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:34:27 +0000 (12:34 +1000)]
drm/nouveau/mmu: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/mc: use split type+inst when handling dev_top interrupts
Ben Skeggs [Sat, 6 Feb 2021 00:54:34 +0000 (10:54 +1000)]
drm/nouveau/mc: use split type+inst when handling dev_top interrupts

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/mc: use split type+inst in interrupt masking API
Ben Skeggs [Sat, 6 Feb 2021 00:47:48 +0000 (10:47 +1000)]
drm/nouveau/mc: use split type+inst in interrupt masking API

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/mc: use split type+inst in device reset APIs
Ben Skeggs [Sat, 6 Feb 2021 00:44:15 +0000 (10:44 +1000)]
drm/nouveau/mc: use split type+inst in device reset APIs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/mc: lookup subdev interrupt handlers with split type+inst
Ben Skeggs [Thu, 4 Feb 2021 07:59:28 +0000 (17:59 +1000)]
drm/nouveau/mc: lookup subdev interrupt handlers with split type+inst

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/mc: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:28:41 +0000 (12:28 +1000)]
drm/nouveau/mc: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/top: expose parsed device info more directly
Ben Skeggs [Sun, 6 Dec 2020 22:54:34 +0000 (08:54 +1000)]
drm/nouveau/top: expose parsed device info more directly

This is easier to deal with in some situations than the existing accessor
functions.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/top: store device type and instance separately
Ben Skeggs [Sun, 6 Dec 2020 22:52:41 +0000 (08:52 +1000)]
drm/nouveau/top: store device type and instance separately

MC/FIFO will need this info as they're switched over.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/ltc: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:24:17 +0000 (12:24 +1000)]
drm/nouveau/ltc: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/instmem: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:20:41 +0000 (12:20 +1000)]
drm/nouveau/instmem: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/iccsense: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:17:03 +0000 (12:17 +1000)]
drm/nouveau/iccsense: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/ibus: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:05:51 +0000 (12:05 +1000)]
drm/nouveau/ibus: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/i2c: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 02:03:13 +0000 (12:03 +1000)]
drm/nouveau/i2c: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/gsp: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 01:23:38 +0000 (11:23 +1000)]
drm/nouveau/gsp: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/gpio: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 01:21:38 +0000 (11:21 +1000)]
drm/nouveau/gpio: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fuse: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 01:18:45 +0000 (11:18 +1000)]
drm/nouveau/fuse: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fb: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 01:16:21 +0000 (11:16 +1000)]
drm/nouveau/fb: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fault: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 01:07:41 +0000 (11:07 +1000)]
drm/nouveau/fault: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/devinit: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 01:04:41 +0000 (11:04 +1000)]
drm/nouveau/devinit: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/clk: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 00:58:58 +0000 (10:58 +1000)]
drm/nouveau/clk: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/bus: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 00:52:28 +0000 (10:52 +1000)]
drm/nouveau/bus: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/bios: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 00:49:00 +0000 (10:49 +1000)]
drm/nouveau/bios: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/bar: switch to instanced constructor
Ben Skeggs [Fri, 4 Dec 2020 00:46:32 +0000 (10:46 +1000)]
drm/nouveau/bar: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/acr: switch to instanced constructor
Ben Skeggs [Tue, 1 Dec 2020 22:35:30 +0000 (08:35 +1000)]
drm/nouveau/acr: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/nvkm: add macros for subdev layout
Ben Skeggs [Sun, 6 Dec 2020 02:14:13 +0000 (12:14 +1000)]
drm/nouveau/nvkm: add macros for subdev layout

Rather than having to add new engines / engine instances to multiple places,
define everything in include/nvkm/core/layout.h and use macros to generate
the required plumbing.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/device: pass instance id when looking up a subdev/engine
Ben Skeggs [Thu, 4 Feb 2021 04:28:06 +0000 (14:28 +1000)]
drm/nouveau/device: pass instance id when looking up a subdev/engine

This switches to using the subdev list for lookup, and otherwise should
be a no-op aside from switching the function signatures.

Callers will be transitioned to split type+inst individually.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/subdev: track type+instance separately
Ben Skeggs [Sat, 25 Jul 2020 06:40:07 +0000 (16:40 +1000)]
drm/nouveau/subdev: track type+instance separately

We use subdev id bitmasks (as a u64) in a number of places, and GA100 adds
enough new engine instances that we run out of bits.  We could alias IDs of
engines that no longer exist, but it's cleaner for a number of reasons to
just split the subdev index into a subdev type, and instance ID instead.

Just a lot more painful to do.

This magics up the values for old-style subdev constructors, and provides a
way to incrementally transition each subdev to the new style.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/subdev: store full subdev name in struct
Ben Skeggs [Sat, 25 Jul 2020 05:19:46 +0000 (15:19 +1000)]
drm/nouveau/subdev: store full subdev name in struct

Much easier to store this to avoid having to reconstruct a string for a
specific subdev, taking into account whether it's instanced or not.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/subdev: store subdevs in list
Ben Skeggs [Tue, 1 Dec 2020 10:22:40 +0000 (20:22 +1000)]
drm/nouveau/subdev: store subdevs in list

This is somewhat nicer to read.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/subdev: remove nvkm_subdev.mutex
Ben Skeggs [Wed, 2 Dec 2020 05:52:46 +0000 (15:52 +1000)]
drm/nouveau/subdev: remove nvkm_subdev.mutex

There's not really any nice way to assign the lock classes when we split
subdev indices into type+inst, and saves a few bytes in the structs when
a subdev has no need for it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/perfmon: use private spinlock to control exclusive access to perfmon
Ben Skeggs [Thu, 3 Dec 2020 00:46:18 +0000 (10:46 +1000)]
drm/nouveau/perfmon: use private spinlock to control exclusive access to perfmon

nvkm_subdev.mutex is going away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fifo: private mutex
Ben Skeggs [Thu, 3 Dec 2020 00:42:43 +0000 (10:42 +1000)]
drm/nouveau/fifo: private mutex

nvkm_subdev.mutex is going away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/disp: use private spinlock to control exclusive access to disp
Ben Skeggs [Wed, 2 Dec 2020 22:39:42 +0000 (08:39 +1000)]
drm/nouveau/disp: use private spinlock to control exclusive access to disp

nvkm_subdev.mutex is going away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/pmu: serialise send() with private mutex
Ben Skeggs [Wed, 2 Dec 2020 22:34:07 +0000 (08:34 +1000)]
drm/nouveau/pmu: serialise send() with private mutex

nvkm_subdev.mutex is going away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/mmu: serialise mmu invalidations with private mutex
Ben Skeggs [Wed, 2 Dec 2020 22:32:31 +0000 (08:32 +1000)]
drm/nouveau/mmu: serialise mmu invalidations with private mutex

nvkm_subdev.mutex is going away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/ltc: serialise cbc operations with private mutex
Ben Skeggs [Wed, 2 Dec 2020 06:43:49 +0000 (16:43 +1000)]
drm/nouveau/ltc: serialise cbc operations with private mutex

nvkm_subdev.mutex is going away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/instmem: protect mm/lru with private mutex
Ben Skeggs [Wed, 2 Dec 2020 06:40:28 +0000 (16:40 +1000)]
drm/nouveau/instmem: protect mm/lru with private mutex

nvkm_subdev.mutex is going away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fb: protect vram mm with private mutex
Ben Skeggs [Wed, 2 Dec 2020 06:31:23 +0000 (16:31 +1000)]
drm/nouveau/fb: protect vram mm with private mutex

nvkm_subdev.mutex is going away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/fb: protect comptags with private mutex
Ben Skeggs [Wed, 2 Dec 2020 06:24:20 +0000 (16:24 +1000)]
drm/nouveau/fb: protect comptags with private mutex

nvkm_subdev.mutex is going away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/nouveau/engine: use refcount_t + private mutex
Ben Skeggs [Wed, 2 Dec 2020 06:09:25 +0000 (16:09 +1000)]
drm/nouveau/engine: use refcount_t + private mutex

nvkm_subdev.mutex is going away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
3 years agodrm/amd/display: fix unused variable warning
Arnd Bergmann [Mon, 25 Jan 2021 12:48:43 +0000 (13:48 +0100)]
drm/amd/display: fix unused variable warning

After all users of the 'dm' warnings got hidden in an #ifdef,
the compiler started warning about it being unused:

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5380:33: error: unused variable 'dm' [-Werror,-Wunused-variable]

Add another such #ifdef.

Fixes: 98ab5f3513f9 ("drm/amd/display: Fix deadlock during gpu reset v3")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210125124849.102037-1-arnd@kernel.org
3 years agoMerge tag 'amd-drm-next-5.12-2021-02-03' of https://gitlab.freedesktop.org/agd5f...
Dave Airlie [Thu, 4 Feb 2021 23:38:19 +0000 (09:38 +1000)]
Merge tag 'amd-drm-next-5.12-2021-02-03' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-5.12-2021-02-03:

amdgpu:
- Display fixes and cleanups
- Vangogh fixes
- Fix possible race when there are timeouts on two rings
- SR-IOV fixes
- Add missing license
- DCE 10/12 bpc fixes
- Display MALL fixes
- Fix SMU user preference settings persistence
- Fix retry in gem allocate
- Add new PCI DID
- Fix for manual fan speed control on cards where it was problematic
- Fix regression in pinning GTT
- Misc display fixes
- Misc code cleanups

amdkfd:
- Fix config handling
- Fix regression in buffer free

From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210204045717.3823-1-alexander.deucher@amd.com
Signed-off-by: Dave Airlie <airlied@redhat.com>
3 years agoMerge tag 'mediatek-drm-next-5.12' of https://git.kernel.org/pub/scm/linux/kernel...
Dave Airlie [Thu, 4 Feb 2021 23:25:20 +0000 (09:25 +1000)]
Merge tag 'mediatek-drm-next-5.12' of https://git./linux/kernel/git/chunkuang.hu/linux into drm-next

Mediatek DRM Next for Linux 5.12

1. Decouple Mediatek DRM sub driver
2. Share mtk mutex driver for both DRM and MDP
3. Add support for SoC MT8183

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210204151750.7550-1-chunkuang.hu@kernel.org
3 years agodrm/mediatek: Add matrix_bits private data for ccorr
Yongqiang Niu [Tue, 2 Feb 2021 08:12:35 +0000 (16:12 +0800)]
drm/mediatek: Add matrix_bits private data for ccorr

Add matrix_bits and coeffs_precision to ccorr private data:
- matrix bits of mt8183 is 10
- matrix bits of mt8192 is 11

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Fix ccorr size config
Yongqiang Niu [Tue, 2 Feb 2021 08:12:34 +0000 (16:12 +0800)]
drm/mediatek: Fix ccorr size config

Fix setting to follow hardware datasheet. The original error setting
affects mt8192 display.

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Separate ccorr module
Yongqiang Niu [Tue, 2 Feb 2021 08:12:33 +0000 (16:12 +0800)]
drm/mediatek: Separate ccorr module

ccorr ctm matrix bits will be different in mt8192.

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Enable dither function
Yongqiang Niu [Sun, 31 Jan 2021 05:10:58 +0000 (13:10 +0800)]
drm/mediatek: Enable dither function

Enable dither function to improve the display quality.

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Enable OVL_LAYER_SMI_ID_EN for multi-layer usecase
Yongqiang Niu [Fri, 29 Jan 2021 07:34:32 +0000 (15:34 +0800)]
drm/mediatek: Enable OVL_LAYER_SMI_ID_EN for multi-layer usecase

Enable OVL_LAYER_SMI_ID_EN for multi-layer usecase, without this patch,
ovl will hang up when more than 1 layer enabled.

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Add support for SoC MT8183
Yongqiang Niu [Fri, 29 Jan 2021 09:22:09 +0000 (17:22 +0800)]
drm/mediatek: Add support for SoC MT8183

1. Add ovl private data
2. Add rdma private data
3. Add gamma privte data
4. Add main and external path module for crtc create

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Add has_dither private data for gamma
Yongqiang Niu [Fri, 29 Jan 2021 09:22:06 +0000 (17:22 +0800)]
drm/mediatek: Add has_dither private data for gamma

Not all SoC has dither function in gamma module.
Add private data to control this function setting.

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Separate gamma module
Yongqiang Niu [Fri, 29 Jan 2021 09:22:05 +0000 (17:22 +0800)]
drm/mediatek: Separate gamma module

mt8183 gamma module will different with mt8173,
so separate gamma for adding private data.

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Add mtk_dither_set_common() function
Hsin-Yi Wang [Fri, 29 Jan 2021 09:22:04 +0000 (17:22 +0800)]
drm/mediatek: Add mtk_dither_set_common() function

Current implementation of mtk_dither_set() cast dev data to
struct mtk_ddp_comp_dev. But other devices with different dev data
would also call this function.

Separate necessary parameters out so other device components (dither,
gamma) can call this function.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agosoc / drm: mediatek: Move mtk mutex driver to soc folder
CK Hu [Tue, 21 Jul 2020 07:46:06 +0000 (15:46 +0800)]
soc / drm: mediatek: Move mtk mutex driver to soc folder

mtk mutex is used by DRM and MDP driver, and its function is SoC-specific,
so move it to soc folder.

Signed-off-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agodrm/mediatek: Automatically search unclaimed mtk mutex in mtk_mutex_get()
CK Hu [Tue, 21 Jul 2020 03:30:11 +0000 (11:30 +0800)]
drm/mediatek: Automatically search unclaimed mtk mutex in mtk_mutex_get()

Moving mutex resource management from client driver to  mutex driver
could prevent client drivers negotiating for resource management.

Signed-off-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Change disp/ddp term to mutex in mtk mutex driver
CK Hu [Tue, 21 Jul 2020 03:24:36 +0000 (11:24 +0800)]
drm/mediatek: Change disp/ddp term to mutex in mtk mutex driver

mtk mutex is used by both drm and mdp driver, so change disp/ddp term to
mutex to show that it's a common driver for drm and mdp.

Signed-off-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Rename file mtk_drm_ddp to mtk_mutex
CK Hu [Tue, 21 Jul 2020 02:47:30 +0000 (10:47 +0800)]
drm/mediatek: Rename file mtk_drm_ddp to mtk_mutex

After mmsys routing function is moved out of mtk_drm_ddp.c, mtk_drm_ddp.c
has only mtk mutex function, so rename it to match the function in it.

Signed-off-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Remove redundant file including
CK Hu [Tue, 21 Jul 2020 01:31:19 +0000 (09:31 +0800)]
drm/mediatek: Remove redundant file including

Those file includings are useless, so remove them.

Signed-off-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Add fifo_size into rdma private data
Yongqiang Niu [Thu, 7 Jan 2021 03:11:15 +0000 (11:11 +0800)]
drm/mediatek: Add fifo_size into rdma private data

Get the fifo size from device tree
because each rdma in the same SoC may have different fifo size

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Fix aal size config
Yongqiang Niu [Mon, 11 Jan 2021 07:43:47 +0000 (15:43 +0800)]
drm/mediatek: Fix aal size config

The orginal setting is not correct, fix it to follow hardware data sheet.
If keep this error setting, mt8173/mt8183 display ok
but mt8192 display abnormal.

Fixes: 0664d1392c26 ("drm/mediatek: Add AAL engine basic function")

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodt-bindings: mediatek: add description for postmask
Yongqiang Niu [Mon, 11 Jan 2021 07:43:37 +0000 (15:43 +0800)]
dt-bindings: mediatek: add description for postmask

add description for postmask
postmask is used control round corner for display frame

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: mtk_dpi: Create connector for bridges
Hsin-Yi Wang [Thu, 3 Dec 2020 08:24:45 +0000 (16:24 +0800)]
drm/mediatek: mtk_dpi: Create connector for bridges

Similar to commit a9d9fea74be2
("drm/mediatek: mtk_dsi: Create connector for bridges"):

Use the drm_bridge_connector helper to create a connector for pipelines
that use drm_bridge. This allows splitting connector operations across
multiple bridges when necessary, instead of having the last bridge in
the chain creating the connector and handling all connector operations
internally.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodt-bindings: mediatek: add rdma-fifo-size description for mt8183 display
Yongqiang Niu [Thu, 7 Jan 2021 03:11:11 +0000 (11:11 +0800)]
dt-bindings: mediatek: add rdma-fifo-size description for mt8183 display

rdma fifo size may be different even in same SOC, add this
property to the corresponding rdma

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agodrm/mediatek: Check if fb is null
Yongqiang Niu [Mon, 11 Jan 2021 07:43:44 +0000 (15:43 +0800)]
drm/mediatek: Check if fb is null

It's possible that state->base.fb is null. Add a check before access its
format.

Fixes: b6b1bb980ec4 ("drm/mediatek: Turn off Alpha bit when plane format has no alpha")
Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
3 years agoMerge tag 'drm-intel-next-2021-01-29' of git://anongit.freedesktop.org/drm/drm-intel...
Dave Airlie [Thu, 4 Feb 2021 02:57:18 +0000 (12:57 +1000)]
Merge tag 'drm-intel-next-2021-01-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

- WARN if plane src coords are too big (Ville)
- Prevent double YUV range correction on HDR planes (Andres)
- DP MST related Fixes (Sean, Imre)
- More clean-up around DRAM detection code (Jose)
- Actually async flips enable for all ilk+ platforms (Ville)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210129225328.GA1041349@intel.com
3 years agoMerge tag 'drm/tegra/for-5.12-rc1' of ssh://git.freedesktop.org/git/tegra/linux into...
Dave Airlie [Thu, 4 Feb 2021 02:31:16 +0000 (12:31 +1000)]
Merge tag 'drm/tegra/for-5.12-rc1' of ssh://git.freedesktop.org/git/tegra/linux into drm-next

drm/tegra: Changes for v5.12-rc1

Adds support for newer firmware image versions of the Video Image
Composer (VIC) and adds a comment clarifying the use of the STREAMID
registers. Fixes a couple of issues with display and gr2d on older
Tegra SoCs such as Tegra114, as well as a runtime PM reference leak.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Thierry Reding <thierry.reding@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210129193807.3653456-1-thierry.reding@gmail.com