drivers/gpu/drm/exynos/exynos_drm_ipp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/exynos/exynos_drm_ipp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/exynos/exynos_drm_ipp.c- Extension
.c- Size
- 25414 bytes
- Lines
- 944
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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
linux/uaccess.hdrm/drm_blend.hdrm/drm_file.hdrm/drm_fourcc.hdrm/drm_mode.hdrm/drm_print.hdrm/exynos_drm.hexynos_drm_drv.hexynos_drm_gem.hexynos_drm_ipp.h
Detected Declarations
struct drm_pending_exynos_ipp_eventstruct drm_ipp_limitenum drm_ipp_size_idfunction exynos_drm_ipp_registerfunction exynos_drm_ipp_unregisterfunction exynos_drm_ipp_get_res_ioctlfunction list_for_each_entryfunction exynos_drm_ipp_get_caps_ioctlfunction exynos_drm_ipp_get_limits_ioctlfunction exynos_drm_ipp_task_allocfunction exynos_drm_ipp_task_setfunction exynos_drm_ipp_task_setup_bufferfunction exynos_drm_ipp_task_release_buffunction exynos_drm_ipp_task_freefunction __limit_set_valfunction __get_size_limitfunction __align_checkfunction __size_limit_checkfunction exynos_drm_ipp_check_size_limitsfunction __scale_limit_checkfunction exynos_drm_ipp_check_scale_limitsfunction exynos_drm_ipp_check_formatfunction exynos_drm_ipp_task_checkfunction exynos_drm_ipp_task_setup_buffersfunction exynos_drm_ipp_event_createfunction exynos_drm_ipp_event_sendfunction exynos_drm_ipp_task_cleanupfunction exynos_drm_ipp_cleanup_workfunction exynos_drm_ipp_task_donefunction exynos_drm_ipp_next_taskfunction exynos_drm_ipp_schedule_taskfunction exynos_drm_ipp_task_abortfunction exynos_drm_ipp_commit_ioctlfunction exynos_drm_ipp_task_done
Annotated Snippet
struct drm_pending_exynos_ipp_event {
struct drm_pending_event base;
struct drm_exynos_ipp_event event;
};
static inline struct exynos_drm_ipp_task *
exynos_drm_ipp_task_alloc(struct exynos_drm_ipp *ipp)
{
struct exynos_drm_ipp_task *task;
task = kzalloc_obj(*task);
if (!task)
return NULL;
task->dev = ipp->dev;
task->ipp = ipp;
/* some defaults */
task->src.rect.w = task->dst.rect.w = UINT_MAX;
task->src.rect.h = task->dst.rect.h = UINT_MAX;
task->transform.rotation = DRM_MODE_ROTATE_0;
DRM_DEV_DEBUG_DRIVER(task->dev, "Allocated task %p\n", task);
return task;
}
static const struct exynos_drm_param_map {
unsigned int id;
unsigned int size;
unsigned int offset;
} exynos_drm_ipp_params_maps[] = {
{
DRM_EXYNOS_IPP_TASK_BUFFER | DRM_EXYNOS_IPP_TASK_TYPE_SOURCE,
sizeof(struct drm_exynos_ipp_task_buffer),
offsetof(struct exynos_drm_ipp_task, src.buf),
}, {
DRM_EXYNOS_IPP_TASK_BUFFER |
DRM_EXYNOS_IPP_TASK_TYPE_DESTINATION,
sizeof(struct drm_exynos_ipp_task_buffer),
offsetof(struct exynos_drm_ipp_task, dst.buf),
}, {
DRM_EXYNOS_IPP_TASK_RECTANGLE | DRM_EXYNOS_IPP_TASK_TYPE_SOURCE,
sizeof(struct drm_exynos_ipp_task_rect),
offsetof(struct exynos_drm_ipp_task, src.rect),
}, {
DRM_EXYNOS_IPP_TASK_RECTANGLE |
DRM_EXYNOS_IPP_TASK_TYPE_DESTINATION,
sizeof(struct drm_exynos_ipp_task_rect),
offsetof(struct exynos_drm_ipp_task, dst.rect),
}, {
DRM_EXYNOS_IPP_TASK_TRANSFORM,
sizeof(struct drm_exynos_ipp_task_transform),
offsetof(struct exynos_drm_ipp_task, transform),
}, {
DRM_EXYNOS_IPP_TASK_ALPHA,
sizeof(struct drm_exynos_ipp_task_alpha),
offsetof(struct exynos_drm_ipp_task, alpha),
},
};
static int exynos_drm_ipp_task_set(struct exynos_drm_ipp_task *task,
struct drm_exynos_ioctl_ipp_commit *arg)
{
const struct exynos_drm_param_map *map = exynos_drm_ipp_params_maps;
void __user *params = (void __user *)(unsigned long)arg->params_ptr;
unsigned int size = arg->params_size;
uint32_t id;
int i;
while (size) {
if (get_user(id, (uint32_t __user *)params))
return -EFAULT;
for (i = 0; i < ARRAY_SIZE(exynos_drm_ipp_params_maps); i++)
if (map[i].id == id)
break;
if (i == ARRAY_SIZE(exynos_drm_ipp_params_maps) ||
map[i].size > size)
return -EINVAL;
if (copy_from_user((void *)task + map[i].offset, params,
map[i].size))
return -EFAULT;
params += map[i].size;
size -= map[i].size;
}
DRM_DEV_DEBUG_DRIVER(task->dev,
Annotation
- Immediate include surface: `linux/uaccess.h`, `drm/drm_blend.h`, `drm/drm_file.h`, `drm/drm_fourcc.h`, `drm/drm_mode.h`, `drm/drm_print.h`, `drm/exynos_drm.h`, `exynos_drm_drv.h`.
- Detected declarations: `struct drm_pending_exynos_ipp_event`, `struct drm_ipp_limit`, `enum drm_ipp_size_id`, `function exynos_drm_ipp_register`, `function exynos_drm_ipp_unregister`, `function exynos_drm_ipp_get_res_ioctl`, `function list_for_each_entry`, `function exynos_drm_ipp_get_caps_ioctl`, `function exynos_drm_ipp_get_limits_ioctl`, `function exynos_drm_ipp_task_alloc`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.