File: gtpin_IGC_interface.h

package info (click to toggle)
intel-graphics-compiler 1.0.12504.6-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 83,912 kB
  • sloc: cpp: 910,147; lisp: 202,655; ansic: 15,197; python: 4,025; yacc: 2,241; lex: 1,570; pascal: 244; sh: 104; makefile: 25
file content (109 lines) | stat: -rw-r--r-- 3,903 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*========================== begin_copyright_notice ============================

Copyright (C) 2019-2021 Intel Corporation

SPDX-License-Identifier: MIT

============================= end_copyright_notice ===========================*/

#pragma once

#ifndef _GPTIN_IGC_INTERFACE_
#define _GPTIN_IGC_INTERFACE_

namespace gtpin
{
namespace igc
{

/*!
 * GTPin <-> IGC driver interface version
 */
static const uint32_t GTPIN_IGC_INTERFACE_VERSION = 0;


/*!
 * Tokens for patches IGC can pass to GTPin
 */
typedef enum
{
    GTPIN_IGC_TOKEN_GRF_INFO
    //TBD - more tokens
} GTPIN_IGC_TOKEN;


/*
 * IGC initialization data
 */
typedef struct igc_init_t
{
    uint32_t    version;
    uint8_t     re_ra;                  // active RERA - on/off
    uint8_t     grf_info;               // active free GRF info - on/off
    uint8_t     srcline_mapping;        // active source line mapping - on/off
} igc_init_t;

/*!
 * General header for patch item passed from IGC to GTPin
 * Visualization example of the patch item representing the free GRF information
 * +---------------------+ igc_info_t +-----------------------+
 * |                                                          |
 * | igc_init_t   init_status                                 |
 * | uint32_t     num_tokens                                  |
 * |                                                          |
 * | +----------------+ igc_token_header_t +------------------+
 * | |                                                        |
 * | |  GTPIN_IGC_TOKEN    token                              |
 * | |  uint32_t           token_size                         |
 * | |                                                        |
 * | |  +------------+ igc_token_free_reg_info_t +------------+
 * | |  |                                                     |
 * | |  | uint32_t        magic_start                         |
 * | |  | uint32_t        num_items                           |
 * | |  | reg_sequence_t  free_reg_sequence[num_items]        |
 * | |  | uint32_t        magic_end                           |
 * | |  |                                                     |
 * +----------------------------------------------------------+
 */
typedef struct igc_token_header_t
{
    GTPIN_IGC_TOKEN     token;          // Token ID
    uint32_t            token_size;     // Total size of the patch item. Equal to sizeof(token) + sizeof(token_size) + sizeof(*patch*)
} igc_token_header_t;


/*!
 * A single sequence of consecutive bytes, all of which are unused in the current kernel.
 */
typedef struct reg_sequence_t
{
    uint32_t start_byte;            // Starting byte in the GRF table, representing the start of unused bytes in the current kernel
    uint32_t num_consecutive_bytes; // Number of consecutive bytes in the sequence, starting from start_byte
} reg_sequence_t;


/*!
 * Patch item detailing unused registers in the current kernel
 */
typedef struct igc_token_free_reg_info_t : igc_token_header_t
{
    uint32_t        magic_start;                        // Equal to 0xdeadd00d
    uint32_t        num_items;                          // Number of consecutive sequences of unused bytes
    // reg_sequence_t  free_reg_sequence[/* num_items */]; // Inlined array of num_items sequences detailing unused bytes
    //uint32_t      magic_end                           // Equal to 0xdeadbeef
} igc_token_free_reg_info_t;

/**
 * IGC's additional information about the kernel's execution
 */
typedef struct igc_info_s
{
    igc_init_t          init_status;                    // IGC's report regarding the various requested features from GTPin
    uint32_t            num_tokens;                     // Number of patch items passed in the struct.
    //igc_token_header_t  token_list[];                 // Contiguous block of memory containing the patch tokens
} igc_info_t;

} // namespace igc
} // namespace gtpin

#endif