drivers/gpu/drm/radeon/evergreen_cs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/radeon/evergreen_cs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/radeon/evergreen_cs.c- Extension
.c- Size
- 111579 bytes
- Lines
- 3760
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
radeon.hradeon_asic.hr600.hevergreend.hevergreen_reg_safe.hcayman_reg_safe.h
Detected Declarations
struct evergreen_cs_trackstruct eg_surfacefunction evergreen_cs_get_aray_modefunction evergreen_cs_get_num_banksfunction evergreen_cs_track_initfunction evergreen_surface_check_linearfunction evergreen_surface_check_linear_alignedfunction evergreen_surface_check_1dfunction evergreen_surface_check_2dfunction evergreen_surface_checkfunction evergreen_surface_value_conv_checkfunction evergreen_cs_track_validate_cbfunction ALIGNfunction evergreen_cs_track_validate_htilefunction evergreen_cs_track_validate_stencilfunction evergreen_cs_track_validate_depthfunction evergreen_cs_track_validate_texturefunction evergreen_cs_track_checkfunction evergreen_cs_packet_parse_vlinefunction evergreen_packet0_checkfunction evergreen_cs_parse_packet0function evergreen_cs_handle_regfunction evergreen_is_safe_regfunction evergreen_packet3_checkfunction evergreen_cs_parsefunction evergreen_dma_cs_parsefunction evergreen_vm_reg_validfunction evergreen_vm_packet3_checkfunction evergreen_ib_parsefunction evergreen_dma_ib_parse
Annotated Snippet
struct evergreen_cs_track {
u32 group_size;
u32 nbanks;
u32 npipes;
u32 row_size;
/* value we track */
u32 nsamples; /* unused */
struct radeon_bo *cb_color_bo[12];
u32 cb_color_bo_offset[12];
struct radeon_bo *cb_color_fmask_bo[8]; /* unused */
struct radeon_bo *cb_color_cmask_bo[8]; /* unused */
u32 cb_color_info[12];
u32 cb_color_view[12];
u32 cb_color_pitch[12];
u32 cb_color_slice[12];
u32 cb_color_slice_idx[12];
u32 cb_color_attrib[12];
u32 cb_color_cmask_slice[8];/* unused */
u32 cb_color_fmask_slice[8];/* unused */
u32 cb_target_mask;
u32 cb_shader_mask; /* unused */
u32 vgt_strmout_config;
u32 vgt_strmout_buffer_config;
struct radeon_bo *vgt_strmout_bo[4];
u32 vgt_strmout_bo_offset[4];
u32 vgt_strmout_size[4];
u32 db_depth_control;
u32 db_depth_view;
u32 db_depth_slice;
u32 db_depth_size;
u32 db_z_info;
u32 db_z_read_offset;
u32 db_z_write_offset;
struct radeon_bo *db_z_read_bo;
struct radeon_bo *db_z_write_bo;
u32 db_s_info;
u32 db_s_read_offset;
u32 db_s_write_offset;
struct radeon_bo *db_s_read_bo;
struct radeon_bo *db_s_write_bo;
bool sx_misc_kill_all_prims;
bool cb_dirty;
bool db_dirty;
bool streamout_dirty;
u32 htile_offset;
u32 htile_surface;
struct radeon_bo *htile_bo;
unsigned long indirect_draw_buffer_size;
const unsigned *reg_safe_bm;
};
static u32 evergreen_cs_get_aray_mode(u32 tiling_flags)
{
if (tiling_flags & RADEON_TILING_MACRO)
return ARRAY_2D_TILED_THIN1;
else if (tiling_flags & RADEON_TILING_MICRO)
return ARRAY_1D_TILED_THIN1;
else
return ARRAY_LINEAR_GENERAL;
}
static u32 evergreen_cs_get_num_banks(u32 nbanks)
{
switch (nbanks) {
case 2:
return ADDR_SURF_2_BANK;
case 4:
return ADDR_SURF_4_BANK;
case 8:
default:
return ADDR_SURF_8_BANK;
case 16:
return ADDR_SURF_16_BANK;
}
}
static void evergreen_cs_track_init(struct evergreen_cs_track *track)
{
int i;
for (i = 0; i < 8; i++) {
track->cb_color_fmask_bo[i] = NULL;
track->cb_color_cmask_bo[i] = NULL;
track->cb_color_cmask_slice[i] = 0;
track->cb_color_fmask_slice[i] = 0;
}
for (i = 0; i < 12; i++) {
track->cb_color_bo[i] = NULL;
track->cb_color_bo_offset[i] = 0xFFFFFFFF;
Annotation
- Immediate include surface: `radeon.h`, `radeon_asic.h`, `r600.h`, `evergreend.h`, `evergreen_reg_safe.h`, `cayman_reg_safe.h`.
- Detected declarations: `struct evergreen_cs_track`, `struct eg_surface`, `function evergreen_cs_get_aray_mode`, `function evergreen_cs_get_num_banks`, `function evergreen_cs_track_init`, `function evergreen_surface_check_linear`, `function evergreen_surface_check_linear_aligned`, `function evergreen_surface_check_1d`, `function evergreen_surface_check_2d`, `function evergreen_surface_check`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.