diff options
author | Younes Manton <[email protected]> | 2010-03-12 12:09:44 -0500 |
---|---|---|
committer | Younes Manton <[email protected]> | 2010-03-12 12:09:44 -0500 |
commit | 299407aaa3d3a4ab96097e110df1a7db16eaee9c (patch) | |
tree | 6266dc0cb25de1057d05f3d6e3e1fff161e7a401 /src/gallium/drivers/softpipe | |
parent | 81badd502932b001e12464c28ba2a52c46fb643a (diff) |
vl: Get rid of pipe_video_surface.
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_state_sampler.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_texture.c | 55 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_texture.h | 16 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_video_context.c | 24 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_video_context.h | 3 |
5 files changed, 14 insertions, 85 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_sampler.c b/src/gallium/drivers/softpipe/sp_state_sampler.c index ceb4e338f1a..9298023bbe2 100644 --- a/src/gallium/drivers/softpipe/sp_state_sampler.c +++ b/src/gallium/drivers/softpipe/sp_state_sampler.c @@ -30,6 +30,7 @@ */ #include "util/u_memory.h" +#include "util/u_inlines.h" #include "draw/draw_context.h" #include "draw/draw_context.h" diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index 32d261b5ffc..d80a71aca50 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -402,58 +402,6 @@ softpipe_transfer_unmap(struct pipe_screen *screen, } -static struct pipe_video_surface* -softpipe_video_surface_create(struct pipe_screen *screen, - enum pipe_video_chroma_format chroma_format, - unsigned width, unsigned height) -{ - struct softpipe_video_surface *sp_vsfc; - struct pipe_texture template; - - assert(screen); - assert(width && height); - - sp_vsfc = CALLOC_STRUCT(softpipe_video_surface); - if (!sp_vsfc) - return NULL; - - pipe_reference_init(&sp_vsfc->base.reference, 1); - sp_vsfc->base.screen = screen; - sp_vsfc->base.chroma_format = chroma_format; - /*sp_vsfc->base.surface_format = PIPE_VIDEO_SURFACE_FORMAT_VUYA;*/ - sp_vsfc->base.width = width; - sp_vsfc->base.height = height; - - memset(&template, 0, sizeof(struct pipe_texture)); - template.target = PIPE_TEXTURE_2D; - template.format = PIPE_FORMAT_B8G8R8X8_UNORM; - template.last_level = 0; - /* vl_mpeg12_mc_renderer expects this when it's initialized with pot_buffers=true */ - template.width0 = util_next_power_of_two(width); - template.height0 = util_next_power_of_two(height); - template.depth0 = 1; - template.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER | PIPE_TEXTURE_USAGE_RENDER_TARGET; - - sp_vsfc->tex = screen->texture_create(screen, &template); - if (!sp_vsfc->tex) { - FREE(sp_vsfc); - return NULL; - } - - return &sp_vsfc->base; -} - - -static void -softpipe_video_surface_destroy(struct pipe_video_surface *vsfc) -{ - struct softpipe_video_surface *sp_vsfc = softpipe_video_surface(vsfc); - - pipe_texture_reference(&sp_vsfc->tex, NULL); - FREE(sp_vsfc); -} - - void softpipe_init_screen_texture_funcs(struct pipe_screen *screen) { @@ -468,9 +416,6 @@ softpipe_init_screen_texture_funcs(struct pipe_screen *screen) screen->tex_transfer_destroy = softpipe_tex_transfer_destroy; screen->transfer_map = softpipe_transfer_map; screen->transfer_unmap = softpipe_transfer_unmap; - - screen->video_surface_create = softpipe_video_surface_create; - screen->video_surface_destroy = softpipe_video_surface_destroy; } diff --git a/src/gallium/drivers/softpipe/sp_texture.h b/src/gallium/drivers/softpipe/sp_texture.h index 2ef64e1e7c3..2537ab6a40d 100644 --- a/src/gallium/drivers/softpipe/sp_texture.h +++ b/src/gallium/drivers/softpipe/sp_texture.h @@ -30,7 +30,6 @@ #include "pipe/p_state.h" -#include "pipe/p_video_state.h" struct pipe_context; @@ -63,15 +62,6 @@ struct softpipe_transfer unsigned long offset; }; -struct softpipe_video_surface -{ - struct pipe_video_surface base; - - /* The data is held here: - */ - struct pipe_texture *tex; -}; - /** cast wrappers */ static INLINE struct softpipe_texture * @@ -86,12 +76,6 @@ softpipe_transfer(struct pipe_transfer *pt) return (struct softpipe_transfer *) pt; } -static INLINE struct softpipe_video_surface * -softpipe_video_surface(struct pipe_video_surface *pvs) -{ - return (struct softpipe_video_surface *) pvs; -} - extern void softpipe_init_screen_texture_funcs(struct pipe_screen *screen); diff --git a/src/gallium/drivers/softpipe/sp_video_context.c b/src/gallium/drivers/softpipe/sp_video_context.c index e575e238bd7..2be093f505d 100644 --- a/src/gallium/drivers/softpipe/sp_video_context.c +++ b/src/gallium/drivers/softpipe/sp_video_context.c @@ -51,7 +51,7 @@ sp_mpeg12_destroy(struct pipe_video_context *vpipe) ctx->pipe->delete_rasterizer_state(ctx->pipe, ctx->rast); ctx->pipe->delete_depth_stencil_alpha_state(ctx->pipe, ctx->dsa); - pipe_video_surface_reference(&ctx->decode_target, NULL); + pipe_surface_reference(&ctx->decode_target, NULL); vl_compositor_cleanup(&ctx->compositor); vl_mpeg12_mc_renderer_cleanup(&ctx->mc_renderer); ctx->pipe->destroy(ctx->pipe); @@ -61,8 +61,8 @@ sp_mpeg12_destroy(struct pipe_video_context *vpipe) static void sp_mpeg12_decode_macroblocks(struct pipe_video_context *vpipe, - struct pipe_video_surface *past, - struct pipe_video_surface *future, + struct pipe_surface *past, + struct pipe_surface *future, unsigned num_macroblocks, struct pipe_macroblock *macroblocks, struct pipe_fence_handle **fence) @@ -77,9 +77,9 @@ sp_mpeg12_decode_macroblocks(struct pipe_video_context *vpipe, assert(ctx->decode_target); vl_mpeg12_mc_renderer_render_macroblocks(&ctx->mc_renderer, - softpipe_video_surface(ctx->decode_target)->tex, - past ? softpipe_video_surface(past)->tex : NULL, - future ? softpipe_video_surface(future)->tex : NULL, + ctx->decode_target->texture, + past ? past->texture : NULL, + future ? future->texture : NULL, num_macroblocks, mpeg12_macroblocks, fence); } @@ -122,12 +122,12 @@ sp_mpeg12_surface_copy(struct pipe_video_context *vpipe, static void sp_mpeg12_render_picture(struct pipe_video_context *vpipe, - struct pipe_video_surface *src_surface, + struct pipe_surface *src_surface, enum pipe_mpeg12_picture_type picture_type, /*unsigned num_past_surfaces, - struct pipe_video_surface *past_surfaces, + struct pipe_surface *past_surfaces, unsigned num_future_surfaces, - struct pipe_video_surface *future_surfaces,*/ + struct pipe_surface *future_surfaces,*/ struct pipe_video_rect *src_area, struct pipe_surface *dst_surface, struct pipe_video_rect *dst_area, @@ -141,7 +141,7 @@ sp_mpeg12_render_picture(struct pipe_video_context *vpipe, assert(dst_surface); assert(dst_area); - vl_compositor_render(&ctx->compositor, softpipe_video_surface(src_surface)->tex, + vl_compositor_render(&ctx->compositor, src_surface->texture, picture_type, src_area, dst_surface->texture, dst_area, fence); } @@ -177,14 +177,14 @@ sp_mpeg12_set_picture_layers(struct pipe_video_context *vpipe, static void sp_mpeg12_set_decode_target(struct pipe_video_context *vpipe, - struct pipe_video_surface *dt) + struct pipe_surface *dt) { struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe; assert(vpipe); assert(dt); - pipe_video_surface_reference(&ctx->decode_target, dt); + pipe_surface_reference(&ctx->decode_target, dt); } static void diff --git a/src/gallium/drivers/softpipe/sp_video_context.h b/src/gallium/drivers/softpipe/sp_video_context.h index 40743ac423c..bc5daa05ac6 100644 --- a/src/gallium/drivers/softpipe/sp_video_context.h +++ b/src/gallium/drivers/softpipe/sp_video_context.h @@ -34,13 +34,12 @@ struct pipe_screen; struct pipe_context; -struct pipe_video_surface; struct sp_mpeg12_context { struct pipe_video_context base; struct pipe_context *pipe; - struct pipe_video_surface *decode_target; + struct pipe_surface *decode_target; struct vl_mpeg12_mc_renderer mc_renderer; struct vl_compositor compositor; |