diff options
author | Pierre-Eric Pelloux-Prayer <[email protected]> | 2020-02-05 10:21:20 +0100 |
---|---|---|
committer | Pierre-Eric Pelloux-Prayer <[email protected]> | 2020-02-27 10:01:31 +0100 |
commit | 24f2b0a8560f34745854bf8263fa7c2d0f95f2bc (patch) | |
tree | 775bf398b06d9e3c10cc4d5f9a0f9ca80d09ccea /src/gallium/drivers | |
parent | 87807298a307d4e38195dc04f66c26404e7cb791 (diff) |
gallium/video: remove pipe_video_buffer.chroma_format
chroma_format depends on buffer_format so use the format_to_chroma_format
helper instead of storing it next to buffer_format.
This avoids bugs where one value is changed without updating the other.
Reviewed-by: Marek Olšák <[email protected]>
Acked-by: Leo Liu <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3738>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_video.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_vp3_video.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv84_video.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/r600/radeon_vce.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_uvd_enc.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_vce.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_vcn_enc.c | 1 |
7 files changed, 3 insertions, 10 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_video.c b/src/gallium/drivers/nouveau/nouveau_video.c index 9394a653769..5c94686625f 100644 --- a/src/gallium/drivers/nouveau/nouveau_video.c +++ b/src/gallium/drivers/nouveau/nouveau_video.c @@ -782,7 +782,7 @@ nouveau_video_buffer_create(struct pipe_context *pipe, screen->device->chipset < 0x40) return vl_video_buffer_create(pipe, templat); - assert(templat->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420); + assert(pipe_format_to_chroma_format(templat->buffer_format) == PIPE_VIDEO_CHROMA_FORMAT_420); width = align(templat->width, 64); height = align(templat->height, 64); @@ -795,7 +795,6 @@ nouveau_video_buffer_create(struct pipe_context *pipe, buffer->base.get_sampler_view_planes = nouveau_video_buffer_sampler_view_planes; buffer->base.get_sampler_view_components = nouveau_video_buffer_sampler_view_components; buffer->base.get_surfaces = nouveau_video_buffer_surfaces; - buffer->base.chroma_format = templat->chroma_format; buffer->base.buffer_format = templat->buffer_format; buffer->base.width = width; buffer->base.height = height; diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.c b/src/gallium/drivers/nouveau/nouveau_vp3_video.c index 7c5ae25736d..b28d31e0079 100644 --- a/src/gallium/drivers/nouveau/nouveau_vp3_video.c +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.c @@ -89,7 +89,7 @@ nouveau_vp3_video_buffer_create(struct pipe_context *pipe, return vl_video_buffer_create(pipe, templat); assert(templat->interlaced); - assert(templat->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420); + assert(pipe_format_to_chroma_format(templat->buffer_format) == PIPE_VIDEO_CHROMA_FORMAT_420); buffer = CALLOC_STRUCT(nouveau_vp3_video_buffer); if (!buffer) @@ -98,7 +98,6 @@ nouveau_vp3_video_buffer_create(struct pipe_context *pipe, buffer->base.buffer_format = templat->buffer_format; buffer->base.context = pipe; buffer->base.destroy = nouveau_vp3_video_buffer_destroy; - buffer->base.chroma_format = templat->chroma_format; buffer->base.width = templat->width; buffer->base.height = templat->height; buffer->base.get_sampler_view_planes = nouveau_vp3_video_buffer_sampler_view_planes; diff --git a/src/gallium/drivers/nouveau/nv50/nv84_video.c b/src/gallium/drivers/nouveau/nv50/nv84_video.c index 927f7a29f8e..0b5ebd48cc9 100644 --- a/src/gallium/drivers/nouveau/nv50/nv84_video.c +++ b/src/gallium/drivers/nouveau/nv50/nv84_video.c @@ -619,7 +619,7 @@ nv84_video_buffer_create(struct pipe_context *pipe, debug_printf("Require interlaced video buffers\n"); return NULL; } - if (template->chroma_format != PIPE_VIDEO_CHROMA_FORMAT_420) { + if (pipe_format_to_chroma_format(template->buffer_format) != PIPE_VIDEO_CHROMA_FORMAT_420) { debug_printf("Must use 4:2:0 format\n"); return NULL; } @@ -638,7 +638,6 @@ nv84_video_buffer_create(struct pipe_context *pipe, buffer->base.buffer_format = template->buffer_format; buffer->base.context = pipe; buffer->base.destroy = nv84_video_buffer_destroy; - buffer->base.chroma_format = template->chroma_format; buffer->base.width = template->width; buffer->base.height = template->height; buffer->base.get_sampler_view_planes = nv84_video_buffer_sampler_view_planes; diff --git a/src/gallium/drivers/r600/radeon_vce.c b/src/gallium/drivers/r600/radeon_vce.c index 16f48c69456..cd7cdb24b89 100644 --- a/src/gallium/drivers/r600/radeon_vce.c +++ b/src/gallium/drivers/r600/radeon_vce.c @@ -438,7 +438,6 @@ struct pipe_video_codec *rvce_create_encoder(struct pipe_context *context, } templat.buffer_format = PIPE_FORMAT_NV12; - templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420; templat.width = enc->base.width; templat.height = enc->base.height; templat.interlaced = false; diff --git a/src/gallium/drivers/radeon/radeon_uvd_enc.c b/src/gallium/drivers/radeon/radeon_uvd_enc.c index 639e5043543..b2b742aab9b 100644 --- a/src/gallium/drivers/radeon/radeon_uvd_enc.c +++ b/src/gallium/drivers/radeon/radeon_uvd_enc.c @@ -327,7 +327,6 @@ radeon_uvd_create_encoder(struct pipe_context *context, enc->si = &si; templat.buffer_format = PIPE_FORMAT_NV12; - templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420; templat.width = enc->base.width; templat.height = enc->base.height; templat.interlaced = false; diff --git a/src/gallium/drivers/radeon/radeon_vce.c b/src/gallium/drivers/radeon/radeon_vce.c index 521dfb40a67..66b4744a558 100644 --- a/src/gallium/drivers/radeon/radeon_vce.c +++ b/src/gallium/drivers/radeon/radeon_vce.c @@ -448,7 +448,6 @@ struct pipe_video_codec *si_vce_create_encoder(struct pipe_context *context, } templat.buffer_format = PIPE_FORMAT_NV12; - templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420; templat.width = enc->base.width; templat.height = enc->base.height; templat.interlaced = false; diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c b/src/gallium/drivers/radeon/radeon_vcn_enc.c index 9cabbd4678e..3225e9f8747 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_enc.c +++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c @@ -401,7 +401,6 @@ struct pipe_video_codec *radeon_create_encoder(struct pipe_context *context, enc->si = &si; templat.buffer_format = PIPE_FORMAT_NV12; - templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420; templat.width = enc->base.width; templat.height = enc->base.height; templat.interlaced = false; |