aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-01-29drm/nouveau/acr: return error when registering LSF if ACR not supportedBen Skeggs1-1/+5
This fixes an oops on TU11x GPUs where SEC2 attempts to register its falcon, and triggers a NULL-pointer deref because ACR isn't yet supported. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-29drm/nouveau/disp/gv100-: not all channel types support reporting error codesBen Skeggs1-6/+17
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-29drm/nouveau/disp/nv50-: prevent oops when no channel method map providedBen Skeggs1-0/+2
The implementations for most channel types contains a map of methods to priv registers in order to provide debugging info when a disp exception has been raised. This info is missing from the implementation of PIO channels as they're rather simplistic already, however, if an exception is raised by one of them, we'd end up triggering a NULL-pointer deref. Not ideal... Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=206299 Signed-off-by: Ben Skeggs <[email protected]>
2020-01-29drm/nouveau: support synchronous pushbuf submissionBen Skeggs2-1/+11
This is useful for debugging GPU hangs. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-29drm/nouveau: signal pending fences when channel has been killedBen Skeggs3-1/+12
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-29drm/nouveau: reject attempts to submit to dead channelsBen Skeggs1-0/+2
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-29drm/nouveau: zero vma pointer even if we only unreference it rather than freeBen Skeggs1-1/+1
I'm not sure this affects anything, but best be safe. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-29drm/nouveau: Add HD-audio component notifier supportTakashi Iwai3-0/+119
This patch adds the support for the notification of HD-audio hotplug via the already existing drm_audio_component framework. This allows us more reliable hotplug notification and ELD transfer without accessing HD-audio bus; it's more efficient, and more importantly, it works without waking up the runtime PM. The implementation is rather simplistic: nouveau driver provides the get_eld ops for HD-audio, and it notifies the audio hotplug via pin_eld_notify callback upon each nv50_audio_enable() and _disable() call. As the HD-audio pin assignment seems corresponding to the CRTC, the crtc->index number is passed directly as the zero-based port number. The bind and unbind callbacks handle the device-link so that it assures the PM call order. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Lyude Paul <[email protected]> Cc: Jaroslav Kysela <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2020-01-23drm/nouveau: fix build error without CONFIG_IOMMU_APIChen Zhou1-0/+1
If CONFIG_IOMMU_API is n, build fails: vers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c:37:9: error: implicit declaration of function dev_iommu_fwspec_get; did you mean iommu_fwspec_free? [-Werror=implicit-function-declaration] spec = dev_iommu_fwspec_get(device->dev); ^~~~~~~~~~~~~~~~~~~~ iommu_fwspec_free drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c:37:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion] spec = dev_iommu_fwspec_get(device->dev); ^ drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c:39:17: error: struct iommu_fwspec has no member named ids u32 sid = spec->ids[0] & 0xffff; Seletc IOMMU_API under config DRM_NOUVEAU to fix this. Reported-by: Hulk Robot <[email protected]> Signed-off-by: Chen Zhou <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2020-01-23drm/nouveau/kms/nv04: remove set but not used variable 'width'YueHaibing1-2/+1
drivers/gpu/drm/nouveau/dispnv04/arb.c: In function nv04_calc_arb: drivers/gpu/drm/nouveau/dispnv04/arb.c:56:21: warning: variable width set but not used [-Wunused-but-set-variable] 'width' is never used, so remove it. Reported-by: Hulk Robot <[email protected]> Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2020-01-23drm/nouveau/kms/nv50: remove set but not unused variable 'nv_connector'YueHaibing1-2/+0
drivers/gpu/drm/nouveau/dispnv50/disp.c: In function nv50_pior_enable: drivers/gpu/drm/nouveau/dispnv50/disp.c:1672:28: warning: variable nv_connector set but not used [-Wunused-but-set-variable] commit ac2d9275f371 ("drm/nouveau/kms/nv50-: Store the bpc we're using in nv50_head_atom") left behind this. Reported-by: Hulk Robot <[email protected]> Signed-off-by: YueHaibing <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2020-01-23drm/nouveau/mmu: fix comptag memory leakBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-23drm/nouveau/gr/gp10b: Use gp100_grctx and gp100_gr_zbcThierry Reding3-3/+4
gp10b doesn't have all the registers that gp102_gr_zbc wants to access, which causes IBUS MMIO faults to occur. Avoid this by using the gp100 variants of grctx and gr_zbc. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2020-01-23drm/nouveau/pmu/gm20b,gp10b: Fix Falcon bootstrappingThierry Reding2-4/+14
The low-level Falcon bootstrapping callbacks are expected to return 0 on success or a negative error code on failure. However, the implementation on Tegra returns the ID or mask of the Falcons that were bootstrapped on success, thus breaking the calling code, which treats this as failure. Fix this by making sure we only return 0 or a negative error code, just like the code for discrete GPUs does. Fixes: 86ce2a71539c ("drm/nouveau/flcn/cmdq: move command generation to subdevs") Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/gr/tu10x: initial supportBen Skeggs12-11/+313
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/acr/tu10x: initial supportBen Skeggs6-0/+229
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/core: remove previous versioned fw loaderBen Skeggs4-32/+16
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/secboot: removeBen Skeggs33-4189/+1
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/acr: implement new subdev to replace "secure boot"Ben Skeggs30-47/+2207
ACR is responsible for managing the firmware for LS (Low Secure) falcons, this was previously handled in the driver by SECBOOT. This rewrite started from some test code that attempted to replicate the procedure RM uses in order to debug early Turing ACR firmwares that were provided by NVIDIA for development. Compared with SECBOOT, the code is structured into more individual steps, with the aim of making the process easier to follow/debug, whilst making it possible to support newer firmware versions that may have a different binary format or API interface. The HS (High Secure) binary(s) are now booted earlier in device init, to match the behaviour of RM, whereas SECBOOT would delay this until we try to boot the first LS falcon. There's also additional debugging features available, with the intention of making it easier to solve issues during FW/HW bring-up in the future. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/fb/gp102-: unlock VPR as part of FB initBen Skeggs10-121/+226
We perform memory allocations long before we hit the code in SECBOOT that would unlock the VPR, which could potentially result in memory allocation within the locked region. Run the scrubber binary right after VRAM init to ensure we don't. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/core/memory: add macros to read/write blocks from objectsBen Skeggs1-0/+16
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/secboot: move code to boot LS falcons to subdevsBen Skeggs24-517/+77
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/msgq: rename msgq-related nvkm_msgqueue_queue to ↵Ben Skeggs4-77/+71
nvkm_falcon_msgq Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/msgq: pass explicit message queue pointer to recv()Ben Skeggs9-49/+4
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/msgq: move handling of init message to subdevsBen Skeggs19-265/+202
When the PMU/SEC2 LS FWs have booted, they'll send a message to the host with various information, including the configuration of message/command queues that are available. Move the handling for this to the relevant subdevs. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/msgq: drop nvkm_msgqueue argument to functionsBen Skeggs1-26/+19
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/msgq: switch to falcon queue printk macrosBen Skeggs1-8/+6
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/msgq: simplify msg_queue_pop() error handlingBen Skeggs1-18/+7
We always want at least requested size, make anything less a more direct error condition. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/msgq: remove error handling for msg_queue_open(), it can't failBen Skeggs1-7/+2
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/cmdq: move command generation to subdevsBen Skeggs16-276/+300
This moves the code to generate commands for the ACR unit of the PMU/SEC2 LS firmwares to those subdevs. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/cmdq: rename cmdq-related nvkm_msqqueue_queue to ↵Ben Skeggs2-41/+38
nvkm_falcon_cmdq Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/cmdq: implement a more explicit send() interfaceBen Skeggs5-79/+40
Takes the command queue pointer directly instead of requiring a function to lookup based on an queue type, as well as an explicit timeout value. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/cmdq: drop nvkm_msgqueue argument to functionsBen Skeggs1-22/+18
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/cmdq: switch to falcon queue printk macrosBen Skeggs1-5/+5
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/cmdq: cmd_queue_close always commits, simplify itBen Skeggs1-9/+3
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/cmdq: cmd_queue_push can't fail, remove error handling for itBen Skeggs1-15/+3
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/cmdq: split the condition for queue readiness vs pmu acr ↵Ben Skeggs7-15/+31
readiness This is to allow for proper separation of the LS interface code from the queue handling code. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/qmgr: rename remaining nvkm_msgqueue bits to nvkm_falcon_qmgrBen Skeggs4-30/+32
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/qmgr: support syncronous command submission from common codeBen Skeggs6-34/+31
Functions implementing FW commands had to implement this themselves, let's move that to common code and plumb the return code from callbacks through. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/qmgr: allow arbtrary priv + return code for callbacksBen Skeggs7-38/+65
Code to interface with LS firmwares is being moved to the subdevs where it belongs, rather than living in the common falcon code. Arbitrary private data passed to callbacks is to allow for something other than struct nvkm_msgqueue to be passed into the callback (like the pointer to the subdev itself, for example), and the return code will be used where we'd like to detect failure from synchronous messages. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/qmgr: move sequence tracking from nvkm_msgqueue to ↵Ben Skeggs6-53/+55
nvkm_falcon_qmgr Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/msgq: explicitly create message queue from subdevsBen Skeggs9-56/+64
Code to interface with LS firmwares is being moved to the subdevs where it belongs, rather than living in the common falcon code. This is an incremental step towards that goal. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/cmdq: explicitly create command queue(s) from subdevsBen Skeggs11-21/+95
Code to interface with LS firmwares is being moved to the subdevs where it belongs, rather than living in the common falcon code. This is an incremental step towards that goal. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn/qmgr: explicitly create queue manager from subdevsBen Skeggs8-3/+52
Code to interface with LS firmwares is being moved to the subdevs where it belongs, rather than living in the common falcon code. This is an incremental step towards that goal. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn: split msgqueue into multiple piecesBen Skeggs6-410/+474
To make things clearer while modifying the interfaces, split msgqueue into Queue Manager, Command Queue, and Message Queue. There should be no code changes here, these will be done incrementally. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn: add printk macrosBen Skeggs1-0/+9
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn: reset sec2/gsp falcons harderBen Skeggs4-2/+13
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn: specify queue register offsets from subdevBen Skeggs7-26/+29
Also fixes the values for Turing, even though we don't use it yet. Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn: specify debug/production register offset from subdevBen Skeggs6-26/+8
Signed-off-by: Ben Skeggs <[email protected]>
2020-01-15drm/nouveau/flcn: specify EMEM address from subdevBen Skeggs5-8/+9
Signed-off-by: Ben Skeggs <[email protected]>