diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2010-11-09 13:05:07 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2010-12-06 12:50:04 +0800 |
commit | 13e78b6c8ebd20b84e9758e72ae4b6ae401b674a (patch) | |
tree | 126d3743a5740fb01880c4dcdd6c9dccbf47b86b | |
parent | 458aa1b992ffe357d25ae075a2f1f2a538ac5256 (diff) |
i965_drv_video/render: support tiled source surface
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
-rw-r--r-- | i965_drv_video/i965_render.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/i965_drv_video/i965_render.c b/i965_drv_video/i965_render.c index e92f15c..031508c 100644 --- a/i965_drv_video/i965_render.c +++ b/i965_drv_video/i965_render.c @@ -536,6 +536,25 @@ i965_render_cc_unit(VADriverContextP ctx) } static void +i965_render_set_surface_tiling(struct i965_surface_state *ss, unsigned int tiling) +{ + switch (tiling) { + case I915_TILING_NONE: + ss->ss3.tiled_surface = 0; + ss->ss3.tile_walk = 0; + break; + case I915_TILING_X: + ss->ss3.tiled_surface = 1; + ss->ss3.tile_walk = I965_TILEWALK_XMAJOR; + break; + case I915_TILING_Y: + ss->ss3.tiled_surface = 1; + ss->ss3.tile_walk = I965_TILEWALK_YMAJOR; + break; + } +} + +static void i965_render_src_surface_state(VADriverContextP ctx, int index, dri_bo *region, @@ -547,8 +566,11 @@ i965_render_src_surface_state(VADriverContextP ctx, struct i965_render_state *render_state = &i965->render_state; struct i965_surface_state *ss; dri_bo *ss_bo = render_state->wm.surface_state_binding_table_bo; + unsigned int tiling; + unsigned int swizzle; assert(index < MAX_RENDER_SURFACES); + dri_bo_map(ss_bo, 1); assert(ss_bo->virtual); ss = (struct i965_surface_state *)((char *)ss_bo->virtual + SURFACE_STATE_OFFSET(index)); @@ -574,6 +596,9 @@ i965_render_src_surface_state(VADriverContextP ctx, ss->ss3.pitch = pitch - 1; + dri_bo_get_tiling(region, &tiling, &swizzle); + i965_render_set_surface_tiling(ss, tiling); + dri_bo_emit_reloc(ss_bo, I915_GEM_DOMAIN_SAMPLER, 0, offset, @@ -699,25 +724,6 @@ i965_subpic_render_src_surfaces_state(VADriverContextP ctx, } static void -i965_render_set_surface_tiling(struct i965_surface_state *ss, unsigned int tiling) -{ - switch (tiling) { - case I915_TILING_NONE: - ss->ss3.tiled_surface = 0; - ss->ss3.tile_walk = 0; - break; - case I915_TILING_X: - ss->ss3.tiled_surface = 1; - ss->ss3.tile_walk = I965_TILEWALK_XMAJOR; - break; - case I915_TILING_Y: - ss->ss3.tiled_surface = 1; - ss->ss3.tile_walk = I965_TILEWALK_YMAJOR; - break; - } -} - -static void i965_render_dest_surface_state(VADriverContextP ctx, int index) { struct i965_driver_data *i965 = i965_driver_data(ctx); |