From patchwork Wed Jul 5 07:26:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1803454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=OxAOlo+w; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qwrp90vkVz20bL for ; Wed, 5 Jul 2023 17:27:11 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qGwuj-0005rW-Cv; Wed, 05 Jul 2023 07:27:01 +0000 Received: from mail-pl1-f174.google.com ([209.85.214.174]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qGwuh-0005r7-T3 for kernel-team@lists.ubuntu.com; Wed, 05 Jul 2023 07:27:00 +0000 Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1b7ffab7ff1so35152675ad.2 for ; Wed, 05 Jul 2023 00:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688542018; x=1691134018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=oQPFHg+AHiPHlGcTutJW2OgBhxnEoNhG/gRKYniYsuc=; b=OxAOlo+wbKX7tVjuiNYgm1MVa1BqQk6iKWt4mMZmrG3YFsfcRTbrsb9ABfBCc/fycC QsE4rRkA2DMjH124dH0nq72EcuRBce8pcKM7KZGZ236ybkCZ4tc475NPWhuOBepubRoi 0vU86f6b/+xqsdKoYitHLHAGIKP3gfE7dwDOpz1bswk5+9PrFaCQYmQCi6wVgAHPZWx+ 4yWUzdOL4JWzHBeaTTTAxws0nfpJJdTUkU9NWEqnQp9OadxlUyysMXMHq9szB0fIpHaw IsH83QaQPth2VcSDuOMaRPhnHQa9E1APMUrDtYk2YmT2oIllNbgQUX+VUly5e5M3+NJR 6iew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688542018; x=1691134018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=oQPFHg+AHiPHlGcTutJW2OgBhxnEoNhG/gRKYniYsuc=; b=GNq6JnZ2/6lhBAtALL+M1oHcV8Kr7Sq4FNzc5uP02JaibiI/utdHoZrt/FQVq3aU+M cun2LVsL8QyKuOhjdK//+0HZWPhVEwA9rnOnRacCI5YhiIs6bkjagGQfrP6140o2a4Y1 8KcpenfvseQb6aUcP3STXMdylyYn5XqKPm1sOOEd0f0rrQX716T6WwEZWIa9nlxzYCg7 EiqoBvcuJARRZzU9zxv2IAgD/Tou3BgazPmg9QI0pzpkE1Orx7gN1lZ/MghyrQX4Ka4k fRojrWlgquOTc+lEklg7NT23UU4FfgO8Uo51+PsfYpyuCeCrqlR5H9yQurVS+iszxgaq bzCg== X-Gm-Message-State: ABy/qLbW2o4oWFX9qro0qdD2wesH2Ry5fI3jVO3+6pZ/SQUT4cJpjrkh LqIXdkMYiMfXaWLe+u0AlhMInaspIfo= X-Google-Smtp-Source: APBJJlHqxk0wqzKmaJDLMBgu60QGlWo4Yo3LShRGYFapykfjt/IBK0ynv2gwYoeCzNnZKvyG+EjcWg== X-Received: by 2002:a17:902:e5d2:b0:1b8:30d8:bc45 with SMTP id u18-20020a170902e5d200b001b830d8bc45mr10114256plf.47.1688542017881; Wed, 05 Jul 2023 00:26:57 -0700 (PDT) Received: from localhost (118-163-61-247.hinet-ip.hinet.net. [118.163.61.247]) by smtp.gmail.com with ESMTPSA id d10-20020a170902ceca00b001b8a8154f3fsm2263632plg.270.2023.07.05.00.26.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jul 2023 00:26:57 -0700 (PDT) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 1/1][SRU][M] UBUNTU: SAUCE: drm/i915/quirks: Add multiple VBT quirk for HP ZBook Power G10 Date: Wed, 5 Jul 2023 15:26:52 +0800 Message-Id: <20230705072652.757019-2-acelan.kao@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230705072652.757019-1-acelan.kao@canonical.com> References: <20230705072652.757019-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.174; envelope-from=acelan@gmail.com; helo=mail-pl1-f174.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: "Chia-Lin Kao (AceLan)" BugLink: https://bugs.launchpad.net/bugs/2025195 The quirk is to fix the bug[1] when you see this message[2]. The first port is not the right port we want to use and it leads to the HDMI monitor doesn't work. According the bug report, skip the return works around the issue, so I created the DMI quirk to list affected platforms. Intel is submitting patches[3][4] to fix the issue, but it requires to backport huge drm structure changes, too. As there is no regression found with this workaround, it's safer to use the DMI quirk to handle this issue. 1. https://gitlab.freedesktop.org/drm/intel/-/issues/7709 2. kernel: i915 0000:00:02.0: [drm:intel_bios_init [i915]] More than one child device for port B in VBT, using the first. 3. https://patchwork.freedesktop.org/series/117641/ 4. https://patchwork.freedesktop.org/series/114200/ v2. removed sku number in the DMI quirk as all platforms are affected Signed-off-by: Chia-Lin Kao (AceLan) --- drivers/gpu/drm/i915/display/intel_bios.c | 3 +- drivers/gpu/drm/i915/display/intel_display.c | 2 ++ drivers/gpu/drm/i915/display/intel_quirks.c | 38 ++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_quirks.h | 2 ++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 04b846440de6..d505c478a6ff 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -34,6 +34,7 @@ #include "intel_display.h" #include "intel_display_types.h" #include "intel_gmbus.h" +#include "intel_quirks.h" #define _INTEL_BIOS_PRIVATE #include "intel_vbt_defs.h" @@ -2730,7 +2731,7 @@ static void parse_ddi_port(struct intel_bios_encoder_data *devdata) return; } - if (i915->display.vbt.ports[port]) { + if (i915->display.vbt.ports[port] && !intel_has_quirk(i915, QUIRK_MULTIPLE_VBT_DEVICES)) { drm_dbg_kms(&i915->drm, "More than one child device for port %c in VBT, using the first.\n", port_name(port)); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index c84b581c61c6..ea90f957a5b9 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -8666,6 +8666,8 @@ int intel_modeset_init_noirq(struct drm_i915_private *i915) return ret; } + intel_init_quirks_early(i915); + intel_bios_init(i915); ret = intel_vga_register(i915); diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c index a280448df771..4428b8e38530 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_multiple_vbt_devices(struct drm_i915_private *i915) +{ + intel_set_quirk(i915, QUIRK_MULTIPLE_VBT_DEVICES); + drm_info(&i915->drm, "Applying multiple VBT devices 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_multiple_vbt_devices(const struct dmi_system_id *id) +{ + DRM_INFO("Allow multiple VBT devices in one port on %s\n", id->ident); + return 1; +} + static const struct intel_dmi_quirk intel_dmi_quirks[] = { { .dmi_id_list = &(const struct dmi_system_id[]) { @@ -138,6 +150,22 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = { }, }; +static const struct intel_dmi_quirk intel_dmi_quirks_early[] = { + { + .dmi_id_list = &(const struct dmi_system_id[]) { + { + .callback = intel_dmi_multiple_vbt_devices, + .ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC", + .matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"), + }, + }, + { } + }, + .hook = quirk_multiple_vbt_devices, + }, +}; + static struct intel_quirk intel_quirks[] = { /* Lenovo U160 cannot use SSC on LVDS */ { 0x0046, 0x17aa, 0x3920, quirk_ssc_force_disable }, @@ -224,6 +252,16 @@ void intel_init_quirks(struct drm_i915_private *i915) } } +void intel_init_quirks_early(struct drm_i915_private *i915) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(intel_dmi_quirks_early); i++) { + if (dmi_check_system(*intel_dmi_quirks_early[i].dmi_id_list) != 0) + intel_dmi_quirks_early[i].hook(i915); + } +} + bool intel_has_quirk(struct drm_i915_private *i915, enum intel_quirk_id quirk) { return i915->display.quirks.mask & BIT(quirk); diff --git a/drivers/gpu/drm/i915/display/intel_quirks.h b/drivers/gpu/drm/i915/display/intel_quirks.h index 10a4d163149f..4faa16e46882 100644 --- a/drivers/gpu/drm/i915/display/intel_quirks.h +++ b/drivers/gpu/drm/i915/display/intel_quirks.h @@ -17,9 +17,11 @@ enum intel_quirk_id { QUIRK_INVERT_BRIGHTNESS, QUIRK_LVDS_SSC_DISABLE, QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK, + QUIRK_MULTIPLE_VBT_DEVICES, }; void intel_init_quirks(struct drm_i915_private *i915); +void intel_init_quirks_early(struct drm_i915_private *i915); bool intel_has_quirk(struct drm_i915_private *i915, enum intel_quirk_id quirk); #endif /* __INTEL_QUIRKS_H__ */