• Hans de Goede's avatar
    modesetting: Properly cleanup fb for reverse-prime-offload · b8ef71fb
    Hans de Goede authored
    drmmode_set_scanout_pixmap_gpu(pix) adds drmmod->fb_id through a call
    to drmmode_xf86crtc_resize(), but on a subsequent
    drmmode_set_scanout_pixmap_gpu(NULL) it would not remove the fb.
    This keeps the crtc marked as busy, which causes the dgpu to not
    being able to runtime suspend, after an output attached to the dgpu
    has been used once. Which causes burning through an additional 10W
    of power and the laptop to run quite hot.
    This commit adds the missing remove fb call, allowing the dgpu to runtime
    suspend after an external monitor has been plugged into the laptop.
    Note this also makes drmmode_set_scanout_pixmap_gpu(NULL) match the
    behavior of drmmode_set_scanout_pixmap_cpu(NULL) which was already
    removing the fb.
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
drmmode_display.c 67.2 KB