From patchwork Wed May 16 10:38:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 10403585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CC5C60155 for ; Wed, 16 May 2018 10:38:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58E372856A for ; Wed, 16 May 2018 10:38:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D574285AF; Wed, 16 May 2018 10:38:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E689D2856A for ; Wed, 16 May 2018 10:38:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 55BE66E3B5; Wed, 16 May 2018 10:38:26 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mblankhorst.nl (mblankhorst.nl [141.105.120.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 472B66E3B5 for ; Wed, 16 May 2018 10:38:25 +0000 (UTC) From: Maarten Lankhorst To: intel-gfx@lists.freedesktop.org Date: Wed, 16 May 2018 12:38:21 +0200 Message-Id: <20180516103821.53661-1-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.17.0 Subject: [Intel-gfx] [PATCH] drm/i915: Enable fastset by default, except on initial modeset X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP We may not be perfect at reading out the initial mode, but when the mode is sanitized by our first modeset we know for sure the state is compatible, so we can compare with intel_pipe_config_compare. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/intel_display.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e6babd9ae07a..9985236b488b 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12179,6 +12179,22 @@ static int calc_watermark_data(struct drm_atomic_state *state) return 0; } +static bool can_fastset(struct drm_i915_private *dev_priv, + struct intel_crtc_state *old_crtc_state, + struct intel_crtc_state *new_crtc_state) +{ + bool reset_mode = + old_crtc_state->base.mode.private_flags && + !new_crtc_state->base.mode.private_flags; + + /* Without fastboot, we always want to modeset the initial mode. */ + if (reset_mode && !i915_modparams.fastboot) + return false; + + return intel_pipe_config_compare(dev_priv, old_crtc_state, + new_crtc_state, true); +} + /** * intel_atomic_check - validate state object * @dev: drm device @@ -12209,6 +12225,8 @@ static int intel_atomic_check(struct drm_device *dev, for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, crtc_state, i) { struct intel_crtc_state *pipe_config = to_intel_crtc_state(crtc_state); + struct intel_crtc_state *old_intel_crtc_state = + to_intel_crtc_state(old_crtc_state); if (!needs_modeset(crtc_state)) continue; @@ -12225,10 +12243,7 @@ static int intel_atomic_check(struct drm_device *dev, return ret; } - if (i915_modparams.fastboot && - intel_pipe_config_compare(dev_priv, - to_intel_crtc_state(old_crtc_state), - pipe_config, true)) { + if (can_fastset(dev_priv, old_intel_crtc_state, pipe_config)) { crtc_state->mode_changed = false; pipe_config->update_pipe = true; }