drivers/gpu/drm/msm/registers/gen_header.py
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/registers/gen_header.py
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/registers/gen_header.py- Extension
.py- Size
- 42047 bytes
- Lines
- 1221
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: drivers/gpu
- Status
- atlas-only
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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function printfunction printfunction printfunction printfunction printfunction print
Annotated Snippet
print(" return (struct fd_reg_pair) {")
print(" .reg = (uint32_t)%s," % reg.reg_offset())
print(" .value =")
cast = "(uint64_t)" if reg.bit_size == 64 else ""
for f in self.fields:
if f.type in ["address", "waddress"]:
continue
else:
type, val = f.ctype("fields.%s" % field_name(reg, f))
print(" (%s%-40s << %2d) |" % (cast, val, f.low))
value_name = "dword"
if reg.bit_size == 64:
value_name = "qword"
print(" fields.unknown | fields.%s," % (value_name,))
address = self.get_address_field()
if address:
print("#ifndef TU_CS_H")
print(" .bo = fields.bo,")
print(" .is_address = true,")
print(" .bo_offset = fields.bo_offset,")
print(" .bo_shift = %d," % address.shr)
print(" .bo_low = %d," % address.low)
print("#else")
print(" .is_address = true,")
print("#endif")
print(" };")
def dump_pack_struct(self, has_variants, reg=None):
if not reg:
return
prefix = reg.full_name
constexpr_mark = " CONSTEXPR"
print("struct %s {" % prefix)
for f in self.fields:
if f.type in ["address", "waddress"]:
print("#ifndef TU_CS_H")
tab_to(" __bo_type", "bo;")
tab_to(" uint32_t", "bo_offset;")
print("#endif\n")
continue
name = field_name(reg, f)
type, val = f.ctype("var")
tab_to(" %s" % type, "%s;" % name)
if f.type == "float":
# Requires using `fui()` or `_mesa_float_to_half()`
constexpr_mark = ""
if reg.bit_size == 64:
tab_to(" uint64_t", "qword;")
tab_to(" uint64_t", "unknown;")
else:
tab_to(" uint32_t", "dword;")
tab_to(" uint32_t", "unknown;")
print("};\n")
if not has_variants:
print("static%s inline struct fd_reg_pair" % constexpr_mark)
if reg.array:
print("pack_%s(uint32_t __i, struct %s fields)\n{" % (prefix, prefix))
else:
print("pack_%s(struct %s fields)\n{" % (prefix, prefix))
self.dump_regpair_builder(reg)
Annotation
- Detected declarations: `function print`, `function print`, `function print`, `function print`, `function print`, `function print`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: atlas-only.
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.