diff options
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/r600/Makefile | 1 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_video_context.c | 22 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_video_context.h | 11 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_video_context.c | 38 |
5 files changed, 74 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/Makefile b/src/gallium/drivers/r600/Makefile index a484f38e9f1..436de9c4dbd 100644 --- a/src/gallium/drivers/r600/Makefile +++ b/src/gallium/drivers/r600/Makefile @@ -17,6 +17,7 @@ C_SOURCES = \ r600_shader.c \ r600_state.c \ r600_texture.c \ + r600_video_context.c \ r700_asm.c \ evergreen_state.c \ eg_asm.c \ diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index bea7ef5df84..e1a5b2b49f8 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -43,6 +43,7 @@ #include "r600_shader.h" #include "r600_pipe.h" #include "r600_state_inlines.h" +#include "r600_video_context.h" /* * pipe_context @@ -449,6 +450,7 @@ struct pipe_screen *r600_screen_create(struct radeon *radeon) rscreen->screen.get_paramf = r600_get_paramf; rscreen->screen.is_format_supported = r600_is_format_supported; rscreen->screen.context_create = r600_create_context; + rscreen->screen.video_context_create = r600_video_create; r600_init_screen_texture_functions(&rscreen->screen); r600_init_screen_resource_functions(&rscreen->screen); diff --git a/src/gallium/drivers/r600/r600_video_context.c b/src/gallium/drivers/r600/r600_video_context.c new file mode 100644 index 00000000000..2bbf622052b --- /dev/null +++ b/src/gallium/drivers/r600/r600_video_context.c @@ -0,0 +1,22 @@ +#include "r600_video_context.h" +#include <softpipe/sp_video_context.h> + +struct pipe_video_context * +r600_video_create(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_chroma_format chroma_format, + unsigned width, unsigned height, void *priv) +{ + struct pipe_context *pipe; + + assert(screen); + + pipe = screen->context_create(screen, priv); + if (!pipe) + return NULL; + + return sp_video_create_ex(pipe, profile, chroma_format, width, height, + VL_MPEG12_MC_RENDERER_BUFFER_PICTURE, + VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE, + true, + PIPE_FORMAT_VUYX); +} diff --git a/src/gallium/drivers/r600/r600_video_context.h b/src/gallium/drivers/r600/r600_video_context.h new file mode 100644 index 00000000000..bda33a00d44 --- /dev/null +++ b/src/gallium/drivers/r600/r600_video_context.h @@ -0,0 +1,11 @@ +#ifndef __R600_VIDEO_CONTEXT_H__ +#define __R600_VIDEO_CONTEXT_H__ + +#include <pipe/p_video_context.h> + +struct pipe_video_context * +r600_video_create(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_chroma_format chroma_format, + unsigned width, unsigned height, void *priv); + +#endif diff --git a/src/gallium/drivers/softpipe/sp_video_context.c b/src/gallium/drivers/softpipe/sp_video_context.c index a8c1b14428f..f39c46e596c 100644 --- a/src/gallium/drivers/softpipe/sp_video_context.c +++ b/src/gallium/drivers/softpipe/sp_video_context.c @@ -98,8 +98,13 @@ sp_mpeg12_is_format_supported(struct pipe_video_context *vpipe, if (geom & PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO) return FALSE; +<<<<<<< HEAD return ctx->pipe->screen->is_format_supported(ctx->pipe->screen, format, PIPE_TEXTURE_2D, 1, usage, geom); +======= + return ctx->pipe->screen->is_format_supported(ctx->pipe->screen, format, PIPE_TEXTURE_2D, + 0, usage, geom); +>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97 } static void @@ -133,6 +138,7 @@ sp_mpeg12_clear_render_target(struct pipe_video_context *vpipe, unsigned width, unsigned height) { struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe; + float rgba[4] = { 0, 0, 0, 0 }; assert(vpipe); assert(dst); @@ -158,10 +164,27 @@ sp_mpeg12_resource_copy_region(struct pipe_video_context *vpipe, assert(vpipe); assert(dst); +<<<<<<< HEAD if (ctx->pipe->resource_copy_region) ctx->pipe->resource_copy_region(ctx->pipe, dst, subdst, dstx, dsty, dstz, src, subsrc, srcx, srcy, srcz, width, height); else util_resource_copy_region(ctx->pipe, dst, subdst, dstx, dsty, dstz, src, subsrc, srcx, srcy, srcz, width, height); +======= + struct pipe_subresource subdst, subsrc; + subdst.face = dst->face; + subdst.level = dst->level; + subsrc.face = src->face; + subsrc.level = src->level; + + if (ctx->pipe->resource_copy_region) + ctx->pipe->resource_copy_region(ctx->pipe, dst->texture, subdst, dstx, dsty, dst->zslice, + src->texture, subsrc, srcx, srcy, src->zslice, + width, height); + else + util_resource_copy_region(ctx->pipe, dst->texture, subdst, dstx, dsty, dst->zslice, + src->texture, subsrc, srcx, srcy, src->zslice, + width, height); +>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97 } static struct pipe_transfer* @@ -339,12 +362,22 @@ init_pipe_state(struct sp_mpeg12_context *ctx) assert(ctx); + memset(&rast, 0, sizeof rast); rast.flatshade = 1; rast.flatshade_first = 0; rast.light_twoside = 0; +<<<<<<< HEAD rast.cull_face = PIPE_FACE_FRONT; rast.fill_front = PIPE_POLYGON_MODE_FILL; rast.fill_back = PIPE_POLYGON_MODE_FILL; +======= + rast.front_ccw = 1; + rast.cull_face = PIPE_FACE_NONE; + rast.fill_back = PIPE_POLYGON_MODE_FILL; + rast.fill_front = PIPE_POLYGON_MODE_FILL; + rast.offset_point = 0; + rast.offset_line = 0; +>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97 rast.scissor = 0; rast.poly_smooth = 0; rast.poly_stipple_enable = 0; @@ -367,7 +400,11 @@ init_pipe_state(struct sp_mpeg12_context *ctx) ctx->rast = ctx->pipe->create_rasterizer_state(ctx->pipe, &rast); ctx->pipe->bind_rasterizer_state(ctx->pipe, ctx->rast); +<<<<<<< HEAD +======= + memset(&blend, 0, sizeof blend); +>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97 blend.independent_blend_enable = 0; blend.rt[0].blend_enable = 0; blend.rt[0].rgb_func = PIPE_BLEND_ADD; @@ -384,6 +421,7 @@ init_pipe_state(struct sp_mpeg12_context *ctx) ctx->blend = ctx->pipe->create_blend_state(ctx->pipe, &blend); ctx->pipe->bind_blend_state(ctx->pipe, ctx->blend); + memset(&dsa, 0, sizeof dsa); dsa.depth.enabled = 0; dsa.depth.writemask = 0; dsa.depth.func = PIPE_FUNC_ALWAYS; |