dm368 resize 阻塞解决办法

转自:http://e2e.ti.com/support/embedded/linux/f/354/t/132038.aspx


[This post was split from this thread V4L2 Capture buffers with old data DM368 ]

I'm seeing the same, or a similar issue using the resizer in single-shot mode on the DM365 with DVSDK 2.0.  When the ARM CPU has over 50% load, and there's lots of DMA transfers going on, occasionally the Resizer_execute function will return early, and the resized output frames will be incomplete.  Normally resizing my 720x480 NTSC source image takes 9ms, but sometimes it would take only 1-2ms.  Based on the advice in this thread, I checked the RSZ_EN register in the imp_common_isr and occasionally the resizer is still enabled when the interrupt arrives with RSZ_INT_DMA flag set in INTSTAT [1].  The interrupt doesn't fire again if I keep waiting. If I try to run the resizer again immediately after the early return, it never gets an interrupt, effectively locking up as described in that other thread.  Can anyone explain what causes the VPSS interrupt to be triggered early with RSZ_INT_DMA set?

My workaround is to poll the RSZ_EN register until clear after getting the completion event from the interrupt.  Here's the code change for DVSDK 2.0:

In drivers/char/imp_common.c:imp_common_start():

    wait_for_completion_interruptible(&(imp_serializer_info.sem_isr));

    if (!prev && cpu_is_davinci_dm365()) {
            /* under rare conditions the resizer may complete early,
             * and if we try to run it again too soon, it may lock up
             */
        while (davinci_readl(0x1c70400)) /* poll RSZ_EN until clear */
            msleep(1);
    }

Also add: #include <linux/delay.h>

[1] The SPRUFG8 document shows RSZ_INT_DMA to be bit 15 in the INTSTAT register, but the field descriptions incorrectly show bit 15 to be Reserved.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值