Skip to content

Commit 61ab485

Browse files
Andrzej Kacprowskisgruszka
authored andcommitted
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 <[email protected]> Reviewed-by: Stanislaw Gruszka <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent bacc130 commit 61ab485

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ MODULE_PARM_DESC(dbg_mask, "Driver debug mask. See IVPU_DBG_* macros.");
3939

4040
int ivpu_test_mode;
4141
module_param_named_unsafe(test_mode, ivpu_test_mode, int, 0644);
42-
MODULE_PARM_DESC(test_mode, "Test mode: 0 - normal operation, 1 - fw unit test, 2 - null hw");
42+
MODULE_PARM_DESC(test_mode, "Test mode: 0 - disabled , 1 - fw unit test, 2 - null hw, 3 - null submission");
4343

4444
u8 ivpu_pll_min_ratio;
4545
module_param_named(pll_min_ratio, ivpu_pll_min_ratio, byte, 0644);

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ extern u8 ivpu_pll_min_ratio;
147147
extern u8 ivpu_pll_max_ratio;
148148
extern bool ivpu_disable_mmu_cont_pages;
149149

150-
#define IVPU_TEST_MODE_DISABLED 0
151-
#define IVPU_TEST_MODE_FW_TEST 1
152-
#define IVPU_TEST_MODE_NULL_HW 2
150+
#define IVPU_TEST_MODE_DISABLED 0
151+
#define IVPU_TEST_MODE_FW_TEST 1
152+
#define IVPU_TEST_MODE_NULL_HW 2
153+
#define IVPU_TEST_MODE_NULL_SUBMISSION 3
153154
extern int ivpu_test_mode;
154155

155156
struct ivpu_file_priv *ivpu_file_priv_get(struct ivpu_file_priv *file_priv);

drivers/accel/ivpu/ivpu_job.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ static int ivpu_cmdq_push_job(struct ivpu_cmdq *cmdq, struct ivpu_job *job)
196196
entry->batch_buf_addr = job->cmd_buf_vpu_addr;
197197
entry->job_id = job->job_id;
198198
entry->flags = 0;
199+
if (unlikely(ivpu_test_mode == IVPU_TEST_MODE_NULL_SUBMISSION))
200+
entry->flags = VPU_JOB_FLAGS_NULL_SUBMISSION_MASK;
199201
wmb(); /* Ensure that tail is updated after filling entry */
200202
header->tail = next_entry;
201203
wmb(); /* Flush WC buffer for jobq header */

0 commit comments

Comments
 (0)