drivers/gpu/drm/i915/selftests/mock_request.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/selftests/mock_request.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/selftests/mock_request.c- Extension
.c- Size
- 1973 bytes
- Lines
- 60
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
gem/selftests/igt_gem_utils.hgt/mock_engine.hmock_request.h
Detected Declarations
function filesfunction mock_cancel_request
Annotated Snippet
#include "gem/selftests/igt_gem_utils.h"
#include "gt/mock_engine.h"
#include "mock_request.h"
struct i915_request *
mock_request(struct intel_context *ce, unsigned long delay)
{
struct i915_request *request;
/* NB the i915->requests slab cache is enlarged to fit mock_request */
request = intel_context_create_request(ce);
if (IS_ERR(request))
return request;
request->mock.delay = delay;
return request;
}
bool mock_cancel_request(struct i915_request *request)
{
struct mock_engine *engine =
container_of(request->engine, typeof(*engine), base);
bool was_queued;
spin_lock_irq(&engine->hw_lock);
was_queued = !list_empty(&request->mock.link);
list_del_init(&request->mock.link);
spin_unlock_irq(&engine->hw_lock);
if (was_queued)
i915_request_unsubmit(request);
return was_queued;
}
Annotation
- Immediate include surface: `gem/selftests/igt_gem_utils.h`, `gt/mock_engine.h`, `mock_request.h`.
- Detected declarations: `function files`, `function mock_cancel_request`.
- 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.