Skip to content
  • Jonas Ådahl's avatar
    gpu-kms: Don't add outputs without modes · d092e913
    Jonas Ådahl authored
    There seems to be a kernel race when one disconnects an external
    monitor connected to a DisplayPort via a USB-C adapter. The race
    results in a connector being reported as connected, but without any
    modes supported.
    
    This had the side effect that we tried to set a preferred mode to
    the first listed mode, but as no modes were available, we instead tried
    to dereference the first element of a NULL array, causing a
    segmentation fault.
    
    Mitigate this by skipping adding output if no supported modes are
    advertised and the output doesn't support scaling, while moving the
    fallback path for calculating a preferred output mode to after possibly
    adding the common modes, to avoid the unvolentary NULL dereference.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789501
    d092e913