2018-03-28 01:10:06 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018 Intel Corporation
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
*
|
|
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
|
* Software.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
|
|
|
* IN THE SOFTWARE.
|
|
|
|
|
*/
|
|
|
|
|
|
2021-03-03 13:20:06 -08:00
|
|
|
#ifndef INTEL_AUX_MAP_H
|
|
|
|
|
#define INTEL_AUX_MAP_H
|
2018-03-28 01:10:06 -07:00
|
|
|
|
2021-03-03 13:20:06 -08:00
|
|
|
#include "intel_buffer_alloc.h"
|
2018-03-28 01:10:06 -07:00
|
|
|
|
|
|
|
|
#include "isl/isl.h"
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Auxiliary surface mapping implementation
|
|
|
|
|
*
|
|
|
|
|
* These functions are implemented in common code shared by drivers.
|
|
|
|
|
*/
|
|
|
|
|
|
2021-03-03 13:49:18 -08:00
|
|
|
struct intel_aux_map_context;
|
2021-04-05 13:19:39 -07:00
|
|
|
struct intel_device_info;
|
2018-03-28 01:10:06 -07:00
|
|
|
|
2021-03-03 13:58:15 -08:00
|
|
|
#define INTEL_AUX_MAP_ENTRY_VALID_BIT 0x1ull
|
2020-01-21 14:14:20 -06:00
|
|
|
|
2021-03-03 13:49:18 -08:00
|
|
|
struct intel_aux_map_context *
|
|
|
|
|
intel_aux_map_init(void *driver_ctx,
|
2021-04-07 13:22:19 -07:00
|
|
|
struct intel_mapped_pinned_buffer_alloc *buffer_alloc,
|
2021-04-05 13:19:39 -07:00
|
|
|
const struct intel_device_info *devinfo);
|
2018-03-28 01:10:06 -07:00
|
|
|
|
2023-05-23 10:10:21 +03:00
|
|
|
uint32_t
|
|
|
|
|
intel_aux_map_get_alignment(struct intel_aux_map_context *ctx);
|
|
|
|
|
|
2018-03-28 01:10:06 -07:00
|
|
|
void
|
2021-03-03 13:49:18 -08:00
|
|
|
intel_aux_map_finish(struct intel_aux_map_context *ctx);
|
2018-03-28 01:10:06 -07:00
|
|
|
|
|
|
|
|
uint32_t
|
2021-03-03 13:49:18 -08:00
|
|
|
intel_aux_map_get_state_num(struct intel_aux_map_context *ctx);
|
2018-03-28 01:10:06 -07:00
|
|
|
|
2022-12-07 17:55:57 -08:00
|
|
|
/**
|
|
|
|
|
* Returns the current number of buffers used by the aux-map tables
|
2018-03-28 01:10:06 -07:00
|
|
|
*
|
|
|
|
|
* When preparing to execute a new batch, use this function to determine how
|
|
|
|
|
* many buffers will be required. More buffers may be added by concurrent
|
|
|
|
|
* accesses of the aux-map functions, but they won't be required for since
|
|
|
|
|
* they involve surfaces not used by this batch.
|
|
|
|
|
*/
|
|
|
|
|
uint32_t
|
2021-03-03 13:49:18 -08:00
|
|
|
intel_aux_map_get_num_buffers(struct intel_aux_map_context *ctx);
|
2018-03-28 01:10:06 -07:00
|
|
|
|
2022-11-11 12:34:46 -08:00
|
|
|
/**
|
|
|
|
|
* Returns the mask of meta data address in L1 entry
|
|
|
|
|
*
|
|
|
|
|
* The mask value is effected by page size of meta data specific to a platform.
|
|
|
|
|
*/
|
|
|
|
|
uint64_t
|
|
|
|
|
intel_aux_get_meta_address_mask(struct intel_aux_map_context *ctx);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the ratio between the granularity of main surface and AUX data
|
|
|
|
|
*/
|
|
|
|
|
uint64_t
|
|
|
|
|
intel_aux_get_main_to_aux_ratio(struct intel_aux_map_context *ctx);
|
|
|
|
|
|
2022-12-07 17:55:57 -08:00
|
|
|
/**
|
|
|
|
|
* Fill an array of exec_object2 with aux-map buffer handles
|
2018-03-28 01:10:06 -07:00
|
|
|
*
|
2021-03-03 13:49:18 -08:00
|
|
|
* The intel_aux_map_get_num_buffers call should be made, then the driver can
|
2018-03-28 01:10:06 -07:00
|
|
|
* make sure the `obj` array is large enough before calling this function.
|
|
|
|
|
*/
|
|
|
|
|
void
|
2021-03-03 13:49:18 -08:00
|
|
|
intel_aux_map_fill_bos(struct intel_aux_map_context *ctx, void **driver_bos,
|
2021-03-09 09:44:02 -08:00
|
|
|
uint32_t max_bos);
|
2018-03-28 01:10:06 -07:00
|
|
|
|
|
|
|
|
uint64_t
|
2021-03-03 13:49:18 -08:00
|
|
|
intel_aux_map_get_base(struct intel_aux_map_context *ctx);
|
2018-03-28 01:10:06 -07:00
|
|
|
|
2019-11-19 16:05:38 -08:00
|
|
|
uint64_t
|
2021-03-03 13:49:18 -08:00
|
|
|
intel_aux_map_format_bits(enum isl_tiling tiling, enum isl_format format,
|
2021-03-09 09:44:02 -08:00
|
|
|
uint8_t plane);
|
2019-11-19 16:05:38 -08:00
|
|
|
|
2020-01-21 14:23:41 -06:00
|
|
|
uint64_t
|
2021-03-03 13:49:18 -08:00
|
|
|
intel_aux_map_format_bits_for_isl_surf(const struct isl_surf *isl_surf);
|
2020-01-21 14:23:41 -06:00
|
|
|
|
|
|
|
|
uint64_t *
|
2021-03-03 13:49:18 -08:00
|
|
|
intel_aux_map_get_entry(struct intel_aux_map_context *ctx,
|
2021-03-09 09:44:02 -08:00
|
|
|
uint64_t address,
|
|
|
|
|
uint64_t *entry_address);
|
2020-01-21 14:23:41 -06:00
|
|
|
|
|
|
|
|
void
|
2021-03-03 13:49:18 -08:00
|
|
|
intel_aux_map_add_mapping(struct intel_aux_map_context *ctx, uint64_t address,
|
2021-03-09 09:44:02 -08:00
|
|
|
uint64_t aux_address, uint64_t main_size_B,
|
|
|
|
|
uint64_t format_bits);
|
2020-01-21 14:23:41 -06:00
|
|
|
|
2018-03-28 01:10:06 -07:00
|
|
|
void
|
2021-03-03 13:49:18 -08:00
|
|
|
intel_aux_map_unmap_range(struct intel_aux_map_context *ctx, uint64_t address,
|
2021-03-09 09:44:02 -08:00
|
|
|
uint64_t size);
|
2018-03-28 01:10:06 -07:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-03-03 13:20:06 -08:00
|
|
|
#endif /* INTEL_AUX_MAP_H */
|