drivers/gpu/drm/vc4/tests/vc4_mock_crtc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/vc4/tests/vc4_mock_crtc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/vc4/tests/vc4_mock_crtc.c- Extension
.c- Size
- 1068 bytes
- Lines
- 42
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
drm/drm_atomic_state_helper.hdrm/drm_modeset_helper_vtables.hkunit/test.hvc4_mock.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_modeset_helper_vtables.h>
#include <kunit/test.h>
#include "vc4_mock.h"
static const struct drm_crtc_helper_funcs vc4_dummy_crtc_helper_funcs = {
.atomic_check = vc4_crtc_atomic_check,
};
static const struct drm_crtc_funcs vc4_dummy_crtc_funcs = {
.atomic_destroy_state = vc4_crtc_destroy_state,
.atomic_duplicate_state = vc4_crtc_duplicate_state,
.reset = vc4_crtc_reset,
};
struct vc4_dummy_crtc *vc4_mock_pv(struct kunit *test,
struct drm_device *drm,
struct drm_plane *plane,
const struct vc4_crtc_data *data)
{
struct vc4_dummy_crtc *dummy_crtc;
struct vc4_crtc *vc4_crtc;
int ret;
dummy_crtc = drmm_kzalloc(drm, sizeof(*dummy_crtc), GFP_KERNEL);
KUNIT_ASSERT_NOT_NULL(test, dummy_crtc);
vc4_crtc = &dummy_crtc->crtc;
ret = __vc4_crtc_init(drm, NULL,
vc4_crtc, data, plane,
&vc4_dummy_crtc_funcs,
&vc4_dummy_crtc_helper_funcs,
false);
KUNIT_ASSERT_EQ(test, ret, 0);
return dummy_crtc;
}
Annotation
- Immediate include surface: `drm/drm_atomic_state_helper.h`, `drm/drm_modeset_helper_vtables.h`, `kunit/test.h`, `vc4_mock.h`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.