drivers/gpu/drm/verisilicon/vs_bridge.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/verisilicon/vs_bridge.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/verisilicon/vs_bridge.c- Extension
.c- Size
- 11034 bytes
- Lines
- 371
- 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.hlinux/regmap.huapi/linux/media-bus-format.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_bridge_connector.hdrm/drm_connector.hdrm/drm_encoder.hdrm/drm_of.hdrm/drm_print.hdrm/drm_simple_kms_helper.hvs_bridge.hvs_bridge_regs.hvs_crtc.hvs_dc.h
Detected Declarations
struct vsdc_dp_formatfunction Copyrightfunction vs_bridge_out_dp_fmt_supportedfunction vs_bridge_atomic_check_dpfunction vs_bridge_enable_commonfunction vs_bridge_atomic_enable_dpifunction vs_bridge_atomic_enable_dpfunction vs_bridge_atomic_disablefunction vs_bridge_detect_output_interface
Annotated Snippet
struct vsdc_dp_format {
u32 linux_fmt;
bool is_yuv;
u32 vsdc_fmt;
};
static struct vsdc_dp_format vsdc_dp_supported_fmts[] = {
/* default to RGB888 */
{ MEDIA_BUS_FMT_FIXED, false, VSDC_DISP_DP_CONFIG_FMT_RGB888 },
{ MEDIA_BUS_FMT_RGB888_1X24, false, VSDC_DISP_DP_CONFIG_FMT_RGB888 },
{ MEDIA_BUS_FMT_RGB565_1X16, false, VSDC_DISP_DP_CONFIG_FMT_RGB565 },
{ MEDIA_BUS_FMT_RGB666_1X18, false, VSDC_DISP_DP_CONFIG_FMT_RGB666 },
{ MEDIA_BUS_FMT_RGB101010_1X30,
false, VSDC_DISP_DP_CONFIG_FMT_RGB101010 },
{ MEDIA_BUS_FMT_UYVY8_1X16, true, VSDC_DISP_DP_CONFIG_YUV_FMT_UYVY8 },
{ MEDIA_BUS_FMT_UYVY10_1X20, true, VSDC_DISP_DP_CONFIG_YUV_FMT_UYVY10 },
{ MEDIA_BUS_FMT_YUV8_1X24, true, VSDC_DISP_DP_CONFIG_YUV_FMT_YUV8 },
{ MEDIA_BUS_FMT_YUV10_1X30, true, VSDC_DISP_DP_CONFIG_YUV_FMT_YUV10 },
{ MEDIA_BUS_FMT_UYYVYY8_0_5X24,
true, VSDC_DISP_DP_CONFIG_YUV_FMT_UYYVYY8 },
{ MEDIA_BUS_FMT_UYYVYY10_0_5X30,
true, VSDC_DISP_DP_CONFIG_YUV_FMT_UYYVYY10 },
};
static u32 *vs_bridge_atomic_get_output_bus_fmts_dpi(struct drm_bridge *bridge,
struct drm_bridge_state *bridge_state,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state,
unsigned int *num_output_fmts)
{
u32 *output_fmts;
*num_output_fmts = 2;
output_fmts = kcalloc(*num_output_fmts, sizeof(*output_fmts),
GFP_KERNEL);
if (!output_fmts)
return NULL;
/* TODO: support more DPI output formats */
output_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24;
output_fmts[1] = MEDIA_BUS_FMT_FIXED;
return output_fmts;
}
static u32 *vs_bridge_atomic_get_output_bus_fmts_dp(struct drm_bridge *bridge,
struct drm_bridge_state *bridge_state,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state,
unsigned int *num_output_fmts)
{
u32 *output_fmts;
unsigned int i;
*num_output_fmts = ARRAY_SIZE(vsdc_dp_supported_fmts);
output_fmts = kcalloc(*num_output_fmts, sizeof(*output_fmts),
GFP_KERNEL);
if (!output_fmts)
return NULL;
for (i = 0; i < *num_output_fmts; i++)
output_fmts[i] = vsdc_dp_supported_fmts[i].linux_fmt;
return output_fmts;
}
static bool vs_bridge_out_dp_fmt_supported(u32 out_fmt)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(vsdc_dp_supported_fmts); i++)
if (vsdc_dp_supported_fmts[i].linux_fmt == out_fmt)
return true;
return false;
}
static u32 *vs_bridge_atomic_get_input_bus_fmts_dp(struct drm_bridge *bridge,
struct drm_bridge_state *bridge_state,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state,
u32 output_fmt,
unsigned int *num_input_fmts)
{
if (!vs_bridge_out_dp_fmt_supported(output_fmt)) {
*num_input_fmts = 0;
return NULL;
}
Annotation
- Immediate include surface: `linux/of.h`, `linux/regmap.h`, `uapi/linux/media-bus-format.h`, `drm/drm_atomic.h`, `drm/drm_atomic_helper.h`, `drm/drm_bridge.h`, `drm/drm_bridge_connector.h`, `drm/drm_connector.h`.
- Detected declarations: `struct vsdc_dp_format`, `function Copyright`, `function vs_bridge_out_dp_fmt_supported`, `function vs_bridge_atomic_check_dp`, `function vs_bridge_enable_common`, `function vs_bridge_atomic_enable_dpi`, `function vs_bridge_atomic_enable_dp`, `function vs_bridge_atomic_disable`, `function vs_bridge_detect_output_interface`.
- 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.