From patchwork Fri Feb 28 23:44:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 3745261 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AB03E9F35F for ; Fri, 28 Feb 2014 23:45:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CFBD920237 for ; Fri, 28 Feb 2014 23:45:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 031F3201BA for ; Fri, 28 Feb 2014 23:45:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 42C35FBDD4; Fri, 28 Feb 2014 15:45:01 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f51.google.com (mail-yh0-f51.google.com [209.85.213.51]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DD34FBDD6 for ; Fri, 28 Feb 2014 15:44:55 -0800 (PST) Received: by mail-yh0-f51.google.com with SMTP id f10so1088288yha.10 for ; Fri, 28 Feb 2014 15:44:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=ZGHh+xci+T07sWVsa3v0TRqeu+Pq5oLnzae2jgbwN94=; b=zlGbRoAAH0uWJjQSzigKSHq1mK0d7W0p4K7iwrYxfF8Fb74Gsih05WbmliVwQvARwo s4B5yVUjT3KYPrTOaxZO1tnkosUxmm8K868oQjRtVKoKpUZ9e8jVKweFnOCn/kLOXhO9 1FwTIKpp5qQw1k1Z0r+qsi6aLbgrTSYRRdJ5ekNwI3QupU1oUYs7NkXTr75O8s3bqkkK d0VGhzsT9Lw5b0hxwuWrWMQvJpPMj1HKvu9F3h2wV9f226bXnuAEheztLnI3gXtNFWR1 65q8ClElUAaaAV2qegKDQ1GKMj9OgDCtbFxsYnhHYKHCzakoL1FK2FKFqiw+UHr0xdg5 RSwg== X-Received: by 10.236.93.43 with SMTP id k31mr5049974yhf.88.1393631095258; Fri, 28 Feb 2014 15:44:55 -0800 (PST) Received: from localhost.localdomain ([189.67.129.152]) by mx.google.com with ESMTPSA id h23sm10769779yhc.0.2014.02.28.15.44.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2014 15:44:54 -0800 (PST) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Fri, 28 Feb 2014 20:44:36 -0300 Message-Id: <1393631086-3880-2-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1393631086-3880-1-git-send-email-rodrigo.vivi@gmail.com> References: <1393631086-3880-1-git-send-email-rodrigo.vivi@gmail.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 01/11] drm/i915: Set primary plane enable at dpcntrl. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This patch allows system to safely recover after kms_psr_sink_crc check or any other similar case that might fail when PSR is enabled. Ville made and sent me this patch after noticing that primary plane enabled bit was set during test case and unset after failure. What was causing a hard and non-recoverable blank screen. After the failure when alternating from fbcon to x section it was possible to see and move mouse cursor, but nothing else. Everything else was fully black. A for dpms off/on also haleped to get screen back. But this patch seeting primary plane enabled bit propertly seemed more clean. v2: Fix identation issue. v3: Add the XXX comment. Cc: Ville Syrjälä Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2e05d1e..e23ff4c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2118,6 +2118,9 @@ static int i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb, if (IS_G4X(dev)) dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE; + if (intel_crtc->primary_enabled) + dspcntr |= DISPLAY_PLANE_ENABLE; + I915_WRITE(reg, dspcntr); linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8); @@ -2215,6 +2218,9 @@ static int ironlake_update_plane(struct drm_crtc *crtc, else dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE; + if (intel_crtc->primary_enabled) + dspcntr |= DISPLAY_PLANE_ENABLE; + I915_WRITE(reg, dspcntr); linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8); @@ -8633,6 +8639,13 @@ static int intel_gen7_queue_flip(struct drm_device *dev, intel_ring_emit(ring, i915_gem_obj_ggtt_offset(obj) + intel_crtc->dspaddr_offset); intel_ring_emit(ring, (MI_NOOP)); + /* XXX: Ugly hack to avoid PSR test case eventually breaking things up + * to be removed whenever it is fixed. */ + if (IS_VALLEYVIEW(dev) && intel_crtc->primary_enabled) + I915_WRITE(DSPCNTR(intel_crtc->plane), + I915_READ(DSPCNTR(intel_crtc->plane)) + | DISPLAY_PLANE_ENABLE); + intel_mark_page_flip_active(intel_crtc); __intel_ring_advance(ring); return 0;