From patchwork Mon Jan 19 13:51:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ander Conselvan de Oliveira X-Patchwork-Id: 5658991 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C17A9C058D for ; Mon, 19 Jan 2015 13:52:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F163D20383 for ; Mon, 19 Jan 2015 13:52:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E77F32034F for ; Mon, 19 Jan 2015 13:52:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10E396E0C7; Mon, 19 Jan 2015 05:52:08 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 141336E0C7 for ; Mon, 19 Jan 2015 05:52:06 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 19 Jan 2015 05:52:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,427,1418112000"; d="scan'208";a="639326843" Received: from linux.jf.intel.com (HELO linux.intel.com) ([10.23.219.25]) by orsmga001.jf.intel.com with ESMTP; 19 Jan 2015 05:52:05 -0800 Received: from localhost (ander-mobl1.fi.intel.com [10.237.72.65]) by linux.intel.com (Postfix) with ESMTP id 81A806A408D; Mon, 19 Jan 2015 05:51:59 -0800 (PST) From: Ander Conselvan de Oliveira To: Daniel Vetter Date: Mon, 19 Jan 2015 15:51:47 +0200 Message-Id: <1421675507-27529-1-git-send-email-ander.conselvan.de.oliveira@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421077012-25369-1-git-send-email-ander.conselvan.de.oliveira@intel.com> References: <1421077012-25369-1-git-send-email-ander.conselvan.de.oliveira@intel.com> Cc: Ander Conselvan de Oliveira , intel-gfx@lists.freedesktop.org, stable@vger.kernel.org Subject: [Intel-gfx] [PATCH v2] drm/i915: Initialize primary plane src/dst coords when reading hw state 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 Otherwise setting the rotation property will cause the primary plane to be disabled, caused by having a 0x0 initial value. v2: Rebase on top of the move to plane helpers. Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87662 Signed-off-by: Ander Conselvan de Oliveira Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) --- drivers/gpu/drm/i915/intel_display.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 91d8ada..ed70ca7 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -13327,6 +13327,23 @@ static bool primary_get_hw_state(struct intel_crtc *crtc) return I915_READ(DSPCNTR(crtc->plane)) & DISPLAY_PLANE_ENABLE; } +static void primary_update_size(struct intel_crtc *crtc) +{ + struct drm_plane_state *state = crtc->base.primary->state; + + if (!crtc->primary_enabled) + return; + + state->crtc_x = 0; + state->crtc_y = 0; + state->crtc_w = crtc->config.pipe_src_w; + state->crtc_h = crtc->config.pipe_src_h; + state->src_x = 0; + state->src_y = 0; + state->src_w = crtc->config.pipe_src_w << 16; + state->src_h = crtc->config.pipe_src_h << 16; +} + static void intel_modeset_readout_hw_state(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; @@ -13337,6 +13354,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) int i; for_each_intel_crtc(dev, crtc) { + memset(&crtc->config, 0, sizeof(crtc->config)); crtc->config.quirks |= PIPE_CONFIG_QUIRK_INHERITED_MODE; @@ -13346,6 +13364,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) crtc->base.enabled = crtc->active; crtc->primary_enabled = primary_get_hw_state(crtc); + primary_update_size(crtc); DRM_DEBUG_KMS("[CRTC:%d] hw state readout: %s\n", crtc->base.base.id,