From patchwork Fri Jul 23 09:15:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 484589 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1144472jao; Fri, 23 Jul 2021 02:15:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpHN2/12R+YCTn8aeRmvdEvkdVTmTbm6i/RTQs94p0HIoNOeKZcrnJVRTKK5UKYM5CihWt X-Received: by 2002:a17:90b:1117:: with SMTP id gi23mr566060pjb.151.1627031742130; Fri, 23 Jul 2021 02:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627031742; cv=none; d=google.com; s=arc-20160816; b=Jwc6JgQlJgjdkzOex4tqWKXNUYm4AEnHvbKLkx9am6UYh6JMSmfHfuFhaNERZ8IjBI rZINAa+dl+jZj+eeSD2LaTjxiC+AvTt69LbeURnfQarGoJ2zht4YQnbdtu4FV3WJR7gw IhozvnxpPsePXdFIEnnoUJbfG+/Gg3QhOt1c4i6ACHVyt5ge0AkaxwBoYW1jfBzVRU0m +LaGEcYRphW+xsqBKbvnUSnPOvXlCKr96ORkPBh7uMbtEooGKNcZxBxMyM1xWz8wH+bk zD9XjsWMy1TbxMFIcfmA+sSi3VumT/urUTD3ZFjcB6Hxyh33ACXkM6VtCCuhuEAdZOEJ 6gyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :delivered-to; bh=NKxxfeqgFHucyh5q8aAdr0oNAKFV8EGlhZxqa2/khLM=; b=tOYE7yNK3A4BDwOyWuVgHyCXSXWMSUcKYmpCa6BApJc04BzLOyv04KFASjWrBwLBYc OKSfGLrkg0dviQS9w/zufOxulcesvMrp+VNFa6wvWcyAn7T2mr8jA2j1d74tGEWo72mK QleyU5ghHA1cGkBKDSltXeyiOiksuQmihFTxU2oXF+eMtw3VZcjDeEjnz+WVVWyXfEJz QgX1lAQaZbkwLwPdOkrklQP/n3q5S5sE8wqGodZmzAApVALHbpQHq13sQL2uTvFYKsNM KeNxrialYEY5Y76vyU8PAeD2Z5/6ZUnbqy7zAYYihRT7K96T8W+zZcrHIZZ6Sh5qfHvd 3c1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b="ahof7/VW"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id rj8si6180649pjb.53.2021.07.23.02.15.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 02:15:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b="ahof7/VW"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 23C586F8C5; Fri, 23 Jul 2021 09:15:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id E76B56F8C5; Fri, 23 Jul 2021 09:15:39 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id D50BC60ED4; Fri, 23 Jul 2021 09:15:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627031739; bh=SE6snYvEeeZ9b06fLIc5TbNhAAvsQE2VfQEDDanskLQ=; h=From:To:Cc:Subject:Date:From; b=ahof7/VWmPmw0D21oaa1MW95ypJ8UCeqvOHW0gxCOovI1GP4WDQob2SBP6z6mG5kM rdkvSamfwj66jEMJkDqwBeIhZ650s1C2OzzobetoM2lIqESrHUshs/SfneFj1zoFcI QfhI6pP8cT4as2G8hKYqUcmCyj+/HzjzfUpZzRkiQqDh6JwEL9YFRXHOSy3sL9PNq4 fOkHTpqtF7RxRupdpMFNpgGck7vrfreFZIlP3dg22xQnZru3tT0q0FySu6P+SJnPAh WN3506dobl/mPLCtlxUSq/yHH9Ulb8oLe3H+71W6DJSqy9gCbW2fv3UMuAW3TGnKKH HZXUqs24iWNdQ== From: Arnd Bergmann To: Ben Skeggs , David Airlie , Daniel Vetter , Lyude Paul Subject: [PATCH] drm/nouveau/kms/nv50-: fix build failure with CONFIG_BACKLIGHT=n Date: Fri, 23 Jul 2021 11:15:27 +0200 Message-Id: <20210723091534.1730564-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Nikola Cornij Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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(-) -- 2.29.2 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);