drivers/gpu/drm/omapdrm/dss/base.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/omapdrm/dss/base.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/omapdrm/dss/base.c- Extension
.c- Size
- 5861 bytes
- Lines
- 282
- 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
linux/kernel.hlinux/list.hlinux/module.hlinux/mutex.hlinux/of.hlinux/of_graph.hlinux/platform_device.hdss.homapdss.h
Detected Declarations
struct omapdss_comp_nodefunction Copyrightfunction omapdss_device_registerfunction omapdss_device_unregisterfunction omapdss_device_is_registeredfunction list_for_each_entryfunction omapdss_device_putfunction list_for_each_entryfunction list_for_each_entryfunction omapdss_device_is_connectedfunction omapdss_device_connectfunction omapdss_device_disconnectfunction omapdss_list_containsfunction list_for_each_entryfunction omapdss_walk_devicefunction for_each_endpoint_of_nodefunction omapdss_gather_componentsfunction omapdss_component_is_loadedfunction omapdss_stack_is_readyfunction list_for_each_entry
Annotated Snippet
struct omapdss_comp_node {
struct list_head list;
struct device_node *node;
bool dss_core_component;
const char *compat;
};
static bool omapdss_list_contains(const struct device_node *node)
{
struct omapdss_comp_node *comp;
list_for_each_entry(comp, &omapdss_comp_list, list) {
if (comp->node == node)
return true;
}
return false;
}
static void omapdss_walk_device(struct device *dev, struct device_node *node,
bool dss_core)
{
struct omapdss_comp_node *comp;
struct device_node *n;
const char *compat;
int ret;
ret = of_property_read_string(node, "compatible", &compat);
if (ret < 0)
return;
comp = devm_kzalloc(dev, sizeof(*comp), GFP_KERNEL);
if (comp) {
comp->node = node;
comp->dss_core_component = dss_core;
comp->compat = compat;
list_add(&comp->list, &omapdss_comp_list);
}
/*
* of_graph_get_remote_port_parent() prints an error if there is no
* port/ports node. To avoid that, check first that there's the node.
*/
n = of_get_child_by_name(node, "ports");
if (!n)
n = of_get_child_by_name(node, "port");
if (!n)
return;
of_node_put(n);
for_each_endpoint_of_node(node, n) {
struct device_node *pn = of_graph_get_remote_port_parent(n);
if (!pn)
continue;
if (!of_device_is_available(pn) || omapdss_list_contains(pn)) {
of_node_put(pn);
continue;
}
omapdss_walk_device(dev, pn, false);
}
}
void omapdss_gather_components(struct device *dev)
{
struct device_node *child;
INIT_LIST_HEAD(&omapdss_comp_list);
omapdss_walk_device(dev, dev->of_node, true);
for_each_available_child_of_node(dev->of_node, child)
omapdss_walk_device(dev, child, true);
}
static bool omapdss_component_is_loaded(struct omapdss_comp_node *comp)
{
if (comp->dss_core_component)
return true;
if (!strstarts(comp->compat, "omapdss,"))
return true;
if (omapdss_device_is_registered(comp->node))
return true;
return false;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/list.h`, `linux/module.h`, `linux/mutex.h`, `linux/of.h`, `linux/of_graph.h`, `linux/platform_device.h`, `dss.h`.
- Detected declarations: `struct omapdss_comp_node`, `function Copyright`, `function omapdss_device_register`, `function omapdss_device_unregister`, `function omapdss_device_is_registered`, `function list_for_each_entry`, `function omapdss_device_put`, `function list_for_each_entry`, `function list_for_each_entry`, `function omapdss_device_is_connected`.
- 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.