Skip to contentSkip to conversation

drm/xe: Add mocs kunit

PATCH Superseded Ruthuvikas Ravikumar 2 participants 2 messages Nov 8, 2023

Subsystems (2)

v9 of 14 Superseded Latest is v14 →

lore
Share & tools
lore
#0 lore raw

PATCH v9 1/1 drm/xe: Add mocs kunit

This kunit verifies the hardware values of mocs and l3cc registers with the KMD programmed values.

v9: Add Forcewake Fail.

v8: Remove xe_bo.h and xe_pm.h
Remove mocs and l3cc from live_mocs.
Pull debug and err msg for mocs/l3cc out of if else block. Add HAS_LNCF_MOCS.

v7: correct checkpath

v6: Change ssize_t type.
Change forcewake domain to XE_FW_GT.
Update change of MOCS registers are multicast on Xe_HP and beyond patch.

v5: Release forcewake.
Remove single statement braces.
Fix debug statements.

v4: Drop stratch and vaddr.
Fix debug statements.
Fix indentation.

v3: Fix checkpath.

v2: Fix checkpath.

Cc Aravind Iddamsetty <[email protected]>
Cc Mathew D Roper <[email protected]>
---
 drivers/gpu/drm/xe/tests/Makefile       |   1 +
 drivers/gpu/drm/xe/tests/xe_mocs.c      | 138 ++++++++++++++++++++++++
 drivers/gpu/drm/xe/tests/xe_mocs_test.c |  24 +++++
 drivers/gpu/drm/xe/tests/xe_mocs_test.h |  13 +++
 drivers/gpu/drm/xe/xe_mocs.c            |   4 +
 5 files changed, 180 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/tests/xe_mocs.c
 create mode 100644 drivers/gpu/drm/xe/tests/xe_mocs_test.c
 create mode 100644 drivers/gpu/drm/xe/tests/xe_mocs_test.h
drivers/gpu/drm/xe/tests/Makefile +1 -0
index 51f1a7f017d4..39d8a0892274 100644
@@ -4,6 +4,7 @@ obj-$(CONFIG_DRM_XE_KUNIT_TEST) += \
 	xe_bo_test.o \
 	xe_dma_buf_test.o \
 	xe_migrate_test.o \
+	xe_mocs_test.o \
 	xe_pci_test.o \
 	xe_rtp_test.o \
 	xe_wa_test.o
drivers/gpu/drm/xe/tests/xe_mocs.c new file +138 -0

138 lines not on this page · raw message

drivers/gpu/drm/xe/tests/xe_mocs_test.c new file +24 -0
new file mode 100644
index 000000000000..ef56bd517b28
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright © 2022 Intel Corporation
+ */
+
+#include "xe_mocs_test.h"
+
+#include <kunit/test.h>
+
+static struct kunit_case xe_mocs_tests[] = {
+	KUNIT_CASE(xe_live_mocs_kernel_kunit),
+	{}
+};
+
+static struct kunit_suite xe_mocs_test_suite = {
+	.name = "xe_mocs",
+	.test_cases = xe_mocs_tests,
+};
+
+kunit_test_suite(xe_mocs_test_suite);
+
+MODULE_AUTHOR("Intel Corporation");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(EXPORTED_FOR_KUNIT_TESTING);
drivers/gpu/drm/xe/tests/xe_mocs_test.h new file +13 -0
new file mode 100644
index 000000000000..7faa3575e6c3
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 AND MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef _XE_MOCS_TEST_H_
+#define _XE_MOCS_TEST_H_
+
+struct kunit;
+
+void xe_live_mocs_kernel_kunit(struct kunit *test);
+
+#endif
drivers/gpu/drm/xe/xe_mocs.c +4 -0
index 46e999257862..409f21b72761 100644
@@ -588,3 +588,7 @@ void xe_mocs_init(struct xe_gt *gt)
 	if (flags & HAS_LNCF_MOCS)
 		init_l3cc_table(gt, &table);
 }
+
+#if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
+#include "tests/xe_mocs.c"
+#endif
Signature · 1 line
2.25.1
#1 lore raw

[Intel-xe] ✗ CI.Patch_applied: failure for drm/xe: Add mocs kunit (rev9)

== Series Details ==

== Series Details ==

Series: drm/xe: Add mocs kunit (rev9)
URL : https://patchwork.freedesktop.org/series/124926/
State : failure

== Summary ==

=== Applying kernel patches on branch 'drm-xe-next' with base: === Base commit: 58c0bd519 drm/xe: Add Wa_14019877138
=== git am output follows ===
Applying: drm/xe: Add mocs kunit