From patchwork Wed Aug 24 12:14:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 600048 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE43FC00140 for ; Wed, 24 Aug 2022 12:15:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235856AbiHXMPz (ORCPT ); Wed, 24 Aug 2022 08:15:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237231AbiHXMPu (ORCPT ); Wed, 24 Aug 2022 08:15:50 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B98960697 for ; Wed, 24 Aug 2022 05:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661343348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fez5JurfKkdDHmkN5O68TIQTTlcqRFGtraUyOgljYGY=; b=K40HM0jB5t15POSd8EB8jxu83tMZ7ZPtnkMNGzC1Ai+tEkk6AV1QyCQ0JJ7+z2Yn+vTDT/ gPNIhliCu0kBLP+uKLZDwtCVS6hJrqfO7zDnAwKdMhgITCbmSvF87bUnBQlgQU9ATF51kV zbsHGhqBgi9GuTJadjFHlTz3Kua7YPU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-510-cNAXySJINM6P_8HiGuvrAw-1; Wed, 24 Aug 2022 08:15:46 -0400 X-MC-Unique: cNAXySJINM6P_8HiGuvrAw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E7F40101AA47; Wed, 24 Aug 2022 12:15:44 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.193.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BC71C15BB3; Wed, 24 Aug 2022 12:15:41 +0000 (UTC) From: Hans de Goede To: Ben Skeggs , Karol Herbst , Lyude , Daniel Dadap , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Pan@vger.kernel.org, Xinhui , "Rafael J . Wysocki" , Mika Westerberg , Lukas Wunner , Mark Gross , Andy Shevchenko Cc: Hans de Goede , nouveau@lists.freedesktop.org, Daniel Vetter , David Airlie , intel-gfx , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Len Brown , linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH v4 02/31] drm/i915: Don't register backlight when another backlight should be used Date: Wed, 24 Aug 2022 14:14:54 +0200 Message-Id: <20220824121523.1291269-3-hdegoede@redhat.com> In-Reply-To: <20220824121523.1291269-1-hdegoede@redhat.com> References: <20220824121523.1291269-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Before this commit when we want userspace to use the acpi_video backlight device we register both the GPU's native backlight device and acpi_video's firmware acpi_video# backlight device. This relies on userspace preferring firmware type backlight devices over native ones. Registering 2 backlight devices for a single display really is undesirable, don't register the GPU's native backlight device when another backlight device should be used. Signed-off-by: Hans de Goede --- drivers/gpu/drm/i915/display/intel_backlight.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c index 681ebcda97ad..a4dd7924e0c1 100644 --- a/drivers/gpu/drm/i915/display/intel_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_backlight.c @@ -8,6 +8,8 @@ #include #include +#include + #include "intel_backlight.h" #include "intel_backlight_regs.h" #include "intel_connector.h" @@ -952,6 +954,11 @@ int intel_backlight_device_register(struct intel_connector *connector) WARN_ON(panel->backlight.max == 0); + if (!acpi_video_backlight_use_native()) { + DRM_INFO("Skipping intel_backlight registration\n"); + return 0; + } + memset(&props, 0, sizeof(props)); props.type = BACKLIGHT_RAW;