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=-15.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 800F7C4338F for ; Fri, 23 Jul 2021 16:31:38 +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 92B3260200 for ; Fri, 23 Jul 2021 16:31:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 92B3260200 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org 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 492006F8A9; Fri, 23 Jul 2021 16:31:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by gabe.freedesktop.org (Postfix) with ESMTPS id 70B686F8A9; Fri, 23 Jul 2021 16:31:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=AJR4Uwi2twf+SqV3Z1Vf6OE1gwqoYjBswhC7GZxo0Zk=; b=DR8TH5p8tSmZN+rEb8dwHCUOaX hDANAh3CZGcYYS/mJ7ctrM3KkFNFb6vpT+5Q5ORTTNgbwzdgqTVoHZncRkq9KgTSeoac+6++u42xz +JKg6ni/pFSh704KbFdxwLBkOYQRl8Q2L4xHvNbHrLlz63VONrrdpih4hzTVi5TeKmnb4PG7Bn5ZG IYjMPpR0w7iuqajisWTNvwfoMTZS9NFEJrQ+DxZiX1vVujNBz/EHmYVesXU+LeUDZsYz5pPL5Uz3F 3DFjtTSonKSPbHFEb9r3Ig0iw1dVA4DjLXXANvEc9XXQ68dxxEh7arlCGBUgIG213/YHQcb9DJtfr kAfjfLEg==; Received: from [2601:1c0:6280:3f0::aefb] by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6y5G-005Lel-VX; Fri, 23 Jul 2021 16:31:35 +0000 To: Karol Herbst References: <20210723091534.1730564-1-arnd@kernel.org> From: Randy Dunlap Message-ID: <7ddd0c7c-9bdc-9ea3-c635-f1d141d1e870@infradead.org> Date: Fri, 23 Jul 2021 09:31:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US 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 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. _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau