drivers/gpu/drm/nouveau/dispnv50/wndw.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/dispnv50/wndw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/dispnv50/wndw.c- Extension
.c- Size
- 27253 bytes
- Lines
- 959
- 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
wndw.hwimm.hhandles.hnvif/class.hnvif/cl0002.hnvhw/class/cl507c.hnvhw/class/cl507e.hnvhw/class/clc37e.hlinux/iosys-map.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_blend.hdrm/drm_fourcc.hdrm/drm_framebuffer.hdrm/drm_gem_atomic_helper.hdrm/drm_panic.hdrm/ttm/ttm_bo.hnouveau_bo.hnouveau_gem.htile.h
Detected Declarations
function filesfunction nv50_wndw_ctxdma_newfunction list_for_each_entryfunction nv50_wndw_wait_armedfunction nv50_wndw_flush_clrfunction nv50_wndw_flush_setfunction nv50_wndw_ntfy_enablefunction nv50_wndw_atomic_check_releasefunction nv50_wndw_atomic_check_acquire_yuvfunction nv50_wndw_atomic_check_acquire_rgbfunction nv50_wndw_atomic_check_acquirefunction nv50_wndw_atomic_check_lutfunction nv50_wndw_atomic_checkfunction nv50_wndw_cleanup_fbfunction nv50_wndw_prepare_fbfunction nv50_get_block_offfunction nv50_set_pixel_swizzlefunction nv50_set_pixelfunction nv50_wndw_get_scanout_bufferfunction nv50_wndw_atomic_destroy_statefunction nv50_wndw_atomic_duplicate_statefunction nv50_wndw_zpos_defaultfunction nv50_wndw_resetfunction nv50_wndw_destroyfunction list_for_each_entry_safefunction nv50_plane_format_mod_supportedfunction nv50_wndw_new_function nv50_wndw_new
Annotated Snippet
if (asyw->ilut) {
asyw->xlut.i.offset =
nv50_lut_load(&wndw->ilut, asyw->xlut.i.buffer,
asyw->ilut, asyw->xlut.i.load);
}
wndw->func->xlut_set(wndw, asyw);
}
if (asyw->set.csc ) wndw->func->csc_set (wndw, asyw);
if (asyw->set.scale) wndw->func->scale_set(wndw, asyw);
if (asyw->set.blend) wndw->func->blend_set(wndw, asyw);
if (asyw->set.point) {
if (asyw->set.point = false, asyw->set.mask)
interlock[wndw->interlock.type] |= wndw->interlock.data;
interlock[NV50_DISP_INTERLOCK_WIMM] |= wndw->interlock.wimm;
wndw->immd->point(wndw, asyw);
wndw->immd->update(wndw, interlock);
} else {
interlock[wndw->interlock.type] |= wndw->interlock.data;
}
}
void
nv50_wndw_ntfy_enable(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{
struct nv50_disp *disp = nv50_disp(wndw->plane.dev);
asyw->ntfy.handle = wndw->wndw.sync.handle;
asyw->ntfy.offset = wndw->ntfy;
asyw->ntfy.awaken = false;
asyw->set.ntfy = true;
wndw->func->ntfy_reset(disp->sync, wndw->ntfy);
wndw->ntfy ^= 0x10;
}
static void
nv50_wndw_atomic_check_release(struct nv50_wndw *wndw,
struct nv50_wndw_atom *asyw,
struct nv50_head_atom *asyh)
{
struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev);
NV_ATOMIC(drm, "%s release\n", wndw->plane.name);
wndw->func->release(wndw, asyw, asyh);
asyw->ntfy.handle = 0;
asyw->sema.handle = 0;
asyw->xlut.handle = 0;
memset(asyw->image.handle, 0x00, sizeof(asyw->image.handle));
}
static int
nv50_wndw_atomic_check_acquire_yuv(struct nv50_wndw_atom *asyw)
{
switch (asyw->state.fb->format->format) {
case DRM_FORMAT_YUYV:
asyw->image.format = NV507E_SURFACE_SET_PARAMS_FORMAT_VE8YO8UE8YE8;
break;
case DRM_FORMAT_UYVY:
asyw->image.format = NV507E_SURFACE_SET_PARAMS_FORMAT_YO8VE8YE8UE8;
break;
default:
WARN_ON(1);
return -EINVAL;
}
asyw->image.colorspace = NV507E_SURFACE_SET_PARAMS_COLOR_SPACE_YUV_601;
return 0;
}
static int
nv50_wndw_atomic_check_acquire_rgb(struct nv50_wndw_atom *asyw)
{
switch (asyw->state.fb->format->format) {
case DRM_FORMAT_C8:
asyw->image.format = NV507C_SURFACE_SET_PARAMS_FORMAT_I8;
break;
case DRM_FORMAT_XRGB8888:
case DRM_FORMAT_ARGB8888:
asyw->image.format = NV507C_SURFACE_SET_PARAMS_FORMAT_A8R8G8B8;
break;
case DRM_FORMAT_RGB565:
asyw->image.format = NV507C_SURFACE_SET_PARAMS_FORMAT_R5G6B5;
break;
case DRM_FORMAT_XRGB1555:
case DRM_FORMAT_ARGB1555:
asyw->image.format = NV507C_SURFACE_SET_PARAMS_FORMAT_A1R5G5B5;
break;
case DRM_FORMAT_XBGR2101010:
case DRM_FORMAT_ABGR2101010:
Annotation
- Immediate include surface: `wndw.h`, `wimm.h`, `handles.h`, `nvif/class.h`, `nvif/cl0002.h`, `nvhw/class/cl507c.h`, `nvhw/class/cl507e.h`, `nvhw/class/clc37e.h`.
- Detected declarations: `function files`, `function nv50_wndw_ctxdma_new`, `function list_for_each_entry`, `function nv50_wndw_wait_armed`, `function nv50_wndw_flush_clr`, `function nv50_wndw_flush_set`, `function nv50_wndw_ntfy_enable`, `function nv50_wndw_atomic_check_release`, `function nv50_wndw_atomic_check_acquire_yuv`, `function nv50_wndw_atomic_check_acquire_rgb`.
- 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.