drivers/gpu/drm/exynos/exynos_drm_fb.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/exynos/exynos_drm_fb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/exynos/exynos_drm_fb.c- Extension
.c- Size
- 4396 bytes
- Lines
- 184
- 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.hdrm/drm_atomic_helper.hdrm/drm_crtc.hdrm/drm_framebuffer.hdrm/drm_fourcc.hdrm/drm_gem_framebuffer_helper.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/exynos_drm.hexynos_drm_crtc.hexynos_drm_drv.hexynos_drm_fb.hexynos_drm_fbdev.hexynos_drm_gem.h
Detected Declarations
function Copyrightfunction exynos_drm_framebuffer_initfunction exynos_user_fb_createfunction exynos_drm_fb_dma_addrfunction exynos_drm_mode_config_init
Annotated Snippet
if (!exynos_gem[i]) {
DRM_DEV_ERROR(dev->dev,
"failed to lookup gem object\n");
ret = -ENOENT;
goto err;
}
if (size > exynos_gem[i]->base.size) {
i++;
ret = -EINVAL;
goto err;
}
}
fb = exynos_drm_framebuffer_init(dev, info, mode_cmd, exynos_gem, i);
if (IS_ERR(fb)) {
ret = PTR_ERR(fb);
goto err;
}
return fb;
err:
while (i--)
exynos_drm_gem_put(exynos_gem[i]);
return ERR_PTR(ret);
}
dma_addr_t exynos_drm_fb_dma_addr(struct drm_framebuffer *fb, int index)
{
struct exynos_drm_gem *exynos_gem;
if (WARN_ON_ONCE(index >= DRM_FORMAT_MAX_PLANES))
return 0;
exynos_gem = to_exynos_gem(fb->obj[index]);
return exynos_gem->dma_addr + fb->offsets[index];
}
static struct drm_mode_config_helper_funcs exynos_drm_mode_config_helpers = {
.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
};
static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = {
.fb_create = exynos_user_fb_create,
.atomic_check = drm_atomic_helper_check,
.atomic_commit = drm_atomic_helper_commit,
};
void exynos_drm_mode_config_init(struct drm_device *dev)
{
dev->mode_config.min_width = 0;
dev->mode_config.min_height = 0;
/*
* set max width and height as default value(4096x4096).
* this value would be used to check framebuffer size limitation
* at drm_mode_addfb().
*/
dev->mode_config.max_width = 4096;
dev->mode_config.max_height = 4096;
dev->mode_config.funcs = &exynos_drm_mode_config_funcs;
dev->mode_config.helper_private = &exynos_drm_mode_config_helpers;
dev->mode_config.normalize_zpos = true;
}
Annotation
- Immediate include surface: `drm/drm_atomic.h`, `drm/drm_atomic_helper.h`, `drm/drm_crtc.h`, `drm/drm_framebuffer.h`, `drm/drm_fourcc.h`, `drm/drm_gem_framebuffer_helper.h`, `drm/drm_print.h`, `drm/drm_probe_helper.h`.
- Detected declarations: `function Copyright`, `function exynos_drm_framebuffer_init`, `function exynos_user_fb_create`, `function exynos_drm_fb_dma_addr`, `function exynos_drm_mode_config_init`.
- 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.