intel/aux_map: add helper to compute offset in aux data

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26822>
This commit is contained in:
Lionel Landwerlin
2023-12-27 10:27:21 +02:00
committed by Marge Bot
parent c0889a127b
commit bd197c6bcf
2 changed files with 15 additions and 0 deletions

View File

@@ -248,6 +248,13 @@ intel_aux_get_main_to_aux_ratio(struct intel_aux_map_context *ctx)
return ctx->format->main_to_aux_ratio;
}
uint64_t
intel_aux_main_to_aux_offset(struct intel_aux_map_context *ctx,
uint64_t main_offset)
{
return main_offset / ctx->format->main_to_aux_ratio;
}
static const struct aux_format_info *
get_format(enum intel_aux_map_format format)
{

View File

@@ -84,6 +84,14 @@ intel_aux_get_meta_address_mask(struct intel_aux_map_context *ctx);
uint64_t
intel_aux_get_main_to_aux_ratio(struct intel_aux_map_context *ctx);
/**
* Takes a relative offset in the main surface and returns a relative offset
* in the aux surface that maps to the main offset.
*/
uint64_t
intel_aux_main_to_aux_offset(struct intel_aux_map_context *ctx,
uint64_t main_offset);
/**
* Fill an array of exec_object2 with aux-map buffer handles
*