• Peter Ujfalusi's avatar
    drm/nouveau: Fix drm poll_helper handling · 9a2eba33
    Peter Ujfalusi authored
    Commit cae9ff03 effectively disabled the drm poll_helper by checking
    the wrong flag to see if the driver should enable the poll or not:
    mode_config.poll_enabled is only set to true by poll_init and it is not
    indicating if the poll is enabled or not.
    nouveau_display_create() will initialize the poll and going to disable it
    right away. After poll_init() the mode_config.poll_enabled will be true,
    but the poll itself is disabled.
    
    To avoid the race caused by calling the poll_enable() from different paths,
    this patch will enable the poll from one place, in the
    nouveau_display_hpd_work().
    
    In case the pm_runtime is disabled we will enable the poll in
    nouveau_drm_load() once.
    
    Fixes: cae9ff03 ("drm/nouveau: Don't enabling polling twice on runtime resume")
    Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
    Reviewed-by: default avatarLyude <lyude@redhat.com>
    Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
    9a2eba33
nouveau_drm.c 28.9 KB