drivers/gpu/drm/imagination/pvr_hwrt.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/imagination/pvr_hwrt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/imagination/pvr_hwrt.c- Extension
.c- Size
- 14732 bytes
- Lines
- 547
- 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.
- 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
pvr_free_list.hpvr_hwrt.hpvr_gem.hpvr_rogue_cr_defs_client.hpvr_rogue_fwif.hdrm/drm_gem.hlinux/bitops.hlinux/math.hlinux/slab.hlinux/xarray.huapi/drm/pvr_drm.h
Detected Declarations
struct pvr_rt_mtile_infofunction hwrt_init_kernel_structurefunction hwrt_fini_kernel_structurefunction hwrt_fini_common_fw_structurefunction get_cr_isp_mtile_size_valfunction get_cr_multisamplectl_valfunction get_cr_te_aa_valfunction hwrtdata_common_initfunction hwrt_init_common_fw_structurefunction hwrt_fw_data_initfunction hwrt_data_init_fw_structurefunction hwrt_data_fini_fw_structurefunction pvr_hwrt_dataset_createfunction pvr_hwrt_dataset_releasefunction pvr_destroy_hwrt_datasets_for_filefunction xa_for_eachfunction pvr_hwrt_dataset_put
Annotated Snippet
struct pvr_rt_mtile_info {
u32 mtile_x[3];
u32 mtile_y[3];
u32 tile_max_x;
u32 tile_max_y;
u32 tile_size_x;
u32 tile_size_y;
u32 num_tiles_x;
u32 num_tiles_y;
};
/* Size of Shadow Render Target Cache entry */
#define SRTC_ENTRY_SIZE sizeof(u32)
/* Size of Renders Accumulation Array entry */
#define RAA_ENTRY_SIZE sizeof(u32)
static int
hwrt_init_kernel_structure(struct pvr_file *pvr_file,
struct drm_pvr_ioctl_create_hwrt_dataset_args *args,
struct pvr_hwrt_dataset *hwrt)
{
struct pvr_device *pvr_dev = pvr_file->pvr_dev;
int err;
hwrt->pvr_dev = pvr_dev;
hwrt->max_rts = args->layers;
/* Get pointers to the free lists */
for (int i = 0; i < ARRAY_SIZE(hwrt->free_lists); i++) {
hwrt->free_lists[i] = pvr_free_list_lookup(pvr_file, args->free_list_handles[i]);
if (!hwrt->free_lists[i]) {
err = -EINVAL;
goto err_put_free_lists;
}
}
if (hwrt->free_lists[ROGUE_FW_LOCAL_FREELIST]->current_pages <
pvr_get_free_list_min_pages(pvr_dev)) {
err = -EINVAL;
goto err_put_free_lists;
}
return 0;
err_put_free_lists:
for (int i = 0; i < ARRAY_SIZE(hwrt->free_lists); i++) {
pvr_free_list_put(hwrt->free_lists[i]);
hwrt->free_lists[i] = NULL;
}
return err;
}
static void
hwrt_fini_kernel_structure(struct pvr_hwrt_dataset *hwrt)
{
for (int i = 0; i < ARRAY_SIZE(hwrt->free_lists); i++) {
pvr_free_list_put(hwrt->free_lists[i]);
hwrt->free_lists[i] = NULL;
}
}
static void
hwrt_fini_common_fw_structure(struct pvr_hwrt_dataset *hwrt)
{
pvr_fw_object_destroy(hwrt->common_fw_obj);
}
static int
get_cr_isp_mtile_size_val(struct pvr_device *pvr_dev, u32 samples,
struct pvr_rt_mtile_info *info, u32 *value_out)
{
u32 x = info->mtile_x[0];
u32 y = info->mtile_y[0];
u32 samples_per_pixel;
int err;
err = PVR_FEATURE_VALUE(pvr_dev, isp_samples_per_pixel, &samples_per_pixel);
if (err)
return err;
if (samples_per_pixel == 1) {
if (samples >= 4)
x <<= 1;
if (samples >= 2)
y <<= 1;
} else if (samples_per_pixel == 2) {
if (samples >= 8)
x <<= 1;
if (samples >= 4)
Annotation
- Immediate include surface: `pvr_free_list.h`, `pvr_hwrt.h`, `pvr_gem.h`, `pvr_rogue_cr_defs_client.h`, `pvr_rogue_fwif.h`, `drm/drm_gem.h`, `linux/bitops.h`, `linux/math.h`.
- Detected declarations: `struct pvr_rt_mtile_info`, `function hwrt_init_kernel_structure`, `function hwrt_fini_kernel_structure`, `function hwrt_fini_common_fw_structure`, `function get_cr_isp_mtile_size_val`, `function get_cr_multisamplectl_val`, `function get_cr_te_aa_val`, `function hwrtdata_common_init`, `function hwrt_init_common_fw_structure`, `function hwrt_fw_data_init`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.