From patchwork Fri Oct 24 23:11:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 5150431 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 BCF5F9F43D for ; Fri, 24 Oct 2014 23:11:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E5CC02026F for ; Fri, 24 Oct 2014 23:11:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0ED9220268 for ; Fri, 24 Oct 2014 23:11:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 535F46EA40; Fri, 24 Oct 2014 16:11:20 -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 8DAFB6EA01 for ; Fri, 24 Oct 2014 16:11:17 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 24 Oct 2014 16:09:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,783,1406617200"; d="scan'208";a="624963448" 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:16 -0700 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Sat, 25 Oct 2014 00:11:12 +0100 Message-Id: <1414192274-15933-2-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 2/4] drm/i915: Introduce a vfunc for platform-specfic MMIO flip code 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 SKL will specialize it. Signed-off-by: Damien Lespiau --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_display.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 627b7e7..d979549 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -492,6 +492,7 @@ struct drm_i915_display_funcs { struct drm_i915_gem_object *obj, struct intel_engine_cs *ring, uint32_t flags); + void (*do_mmio_flip)(struct intel_crtc *crtc); void (*update_primary_plane)(struct drm_crtc *crtc, struct drm_framebuffer *fb, int x, int y); diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 5133ef9..07440ad 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9552,7 +9552,7 @@ static bool use_mmio_flip(struct intel_engine_cs *ring, return ring != obj->ring; } -static void intel_do_mmio_flip(struct intel_crtc *intel_crtc) +static void ilk_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; @@ -9561,9 +9561,6 @@ static void intel_do_mmio_flip(struct intel_crtc *intel_crtc) struct drm_i915_gem_object *obj = intel_fb->obj; u32 dspcntr; u32 reg; - - intel_mark_page_flip_active(intel_crtc); - reg = DSPCNTR(intel_crtc->plane); dspcntr = I915_READ(reg); @@ -9579,6 +9576,15 @@ static void intel_do_mmio_flip(struct intel_crtc *intel_crtc) POSTING_READ(DSPSURF(intel_crtc->plane)); } +static void intel_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; + + intel_mark_page_flip_active(intel_crtc); + dev_priv->display.do_mmio_flip(intel_crtc); +} + static int intel_postpone_flip(struct drm_i915_gem_object *obj) { struct intel_engine_cs *ring; @@ -12694,6 +12700,9 @@ static void intel_init_display(struct drm_device *dev) break; } + if (INTEL_INFO(dev)->gen >= 5) + dev_priv->display.do_mmio_flip = ilk_do_mmio_flip; + intel_panel_init_backlight_funcs(dev); mutex_init(&dev_priv->pps_mutex);