2 * Copyright (c) 2018 Intel Corporation
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
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27 #include "gen_buffer_alloc.h"
38 * Auxiliary surface mapping implementation
40 * These functions are implemented in common code shared by drivers.
43 struct gen_aux_map_context
;
44 struct gen_device_info
;
46 struct gen_aux_map_context
*
47 gen_aux_map_init(void *driver_ctx
,
48 struct gen_mapped_pinned_buffer_alloc
*buffer_alloc
,
49 const struct gen_device_info
*devinfo
);
52 gen_aux_map_finish(struct gen_aux_map_context
*ctx
);
55 gen_aux_map_get_state_num(struct gen_aux_map_context
*ctx
);
57 /** Returns the current number of buffers used by the aux-map tables
59 * When preparing to execute a new batch, use this function to determine how
60 * many buffers will be required. More buffers may be added by concurrent
61 * accesses of the aux-map functions, but they won't be required for since
62 * they involve surfaces not used by this batch.
65 gen_aux_map_get_num_buffers(struct gen_aux_map_context
*ctx
);
67 /** Fill an array of exec_object2 with aux-map buffer handles
69 * The gen_aux_map_get_num_buffers call should be made, then the driver can
70 * make sure the `obj` array is large enough before calling this function.
73 gen_aux_map_fill_bos(struct gen_aux_map_context
*ctx
, void **driver_bos
,
77 gen_aux_map_get_base(struct gen_aux_map_context
*ctx
);
80 gen_aux_map_add_image(struct gen_aux_map_context
*ctx
,
81 const struct isl_surf
*isl_surf
, uint64_t address
,
82 uint64_t aux_address
);
85 gen_aux_map_unmap_range(struct gen_aux_map_context
*ctx
, uint64_t address
,
92 #endif /* GEN_AUX_MAP_H */