From: rongrong zhou Date: Wed, 4 Dec 2019 07:04:22 +0000 (+0800) Subject: v4l2: drop frames [1/3] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=68f9800990b7d23391389b51a14c865deb25893e;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git v4l2: drop frames [1/3] 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 --- diff --git a/drivers/amlogic/debug/meson_atrace.c b/drivers/amlogic/debug/meson_atrace.c index 28fe0694e177..f43c89a2399d 100644 --- a/drivers/amlogic/debug/meson_atrace.c +++ b/drivers/amlogic/debug/meson_atrace.c @@ -34,6 +34,8 @@ struct { TAG_INFO(TSYNC), TAG_INFO(IONVIDEO), TAG_INFO(AMLVIDEO), + TAG_INFO(VIDEO_COMPOSER), + TAG_INFO(V4L2), { NULL, 0 } }; diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index f1dc6566f677..f80ff39169c7 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -1529,6 +1529,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", diff --git a/drivers/amlogic/media/video_processor/video_composer/video_composer.c b/drivers/amlogic/media/video_processor/video_composer/video_composer.c index 9c1c56330fb7..e70acd190708 100644 --- a/drivers/amlogic/media/video_processor/video_composer/video_composer.c +++ b/drivers/amlogic/media/video_processor/video_composer/video_composer.c @@ -30,6 +30,9 @@ #include #include "video_composer.h" +#define KERNEL_ATRACE_TAG KERNEL_ATRACE_TAG_VIDEO_COMPOSER +#include + #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) @@ -1394,12 +1398,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", diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 6e2fbfc07d7d..ab0b40f7aace 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -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; diff --git a/include/trace/events/meson_atrace.h b/include/trace/events/meson_atrace.h index ec5d50255c95..cb277a4f28d6 100644 --- a/include/trace/events/meson_atrace.h +++ b/include/trace/events/meson_atrace.h @@ -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 };