diff options
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_video.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_vp3_video.c | 30 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_vp3_video.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv84_video.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv98_video.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv98_video_bsp.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv98_video_ppp.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv98_video_vp.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_video.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_video_bsp.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_video_ppp.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_video_vp.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_uvd.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_uvd.c | 38 |
16 files changed, 89 insertions, 89 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_video.c b/src/gallium/drivers/nouveau/nouveau_video.c index d6ca13f9d90..9cf5e349bd7 100644 --- a/src/gallium/drivers/nouveau/nouveau_video.c +++ b/src/gallium/drivers/nouveau/nouveau_video.c @@ -515,7 +515,7 @@ nouveau_create_decoder(struct pipe_context *context, if (getenv("XVMC_VL")) goto vl; - if (u_reduce_video_profile(templ->profile) != PIPE_VIDEO_CODEC_MPEG12) + if (u_reduce_video_profile(templ->profile) != PIPE_VIDEO_FORMAT_MPEG12) goto vl; if (screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0) goto vl; diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.c b/src/gallium/drivers/nouveau/nouveau_vp3_video.c index 36fea5879d0..611b455a46a 100644 --- a/src/gallium/drivers/nouveau/nouveau_vp3_video.c +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.c @@ -234,15 +234,15 @@ nouveau_vp3_decoder_init_common(struct pipe_video_decoder *dec) static void vp3_getpath(enum pipe_video_profile profile, char *path) { switch (u_reduce_video_profile(profile)) { - case PIPE_VIDEO_CODEC_MPEG12: { + case PIPE_VIDEO_FORMAT_MPEG12: { sprintf(path, "/lib/firmware/nouveau/vuc-vp3-mpeg12-0"); break; } - case PIPE_VIDEO_CODEC_VC1: { + case PIPE_VIDEO_FORMAT_VC1: { sprintf(path, "/lib/firmware/nouveau/vuc-vp3-vc1-0"); break; } - case PIPE_VIDEO_CODEC_MPEG4_AVC: { + case PIPE_VIDEO_FORMAT_MPEG4_AVC: { sprintf(path, "/lib/firmware/nouveau/vuc-vp3-h264-0"); break; } @@ -253,19 +253,19 @@ static void vp3_getpath(enum pipe_video_profile profile, char *path) static void vp4_getpath(enum pipe_video_profile profile, char *path) { switch (u_reduce_video_profile(profile)) { - case PIPE_VIDEO_CODEC_MPEG12: { + case PIPE_VIDEO_FORMAT_MPEG12: { sprintf(path, "/lib/firmware/nouveau/vuc-mpeg12-0"); break; } - case PIPE_VIDEO_CODEC_MPEG4: { + case PIPE_VIDEO_FORMAT_MPEG4: { sprintf(path, "/lib/firmware/nouveau/vuc-mpeg4-0"); break; } - case PIPE_VIDEO_CODEC_VC1: { + case PIPE_VIDEO_FORMAT_VC1: { sprintf(path, "/lib/firmware/nouveau/vuc-vc1-0"); break; } - case PIPE_VIDEO_CODEC_MPEG4_AVC: { + case PIPE_VIDEO_FORMAT_MPEG4_AVC: { sprintf(path, "/lib/firmware/nouveau/vuc-h264-0"); break; } @@ -322,22 +322,22 @@ nouveau_vp3_load_firmware(struct nouveau_vp3_decoder *dec, r = (intptr_t)end - (intptr_t)dec->fw_bo->map + 4; switch (u_reduce_video_profile(profile)) { - case PIPE_VIDEO_CODEC_MPEG12: { + case PIPE_VIDEO_FORMAT_MPEG12: { assert((r & 0xff) == 0xe0); dec->fw_sizes = (0x2e0<<16) | (r - 0x2e0); break; } - case PIPE_VIDEO_CODEC_MPEG4: { + case PIPE_VIDEO_FORMAT_MPEG4: { assert((r & 0xff) == 0xe0); dec->fw_sizes = (0x2e0<<16) | (r - 0x2e0); break; } - case PIPE_VIDEO_CODEC_VC1: { + case PIPE_VIDEO_FORMAT_VC1: { assert((r & 0xff) == 0xac); dec->fw_sizes = (0x3ac<<16) | (r - 0x3ac); break; } - case PIPE_VIDEO_CODEC_MPEG4_AVC: { + case PIPE_VIDEO_FORMAT_MPEG4_AVC: { assert((r & 0xff) == 0x70); dec->fw_sizes = (0x370<<16) | (r - 0x370); break; @@ -358,17 +358,17 @@ nouveau_vp3_screen_get_video_param(struct pipe_screen *pscreen, int chipset = nouveau_screen(pscreen)->device->chipset; int vp3 = chipset < 0xa3 || chipset == 0xaa || chipset == 0xac; int vp5 = chipset >= 0xd0; - enum pipe_video_codec codec = u_reduce_video_profile(profile); + enum pipe_video_format codec = u_reduce_video_profile(profile); switch (param) { case PIPE_VIDEO_CAP_SUPPORTED: /* For now, h264 and mpeg4 don't work on pre-nvc0. */ if (chipset < 0xc0) - return codec == PIPE_VIDEO_CODEC_MPEG12 || - codec == PIPE_VIDEO_CODEC_VC1; + return codec == PIPE_VIDEO_FORMAT_MPEG12 || + codec == PIPE_VIDEO_FORMAT_VC1; /* In the general case, this should work, once the pre-nvc0 problems are * resolved. */ return profile >= PIPE_VIDEO_PROFILE_MPEG1 && ( - !vp3 || codec != PIPE_VIDEO_CODEC_MPEG4); + !vp3 || codec != PIPE_VIDEO_FORMAT_MPEG4); case PIPE_VIDEO_CAP_NPOT_TEXTURES: return 1; case PIPE_VIDEO_CAP_MAX_WIDTH: diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.h b/src/gallium/drivers/nouveau/nouveau_vp3_video.h index f1a10548518..9af29cddaed 100644 --- a/src/gallium/drivers/nouveau/nouveau_vp3_video.h +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.h @@ -185,7 +185,7 @@ nouveau_vp3_inter_sizes(struct nouveau_vp3_decoder *dec, uint32_t slice_count, uint32_t *ring_size) { *slice_size = (SLICE_SIZE * slice_count)>>8; - if (u_reduce_video_profile(dec->base.profile) == PIPE_VIDEO_CODEC_MPEG12) + if (u_reduce_video_profile(dec->base.profile) == PIPE_VIDEO_FORMAT_MPEG12) *bucket_size = 0; else *bucket_size = mb(dec->base.width) * 3; diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c b/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c index 03118540ad3..ba2a91716d2 100644 --- a/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c @@ -236,7 +236,7 @@ nouveau_vp3_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, unsigned comm_seq, unsigned num_buffers, const void *const *data, const unsigned *num_bytes) { - enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile); + enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile); struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH]; char *bsp; uint32_t endmarker, caps; @@ -252,20 +252,20 @@ nouveau_vp3_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, */ switch (codec){ - case PIPE_VIDEO_CODEC_MPEG12: + case PIPE_VIDEO_FORMAT_MPEG12: endmarker = 0xb7010000; caps = nouveau_vp3_fill_picparm_mpeg12_bsp(dec, desc.mpeg12, bsp); break; - case PIPE_VIDEO_CODEC_MPEG4: + case PIPE_VIDEO_FORMAT_MPEG4: endmarker = 0xb1010000; caps = nouveau_vp3_fill_picparm_mpeg4_bsp(dec, desc.mpeg4, bsp); break; - case PIPE_VIDEO_CODEC_VC1: { + case PIPE_VIDEO_FORMAT_VC1: { endmarker = 0x0a010000; caps = nouveau_vp3_fill_picparm_vc1_bsp(dec, desc.vc1, bsp); break; } - case PIPE_VIDEO_CODEC_MPEG4_AVC: { + case PIPE_VIDEO_FORMAT_MPEG4_AVC: { endmarker = 0x0b010000; caps = nouveau_vp3_fill_picparm_h264_bsp(dec, desc.h264, bsp); break; diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c b/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c index c9b1b996bd0..199c43d6d00 100644 --- a/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c @@ -171,7 +171,7 @@ struct h264_picparm_vp { // 700..a00 static void nouveau_vp3_handle_references(struct nouveau_vp3_decoder *dec, struct nouveau_vp3_video_buffer *refs[16], unsigned seq, struct nouveau_vp3_video_buffer *target) { - unsigned h264 = u_reduce_video_profile(dec->base.profile) == PIPE_VIDEO_CODEC_MPEG4_AVC; + unsigned h264 = u_reduce_video_profile(dec->base.profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC; unsigned i, idx, empty_spot = dec->base.max_references + 1; for (i = 0; i < dec->base.max_references; ++i) { if (!refs[i]) @@ -457,24 +457,24 @@ void nouveau_vp3_vp_caps(struct nouveau_vp3_decoder *dec, union pipe_desc desc, struct nouveau_vp3_video_buffer *refs[16]) { struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH]; - enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile); + enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile); char *vp = bsp_bo->map + VP_OFFSET; switch (codec){ - case PIPE_VIDEO_CODEC_MPEG12: + case PIPE_VIDEO_FORMAT_MPEG12: *caps = nouveau_vp3_fill_picparm_mpeg12_vp(dec, desc.mpeg12, refs, is_ref, vp); nouveau_vp3_handle_references(dec, refs, dec->fence_seq, target); return; - case PIPE_VIDEO_CODEC_MPEG4: + case PIPE_VIDEO_FORMAT_MPEG4: *caps = nouveau_vp3_fill_picparm_mpeg4_vp(dec, desc.mpeg4, refs, is_ref, vp); nouveau_vp3_handle_references(dec, refs, dec->fence_seq, target); return; - case PIPE_VIDEO_CODEC_VC1: { + case PIPE_VIDEO_FORMAT_VC1: { *caps = nouveau_vp3_fill_picparm_vc1_vp(dec, desc.vc1, refs, is_ref, vp); nouveau_vp3_handle_references(dec, refs, dec->fence_seq, target); return; } - case PIPE_VIDEO_CODEC_MPEG4_AVC: { + case PIPE_VIDEO_FORMAT_MPEG4_AVC: { *caps = nouveau_vp3_fill_picparm_h264_vp(dec, desc.h264, refs, is_ref, vp); nouveau_vp3_handle_references(dec, refs, dec->fence_seq, target); nouveau_vp3_fill_picparm_h264_vp_refs(dec, desc.h264, refs, target, vp); diff --git a/src/gallium/drivers/nv50/nv84_video.c b/src/gallium/drivers/nv50/nv84_video.c index aedb9efc149..7c81d2d4025 100644 --- a/src/gallium/drivers/nv50/nv84_video.c +++ b/src/gallium/drivers/nv50/nv84_video.c @@ -274,8 +274,8 @@ nv84_create_decoder(struct pipe_context *context, union pipe_color_union color; struct nv04_fifo nv04_data = { .vram = 0xbeef0201, .gart = 0xbeef0202 }; int ret, i; - int is_h264 = u_reduce_video_profile(templ->profile) == PIPE_VIDEO_CODEC_MPEG4_AVC; - int is_mpeg12 = u_reduce_video_profile(templ->profile) == PIPE_VIDEO_CODEC_MPEG12; + int is_h264 = u_reduce_video_profile(templ->profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC; + int is_mpeg12 = u_reduce_video_profile(templ->profile) == PIPE_VIDEO_FORMAT_MPEG12; if (getenv("XVMC_VL")) return vl_create_decoder(context, templ); @@ -748,8 +748,8 @@ nv84_screen_get_video_param(struct pipe_screen *pscreen, { switch (param) { case PIPE_VIDEO_CAP_SUPPORTED: - return u_reduce_video_profile(profile) == PIPE_VIDEO_CODEC_MPEG4_AVC || - u_reduce_video_profile(profile) == PIPE_VIDEO_CODEC_MPEG12; + return u_reduce_video_profile(profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC || + u_reduce_video_profile(profile) == PIPE_VIDEO_FORMAT_MPEG12; case PIPE_VIDEO_CAP_NPOT_TEXTURES: return 1; case PIPE_VIDEO_CAP_MAX_WIDTH: diff --git a/src/gallium/drivers/nv50/nv98_video.c b/src/gallium/drivers/nv50/nv98_video.c index 60bc79b222c..541cd729352 100644 --- a/src/gallium/drivers/nv50/nv98_video.c +++ b/src/gallium/drivers/nv50/nv98_video.c @@ -152,24 +152,24 @@ nv98_create_decoder(struct pipe_context *context, goto fail; switch (u_reduce_video_profile(templ->profile)) { - case PIPE_VIDEO_CODEC_MPEG12: { + case PIPE_VIDEO_FORMAT_MPEG12: { codec = 1; assert(templ->max_references <= 2); break; } - case PIPE_VIDEO_CODEC_MPEG4: { + case PIPE_VIDEO_FORMAT_MPEG4: { codec = 4; tmp_size = mb(templ->height)*16 * mb(templ->width)*16; assert(templ->max_references <= 2); break; } - case PIPE_VIDEO_CODEC_VC1: { + case PIPE_VIDEO_FORMAT_VC1: { ppp_codec = codec = 2; tmp_size = mb(templ->height)*16 * mb(templ->width)*16; assert(templ->max_references <= 2); break; } - case PIPE_VIDEO_CODEC_MPEG4_AVC: { + case PIPE_VIDEO_FORMAT_MPEG4_AVC: { codec = 3; dec->tmp_stride = 16 * mb_half(templ->width) * nouveau_vp3_video_align(templ->height) * 3 / 2; tmp_size = dec->tmp_stride * (templ->max_references + 1); diff --git a/src/gallium/drivers/nv50/nv98_video_bsp.c b/src/gallium/drivers/nv50/nv98_video_bsp.c index 65128da9e6b..9a5639eb5cd 100644 --- a/src/gallium/drivers/nv50/nv98_video_bsp.c +++ b/src/gallium/drivers/nv50/nv98_video_bsp.c @@ -40,7 +40,7 @@ nv98_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, struct nouveau_vp3_video_buffer *refs[16]) { struct nouveau_pushbuf *push = dec->pushbuf[0]; - enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile); + enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile); uint32_t bsp_addr, comm_addr, inter_addr; uint32_t slice_size, bucket_size, ring_size; uint32_t caps; @@ -76,7 +76,7 @@ nv98_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, nouveau_vp3_vp_caps(dec, desc, target, comm_seq, vp_caps, is_ref, refs); - nouveau_pushbuf_space(push, 6 + (codec == PIPE_VIDEO_CODEC_MPEG4_AVC ? 9 : 8) + fence_extra + 2, num_refs, 0); + nouveau_pushbuf_space(push, 6 + (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC ? 9 : 8) + fence_extra + 2, num_refs, 0); nouveau_pushbuf_refn(push, bo_refs, num_refs); bsp_addr = bsp_bo->offset >> 8; @@ -96,9 +96,9 @@ nv98_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, PUSH_DATA (push, comm_addr); // 70c comm PUSH_DATA (push, comm_seq); // 710 seq - if (codec != PIPE_VIDEO_CODEC_MPEG4_AVC) { + if (codec != PIPE_VIDEO_FORMAT_MPEG4_AVC) { u32 bitplane_addr; - int mpeg12 = (codec == PIPE_VIDEO_CODEC_MPEG12); + int mpeg12 = (codec == PIPE_VIDEO_FORMAT_MPEG12); bitplane_addr = dec->bitplane_bo->offset >> 8; diff --git a/src/gallium/drivers/nv50/nv98_video_ppp.c b/src/gallium/drivers/nv50/nv98_video_ppp.c index 03659750659..a26c661cfa4 100644 --- a/src/gallium/drivers/nv50/nv98_video_ppp.c +++ b/src/gallium/drivers/nv50/nv98_video_ppp.c @@ -90,7 +90,7 @@ nv98_decoder_vc1_ppp(struct nouveau_vp3_decoder *dec, struct pipe_vc1_picture_de void nv98_decoder_ppp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, struct nouveau_vp3_video_buffer *target, unsigned comm_seq) { - enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile); + enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile); struct nouveau_pushbuf *push = dec->pushbuf[2]; unsigned ppp_caps = 0x10; unsigned fence_extra = 0; @@ -99,17 +99,17 @@ nv98_decoder_ppp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, struct n fence_extra = 4; #endif - nouveau_pushbuf_space(push, 11 + (codec == PIPE_VIDEO_CODEC_VC1 ? 2 : 0) + 3 + fence_extra + 2, 4, 0); + nouveau_pushbuf_space(push, 11 + (codec == PIPE_VIDEO_FORMAT_VC1 ? 2 : 0) + 3 + fence_extra + 2, 4, 0); switch (codec) { - case PIPE_VIDEO_CODEC_MPEG12: { + case PIPE_VIDEO_FORMAT_MPEG12: { unsigned mpeg2 = dec->base.profile != PIPE_VIDEO_PROFILE_MPEG1; nv98_decoder_setup_ppp(dec, target, 0x1410 | mpeg2); break; } - case PIPE_VIDEO_CODEC_MPEG4: nv98_decoder_setup_ppp(dec, target, 0x1414); break; - case PIPE_VIDEO_CODEC_VC1: ppp_caps = nv98_decoder_vc1_ppp(dec, desc.vc1, target); break; - case PIPE_VIDEO_CODEC_MPEG4_AVC: nv98_decoder_setup_ppp(dec, target, 0x1413); break; + case PIPE_VIDEO_FORMAT_MPEG4: nv98_decoder_setup_ppp(dec, target, 0x1414); break; + case PIPE_VIDEO_FORMAT_VC1: ppp_caps = nv98_decoder_vc1_ppp(dec, desc.vc1, target); break; + case PIPE_VIDEO_FORMAT_MPEG4_AVC: nv98_decoder_setup_ppp(dec, target, 0x1413); break; default: assert(0); } BEGIN_NV04(push, SUBC_PPP(0x734), 2); diff --git a/src/gallium/drivers/nv50/nv98_video_vp.c b/src/gallium/drivers/nv50/nv98_video_vp.c index adba58becf3..4fbce69bcf2 100644 --- a/src/gallium/drivers/nv50/nv98_video_vp.c +++ b/src/gallium/drivers/nv50/nv98_video_vp.c @@ -73,7 +73,7 @@ nv98_decoder_vp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, struct nouveau_pushbuf *push = dec->pushbuf[1]; uint32_t bsp_addr, comm_addr, inter_addr, ucode_addr, pic_addr[17], last_addr, null_addr; uint32_t slice_size, bucket_size, ring_size, i; - enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile); + enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile); struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH]; struct nouveau_bo *inter_bo = dec->inter_bo[comm_seq & 1]; u32 fence_extra = 0, codec_extra = 0; @@ -92,7 +92,7 @@ nv98_decoder_vp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, fence_extra = 4; #endif - if (codec == PIPE_VIDEO_CODEC_MPEG4_AVC) { + if (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC) { nouveau_vp3_inter_sizes(dec, desc.h264->slice_count, &slice_size, &bucket_size, &ring_size); codec_extra += 2; } else @@ -115,7 +115,7 @@ nv98_decoder_vp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, if (!is_ref) nv98_decoder_kick_ref(dec, target); - nouveau_pushbuf_space(push, 8 + 3 * (codec != PIPE_VIDEO_CODEC_MPEG12) + + nouveau_pushbuf_space(push, 8 + 3 * (codec != PIPE_VIDEO_FORMAT_MPEG12) + 6 + codec_extra + fence_extra + 2, num_refs, 0); nouveau_pushbuf_refn(push, bo_refs, num_refs); @@ -166,7 +166,7 @@ nv98_decoder_vp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, } } - if (codec == PIPE_VIDEO_CODEC_MPEG4_AVC) { + if (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC) { BEGIN_NV04(push, SUBC_VP(0x438), 1); PUSH_DATA (push, desc.h264->slice_count); } diff --git a/src/gallium/drivers/nvc0/nvc0_video.c b/src/gallium/drivers/nvc0/nvc0_video.c index 1b2dcd18ffc..e913126df4c 100644 --- a/src/gallium/drivers/nvc0/nvc0_video.c +++ b/src/gallium/drivers/nvc0/nvc0_video.c @@ -184,24 +184,24 @@ nvc0_create_decoder(struct pipe_context *context, goto fail; switch (u_reduce_video_profile(templ->profile)) { - case PIPE_VIDEO_CODEC_MPEG12: { + case PIPE_VIDEO_FORMAT_MPEG12: { codec = 1; assert(templ->max_references <= 2); break; } - case PIPE_VIDEO_CODEC_MPEG4: { + case PIPE_VIDEO_FORMAT_MPEG4: { codec = 4; tmp_size = mb(templ->height)*16 * mb(templ->width)*16; assert(templ->max_references <= 2); break; } - case PIPE_VIDEO_CODEC_VC1: { + case PIPE_VIDEO_FORMAT_VC1: { ppp_codec = codec = 2; tmp_size = mb(templ->height)*16 * mb(templ->width)*16; assert(templ->max_references <= 2); break; } - case PIPE_VIDEO_CODEC_MPEG4_AVC: { + case PIPE_VIDEO_FORMAT_MPEG4_AVC: { codec = 3; dec->tmp_stride = 16 * mb_half(templ->width) * nouveau_vp3_video_align(templ->height) * 3 / 2; tmp_size = dec->tmp_stride * (templ->max_references + 1); diff --git a/src/gallium/drivers/nvc0/nvc0_video_bsp.c b/src/gallium/drivers/nvc0/nvc0_video_bsp.c index 2ce551995a8..2edfb8a7b71 100644 --- a/src/gallium/drivers/nvc0/nvc0_video_bsp.c +++ b/src/gallium/drivers/nvc0/nvc0_video_bsp.c @@ -40,7 +40,7 @@ nvc0_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, struct nouveau_vp3_video_buffer *refs[16]) { struct nouveau_pushbuf *push = dec->pushbuf[0]; - enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile); + enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile); uint32_t bsp_addr, comm_addr, inter_addr; uint32_t slice_size, bucket_size, ring_size; uint32_t caps; @@ -76,7 +76,7 @@ nvc0_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, nouveau_vp3_vp_caps(dec, desc, target, comm_seq, vp_caps, is_ref, refs); - nouveau_pushbuf_space(push, 6 + (codec == PIPE_VIDEO_CODEC_MPEG4_AVC ? 9 : 7) + fence_extra + 2, num_refs, 0); + nouveau_pushbuf_space(push, 6 + (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC ? 9 : 7) + fence_extra + 2, num_refs, 0); nouveau_pushbuf_refn(push, bo_refs, num_refs); bsp_addr = bsp_bo->offset >> 8; @@ -96,7 +96,7 @@ nvc0_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, PUSH_DATA (push, comm_addr); // 70c comm PUSH_DATA (push, comm_seq); // 710 seq - if (codec != PIPE_VIDEO_CODEC_MPEG4_AVC) { + if (codec != PIPE_VIDEO_FORMAT_MPEG4_AVC) { u32 bitplane_addr; bitplane_addr = dec->bitplane_bo->offset >> 8; diff --git a/src/gallium/drivers/nvc0/nvc0_video_ppp.c b/src/gallium/drivers/nvc0/nvc0_video_ppp.c index 496db80a23e..c1fd1fd16a8 100644 --- a/src/gallium/drivers/nvc0/nvc0_video_ppp.c +++ b/src/gallium/drivers/nvc0/nvc0_video_ppp.c @@ -90,7 +90,7 @@ nvc0_decoder_vc1_ppp(struct nouveau_vp3_decoder *dec, struct pipe_vc1_picture_de void nvc0_decoder_ppp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, struct nouveau_vp3_video_buffer *target, unsigned comm_seq) { - enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile); + enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile); struct nouveau_pushbuf *push = dec->pushbuf[2]; unsigned ppp_caps = 0x10; unsigned fence_extra = 0; @@ -99,17 +99,17 @@ nvc0_decoder_ppp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, struct n fence_extra = 4; #endif - nouveau_pushbuf_space(push, 11 + (codec == PIPE_VIDEO_CODEC_VC1 ? 2 : 0) + 3 + fence_extra + 2, 4, 0); + nouveau_pushbuf_space(push, 11 + (codec == PIPE_VIDEO_FORMAT_VC1 ? 2 : 0) + 3 + fence_extra + 2, 4, 0); switch (codec) { - case PIPE_VIDEO_CODEC_MPEG12: { + case PIPE_VIDEO_FORMAT_MPEG12: { unsigned mpeg2 = dec->base.profile != PIPE_VIDEO_PROFILE_MPEG1; nvc0_decoder_setup_ppp(dec, target, 0x1410 | mpeg2); break; } - case PIPE_VIDEO_CODEC_MPEG4: nvc0_decoder_setup_ppp(dec, target, 0x1414); break; - case PIPE_VIDEO_CODEC_VC1: ppp_caps = nvc0_decoder_vc1_ppp(dec, desc.vc1, target); break; - case PIPE_VIDEO_CODEC_MPEG4_AVC: nvc0_decoder_setup_ppp(dec, target, 0x1413); break; + case PIPE_VIDEO_FORMAT_MPEG4: nvc0_decoder_setup_ppp(dec, target, 0x1414); break; + case PIPE_VIDEO_FORMAT_VC1: ppp_caps = nvc0_decoder_vc1_ppp(dec, desc.vc1, target); break; + case PIPE_VIDEO_FORMAT_MPEG4_AVC: nvc0_decoder_setup_ppp(dec, target, 0x1413); break; default: assert(0); } BEGIN_NVC0(push, SUBC_PPP(0x734), 2); diff --git a/src/gallium/drivers/nvc0/nvc0_video_vp.c b/src/gallium/drivers/nvc0/nvc0_video_vp.c index eb4f1a9f415..df9633e28c2 100644 --- a/src/gallium/drivers/nvc0/nvc0_video_vp.c +++ b/src/gallium/drivers/nvc0/nvc0_video_vp.c @@ -73,7 +73,7 @@ nvc0_decoder_vp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, struct nouveau_pushbuf *push = dec->pushbuf[1]; uint32_t bsp_addr, comm_addr, inter_addr, ucode_addr, pic_addr[17], last_addr, null_addr; uint32_t slice_size, bucket_size, ring_size, i; - enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile); + enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile); struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH]; struct nouveau_bo *inter_bo = dec->inter_bo[comm_seq & 1]; u32 fence_extra = 0, codec_extra = 0; @@ -92,7 +92,7 @@ nvc0_decoder_vp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, fence_extra = 4; #endif - if (codec == PIPE_VIDEO_CODEC_MPEG4_AVC) { + if (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC) { nouveau_vp3_inter_sizes(dec, desc.h264->slice_count, &slice_size, &bucket_size, &ring_size); codec_extra += 2; } else @@ -115,7 +115,7 @@ nvc0_decoder_vp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, if (!is_ref) nvc0_decoder_kick_ref(dec, target); - nouveau_pushbuf_space(push, 8 + 3 * (codec != PIPE_VIDEO_CODEC_MPEG12) + + nouveau_pushbuf_space(push, 8 + 3 * (codec != PIPE_VIDEO_FORMAT_MPEG12) + 6 + codec_extra + fence_extra + 2, num_refs, 0); nouveau_pushbuf_refn(push, bo_refs, num_refs); @@ -166,7 +166,7 @@ nvc0_decoder_vp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, } } - if (codec == PIPE_VIDEO_CODEC_MPEG4_AVC) { + if (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC) { BEGIN_NVC0(push, SUBC_VP(0x438), 1); PUSH_DATA (push, desc.h264->slice_count); } diff --git a/src/gallium/drivers/r600/r600_uvd.c b/src/gallium/drivers/r600/r600_uvd.c index 62c8e525e12..288790591ce 100644 --- a/src/gallium/drivers/r600/r600_uvd.c +++ b/src/gallium/drivers/r600/r600_uvd.c @@ -180,15 +180,15 @@ int r600_uvd_get_video_param(struct pipe_screen *screen, /* UVD 2.x limits */ if (rscreen->family < CHIP_PALM) { - enum pipe_video_codec codec = u_reduce_video_profile(profile); + enum pipe_video_format codec = u_reduce_video_profile(profile); switch (param) { case PIPE_VIDEO_CAP_SUPPORTED: /* no support for MPEG4 */ - return codec != PIPE_VIDEO_CODEC_MPEG4; + return codec != PIPE_VIDEO_FORMAT_MPEG4; case PIPE_VIDEO_CAP_PREFERS_INTERLACED: case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED: /* and MPEG2 only with shaders */ - return codec != PIPE_VIDEO_CODEC_MPEG12; + return codec != PIPE_VIDEO_FORMAT_MPEG12; default: break; } diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c index 55aca415045..fd6bc4c20cf 100644 --- a/src/gallium/drivers/radeon/radeon_uvd.c +++ b/src/gallium/drivers/radeon/radeon_uvd.c @@ -243,16 +243,16 @@ static void next_buffer(struct ruvd_decoder *dec) static uint32_t profile2stream_type(enum pipe_video_profile profile) { switch (u_reduce_video_profile(profile)) { - case PIPE_VIDEO_CODEC_MPEG4_AVC: + case PIPE_VIDEO_FORMAT_MPEG4_AVC: return RUVD_CODEC_H264; - case PIPE_VIDEO_CODEC_VC1: + case PIPE_VIDEO_FORMAT_VC1: return RUVD_CODEC_VC1; - case PIPE_VIDEO_CODEC_MPEG12: + case PIPE_VIDEO_FORMAT_MPEG12: return RUVD_CODEC_MPEG2; - case PIPE_VIDEO_CODEC_MPEG4: + case PIPE_VIDEO_FORMAT_MPEG4: return RUVD_CODEC_MPEG4; default: @@ -283,7 +283,7 @@ static unsigned calc_dpb_size(const struct pipe_video_decoder *templ) height_in_mb = align(height / VL_MACROBLOCK_HEIGHT, 2); switch (u_reduce_video_profile(templ->profile)) { - case PIPE_VIDEO_CODEC_MPEG4_AVC: + case PIPE_VIDEO_FORMAT_MPEG4_AVC: // the firmware seems to allways assume a minimum of ref frames max_references = MAX2(NUM_H264_REFS, max_references); @@ -297,7 +297,7 @@ static unsigned calc_dpb_size(const struct pipe_video_decoder *templ) dpb_size += width_in_mb * height_in_mb * 32; break; - case PIPE_VIDEO_CODEC_VC1: + case PIPE_VIDEO_FORMAT_VC1: // reference picture buffer dpb_size = image_size * max_references; @@ -314,12 +314,12 @@ static unsigned calc_dpb_size(const struct pipe_video_decoder *templ) dpb_size += align(MAX2(width_in_mb, height_in_mb) * 7 * 16, 64); break; - case PIPE_VIDEO_CODEC_MPEG12: + case PIPE_VIDEO_FORMAT_MPEG12: // reference picture buffer, must be big enough for all frames dpb_size = image_size * NUM_MPEG2_REFS; break; - case PIPE_VIDEO_CODEC_MPEG4: + case PIPE_VIDEO_FORMAT_MPEG4: // reference picture buffer dpb_size = image_size * max_references; @@ -767,19 +767,19 @@ static void ruvd_end_frame(struct pipe_video_decoder *decoder, dt = dec->set_dtb(&msg, (struct vl_video_buffer *)target); switch (u_reduce_video_profile(picture->profile)) { - case PIPE_VIDEO_CODEC_MPEG4_AVC: + case PIPE_VIDEO_FORMAT_MPEG4_AVC: msg.body.decode.codec.h264 = get_h264_msg(dec, (struct pipe_h264_picture_desc*)picture); break; - case PIPE_VIDEO_CODEC_VC1: + case PIPE_VIDEO_FORMAT_VC1: msg.body.decode.codec.vc1 = get_vc1_msg((struct pipe_vc1_picture_desc*)picture); break; - case PIPE_VIDEO_CODEC_MPEG12: + case PIPE_VIDEO_FORMAT_MPEG12: msg.body.decode.codec.mpeg2 = get_mpeg2_msg(dec, (struct pipe_mpeg12_picture_desc*)picture); break; - case PIPE_VIDEO_CODEC_MPEG4: + case PIPE_VIDEO_FORMAT_MPEG4: msg.body.decode.codec.mpeg4 = get_mpeg4_msg(dec, (struct pipe_mpeg4_picture_desc*)picture); break; @@ -831,13 +831,13 @@ struct pipe_video_decoder *ruvd_create_decoder(struct pipe_context *context, ws->query_info(ws, &info); switch(u_reduce_video_profile(templ->profile)) { - case PIPE_VIDEO_CODEC_MPEG12: + case PIPE_VIDEO_FORMAT_MPEG12: if (templ->entrypoint > PIPE_VIDEO_ENTRYPOINT_BITSTREAM || info.family < CHIP_PALM) return vl_create_mpeg12_decoder(context, templ); /* fall through */ - case PIPE_VIDEO_CODEC_MPEG4: - case PIPE_VIDEO_CODEC_MPEG4_AVC: + case PIPE_VIDEO_FORMAT_MPEG4: + case PIPE_VIDEO_FORMAT_MPEG4_AVC: width = align(width, VL_MACROBLOCK_WIDTH); height = align(height, VL_MACROBLOCK_HEIGHT); break; @@ -1080,10 +1080,10 @@ int ruvd_get_video_param(struct pipe_screen *screen, switch (param) { case PIPE_VIDEO_CAP_SUPPORTED: switch (u_reduce_video_profile(profile)) { - case PIPE_VIDEO_CODEC_MPEG12: - case PIPE_VIDEO_CODEC_MPEG4: - case PIPE_VIDEO_CODEC_MPEG4_AVC: - case PIPE_VIDEO_CODEC_VC1: + case PIPE_VIDEO_FORMAT_MPEG12: + case PIPE_VIDEO_FORMAT_MPEG4: + case PIPE_VIDEO_FORMAT_MPEG4_AVC: + case PIPE_VIDEO_FORMAT_VC1: return true; default: return false; |