Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp11255994rwd; Thu, 22 Jun 2023 10:41:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68CUMlihgijzB1JNYJL18t4BncZH8kzQKrE/dvbr3fcEp6KkjNdoiwDz1r9k/pPjQD9cox X-Received: by 2002:a05:6358:f1e:b0:129:d242:f782 with SMTP id b30-20020a0563580f1e00b00129d242f782mr14956943rwj.0.1687455671319; Thu, 22 Jun 2023 10:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687455671; cv=none; d=google.com; s=arc-20160816; b=XREWdCuvxJsWIGn9NN+SXGAeZBe86YqTmzC6js9X7CeoSLzhfeDjWIeDySECt/BKBM h3NG9TydwehSfQDnLF2AeZXFx6SUc848B+4lcFcV5yXh84EWrLFQSCIa1yL8lxVMtsbb VBYfX7r1HkIHIyRJT+KVbjxsIqYaPR/pbdATDnyCmzahOE/qQAiw5djl95GuZX8uFGSA tNd5NktcxzYwlgEHyLQY1q3t9MIutv0RHvSEWx8JTQHGobp5p3rgo2nb+BVEbR57gPta RZ+9Us95Cr2AiZNaPV259W6inqeEaLxOxKeXj9mIJc0JvLsGBF9flODW00XxTjhFGNJC GftA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LG+SNuCveJ3k9ZN/Bizrp7A+pc/Q1Y7lTPWIVH04fxs=; b=Oos9Xy4IMoC/zIiWffuK4pnrsRSnGo9FbmBSP3LVeUHPDv4aCQfNaJgWyW/DW3hxl8 7tWZhn7mMYc1kHLdtyIJRRoO9gcFcMTLZ5CihRePFzkxwF9VoJD+svIN6YLEKyBVI8yO 7a0sGdQvWIFf1HVDV1YAXuK6hl6CZBTCDC6UQW7WuCGFa9rfLkkp+HZz/SIesjqzt0UX wo+ZsQg8BFuemJGu/EnRG2LofkywqsWumVQEenLBxZL00UzSw4n6KbdDEEQrKd7Kqu3l wqEjdFizKpSmXGeZjeHUxNNvx/2DlPwG+uw50uXj+GGyhQPJtp092DvcjELZ1ZJJLINz mHhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=T4I3aijP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v71-20020a63894a000000b005321c340960si7034431pgd.811.2023.06.22.10.40.59; Thu, 22 Jun 2023 10:41:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=T4I3aijP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230380AbjFVR2Z (ORCPT + 99 others); Thu, 22 Jun 2023 13:28:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbjFVR2Y (ORCPT ); Thu, 22 Jun 2023 13:28:24 -0400 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ED8E195 for ; Thu, 22 Jun 2023 10:28:23 -0700 (PDT) Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-38e04d1b2b4so5098619b6e.3 for ; Thu, 22 Jun 2023 10:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687454902; x=1690046902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LG+SNuCveJ3k9ZN/Bizrp7A+pc/Q1Y7lTPWIVH04fxs=; b=T4I3aijPx32FFgw6FOHR4Ruv4anJ/z6F+8J8R3KxSSBtkaY0EbMuS4skm/dDmK8OpR vFlZY+b5HP+SGUiOwEE/tsifiyA746cimvL34ghxa5Mpuk2IcHRB8IbkcivmgGhDw76h 4R7f5O8draGsNBPtqFpB4troLWRAbfbUXGljQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687454902; x=1690046902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LG+SNuCveJ3k9ZN/Bizrp7A+pc/Q1Y7lTPWIVH04fxs=; b=Pg+bsoFrv3VstYA9ZAtukbrxalfyRLjIhFk9GFzPmSYtiSdQY8/bdM5pMWPcGUbvPb nKmiOpFyPbu28zSJh9yOatjjaG/s1xvZhewwt4P2efVNTKGHMStmlxtqD0JTQunvEBEs AfmV0dWY6lcWF/DtpouAeiYC23O6OyURsYAOF0eICQ0suKU2/aFUxmEzcC0v6uxpxkzw j6S/WXWgr3jEV7PL/KZiZmUVd75mb3v/zcesH/13oywBApK6hWwimGEEMVDu1AgGYyVS oo13ji0r1jMZl/Lv1T6nC4Ucp4mrpEWrtEmWxX28w79c+lTBBm0rLHlQDGxYv4eB26XY O8cg== X-Gm-Message-State: AC+VfDxWy43/68cBNeyIumSJVJGURgnt5XybOhFUstToUw+OYyQKP2cH wZCbae4mFCqH1WSGi47XOouZKg== X-Received: by 2002:a05:6808:6243:b0:398:9ee4:1dac with SMTP id dt3-20020a056808624300b003989ee41dacmr21175501oib.32.1687454902406; Thu, 22 Jun 2023 10:28:22 -0700 (PDT) Received: from ballway1.c.googlers.com.com (97.173.125.34.bc.googleusercontent.com. [34.125.173.97]) by smtp.gmail.com with ESMTPSA id q15-20020a17090a064f00b002533ce5b261sm36645pje.10.2023.06.22.10.28.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 10:28:22 -0700 (PDT) From: Allen Ballway To: ballway@chromium.org Cc: arun.r.murthy@intel.com, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com, linux-kernel@vger.kernel.org Subject: [PATCH v2] drm/i915/quirk: Add quirk for devices that cannot be dimmed Date: Thu, 22 Jun 2023 17:28:15 +0000 Message-ID: <20230622172817.2281527-1-ballway@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog In-Reply-To: <20230606211901.1.I06e778109090b5dc85c44da7b742d185aa6adb59@changeid> References: <20230606211901.1.I06e778109090b5dc85c44da7b742d185aa6adb59@changeid> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cybernet T10C cannot be dimmed without the backlight strobing. Create a new quirk to lock the minimum brightness to the highest supported value. This aligns the device with its behavior on Windows, which will not lower the brightness below maximum. Signed-off-by: Allen Ballway --- V1 -> V2: Fix style issue. .../gpu/drm/i915/display/intel_backlight.c | 5 ++++ drivers/gpu/drm/i915/display/intel_quirks.c | 27 +++++++++++++++++++ drivers/gpu/drm/i915/display/intel_quirks.h | 1 + 3 files changed, 33 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c index 2e8f17c045222..049e95105e8b6 100644 --- a/drivers/gpu/drm/i915/display/intel_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_backlight.c @@ -1192,6 +1192,11 @@ static u32 get_backlight_min_vbt(struct intel_connector *connector) drm_WARN_ON(&i915->drm, panel->backlight.pwm_level_max == 0); + if (intel_has_quirk(i915, QUIRK_NO_DIM)) { + /* Cannot dim backlight, set minimum to hightest value */ + return panel->backlight.pwm_level_max - 1; + } + /* * XXX: If the vbt value is 255, it makes min equal to max, which leads * to problems. There are such machines out there. Either our diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c index a280448df771a..910c95840a539 100644 --- a/drivers/gpu/drm/i915/display/intel_quirks.c +++ b/drivers/gpu/drm/i915/display/intel_quirks.c @@ -65,6 +65,12 @@ static void quirk_no_pps_backlight_power_hook(struct drm_i915_private *i915) drm_info(&i915->drm, "Applying no pps backlight power quirk\n"); } +static void quirk_no_dim(struct drm_i915_private *i915) +{ + intel_set_quirk(i915, QUIRK_NO_DIM); + drm_info(&i915->drm, "Applying no dim quirk\n"); +} + struct intel_quirk { int device; int subsystem_vendor; @@ -90,6 +96,12 @@ static int intel_dmi_no_pps_backlight(const struct dmi_system_id *id) return 1; } +static int intel_dmi_no_dim(const struct dmi_system_id *id) +{ + DRM_INFO("No dimming allowed on %s\n", id->ident); + return 1; +} + static const struct intel_dmi_quirk intel_dmi_quirks[] = { { .dmi_id_list = &(const struct dmi_system_id[]) { @@ -136,6 +148,20 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = { }, .hook = quirk_no_pps_backlight_power_hook, }, + { + .dmi_id_list = &(const struct dmi_system_id[]) { + { + .callback = intel_dmi_no_dim, + .ident = "Cybernet T10C Tablet", + .matches = {DMI_EXACT_MATCH(DMI_BOARD_VENDOR, + "Cybernet Manufacturing Inc."), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "T10C Tablet"), + }, + }, + { } + }, + .hook = quirk_no_dim, + }, }; static struct intel_quirk intel_quirks[] = { @@ -218,6 +244,7 @@ void intel_init_quirks(struct drm_i915_private *i915) q->subsystem_device == PCI_ANY_ID)) q->hook(i915); } + for (i = 0; i < ARRAY_SIZE(intel_dmi_quirks); i++) { if (dmi_check_system(*intel_dmi_quirks[i].dmi_id_list) != 0) intel_dmi_quirks[i].hook(i915); diff --git a/drivers/gpu/drm/i915/display/intel_quirks.h b/drivers/gpu/drm/i915/display/intel_quirks.h index 10a4d163149fd..b41c7bbf0a5e3 100644 --- a/drivers/gpu/drm/i915/display/intel_quirks.h +++ b/drivers/gpu/drm/i915/display/intel_quirks.h @@ -17,6 +17,7 @@ enum intel_quirk_id { QUIRK_INVERT_BRIGHTNESS, QUIRK_LVDS_SSC_DISABLE, QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK, + QUIRK_NO_DIM, }; void intel_init_quirks(struct drm_i915_private *i915); -- 2.41.0.162.gfafddb0af9-goog