drivers/gpu/drm/gma500/fbdev.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/gma500/fbdev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/gma500/fbdev.c- Extension
.c- Size
- 5266 bytes
- Lines
- 196
- 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
linux/fb.hdrm/drm_crtc_helper.hdrm/drm_drv.hdrm/drm_fb_helper.hdrm/drm_framebuffer.hgem.hpsb_drv.h
Detected Declarations
function Copyrightfunction psb_fbdev_fb_mmapfunction psb_fbdev_fb_destroyfunction psb_fbdev_driver_fbdev_probe
Annotated Snippet
if (ret == -EBUSY && sizes->surface_bpp > 16) {
/*
* If the mode does not fit in 32 bit then switch to 16 bit to
* get a console on full resolution. User-space compositors will
* allocate their own 32-bit framebuffers.
*/
sizes->surface_bpp = 16;
sizes->surface_depth = 16;
goto try_psb_gem_create;
}
return ret;
}
obj = &backing->base;
ret = drm_gem_handle_create(file, obj, &handle);
if (ret)
goto err_drm_gem_object_put;
buffer = drm_client_buffer_create(client, sizes->surface_width, sizes->surface_height,
fourcc, handle, pitch);
if (IS_ERR(buffer)) {
ret = PTR_ERR(buffer);
goto err_drm_gem_handle_delete;
}
fb_helper->funcs = &psb_fbdev_fb_helper_funcs;
fb_helper->buffer = buffer;
fb_helper->fb = buffer->fb;
info->fbops = &psb_fbdev_fb_ops;
/* Accessed stolen memory directly */
info->screen_base = dev_priv->vram_addr + backing->offset;
info->screen_size = obj->size;
drm_fb_helper_fill_info(info, fb_helper, sizes);
info->fix.smem_start = dev_priv->stolen_base + backing->offset;
info->fix.smem_len = obj->size;
info->fix.ywrapstep = 0;
info->fix.ypanstep = 0;
info->fix.mmio_start = pci_resource_start(pdev, 0);
info->fix.mmio_len = pci_resource_len(pdev, 0);
fb_memset_io(info->screen_base, 0, info->screen_size);
/* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
dev_dbg(dev->dev, "allocated %dx%d fb\n", buffer->fb->width, buffer->fb->height);
/* The handle is only needed for creating the framebuffer.*/
drm_gem_handle_delete(file, handle);
/* The framebuffer still holds a references on the GEM object. */
drm_gem_object_put(obj);
return 0;
err_drm_gem_handle_delete:
drm_gem_handle_delete(file, handle);
err_drm_gem_object_put:
drm_gem_object_put(obj);
return ret;
}
Annotation
- Immediate include surface: `linux/fb.h`, `drm/drm_crtc_helper.h`, `drm/drm_drv.h`, `drm/drm_fb_helper.h`, `drm/drm_framebuffer.h`, `gem.h`, `psb_drv.h`.
- Detected declarations: `function Copyright`, `function psb_fbdev_fb_mmap`, `function psb_fbdev_fb_destroy`, `function psb_fbdev_driver_fbdev_probe`.
- 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.