From patchwork Fri Mar 22 11:40:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Lisovskiy, Stanislav" X-Patchwork-Id: 13599992 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4BF39C54E71 for ; Fri, 22 Mar 2024 11:40:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5790D10F6A3; Fri, 22 Mar 2024 11:40:58 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="WfUKQLCo"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id A8D8E10F657 for ; Fri, 22 Mar 2024 11:40:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711107653; x=1742643653; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KJNAYWd5qCqe9YJSv/Pznf+ue5ZK6aTZe3com5dz7Xg=; b=WfUKQLCo6C9dJARqpSAFgWHeKmnrR+abX8HP1X8zZS9wBUSgL/tgI5rq yBt48qVXo6PMR+FQ/ZOgiXa0p+ngJZnwKnULoyyPye40lfAxcWV8xl8Qh 1x4kDalsvxsGffCDXfyjLenyQ3HRtZi5jGtuhYHSnAKwVSQ1H+48xvrqU mMb+iCOUOlgghi/LtO92QTHrO+zcc6W+xpyL7IJv832/BZbDJ9iwU+O5w uf5X6Bsze4p7VvUBo9tZdaJzoaqSOfhLXAEISQqKz2KxPsdffBvBHwLk+ V1PAhdUVS1Cop9GwFKmKON5zDPGNmFzGF6ihTArjYlLZKTJ/da9P18SuJ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11020"; a="9939215" X-IronPort-AV: E=Sophos;i="6.07,145,1708416000"; d="scan'208";a="9939215" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2024 04:40:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,145,1708416000"; d="scan'208";a="14906487" Received: from unknown (HELO slisovsk-Lenovo-ideapad-720S-13IKB.fi.intel.com) ([10.237.72.65]) by fmviesa009.fm.intel.com with ESMTP; 22 Mar 2024 04:40:51 -0700 From: Stanislav Lisovskiy To: intel-gfx@lists.freedesktop.org Cc: jani.saarinen@intel.com, Stanislav.Lisovskiy@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH 3/5] drm/i915: Use old mbus_join value when increasing CDCLK Date: Fri, 22 Mar 2024 13:40:44 +0200 Message-Id: <20240322114046.24930-4-stanislav.lisovskiy@intel.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20240322114046.24930-1-stanislav.lisovskiy@intel.com> References: <20240322114046.24930-1-stanislav.lisovskiy@intel.com> MIME-Version: 1.0 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" In order to make sure we are not breaking the proper sequence lets to updates step by step and don't change MBUS join value during MDCLK/CDCLK programming stage. MBUS join programming would be taken care by pre/post ddb hooks. Signed-off-by: Stanislav Lisovskiy Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_cdclk.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c index 31aaa9780dfcf..43a9616c78260 100644 --- a/drivers/gpu/drm/i915/display/intel_cdclk.c +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c @@ -2611,9 +2611,19 @@ intel_set_cdclk_pre_plane_update(struct intel_atomic_state *state) if (pipe == INVALID_PIPE || old_cdclk_state->actual.cdclk <= new_cdclk_state->actual.cdclk) { + struct intel_cdclk_config cdclk_config; + drm_WARN_ON(&i915->drm, !new_cdclk_state->base.changed); - intel_set_cdclk(i915, &new_cdclk_state->actual, pipe); + /* + * By this hack we want to prevent mbus_join to be programmed + * beforehand - we will take care of this later in pre ddb + * programming hook. + */ + cdclk_config = new_cdclk_state->actual; + cdclk_config.joined_mbus = old_cdclk_state->actual.joined_mbus; + + intel_set_cdclk(i915, &cdclk_config, pipe); } }