Anson Jacob [Fri, 19 Feb 2021 00:42:57 +0000 (19:42 -0500)]
Revert "drm/amd/display: reuse current context instead of recreating one"
This reverts commit
8866a67ab86cc0812e65c04f1ef02bcc41e24d68.
Reason for revert: This breaks hotplug of HDMI on some systems,
resulting in a blank screen. Caused general hangs on boot/hotplugs.
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1487
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1492
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=211649
Signed-off-by: Anson Jacob <Anson.Jacob@amd.com>
Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Nathan Chancellor [Thu, 18 Feb 2021 22:48:50 +0000 (15:48 -0700)]
drm/amd/pm/swsmu: Avoid using structure_size uninitialized in smu_cmn_init_soft_gpu_metrics
Clang warns:
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:764:2: warning:
variable 'structure_size' is used uninitialized whenever switch default
is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:770:23: note:
uninitialized use occurs here
memset(header, 0xFF, structure_size);
^~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:753:25: note:
initialize the variable 'structure_size' to silence this warning
uint16_t structure_size;
^
= 0
1 warning generated.
Return in the default case, as the size of the header will not be known.
Fixes:
de4b7cd8cb87 ("drm/amd/pm/swsmu: unify the init soft gpu metrics function")
Link: https://github.com/ClangBuiltLinux/linux/issues/1304
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 19 Feb 2021 03:54:29 +0000 (13:54 +1000)]
Merge tag 'drm-intel-next-fixes-2021-02-18' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
- Restrict DRM_I915_DEBUG to developer builds (Chris)
- Fix return and error codes (Dan)
- Suspend/Resume fix (Chris)
- Disable atomics in L3 for gen9 (Chris)
- Flush before changing register state (Chris)
- Fix for GLK's HDMI (Ville)
- Fix ILK+'s plane strides with Xtiling (Ville)
- Correct surface base address for renderclear (Chris)
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/YC7uQY1kt6w0tRp+@intel.com
Dave Airlie [Fri, 19 Feb 2021 03:50:47 +0000 (13:50 +1000)]
Merge tag 'amd-drm-next-5.12-2021-02-18' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-5.12-2021-02-18:
amdgpu:
- Prefer Bhawan's unused variable fix
- Fixes for high priority queues on gfx8,9
- swSMU fixes for sienna cichlid
- swSMU fixes for renoir
- mmhub client id fixes for arcturus
- SMUIO fixes for navi family
- swSMU fixes for vangogh
- GPU reset cleanup
- Display fixes
- GFX harvesting fix for sienna cichlid
- Fix reference clock on Renoir
- Misc fixes and cleanups
amdkfd:
- Fix for unique id query
- Fix recursive lock warnings
radeon:
- Remove confusing VCE messages on Oland
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210218221531.3870-1-alexander.deucher@amd.com
Alex Deucher [Tue, 16 Feb 2021 15:57:00 +0000 (10:57 -0500)]
drm/amdgpu: Set reference clock to 100Mhz on Renoir (v2)
Fixes the rlc reference clock used for GPU timestamps.
Value is 100Mhz. Confirmed with hardware team.
v2: reword commit message.
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1480
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Alex Deucher [Tue, 16 Feb 2021 14:02:36 +0000 (09:02 -0500)]
drm/radeon: OLAND boards don't have VCE
Disable it on those boards. No functional change, this just
removes the message about VCE failing to initialize.
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=197327
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Felix Kuehling [Thu, 4 Feb 2021 05:11:17 +0000 (00:11 -0500)]
drm/amdkfd: Fix recursive lock warnings
memalloc_nofs_save/restore are no longer sufficient to prevent recursive
lock warnings when holding locks that can be taken in MMU notifiers. Use
memalloc_noreclaim_save/restore instead.
Fixes:
f920e413ff9c ("mm: track mmu notifiers in fs_reclaim_acquire/release")
CC: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 5.10.x
Jan Kokemüller [Thu, 11 Feb 2021 18:28:43 +0000 (19:28 +0100)]
drm/amd/display: Add FPU wrappers to dcn21_validate_bandwidth()
dcn21_validate_bandwidth() calls functions that use floating point math.
On my machine this sometimes results in simd exceptions when there are
other FPU users such as KVM virtual machines running. The screen freezes
completely in this case.
Wrapping the function with DC_FP_START()/DC_FP_END() seems to solve the
problem. This mirrors the approach used for dcn20_validate_bandwidth.
Tested on a AMD Ryzen 7 PRO 4750U (Renoir).
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=206987
Signed-off-by: Jan Kokemüller <jan.kokemueller@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Gustavo A. R. Silva [Wed, 10 Feb 2021 21:23:30 +0000 (15:23 -0600)]
drm/amd/display: Fix potential integer overflow
Fix potential integer overflow by casting actual_calculated_clock_100hz
to u64, in order to give the compiler complete information about the
proper arithmetic to use.
Notice that such variable is used in a context that expects
an expression of type u64 (64 bits, unsigned) and the following
expression is currently being evaluated using 32-bit arithmetic:
actual_calculated_clock_100hz * post_divider
Fixes:
7a03fdf628af ("drm/amd/display: fix 64bit division issue on 32bit OS")
Addresses-Coverity-ID: 1501691 ("Unintentional integer overflow")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Nirmoy Das [Wed, 10 Feb 2021 17:11:04 +0000 (18:11 +0100)]
drm/amdgpu/display: remove hdcp_srm sysfs on device removal
Fixes:
9037246bb2da5 ("drm/amd/display: Add sysfs interface for set/get srm")
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Marek Olšák [Thu, 4 Feb 2021 07:46:20 +0000 (02:46 -0500)]
drm/amdgpu: fix CGTS_TCC_DISABLE register offset on gfx10.3
This fixes incorrect TCC harvesting info reported to userspace.
The impact was a very very tiny performance degradation (unnecessary
GL2 cache flushes).
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Chris Wilson [Wed, 10 Feb 2021 12:27:28 +0000 (12:27 +0000)]
drm/i915/gt: Correct surface base address for renderclear
The surface_state_base is an offset into the batch, so we need to pass
the correct batch address for STATE_BASE_ADDRESS.
Fixes:
47f8253d2b89 ("drm/i915/gen7: Clear all EU/L3 residual contexts")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Prathap Kumar Valsan <prathap.kumar.valsan@intel.com>
Cc: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: <stable@vger.kernel.org> # v5.7+
Link: https://patchwork.freedesktop.org/patch/msgid/20210210122728.20097-1-chris@chris-wilson.co.uk
(cherry picked from commit
1914911f4aa08ddc05bae71d3516419463e0c567)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Ville Syrjälä [Tue, 9 Feb 2021 02:19:16 +0000 (04:19 +0200)]
drm/i915: Disallow plane x+w>stride on ilk+ with X-tiling
ilk+ planes get notably unhappy when the plane x+w exceeds
the stride. This wasn't a problem previously because we
always aligned SURF to the closest tile boundary so the
x offset never got particularly large. But now with async
flips we have to align to 256KiB instead and thus this
becomes a real issue.
On ilk/snb/ivb it looks like the accesses just wrap
early to the next tile row when scanout goes past the
SURF+n*stride boundary, hsw/bdw suffer more heavily and
start to underrun constantly. i965/g4x appear to be immune.
vlv/chv I've not yet checked.
Let's borrow another trick from the skl+ code and search
backwards for a better SURF offset in the hopes of getting the
x offset below the limit. IIRC when I ran into a similar issue
on skl years ago it was causing the hardware to fall over
pretty hard as well.
And let's be consistent and include i965/g4x in the check
as well, just in case I just got super lucky somehow when
I wasn't able to reproduce the issue. Not that it really
matters since we still use 4k SURF alignment for i965/g4x
anyway.
Fixes:
6ede6b0616b2 ("drm/i915: Implement async flips for vlv/chv")
Fixes:
4bb18054adc4 ("drm/i915: Implement async flip for ilk/snb")
Fixes:
2a636e240c77 ("drm/i915: Implement async flip for ivb/hsw")
Fixes:
cda195f13abd ("drm/i915: Implement async flips for bdw")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210209021918.16234-1-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit
59fb8218c8e5001f854e7d5fdb5fb135cba58102)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
[Rodrigo also exported some functions from intel_display.c during backport]
Dave Airlie [Fri, 12 Feb 2021 00:57:54 +0000 (10:57 +1000)]
Merge tag 'drm-misc-next-fixes-2021-02-11' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next-fixes cherry picked from drm-misc-next for v5.12:
- Assorted small fixes.
- Disable and remove gma3600 support.
- Fix CEC for vc4/hdmi.
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/dac2ae30-c5d9-4222-39e2-f64067310491@linux.intel.com
Dave Airlie [Fri, 12 Feb 2021 00:15:42 +0000 (10:15 +1000)]
Merge branch '00.00-inst' of git://github.com/skeggsb/linux into drm-next
Ben wrote:
The problem is that GA100 added enough new engine types and instances
that we would have begun to overflow various u64 bitfields used to
track the connections between various engines.
Rather than addressing subdevs by a unique index, we give
each subdev a type and instance id, and replace the use of bitfields
tied to subdev index with other methods.
Notable changes:
- replace subdev index with subdev type + instance id
- engines that turn out to be fused-off (can't detect until later in
init) no longer leave dangling pointers around
- new subdev/instance additions no longer need to be made in multiple places
- ampere engine topology is now being parsed
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Ben Skeggs <skeggsb@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/CACAvsv4c_Y923ng0rT1y23wktHHyjEMsusb0=9Z7kQaVbxyPyQ@mail.gmail.com
Ben Skeggs [Mon, 8 Feb 2021 06:01:44 +0000 (16:01 +1000)]
drm/nouveau/top/ga100: initial support
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Ben Skeggs [Mon, 8 Feb 2021 06:40:06 +0000 (16:40 +1000)]
drm/nouveau/top: add ioctrl/nvjpg
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Ben Skeggs [Sat, 16 Jan 2021 06:17:21 +0000 (16:17 +1000)]
drm/nouveau/privring: rename from ibus
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Ben Skeggs [Mon, 8 Feb 2021 01:30:21 +0000 (11:30 +1000)]
drm/nouveau/nvkm: remove nvkm_subdev.index
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Ben Skeggs [Sun, 6 Dec 2020 11:07:14 +0000 (21:07 +1000)]
drm/nouveau/nvkm: determine subdev id/order from layout
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Ben Skeggs [Thu, 4 Feb 2021 06:56:07 +0000 (16:56 +1000)]
drm/nouveau/vic: switch to instanced constructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Ben Skeggs [Fri, 4 Dec 2020 06:13:27 +0000 (16:13 +1000)]
drm/nouveau/sw: switch to instanced constructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Ben Skeggs [Fri, 4 Dec 2020 06:11:29 +0000 (16:11 +1000)]
drm/nouveau/sec2: switch to instanced constructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Ben Skeggs [Wed, 3 Feb 2021 22:40:52 +0000 (08:40 +1000)]
drm/nouveau/sec: switch to instanced constructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Ben Skeggs [Fri, 4 Dec 2020 06:07:49 +0000 (16:07 +1000)]
drm/nouveau/pm: switch to instanced constructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Ben Skeggs [Fri, 4 Dec 2020 06:04:23 +0000 (16:04 +1000)]
drm/nouveau/nvenc: switch to instanced constructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Ben Skeggs [Fri, 4 Dec 2020 06:01:06 +0000 (16:01 +1000)]
drm/nouveau/nvdec: switch to instanced constructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>