summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_uc.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2024-06-11 09:08:54 +1000
committerDave Airlie <airlied@redhat.com>2024-06-11 09:09:07 +1000
commit7957066ca614b63aa6687e825ccbc215fa4584ea (patch)
treedf0dc7f4f762cab6b59f84463c1a4a0949827c9d /drivers/gpu/drm/xe/xe_uc.c
parent83a7eefedc9b56fe7bfeff13b6c7356688ffa670 (diff)
parent6800e63cf97bae62bca56d8e691544540d945f53 (diff)
Merge tag 'drm-xe-next-2024-06-06' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
UAPI Changes: - Expose the L3 bank mask (Francois) Cross-subsystem Changes: - Update Xe driver maintainers (Oded) Display (i915): - Add missing include to intel_vga.c (Michal Wajdeczko) Driver Changes: - Fix Display (xe-only) detection for ADL-N (Lucas) - Runtime PM fixes that enabled PC-10 and D3Cold (Francois, Rodrigo) - Fix unexpected silent drm backmerge issues (Thomas) - More (a lot more) preparation for SR-IOV support (Michal Wajdeczko) - Devcoredump fixes and improvements (Jose, Tejas, Matt Brost) - Introduce device 'wedged' state (Rodrigo) - Improve debug and info messages (Michal Wajdeczko, Rodrigo, Nirmoy) - Adding or fixing workarounds (Tejas, Shekhar, Lucas, Bommu) - Check result of drmm_mutex_init (Michal Wajdeczko) - Enlarge the critical dma fence area for preempt fences (Matt Auld) - Prevent UAF in VM's rebind work (Matt Auld) - GuC submit related clean-ups and fixes (Matt Brost, Himal, Jonathan, Niranjana) - Prefer local helpers to perform dma reservation locking (Himal) - Spelling and typo fixes (Colin, Francois) - Prep patches for 1 job per VM bind IOCTL (no uapi change yet) (Matt Brost) - Remove uninitialized end var from xe_gt_tlb_invalidation_range (Nirmoy) - GSC related changes targeting LNL support (Daniele) - Fix assert in L3 bank mask generation (Francois) - Perform dma_map when moving system buffer objects to TT (Thomas) - Add helpers for manipulating macro arguments (Michal Wajdeczko) - Refactor default device atomic settings (Nirmoy) - Add debugfs node to dump mocs (Janga) - Use ordered WQ for G2H handler (Matt Brost) - Clean up and fixes in header includes (Michal Wajdeczko) - Prefer flexible-array over deprecated zero-lenght ones (Lucas) - Add Indirect Ring State support (Niranjana) - Fix UBSAN shift-out-of-bounds failure (Shuicheng) - HWMon fixes and additions (Karthik) - Clean-up refactor around probe init functions (Lucas, Michal Wajdeczko) - Fix PCODE init function (Himal) - Only use reserved BCS instances for usm migrate exec queue (Matt Brost) - Only zap PTEs as needed (Matt Brost) - Per client usage info (Lucas) - Core hotunplug improvements converting stuff towards devm (Matt Auld) - Don't emit false error if running in execlist mode (Michal Wajdeczko) - Remove unused struct (Dr. David) - Support/debug for slow GuC loads (John Harrison) - Decouple job seqno and lrc seqno (Matt Brost) - Allow migrate vm gpu submissions from reclaim context (Thomas) - Rename drm-client running time to run_ticks and fix a UAF (Umesh) - Check empty pinned BO list with lock held (Nirmoy) - Drop undesired prefix from the platform name (Michal Wajdeczko) - Remove unwanted mutex locking on xe file close (Niranjana) - Replace format-less snprintf() with strscpy() (Arnd) - Other general clean-ups on registers definitions and function names (Michal Wajdeczko) - Add kernel-doc to some xe_lrc interfaces (Niranajana) - Use missing lock in relay_needs_worker (Nirmoy) - Drop redundant W=1 warnings from Makefile (Jani) - Simplify if condition in preempt fences code (Thorsten) - Flush engine buffers before signalling user fence on all engines (Andrzej) - Don't overmap identity VRAM mapping (Matt Brost) - Do not dereference NULL job->fence in trace points (Matt Brost) - Add synchronous gt reset debugfs (Jonathan) - Xe gt_idle fixes (Riana) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/ZmItmuf7vq_xvRjJ@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_uc.c')
-rw-r--r--drivers/gpu/drm/xe/xe_uc.c58
1 files changed, 42 insertions, 16 deletions
diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
index 4feb35c95a1c..0f240534fb72 100644
--- a/drivers/gpu/drm/xe/xe_uc.c
+++ b/drivers/gpu/drm/xe/xe_uc.c
@@ -5,15 +5,17 @@
#include "xe_uc.h"
+#include "xe_assert.h"
#include "xe_device.h"
#include "xe_gsc.h"
#include "xe_gsc_proxy.h"
#include "xe_gt.h"
+#include "xe_gt_printk.h"
+#include "xe_gt_sriov_vf.h"
#include "xe_guc.h"
-#include "xe_guc_db_mgr.h"
#include "xe_guc_pc.h"
-#include "xe_guc_submit.h"
#include "xe_huc.h"
+#include "xe_sriov.h"
#include "xe_uc_fw.h"
#include "xe_wopcm.h"
@@ -51,19 +53,19 @@ int xe_uc_init(struct xe_uc *uc)
goto err;
if (!xe_device_uc_enabled(uc_to_xe(uc)))
- goto err;
+ return 0;
- ret = xe_wopcm_init(&uc->wopcm);
- if (ret)
- goto err;
+ if (IS_SRIOV_VF(uc_to_xe(uc)))
+ return 0;
- ret = xe_guc_submit_init(&uc->guc);
+ ret = xe_wopcm_init(&uc->wopcm);
if (ret)
goto err;
- ret = xe_guc_db_mgr_init(&uc->guc.dbm, ~0);
+ return 0;
err:
+ xe_gt_err(uc_to_gt(uc), "Failed to initialize uC (%pe)\n", ERR_PTR(ret));
return ret;
}
@@ -144,6 +146,31 @@ int xe_uc_init_hwconfig(struct xe_uc *uc)
return 0;
}
+static int vf_uc_init_hw(struct xe_uc *uc)
+{
+ int err;
+
+ err = xe_uc_sanitize_reset(uc);
+ if (err)
+ return err;
+
+ err = xe_guc_enable_communication(&uc->guc);
+ if (err)
+ return err;
+
+ err = xe_gt_sriov_vf_connect(uc_to_gt(uc));
+ if (err)
+ return err;
+
+ uc->guc.submission_state.enabled = true;
+
+ err = xe_gt_record_default_lrcs(uc_to_gt(uc));
+ if (err)
+ return err;
+
+ return 0;
+}
+
/*
* Should be called during driver load, after every GT reset, and after every
* suspend to reload / auth the firmwares.
@@ -156,6 +183,9 @@ int xe_uc_init_hw(struct xe_uc *uc)
if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
+ if (IS_SRIOV_VF(uc_to_xe(uc)))
+ return vf_uc_init_hw(uc);
+
ret = xe_huc_upload(&uc->huc);
if (ret)
return ret;
@@ -215,13 +245,13 @@ void xe_uc_stop_prepare(struct xe_uc *uc)
xe_guc_stop_prepare(&uc->guc);
}
-int xe_uc_stop(struct xe_uc *uc)
+void xe_uc_stop(struct xe_uc *uc)
{
/* GuC submission not enabled, nothing to do */
if (!xe_device_uc_enabled(uc_to_xe(uc)))
- return 0;
+ return;
- return xe_guc_stop(&uc->guc);
+ xe_guc_stop(&uc->guc);
}
int xe_uc_start(struct xe_uc *uc)
@@ -247,17 +277,13 @@ again:
int xe_uc_suspend(struct xe_uc *uc)
{
- int ret;
-
/* GuC submission not enabled, nothing to do */
if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
uc_reset_wait(uc);
- ret = xe_uc_stop(uc);
- if (ret)
- return ret;
+ xe_uc_stop(uc);
return xe_guc_suspend(&uc->guc);
}