diff options
author | Roland Scheidegger <rscheidegger_lists@hispeed.ch> | 2012-05-11 05:25:32 +0200 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2012-05-11 01:14:48 -0400 |
commit | 4b9bad959438725e4434e2aa4f142542d8dcc260 (patch) | |
tree | 18f0c465eaadeb7ee0cf0d7105299689cefe8d7a /src/evergreen_textured_videofuncs.c | |
parent | 37786e9027b8c8d1f9ec9928915784dd28853766 (diff) |
radeon: use GB_GR and BG_RG formats for packed yuv video for r600+
Those formats were invented for exactly that purpose so use them.
This saves some code and also some hw resources (only need one
sampler instead of two for packed yuv).
Only tested on EG.
Diffstat (limited to 'src/evergreen_textured_videofuncs.c')
-rw-r--r-- | src/evergreen_textured_videofuncs.c | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/src/evergreen_textured_videofuncs.c b/src/evergreen_textured_videofuncs.c index fe86e898..0643ac62 100644 --- a/src/evergreen_textured_videofuncs.c +++ b/src/evergreen_textured_videofuncs.c @@ -331,7 +331,7 @@ EVERGREENDisplayTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) default: accel_state->src_size[0] = accel_state->src_obj[0].pitch * pPriv->h; - /* Y texture */ + /* YUV texture */ tex_res.id = 0; tex_res.w = accel_state->src_obj[0].width; tex_res.h = accel_state->src_obj[0].height; @@ -345,13 +345,13 @@ EVERGREENDisplayTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) tex_res.mip_bo = accel_state->src_obj[0].bo; tex_res.surface = NULL; - tex_res.format = FMT_8_8; if (pPriv->id == FOURCC_UYVY) - tex_res.dst_sel_x = SQ_SEL_Y; /* Y */ + tex_res.format = FMT_GB_GR; 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.format = FMT_BG_RG; + tex_res.dst_sel_x = SQ_SEL_Y; + tex_res.dst_sel_y = SQ_SEL_X; + tex_res.dst_sel_z = SQ_SEL_Z; tex_res.dst_sel_w = SQ_SEL_1; tex_res.base_level = 0; @@ -362,7 +362,7 @@ EVERGREENDisplayTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) tex_res.array_mode = 1; evergreen_set_tex_resource(pScrn, &tex_res, accel_state->src_obj[0].domain); - /* Y sampler */ + /* YUV sampler */ tex_samp.id = 0; tex_samp.clamp_x = SQ_TEX_CLAMP_LAST_TEXEL; tex_samp.clamp_y = SQ_TEX_CLAMP_LAST_TEXEL; @@ -375,33 +375,6 @@ EVERGREENDisplayTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) tex_samp.mip_filter = 0; /* no mipmap */ evergreen_set_tex_sampler(pScrn, &tex_samp); - /* UV texture */ - tex_res.id = 1; - tex_res.format = FMT_8_8_8_8; - tex_res.w = accel_state->src_obj[0].width >> 1; - tex_res.h = accel_state->src_obj[0].height; - tex_res.pitch = accel_state->src_obj[0].pitch >> 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; - - tex_res.base = accel_state->src_obj[0].offset; - tex_res.mip_base = accel_state->src_obj[0].offset; - tex_res.size = accel_state->src_size[0]; - if (accel_state->src_obj[0].tiling_flags == 0) - tex_res.array_mode = 1; - evergreen_set_tex_resource(pScrn, &tex_res, accel_state->src_obj[0].domain); - - /* UV sampler */ - tex_samp.id = 1; - evergreen_set_tex_sampler(pScrn, &tex_samp); break; } |