From patchwork Fri Aug 14 06:57:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1344668 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; dmarc=fail (p=none dis=none) header.from=canonical.com 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 4BSZ630ZTnz9sTN; Fri, 14 Aug 2020 16:58:35 +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 1k6Tfa-0007xh-KH; Fri, 14 Aug 2020 06:58:30 +0000 Received: from mail-pg1-f173.google.com ([209.85.215.173]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k6TfW-0007qC-5v for kernel-team@lists.ubuntu.com; Fri, 14 Aug 2020 06:58:26 +0000 Received: by mail-pg1-f173.google.com with SMTP id t6so4096067pgq.1 for ; Thu, 13 Aug 2020 23:58:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y8AtkVooBPezhJmlqAj1GncygOGpW/j+ct6cBy5GcHc=; b=eoAWvfY3yytfdsmgr1fS/7uEFyVKOdaml8GJOAeAI356r0obKuZFCGT7k4lyvdaVU0 l1FhQVD++mLS/ldMd0E6qYL59sMHI2LUE83dKa2G38mzhmGqWl2YDCkbiiX5vhFIRInT 18ARfjl5dFpcfY84NtIyqOfRyEtAeeskSXmtylUrOvGDkxx/5rNwQN8oMMRYNtva3brU 1ngQ6/IQLTqDMfo2xRQHt6OkdZCMshUpjv9+UXR286Q666nXYWJj5lUQFqi08tabn7GH znz/LfXaRekJ/UYmZy9Kc6/PK7Zi7xXGf+MccerBwZ8ke2h6JGPHn6F96ErCdufq7hzW r1zQ== X-Gm-Message-State: AOAM532RY3iLtRUORoREFpB9D1nNeWLJrsZzVof9j9bWPAnEprhQXLS4 siOa2Q0wtx+4U24M+USkAOYa4ncWhAyvIA== X-Google-Smtp-Source: ABdhPJzjkVKl7tFJ0BHkfbx4jYV531xp3HWIBWUldhKFBHuOuQ62QxtLwRgCCg7P8d73I25rqFW3Og== X-Received: by 2002:a63:2584:: with SMTP id l126mr876493pgl.126.1597388300836; Thu, 13 Aug 2020 23:58:20 -0700 (PDT) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id o10sm7025268pjo.55.2020.08.13.23.58.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2020 23:58:20 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 14/31][SRU][OEM-5.6] drm/i915: Don't check for wm changes until we've compute the wms fully Date: Fri, 14 Aug 2020 14:57:23 +0800 Message-Id: <20200814065740.276039-15-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200814065740.276039-1-vicamo.yang@canonical.com> References: <20200814065740.276039-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.173; envelope-from=vicamo@gmail.com; helo=mail-pg1-f173.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: Ville Syrjälä BugLink: https://bugs.launchpad.net/bugs/1891451 Currently we're comparing the watermarks between the old and new states before we've fully computed the new watermarks. In particular skl_build_pipe_wm() will not account for the amount of ddb space we'll have. That information is only available during skl_compute_ddb() which will proceed to zero out any watermark level exceeding the ddb allocation. If we're short on ddb space this will end up adding the plane to the state due erronously determining that the watermarks have changed. Fix the problem by deferring skl_wm_add_affected_planes() until we have the final watermarks computed. Noticed this when trying enable transition watermarks on glk. We now computed the trans_wm as 28, but we only had 14 blocks of ddb, and thus skl_compute_ddb() ended up disabling the cursor trans_wm every time. Thus we ended up adding the cursor to every commit that didn't actually affect the cursor at all. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200228203552.30273-2-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza (cherry picked from commit 23baedd217effd594bdf4620c1fea4d27febe090) Signed-off-by: You-Sheng Yang --- drivers/gpu/drm/i915/intel_pm.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index d25726666177..e5460b470f1f 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -5769,16 +5769,24 @@ skl_compute_wm(struct intel_atomic_state *state) ret = skl_build_pipe_wm(new_crtc_state); if (ret) return ret; - - ret = skl_wm_add_affected_planes(state, crtc); - if (ret) - return ret; } ret = skl_compute_ddb(state); if (ret) return ret; + /* + * skl_compute_ddb() will have adjusted the final watermarks + * based on how much ddb is available. Now we can actually + * check if the final watermarks changed. + */ + for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, + new_crtc_state, i) { + ret = skl_wm_add_affected_planes(state, crtc); + if (ret) + return ret; + } + skl_print_wm_changes(state); return 0;