mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
media: hantro: HEVC: Fix auxilary buffer size calculation
SAO and FILTER buffers size depend of the bit depth. Make sure we have enough space for 10bit bitstreams. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
4bec03301e
commit
8a438580a0
@@ -104,7 +104,7 @@ static int tile_buffer_reallocate(struct hantro_ctx *ctx)
|
||||
hevc_dec->tile_bsd.cpu = NULL;
|
||||
}
|
||||
|
||||
size = VERT_FILTER_RAM_SIZE * height64 * (num_tile_cols - 1);
|
||||
size = (VERT_FILTER_RAM_SIZE * height64 * (num_tile_cols - 1) * ctx->bit_depth) / 8;
|
||||
hevc_dec->tile_filter.cpu = dma_alloc_coherent(vpu->dev, size,
|
||||
&hevc_dec->tile_filter.dma,
|
||||
GFP_KERNEL);
|
||||
@@ -112,7 +112,7 @@ static int tile_buffer_reallocate(struct hantro_ctx *ctx)
|
||||
goto err_free_tile_buffers;
|
||||
hevc_dec->tile_filter.size = size;
|
||||
|
||||
size = VERT_SAO_RAM_SIZE * height64 * (num_tile_cols - 1);
|
||||
size = (VERT_SAO_RAM_SIZE * height64 * (num_tile_cols - 1) * ctx->bit_depth) / 8;
|
||||
hevc_dec->tile_sao.cpu = dma_alloc_coherent(vpu->dev, size,
|
||||
&hevc_dec->tile_sao.dma,
|
||||
GFP_KERNEL);
|
||||
|
||||
Reference in New Issue
Block a user