drivers/gpu/drm/nouveau/nouveau_connector.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nouveau_connector.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nouveau_connector.c- Extension
.c- Size
- 44538 bytes
- Lines
- 1498
- 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
acpi/button.hlinux/pm_runtime.hlinux/vga_switcheroo.hdrm/drm_atomic_helper.hdrm/drm_edid.hdrm/drm_crtc_helper.hdrm/drm_probe_helper.hdrm/drm_atomic.hnouveau_reg.hnouveau_drv.hdispnv04/hw.hdispnv50/disp.hnouveau_acpi.hnouveau_display.hnouveau_connector.hnouveau_encoder.hnouveau_crtc.hnvif/class.hnvif/if0011.h
Detected Declarations
struct moderecfunction Copyrightfunction list_for_each_entryfunction nouveau_conn_atomic_get_propertyfunction nouveau_conn_atomic_set_propertyfunction nouveau_conn_atomic_destroy_statefunction nouveau_conn_atomic_duplicate_statefunction nouveau_conn_resetfunction nouveau_conn_attach_propertiesfunction find_encoderfunction drm_connector_for_each_possible_encoderfunction nouveau_connector_destroyfunction nouveau_connector_ddc_detectfunction drm_connector_for_each_possible_encoderfunction nouveau_connector_of_detectfunction for_each_child_of_node_scopedfunction nouveau_connector_set_encoderfunction nouveau_connector_set_edidfunction nouveau_connector_detectfunction unnecessaryfunction nouveau_connector_detect_lvdsfunction nouveau_connector_forcefunction nouveau_connector_set_propertyfunction nouveau_connector_scaler_modes_addfunction nouveau_connector_detect_depthfunction nouveau_connector_late_registerfunction nouveau_connector_early_unregisterfunction nouveau_connector_get_modesfunction get_tmds_link_bandwidthfunction nouveau_connector_mode_validfunction nouveau_connector_best_encoderfunction nouveau_connector_atomic_checkfunction nouveau_connector_hpdfunction nouveau_connector_irqfunction nouveau_connector_hotplugfunction nouveau_connector_aux_xferfunction drm_conntype_from_dcbfunction nouveau_connector_create
Annotated Snippet
struct moderec {
int hdisplay;
int vdisplay;
};
static struct moderec scaler_modes[] = {
{ 1920, 1200 },
{ 1920, 1080 },
{ 1680, 1050 },
{ 1600, 1200 },
{ 1400, 1050 },
{ 1280, 1024 },
{ 1280, 960 },
{ 1152, 864 },
{ 1024, 768 },
{ 800, 600 },
{ 720, 400 },
{ 640, 480 },
{ 640, 400 },
{ 640, 350 },
{}
};
static int
nouveau_connector_scaler_modes_add(struct drm_connector *connector)
{
struct nouveau_connector *nv_connector = nouveau_connector(connector);
struct drm_display_mode *native = nv_connector->native_mode, *m;
struct drm_device *dev = connector->dev;
struct moderec *mode = &scaler_modes[0];
int modes = 0;
if (!native)
return 0;
while (mode->hdisplay) {
if (mode->hdisplay <= native->hdisplay &&
mode->vdisplay <= native->vdisplay &&
(mode->hdisplay != native->hdisplay ||
mode->vdisplay != native->vdisplay)) {
m = drm_cvt_mode(dev, mode->hdisplay, mode->vdisplay,
drm_mode_vrefresh(native), false,
false, false);
if (!m)
continue;
drm_mode_probed_add(connector, m);
modes++;
}
mode++;
}
return modes;
}
static void
nouveau_connector_detect_depth(struct drm_connector *connector)
{
struct nouveau_drm *drm = nouveau_drm(connector->dev);
struct nouveau_connector *nv_connector = nouveau_connector(connector);
struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder;
struct nvbios *bios = &drm->vbios;
struct drm_display_mode *mode = nv_connector->native_mode;
bool duallink;
/* if the edid is feeling nice enough to provide this info, use it */
if (nv_connector->edid && connector->display_info.bpc)
return;
/* EDID 1.4 is *supposed* to be supported on eDP, but, Apple... */
if (nv_connector->type == DCB_CONNECTOR_eDP) {
connector->display_info.bpc = 6;
return;
}
/* we're out of options unless we're LVDS, default to 8bpc */
if (nv_encoder->dcb->type != DCB_OUTPUT_LVDS) {
connector->display_info.bpc = 8;
return;
}
connector->display_info.bpc = 6;
/* LVDS: panel straps */
if (bios->fp_no_ddc) {
if (bios->fp.if_is_24bit)
connector->display_info.bpc = 8;
return;
}
Annotation
- Immediate include surface: `acpi/button.h`, `linux/pm_runtime.h`, `linux/vga_switcheroo.h`, `drm/drm_atomic_helper.h`, `drm/drm_edid.h`, `drm/drm_crtc_helper.h`, `drm/drm_probe_helper.h`, `drm/drm_atomic.h`.
- Detected declarations: `struct moderec`, `function Copyright`, `function list_for_each_entry`, `function nouveau_conn_atomic_get_property`, `function nouveau_conn_atomic_set_property`, `function nouveau_conn_atomic_destroy_state`, `function nouveau_conn_atomic_duplicate_state`, `function nouveau_conn_reset`, `function nouveau_conn_attach_properties`, `function find_encoder`.
- 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.