From 35680bfea1d0e2fe8ee4504cf1e4ae4aa747b766 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 18 Sep 2019 20:48:15 -0400 Subject: vl: use u_format in vl_video_buffer_formats Reviewed-by: Bas Nieuwenhuizen --- src/gallium/drivers/r600/r600_uvd.c | 6 ++---- src/gallium/drivers/radeonsi/si_uvd.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r600/r600_uvd.c b/src/gallium/drivers/r600/r600_uvd.c index ca4248aed69..2e7d7ee4d40 100644 --- a/src/gallium/drivers/r600/r600_uvd.c +++ b/src/gallium/drivers/r600/r600_uvd.c @@ -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; diff --git a/src/gallium/drivers/radeonsi/si_uvd.c b/src/gallium/drivers/radeonsi/si_uvd.c index 19d1b09f1c1..1469b6ac7f1 100644 --- a/src/gallium/drivers/radeonsi/si_uvd.c +++ b/src/gallium/drivers/radeonsi/si_uvd.c @@ -44,7 +44,7 @@ struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe, struct si_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[VL_NUM_COMPONENTS]; struct pipe_video_buffer vidtemplate; struct pipe_resource templ; unsigned i, array_size; @@ -52,9 +52,7 @@ struct pipe_video_buffer *si_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; vidtemplate = *tmpl; -- cgit v1.2.3