r600/sfn: Make the pin_to_channel generic
[mesa.git] / src / gallium / drivers / r600 / r600_uvd.c
index 28551e2daadfd3a0c93edc57b16e9ce629872e4d..2e7d7ee4d40419407f43e644c32a83568d36ec4b 100644 (file)
@@ -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;
@@ -162,7 +160,7 @@ static struct pb_buffer* r600_uvd_set_dtb(struct ruvd_msg *msg, struct vl_video_
        msg->body.decode.dt_field_mode = buf->base.interlaced;
        msg->body.decode.dt_surf_tile_config |= RUVD_NUM_BANKS(eg_num_banks(rscreen->b.info.r600_num_banks));
 
-       ruvd_set_dt_surfaces(msg, &luma->surface, &chroma->surface, RUVD_SURFACE_TYPE_LEGACY);
+       ruvd_set_dt_surfaces(msg, &luma->surface, &chroma->surface);
 
        return luma->resource.buf;
 }