Katarzyna Dec | 081f771 | 2018-04-11 10:14:58 +0200 | [diff] [blame^] | 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 GPU_FILL_H |
| 26 | #define GPU_FILL_H |
| 27 | |
| 28 | #include <intel_bufmgr.h> |
| 29 | #include <i915_drm.h> |
| 30 | |
| 31 | #include "media_fill.h" |
| 32 | #include "gen7_media.h" |
| 33 | #include "gen8_media.h" |
| 34 | #include "intel_reg.h" |
| 35 | #include "drmtest.h" |
| 36 | #include "intel_batchbuffer.h" |
| 37 | #include "intel_chipset.h" |
| 38 | #include <assert.h> |
| 39 | |
| 40 | uint32_t |
| 41 | batch_used(struct intel_batchbuffer *batch); |
| 42 | |
| 43 | uint32_t |
| 44 | batch_align(struct intel_batchbuffer *batch, uint32_t align); |
| 45 | |
| 46 | void * |
| 47 | batch_alloc(struct intel_batchbuffer *batch, uint32_t size, uint32_t align); |
| 48 | |
| 49 | uint32_t |
| 50 | batch_offset(struct intel_batchbuffer *batch, void *ptr); |
| 51 | |
| 52 | uint32_t |
| 53 | batch_copy(struct intel_batchbuffer *batch, const void *ptr, uint32_t size, uint32_t align); |
| 54 | |
| 55 | void |
| 56 | gen7_render_flush(struct intel_batchbuffer *batch, uint32_t batch_end); |
| 57 | |
| 58 | uint32_t |
| 59 | gen7_fill_curbe_buffer_data(struct intel_batchbuffer *batch, |
| 60 | uint8_t color); |
| 61 | |
| 62 | uint32_t |
| 63 | gen7_fill_surface_state(struct intel_batchbuffer *batch, |
| 64 | struct igt_buf *buf, |
| 65 | uint32_t format, |
| 66 | int is_dst); |
| 67 | |
| 68 | uint32_t |
| 69 | gen7_fill_binding_table(struct intel_batchbuffer *batch, |
| 70 | struct igt_buf *dst); |
| 71 | |
| 72 | uint32_t |
| 73 | gen7_fill_media_kernel(struct intel_batchbuffer *batch, |
| 74 | const uint32_t kernel[][4], |
| 75 | size_t size); |
| 76 | |
| 77 | uint32_t |
| 78 | gen8_fill_media_kernel(struct intel_batchbuffer *batch, |
| 79 | const uint32_t kernel[][4], |
| 80 | size_t size); |
| 81 | |
| 82 | uint32_t |
| 83 | gen7_fill_interface_descriptor(struct intel_batchbuffer *batch, struct igt_buf *dst, |
| 84 | const uint32_t kernel[][4], size_t size); |
| 85 | |
| 86 | void |
| 87 | gen7_emit_state_base_address(struct intel_batchbuffer *batch); |
| 88 | |
| 89 | void |
| 90 | gen7_emit_vfe_state(struct intel_batchbuffer *batch); |
| 91 | |
| 92 | void |
| 93 | gen7_emit_vfe_state_gpgpu(struct intel_batchbuffer *batch); |
| 94 | |
| 95 | void |
| 96 | gen7_emit_curbe_load(struct intel_batchbuffer *batch, uint32_t curbe_buffer); |
| 97 | |
| 98 | void |
| 99 | gen7_emit_interface_descriptor_load(struct intel_batchbuffer *batch, uint32_t interface_descriptor); |
| 100 | |
| 101 | void |
| 102 | gen7_emit_media_objects(struct intel_batchbuffer *batch, |
| 103 | unsigned x, unsigned y, |
| 104 | unsigned width, unsigned height); |
| 105 | |
| 106 | void |
| 107 | gen7_emit_gpgpu_walk(struct intel_batchbuffer *batch, |
| 108 | unsigned x, unsigned y, |
| 109 | unsigned width, unsigned height); |
| 110 | |
| 111 | void |
| 112 | gen8_render_flush(struct intel_batchbuffer *batch, uint32_t batch_end); |
| 113 | |
| 114 | uint32_t |
| 115 | gen8_fill_curbe_buffer_data(struct intel_batchbuffer *batch, |
| 116 | uint8_t color); |
| 117 | |
| 118 | uint32_t |
| 119 | gen8_fill_surface_state(struct intel_batchbuffer *batch, |
| 120 | struct igt_buf *buf, |
| 121 | uint32_t format, |
| 122 | int is_dst); |
| 123 | |
| 124 | uint32_t |
| 125 | gen8_fill_binding_table(struct intel_batchbuffer *batch, |
| 126 | struct igt_buf *dst); |
| 127 | |
| 128 | uint32_t |
| 129 | gen8_fill_interface_descriptor(struct intel_batchbuffer *batch, struct igt_buf *dst, const uint32_t kernel[][4], size_t size); |
| 130 | |
| 131 | void |
| 132 | gen8_emit_state_base_address(struct intel_batchbuffer *batch); |
| 133 | |
| 134 | void |
| 135 | gen8_emit_vfe_state(struct intel_batchbuffer *batch); |
| 136 | |
| 137 | void |
| 138 | gen8_emit_vfe_state_gpgpu(struct intel_batchbuffer *batch); |
| 139 | |
| 140 | void |
| 141 | gen8_emit_curbe_load(struct intel_batchbuffer *batch, uint32_t curbe_buffer); |
| 142 | |
| 143 | void |
| 144 | gen8_emit_interface_descriptor_load(struct intel_batchbuffer *batch, uint32_t interface_descriptor); |
| 145 | |
| 146 | void |
| 147 | gen8_emit_media_state_flush(struct intel_batchbuffer *batch); |
| 148 | |
| 149 | void |
| 150 | gen8_emit_media_objects(struct intel_batchbuffer *batch, |
| 151 | unsigned x, unsigned y, |
| 152 | unsigned width, unsigned height); |
| 153 | |
| 154 | void |
| 155 | gen8lp_emit_media_objects(struct intel_batchbuffer *batch, |
| 156 | unsigned x, unsigned y, |
| 157 | unsigned width, unsigned height); |
| 158 | |
| 159 | void |
| 160 | gen8_emit_gpgpu_walk(struct intel_batchbuffer *batch, |
| 161 | unsigned x, unsigned y, |
| 162 | unsigned width, unsigned height); |
| 163 | |
| 164 | void |
| 165 | gen9_emit_state_base_address(struct intel_batchbuffer *batch); |
| 166 | |
| 167 | #endif /* GPU_FILL_H */ |