2 * Copyright © 2020 Google, Inc.
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:
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
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 FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 #include "drm/freedreno_drmif.h"
32 #include "drm/freedreno_ringbuffer.h"
34 #include "adreno_pm4.xml.h"
35 #include "adreno_common.xml.h"
40 /* filled in by backend when shader is assembled: */
41 uint32_t local_size
[3];
43 uint32_t buf_sizes
[MAX_BUFS
]; /* size in dwords */
45 /* filled in by frontend before launching grid: */
46 struct fd_bo
*bufs
[MAX_BUFS
];
52 /* for backend to configure/read the counter, describes
53 * the selected counter:
56 unsigned counter_reg_lo
;
57 unsigned counter_reg_hi
;
58 /* and selected countable:
63 /* per-generation entry-points: */
65 struct kernel
*(*assemble
)(struct backend
*b
, FILE *in
);
66 void (*disassemble
)(struct kernel
*kernel
, FILE *out
);
67 void (*emit_grid
)(struct kernel
*kernel
, uint32_t grid
[3],
68 struct fd_submit
*submit
);
70 /* performance-counter API: */
71 void (*set_perfcntrs
)(struct backend
*b
, const struct perfcntr
*perfcntrs
,
72 unsigned num_perfcntrs
);
73 void (*read_perfcntrs
)(struct backend
*b
, uint64_t *results
);
76 #define define_cast(_from, _to) \
77 static inline struct _to * \
78 to_ ## _to(struct _from *f) \
79 { return (struct _to *)f; }
81 struct backend
*a6xx_init(struct fd_device
*dev
, uint32_t gpu_id
);
83 /* for conditionally setting boolean flag(s): */
84 #define COND(bool, val) ((bool) ? (val) : 0)
86 #endif /* __MAIN_H__ */