17ec681f3Smrg/* 27ec681f3Smrg * Copyright © 2020 Advanced Micro Devices, Inc. 37ec681f3Smrg * 47ec681f3Smrg * Permission is hereby granted, free of charge, to any person obtaining 57ec681f3Smrg * a copy of this software and associated documentation files (the 67ec681f3Smrg * "Software"), to deal in the Software without restriction, including 77ec681f3Smrg * without limitation the rights to use, copy, modify, merge, publish, 87ec681f3Smrg * distribute, sub license, and/or sell copies of the Software, and to 97ec681f3Smrg * permit persons to whom the Software is furnished to do so, subject to 107ec681f3Smrg * the following conditions: 117ec681f3Smrg * 127ec681f3Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 137ec681f3Smrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 147ec681f3Smrg * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 157ec681f3Smrg * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS 167ec681f3Smrg * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 177ec681f3Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 187ec681f3Smrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 197ec681f3Smrg * USE OR OTHER DEALINGS IN THE SOFTWARE. 207ec681f3Smrg * 217ec681f3Smrg * The above copyright notice and this permission notice (including the 227ec681f3Smrg * next paragraph) shall be included in all copies or substantial portions 237ec681f3Smrg * of the Software. 247ec681f3Smrg */ 257ec681f3Smrg 267ec681f3Smrg#ifndef AC_SHADOWED_REGS 277ec681f3Smrg#define AC_SHADOWED_REGS 287ec681f3Smrg 297ec681f3Smrg#include "ac_gpu_info.h" 307ec681f3Smrg 317ec681f3Smrgstruct radeon_cmdbuf; 327ec681f3Smrg 337ec681f3Smrgstruct ac_reg_range { 347ec681f3Smrg unsigned offset; 357ec681f3Smrg unsigned size; 367ec681f3Smrg}; 377ec681f3Smrg 387ec681f3Smrgenum ac_reg_range_type 397ec681f3Smrg{ 407ec681f3Smrg SI_REG_RANGE_UCONFIG, 417ec681f3Smrg SI_REG_RANGE_CONTEXT, 427ec681f3Smrg SI_REG_RANGE_SH, 437ec681f3Smrg SI_REG_RANGE_CS_SH, 447ec681f3Smrg SI_NUM_SHADOWED_REG_RANGES, 457ec681f3Smrg 467ec681f3Smrg SI_REG_RANGE_NON_SHADOWED = SI_NUM_SHADOWED_REG_RANGES, 477ec681f3Smrg SI_NUM_ALL_REG_RANGES, 487ec681f3Smrg}; 497ec681f3Smrg 507ec681f3Smrg#ifdef __cplusplus 517ec681f3Smrgextern "C" { 527ec681f3Smrg#endif 537ec681f3Smrg 547ec681f3Smrgtypedef void (*set_context_reg_seq_array_fn)(struct radeon_cmdbuf *cs, unsigned reg, unsigned num, 557ec681f3Smrg const uint32_t *values); 567ec681f3Smrg 577ec681f3Smrgvoid ac_get_reg_ranges(enum chip_class chip_class, enum radeon_family family, 587ec681f3Smrg enum ac_reg_range_type type, unsigned *num_ranges, 597ec681f3Smrg const struct ac_reg_range **ranges); 607ec681f3Smrgvoid ac_emulate_clear_state(const struct radeon_info *info, struct radeon_cmdbuf *cs, 617ec681f3Smrg set_context_reg_seq_array_fn set_context_reg_seq_array); 627ec681f3Smrgvoid ac_check_shadowed_regs(enum chip_class chip_class, enum radeon_family family, 637ec681f3Smrg unsigned reg_offset, unsigned count); 647ec681f3Smrgvoid ac_print_shadowed_regs(const struct radeon_info *info); 657ec681f3Smrg 667ec681f3Smrg#ifdef __cplusplus 677ec681f3Smrg} 687ec681f3Smrg#endif 697ec681f3Smrg 707ec681f3Smrg 717ec681f3Smrg#endif 72