• Lyude Paul's avatar
    drm/nouveau/kms/nv140-: Track wndw mappings in nv50_head_atom · dbdaf719
    Lyude Paul authored
    While we're not quite ready yet to add support for flexible wndw
    mappings, we are going to need to at least keep track of the static wndw
    mappings we're currently using in each head's atomic state. We'll likely
    use this in the future to implement real flexible window mapping, but
    the primary reason we'll need this is for CRC support.
    
    See: on nvidia hardware, each CRC entry in the CRC notifier dma context
    has a "tag". This tag corresponds to the nth update on a specific
    EVO/NvDisplay channel, which itself is referred to as the "controlling
    channel". For gf119+ this can be the core channel, ovly channel, or base
    channel. Since we don't expose CRC entry tags to userspace, we simply
    ignore this feature and always use the core channel as the controlling
    channel. Simple.
    
    Things get a little bit more complicated on gv100+ though. GV100+ only
    lets us set the controlling channel to a specific wndw channel, and that
    wndw must be owned by the head that we're grabbing CRCs when we enable
    CRC generation. Thus, we always need to make sure that each atomic head
    state has at least one wndw that is mapped to the head, which will be
    used as the controlling channel.
    
    Note that since we don't have flexible wndw mappings yet, we don't
    expect to run into any scenarios yet where we'd have a head with no
    mapped wndws. When we do add support for flexible wndw mappings however,
    we'll need to make sure that we handle reprogramming CRC capture if our
    controlling wndw is moved to another head (and potentially reject the
    new head state entirely if we can't find another available wndw to
    replace it).
    
    With that being said, nouveau currently tracks wndw visibility on heads.
    It does not keep track of the actual ownership mappings, which are
    (currently) statically programmed. To fix this, we introduce another
    bitmask into nv50_head_atom.wndw to keep track of ownership separately
    from visibility. We then introduce a nv50_head callback to handle
    populating the wndw ownership map, and call it during the atomic check
    phase when core->assign_windows is set to true.
    Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
    Reviewed-by: default avatarBen Skeggs <bskeggs@redhat.com>
    Acked-by: default avatarDave Airlie <airlied@gmail.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20200627194657.156514-7-lyude@redhat.com
    dbdaf719
headc37d.c 6.84 KB