• Lyude Paul's avatar
    drm/nouveau/kms/nv50-: Program notifier offset before requesting disp caps · 24d9422e
    Lyude Paul authored
    Not entirely sure why this never came up when I originally tested this
    (maybe some BIOSes already have this setup?) but the ->caps_init vfunc
    appears to cause the display engine to throw an exception on driver
    init, at least on my ThinkPad P72:
    
    nouveau 0000:01:00.0: disp: chid 0 mthd 008c data 00000000 0000508c 0000102b
    
    This is magic nvidia speak for "You need to have the DMA notifier offset
    programmed before you can call NV507D_GET_CAPABILITIES." So, let's fix
    this by doing that, and also perform an update afterwards to prevent
    racing with the GPU when reading capabilities.
    
    v2:
    * Don't just program the DMA notifier offset, make sure to actually
      perform an update
    v3:
    * Don't call UPDATE()
    * Actually read the correct notifier fields, as apparently the
      CAPABILITIES_DONE field lives in a different location than the main
      NV_DISP_CORE_NOTIFIER_1 field. As well, 907d+ use a different
      CAPABILITIES_DONE field then pre-907d cards.
    v4:
    * Don't forget to check the return value of core507d_read_caps()
    v5:
    * Get rid of NV50_DISP_CAPS_NTFY[14], use NV50_DISP_CORE_NTFY
    * Disable notifier after calling GetCapabilities()
    Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
    Fixes: 4a2cb418 ("drm/nouveau/kms/nv50-: Probe SOR and PIOR caps for DP interlacing support")
    Cc: <stable@vger.kernel.org> # v5.8+
    Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
    24d9422e
cl907d.h 37.5 KB