Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/xe/guc: Update GuC log buffer type value
@ 2025-09-04 15:14 Zhanjun Dong
  2025-09-04 16:29 ` ✓ CI.KUnit: success for drm/xe/guc: Update GuC log buffer type value (rev2) Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Zhanjun Dong @ 2025-09-04 15:14 UTC (permalink / raw)
  To: intel-xe; +Cc: stuart.summers, john.c.harrison, michal.wajdeczko, Zhanjun Dong

Update GuC log buffer type value, to align with the GuC specification.

Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
---
Change list:
v2: Use SZ_4K, instead of PAGE_SIZE
    Expand for loop with switch and fallthrough
---
 drivers/gpu/drm/xe/abi/guc_log_abi.h |  2 +-
 drivers/gpu/drm/xe/xe_guc_log.c      | 20 ++++++++++++--------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/xe/abi/guc_log_abi.h b/drivers/gpu/drm/xe/abi/guc_log_abi.h
index 554630b7ccd9..b1819679fa35 100644
--- a/drivers/gpu/drm/xe/abi/guc_log_abi.h
+++ b/drivers/gpu/drm/xe/abi/guc_log_abi.h
@@ -10,8 +10,8 @@
 
 /* GuC logging buffer types */
 enum guc_log_buffer_type {
-	GUC_LOG_BUFFER_CRASH_DUMP,
 	GUC_LOG_BUFFER_DEBUG,
+	GUC_LOG_BUFFER_CRASH_DUMP,
 	GUC_LOG_BUFFER_CAPTURE,
 };
 
diff --git a/drivers/gpu/drm/xe/xe_guc_log.c b/drivers/gpu/drm/xe/xe_guc_log.c
index c01ccb35dc75..6cbb0378d2ba 100644
--- a/drivers/gpu/drm/xe/xe_guc_log.c
+++ b/drivers/gpu/drm/xe/xe_guc_log.c
@@ -50,7 +50,7 @@ static size_t guc_log_size(void)
 	 *  |     Capture state header      |
 	 *  +-------------------------------+ 96B
 	 *  |                               |
-	 *  +===============================+ PAGE_SIZE (4KB)
+	 *  +===============================+ 4KB
 	 *  |        Crash Dump logs        |
 	 *  +===============================+ + CRASH_SIZE
 	 *  |          Debug logs           |
@@ -58,7 +58,7 @@ static size_t guc_log_size(void)
 	 *  |         Capture logs          |
 	 *  +===============================+ + CAPTURE_SIZE
 	 */
-	return PAGE_SIZE + CRASH_BUFFER_SIZE + DEBUG_BUFFER_SIZE +
+	return SZ_4K + CRASH_BUFFER_SIZE + DEBUG_BUFFER_SIZE +
 		CAPTURE_BUFFER_SIZE;
 }
 
@@ -327,13 +327,17 @@ u32 xe_guc_get_log_buffer_size(struct xe_guc_log *log, enum guc_log_buffer_type
  */
 u32 xe_guc_get_log_buffer_offset(struct xe_guc_log *log, enum guc_log_buffer_type type)
 {
-	enum guc_log_buffer_type i;
-	u32 offset = PAGE_SIZE;/* for the log_buffer_states */
+	u32 offset = SZ_4K; /* 1st section size */
 
-	for (i = GUC_LOG_BUFFER_CRASH_DUMP; i < GUC_LOG_BUFFER_TYPE_MAX; ++i) {
-		if (i == type)
-			break;
-		offset += xe_guc_get_log_buffer_size(log, i);
+	switch (type) {
+	case GUC_LOG_BUFFER_CAPTURE:
+		offset += xe_guc_get_log_buffer_size(log, GUC_LOG_BUFFER_CRASH_DUMP);
+		fallthrough;
+	case GUC_LOG_BUFFER_CRASH_DUMP:
+		offset += xe_guc_get_log_buffer_size(log, GUC_LOG_BUFFER_DEBUG);
+		fallthrough;
+	case GUC_LOG_BUFFER_DEBUG:
+		break;
 	}
 
 	return offset;
-- 
2.34.1


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

end of thread, other threads:[~2025-09-25 17:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04 15:14 [PATCH v2] drm/xe/guc: Update GuC log buffer type value Zhanjun Dong
2025-09-04 16:29 ` ✓ CI.KUnit: success for drm/xe/guc: Update GuC log buffer type value (rev2) Patchwork
2025-09-04 17:02 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-05  7:50 ` ✓ Xe.CI.Full: " Patchwork
2025-09-23 22:20 ` [PATCH v2] drm/xe/guc: Update GuC log buffer type value Michal Wajdeczko
2025-09-25 15:20   ` Dong, Zhanjun
2025-09-25 17:16     ` Michal Wajdeczko

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