• Randy Dunlap's avatar
    drm: nouveau: fix disp.c build when NOUVEAU_BACKLIGHT is not enabled · 98c9644f
    Randy Dunlap authored
    Fix build errors and warnings when CONFIG_DRM_NOUVEAU_BACKLIGHT is not set
    
    ../drivers/gpu/drm/nouveau/dispnv50/disp.c: In function ‘nv50_sor_atomic_disable’:
    ../drivers/gpu/drm/nouveau/dispnv50/disp.c:1665:52: error: ‘struct nouveau_connector’ has no member named ‘backlight’
      struct nouveau_backlight *backlight = nv_connector->backlight;
                                                        ^~
    ../drivers/gpu/drm/nouveau/dispnv50/disp.c:1670:28: error: dereferencing pointer to incomplete type ‘struct nouveau_backlight’
      if (backlight && backlight->uses_dpcd) {
    
    and then fix subsequent build warnings after the above are fixed:
    
    ../drivers/gpu/drm/nouveau/dispnv50/disp.c: In function ‘nv50_sor_atomic_disable’:
    ../drivers/gpu/drm/nouveau/dispnv50/disp.c:1669:6: warning: unused variable ‘ret’ [-Wunused-variable]
      int ret;
          ^~~
    ../drivers/gpu/drm/nouveau/dispnv50/disp.c:1662:22: warning: unused variable ‘drm’ [-Wunused-variable]
      struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
                          ^~~
    
    Fixes: 6eca310e ("drm/nouveau/kms/nv50-: Add basic DPCD backlight support for nouveau")
    Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Cc: Ben Skeggs <bskeggs@redhat.com>
    Cc: dri-devel@lists.freedesktop.org
    Cc: nouveau@lists.freedesktop.org
    Cc: Lyude Paul <lyude@redhat.com>
    Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
    Reviewed-by: default avatarKarol Herbst <kherbst@redhat.com>
    Signed-off-by: default avatarKarol Herbst <kherbst@redhat.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20210714171523.413-1-rdunlap@infradead.org
    98c9644f
disp.c 79.5 KB