drivers/gpu/drm/nouveau/nouveau_display.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nouveau_display.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nouveau_display.c- Extension
.c- Size
- 22328 bytes
- Lines
- 829
- 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/video.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_client_event.hdrm/drm_crtc_helper.hdrm/drm_dumb_buffers.hdrm/drm_fourcc.hdrm/drm_gem_framebuffer_helper.hdrm/drm_probe_helper.hdrm/drm_vblank.hnouveau_crtc.hnouveau_gem.hnouveau_connector.hnv50_display.hnvif/class.hnvif/if0011.hnvif/if0013.hdispnv50/crc.hdispnv50/tile.h
Detected Declarations
struct nouveau_drm_prop_enum_listfunction Copyrightfunction nouveau_display_vblank_disablefunction calcfunction nouveau_display_scanoutpos_headfunction nouveau_display_scanoutposfunction nouveau_decode_modfunction nouveau_framebuffer_get_layoutfunction nouveau_validate_decode_modfunction nouveau_check_bl_sizefunction nouveau_framebuffer_newfunction nouveau_user_framebuffer_createfunction nouveau_display_hpd_resumefunction nouveau_display_hpd_workfunction nouveau_for_each_non_mst_connector_iterfunction nouveau_display_acpi_ntfyfunction nouveau_display_initfunction nouveau_display_finifunction nouveau_display_create_propertiesfunction nouveau_display_createfunction nouveau_display_destroyfunction nouveau_display_suspendfunction nouveau_display_resumefunction nouveau_display_dumb_create
Annotated Snippet
struct nouveau_drm_prop_enum_list {
u8 gen_mask;
int type;
char *name;
};
static struct nouveau_drm_prop_enum_list underscan[] = {
{ 6, UNDERSCAN_AUTO, "auto" },
{ 6, UNDERSCAN_OFF, "off" },
{ 6, UNDERSCAN_ON, "on" },
{}
};
static struct nouveau_drm_prop_enum_list dither_mode[] = {
{ 7, DITHERING_MODE_AUTO, "auto" },
{ 7, DITHERING_MODE_OFF, "off" },
{ 1, DITHERING_MODE_ON, "on" },
{ 6, DITHERING_MODE_STATIC2X2, "static 2x2" },
{ 6, DITHERING_MODE_DYNAMIC2X2, "dynamic 2x2" },
{ 4, DITHERING_MODE_TEMPORAL, "temporal" },
{}
};
static struct nouveau_drm_prop_enum_list dither_depth[] = {
{ 6, DITHERING_DEPTH_AUTO, "auto" },
{ 6, DITHERING_DEPTH_6BPC, "6 bpc" },
{ 6, DITHERING_DEPTH_8BPC, "8 bpc" },
{}
};
#define PROP_ENUM(p,gen,n,list) do { \
struct nouveau_drm_prop_enum_list *l = (list); \
int c = 0; \
while (l->gen_mask) { \
if (l->gen_mask & (1 << (gen))) \
c++; \
l++; \
} \
if (c) { \
p = drm_property_create(dev, DRM_MODE_PROP_ENUM, n, c); \
l = (list); \
while (p && l->gen_mask) { \
if (l->gen_mask & (1 << (gen))) { \
drm_property_add_enum(p, l->type, l->name); \
} \
l++; \
} \
} \
} while(0)
void
nouveau_display_hpd_resume(struct nouveau_drm *drm)
{
if (drm->headless)
return;
spin_lock_irq(&drm->hpd_lock);
drm->hpd_pending = ~0;
spin_unlock_irq(&drm->hpd_lock);
schedule_work(&drm->hpd_work);
}
static void
nouveau_display_hpd_work(struct work_struct *work)
{
struct nouveau_drm *drm = container_of(work, typeof(*drm), hpd_work);
struct drm_device *dev = drm->dev;
struct drm_connector *connector;
struct drm_connector_list_iter conn_iter;
u32 pending;
int changed = 0;
struct drm_connector *first_changed_connector = NULL;
pm_runtime_get_sync(dev->dev);
spin_lock_irq(&drm->hpd_lock);
pending = drm->hpd_pending;
drm->hpd_pending = 0;
spin_unlock_irq(&drm->hpd_lock);
/* Nothing to do, exit early without updating the last busy counter */
if (!pending)
goto noop;
mutex_lock(&dev->mode_config.mutex);
drm_connector_list_iter_begin(dev, &conn_iter);
nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) {
struct nouveau_connector *nv_connector = nouveau_connector(connector);
Annotation
- Immediate include surface: `acpi/video.h`, `drm/drm_atomic.h`, `drm/drm_atomic_helper.h`, `drm/drm_client_event.h`, `drm/drm_crtc_helper.h`, `drm/drm_dumb_buffers.h`, `drm/drm_fourcc.h`, `drm/drm_gem_framebuffer_helper.h`.
- Detected declarations: `struct nouveau_drm_prop_enum_list`, `function Copyright`, `function nouveau_display_vblank_disable`, `function calc`, `function nouveau_display_scanoutpos_head`, `function nouveau_display_scanoutpos`, `function nouveau_decode_mod`, `function nouveau_framebuffer_get_layout`, `function nouveau_validate_decode_mod`, `function nouveau_check_bl_size`.
- 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.