Jacek Lawrynowicz
fd7726e759
accel/ivpu: Fix deadlock in context_xa
...
ivpu_device->context_xa is locked both in kernel thread and IRQ context.
It requires XA_FLAGS_LOCK_IRQ flag to be passed during initialization
otherwise the lock could be acquired from a thread and interrupted by
an IRQ that locks it for the second time causing the deadlock.
This deadlock was reported by lockdep and observed in internal tests.
Fixes: 35b137630f ("accel/ivpu: Introduce a new DRM driver for Intel VPU")
Cc: <stable@vger.kernel.org > # v6.3+
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240402104929.941186-9-jacek.lawrynowicz@linux.intel.com
2024-04-08 10:55:01 +02:00
Jacek Lawrynowicz
c52c35e5b4
accel/ivpu: Return max freq for DRM_IVPU_PARAM_CORE_CLOCK_RATE
...
DRM_IVPU_PARAM_CORE_CLOCK_RATE returns current NPU frequency which
could be 0 if device was sleeping. This value isn't really useful to
the user space, so return max freq instead which can be used to estimate
NPU performance.
Fixes: c39dc15191 ("accel/ivpu: Read clock rate only if device is up")
Cc: <stable@vger.kernel.org > # v6.7
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240402104929.941186-7-jacek.lawrynowicz@linux.intel.com
2024-04-08 10:54:21 +02:00
Jacek Lawrynowicz
e3caadf1f9
accel/ivpu: Remove d3hot_after_power_off WA
...
Always enter D3hot after entering D0i3 an all platforms.
This minimizes power usage.
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240402104929.941186-3-jacek.lawrynowicz@linux.intel.com
2024-04-08 10:53:20 +02:00
Daniel Vetter
f112b68f27
Merge v6.8-rc6 into drm-next
...
Thomas Zimmermann asked to backmerge -rc6 for drm-misc branches,
there's a few same-area-changed conflicts (xe and amdgpu mostly) that
are getting a bit too annoying.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
2024-02-26 11:41:07 +01:00
Jacek Lawrynowicz
b7f9b9b67e
accel/ivpu: Rename VPU to NPU in message strings
...
VPU was renamed to NPU but due to large overhead of renaming
all the sources only user visible messages are being updated.
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240214081305.290108-9-jacek.lawrynowicz@linux.intel.com
2024-02-19 10:52:35 +01:00
Wachowski, Karol
f32d59677a
accel/ivpu: Use lazy allocation for doorbell IDs
...
Reserve/allocate and free doorbells for command queues when needed
using xarray. This allows to avoid reserving a doorbell for
a contexts that never issues a job.
Signed-off-by: Wachowski, Karol <karol.wachowski@intel.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240214081305.290108-6-jacek.lawrynowicz@linux.intel.com
2024-02-19 10:52:35 +01:00
Jacek Lawrynowicz
a7f31091dd
accel/ivpu: Disable d3hot_delay on all NPU generations
...
NPU does not require this delay regardless of the generation.
All generations are integrated into the SOC.
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240126122804.2169129-4-jacek.lawrynowicz@linux.intel.com
2024-02-06 13:36:33 +01:00
Jacek Lawrynowicz
f1cc6aceec
accel/ivpu: Fix dev open/close races with unbind
...
- Add context_list_lock to synchronize user context addition/removal
- Use drm_dev_enter() to prevent unbinding the device during ivpu_open()
and vpu address allocation
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Wachowski, Karol <karol.wachowski@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240122120945.1150728-2-jacek.lawrynowicz@linux.intel.com
2024-01-25 10:16:56 +01:00
Wachowski, Karol
b246271d25
accel/ivpu: Deprecate DRM_IVPU_PARAM_CONTEXT_PRIORITY param
...
DRM_IVPU_PARAM_CONTEXT_PRIORITY has been deprecated because it
has been replaced with DRM_IVPU_JOB_PRIORITY levels set with
submit IOCTL and was unused anyway.
Signed-off-by: Wachowski, Karol <karol.wachowski@intel.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240115134434.493839-10-jacek.lawrynowicz@linux.intel.com
2024-01-22 10:31:54 +01:00
Wachowski, Karol
2a20b857dd
accel/ivpu: Add diagnostic messages when VPU fails to boot or suspend
...
Make boot/suspend failure debugging easier by dumping FW logs and error
registers.
Signed-off-by: Wachowski, Karol <karol.wachowski@intel.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240115134434.493839-5-jacek.lawrynowicz@linux.intel.com
2024-01-22 10:28:40 +01:00
Wachowski, Karol
30cf36bb04
accel/ivpu: Dump MMU events in case of VPU boot timeout
...
Add ivpu_mmu_evtq_dump() function that dumps existing MMU events from
MMU event queue. Call this function if VPU boot failed.
Previously MMU events were only checked in interrupt handler, but if VPU
failed to boot due to MMU faults, those faults were missed because of
interrupts not yet being enabled. This will allow checking potential
fault reason of VPU not booting.
Signed-off-by: Wachowski, Karol <karol.wachowski@intel.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240115134434.493839-2-jacek.lawrynowicz@linux.intel.com
2024-01-22 10:27:37 +01:00
Jacek Lawrynowicz
3b434a3445
accel/ivpu: Use threaded IRQ to handle JOB done messages
...
Remove job_done thread and replace it with generic callback based
mechanism.
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231113170252.758137-6-jacek.lawrynowicz@linux.intel.com
2023-11-16 13:41:49 +01:00
Maxime Ripard
3bf3e21c15
Merge drm/drm-next into drm-misc-next
...
Let's kickstart the v6.8 release cycle.
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2023-11-15 10:56:44 +01:00
Jacek Lawrynowicz
8d88e4cdce
accel/ivpu: Use GEM shmem helper for all buffers
...
Use struct drm_gem_shmem_object as a base for struct ivpu_bo.
This cuts by 50% the buffer management code.
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231031073156.1301669-5-stanislaw.gruszka@linux.intel.com
2023-11-08 16:27:43 +01:00
Jacek Lawrynowicz
48aea7f2a2
accel/ivpu: Fix locking in ivpu_bo_remove_all_bos_from_context()
...
ivpu_bo_remove_all_bos_from_context() could race with ivpu_bo_free()
when prime buffer was closed after vpu device was closed.
Move the bo_list from context to vdev and use a dedicated lock to
sync it. This list is not modified when BO is added/removed from
a context.
Also rename ivpu_bo_free_vpu_addr() to ivpu_bo_unbind() because this
function does more then just free vpu_addr.
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231031073156.1301669-3-stanislaw.gruszka@linux.intel.com
2023-11-08 16:27:35 +01:00
Stanislaw Gruszka
57c7e3e480
accel/ivpu: Stop job_done_thread on suspend
...
Stop job_done thread when going to suspend. Use kthread_park() instead
of kthread_stop() to avoid memory allocation and potential failure
on resume.
Use separate function as thread wake up condition. Use spin lock to assure
rx_msg_list is properly protected against concurrent access. This avoid
race condition when the rx_msg_list list is modified and read in
ivpu_ipc_recive() at the same time.
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231028155936.1183342-4-stanislaw.gruszka@linux.intel.com
2023-10-31 16:14:17 +01:00
Stanislaw Gruszka
a06eb9be49
accel/ivpu: Assure device is off if power up sequence fail
...
We should not leave device half enabled if there is failure somewhere
it power up sequence. Fix device init and resume paths.
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231028155936.1183342-3-stanislaw.gruszka@linux.intel.com
2023-10-31 15:53:19 +01:00
Dave Airlie
915b6d034b
Merge tag 'drm-misc-next-2023-10-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
...
drm-misc-next for v6.7-rc1:
drm-misc-next-2023-10-19 + following:
UAPI Changes:
Cross-subsystem Changes:
- Convert fbdev drivers to use fbdev i/o mem helpers.
Core Changes:
- Use cross-references for macros in docs.
- Make drm_client_buffer_addb use addfb2.
- Add NV20 and NV30 YUV formats.
- Documentation updates for create_dumb ioctl.
- CI fixes.
- Allow variable number of run-queues in scheduler.
Driver Changes:
- Rename drm/ast constants.
- Make ili9882t its own driver.
- Assorted fixes in ivpu, vc4, bridge/synopsis, amdgpu.
- Add planar formats to rockchip.
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/3d92fae8-9b1b-4165-9ca8-5fda11ee146b@linux.intel.com
2023-10-31 10:47:50 +10:00
Karol Wachowski
8b5cec3c2c
accel/ivpu: Change test_mode module param to bitmask
...
Change meaning of test_mode module parameter from integer value
to bitmask allowing setting different test features with corresponding
bits.
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231028133415.1169975-7-stanislaw.gruszka@linux.intel.com
2023-10-30 11:06:10 +01:00
Andrzej Kacprowski
61ab485f0e
accel/ivpu: Add support for VPU_JOB_FLAGS_NULL_SUBMISSION_MASK
...
Add test_mode = 3 that add VPU_JOB_FLAGS_NULL_SUBMISSION_MASK
flag to the job send to the VPU device. Then the VPU will process
the job but won't execute commands (except the command to signal
the fence).
This can be used to estimate job processing overhead in the host
software and VPU firmware.
Unlike the null hardware mode, the null submission mode will
still work even if UMD uses VPU fences to track job completion.
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231028133415.1169975-6-stanislaw.gruszka@linux.intel.com
2023-10-30 11:06:10 +01:00
Stanislaw Gruszka
9692b1dcef
accel/ivpu: Remove unneeded drm_driver declaration
...
Cleanup drm_driver declaration leftover.
Reviewed-by: Krystian Pradzynski <krystian.pradzynski@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231028133415.1169975-3-stanislaw.gruszka@linux.intel.com
2023-10-30 11:06:08 +01:00
Dave Airlie
7cd62eab9b
BackMerge tag 'v6.6-rc7' into drm-next
...
This is needed to add the msm pr which is based on a higher base.
Signed-off-by: Dave Airlie <airlied@redhat.com >
2023-10-23 18:20:06 +10:00
Karol Wachowski
c39dc15191
accel/ivpu: Read clock rate only if device is up
...
Do not unnecessarily wake up device to read clock rate.
Return 0 as clk_rate if device is suspended.
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231020104501.697763-4-stanislaw.gruszka@linux.intel.com
2023-10-23 08:59:20 +02:00
Jacek Lawrynowicz
828d63042a
accel/ivpu: Don't enter d0i3 during FLR
...
Avoid HW bug on some platforms where we enter D0i3 state
and CPU is in low power states (C8 or above).
Fixes: 852be13f3b ("accel/ivpu: Add PM support")
Cc: stable@vger.kernel.org
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003064213.1527327-1-stanislaw.gruszka@linux.intel.com
2023-10-19 06:48:05 +02:00
Stanislaw Gruszka
d776f654d0
accel/ivpu: Compile ivpu_debugfs.c conditionally
...
Only compile ivpu_debugfs.c file with CONFIG_DEBUG_FS.
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230907072610.433497-2-stanislaw.gruszka@linux.intel.com
2023-09-27 13:11:51 +02:00
Stanislaw Gruszka
c78199a78f
accel/ivpu: Update debugfs to latest changes in DRM
...
Use new drm debugfs helpers. This is needed after changes from
commit 78346ebf9f94 ("drm/debugfs: drop debugfs_init() for the render
and accel node v2").
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230907072610.433497-1-stanislaw.gruszka@linux.intel.com
2023-09-27 13:11:44 +02:00
Jacek Lawrynowicz
0026525550
accel/ivpu: Don't flood dmesg with VPU ready message
...
Use ivpu_dbg() to print the VPU ready message so it doesn't pollute
the dmesg.
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230925121137.872158-3-stanislaw.gruszka@linux.intel.com
2023-09-27 07:40:17 +02:00
Stanislaw Gruszka
9c1b2429c1
accel/ivpu: Add Arrow Lake pci id
...
Enable VPU on Arrow Lake CPUs.
Reviewed-by: Krystian Pradzynski <krystian.pradzynski@linux.intel.com >
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230922132206.812817-1-stanislaw.gruszka@linux.intel.com
2023-09-25 08:49:28 +02:00
Jacek Lawrynowicz
53d98420f5
accel/ivpu: Move ivpu_fw_load() to ivpu_fw_init()
...
ivpu_fw_load() doesn't have to be called separately in ivpu_dev_init().
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-8-stanislaw.gruszka@linux.intel.com
Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-7-stanislaw.gruszka@linux.intel.com
2023-09-04 11:01:49 +02:00
Karol Wachowski
34d03f2a17
accel/ivpu: Initialize context with SSID = 1
...
Context with SSID = 1 is reserved and accesses on that context happen
only when context is uninitialized on the VPU side. Such access triggers
MMU fault (0xa) "Invalid CD Fetch", which doesn't contain any useful
information besides context ID.
This commit will change that state, now (0x10) "Translation fault" will
be triggered and accessed address will shown in the log.
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-7-stanislaw.gruszka@linux.intel.com
2023-09-04 11:01:26 +02:00
Stanislaw Gruszka
3f68b03ae6
accel/ivpu: Make ivpu_pm_init() void
...
ivpu_pm_init() does not return any error, make it void.
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-4-stanislaw.gruszka@linux.intel.com
2023-09-04 11:01:26 +02:00
Jacek Lawrynowicz
0a9cd7924e
accel/ivpu: Remove duplicated error messages
...
Reduce the number of error messages per single failure in
ivpu_dev_init() and ivpu_probe().
Most error messages are already printed by functions called
from ivpu_dev_init(). Add missed error prints in ivpu_ipc_init()
and ivpu_mmu_context_init().
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-3-stanislaw.gruszka@linux.intel.com
2023-09-04 11:01:26 +02:00
Stanislaw Gruszka
79cdc56c4a
accel/ivpu: Add initial support for VPU 4
...
Add support VPU 4 - new generation of VPU IP with various
hardware design improvements. From driver point of view, it differs
in register set, initialization process and MMU memory ranges.
Co-developed-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com >
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com >
Co-developed-by: Krystian Pradzynski <krystian.pradzynski@linux.intel.com >
Signed-off-by: Krystian Pradzynski <krystian.pradzynski@linux.intel.com >
Co-developed-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230731161258.2987564-7-stanislaw.gruszka@linux.intel.com
2023-08-09 13:55:21 +02:00
Karol Wachowski
162f17b2d9
accel/ivpu: Refactor memory ranges logic
...
Add new dma range and change naming convention for virtual address
memory ranges managed by KMD.
New available ranges are named as follows:
* global range - global context accessible by FW
* aliased range - user context accessible by FW
* dma range - user context accessible by DMA
* shave range - user context accessible by shaves
* global shave range - global context accessible by shave nn
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230731161258.2987564-6-stanislaw.gruszka@linux.intel.com
2023-08-09 13:52:15 +02:00
Stanislaw Gruszka
aa5f04d2e5
accel/ivpu: Extend get_param ioctl to identify capabilities
...
Add DRM_IVPU_PARAM_CAPABILITIES parameters to get_param ioctl to query
driver capabilities. For now use it for identify metric streamer and
new dma memory range features. Currently upstream version of intel_vpu
does not have those, they will be added it the future.
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230731161258.2987564-5-stanislaw.gruszka@linux.intel.com
2023-08-09 13:48:56 +02:00
Jacek Lawrynowicz
51d66a7b7d
accel/ivpu: Use generation based function and registers names
...
Given that VPU generation can be used by multiple platforms, driver should
use VPU IP generation names instead of a platform.
Change naming for functions and registries.
Use 37XX format, where:
3 - major VPU IP generation version
7 - minor VPU IP generation version
XX - postfix indicating this is an architecture and not marketing name
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230731161258.2987564-3-stanislaw.gruszka@linux.intel.com
2023-08-09 13:42:16 +02:00
Stanislaw Gruszka
edde4caec1
accel/ivpu: Initial debugfs support
...
Add initial debugfs support. Provide below functionality:
- print buffer objects
- print latest boot mode
- trigger vpu engine reset
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230524074847.866711-2-stanislaw.gruszka@linux.intel.com
2023-07-07 09:33:13 +02:00
Thomas Zimmermann
71e801b9b4
drm: Clear fd/handle callbacks in struct drm_driver
...
Clear all assignments of struct drm_driver's fd/handle callbacks to
drm_gem_prime_fd_to_handle() and drm_gem_prime_handle_to_fd(). These
functions are called by default. Add a TODO item to convert vmwgfx
to the defaults as well.
v2:
* remove TODO item (Zack)
* also update amdgpu's amdgpu_partition_driver
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Simon Ser <contact@emersion.fr >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Jeffrey Hugo <quic_jhugo@quicinc.com > # qaic
Link: https://patchwork.freedesktop.org/patch/msgid/20230620080252.16368-3-tzimmermann@suse.de
2023-06-26 11:08:41 +02:00
Thomas Zimmermann
0adec22702
drm: Remove struct drm_driver.gem_prime_mmap
...
All drivers initialize this field with drm_gem_prime_mmap(). Call
the function directly and remove the field. Simplifies the code and
resolves a long-standing TODO item.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230613150441.17720-3-tzimmermann@suse.de
2023-06-19 13:56:40 +02:00
Karol Wachowski
95d440188d
accel/ivpu: Mark 64 kB contiguous areas as contiguous in PTEs
...
Whenever KMD maps region larger than 64kB that is both aligned and
contiguous, set contiguous bit (52) in MMU PTE descriptor for each page
in that region.
This allows to treat 16 contiguous pages as one and reduce
number of MMU page walks required which results in lower latency.
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230518131605.650622-6-stanislaw.gruszka@linux.intel.com
2023-06-08 07:54:00 +02:00
Karol Wachowski
a4172d6cf0
accel/ivpu: Make DMA bit mask HW specific
...
Future devices will have different dma bit mask, make it hw specific.
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230518131605.650622-4-stanislaw.gruszka@linux.intel.com
2023-06-08 07:53:40 +02:00
Linus Torvalds
c8cc58e289
Merge tag 'drm-next-2023-04-24' of git://anongit.freedesktop.org/drm/drm
...
Pull drm updates from Dave Airlie:
"There is a new Qualcomm accel driver for their QAIC, dma-fence got a
deadline feature added, lots of refactoring around fbdev emulation,
and the usual pre-release hw enablements from AMD and Intel and fixes
everywhere.
New drivers:
- add QAIC acceleration driver
dma-buf:
- constify kobj_type structs
- Reject prime DMA-Buf attachment if get_sg_table is missing.
fbdev:
- cmdline parser fixes
- implement fbdev emulation for GEM DMA drivers
- always use shadow buffer in fbdev emulation helpers
dma-fence:
- add deadline hint to fences
- signal private stub fence
core:
- improve DisplayID 2.0 and EDID parsing
- add gem eviction function + callback
- prep to convert shmem helper to GEM resv lock
- move suballocator from radeon/amdgpu to core for Xe
- HPD polling fixes
- Documentation improvements
- Add atomic enable_plane callback
- use tgid instead of pid for client tracking
- DP: Add SDP Error Detection Configuration Register
- Add prime import/export to vram-helper
- use pci aperture helpers in more drivers
panel:
- Radxa 8/10HD support
- Samsung AMD495QA01 support
- Elida KD50T048A
- Sony TD4353
- Novatek NT36523
- STARRY 2081101QFH032011-53G
- B133UAN01.0
- AUO NE135FBM-N41
i915:
- More MTL enabling
- fix s/r problems with MEI/PXP
- Implement fb_dirty for PSR,FBC,DRRS fixes
- Fix eDP+DSI dual panel systems
- Fix issue #6333 : "list_add corruption" and full system lockup from
performance monitoring
- Don't use stolen memory or BAR for ring buffers on LLC platforms
- Make sure DSM size has correct 1MiB granularity on Gen12+
- Whitelist COMMON_SLICE_CHICKEN3 for UMD access on Gen12+
- Add engine TLB invalidation for Meteorlake
- Fix GSC races on driver load/unload on Meteorlake+
- Make kobj_type structures constant
- Move fd_install after last use of fence
- wm/vblank refactoring
- display code refactoring
- Create GSC submission targeting HDCP and PXP usages on MTL+
- Enable HDCP2.x via GSC CS
- Fix context runtime accounting on sysfs fdinfo for heavy workloads
- Use i915 instead of dev_priv insied the file_priv structure
- Replace fake flex-array with flexible-array member
amdgpu:
- Make kobj structures const
- Generalize dmabuf import to work with KFD
- Add capped/uncapped workload handling for supported APUs
- Expose additional memory stats via fdinfo
- Register vga_switcheroo for apple-gmux
- Initial NBIO7.9, GC 9.4.3, GFXHUB 1.2, MMHUB 1.8 support
- Initial DC FAM infrastructure
- Link DC backlight to connector device rather than PCI device
- Add sysfs nodes for secondary VCN clocks
amdkfd:
- Make kobj structures const
- Support for exporting buffers via dmabuf
- Multi-VMA page migration fixes
- initial GC 9.4.3 support
radeon:
- iMac fix
- convert to client based fbdev emulation
habanalabs:
- Add opcodes to the CS ioctl to allow user to stall/resume specific
engines inside Gaudi2.
- INFO ioctl the amount of device memory that the driver and f/w
reserve for themselves.
- INFO ioctl a bit-mask of the available rotator engines
- INFO ioctl the register's address of the f/w that should be used to
trigger interrupts
- INFO ioctl two new opcodes to fetch information on h/w and f/w
events
- Enable graceful reset mechanism for compute-reset.
- Align to the latest firmware specs.
- Enforce the release order of the compute device and dma-buf.
msm:
- UBWC decoder programming rework
- SM8550, SM8450 bindings update
- uapi C++ fix
- a3xx and a4xx devfreq support
- GPU and GEM updates to avoid allocations which could trigger
reclaim (shrinker) in fence signaling path
- dma-fence deadline hint support and wait-boost
- a640/650 speed bin support
cirrus:
- convert to regular atomic helpers
- add damage clipping
mediatek:
- 10-bit overlay support
- mt8195 support
- Only trigger DRM HPD events if bridge is attached
- Change the aux retries times when receiving AUX_DEFER
rockchip:
- add 4K support
vc4:
- use drm_gem_objects
virtio:
- allow KMS support to be disabled
- add damage clipping
vmwgfx:
- buffer object lifetime fixes
exynos:
- move MIPI DSI driver to drm bridge for iMX sharing
- use kernel fbdev emulation
panfrost:
- add support for mali MT81xx devices
- add speed binning support
lima:
- add usage stats
tegra:
- fbdev client conversion
vkms:
- Add primary plane positioning support"
* tag 'drm-next-2023-04-24' of git://anongit.freedesktop.org/drm/drm: (1495 commits)
drm/i915/dp_mst: Fix active port PLL selection for secondary MST streams
drm/exynos: Implement fbdev emulation as in-kernel client
drm/exynos: Initialize fbdev DRM client
drm/exynos: Remove fb_helper from struct exynos_drm_private
drm/exynos: Remove struct exynos_drm_fbdev
drm/exynos: Remove exynos_gem from struct exynos_drm_fbdev
drm/i915: Fix memory leaks in i915 selftests
drm/i915: Make intel_get_crtc_new_encoder() less oopsy
drm/i915/gt: Avoid out-of-bounds access when loading HuC
drm/amdgpu: add some basic elements for multiple XCD case
drm/amdgpu: move vmhub out of amdgpu_ring_funcs (v4)
Revert "drm/amdgpu: enable ras for mp0 v13_0_10 on SRIOV"
drm/amdgpu: add common ip block for GC 9.4.3
drm/amd/display: Add logging when DP link training Clock recovery is Successful
drm/amdgpu: add common early init support for GC 9.4.3
drm/amdgpu: switch to v9_4_3 gfx_funcs callbacks for GC 9.4.3
drm/amd/display: Add logging when setting DP sink power state fails
drm/amdkfd: Add gfx_target_version for GC 9.4.3
drm/amdkfd: Enable HW_UPDATE_RPTR on GC 9.4.3
drm/amdgpu: reserve the old gc_11_0_*_mes.bin
...
2023-04-25 16:12:15 -07:00
Karol Wachowski
cb949ce504
accel/ivpu: Remove D3hot delay for Meteorlake
...
VPU on MTL has hardware optimizations and does not require 10ms
D0 - D3hot transition delay imposed by PCI specification (PCIe
r6.0, sec 5.9.) .
The delay removal is traditionally done by adding PCI ID to
quirk_remove_d3hot_delay() in drivers/pci/quirks.c . But since
we do not need that optimization before driver probe and we
can better specify in the ivpu driver on what (future) hardware
use the optimization, we do not use quirk_remove_d3hot_delay()
for that.
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230403121545.2995279-1-stanislaw.gruszka@linux.intel.com
2023-04-05 09:02:28 +02:00
Stanislaw Gruszka
3d8b2727d8
accel/ivpu: Disable buttress on device removal
...
Use pci_set_power_state() to disable buttress when device is removed.
This is workaround of hardware bug that hangs the system.
Additionally not disabling buttress prevents CPU enter deeper Pkg-C
states when the driver is unloaded or fail to probe.
Fixes: 35b137630f ("accel/ivpu: Introduce a new DRM driver for Intel VPU")
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230323125504.2586442-6-stanislaw.gruszka@linux.intel.com
2023-03-24 10:52:20 +01:00
Stanislaw Gruszka
3ff6edbc17
accel/ivpu: Do not use SSID 1
...
The SSID=1 is used by the firmware as default value in
case SSID mapping is not initialized. This allows
detecting use of miss-configured memory contexts.
The future FW versions may not allow using SSID=1.
SSID=65 is valid value, number of contexts are limited
by number of available command queues, but SSID can be
any u16 value.
Fixes: 35b137630f ("accel/ivpu: Introduce a new DRM driver for Intel VPU")
Co-developed-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com >
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230323125504.2586442-4-stanislaw.gruszka@linux.intel.com
2023-03-24 10:50:27 +01:00
Stanislaw Gruszka
6013aa84ee
accel/ivpu: Cancel recovery work
...
Prevent running recovery_work after device is removed.
Fixes: 852be13f3b ("accel/ivpu: Add PM support")
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230323125504.2586442-3-stanislaw.gruszka@linux.intel.com
2023-03-24 10:50:27 +01:00
Stanislaw Gruszka
4522ad764d
accel/ivpu: Do not access HW registers after unbind
...
We should not access hardware after we unbind from the bus.
Use drm_dev_enter() / drm_dev_exit() to mark code sections where
hardware is accessed (and not already protected by other locks)
and drm_dev_unplug() to mark device is gone.
Fixes: 35b137630f ("accel/ivpu: Introduce a new DRM driver for Intel VPU")
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230323125504.2586442-2-stanislaw.gruszka@linux.intel.com
2023-03-24 10:50:26 +01:00
Stanislaw Gruszka
62079b6f2c
accel/ivpu: Set dma max_segment_size
...
Avoid below spurious warning:
[ 264.844029] DMA-API: intel_vpu 0000:00:0b.0: mapping sg segment longer than device claims to support [len=143360] [max=65536]
[ 264.844038] WARNING: CPU: 0 PID: 1254 at kernel/dma/debug.c:1160 debug_dma_map_sg+0x6ca/0xb70
Fixes: 263b2ba5fc ("accel/ivpu: Add Intel VPU MMU support")
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230202092114.2637452-4-stanislaw.gruszka@linux.intel.com
(cherry picked from commit 07ccb63a5c )
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
2023-02-06 09:28:22 +01:00
Andrzej Kacprowski
dffaa98c8b
accel/ivpu: Send VPU_JSM_MSG_CONTEXT_DELETE when deleting context
...
The VPU_JSM_MSG_CONTEXT_DELETE will remove any resources associated
with the SSID, that included any blobs create by the user space
application.
The command can also remove doorbell registrations, but since this
does not work in HW scheduling case, we do not depend on this
capability and unregister the doorbells explicitly.
Fixes: cd7272215c ("accel/ivpu: Add command buffer submission logic")
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com >
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230202092114.2637452-3-stanislaw.gruszka@linux.intel.com
(cherry picked from commit 38257f514d )
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
2023-02-06 09:27:26 +01:00
Stanislaw Gruszka
07ccb63a5c
accel/ivpu: Set dma max_segment_size
...
Avoid below spurious warning:
[ 264.844029] DMA-API: intel_vpu 0000:00:0b.0: mapping sg segment longer than device claims to support [len=143360] [max=65536]
[ 264.844038] WARNING: CPU: 0 PID: 1254 at kernel/dma/debug.c:1160 debug_dma_map_sg+0x6ca/0xb70
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230202092114.2637452-4-stanislaw.gruszka@linux.intel.com
2023-02-06 09:02:11 +01:00