From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CD5EC4320A for ; Fri, 23 Jul 2021 16:34:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3628560ED7 for ; Fri, 23 Jul 2021 16:34:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3628560ED7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DDB9C6E9E1; Fri, 23 Jul 2021 16:34:55 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 753826E9E1 for ; Fri, 23 Jul 2021 16:34:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627058093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jBKfujrZeXlnAEPqRseOsz+DSjWxEDmI89ivOTZgHQY=; b=csRU00dRsLRFPNxfCslsC0dsN8Li0kWCgGRiVV/n6NyhVBcD8WVYOtiAIY/24XTDp+iy5/ xbxOdgGYhxK69kt+1XK4RrktYldot/Ihs0ujtYTf2ruHsqzoxTzW3PJG1Iv5kfRAnArRIW NhNHt/XRAmEECKTHa4WKDkm9xeEkADo= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-288-5HilrCWMP5y9AtS_dIqn4w-1; Fri, 23 Jul 2021 12:34:51 -0400 X-MC-Unique: 5HilrCWMP5y9AtS_dIqn4w-1 Received: by mail-wr1-f70.google.com with SMTP id a7-20020adfeec70000b0290140ab4d8389so1188233wrp.10 for ; Fri, 23 Jul 2021 09:34:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jBKfujrZeXlnAEPqRseOsz+DSjWxEDmI89ivOTZgHQY=; b=EU0fsMCJTVvqWaEEsYrMRCPNpi1V0QQ6SZKztlQGJ/nDN7NWIIcEtAlMWiwpGtW9Gc ojKzC3eXEX39MgF8SZgyeAq7AetvjjaLgNmfHXsBVNsHwj+f9m4X205lbU9oAgYVSj+w UAGqOd8FthxyBEGWlcd2KjC3VOt0tTm7Okq2I3BD8Njk9NeLCifOfqviuZVHxt66F3TE 9sAp2WII09F9ndDwbv6q/d65Q7vaqKWe4MHqo3/ZGzrEFBOyMl6RilM7aLNzSU8uhnPj g/uACckW/kyDOPAtWeEgDQZ4x0EPWockc6I3FndEwAZ8sCmcjC9F2e3limzlRF6et8iz hTRQ== X-Gm-Message-State: AOAM530TNubF5wykmd/lKJ4gUKklNS7Y3AUg4trZuwVGqkl1VUkUK/2b TCiLnUn3avTtO6saKRtVzI/syVmzcHowqguGBDG1bYnXFelVLQYdeCnyKGEtc32VbOfeOTuH9JE E1SLQlxsFEcwBOCyCSA2GMEenlFOyZoV1CTnECrO74Q== X-Received: by 2002:adf:ec0c:: with SMTP id x12mr6485191wrn.113.1627058090640; Fri, 23 Jul 2021 09:34:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjZmLFiXzbRdB1FSZxk6Ci9/11PUg5q7Gnq6fHY+P642HnHn3ZO13MsX1/M3WvfMfwQhNQ9sYSLAOwuVdUjA0= X-Received: by 2002:adf:ec0c:: with SMTP id x12mr6485172wrn.113.1627058090493; Fri, 23 Jul 2021 09:34:50 -0700 (PDT) MIME-Version: 1.0 References: <20210723091534.1730564-1-arnd@kernel.org> <7ddd0c7c-9bdc-9ea3-c635-f1d141d1e870@infradead.org> In-Reply-To: <7ddd0c7c-9bdc-9ea3-c635-f1d141d1e870@infradead.org> From: Karol Herbst Date: Fri, 23 Jul 2021 18:34:39 +0200 Message-ID: To: Randy Dunlap Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kherbst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: Re: [Nouveau] [PATCH] drm/nouveau/kms/nv50-: fix build failure with CONFIG_BACKLIGHT=n X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Arnd Bergmann , David Airlie , nouveau , LKML , dri-devel , Nikola Cornij , Ben Skeggs , Daniel Vetter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Fri, Jul 23, 2021 at 6:31 PM Randy Dunlap wrote: > > On 7/23/21 8:15 AM, Karol Herbst wrote: > > On Fri, Jul 23, 2021 at 5:10 PM Randy Dunlap wrote: > >> > >> On 7/23/21 2:15 AM, Arnd Bergmann wrote: > >>> From: Arnd Bergmann > >>> > >>> When the backlight support is disabled, the driver fails to build: > >>> > >>> drivers/gpu/drm/nouveau/dispnv50/disp.c: In function 'nv50_sor_atomic_disable': > >>> drivers/gpu/drm/nouveau/dispnv50/disp.c:1665:59: error: 'struct nouveau_connector' has no member named 'backlight' > >>> 1665 | struct nouveau_backlight *backlight = nv_connector->backlight; > >>> | ^~ > >>> drivers/gpu/drm/nouveau/dispnv50/disp.c:1670:35: error: invalid use of undefined type 'struct nouveau_backlight' > >>> 1670 | if (backlight && backlight->uses_dpcd) { > >>> | ^~ > >>> drivers/gpu/drm/nouveau/dispnv50/disp.c:1671:64: error: invalid use of undefined type 'struct nouveau_backlight' > >>> 1671 | ret = drm_edp_backlight_disable(aux, &backlight->edp_info); > >>> | ^~ > >>> > >>> The patch that introduced the problem already contains some #ifdef > >>> checks, so just add another one that makes it build again. > >>> > >>> Fixes: 6eca310e8924 ("drm/nouveau/kms/nv50-: Add basic DPCD backlight support for nouveau") > >>> Signed-off-by: Arnd Bergmann > >>> --- > >>> drivers/gpu/drm/nouveau/dispnv50/disp.c | 11 +++++++---- > >>> 1 file changed, 7 insertions(+), 4 deletions(-) > >>> > >>> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c > >>> index 093e1f7163b3..fcf53e24db21 100644 > >>> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c > >>> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c > >>> @@ -1659,20 +1659,23 @@ static void > >>> nv50_sor_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_state *state) > >>> { > >>> struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); > >>> - struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); > >>> struct nouveau_crtc *nv_crtc = nouveau_crtc(nv_encoder->crtc); > >>> struct nouveau_connector *nv_connector = nv50_outp_get_old_connector(state, nv_encoder); > >>> - struct nouveau_backlight *backlight = nv_connector->backlight; > >>> struct drm_dp_aux *aux = &nv_connector->aux; > >>> - int ret; > >>> u8 pwr; > >>> > >>> +#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT > >>> + struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); > >>> + struct nouveau_backlight *backlight = nv_connector->backlight; > >>> + > >>> if (backlight && backlight->uses_dpcd) { > >>> - ret = drm_edp_backlight_disable(aux, &backlight->edp_info); > >>> + int ret = drm_edp_backlight_disable(aux, &backlight->edp_info); > >>> + > >>> if (ret < 0) > >>> NV_ERROR(drm, "Failed to disable backlight on [CONNECTOR:%d:%s]: %d\n", > >>> nv_connector->base.base.id, nv_connector->base.name, ret); > >>> } > >>> +#endif > >>> > >>> if (nv_encoder->dcb->type == DCB_OUTPUT_DP) { > >>> int ret = drm_dp_dpcd_readb(aux, DP_SET_POWER, &pwr); > >>> > >> > >> Hm, only Lyude Paul replied to this patch: > >> > >> https://lore.kernel.org/lkml/20210714171523.413-1-rdunlap@infradead.org/ > >> > > > > what's actually the use case of compiling with > > CONFIG_DRM_NOUVEAU_BACKLIGHT=n anyway? > > Dunno. In this case it was just a randconfig. Still, it needs to be > handled in some way - such as the other suggestion in this thread. > sure, I was just curious if there was a specific use case or just something random as you mentioned. _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau