Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/intel_mocs: Initialize MOCS values directly
@ 2023-12-21 20:15 Matt Roper
  2023-12-22  9:44 ` Matthew Auld
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Roper @ 2023-12-21 20:15 UTC (permalink / raw)
  To: igt-dev

The #define's at the top of the file don't really provide any value and
just make it harder to quickly check which numeric index is associated
with which behavior on a given platform.  Drop them and assign the index
fields directly.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 lib/intel_mocs.c | 31 ++++++++++---------------------
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/lib/intel_mocs.c b/lib/intel_mocs.c
index 0659ff50b..4a9c305dc 100644
--- a/lib/intel_mocs.c
+++ b/lib/intel_mocs.c
@@ -6,17 +6,6 @@
 #include "igt.h"
 #include "intel_mocs.h"
 
-#define DG1_MOCS_UC_IDX				1
-#define DG1_MOCS_WB_IDX				5
-#define DG2_MOCS_UC_IDX				1
-#define DG2_MOCS_WB_IDX				3
-#define MTL_MOCS_UC_IDX				5
-#define MTL_MOCS_WB_IDX				10
-#define GEN12_MOCS_UC_IDX			3
-#define GEN12_MOCS_WB_IDX			2
-#define XE2_MOCS_UC_IDX				3
-#define XE2_MOCS_WB_IDX				4
-
 struct drm_intel_mocs_index {
 	uint8_t uc_index;
 	uint8_t wb_index;
@@ -34,20 +23,20 @@ static void get_mocs_index(int fd, struct drm_intel_mocs_index *mocs)
 	 * as WB MOCS index based on platform.
 	 */
 	if (intel_graphics_ver(devid) >= IP_VER(20, 0)) {
-		mocs->uc_index = XE2_MOCS_UC_IDX;
-		mocs->wb_index = XE2_MOCS_WB_IDX;
+		mocs->uc_index = 3;
+		mocs->wb_index = 4;
 	} else if (IS_METEORLAKE(devid)) {
-		mocs->uc_index = MTL_MOCS_UC_IDX;
-		mocs->wb_index = MTL_MOCS_WB_IDX;
+		mocs->uc_index = 5;
+		mocs->wb_index = 10;
 	} else if (IS_DG2(devid)) {
-		mocs->uc_index = DG2_MOCS_UC_IDX;
-		mocs->wb_index = DG2_MOCS_WB_IDX;
+		mocs->uc_index = 1;
+		mocs->wb_index = 3;
 	} else if (IS_DG1(devid)) {
-		mocs->uc_index = DG1_MOCS_UC_IDX;
-		mocs->wb_index = DG1_MOCS_WB_IDX;
+		mocs->uc_index = 1;
+		mocs->wb_index = 5;
 	} else if (IS_GEN12(devid)) {
-		mocs->uc_index = GEN12_MOCS_UC_IDX;
-		mocs->wb_index = GEN12_MOCS_WB_IDX;
+		mocs->uc_index = 3;
+		mocs->wb_index = 2;
 	} else {
 		mocs->uc_index = I915_MOCS_PTE;
 		mocs->wb_index = I915_MOCS_CACHED;
-- 
2.43.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH i-g-t] lib/intel_mocs: Initialize MOCS values directly
  2023-12-21 20:15 [PATCH i-g-t] lib/intel_mocs: Initialize MOCS values directly Matt Roper
@ 2023-12-22  9:44 ` Matthew Auld
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Auld @ 2023-12-22  9:44 UTC (permalink / raw)
  To: Matt Roper; +Cc: igt-dev

On Thu, 21 Dec 2023 at 20:25, Matt Roper <matthew.d.roper@intel.com> wrote:
>
> The #define's at the top of the file don't really provide any value and
> just make it harder to quickly check which numeric index is associated
> with which behavior on a given platform.  Drop them and assign the index
> fields directly.
>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-22  9:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-21 20:15 [PATCH i-g-t] lib/intel_mocs: Initialize MOCS values directly Matt Roper
2023-12-22  9:44 ` Matthew Auld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox