Repository navigation
feat(nvidia): built the window channel's methods showing an image - #520
Merged
Merged
Conversation
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds the register writes that show one unscaled image through the display engine (the GPU's unit that scans images out to monitors), for the driver's first lit screen and every later image to share.
Changes
build_window_image_methods(window_methods.h) gives, in order, the 54 methods NVIDIA's modesetting module writes for a flip (a change of a window's image) of one X8R8G8B8 surface in rows, shown whole and unscaled where the window already lies, from a vertical blank for at least a frame, asking no notifier event, timestamp, semaphore, flip lock, variable refresh rate, rotation, reflection, tone mapping, color matrix, look-up table or blending of its own, each method re-declared in rm.h from NVIDIA's window class.window_methodholds both halves of the update timestamp (a time not to show the image before) in one method, as NVIDIA writes them, so the methods take 109 words with their headers. A method of the core channel (the display channel that sets up heads, links and which head owns each window) keeps one value indisplay_method.window_image_updatenames the window notifier's context DMA and 16-byte slot, or none, and whether the update takes effect only with the core channel's next update. The window's own channel is always in its interlock, and the update sets the bit NVIDIA sets in every window update (RELEASE_ELV).LOOK_UP_TABLE_HEADER_ENTRIESandLOOK_UP_TABLE_ENTRIESmove from display_light.cpp into display_light.h, beside the look-up table surface's size, so the builder sizes the input table with its header, 1029 entries.window_imageandwindow_image_updatestate what their values must keep to fit their methods' fields (both handles nonzero, a window below 32, a width and height below 65536, a pitch a multiple of 64 below 512 KiB, a slot below 256), where NVIDIA's module cuts a value to its field. The two agree on every value within the bounds.nvidia_window_methodschecks that the light's image (window 2, 2560 by 1440, interlocked with the core channel, no notifier, its handles past 16 bits as the driver's are) is NVIDIA's flip method for method and value for value, in 109 words. It checks that a present differs only by its notifier, named by its slot in 16-byte units, and its core interlock left out, that a slot with no notifier leaves the notifier's control 0, that the size, a padded pitch and the interlock bit follow the image (window 5, 1920 by 1080, pitch 16384), and that the largest values within the bounds fill their fields whole.Note
Low Risk
Pure method-building logic with no runtime callers yet; display behavior unchanged until a later change submits these methods to hardware.
Overview
Adds
build_window_image_methods, which emits the 54 window-channel register methods (109 push-buffer words) NVIDIA's modesetting stack uses for a simple flip: unscaled X8R8G8B8 surface in rows, present at vblank for at least one frame, identity color path, input LUT at the LUT surface, opaque main-layer composition, optional notifier slot, and core/window interlock flags ending in RELEASE_ELV.rm.hgains the NVC67E method offsets and field encodings; LUT header/entry counts move fromdisplay_light.cpptodisplay_light.hfor shared sizing.nvidia_window_methodstests assert method order/values match NVIDIA's flip, notifier/interlock variants, pitch encoding, and field limits. Nothing in the boot/display path calls the builder yet—tests are the only consumer.Reviewed by Cursor Bugbot for commit c02ac61. Bugbot is set up for automated code reviews on this repo. Configure here.