From patchwork Fri May 17 19:31:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 10948481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C0CF912 for ; Fri, 17 May 2019 19:32:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D72A28389 for ; Fri, 17 May 2019 19:32:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 325772845E; Fri, 17 May 2019 19:32:03 +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 DE1802843C for ; Fri, 17 May 2019 19:32:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 64351899AB; Fri, 17 May 2019 19:32:02 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id A29D1899B0 for ; Fri, 17 May 2019 19:32:01 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 May 2019 12:32:01 -0700 X-ExtLoop1: 1 Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga008.jf.intel.com with SMTP; 17 May 2019 12:31:59 -0700 Received: by stinkbox (sSMTP sendmail emulation); Fri, 17 May 2019 22:31:58 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Fri, 17 May 2019 22:31:28 +0300 Message-Id: <20190517193132.8140-10-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190517193132.8140-1-ville.syrjala@linux.intel.com> References: <20190517193132.8140-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 10/14] drm/i915: Move state dump to the end of atomic_check() 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä Currently we're dumping the crtc states before they have been fully calculated. Move the dumping to the end of .atomic_check() so we get a fully up to date dump. Let's also do the dump for fully disabled pipes, but we'll limit that to just saying that the pipe is disabled since the rest of the state is going to be nonsense in that case. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e71a90a47d3a..5ffb4f5c4fa7 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -11488,8 +11488,9 @@ static void intel_dump_pipe_config(struct intel_crtc_state *pipe_config, struct drm_framebuffer *fb; char buf[64]; - DRM_DEBUG_KMS("[CRTC:%d:%s]%s\n", - crtc->base.base.id, crtc->base.name, context); + DRM_DEBUG_KMS("[CRTC:%d:%s] enable: %s %s\n", + crtc->base.base.id, crtc->base.name, + yesno(pipe_config->base.enable), context); snprintf_output_types(buf, sizeof(buf), pipe_config->output_types); DRM_DEBUG_KMS("output_types: %s (0x%x)\n", @@ -13081,10 +13082,6 @@ static int intel_atomic_check(struct drm_device *dev, if (needs_modeset(&new_crtc_state->base)) any_ms = true; - - intel_dump_pipe_config(new_crtc_state, - needs_modeset(&new_crtc_state->base) ? - "[modeset]" : "[fastset]"); } ret = drm_dp_mst_atomic_check(&state->base); @@ -13108,7 +13105,23 @@ static int intel_atomic_check(struct drm_device *dev, return ret; intel_fbc_choose_crtc(dev_priv, state); - return calc_watermark_data(state); + + ret = calc_watermark_data(state); + if (ret) + return ret; + + for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, + new_crtc_state, i) { + if (!needs_modeset(&new_crtc_state->base) && + !new_crtc_state->update_pipe) + continue; + + intel_dump_pipe_config(new_crtc_state, + needs_modeset(&new_crtc_state->base) ? + "[modeset]" : "[fastset]"); + } + + return 0; } static int intel_atomic_prepare_commit(struct drm_device *dev,