xref: /third_party/mesa3d/src/intel/tools/aub_read.h (revision bf215546)
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#include "drm-uapi/i915_drm.h"
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37struct aub_read {
38   /* Caller's data */
39   void *user_data;
40
41   void (*error)(void *user_data, const void *aub_data, const char *msg);
42
43   void (*info)(void *user_data, int pci_id, const char *app_name);
44
45   void (*comment)(void *user_data, const char *msg);
46
47   void (*local_write)(void *user_data, uint64_t phys_addr, const void *data, uint32_t data_len);
48   void (*phys_write)(void *user_data, uint64_t phys_addr, const void *data, uint32_t data_len);
49   void (*ggtt_write)(void *user_data, uint64_t phys_addr, const void *data, uint32_t data_len);
50   void (*ggtt_entry_write)(void *user_data, uint64_t phys_addr,
51                            const void *data, uint32_t data_len);
52
53   void (*reg_write)(void *user_data, uint32_t reg_offset, uint32_t reg_value);
54
55   void (*ring_write)(void *user_data, enum drm_i915_gem_engine_class engine,
56                      const void *data, uint32_t data_len);
57   void (*execlist_write)(void *user_data, enum drm_i915_gem_engine_class engine,
58                          uint64_t context_descriptor);
59
60   /* Reader's data */
61   uint32_t render_elsp[4];
62   int render_elsp_index;
63   uint32_t video_elsp[4];
64   int video_elsp_index;
65   uint32_t blitter_elsp[4];
66   int blitter_elsp_index;
67
68   struct intel_device_info devinfo;
69};
70
71int aub_read_command(struct aub_read *read, const void *data, uint32_t data_len);
72
73#ifdef __cplusplus
74}
75#endif
76
77#endif /* INTEL_AUB_READ */
78