summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2011-06-21 14:14:38 +0800
committerOwain G. Ainsworth <oga@openbsd.org>2011-06-24 05:58:26 +0100
commita316948d2c18d90587c82703053b8857f6ef6997 (patch)
tree95d267bb712fa45261d1f17725154efefd6e0e05
parent3c1a664ea443ff7c589a5d6517e36120c9026c42 (diff)
Xv: upload new shaders to GEM objects for Xv on Ivybridge
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> (cherry picked from commit 90a0800588f83d78254136b94bca656c4c24215d) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
-rw-r--r--src/i965_video.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/src/i965_video.c b/src/i965_video.c
index 678e7806..582f833f 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
@@ -1460,28 +1475,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);