xref: /aosp_15_r20/external/mesa3d/src/intel/tools/aub_read.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright © 2018 Intel Corporation
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice (including the next
12  * paragraph) shall be included in all copies or substantial portions of the
13  * Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21  * IN THE SOFTWARE.
22  *
23  */
24 
25 #ifndef INTEL_AUB_READ
26 #define INTEL_AUB_READ
27 
28 #include <stdint.h>
29 
30 #include "dev/intel_device_info.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 struct aub_read {
37    /* Caller's data */
38    void *user_data;
39 
40    void (*error)(void *user_data, const void *aub_data, const char *msg);
41 
42    void (*info)(void *user_data, int pci_id, const char *app_name);
43 
44    void (*comment)(void *user_data, const char *msg);
45 
46    void (*local_write)(void *user_data, uint64_t phys_addr, const void *data, uint32_t data_len);
47    void (*phys_write)(void *user_data, uint64_t phys_addr, const void *data, uint32_t data_len);
48    void (*ggtt_write)(void *user_data, uint64_t phys_addr, const void *data, uint32_t data_len);
49    void (*ggtt_entry_write)(void *user_data, uint64_t phys_addr,
50                             const void *data, uint32_t data_len);
51 
52    void (*reg_write)(void *user_data, uint32_t reg_offset, uint32_t reg_value);
53 
54    void (*ring_write)(void *user_data, enum intel_engine_class engine,
55                       const void *data, uint32_t data_len);
56    void (*execlist_write)(void *user_data, enum intel_engine_class engine,
57                           uint64_t context_descriptor);
58 
59    /* Reader's data */
60    uint32_t render_elsp[4];
61    int render_elsp_index;
62    uint32_t video_elsp[4];
63    int video_elsp_index;
64    uint32_t blitter_elsp[4];
65    int blitter_elsp_index;
66 
67    struct intel_device_info devinfo;
68 };
69 
70 int aub_read_command(struct aub_read *read, const void *data, uint32_t data_len);
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* INTEL_AUB_READ */
77