From patchwork Fri Oct 24 23:11:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 5150441 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 09C46C11AC for ; Fri, 24 Oct 2014 23:11:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 428D220268 for ; Fri, 24 Oct 2014 23:11:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7699120256 for ; Fri, 24 Oct 2014 23:11:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0339D6EA01; Fri, 24 Oct 2014 16:11:22 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTP id 2789A6EA4B for ; Fri, 24 Oct 2014 16:11:20 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 24 Oct 2014 16:09:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,783,1406617200"; d="scan'208";a="624963481" Received: from mlynch-mobl.ger.corp.intel.com (HELO strange.ger.corp.intel.com) ([10.252.3.185]) by orsmga002.jf.intel.com with ESMTP; 24 Oct 2014 16:11:18 -0700 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Sat, 25 Oct 2014 00:11:14 +0100 Message-Id: <1414192274-15933-4-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1414192274-15933-1-git-send-email-damien.lespiau@intel.com> References: <1414192274-15933-1-git-send-email-damien.lespiau@intel.com> Subject: [Intel-gfx] [PATCH 4/4] drm/i915/skl: Implement do_mmio_flip for SKL X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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=-5.6 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 Nothing special to note. We mirror what is done for other platforms, but using the SKL plane registers. Signed-off-by: Damien Lespiau Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) --- drivers/gpu/drm/i915/intel_display.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index dd071c6..c09d009 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9552,6 +9552,28 @@ static bool use_mmio_flip(struct intel_engine_cs *ring, return ring != obj->ring; } +static void skl_do_mmio_flip(struct intel_crtc *intel_crtc) +{ + struct drm_device *dev = intel_crtc->base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; + struct intel_framebuffer *intel_fb = + to_intel_framebuffer(intel_crtc->base.primary->fb); + struct drm_i915_gem_object *obj = intel_fb->obj; + const int pipe = intel_crtc->pipe; + u32 val; + + val = I915_READ(PLANE_CTL(pipe, 0)); + + val &= ~PLANE_CTL_TILED_MASK; + if (obj->tiling_mode == I915_TILING_X) + val |= PLANE_CTL_TILED_X; + + I915_WRITE(PLANE_CTL(pipe, 0), val); + + I915_WRITE(PLANE_SURF(pipe, 0), intel_crtc->unpin_work->gtt_offset); + POSTING_READ(PLANE_SURF(pipe, 0)); +} + static void ilk_do_mmio_flip(struct intel_crtc *intel_crtc) { struct drm_device *dev = intel_crtc->base.dev; @@ -12701,7 +12723,9 @@ static void intel_init_display(struct drm_device *dev) break; } - if (INTEL_INFO(dev)->gen >= 5) + if (INTEL_INFO(dev)->gen >= 9) + dev_priv->display.do_mmio_flip = skl_do_mmio_flip; + else if (INTEL_INFO(dev)->gen >= 5) dev_priv->display.do_mmio_flip = ilk_do_mmio_flip; intel_panel_init_backlight_funcs(dev);