v4l2: drop frames [1/3]
authorrongrong zhou <rongrong.zhou@amlogic.com>
Wed, 4 Dec 2019 07:04:22 +0000 (15:04 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 13 Dec 2019 06:02:16 +0000 (23:02 -0700)
PD#SWPL-17328

Problem:
drop frames

Solution:
1. add trace for debug
2. less than 256K, do not use codec_mm allocation
3. osd fence crash

Verify:
local

Change-Id: I3df0a1532b920570365e66cc48d81253831897c0
Signed-off-by: rongrong zhou <rongrong.zhou@amlogic.com>
drivers/amlogic/debug/meson_atrace.c
drivers/amlogic/media/osd/osd_hw.c
drivers/amlogic/media/video_processor/video_composer/video_composer.c
drivers/staging/android/ion/ion.c
include/trace/events/meson_atrace.h

index 28fe0694e177902bad48f096e7ce50b1c4f333d8..f43c89a2399d5cfff143c49293a7719c0db30f01 100644 (file)
@@ -34,6 +34,8 @@ struct {
        TAG_INFO(TSYNC),
        TAG_INFO(IONVIDEO),
        TAG_INFO(AMLVIDEO),
+       TAG_INFO(VIDEO_COMPOSER),
+       TAG_INFO(V4L2),
        { NULL, 0 }
 };
 
index 66c6b5d4c64727c2eac719390cce32d9f798fc12..727773fa75b6bb5aea3e5a1bc5d81e7e3ef2764b 100644 (file)
@@ -1530,6 +1530,9 @@ static int osd_wait_buf_ready_combine(struct layer_fence_map_s *layer_map)
        if (layer_map->in_fd <= 0)
                return -1;
        buf_ready_fence = layer_map->in_fence;
+       if (buf_ready_fence == NULL) {
+               return -1;/* no fence ,output directly. */
+       }
        ret = osd_wait_fenceobj(buf_ready_fence, 4000);
        if (ret < 0)
                osd_log_err("osd%d: Sync Fence wait error:%d\n",
index 7520e317491db8c8027d6a851cc02da19ada5738..a4bef7f2f57d049e305f5367048a06c6f69b97c0 100644 (file)
@@ -30,6 +30,9 @@
 #include <ion/ion_priv.h>
 #include "video_composer.h"
 
+#define KERNEL_ATRACE_TAG KERNEL_ATRACE_TAG_VIDEO_COMPOSER
+#include <trace/events/meson_atrace.h>
+
 #define VIDEO_COMPOSER_VERSION "1.0"
 
 #define VIDEO_COMPOSER_NAME_SIZE 32
@@ -114,6 +117,7 @@ static struct class video_composer_class = {
 #define PRINT_FENCE            0X0002
 #define PRINT_PERFORMANCE      0X0004
 #define PRINT_OTHER            0X0008
+#define PRINT_INDEX_DISP       0X0010
 
 #define to_dst_buf(vf) \
        container_of(vf, struct dst_buf_t, frame)
@@ -1398,12 +1402,15 @@ static void set_frames_info(struct composer_dev *dev,
                        file_private_data =
                        (struct file_private_data *)(file_vf->private_data);
                        vf = &file_private_data->vf;
-                       vc_print(dev->index, PRINT_OTHER,
-                                "received_cnt=%lld,i=%d,z=%d,omx_index=%d\n",
+                       vc_print(dev->index, PRINT_INDEX_DISP,
+                                "received_cnt=%lld,i=%d,z=%d,omx_index=%d, fence_fd=%d, index_disp=%d\n",
                                 dev->received_count + 1,
                                 i,
                                 frames_info->frame_info[j].zorder,
-                                vf->omx_index);
+                                vf->omx_index,
+                                fence_fd,
+                               vf->index_disp);
+                       ATRACE_COUNTER("video_composer", vf->index_disp);
                } else if (frames_info->frame_info[j].type == 1) {
                        vc_print(dev->index, PRINT_OTHER,
                                 "received_cnt=%lld,i=%d,z=%d,DMA_fd=%d\n",
index 6e2fbfc07d7dbbd9e652424895473bc118ef3aa5..ab0b40f7aace4f1a6958fb83a1b8880affaaa6f2 100644 (file)
@@ -432,6 +432,9 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
                /* if the caller didn't specify this heap id */
                if (!((1 << heap->id) & heap_id_mask))
                        continue;
+               if (len < SZ_256K && heap->id == ION_HEAP_TYPE_CUSTOM &&
+                       heap_id_mask == -1)
+                       continue;
                buffer = ion_buffer_create(heap, dev, len, align, flags);
                if (!IS_ERR(buffer))
                        break;
index ec5d50255c954da9099676f8462bd61116804331..cb277a4f28d682a2b1c4f6ccc28d6d080e2b63d1 100644 (file)
@@ -44,6 +44,8 @@ enum {
        KERNEL_ATRACE_TAG_TSYNC,
        KERNEL_ATRACE_TAG_IONVIDEO,
        KERNEL_ATRACE_TAG_AMLVIDEO,
+       KERNEL_ATRACE_TAG_VIDEO_COMPOSER,
+       KERNEL_ATRACE_TAG_V4L2,
        KERNEL_ATRACE_TAG_MAX = 64,
        KERNEL_ATRACE_TAG_ALL
 };