From patchwork Fri Feb 12 18:22:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Souza, Jose" X-Patchwork-Id: 12085863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB23BC433DB for ; Fri, 12 Feb 2021 18:20:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7205C64E8E for ; Fri, 12 Feb 2021 18:20:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7205C64E8E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 141586E1D8; Fri, 12 Feb 2021 18:20:44 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED7D96E1D8 for ; Fri, 12 Feb 2021 18:20:42 +0000 (UTC) IronPort-SDR: avTWEcsA6IVQgOnJ5wXVrVrfYqvV+0yk/bkZyA9zu1pyLsLYBQRuVQeh7m1xjsPaqnu5O/7SP6 7LgMv8x7tYsw== X-IronPort-AV: E=McAfee;i="6000,8403,9893"; a="161599194" X-IronPort-AV: E=Sophos;i="5.81,174,1610438400"; d="scan'208";a="161599194" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2021 10:20:41 -0800 IronPort-SDR: fy+zKhG/7PrOuKrTSeiuUSXeTWEWLhx53UX0W2Pr+gw8HuOH+Nnik0X2fOTdUrvlHpQgGte9WI 0uf75VJNqepg== X-IronPort-AV: E=Sophos;i="5.81,174,1610438400"; d="scan'208";a="491231844" Received: from sarcot-mobl1.amr.corp.intel.com (HELO josouza-mobl2.intel.com) ([10.254.56.203]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2021 10:20:40 -0800 From: =?utf-8?q?Jos=C3=A9_Roberto_de_Souza?= To: intel-gfx@lists.freedesktop.org Date: Fri, 12 Feb 2021 10:22:01 -0800 Message-Id: <20210212182201.155043-3-jose.souza@intel.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210212182201.155043-1-jose.souza@intel.com> References: <20210212182201.155043-1-jose.souza@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/3] drm/i915: Fix plane watermark mismatches X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Found a system were firmware/BIOS left the plane_res_b and plane_res_l set with non-zero values for disable planes. As the planes are disabled i915 will not even try to sanitize it so here returning earlier if both skl_wm_levels being compared are disabled, if that is true no need to check the other fields as HW will ignore it. Signed-off-by: José Roberto de Souza --- drivers/gpu/drm/i915/intel_pm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 8cc67f9c4e58..c630dc10c34b 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -5633,6 +5633,8 @@ void skl_write_cursor_wm(struct intel_plane *plane, bool skl_wm_level_equals(const struct skl_wm_level *l1, const struct skl_wm_level *l2) { + if (l1->plane_en == false && l2->plane_en == false) + return true; return l1->plane_en == l2->plane_en && l1->ignore_lines == l2->ignore_lines && l1->plane_res_l == l2->plane_res_l &&