author | Hui Zhang <hui.zhang@amlogic.com> | 2020-03-19 05:50:31 (GMT) |
---|---|---|
committer | Hui Zhang <hui.zhang@amlogic.com> | 2020-03-21 06:13:33 (GMT) |
commit | bbfb6d507c8689eddaaecd96648bdf593196e9b1 (patch) | |
tree | 5c7d6306509afe7e475b06bb93bf42c6ac009b7e | |
parent | 9725693635142a93013f884674a5b62e0916e356 (diff) | |
download | media_modules-bbfb6d507c8689eddaaecd96648bdf593196e9b1.zip media_modules-bbfb6d507c8689eddaaecd96648bdf593196e9b1.tar.gz media_modules-bbfb6d507c8689eddaaecd96648bdf593196e9b1.tar.bz2 |
vmh264: fixed h264 ar changed issue. [1/2]
PD#SWPL-22711
Problem:
h264 ratio be changed wrongly by driver
Solution:
use a tmp variable for h264_ar in dec_status()
Verify:
u212
Change-Id: I2c37ca127936c63ffd3857609f533e51a6aa8eff
Signed-off-by: Hui Zhang <hui.zhang@amlogic.com>
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/vmh264.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c index c689f5f..d4a051b 100644 --- a/drivers/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c @@ -6865,7 +6865,7 @@ static void check_timer_func(unsigned long arg) static int dec_status(struct vdec_s *vdec, struct vdec_info *vstatus) { - u32 ar; + u32 ar, ar_tmp; struct vdec_h264_hw_s *hw = (struct vdec_h264_hw_s *)vdec->private; if (!hw) @@ -6882,11 +6882,13 @@ static int dec_status(struct vdec_s *vdec, struct vdec_info *vstatus) vstatus->error_count = 0; vstatus->status = hw->stat; if (hw->h264_ar == 0x3ff) - hw->h264_ar = (0x100 * + ar_tmp = (0x100 * hw->frame_height * hw->height_aspect_ratio) / (hw->frame_width * hw->width_aspect_ratio); + else + ar_tmp = hw->h264_ar; ar = min_t(u32, - hw->h264_ar, + ar_tmp, DISP_RATIO_ASPECT_RATIO_MAX); vstatus->ratio_control = ar << DISP_RATIO_ASPECT_RATIO_BIT; |