From patchwork Wed Dec 11 02:08:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Souza, Jose" X-Patchwork-Id: 11283733 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D7DC930 for ; Wed, 11 Dec 2019 02:09:11 +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 6649520652 for ; Wed, 11 Dec 2019 02:09:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6649520652 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 C209E6EA40; Wed, 11 Dec 2019 02:09:04 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8B8486EA3B for ; Wed, 11 Dec 2019 02:09:02 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Dec 2019 18:09:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,301,1571727600"; d="scan'208";a="210618401" Received: from josouza-mobl.jf.intel.com (HELO josouza-MOBL.intel.com) ([10.98.40.69]) by fmsmga008.fm.intel.com with ESMTP; 10 Dec 2019 18:09:01 -0800 From: =?utf-8?q?Jos=C3=A9_Roberto_de_Souza?= To: intel-gfx@lists.freedesktop.org Date: Tue, 10 Dec 2019 18:08:57 -0800 Message-Id: <20191211020858.423049-10-jose.souza@intel.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191211020858.423049-1-jose.souza@intel.com> References: <20191211020858.423049-1-jose.souza@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 10/11] drm/i915/display: Check if pipe fastset is allowed by external dependencies 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: , Cc: Lucas De Marchi Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Check if fastset is allowed by external dependencies like other pipes and transcoders. Right now it only forces a fullmodeset when the MST master transcoder did not changed but the pipe of the master transcoder needs a fullmodeset so all slaves also needs to do a fullmodeset. But it will probably be need for port sync as well. Cc: Ville Syrjälä Cc: Lucas De Marchi Cc: Maarten Lankhorst Cc: Manasi Navare Signed-off-by: José Roberto de Souza --- drivers/gpu/drm/i915/display/intel_display.c | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 4dc48e79d14b..9729f0b299b3 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -13930,11 +13930,52 @@ static int calc_watermark_data(struct intel_atomic_state *state) return 0; } +/** + * Check if fastset is allowed by external dependencies like other pipes and + * transcoders. + * + * Right now it only forces a fullmodeset when the MST master transcoder did + * not changed but the pipe of the master transcoder needs a fullmodeset so + * all slaves also needs to do a fullmodeset. + */ +static bool +intel_crtc_check_external_dependencies_fastset(const struct intel_crtc_state *old_crtc_state, + struct intel_crtc_state *new_crtc_state) +{ + struct intel_atomic_state *state = to_intel_atomic_state(new_crtc_state->uapi.state); + struct drm_i915_private *dev_priv = to_i915(new_crtc_state->uapi.crtc->dev); + struct intel_crtc_state *new_crtc_state_iter; + struct intel_crtc *crtc_iter; + int i; + + if (INTEL_GEN(dev_priv) < 12) + return true; + + if (!intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_DP_MST) || + intel_dp_mst_is_master_trans(new_crtc_state)) + return true; + + for_each_new_intel_crtc_in_state(state, crtc_iter, new_crtc_state_iter, i) { + if (new_crtc_state_iter->cpu_transcoder != + new_crtc_state->mst_master_transcoder) + continue; + + return !needs_modeset(new_crtc_state_iter); + } + + DRM_ERROR("Master MST transcoder of pipe not found\n"); + return false; +} + static void intel_crtc_check_fastset(const struct intel_crtc_state *old_crtc_state, struct intel_crtc_state *new_crtc_state) { if (!intel_pipe_config_compare(old_crtc_state, new_crtc_state, true)) return; + if (!intel_crtc_check_external_dependencies_fastset(old_crtc_state, + new_crtc_state)) + return; + new_crtc_state->uapi.mode_changed = false; new_crtc_state->update_pipe = true;