From patchwork Thu Oct 25 18:05:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 1646471 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 912CA3FE1C for ; Thu, 25 Oct 2012 18:22:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E961A0A4F for ; Thu, 25 Oct 2012 11:22:41 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E8FDA0A2C for ; Thu, 25 Oct 2012 11:07:06 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 25 Oct 2012 11:07:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,648,1344236400"; d="scan'208";a="210833354" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by orsmga001.jf.intel.com with SMTP; 25 Oct 2012 11:07:04 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 25 Oct 2012 21:07:03 +0300 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 21/51] drm/i915: Implement execbuffer wait for all planes Date: Thu, 25 Oct 2012 21:05:24 +0300 Message-Id: <1351188354-24233-22-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1351188354-24233-1-git-send-email-ville.syrjala@linux.intel.com> References: <1351188354-24233-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Ville Syrjälä Add the MI_WAIT_FOR_EVENT bits for sprites, and fix up the whole thing for IVB which moved most of the bits around. Not tested at all! Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 44 +++++++++++++++++++++++++-- drivers/gpu/drm/i915/i915_reg.h | 9 ++++++ 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 3eea143..cb4d9f7 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -625,10 +625,46 @@ i915_gem_execbuffer_wait_for_flips(struct intel_ring_buffer *ring, u32 flips) if (((flips >> plane) & 1) == 0) continue; - if (plane) - flip_mask = MI_WAIT_FOR_PLANE_B_FLIP; - else - flip_mask = MI_WAIT_FOR_PLANE_A_FLIP; + if (IS_GEN7(ring->dev)) { + switch (plane) { + case 0: + flip_mask = MI_WAIT_FOR_PLANE_A_FLIP_IVB; + break; + case 1: + flip_mask = MI_WAIT_FOR_PLANE_B_FLIP_IVB; + break; + case 2: + flip_mask = MI_WAIT_FOR_PLANE_C_FLIP_IVB; + break; + case 16: + flip_mask = MI_WAIT_FOR_SPRITE_A_FLIP_IVB; + break; + case 17: + flip_mask = MI_WAIT_FOR_SPRITE_B_FLIP_IVB; + break; + case 18: + flip_mask = MI_WAIT_FOR_SPRITE_C_FLIP_IVB; + break; + } + } else { + switch (plane) { + case 0: + flip_mask = MI_WAIT_FOR_PLANE_A_FLIP; + break; + case 1: + flip_mask = MI_WAIT_FOR_PLANE_B_FLIP; + break; + case 2: + flip_mask = MI_WAIT_FOR_PLANE_C_FLIP; + break; + case 16: + flip_mask = MI_WAIT_FOR_SPRITE_A_FLIP; + break; + case 17: + flip_mask = MI_WAIT_FOR_SPRITE_B_FLIP; + break; + } + } ret = intel_ring_begin(ring, 2); if (ret) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 5ea4570..6d09411 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -188,7 +188,16 @@ #define MI_NOOP MI_INSTR(0, 0) #define MI_USER_INTERRUPT MI_INSTR(0x02, 0) #define MI_WAIT_FOR_EVENT MI_INSTR(0x03, 0) +#define MI_WAIT_FOR_SPRITE_C_FLIP_IVB (1<<20) +#define MI_WAIT_FOR_PLANE_C_FLIP_IVB (1<<15) +#define MI_WAIT_FOR_SPRITE_B_FLIP_IVB (1<<10) +#define MI_WAIT_FOR_PLANE_B_FLIP_IVB (1<<9) +#define MI_WAIT_FOR_SPRITE_A_FLIP_IVB (1<<2) +#define MI_WAIT_FOR_PLANE_A_FLIP_IVB (1<<1) #define MI_WAIT_FOR_OVERLAY_FLIP (1<<16) +#define MI_WAIT_FOR_SPRITE_B_FLIP (1<<16) +#define MI_WAIT_FOR_SPRITE_A_FLIP (1<<8) +#define MI_WAIT_FOR_PLANE_C_FLIP (1<<8) #define MI_WAIT_FOR_PLANE_B_FLIP (1<<6) #define MI_WAIT_FOR_PLANE_A_FLIP (1<<2) #define MI_WAIT_FOR_PLANE_A_SCANLINES (1<<1)