r600/sfn: Make the pin_to_channel generic
[mesa.git] / src / gallium / drivers / r600 / r600_uvd.c
index 0c9283457739bea5576c059e56121991b900736a..2e7d7ee4d40419407f43e644c32a83568d36ec4b 100644 (file)
@@ -45,9 +45,9 @@
 #include "vl/vl_mpeg12_decoder.h"
 
 #include "r600_pipe.h"
-#include "radeon/radeon_video.h"
-#include "radeon/radeon_uvd.h"
-#include "radeon/radeon_vce.h"
+#include "radeon_video.h"
+#include "radeon_uvd.h"
+#include "radeon_vce.h"
 #include "r600d.h"
 
 #define R600_UVD_ENABLE_TILING 0
@@ -62,7 +62,7 @@ struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
        struct r600_texture *resources[VL_NUM_COMPONENTS] = {};
        struct radeon_surf* surfaces[VL_NUM_COMPONENTS] = {};
        struct pb_buffer **pbs[VL_NUM_COMPONENTS] = {};
-       const enum pipe_format *resource_formats;
+       enum pipe_format resource_formats[3];
        struct pipe_video_buffer template;
        struct pipe_resource templ;
        unsigned i, array_size;
@@ -70,9 +70,7 @@ struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
        assert(pipe);
 
        /* first create the needed resources as "normal" textures */
-       resource_formats = vl_video_buffer_formats(pipe->screen, tmpl->buffer_format);
-       if (!resource_formats)
-               return NULL;
+       vl_get_video_buffer_formats(pipe->screen, tmpl->buffer_format, resource_formats);
 
        array_size = tmpl->interlaced ? 2 : 1;
        template = *tmpl;
@@ -115,7 +113,7 @@ struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
                surfaces[i] = &resources[i]->surface;
        }
 
-       rvid_join_surfaces(ctx->b.ws, templ.bind, pbs, surfaces);
+       rvid_join_surfaces(&ctx->b, pbs, surfaces);
 
        for (i = 0; i < VL_NUM_COMPONENTS; ++i) {
                if (!resources[i])
@@ -131,7 +129,7 @@ struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
 
 error:
        for (i = 0; i < VL_NUM_COMPONENTS; ++i)
-               pipe_resource_reference((struct pipe_resource **)&resources[i], NULL);
+               r600_texture_reference(&resources[i], NULL);
 
        return NULL;
 }