From patchwork Mon Jan 18 14:26:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1428192 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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: 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=20161025 header.b=N4WBnULn; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DKDcZ5BH6z9sWL; Tue, 19 Jan 2021 01:26:38 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1l1VUI-00051k-WD; Mon, 18 Jan 2021 14:26:34 +0000 Received: from mail-pl1-f169.google.com ([209.85.214.169]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l1VUH-0004yj-P8 for kernel-team@lists.ubuntu.com; Mon, 18 Jan 2021 14:26:33 +0000 Received: by mail-pl1-f169.google.com with SMTP id s15so8730423plr.9 for ; Mon, 18 Jan 2021 06:26:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UhZe4FqM+tljMswGuhTmk2XIzcOsX4UZrcFt0CKeBTg=; b=N4WBnULn9quEPduYWQNpm8hBGNauEhO1iGTSj4aMblf+N9LvkOtW6odjn2SQgHY/p9 kjwaTTXiZprwyKtRIVYPVPvOiD9EluoFBCmeeW2vgeeNuBokU2X5qkNOMFiLmlgLZrE/ Vx7xxrzuokJZBcI8JrfWc1zPe+7SwKISxjg7cQLDDolYaQnWT1IL9lL839j1YKDR7PtB mSqUDp6gtCbP/vx3l8d+Q0sYQeMN5tPgRmXEVL5Qa+Jh2GAr3mcASn2R6cGxiuUya7a6 uYj+HawcgYl5pbtE9i7LCJevwXes4GFd2YXxbTP8pbhfof4oUyPhk792XtnlG+GoXY6F pLLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=UhZe4FqM+tljMswGuhTmk2XIzcOsX4UZrcFt0CKeBTg=; b=H1YijdTne9MP+7BGwcIx4ylt3Ng9lU7jG9SsGOCvk3Q5CH++xeOf9PGKHD8hpx3BHT dt4GEYtQFAoqf1rxUfF0u3yuMZBxLhsfkwSlJgXCuvGxH+Qx9C/l6XfydsJDNwgs6ez6 BBFVPSBzcfT4UAlY7VAsvv/G39GKHFTMV/PrKfi5AYftE52hLIPeR0YQdYi7J+ib3kWy MUwaJJxNJHLg/dv/Os+9F01a43qUo4hbgF0438SAFOSeOWwLm0LRebG/Rbsjv4BvKFyL 1qq1u7ewF3ISyA6FHg6GH5hadjSjrZvQPRM+A4AZewm4ceOItNoJZR5VJHVI5TEgplgg xH4g== X-Gm-Message-State: AOAM530lYwX0Y4L600k4qH6nIZIvL5CpkLQGZcuWuUBsLtGJpVP6F2h1 dijo+EdoxNGXP47OjqkWqPLc+FdIspbbfw== X-Google-Smtp-Source: ABdhPJxKy3Tf8ndyW5zynrtCivgqCUt0bFTKI6jCFM1AcSpvj3aOWvIwtUw1bNi5Gc1rA4u0++RklQ== X-Received: by 2002:a17:90a:808a:: with SMTP id c10mr14210893pjn.229.1610979990454; Mon, 18 Jan 2021 06:26:30 -0800 (PST) Received: from localhost (61-220-137-34.HINET-IP.hinet.net. [61.220.137.34]) by smtp.gmail.com with ESMTPSA id 123sm6195376pfg.139.2021.01.18.06.26.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 06:26:29 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 09/10][SRU][OEM-5.10][Unstable] drm/i915/rkl: new rkl ddc map for different PCH Date: Mon, 18 Jan 2021 22:26:03 +0800 Message-Id: <20210118142604.207243-10-acelan.kao@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210118142604.207243-1-acelan.kao@canonical.com> References: <20210118142604.207243-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.169; envelope-from=acelan@gmail.com; helo=mail-pl1-f169.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: Lee Shawn C BugLink: https://bugs.launchpad.net/bugs/1909457 After boot into kernel. Driver configured ddc pin mapping based on predefined table in parse_ddi_port(). Now driver configure rkl ddc pin mapping depends on icp_ddc_pin_map[]. Then this table will give incorrect gmbus port number to cause HDMI can't work. Refer to commit cd0a89527d06 ("drm/i915/rkl: Add DDC pin mapping"). Create two ddc pin table for rkl TGP and CMP pch. Then HDMI can works properly on rkl. v2: update patch based on latest dinq branch. v3: update ddc table for RKL+TGP sku. RKL+CNP sku will load cnp_ddc_pin_map[] setting. v4: modify the if/else judgment to avoid nesting. v5: fix typo in v4. Cc: Matt Roper Cc: Aditya Swarup Cc: Anusha Srivatsa Cc: Jani Nikula Cc: Cooper Chiou Cc: Khaled Almahallawy Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2577 Signed-off-by: Lee Shawn C Reviewed-by: Matt Roper Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20201117142629.28729-1-shawn.c.lee@intel.com (cherry picked from commit 956aee8fa366cfd9d693aa6e7ef822b775980c01 drm-next) Signed-off-by: Chia-Lin Kao (AceLan) --- drivers/gpu/drm/i915/display/intel_bios.c | 10 ++++++++++ drivers/gpu/drm/i915/display/intel_vbt_defs.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index a3aa8fbd9714..973672489566 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -1598,6 +1598,13 @@ static const u8 icp_ddc_pin_map[] = { [TGL_DDC_BUS_PORT_6] = GMBUS_PIN_14_TC6_TGP, }; +static const u8 rkl_pch_tgp_ddc_pin_map[] = { + [ICL_DDC_BUS_DDI_A] = GMBUS_PIN_1_BXT, + [ICL_DDC_BUS_DDI_B] = GMBUS_PIN_2_BXT, + [RKL_DDC_BUS_DDI_D] = GMBUS_PIN_9_TC1_ICP, + [RKL_DDC_BUS_DDI_E] = GMBUS_PIN_10_TC2_ICP, +}; + static u8 map_ddc_pin(struct drm_i915_private *dev_priv, u8 vbt_pin) { const u8 *ddc_pin_map; @@ -1605,6 +1612,9 @@ static u8 map_ddc_pin(struct drm_i915_private *dev_priv, u8 vbt_pin) if (INTEL_PCH_TYPE(dev_priv) >= PCH_DG1) { return vbt_pin; + } else if (IS_ROCKETLAKE(dev_priv) && INTEL_PCH_TYPE(dev_priv) == PCH_TGP) { + ddc_pin_map = rkl_pch_tgp_ddc_pin_map; + n_entries = ARRAY_SIZE(rkl_pch_tgp_ddc_pin_map); } else if (INTEL_PCH_TYPE(dev_priv) >= PCH_ICP) { ddc_pin_map = icp_ddc_pin_map; n_entries = ARRAY_SIZE(icp_ddc_pin_map); diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h b/drivers/gpu/drm/i915/display/intel_vbt_defs.h index 54bcc6a6947c..1a17ef519d74 100644 --- a/drivers/gpu/drm/i915/display/intel_vbt_defs.h +++ b/drivers/gpu/drm/i915/display/intel_vbt_defs.h @@ -319,6 +319,8 @@ enum vbt_gmbus_ddi { ICL_DDC_BUS_DDI_A = 0x1, ICL_DDC_BUS_DDI_B, TGL_DDC_BUS_DDI_C, + RKL_DDC_BUS_DDI_D = 0x3, + RKL_DDC_BUS_DDI_E, ICL_DDC_BUS_PORT_1 = 0x4, ICL_DDC_BUS_PORT_2, ICL_DDC_BUS_PORT_3,