video: rockchip: vcodec: add log message in iommu drm
authorJung Zhao <jung.zhao@rock-chips.com>
Tue, 20 Dec 2016 00:50:28 +0000 (08:50 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 20 Dec 2016 13:03:26 +0000 (21:03 +0800)
Change-Id: If66e7654d87c790977378630824d582f2f4c4ffa
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
drivers/video/rockchip/vcodec/vcodec_iommu_drm.c
drivers/video/rockchip/vcodec/vcodec_iommu_ops.h

index d10e2e0..37559dd 100644 (file)
@@ -282,6 +282,8 @@ static int vcodec_drm_free(struct vcodec_iommu_session_info *session_info,
                list_del_init(&drm_buffer->list);
                kfree(drm_buffer);
                session_info->buffer_nums--;
+               vpu_iommu_debug(session_info->debug_level, DEBUG_IOMMU_NORMAL,
+                       "buffer nums %d\n", session_info->buffer_nums);
        }
        mutex_unlock(&session_info->list_mutex);
 
@@ -393,6 +395,8 @@ vcodec_drm_free_fd(struct vcodec_iommu_session_info *session_info, int fd)
                list_del_init(&drm_buffer->list);
                kfree(drm_buffer);
                session_info->buffer_nums--;
+               vpu_iommu_debug(session_info->debug_level, DEBUG_IOMMU_NORMAL,
+                       "buffer nums %d\n", session_info->buffer_nums);
        }
        mutex_unlock(&session_info->list_mutex);
 
@@ -513,6 +517,8 @@ static int vcodec_drm_import(struct vcodec_iommu_session_info *session_info,
        INIT_LIST_HEAD(&drm_buffer->list);
        mutex_lock(&session_info->list_mutex);
        session_info->buffer_nums++;
+       vpu_iommu_debug(session_info->debug_level, DEBUG_IOMMU_NORMAL,
+                       "buffer nums %d\n", session_info->buffer_nums);
        if (session_info->buffer_nums > BUFFER_LIST_MAX_NUMS) {
                list_for_each_entry_safe(loop_buffer, n,
                                 &session_info->buffer_list, list) {
index 46c721a..807ad2f 100644 (file)
@@ -25,6 +25,7 @@
 #define ALLOCATOR_USE_DRM              0x00000001
 
 #define DEBUG_IOMMU_OPS_DUMP   0x00020000
+#define DEBUG_IOMMU_NORMAL     0x00040000
 
 #define vpu_iommu_debug_func(debug_level, type, fmt, args...)  \
        do {                                                    \