From patchwork Wed Sep 23 15:52:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zanoni, Paulo R" X-Patchwork-Id: 7250871 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 97A529FBFA for ; Wed, 23 Sep 2015 15:52:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C46CC20A65 for ; Wed, 23 Sep 2015 15:52:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6C50E20A7D for ; Wed, 23 Sep 2015 15:52:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 556C76EDCA; Wed, 23 Sep 2015 08:52:48 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 07A796EDC8 for ; Wed, 23 Sep 2015 08:52:46 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 23 Sep 2015 08:52:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,577,1437462000"; d="scan'208";a="567021021" Received: from ljroach-mobl1.amr.corp.intel.com (HELO panetone.amr.corp.intel.com) ([10.254.81.188]) by FMSMGA003.fm.intel.com with ESMTP; 23 Sep 2015 08:52:44 -0700 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Wed, 23 Sep 2015 12:52:26 -0300 Message-Id: <1443023547-19896-7-git-send-email-paulo.r.zanoni@intel.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1443023547-19896-1-git-send-email-paulo.r.zanoni@intel.com> References: <1443023547-19896-1-git-send-email-paulo.r.zanoni@intel.com> Subject: [Intel-gfx] [PATCH 6/7] drm/i915: use compute_page_offset() on SKL too 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, 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 The trick is not strictly necessary on SKL because the offset registers allow more bits. But for FBC, doing this changes how the hardware tracking works - it starts at the surface address we provide - so there's a higher chance that the CRTC will be pointing to an area of the frontbuffer that is actually being covered by the hardware tracking mechanism. This fixes fbc-farfromfence on SKL. Testcase: igt/kms_frontbuffer_tracking/fbc-farfromfence Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_display.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 24b8a72..d40ae71 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3031,6 +3031,7 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc, int src_x = 0, src_y = 0, src_w = 0, src_h = 0; int dst_x = 0, dst_y = 0, dst_w = 0, dst_h = 0; int scaler_id = -1; + int pixel_size; plane_state = to_intel_plane_state(plane->state); @@ -3079,6 +3080,12 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc, src_h = intel_crtc->config->pipe_src_h; } + pixel_size = drm_format_plane_cpp(fb->pixel_format, 0); + intel_crtc->dspaddr_offset = intel_gen4_compute_page_offset(dev_priv, + &x, &y, obj->tiling_mode, + pixel_size, fb->pitches[0]); + surf_addr += intel_crtc->dspaddr_offset; + if (intel_rotation_90_or_270(rotation)) { /* stride = Surface height in tiles */ tile_height = intel_tile_height(dev, fb->pixel_format,