diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-02-11 10:53:50 -0500 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-02-11 10:53:50 -0500 |
commit | 8e437e996cc3f2c424c342701f4aa6bcf72ad08e (patch) | |
tree | 5b222b17a8eda408bc681ed76f7ddcb0a9b011ba /src/r600_textured_videofuncs.c | |
parent | 1b4afc1c9f8458f9ab3434418f4ccf959f532ac1 (diff) |
R6xx/R7xx Xv: Add native support for packed formats
Diffstat (limited to 'src/r600_textured_videofuncs.c')
-rw-r--r-- | src/r600_textured_videofuncs.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/r600_textured_videofuncs.c b/src/r600_textured_videofuncs.c index 82de88ae..993a8d4a 100644 --- a/src/r600_textured_videofuncs.c +++ b/src/r600_textured_videofuncs.c @@ -119,7 +119,7 @@ R600DisplayTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) case FOURCC_YUY2: default: accel_state->ps_mc_addr = info->fbLocation + pScrn->fbOffset + accel_state->shaders->offset + - accel_state->xv_ps_offset_nv12; + accel_state->xv_ps_offset_packed; break; } @@ -268,14 +268,17 @@ R600DisplayTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) tex_res.id = 0; tex_res.w = pPriv->w; tex_res.h = pPriv->h; - tex_res.pitch = accel_state->src_pitch[0]; + tex_res.pitch = accel_state->src_pitch[0] >> 1; tex_res.depth = 0; tex_res.dim = SQ_TEX_DIM_2D; tex_res.base = accel_state->src_mc_addr[0]; tex_res.mip_base = accel_state->src_mc_addr[0]; - tex_res.format = FMT_8; - tex_res.dst_sel_x = SQ_SEL_X; //Y + tex_res.format = FMT_8_8; + if (pPriv->id == FOURCC_UYVY) + tex_res.dst_sel_x = SQ_SEL_Y; //Y + else + tex_res.dst_sel_x = SQ_SEL_X; //Y tex_res.dst_sel_y = SQ_SEL_1; tex_res.dst_sel_z = SQ_SEL_1; tex_res.dst_sel_w = SQ_SEL_1; @@ -302,26 +305,24 @@ R600DisplayTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) set_tex_sampler (pScrn, accel_state->ib, &tex_samp); // UV texture - uv_offset = accel_state->src_pitch[0] * pPriv->h; - uv_offset = (uv_offset + 255) & ~255; - - cp_set_surface_sync(pScrn, accel_state->ib, TC_ACTION_ENA_bit, - accel_state->src_size[0] / 2, - accel_state->src_mc_addr[0] + uv_offset); - tex_res.id = 1; - tex_res.format = FMT_8_8; + tex_res.format = FMT_8_8_8_8; tex_res.w = pPriv->w >> 1; - tex_res.h = pPriv->h >> 1; - tex_res.pitch = accel_state->src_pitch[0] >> 1; - tex_res.dst_sel_x = SQ_SEL_Y; //V - tex_res.dst_sel_y = SQ_SEL_X; //U + tex_res.h = pPriv->h; + tex_res.pitch = accel_state->src_pitch[0] >> 2; + if (pPriv->id == FOURCC_UYVY) { + tex_res.dst_sel_x = SQ_SEL_X; //V + tex_res.dst_sel_y = SQ_SEL_Z; //U + } else { + tex_res.dst_sel_x = SQ_SEL_Y; //V + tex_res.dst_sel_y = SQ_SEL_W; //U + } tex_res.dst_sel_z = SQ_SEL_1; tex_res.dst_sel_w = SQ_SEL_1; tex_res.interlaced = 0; // XXX tex bases need to be 256B aligned - tex_res.base = accel_state->src_mc_addr[0] + uv_offset; - tex_res.mip_base = accel_state->src_mc_addr[0] + uv_offset; + tex_res.base = accel_state->src_mc_addr[0]; + tex_res.mip_base = accel_state->src_mc_addr[0]; set_tex_resource (pScrn, accel_state->ib, &tex_res); // UV sampler |