]> git.baikalelectronics.ru Git - kernel.git/commit
media: hantro: Avoid global variable for jpeg quantization tables
authorJames Cowgill <james.cowgill@blaize.com>
Thu, 11 Nov 2021 22:01:08 +0000 (23:01 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 30 Nov 2021 11:08:23 +0000 (12:08 +0100)
commit17753ba658ed7c3fa82402d8f441a3cd41f59442
tree134cb3fe65b88ccd32410922a6f61b87677d7182
parentd578ce678ba65e9842acef2745b61484ced1f086
media: hantro: Avoid global variable for jpeg quantization tables

On a system with multiple encoders present, it's possible for two
encoders to write to the global luma and chroma quantization tables at
the same time if they both submit a JPEG frame to be encoded. Avoid
this race by moving the tables into the `jpeg_ctx` structure which is
stored on the stack.

Signed-off-by: James Cowgill <james.cowgill@blaize.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
drivers/staging/media/hantro/hantro_jpeg.c
drivers/staging/media/hantro/hantro_jpeg.h
drivers/staging/media/hantro/rockchip_vpu2_hw_jpeg_enc.c