drivers/gpu/drm/tests/drm_sysfb_modeset_test.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/tests/drm_sysfb_modeset_test.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/tests/drm_sysfb_modeset_test.c- Extension
.c- Size
- 4197 bytes
- Lines
- 169
- 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
kunit/test.hdrm/drm_fourcc.hdrm/drm_kunit_helpers.h../sysfb/drm_sysfb_helper.h
Detected Declarations
struct sysfb_build_fourcc_list_casefunction sysfb_build_fourcc_list_case_descfunction drm_test_sysfb_build_fourcc_list
Annotated Snippet
struct sysfb_build_fourcc_list_case {
const char *name;
u32 native_fourccs[TEST_BUF_SIZE];
size_t native_fourccs_size;
u32 expected[TEST_BUF_SIZE];
size_t expected_fourccs_size;
};
static struct sysfb_build_fourcc_list_case sysfb_build_fourcc_list_cases[] = {
{
.name = "no native formats",
.native_fourccs = { },
.native_fourccs_size = 0,
.expected = { DRM_FORMAT_XRGB8888 },
.expected_fourccs_size = 1,
},
{
.name = "XRGB8888 as native format",
.native_fourccs = { DRM_FORMAT_XRGB8888 },
.native_fourccs_size = 1,
.expected = { DRM_FORMAT_XRGB8888 },
.expected_fourccs_size = 1,
},
{
.name = "remove duplicates",
.native_fourccs = {
DRM_FORMAT_XRGB8888,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_RGB888,
DRM_FORMAT_RGB888,
DRM_FORMAT_RGB888,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_RGB888,
DRM_FORMAT_RGB565,
DRM_FORMAT_RGB888,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_RGB565,
DRM_FORMAT_RGB565,
DRM_FORMAT_XRGB8888,
},
.native_fourccs_size = 11,
.expected = {
DRM_FORMAT_XRGB8888,
DRM_FORMAT_RGB888,
DRM_FORMAT_RGB565,
},
.expected_fourccs_size = 3,
},
{
.name = "convert alpha formats",
.native_fourccs = {
DRM_FORMAT_ARGB1555,
DRM_FORMAT_ABGR1555,
DRM_FORMAT_RGBA5551,
DRM_FORMAT_BGRA5551,
DRM_FORMAT_ARGB8888,
DRM_FORMAT_ABGR8888,
DRM_FORMAT_RGBA8888,
DRM_FORMAT_BGRA8888,
DRM_FORMAT_ARGB2101010,
DRM_FORMAT_ABGR2101010,
DRM_FORMAT_RGBA1010102,
DRM_FORMAT_BGRA1010102,
},
.native_fourccs_size = 12,
.expected = {
DRM_FORMAT_XRGB1555,
DRM_FORMAT_XBGR1555,
DRM_FORMAT_RGBX5551,
DRM_FORMAT_BGRX5551,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_XBGR8888,
DRM_FORMAT_RGBX8888,
DRM_FORMAT_BGRX8888,
DRM_FORMAT_XRGB2101010,
DRM_FORMAT_XBGR2101010,
DRM_FORMAT_RGBX1010102,
DRM_FORMAT_BGRX1010102,
},
.expected_fourccs_size = 12,
},
{
.name = "random formats",
.native_fourccs = {
DRM_FORMAT_Y212,
DRM_FORMAT_ARGB1555,
DRM_FORMAT_ABGR16161616F,
DRM_FORMAT_C8,
DRM_FORMAT_BGR888,
DRM_FORMAT_XRGB1555,
Annotation
- Immediate include surface: `kunit/test.h`, `drm/drm_fourcc.h`, `drm/drm_kunit_helpers.h`, `../sysfb/drm_sysfb_helper.h`.
- Detected declarations: `struct sysfb_build_fourcc_list_case`, `function sysfb_build_fourcc_list_case_desc`, `function drm_test_sysfb_build_fourcc_list`.
- 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.