Path: blob/21.2-virgl/src/freedreno/common/freedreno_dev_info.h
4565 views
/*1* Copyright © 2020 Valve Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*22*/2324#ifndef FREEDRENO_DEVICE_INFO_H25#define FREEDRENO_DEVICE_INFO_H2627#include <stdbool.h>28#include <stdint.h>2930#ifdef __cplusplus31extern "C" {32#endif3334/**35* Freedreno hardware description and quirks36*/3738struct fd_dev_info {39/* alignment for size of tiles */40uint32_t tile_align_w, tile_align_h;41/* gmem load/store granularity */42uint32_t gmem_align_w, gmem_align_h;43/* max tile size */44uint32_t tile_max_w, tile_max_h;4546uint32_t num_vsc_pipes;4748/* number of CCU is always equal to the number of SP */49union {50uint32_t num_sp_cores;51uint32_t num_ccu;52};5354union {55struct {56/* Information for private memory calculations */57uint32_t fibers_per_sp;5859uint32_t reg_size_vec4;6061/* Whether the PC_MULTIVIEW_MASK register exists. */62bool supports_multiview_mask;6364/* info for setting RB_CCU_CNTL */65bool ccu_cntl_gmem_unk2;66bool has_z24uint_s8uint;6768bool tess_use_shared;6970/* newer a6xx allows using 16-bit descriptor for both 16-bit71* and 32-bit access72*/73bool storage_16bit;7475/* The latest known a630_sqe.fw fails to wait for WFI before76* reading the indirect buffer when using CP_DRAW_INDIRECT_MULTI,77* so we have to fall back to CP_WAIT_FOR_ME except for a65078* which has a fixed firmware.79*80* TODO: There may be newer a630_sqe.fw released in the future81* which fixes this, if so we should detect it and avoid this82* workaround. Once we have uapi to query fw version, we can83* replace this with minimum fw version.84*/85bool indirect_draw_wfm_quirk;8687bool has_tex_filter_cubic;8889bool has_sample_locations;9091/* The firmware on newer a6xx drops CP_REG_WRITE support as we92* can now use direct register writes for these regs.93*/94bool has_cp_reg_write;9596bool has_8bpp_ubwc;9798struct {99uint32_t RB_UNKNOWN_8E04_blit;100uint32_t PC_UNKNOWN_9805;101uint32_t SP_UNKNOWN_A0F8;102} magic;103} a6xx;104};105};106107struct fd_dev_id {108uint32_t gpu_id;109const char *name;110const struct fd_dev_info *info;111};112113/* per CCU GMEM amount reserved for depth cache for direct rendering */114#define A6XX_CCU_DEPTH_SIZE (64 * 1024)115/* per CCU GMEM amount reserved for color cache used by GMEM resolves116* which require color cache (non-BLIT event case).117* this is smaller than what is normally used by direct rendering118* (RB_CCU_CNTL.GMEM bit enables this smaller size)119* if a GMEM resolve requires color cache, the driver needs to make sure120* it will not overwrite pixel data in GMEM that is still needed121*/122#define A6XX_CCU_GMEM_COLOR_SIZE (16 * 1024)123124const struct fd_dev_info * fd_dev_info(uint32_t gpu_id);125const char * fd_dev_name(uint32_t gpu_id);126127#ifdef __cplusplus128} /* end of extern "C" */129#endif130131#endif /* FREEDRENO_DEVICE_INFO_H */132133134