From patchwork Mon Jan 12 15:36:52 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: 5610961 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 A01D39F3A0 for ; Mon, 12 Jan 2015 15:37:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C8B3E2064D for ; Mon, 12 Jan 2015 15:37:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E523620648 for ; Mon, 12 Jan 2015 15:37:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A1536E508; Mon, 12 Jan 2015 07:37:16 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 23BA96E50B for ; Mon, 12 Jan 2015 07:37:15 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 12 Jan 2015 07:37:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,744,1413270000"; d="scan'208";a="668491067" Received: from linux.jf.intel.com (HELO linux.intel.com) ([10.23.219.25]) by orsmga002.jf.intel.com with ESMTP; 12 Jan 2015 07:37:14 -0800 Received: from localhost (ander-mobl1.fi.intel.com [10.237.72.65]) by linux.intel.com (Postfix) with ESMTP id 1862A2C8002; Mon, 12 Jan 2015 07:37:07 -0800 (PST) From: Ander Conselvan de Oliveira To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Jan 2015 17:36:52 +0200 Message-Id: <1421077012-25369-1-git-send-email-ander.conselvan.de.oliveira@intel.com> X-Mailer: git-send-email 1.9.1 Cc: Ander Conselvan de Oliveira , stable@vger.kernel.org Subject: [Intel-gfx] [PATCH] 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. Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87662 Signed-off-by: Ander Conselvan de Oliveira Reviewed-by: Daniel Vetter 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 d1a4de8..fdea96c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -13322,6 +13322,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 intel_plane *primary = to_intel_plane(crtc->base.primary); + + if (!crtc->primary_enabled) + return; + + primary->crtc_x = 0; + primary->crtc_y = 0; + primary->crtc_w = crtc->config.pipe_src_w; + primary->crtc_h = crtc->config.pipe_src_h; + primary->src_x = 0; + primary->src_y = 0; + primary->src_w = crtc->config.pipe_src_w << 16; + primary->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; @@ -13332,6 +13349,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; @@ -13341,6 +13359,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,