drivers/gpu/drm/tilcdc/tilcdc_encoder.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/tilcdc/tilcdc_encoder.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/tilcdc/tilcdc_encoder.c- Extension
.c- Size
- 1600 bytes
- Lines
- 64
- 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
linux/of_graph.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_bridge_connector.hdrm/drm_of.hdrm/drm_simple_kms_helper.htilcdc_drv.htilcdc_encoder.h
Detected Declarations
function Copyrightfunction tilcdc_encoder_create
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2015 Texas Instruments
* Author: Jyri Sarha <jsarha@ti.com>
*/
#include <linux/of_graph.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_bridge_connector.h>
#include <drm/drm_of.h>
#include <drm/drm_simple_kms_helper.h>
#include "tilcdc_drv.h"
#include "tilcdc_encoder.h"
static
int tilcdc_attach_bridge(struct drm_device *ddev, struct drm_bridge *bridge)
{
struct tilcdc_drm_private *priv = ddev_to_tilcdc_priv(ddev);
struct drm_connector *connector;
int ret;
priv->encoder->base.possible_crtcs = BIT(0);
ret = drm_bridge_attach(&priv->encoder->base, bridge, NULL,
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret)
return ret;
connector = drm_bridge_connector_init(ddev, &priv->encoder->base);
if (IS_ERR(connector)) {
drm_err(ddev, "bridge_connector create failed\n");
return PTR_ERR(connector);
}
priv->connector = connector;
return 0;
}
int tilcdc_encoder_create(struct drm_device *ddev)
{
struct tilcdc_drm_private *priv = ddev_to_tilcdc_priv(ddev);
struct tilcdc_encoder *encoder;
struct drm_bridge *bridge;
bridge = devm_drm_of_get_bridge(ddev->dev, ddev->dev->of_node, 0, 0);
if (PTR_ERR(bridge) == -ENODEV)
return 0;
else if (IS_ERR(bridge))
return PTR_ERR(bridge);
encoder = drmm_simple_encoder_alloc(ddev, struct tilcdc_encoder,
base, DRM_MODE_ENCODER_NONE);
if (IS_ERR(encoder)) {
drm_err(ddev, "drm_encoder_init() failed %pe\n", encoder);
return PTR_ERR(encoder);
}
priv->encoder = encoder;
return tilcdc_attach_bridge(ddev, bridge);
}
Annotation
- Immediate include surface: `linux/of_graph.h`, `drm/drm_atomic_helper.h`, `drm/drm_bridge.h`, `drm/drm_bridge_connector.h`, `drm/drm_of.h`, `drm/drm_simple_kms_helper.h`, `tilcdc_drv.h`, `tilcdc_encoder.h`.
- Detected declarations: `function Copyright`, `function tilcdc_encoder_create`.
- 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.