Path: blob/21.2-virgl/src/amd/common/ac_shadowed_regs.h
7263 views
/*1* Copyright © 2020 Advanced Micro Devices, Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining4* a copy of this software and associated documentation files (the5* "Software"), to deal in the Software without restriction, including6* without limitation the rights to use, copy, modify, merge, publish,7* distribute, sub license, and/or sell copies of the Software, and to8* permit persons to whom the Software is furnished to do so, subject to9* the following conditions:10*11* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,12* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES13* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND14* NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS15* AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER16* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,17* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE18* USE OR OTHER DEALINGS IN THE SOFTWARE.19*20* The above copyright notice and this permission notice (including the21* next paragraph) shall be included in all copies or substantial portions22* of the Software.23*/2425#ifndef AC_SHADOWED_REGS26#define AC_SHADOWED_REGS2728#include "ac_gpu_info.h"2930struct radeon_cmdbuf;3132struct ac_reg_range {33unsigned offset;34unsigned size;35};3637enum ac_reg_range_type38{39SI_REG_RANGE_UCONFIG,40SI_REG_RANGE_CONTEXT,41SI_REG_RANGE_SH,42SI_REG_RANGE_CS_SH,43SI_NUM_SHADOWED_REG_RANGES,4445SI_REG_RANGE_NON_SHADOWED = SI_NUM_SHADOWED_REG_RANGES,46SI_NUM_ALL_REG_RANGES,47};4849#ifdef __cplusplus50extern "C" {51#endif5253typedef void (*set_context_reg_seq_array_fn)(struct radeon_cmdbuf *cs, unsigned reg, unsigned num,54const uint32_t *values);5556void ac_get_reg_ranges(enum chip_class chip_class, enum radeon_family family,57enum ac_reg_range_type type, unsigned *num_ranges,58const struct ac_reg_range **ranges);59void ac_emulate_clear_state(const struct radeon_info *info, struct radeon_cmdbuf *cs,60set_context_reg_seq_array_fn set_context_reg_seq_array);61void ac_check_shadowed_regs(enum chip_class chip_class, enum radeon_family family,62unsigned reg_offset, unsigned count);63void ac_print_shadowed_regs(const struct radeon_info *info);6465#ifdef __cplusplus66}67#endif686970#endif717273