Skip to content
Commit 1620531a authored by Fei Shao's avatar Fei Shao Committed by Greg Kroah-Hartman
Browse files

media: mtk-jpegenc: Fix bug in JPEG encode quality selection

[ Upstream commit 0aeccc63 ]

The driver uses the upper-bound approach to decide the target JPEG
encode quality, but there's a logic bug that if the desired quality is
higher than what the driver can support, the driver falls back to using
the worst quality.

Fix the bug by assuming using the best quality in the beginning, and
with trivial refactor to avoid long lines.

Fixes: 45f13a57

 ("media: platform: Add jpeg enc feature")
Signed-off-by: default avatarFei Shao <fshao@chromium.org>
Reviewed-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b75fb8a2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment