drivers/gpu/drm/i915/display/intel_connector.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_connector.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_connector.c- Extension
.c- Size
- 9856 bytes
- Lines
- 341
- 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/i2c.hlinux/slab.hdrm/drm_atomic_helper.hdrm/drm_edid.hdrm/drm_print.hdrm/drm_probe_helper.hintel_connector.hintel_display_core.hintel_display_debugfs.hintel_display_types.hintel_hdcp.hintel_panel.h
Detected Declarations
function Copyrightfunction intel_connector_queue_modeset_retry_workfunction intel_connector_cancel_modeset_retry_workfunction intel_connector_initfunction intel_connector_freefunction intel_connector_destroyfunction intel_connector_registerfunction intel_connector_unregisterfunction intel_connector_attach_encoderfunction intel_connector_get_hw_statefunction intel_connector_get_pipefunction intel_connector_update_modesfunction intel_ddc_get_modesfunction intel_attach_force_audio_propertyfunction intel_attach_broadcast_rgb_propertyfunction intel_attach_aspect_ratio_propertyfunction intel_attach_hdmi_colorspace_propertyfunction intel_attach_dp_colorspace_propertyfunction intel_attach_scaling_mode_property
Annotated Snippet
#include <linux/i2c.h>
#include <linux/slab.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
#include "intel_connector.h"
#include "intel_display_core.h"
#include "intel_display_debugfs.h"
#include "intel_display_types.h"
#include "intel_hdcp.h"
#include "intel_panel.h"
static void intel_connector_modeset_retry_work_fn(struct work_struct *work)
{
struct intel_connector *connector = container_of(work, typeof(*connector),
modeset_retry_work);
struct intel_display *display = to_intel_display(connector);
drm_dbg_kms(display->drm, "[CONNECTOR:%d:%s]\n", connector->base.base.id,
connector->base.name);
/* Grab the locks before changing connector property*/
mutex_lock(&display->drm->mode_config.mutex);
/* Set connector link status to BAD and send a Uevent to notify
* userspace to do a modeset.
*/
drm_connector_set_link_status_property(&connector->base,
DRM_MODE_LINK_STATUS_BAD);
mutex_unlock(&display->drm->mode_config.mutex);
/* Send Hotplug uevent so userspace can reprobe */
drm_kms_helper_connector_hotplug_event(&connector->base);
drm_connector_put(&connector->base);
}
void intel_connector_queue_modeset_retry_work(struct intel_connector *connector)
{
struct intel_display *display = to_intel_display(connector);
drm_connector_get(&connector->base);
if (!queue_work(display->wq.unordered, &connector->modeset_retry_work))
drm_connector_put(&connector->base);
}
void intel_connector_cancel_modeset_retry_work(struct intel_connector *connector)
{
if (cancel_work_sync(&connector->modeset_retry_work))
drm_connector_put(&connector->base);
}
static int intel_connector_init(struct intel_connector *connector)
{
struct intel_digital_connector_state *conn_state;
/*
* Allocate enough memory to hold intel_digital_connector_state,
* This might be a few bytes too many, but for connectors that don't
* need it we'll free the state and allocate a smaller one on the first
* successful commit anyway.
*/
conn_state = kzalloc_obj(*conn_state);
if (!conn_state)
return -ENOMEM;
__drm_atomic_helper_connector_reset(&connector->base,
&conn_state->base);
intel_panel_init_alloc(connector);
INIT_WORK(&connector->modeset_retry_work,
intel_connector_modeset_retry_work_fn);
return 0;
}
struct intel_connector *intel_connector_alloc(void)
{
struct intel_connector *connector;
connector = kzalloc_obj(*connector);
if (!connector)
return NULL;
if (intel_connector_init(connector) < 0) {
kfree(connector);
return NULL;
}
Annotation
- Immediate include surface: `linux/i2c.h`, `linux/slab.h`, `drm/drm_atomic_helper.h`, `drm/drm_edid.h`, `drm/drm_print.h`, `drm/drm_probe_helper.h`, `intel_connector.h`, `intel_display_core.h`.
- Detected declarations: `function Copyright`, `function intel_connector_queue_modeset_retry_work`, `function intel_connector_cancel_modeset_retry_work`, `function intel_connector_init`, `function intel_connector_free`, `function intel_connector_destroy`, `function intel_connector_register`, `function intel_connector_unregister`, `function intel_connector_attach_encoder`, `function intel_connector_get_hw_state`.
- 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.