Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3297363pxj; Mon, 14 Jun 2021 20:19:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynFaNycMI6g/RIJNKvO4PxaCiidF8YjLRzGVtRRMsm3PlAJES2zRCdZjqOxAYi9uDIthA8 X-Received: by 2002:aa7:cc19:: with SMTP id q25mr20364834edt.56.1623727165563; Mon, 14 Jun 2021 20:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623727165; cv=none; d=google.com; s=arc-20160816; b=Ub+liKBtlrfXBeRPACzZl7QXOrJGZh+gtV+0DNP3/0RZpdFB4nyqp6OXDIDrDizWtI 3tFWVVecTzeTUorDdRm9T5+4a50o1sytX0Lk87ufQKRfstf9pjTVHVzRi69tOC+Ujk6m N/dLNsUbs82+VcnG3zmUXzHnSO8+l7BWJ+FvmWRauHyRR1+h32sW3twt3uRfVeOvPwMf lzFNF6XMEiw7QJ2nkUyqsMoGEL5ankKSlI+k8JFOQDUEUhwRklGct5TVUnreshVvgkj7 g4vVZhmx/SweGCgnEg6trO7WUsYhs+Akvagjd3ilGz0KLXW0jgsH4ue7SifLkdOZBGbT VaDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=y9QYGmCj5EcvHL0ryAVQr6Ml73ocUP6PiIXnvxqs4ME=; b=L9ur/sfQsPP6LQ4H4taKU29W5fpo2Mve1AwEPFCWkMuRKHXRJrDKNrs+iDWxl1fY5h X+20FHtVRZ9VpZhIjf/TCp8OeFUYrr5uWZacuY8L1v2MNl+LRMDv5x+SRhdrOu6HqZIw hcr2uh6U1hMtshadPku/OtFhIX1XTW6uuSXEEiqbSJ5fmFia7fhXNk6vBQn8KUVXugKH z+r4UzlM24YLHFyoUJeIl1n440se5tOUWMijezwrp80FI6e24SMBMQiwy88cnI4KVoRw X1lMkxayASfFbtqkCiBxy3fC3cIM4yjVyQ1y9TLI6D2pGegFcx6RCaBGnxS5Op73GUei VHCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r7si12259666edd.2.2021.06.14.20.19.02; Mon, 14 Jun 2021 20:19:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230516AbhFODSP (ORCPT + 99 others); Mon, 14 Jun 2021 23:18:15 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:4906 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230240AbhFODSO (ORCPT ); Mon, 14 Jun 2021 23:18:14 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G3tg04CqHz6yQb; Tue, 15 Jun 2021 11:13:00 +0800 (CST) Received: from dggpemm500016.china.huawei.com (7.185.36.25) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 15 Jun 2021 11:16:09 +0800 Received: from huawei.com (10.67.174.205) by dggpemm500016.china.huawei.com (7.185.36.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 15 Jun 2021 11:16:08 +0800 From: Chen Jiahao To: , , , , , , , , , CC: , Subject: [PATCH] drm: nouveau: fix nouveau_backlight compiling error Date: Tue, 15 Jun 2021 11:16:58 +0800 Message-ID: <20210615031658.176218-1-chenjiahao16@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.174.205] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500016.china.huawei.com (7.185.36.25) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is a compiling error in disp.c while not selecting CONFIG_DRM_NOUVEAU_BACKLIGHT: 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’ 1665 | 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’ 1670 | if (backlight && backlight->uses_dpcd) { | ^~ The problem is solved by adding the CONFIG_DRM_NOUVEAU_BACKLIGHT dependency where struct nouveau_backlight is used. Signed-off-by: Chen Jiahao --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 093e1f7163b3..d266b7721e29 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1662,17 +1662,21 @@ nv50_sor_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_state *st 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); +#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT struct nouveau_backlight *backlight = nv_connector->backlight; +#endif struct drm_dp_aux *aux = &nv_connector->aux; int ret; u8 pwr; +#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT if (backlight && backlight->uses_dpcd) { 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); -- 2.31.1