From patchwork Mon Sep 14 09:30:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 7174171 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3B0FC9F39B for ; Mon, 14 Sep 2015 09:30:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60CA520645 for ; Mon, 14 Sep 2015 09:30:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6AF832066F for ; Mon, 14 Sep 2015 09:30:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B0216E66F; Mon, 14 Sep 2015 02:30:19 -0700 (PDT) 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 B999C6E0CC for ; Mon, 14 Sep 2015 02:30:17 -0700 (PDT) Received: from patser.lan (5ED48611.cm-7-5c.dynamic.ziggo.nl [94.212.134.17]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mlankhorst) by mblankhorst.nl (Postfix) with ESMTPSA id 345FA18C04C; Mon, 14 Sep 2015 11:30:15 +0200 (CEST) From: Maarten Lankhorst To: intel-gfx@lists.freedesktop.org Date: Mon, 14 Sep 2015 11:30:11 +0200 Message-Id: <1442223011-15581-2-git-send-email-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1442223011-15581-1-git-send-email-maarten.lankhorst@linux.intel.com> References: <1442223011-15581-1-git-send-email-maarten.lankhorst@linux.intel.com> Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A fast modeset can only be performed when connectors and active are not changed. This prevents a lot of KMS spam when going from a NULL mode with 0 connectors to an actual mode. When a crtc is inactive there's no need to evade either, the changes can be applied when the crtc turns on again. Signed-off-by: Maarten Lankhorst Acked-by: Daniel Stone --- drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index deb76c84a307..eddc81c2d459 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12281,7 +12281,7 @@ intel_compare_link_m_n(const struct intel_link_m_n *m_n, static bool intel_pipe_config_compare(struct drm_device *dev, - struct intel_crtc_state *current_config, + const struct intel_crtc_state *current_config, struct intel_crtc_state *pipe_config, bool adjust) { @@ -13013,14 +13013,15 @@ static int intel_atomic_check(struct drm_device *dev, if (ret) return ret; - if (intel_pipe_config_compare(state->dev, - to_intel_crtc_state(crtc->state), - pipe_config, true)) { + if (!crtc_state->connectors_changed && + !crtc_state->active_changed && + crtc_state->active && + intel_pipe_config_compare(state->dev, + to_intel_crtc_state(crtc->state), + pipe_config, true)) { crtc_state->mode_changed = false; - to_intel_crtc_state(crtc_state)->update_pipe = true; - } - - if (needs_modeset(crtc_state)) { + pipe_config->update_pipe = true; + } else { any_ms = true; ret = drm_atomic_add_affected_planes(state, crtc); @@ -13029,8 +13030,8 @@ static int intel_atomic_check(struct drm_device *dev, } intel_dump_pipe_config(to_intel_crtc(crtc), pipe_config, - needs_modeset(crtc_state) ? - "[modeset]" : "[fastset]"); + pipe_config->update_pipe ? + "[fastset]" : "[modeset]"); } if (any_ms) {