Skip to content

Commit 8b5cec3

Browse files
Karol Wachowskisgruszka
authored andcommitted
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 <[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 61ab485 commit 8b5cec3

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 2 additions & 2 deletions
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 - disabled , 1 - fw unit test, 2 - null hw, 3 - null submission");
42+
MODULE_PARM_DESC(test_mode, "Test mode mask. See IVPU_TEST_MODE_* macros.");
4343

4444
u8 ivpu_pll_min_ratio;
4545
module_param_named(pll_min_ratio, ivpu_pll_min_ratio, byte, 0644);
@@ -315,7 +315,7 @@ static int ivpu_wait_for_ready(struct ivpu_device *vdev)
315315
unsigned long timeout;
316316
int ret;
317317

318-
if (ivpu_test_mode == IVPU_TEST_MODE_FW_TEST)
318+
if (ivpu_test_mode & IVPU_TEST_MODE_FW_TEST)
319319
return 0;
320320

321321
ivpu_ipc_consumer_add(vdev, &cons, IVPU_IPC_CHAN_BOOT_MSG);

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,9 @@ 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
153-
#define IVPU_TEST_MODE_NULL_SUBMISSION 3
150+
#define IVPU_TEST_MODE_FW_TEST BIT(0)
151+
#define IVPU_TEST_MODE_NULL_HW BIT(1)
152+
#define IVPU_TEST_MODE_NULL_SUBMISSION BIT(2)
154153
extern int ivpu_test_mode;
155154

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

drivers/accel/ivpu/ivpu_job.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ 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))
199+
if (unlikely(ivpu_test_mode & IVPU_TEST_MODE_NULL_SUBMISSION))
200200
entry->flags = VPU_JOB_FLAGS_NULL_SUBMISSION_MASK;
201201
wmb(); /* Ensure that tail is updated after filling entry */
202202
header->tail = next_entry;
@@ -404,7 +404,7 @@ static int ivpu_direct_job_submission(struct ivpu_job *job)
404404
job->job_id, job->cmd_buf_vpu_addr, file_priv->ctx.id,
405405
job->engine_idx, cmdq->jobq->header.tail);
406406

407-
if (ivpu_test_mode == IVPU_TEST_MODE_NULL_HW) {
407+
if (ivpu_test_mode & IVPU_TEST_MODE_NULL_HW) {
408408
ivpu_job_done(vdev, job->job_id, VPU_JSM_STATUS_SUCCESS);
409409
cmdq->jobq->header.head = cmdq->jobq->header.tail;
410410
wmb(); /* Flush WC buffer for jobq header */

0 commit comments

Comments
 (0)