aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2023-09-20 14:27:38 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2023-09-20 14:27:38 -0400
commitb70849d1ce67a58f9f69b37dc62122f789f4cdf7 (patch)
treebc6cbbd220aa42d07b959a28d6a7d9968d79e5bd
parent51f808e092846a60ea6c88ea3a1d2e349c92977b (diff)
Rearrange, fix an off-by-one error, and remove an unused define
The code in nvdebug.h has been rearranged to enable an easier merge against the jbakita-wip branch.
-rw-r--r--device_info_procfs.c2
-rw-r--r--nvdebug.h105
2 files changed, 53 insertions, 54 deletions
diff --git a/device_info_procfs.c b/device_info_procfs.c
index 195b3ff..e94bef5 100644
--- a/device_info_procfs.c
+++ b/device_info_procfs.c
@@ -47,7 +47,7 @@ static void* device_info_file_seq_start(struct seq_file *s, loff_t *pos) {
47 iter.type_of_next_entry = 0; 47 iter.type_of_next_entry = 0;
48 iter.has_next_entry = 0; 48 iter.has_next_entry = 0;
49 // On Ampere+, the device_info table length can vary 49 // On Ampere+, the device_info table length can vary
50 if (g->chip_id > NV_CHIP_ID_AMPERE) 50 if (g->chip_id >= NV_CHIP_ID_AMPERE)
51 iter.length = NV_PTOP_DEVICE_INFO__SIZE_1_GA100(g); 51 iter.length = NV_PTOP_DEVICE_INFO__SIZE_1_GA100(g);
52 else 52 else
53 iter.length = NV_PTOP_DEVICE_INFO__SIZE_1_GK104; 53 iter.length = NV_PTOP_DEVICE_INFO__SIZE_1_GK104;
diff --git a/nvdebug.h b/nvdebug.h
index 39e07b4..e91763e 100644
--- a/nvdebug.h
+++ b/nvdebug.h
@@ -449,58 +449,6 @@ typedef union {
449 } __attribute__((packed)); 449 } __attribute__((packed));
450} mc_boot_0_t; 450} mc_boot_0_t;
451 451
452enum DEVICE_INFO_TYPE {INFO_TYPE_NOT_VALID = 0, INFO_TYPE_DATA = 1, INFO_TYPE_ENUM = 2, INFO_TYPE_ENGINE_TYPE = 3};
453enum ENGINE_TYPES {
454 ENGINE_GRAPHICS = 0, // GRAPHICS [/compute]
455 ENGINE_COPY0 = 1, // [raw/physical] COPY #0
456 ENGINE_COPY1 = 2, // [raw/physical] COPY #1
457 ENGINE_COPY2 = 3, // [raw/physical] COPY #2
458
459 ENGINE_MSPDEC = 8, // Picture DECoder
460 ENGINE_MSPPP = 9, // [Video] Picture Post Processor
461 ENGINE_MSVLD = 10, // [Video] Variable Length Decoder
462 ENGINE_MSENC = 11, // [Video] ENCoding
463 ENGINE_VIC = 12, // Video Image Compositor
464 ENGINE_SEC = 13, // SEquenCer [?]
465 ENGINE_NVENC0 = 14, // Nvidia Video ENCoder #0
466 ENGINE_NVENC1 = 15, // Nvidia Video ENCoder #1
467 ENGINE_NVDEC = 16, // Nvidia Video DECoder
468
469 ENGINE_IOCTRL = 18, // I/O ConTRoLler [of NVLINK at least]
470 ENGINE_LCE = 19, // Logical Copy Engine
471 ENGINE_GSP = 20, // Gpu System Processor (Volta+)
472 ENGINE_NVJPG = 21, // NVidia JPeG [Decoder] (Turing+)
473 ENGINE_OFA = 22, // Optical Flow Accelerator (Turing+)
474 ENGINE_FLA = 23, // [NVLink] Fabric Logical Addressing [?]
475};
476#define ENGINE_TYPES_LEN 24
477static const char* const ENGINE_TYPES_NAMES[ENGINE_TYPES_LEN] = {
478 "Graphics/Compute",
479 "COPY0",
480 "COPY1",
481 "COPY2",
482 "Unknown Engine ID#4",
483 "Unknown Engine ID#5",
484 "Unknown Engine ID#6",
485 "Unknown Engine ID#7",
486 "MSPDEC: Picture Decoder",
487 "MSPPP: Post Processing",
488 "MSVLD: Variable Length Decoder",
489 "MSENC: Encoder",
490 "VIC: Video Image Compositor",
491 "SEC: Sequencer",
492 "NVENC0: NVIDIA Video Encoder #0",
493 "NVENC1: NVIDIA Video Encoder #1",
494 "NVDEC: NVIDIA Video Decoder",
495 "Unknown Engine ID#17",
496 "IOCTRL: I/O Controller",
497 "LCE: Logical Copy Engine",
498 "GSP: GPU System Processor",
499 "NVJPG: NVIDIA JPEG Decoder",
500 "OFA: Optical Flow Accelerator",
501 "FLA: Fabric Logical Addressing",
502};
503
504/* GPU engine information and control register offsets (GPU TOPology) 452/* GPU engine information and control register offsets (GPU TOPology)
505 Each engine is described by one or more entries (terminated by an entry with 453 Each engine is described by one or more entries (terminated by an entry with
506 the `has_next_entry` flag unset) in the fixed-size PTOP_DEVICE_INFO table. A 454 the `has_next_entry` flag unset) in the fixed-size PTOP_DEVICE_INFO table. A
@@ -567,7 +515,58 @@ static const char* const ENGINE_TYPES_NAMES[ENGINE_TYPES_LEN] = {
567#define NV_PTOP_DEVICE_INFO_GK104(i) (0x00022700+(i)*4) 515#define NV_PTOP_DEVICE_INFO_GK104(i) (0x00022700+(i)*4)
568#define NV_PTOP_DEVICE_INFO__SIZE_1_GA100(g) (nvdebug_readl(g, 0x0224fc) >> 20) 516#define NV_PTOP_DEVICE_INFO__SIZE_1_GA100(g) (nvdebug_readl(g, 0x0224fc) >> 20)
569#define NV_PTOP_DEVICE_INFO__SIZE_1_GK104 64 517#define NV_PTOP_DEVICE_INFO__SIZE_1_GK104 64
570#define NV_PTOP_DEVICE_INFO_TYPE_COUNT 3 518enum DEVICE_INFO_TYPE {INFO_TYPE_NOT_VALID = 0, INFO_TYPE_DATA = 1, INFO_TYPE_ENUM = 2, INFO_TYPE_ENGINE_TYPE = 3};
519enum ENGINE_TYPES {
520 ENGINE_GRAPHICS = 0, // GRAPHICS [/compute]
521 ENGINE_COPY0 = 1, // [raw/physical] COPY #0
522 ENGINE_COPY1 = 2, // [raw/physical] COPY #1
523 ENGINE_COPY2 = 3, // [raw/physical] COPY #2
524
525 ENGINE_MSPDEC = 8, // Picture DECoder
526 ENGINE_MSPPP = 9, // [Video] Picture Post Processor
527 ENGINE_MSVLD = 10, // [Video] Variable Length Decoder
528 ENGINE_MSENC = 11, // [Video] ENCoding
529 ENGINE_VIC = 12, // Video Image Compositor
530 ENGINE_SEC = 13, // SEquenCer [?]
531 ENGINE_NVENC0 = 14, // Nvidia Video ENCoder #0
532 ENGINE_NVENC1 = 15, // Nvidia Video ENCoder #1
533 ENGINE_NVDEC = 16, // Nvidia Video DECoder
534
535 ENGINE_IOCTRL = 18, // I/O ConTRoLler [of NVLINK at least]
536 ENGINE_LCE = 19, // Logical Copy Engine
537 ENGINE_GSP = 20, // Gpu System Processor (Volta+)
538 ENGINE_NVJPG = 21, // NVidia JPeG [Decoder] (Turing+)
539 ENGINE_OFA = 22, // Optical Flow Accelerator (Turing+)
540 ENGINE_FLA = 23, // [NVLink] Fabric Logical Addressing [?]
541};
542#define ENGINE_TYPES_LEN 24
543static const char* const ENGINE_TYPES_NAMES[ENGINE_TYPES_LEN] = {
544 "Graphics/Compute",
545 "COPY0",
546 "COPY1",
547 "COPY2",
548 "Unknown Engine ID#4",
549 "Unknown Engine ID#5",
550 "Unknown Engine ID#6",
551 "Unknown Engine ID#7",
552 "MSPDEC: Picture Decoder",
553 "MSPPP: Post Processing",
554 "MSVLD: Variable Length Decoder",
555 "MSENC: Encoder",
556 "VIC: Video Image Compositor",
557 "SEC: Sequencer",
558 "NVENC0: NVIDIA Video Encoder #0",
559 "NVENC1: NVIDIA Video Encoder #1",
560 "NVDEC: NVIDIA Video Decoder",
561 "Unknown Engine ID#17",
562 "IOCTRL: I/O Controller",
563 "LCE: Logical Copy Engine",
564 "GSP: GPU System Processor",
565 "NVJPG: NVIDIA JPEG Decoder",
566 "OFA: Optical Flow Accelerator",
567 "FLA: Fabric Logical Addressing",
568};
569
571typedef union { 570typedef union {
572 struct { 571 struct {
573 uint32_t fault_id:11; 572 uint32_t fault_id:11;