drivers/gpu/drm/i915/gt/st_shmem_utils.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/st_shmem_utils.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/st_shmem_utils.c- Extension
.c- Size
- 1168 bytes
- Lines
- 64
- 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.
- 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 igt_shmem_basicfunction shmem_utils_mock_selftests
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2020 Intel Corporation
*/
/* Just a quick and causal check of the shmem_utils API */
static int igt_shmem_basic(void *ignored)
{
u32 datum = 0xdeadbeef, result;
struct file *file;
u32 *map;
int err;
file = shmem_create_from_data("mock", &datum, sizeof(datum));
if (IS_ERR(file))
return PTR_ERR(file);
result = 0;
err = shmem_read(file, 0, &result, sizeof(result));
if (err)
goto out_file;
if (result != datum) {
pr_err("Incorrect read back from shmemfs: %x != %x\n",
result, datum);
err = -EINVAL;
goto out_file;
}
result = 0xc0ffee;
err = shmem_write(file, 0, &result, sizeof(result));
if (err)
goto out_file;
map = shmem_pin_map(file);
if (!map) {
err = -ENOMEM;
goto out_file;
}
if (*map != result) {
pr_err("Incorrect read back via mmap of last write: %x != %x\n",
*map, result);
err = -EINVAL;
goto out_map;
}
out_map:
shmem_unpin_map(file, map);
out_file:
fput(file);
return err;
}
int shmem_utils_mock_selftests(void)
{
static const struct i915_subtest tests[] = {
SUBTEST(igt_shmem_basic),
};
return i915_subtests(tests, NULL);
}
Annotation
- Detected declarations: `function igt_shmem_basic`, `function shmem_utils_mock_selftests`.
- 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.