From patchwork Wed Jun 22 16:47:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 904102 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5M8qlYt014472 for ; Wed, 22 Jun 2011 08:53:08 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4FE129E79E for ; Wed, 22 Jun 2011 01:52:47 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 66F669F781 for ; Wed, 22 Jun 2011 01:48:14 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 22 Jun 2011 01:48:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,405,1304319600"; d="scan'208";a="18180525" Received: from xhh-snb32.sh.intel.com (HELO localhost.localdomain) ([10.239.36.49]) by orsmga001.jf.intel.com with ESMTP; 22 Jun 2011 01:48:13 -0700 From: "Xiang, Haihao" To: intel-gfx@lists.freedesktop.org Date: Thu, 23 Jun 2011 00:47:46 +0800 Message-Id: <1308761267-13598-5-git-send-email-haihao.xiang@intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1308761267-13598-1-git-send-email-haihao.xiang@intel.com> References: <1308761267-13598-1-git-send-email-haihao.xiang@intel.com> Subject: [Intel-gfx] [PATCH 4/5] Xv: upload new shaders to GEM objects for Xv on Ivybridge X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 22 Jun 2011 08:53:26 +0000 (UTC) Signed-off-by: Xiang, Haihao --- src/i965_video.c | 36 ++++++++++++++++++++++++++++++------ 1 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/i965_video.c b/src/i965_video.c index 9fbba40..84230a1 100644 --- a/src/i965_video.c +++ b/src/i965_video.c @@ -149,6 +149,21 @@ static const uint32_t ps_kernel_planar_static_gen6[][4] = { #include "exa_wm_write.g6b" }; +/* programs for Ivybridge */ +static const uint32_t ps_kernel_packed_static_gen7[][4] = { +#include "exa_wm_src_affine.g7b" +#include "exa_wm_src_sample_argb.g7b" +#include "exa_wm_yuv_rgb.g7b" +#include "exa_wm_write.g7b" +}; + +static const uint32_t ps_kernel_planar_static_gen7[][4] = { +#include "exa_wm_src_affine.g7b" +#include "exa_wm_src_sample_planar.g7b" +#include "exa_wm_yuv_rgb.g7b" +#include "exa_wm_write.g7b" +}; + #ifndef MAX2 #define MAX2(a,b) ((a) > (b) ? (a) : (b)) #endif @@ -1459,28 +1474,37 @@ gen6_create_vidoe_objects(ScrnInfoPtr scrn) { intel_screen_private *intel = intel_get_screen_private(scrn); drm_intel_bo *(*create_sampler_state)(ScrnInfoPtr); - + const uint32_t *packed_ps_kernel, *planar_ps_kernel; + unsigned int packed_ps_size, planar_ps_size; + if (INTEL_INFO(intel)->gen >= 70) { create_sampler_state = gen7_create_sampler_state; + packed_ps_kernel = &ps_kernel_packed_static_gen7[0][0]; + packed_ps_size = sizeof(ps_kernel_packed_static_gen7); + planar_ps_kernel = &ps_kernel_planar_static_gen7[0][0]; + planar_ps_size = sizeof(ps_kernel_planar_static_gen7); } else { create_sampler_state = i965_create_sampler_state; + packed_ps_kernel = &ps_kernel_packed_static_gen6[0][0]; + packed_ps_size = sizeof(ps_kernel_packed_static_gen6); + planar_ps_kernel = &ps_kernel_planar_static_gen6[0][0]; + planar_ps_size = sizeof(ps_kernel_planar_static_gen6); } - if (intel->video.gen4_sampler_bo == NULL) intel->video.gen4_sampler_bo = create_sampler_state(scrn); if (intel->video.wm_prog_packed_bo == NULL) intel->video.wm_prog_packed_bo = i965_create_program(scrn, - &ps_kernel_packed_static_gen6[0][0], - sizeof(ps_kernel_packed_static_gen6)); + packed_ps_kernel, + packed_ps_size); if (intel->video.wm_prog_planar_bo == NULL) intel->video.wm_prog_planar_bo = i965_create_program(scrn, - &ps_kernel_planar_static_gen6[0][0], - sizeof(ps_kernel_planar_static_gen6)); + planar_ps_kernel, + planar_ps_size); if (intel->video.gen4_cc_vp_bo == NULL) intel->video.gen4_cc_vp_bo = i965_create_cc_vp_state(scrn);