osd: add osd log module control [2/2]
authorPengcheng Chen <pengcheng.chen@amlogic.com>
Wed, 5 Dec 2018 05:45:55 +0000 (13:45 +0800)
committerLuan Yuan <luan.yuan@amlogic.com>
Mon, 17 Dec 2018 06:51:39 +0000 (14:51 +0800)
PD#SWPL-2551

Problem:
add osd log module control

Solution:
add osd log module control

Verify:
verified on P212

Change-Id: Iadbf795cb7afe4ddcab0f9283b9c7f542eca0b29
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
drivers/amlogic/media/osd/osd_drm.c
drivers/amlogic/media/osd/osd_fb.c
drivers/amlogic/media/osd/osd_hw.c
drivers/amlogic/media/osd/osd_io.c
drivers/amlogic/media/osd/osd_log.h
drivers/amlogic/media/osd_ext/osd_fb.c
drivers/amlogic/media/osd_ext/osd_hw.c

index 86083a8..0fe7be3 100644 (file)
@@ -115,6 +115,34 @@ static ssize_t loglevel_write_file(
        return count;
 }
 
+static ssize_t logmodule_read_file(struct file *file, char __user *userbuf,
+                                size_t count, loff_t *ppos)
+{
+       char buf[128];
+       ssize_t len;
+
+       len = snprintf(buf, 128, "%d\n", osd_log_module);
+       return simple_read_from_buffer(userbuf, count, ppos, buf, len);
+}
+
+static ssize_t logmodule_write_file(
+       struct file *file, const char __user *userbuf,
+       size_t count, loff_t *ppos)
+{
+       unsigned int log_module;
+       char buf[128];
+       int ret = 0;
+
+       count = min_t(size_t, count, (sizeof(buf)-1));
+       if (copy_from_user(buf, userbuf, count))
+               return -EFAULT;
+       buf[count] = 0;
+       ret = kstrtoint(buf, 0, &log_module);
+       osd_log_info("log_level: %d->%d\n", osd_log_module, log_module);
+       osd_log_module = log_module;
+       return count;
+}
+
 static ssize_t debug_read_file(struct file *file, char __user *userbuf,
                                 size_t count, loff_t *ppos)
 {
@@ -577,6 +605,12 @@ static const struct file_operations loglevel_file_ops = {
        .write          = loglevel_write_file,
 };
 
+static const struct file_operations logmodule_file_ops = {
+       .open           = simple_open,
+       .read           = logmodule_read_file,
+       .write          = logmodule_write_file,
+};
+
 static const struct file_operations debug_file_ops = {
        .open           = simple_open,
        .read           = debug_read_file,
@@ -671,6 +705,7 @@ struct osd_drm_debugfs_files_s {
 
 static struct osd_drm_debugfs_files_s osd_drm_debugfs_files[] = {
        {"loglevel", S_IFREG | 0640, &loglevel_file_ops},
+       {"logmodule", S_IFREG | 0640, &logmodule_file_ops},
        {"debug", S_IFREG | 0640, &debug_file_ops},
        {"osd_display_debug", S_IFREG | 0640, &osd_display_debug_file_ops},
        {"reset_status", S_IFREG | 0440, &reset_status_file_ops},
index ed2eebb..5ea4494 100644 (file)
@@ -356,6 +356,8 @@ static struct delayed_work osd_dwork;
 static int osd_shutdown_flag;
 
 unsigned int osd_log_level;
+unsigned int osd_log_module = 1;
+
 int int_viu_vsync = -ENXIO;
 int int_viu2_vsync = -ENXIO;
 int int_rdma = INT_RDMA;
@@ -535,7 +537,7 @@ _find_color_format(struct fb_var_screeninfo *var)
            || (var->blue.length == 0) ||
            var->bits_per_pixel != (var->red.length + var->green.length +
                    var->blue.length + var->transp.length)) {
-               osd_log_dbg("not provide color length, use default color\n");
+               osd_log_dbg(MODULE_BASE, "not provide color length, use default color\n");
                found = &default_color_format_array[upper_margin];
        } else {
                for (i = upper_margin; i >= lower_margin; i--) {
@@ -605,7 +607,7 @@ static int osd_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
        if (color_format_pt == NULL || color_format_pt->color_index == 0)
                return -EFAULT;
 
-       osd_log_dbg("select color format :index %d, bpp %d\n",
+       osd_log_dbg(MODULE_BASE, "select color format :index %d, bpp %d\n",
                    color_format_pt->color_index,
                    color_format_pt->bpp);
        fbdev->color = color_format_pt;
@@ -622,7 +624,7 @@ static int osd_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
        var->transp.length = color_format_pt->transp_length;
        var->transp.msb_right = color_format_pt->transp_msb_right;
        var->bits_per_pixel = color_format_pt->bpp;
-       osd_log_dbg("rgba(L/O):%d/%d-%d/%d-%d/%d-%d/%d\n",
+       osd_log_dbg(MODULE_BASE, "rgba(L/O):%d/%d-%d/%d-%d/%d-%d/%d\n",
                    var->red.length, var->red.offset,
                    var->green.length, var->green.offset,
                    var->blue.length, var->blue.offset,
@@ -630,7 +632,7 @@ static int osd_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
        fix->visual = color_format_pt->color_type;
        /* adjust memory length. */
        fix->line_length = var->xres_virtual * var->bits_per_pixel / 8;
-       osd_log_dbg("xvirtual=%d, bpp:%d, line_length=%d\n",
+       osd_log_dbg(MODULE_BASE, "xvirtual=%d, bpp:%d, line_length=%d\n",
                var->xres_virtual, var->bits_per_pixel, fix->line_length);
 
        if (var->xres_virtual < var->xres)
@@ -866,7 +868,8 @@ static int osd_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
                case COLOR_INDEX_24_888_B:
                case COLOR_INDEX_24_RGB:
                case COLOR_INDEX_YUV_422:
-                       osd_log_dbg("set osd color key 0x%x\n", src_colorkey);
+                       osd_log_dbg(MODULE_BASE,
+                               "set osd color key 0x%x\n", src_colorkey);
                        fbdev->color_key = src_colorkey;
                        osd_set_color_key_hw(info->node,
                                fbdev->color->color_index, src_colorkey);
@@ -883,7 +886,7 @@ static int osd_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
                case COLOR_INDEX_24_888_B:
                case COLOR_INDEX_24_RGB:
                case COLOR_INDEX_YUV_422:
-                       osd_log_dbg("set osd color key %s\n",
+                       osd_log_dbg(MODULE_BASE, "set osd color key %s\n",
                                        srckey_enable ? "enable" : "disable");
                        if (srckey_enable != 0) {
                                fbdev->enable_key_flag |= KEYCOLOR_FLAG_TARGET;
@@ -1262,7 +1265,7 @@ static int malloc_osd_memory(struct fb_info *info)
                                osd_log_err("fb[%d] ioremap error", fb_index);
                        pr_info("%s, reserved mem\n", __func__);
 #endif
-                       osd_log_dbg("fb_index=%d dma_alloc=%zu\n",
+                       osd_log_dbg(MODULE_BASE, "fb_index=%d dma_alloc=%zu\n",
                                fb_index, fb_rmem_size[fb_index]);
                }
        } else {
@@ -1447,7 +1450,7 @@ static int osd_open(struct fb_info *info, int arg)
 
        fbdev = (struct osd_fb_dev_s *)info->par;
        fbdev->open_count++;
-       osd_log_dbg("osd_open index=%d,open_count=%d\n",
+       osd_log_dbg(MODULE_BASE, "osd_open index=%d,open_count=%d\n",
                fbdev->fb_index, fbdev->open_count);
        if (info->screen_base != NULL)
                return 0;
@@ -1583,7 +1586,7 @@ static int osd_pan_display(struct fb_var_screeninfo *var,
                           struct fb_info *fbi)
 {
        osd_pan_display_hw(fbi->node, var->xoffset, var->yoffset);
-       osd_log_dbg("osd_pan_display:=>osd%d xoff=%d, yoff=%d\n",
+       osd_log_dbg(MODULE_BASE, "osd_pan_display:=>osd%d xoff=%d, yoff=%d\n",
                        fbi->node, var->xoffset, var->yoffset);
        return 0;
 }
@@ -1740,7 +1743,7 @@ int osd_notify_callback(struct notifier_block *block, unsigned long cmd,
                        */
                        fb_dev->osd_ctl.disp_start_x = disp_rect->x;
                        fb_dev->osd_ctl.disp_start_y = disp_rect->y;
-                       osd_log_dbg("set disp axis: x:%d y:%d w:%d h:%d\n",
+                       osd_log_dbg(MODULE_BASE, "set disp axis: x:%d y:%d w:%d h:%d\n",
                                    disp_rect->x, disp_rect->y,
                                    disp_rect->w, disp_rect->h);
                        if (disp_rect->x + disp_rect->w > vinfo->width)
@@ -1756,7 +1759,7 @@ int osd_notify_callback(struct notifier_block *block, unsigned long cmd,
                                        fb_dev->osd_ctl.disp_start_y +
                                        disp_rect->h - 1;
                        disp_rect++;
-                       osd_log_dbg("new disp axis: x0:%d y0:%d x1:%d y1:%d\n",
+                       osd_log_dbg(MODULE_BASE, "new disp axis: x0:%d y0:%d x1:%d y1:%d\n",
                                    fb_dev->osd_ctl.disp_start_x,
                                    fb_dev->osd_ctl.disp_start_y,
                                    fb_dev->osd_ctl.disp_end_x,
@@ -1929,7 +1932,7 @@ int osd_notify_callback_viu2(struct notifier_block *block, unsigned long cmd,
                 */
                fb_dev->osd_ctl.disp_start_x = disp_rect->x;
                fb_dev->osd_ctl.disp_start_y = disp_rect->y;
-               osd_log_dbg("set disp axis: x:%d y:%d w:%d h:%d\n",
+               osd_log_dbg(MODULE_BASE, "set disp axis: x:%d y:%d w:%d h:%d\n",
                        disp_rect->x, disp_rect->y,
                        disp_rect->w, disp_rect->h);
                if (disp_rect->x + disp_rect->w > vinfo->width)
@@ -1944,7 +1947,7 @@ int osd_notify_callback_viu2(struct notifier_block *block, unsigned long cmd,
                        fb_dev->osd_ctl.disp_end_y =
                                fb_dev->osd_ctl.disp_start_y +
                                disp_rect->h - 1;
-               osd_log_dbg("new disp axis: x0:%d y0:%d x1:%d y1:%d\n",
+               osd_log_dbg(MODULE_BASE, "new disp axis: x0:%d y0:%d x1:%d y1:%d\n",
                        fb_dev->osd_ctl.disp_start_x,
                        fb_dev->osd_ctl.disp_start_y,
                        fb_dev->osd_ctl.disp_end_x,
@@ -2413,6 +2416,27 @@ static ssize_t store_log_level(struct device *device,
        return count;
 }
 
+static ssize_t show_log_module(struct device *device,
+                         struct device_attribute *attr,
+                         char *buf)
+{
+       return snprintf(buf, 40, "0x%x\n", osd_log_module);
+}
+
+static ssize_t store_log_module(struct device *device,
+                          struct device_attribute *attr,
+                          const char *buf, size_t count)
+{
+       int res = 0;
+       int ret = 0;
+
+       ret = kstrtoint(buf, 0, &res);
+       osd_log_info("log_module: 0x%x->0x%x\n", osd_log_module, res);
+       osd_log_module = res;
+
+       return count;
+}
+
 static ssize_t store_order(struct device *device, struct device_attribute *attr,
                           const char *buf, size_t count)
 {
@@ -3194,6 +3218,8 @@ static struct device_attribute osd_attrs[] = {
                        show_debug, store_debug),
        __ATTR(log_level, 0644,
                        show_log_level, store_log_level),
+       __ATTR(log_module, 0644,
+                       show_log_module, store_log_module),
        __ATTR(window_axis, 0664,
                        show_window_axis, store_window_axis),
        __ATTR(freescale_mode, 0664,
@@ -3264,6 +3290,8 @@ static struct device_attribute osd_attrs_viu2[] = {
                        show_debug, store_debug),
        __ATTR(log_level, 0644,
                        show_log_level, store_log_level),
+       __ATTR(log_module, 0644,
+                       show_log_module, store_log_module),
        __ATTR(flush_rate, 0444,
                        show_flush_rate, NULL),
        __ATTR(osd_reverse, 0644,
@@ -3705,7 +3733,6 @@ static int osd_probe(struct platform_device *pdev)
                } else
                        osd_log_info("viu2 vsync irq: %d\n", int_viu2_vsync);
        }
-
        if (osd_meson_dev.has_rdma) {
                int_rdma = platform_get_irq_byname(pdev, "rdma");
                if (int_viu_vsync  == -ENXIO) {
@@ -3772,7 +3799,7 @@ static int osd_probe(struct platform_device *pdev)
                                        pr_err("allocate buffer failed:%d\n",
                                                fb_memsize[0]);
                                }
-                               osd_log_dbg("logo dma_alloc=%d\n",
+                               osd_log_dbg(MODULE_BASE, "logo dma_alloc=%d\n",
                                        fb_memsize[0]);
                        }
                } else
index 1d10d04..db97a3e 100644 (file)
@@ -82,8 +82,6 @@
 #define OSD_TYPE_BOT_FIELD 1
 
 #define OSD_DISP_DEBUG    1
-#define ENCP_LINE_VSYNC   15
-#define ENCP_LINE         16
 #define OSD_OLD_HWC         (0x01 << 0)
 #define OSD_OTHER_NEW_HWC   (0x01 << 1)
 #define OSD_G12A_NEW_HWC    (0x01 << 2)
@@ -1091,7 +1089,7 @@ static int sync_render_layers_fence(u32 index, u32 yres,
        fence_map->layer_map[index].out_fd =
                out_fence_create(&out_fence_fd);
        mutex_unlock(&post_fence_list_lock);
-       osd_log_dbg("sync_render_layers_fence:osd%d: ind_fd=%d,out_fd=%d\n",
+       osd_log_dbg(MODULE_FENCE, "sync_render_layers_fence:osd%d: ind_fd=%d,out_fd=%d\n",
                fence_map->layer_map[index].fb_index,
                fence_map->layer_map[index].in_fd,
                fence_map->layer_map[index].out_fd);
@@ -1109,8 +1107,7 @@ int osd_sync_request_render(u32 index, u32 yres,
 
        cnt++;
        line = get_encp_line();
-       if (osd_hw.osd_display_debug == ENCP_LINE)
-               osd_log_info(
+       osd_log_dbg2(MODULE_RENDER,
                        "enter osd_sync_request_render:cnt=%d,encp line=%d\n",
                        cnt, line);
        if (request->magic == FB_SYNC_REQUEST_RENDER_MAGIC_V1)
@@ -1133,10 +1130,9 @@ int osd_sync_do_hwc(struct do_hwc_cmd_s *hwc_cmd)
        int line;
 
        line = get_encp_line();
-       if (osd_hw.osd_display_debug == ENCP_LINE)
-               osd_log_info(
-                       "enter osd_sync_do_hwc:cnt=%d,encp line=%d\n",
-                       cnt, line);
+       osd_log_dbg2(MODULE_RENDER,
+               "enter osd_sync_do_hwc:cnt=%d,encp line=%d\n",
+               cnt, line);
        fence_map = kzalloc(
                sizeof(struct osd_layers_fence_map_s), GFP_KERNEL);
        if (!fence_map)
@@ -1183,7 +1179,7 @@ int osd_sync_do_hwc(struct do_hwc_cmd_s *hwc_cmd)
                        set_logo_loaded();
                }
        }
-       osd_log_dbg("osd_sync_do_hwc :out_fence_fd=%d\n",
+       osd_log_dbg(MODULE_FENCE, "osd_sync_do_hwc :out_fence_fd=%d\n",
                out_fence_fd);
        return out_fence_fd;
 }
@@ -1225,7 +1221,7 @@ static int osd_wait_buf_ready_combine(struct layer_fence_map_s *layer_map)
        else
                ret = 1;
 
-       osd_log_dbg("osd_wait_buf_ready_combine:osd%d,in_fd=%d\n",
+       osd_log_dbg(MODULE_FENCE, "osd_wait_buf_ready_combine:osd%d,in_fd=%d\n",
                layer_map->fb_index, layer_map->in_fd);
        return ret;
 }
@@ -1269,7 +1265,7 @@ void osd_set_enable_hw(u32 index, u32 enable)
                        map_layers.layer_map[index].enable = enable;
                        map_layers.cmd = BLANK_CMD;
                        mutex_unlock(&post_fence_list_lock);
-                       osd_log_dbg("osd_set_enable_hw: osd%d,enable=%d\n",
+                       osd_log_dbg(MODULE_BASE, "osd_set_enable_hw: osd%d,enable=%d\n",
                                index, enable);
 #endif
                }
@@ -1612,7 +1608,7 @@ static bool mali_afbc_get_error(void)
 
        status = VSYNCOSD_RD_MPEG_REG(VPU_MAFBC_IRQ_RAW_STATUS);
        if (status & 0x3c) {
-               osd_log_dbg("afbc error happened\n");
+               osd_log_dbg(MODULE_BASE, "afbc error happened\n");
                osd_hw.afbc_err_cnt++;
                error = true;
        }
@@ -2098,8 +2094,9 @@ void osd_set_color_key_hw(u32 index, u32 color_index, u32 colorkey)
        data32 = r << 24 | g << 16 | b << 8 | a;
        if (osd_hw.color_key[index] != data32) {
                osd_hw.color_key[index] = data32;
-               osd_log_dbg2("bpp:%d--r:0x%x g:0x%x b:0x%x ,a:0x%x\n",
-                               color_index, r, g, b, a);
+               osd_log_dbg2(MODULE_BASE,
+                       "bpp:%d--r:0x%x g:0x%x b:0x%x ,a:0x%x\n",
+                       color_index, r, g, b, a);
                add_to_update_list(index, OSD_COLOR_KEY);
                osd_wait_vsync_hw();
        }
@@ -2888,7 +2885,7 @@ void osd_clone_pan(u32 index, u32 yoffset, int debug_flag)
                osd_hw.pandata[OSD2].y_end = offset + height_osd1 - 1;
                if (osd_hw.angle[OSD2]) {
                        if (debug_flag)
-                               osd_log_dbg("++ osd_clone_pan start when enable clone\n");
+                               osd_log_dbg(MODULE_BASE, "++ osd_clone_pan start when enable clone\n");
                        osd_clone_update_pan(osd0_buffer_number);
                }
                add_to_update_list(OSD2, DISP_GEOMETRY);
@@ -3748,17 +3745,20 @@ static bool osd_direct_compose_pan_display(struct osd_fence_map_s *fence_map)
                                osd_set_dummy_data(index, 0);
                        else
                                osd_set_dummy_data(index, 0xff);
-                       osd_log_dbg("direct pandata x=%d,x_end=%d,y=%d,y_end=%d,width=%d,height=%d\n",
+                       osd_log_dbg(MODULE_BASE,
+                               "direct pandata x=%d,x_end=%d,y=%d,y_end=%d,width=%d,height=%d\n",
                                osd_hw.pandata[index].x_start,
                                osd_hw.pandata[index].x_end,
                                osd_hw.pandata[index].y_start,
                                osd_hw.pandata[index].y_end,
                                fence_map->width,
                                fence_map->height);
-                       osd_log_dbg("fence_map:xoffset=%d,yoffset=%d\n",
+                       osd_log_dbg(MODULE_BASE,
+                               "fence_map:xoffset=%d,yoffset=%d\n",
                                fence_map->xoffset,
                                fence_map->yoffset);
-                       osd_log_dbg("fence_map:dst_x=%d,dst_y=%d,dst_w=%d,dst_h=%d,byte_stride=%d\n",
+                       osd_log_dbg(MODULE_BASE,
+                               "fence_map:dst_x=%d,dst_y=%d,dst_w=%d,dst_h=%d,byte_stride=%d\n",
                                fence_map->dst_x,
                                fence_map->dst_y,
                                fence_map->dst_w,
@@ -3831,7 +3831,7 @@ static void osd_pan_display_single_fence(struct osd_fence_map_s *fence_map)
        if (timeline_created) { /* out fence created success. */
                ret = osd_wait_buf_ready(fence_map);
                if (ret < 0)
-                       osd_log_dbg("fence wait ret %d\n", ret);
+                       osd_log_dbg(MODULE_BASE, "fence wait ret %d\n", ret);
        }
        if (ret) {
                osd_hw.buffer_alloc[index] = 1;
@@ -3958,7 +3958,8 @@ static void osd_pan_display_single_fence(struct osd_fence_map_s *fence_map)
                                        &osd_hw.free_dst_data_backup[index],
                                        sizeof(struct pandata_s));
                                osd_set_dummy_data(index, 0xff);
-                               osd_log_dbg("switch back dispdata_backup x=%d,x_end=%d,y=%d,y_end=%d\n",
+                               osd_log_dbg(MODULE_BASE,
+                                       "switch back dispdata_backup x=%d,x_end=%d,y=%d,y_end=%d\n",
                                        osd_hw.dispdata_backup[index].x_start,
                                        osd_hw.dispdata_backup[index].x_end,
                                        osd_hw.dispdata_backup[index].y_start,
@@ -4275,7 +4276,8 @@ static void osd_pan_display_layers_fence(
                        && (fence_map->cmd == LAYER_SYNC)) {
                        ret = osd_wait_buf_ready_combine(layer_map);
                        if (ret < 0)
-                               osd_log_dbg("fence wait ret %d\n", ret);
+                               osd_log_dbg(MODULE_FENCE,
+                                       "fence wait ret %d\n", ret);
                }
                osd_pan_display_update_info(layer_map);
                save_layer_info(layer_map);
@@ -4289,7 +4291,7 @@ static void osd_pan_display_layers_fence(
                        /* single step mode */
                        if (osd_hw.osd_debug.osd_single_step > 0) {
                                osd_timeline_increase();
-                               osd_log_dbg("signal out fence\n");
+                               osd_log_dbg(MODULE_FENCE, "signal out fence\n");
                                osd_hw.osd_debug.osd_single_step--;
                        } else
                                osd_hw.osd_debug.wait_fence_release = true;
@@ -4343,7 +4345,7 @@ void osd_pan_display_hw(u32 index, unsigned int xoffset, unsigned int yoffset)
 #ifdef CONFIG_AMLOGIC_MEDIA_FB_EXT
        osd_ext_clone_pan(index);
 #endif
-       osd_log_dbg2("offset[%d-%d]x[%d-%d]y[%d-%d]\n",
+       osd_log_dbg2(MODULE_BASE, "offset[%d-%d]x[%d-%d]y[%d-%d]\n",
                    xoffset, yoffset,
                    osd_hw.pandata[index].x_start,
                    osd_hw.pandata[index].x_end,
@@ -5348,7 +5350,7 @@ static void exchange_din0_din2(struct hw_osd_blending_s *blending)
 {
        int temp1 = 0, temp2 = 0;
 
-       osd_log_dbg("need exchange osd din0 and din2 order\n");
+       osd_log_dbg(MODULE_BLEND, "need exchange osd din0 and din2 order\n");
        temp1 = blending->din_reoder_sel & 0x000f;
        temp2 = blending->din_reoder_sel & 0x0f00;
        blending->din_reoder_sel &= ~0x0f0f;
@@ -5358,7 +5360,7 @@ static void exchange_din0_din2(struct hw_osd_blending_s *blending)
        temp2 = blending->osd_to_bdin_table[2];
        blending->osd_to_bdin_table[2] = temp1;
        blending->osd_to_bdin_table[0] = temp2;
-       osd_log_dbg("din_reoder_sel%x\n",
+       osd_log_dbg(MODULE_BLEND, "din_reoder_sel%x\n",
                blending->din_reoder_sel);
 }
 
@@ -5366,7 +5368,7 @@ static void exchange_din2_din3(struct hw_osd_blending_s *blending)
 {
        int temp1 = 0, temp2 = 0;
 
-       osd_log_dbg("need exchange osd din2 and din3 order\n");
+       osd_log_dbg(MODULE_BLEND, "need exchange osd din2 and din3 order\n");
        temp1 = blending->din_reoder_sel & 0x0f00;
        temp2 = blending->din_reoder_sel & 0xf000;
        blending->din_reoder_sel &= ~0xff00;
@@ -5376,14 +5378,14 @@ static void exchange_din2_din3(struct hw_osd_blending_s *blending)
        temp2 = blending->osd_to_bdin_table[3];
        blending->osd_to_bdin_table[3] = temp1;
        blending->osd_to_bdin_table[2] = temp2;
-       osd_log_dbg("din_reoder_sel%x\n",
+       osd_log_dbg(MODULE_BLEND, "din_reoder_sel%x\n",
                blending->din_reoder_sel);
 }
 
 static void exchange_vpp_order(struct hw_osd_blending_s *blending)
 {
        blending->b_exchange_blend_in = true;
-       osd_log_dbg("need exchange vpp order\n");
+       osd_log_dbg(MODULE_BLEND, "need exchange vpp order\n");
 }
 
 static void generate_blend_din_table(struct hw_osd_blending_s *blending)
@@ -5422,9 +5424,9 @@ static void generate_blend_din_table(struct hw_osd_blending_s *blending)
                                j++;
                        }
                }
-               osd_log_dbg("blend_din4==%d\n",
+               osd_log_dbg(MODULE_BLEND, "blend_din4==%d\n",
                        blending->reorder[temp_index[0]]);
-               osd_log_dbg("blend_din1==%d\n",
+               osd_log_dbg(MODULE_BLEND, "blend_din1==%d\n",
                        blending->reorder[temp_index[1]]);
                /* mode A_C */
                if (blending->osd_blend_mode == OSD_BLEND_A_C) {
@@ -5440,7 +5442,7 @@ static void generate_blend_din_table(struct hw_osd_blending_s *blending)
                        if (blending->reorder[temp_index[0]] <
                                blending->reorder[temp_index[1]]) {
                                blending->b_exchange_blend_in = true;
-                               osd_log_dbg("need exchange vpp order\n");
+                               osd_log_dbg(MODULE_BLEND, "need exchange vpp order\n");
                        }
                } else {
                        if (blending->reorder[temp_index[0]] <
@@ -5456,7 +5458,7 @@ static void generate_blend_din_table(struct hw_osd_blending_s *blending)
                                /* blend_din1 -- osdx */
                                blending->osd_to_bdin_table[0] = temp_index[1];
                                blending->b_exchange_din = true;
-                               osd_log_dbg("need exchange osd din order\n");
+                               osd_log_dbg(MODULE_BLEND, "need exchange osd din order\n");
                        } else {
                                /* blend_din1 */
                                blending->din_reoder_sel |=
@@ -5474,7 +5476,7 @@ static void generate_blend_din_table(struct hw_osd_blending_s *blending)
        }
        case 3:
                /* blend_din1 is bottom, blend_din4 is top layer */
-               osd_log_dbg("reorder:%d,%d,%d\n",
+               osd_log_dbg(MODULE_BLEND, "reorder:%d,%d,%d\n",
                        blending->reorder[OSD1],
                        blending->reorder[OSD2],
                        blending->reorder[OSD3]);
@@ -5497,7 +5499,8 @@ static void generate_blend_din_table(struct hw_osd_blending_s *blending)
                        if ((blending->reorder[OSD1] == LAYER_3)
                                && (blending->reorder[OSD2] == LAYER_2)
                                && (blending->reorder[OSD3] == LAYER_1)) {
-                               osd_log_dbg2("use default order\n");
+                               osd_log_dbg2(MODULE_BLEND,
+                                       "use default order\n");
                        } else if ((blending->reorder[OSD1] == LAYER_2)
                                && (blending->reorder[OSD2] == LAYER_3)
                                && (blending->reorder[OSD3] == LAYER_1)) {
@@ -5552,7 +5555,7 @@ static void generate_blend_din_table(struct hw_osd_blending_s *blending)
                        temp2 |= (0x04 << (i*4));
        }
        blending->din_reoder_sel |= temp2;
-       osd_log_dbg("osd_to_bdin_table[i]=[%x,%x,%x,%x]\n",
+       osd_log_dbg(MODULE_BLEND, "osd_to_bdin_table[i]=[%x,%x,%x,%x]\n",
                blending->osd_to_bdin_table[0],
                blending->osd_to_bdin_table[1],
                blending->osd_to_bdin_table[2],
@@ -5597,9 +5600,9 @@ static void generate_blend_din_table(struct hw_osd_blending_s *blending)
                                j++;
                        }
                }
-               osd_log_dbg("blend_din4==%d\n",
+               osd_log_dbg(MODULE_BLEND, "blend_din4==%d\n",
                        blending->reorder[temp_index[0]]);
-               osd_log_dbg("blend_din1==%d\n",
+               osd_log_dbg(MODULE_BLEND, "blend_din1==%d\n",
                        blending->reorder[temp_index[1]]);
                /* mode A_C */
                if (blending->osd_blend_mode == OSD_BLEND_A_C) {
@@ -5615,7 +5618,7 @@ static void generate_blend_din_table(struct hw_osd_blending_s *blending)
                        if (blending->reorder[temp_index[0]] <
                                blending->reorder[temp_index[1]]) {
                                blending->b_exchange_blend_in = true;
-                               osd_log_dbg("need exchange vpp order\n");
+                               osd_log_dbg(MODULE_BLEND, "need exchange vpp order\n");
                        }
                } else {
                        if (blending->reorder[temp_index[0]] <
@@ -5631,7 +5634,7 @@ static void generate_blend_din_table(struct hw_osd_blending_s *blending)
                                /* blend_din1 -- osdx */
                                blending->osd_to_bdin_table[0] = temp_index[1];
                                blending->b_exchange_din = true;
-                               osd_log_dbg("need exchange osd din order\n");
+                               osd_log_dbg(MODULE_BLEND, "need exchange osd din order\n");
                        } else {
                                /* blend_din1 */
                                blending->din_reoder_sel |=
@@ -5680,12 +5683,12 @@ static void generate_blend_din_table(struct hw_osd_blending_s *blending)
                if (blending->reorder[OSD1] < blending->reorder[OSD3]) {
                        if (blending->osd_blend_mode == OSD_BLEND_A_BC) {
                                blending->b_exchange_blend_in = true;
-                               osd_log_dbg("need exchange vpp order\n");
+                               osd_log_dbg(MODULE_BLEND, "need exchange vpp order\n");
                        } else {
                                u32 temp1, temp2;
 
                                blending->b_exchange_din = true;
-                               osd_log_dbg("need exchange osd din order\n");
+                               osd_log_dbg(MODULE_BLEND, "need exchange osd din order\n");
                                temp1 = blending->osd_to_bdin_table[2];
                                temp2 = blending->osd_to_bdin_table[3];
                                blending->osd_to_bdin_table[3] =
@@ -5701,7 +5704,7 @@ static void generate_blend_din_table(struct hw_osd_blending_s *blending)
                }
                break;
        }
-       osd_log_dbg("osd_to_bdin_table[i]=[%x,%x,%x,%x]\n",
+       osd_log_dbg(MODULE_BLEND, "osd_to_bdin_table[i]=[%x,%x,%x,%x]\n",
                blending->osd_to_bdin_table[0],
                blending->osd_to_bdin_table[1],
                blending->osd_to_bdin_table[2],
@@ -5756,13 +5759,13 @@ static int osd_setting_blending_scope(u32 index)
                osd_hw.dst_data[index].y +
                osd_hw.dst_data[index].h - 1;
 
-       osd_log_dbg("osd%d_hw.dst_data:%d,%d,%d,%d\n",
+       osd_log_dbg(MODULE_BLEND, "osd%d_hw.dst_data:%d,%d,%d,%d\n",
                index,
                osd_hw.dst_data[index].x,
                osd_hw.dst_data[index].y,
                osd_hw.dst_data[index].w,
                osd_hw.dst_data[index].h);
-       osd_log_dbg("h,v axis:%d,%d,%d,%d\n",
+       osd_log_dbg(MODULE_BLEND, "h,v axis:%d,%d,%d,%d\n",
                bld_osd_h_start,
                bld_osd_h_end,
                bld_osd_v_start,
@@ -5786,7 +5789,7 @@ static int vpp_blend_setting_default(u32 index)
        u32 osd1_h_start = 0, osd1_h_end = 0;
        u32 osd1_v_start = 0, osd1_v_end = 0;
 
-       osd_log_dbg("vpp_blend_setting_default\n");
+       osd_log_dbg(MODULE_BASE, "vpp_blend_setting_default\n");
 
        if (index > OSD3) {
                osd_log_err("error osd index=%d\n", index);
@@ -5844,7 +5847,7 @@ static void set_blend_order(struct hw_osd_blending_s *blending)
        }
        insert_sort(order, osd_count);
        //check_order_continuous(order);
-       osd_log_dbg2("after sort:zorder:%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND, "after sort:zorder:%d,%d,%d\n",
                order[0], order[1], order[2]);
 
        /* reorder[i] = osd[i]'s display layer */
@@ -5859,7 +5862,7 @@ static void set_blend_order(struct hw_osd_blending_s *blending)
                        }
                }
        }
-       osd_log_dbg2("after reorder:zorder:%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND, "after reorder:zorder:%d,%d,%d\n",
                blending->reorder[0],
                blending->reorder[1],
                blending->reorder[2]);
@@ -5927,7 +5930,7 @@ static void set_blend_mode(struct hw_osd_blending_s *blending)
                break;
        }
        blending->osd_blend_mode = osd_blend_mode;
-       osd_log_dbg2("osd_blend_mode=%d\n",
+       osd_log_dbg2(MODULE_BLEND, "osd_blend_mode=%d\n",
                blending->osd_blend_mode);
 }
 
@@ -5941,12 +5944,12 @@ static void calc_max_output(struct hw_osd_blending_s *blending)
        if (!blending)
                return;
        layer_blend = &(blending->layer_blend);
-       osd_log_dbg2("calc_max_output input1_data:%d,%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND, "calc_max_output input1_data:%d,%d,%d,%d\n",
                layer_blend->input1_data.x,
                layer_blend->input1_data.y,
                layer_blend->input1_data.w,
                layer_blend->input1_data.h);
-       osd_log_dbg2("calc_max_output input2_data:%d,%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND, "calc_max_output input2_data:%d,%d,%d,%d\n",
                layer_blend->input2_data.x,
                layer_blend->input2_data.y,
                layer_blend->input2_data.w,
@@ -6029,13 +6032,15 @@ static void osd_setting_blend0(struct hw_osd_blending_s *blending)
                + layer_blend->input1_data.w;
        layer_blend->output_data.h = layer_blend->input1_data.y
                + layer_blend->input1_data.h;
-       osd_log_dbg2("blend0:input1_data[osd%d]:%d,%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND,
+               "blend0:input1_data[osd%d]:%d,%d,%d,%d\n",
                index,
                layer_blend->input1_data.x,
                layer_blend->input1_data.y,
                layer_blend->input1_data.w,
                layer_blend->input1_data.h);
-       osd_log_dbg2("blend0:layer_blend->output_data:%d,%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND,
+               "blend0:layer_blend->output_data:%d,%d,%d,%d\n",
                layer_blend->output_data.x,
                layer_blend->output_data.y,
                layer_blend->output_data.w,
@@ -6105,7 +6110,8 @@ static void osd_setting_blend1(struct hw_osd_blending_s *blending)
                        bld_osd_h_end << 16 | bld_osd_h_start;
                blend_reg->osd_blend_din_scope_v[index] =
                        bld_osd_v_end << 16 | bld_osd_v_start;
-               osd_log_dbg2("blend1:input1_data(osd%d):%d,%d,%d,%d\n",
+               osd_log_dbg2(MODULE_BLEND,
+                       "blend1:input1_data(osd%d):%d,%d,%d,%d\n",
                        index,
                        layer_blend->input1_data.x,
                        layer_blend->input1_data.y,
@@ -6131,7 +6137,8 @@ static void osd_setting_blend1(struct hw_osd_blending_s *blending)
                        bld_osd_h_end << 16 | bld_osd_h_start;
                blend_reg->osd_blend_din_scope_v[index] =
                        bld_osd_v_end << 16 | bld_osd_v_start;
-               osd_log_dbg2("layer_blend->input2_data:%d,%d,%d,%d\n",
+               osd_log_dbg2(MODULE_BLEND,
+                       "layer_blend->input2_data:%d,%d,%d,%d\n",
                        layer_blend->input2_data.x,
                        layer_blend->input2_data.y,
                        layer_blend->input2_data.w,
@@ -6167,7 +6174,7 @@ static void osd_setting_blend1(struct hw_osd_blending_s *blending)
        blend_reg->osd_blend_blend1_size =
                blend_vsize  << 16 | blend_hsize;
 
-       osd_log_dbg2("layer_blend1->output_data:%d,%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND, "layer_blend1->output_data:%d,%d,%d,%d\n",
                layer_blend->output_data.x,
                layer_blend->output_data.y,
                layer_blend->output_data.w,
@@ -6232,7 +6239,7 @@ static void osd_setting_blend2(struct hw_osd_blending_s *blending)
                        blend_reg->osd_blend_blend0_size;
 #endif
        }
-       osd_log_dbg2("layer_blend2->output_data:%d,%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND, "layer_blend2->output_data:%d,%d,%d,%d\n",
                layer_blend->output_data.x,
                layer_blend->output_data.y,
                layer_blend->output_data.w,
@@ -6331,10 +6338,12 @@ static void vpp_setting_blend(struct hw_osd_blending_s *blending)
                blend_reg->postbld_osd2_premult = 0;
                break;
        }
-       osd_log_dbg2("vpp_osd1_blend_h_scope=%x, vpp_osd1_blend_v_scope=%x\n",
+       osd_log_dbg2(MODULE_BLEND,
+               "vpp_osd1_blend_h_scope=%x, vpp_osd1_blend_v_scope=%x\n",
                blend_reg->vpp_osd1_blend_h_scope,
                blend_reg->vpp_osd1_blend_v_scope);
-       osd_log_dbg2("vpp_osd2_blend_h_scope=%x, vpp_osd2_blend_v_scope=%x\n",
+       osd_log_dbg2(MODULE_BLEND,
+               "vpp_osd2_blend_h_scope=%x, vpp_osd2_blend_v_scope=%x\n",
                blend_reg->vpp_osd2_blend_h_scope,
                blend_reg->vpp_osd2_blend_v_scope);
 }
@@ -6409,7 +6418,7 @@ static void osd_set_freescale(u32 index,
                        if (width > FREE_SCALE_MAX_WIDTH)
                                width = FREE_SCALE_MAX_WIDTH;
                } else if (blending->osd_blend_mode == OSD_BLEND_AB_C) {
-                       osd_log_dbg("blending->blend_din=%d\n",
+                       osd_log_dbg(MODULE_BLEND, "blending->blend_din=%d\n",
                                blending->blend_din);
                        if (blending->blend_din != BLEND_DIN4) {
                                /* combine mode, need uniformization */
@@ -6472,13 +6481,13 @@ static void osd_set_freescale(u32 index,
                osd_hw.osd_meson_dev.dummy_data = 0x808000;
                osd_set_dummy_data(index, 0xff);
        }
-       osd_log_dbg2("osd%d:free_src_data:%d,%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND, "osd%d:free_src_data:%d,%d,%d,%d\n",
                index,
                osd_hw.free_src_data[index].x_start,
                osd_hw.free_src_data[index].y_start,
                osd_hw.free_src_data[index].x_end,
                osd_hw.free_src_data[index].y_end);
-       osd_log_dbg2("osd%d:free_dst_data:%d,%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND, "osd%d:free_dst_data:%d,%d,%d,%d\n",
                index,
                osd_hw.free_dst_data[index].x_start,
                osd_hw.free_dst_data[index].y_start,
@@ -6518,7 +6527,8 @@ static void osd_setting_blend0_input(u32 index,
                        osd_hw.free_dst_data[index].y_end -
                        osd_hw.free_dst_data[index].y_start + 1;
        }
-       osd_log_dbg2("blend0_input:input0_data[osd%d]:%d,%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND,
+               "blend0_input:input0_data[osd%d]:%d,%d,%d,%d\n",
                index,
                layer_blend->input1_data.x,
                layer_blend->input1_data.y,
@@ -6570,7 +6580,8 @@ static void osd_setting_blend1_input(u32 index,
                        osd_hw.free_dst_data[index].y_end -
                        osd_hw.free_dst_data[index].y_start + 1;
        }
-       osd_log_dbg2("blend1_input:input_data[osd%d]:%d,%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND,
+               "blend1_input:input_data[osd%d]:%d,%d,%d,%d\n",
                index,
                layer_blend->output_data.x,
                layer_blend->output_data.y,
@@ -6625,8 +6636,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                                osd_setting_blend2(blending);
                        }
                        /* osd1 freescale,output is vinfo.w/h */
-                       osd_log_dbg2("after blend: set osd%d freescale\n",
-                               index);
+                       osd_log_dbg2(MODULE_BLEND,
+                               "after blend: set osd%d freescale\n", index);
                        osd_set_freescale(index, blending);
 
                        layer_blend->input1 = BLEND2_DIN;
@@ -6645,7 +6656,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                                osd_hw.free_dst_data[index].y_end -
                                osd_hw.free_dst_data[index].y_start + 1;
                } else {
-                       osd_log_dbg2("first: set osd%d freescale\n", index);
+                       osd_log_dbg2(MODULE_BLEND,
+                               "first: set osd%d freescale\n", index);
                        osd_set_freescale(index, blending);
                        osd_hw.free_dst_data[index].x_start +=
                                osd_hw.disp_info.position_x;
@@ -6705,7 +6717,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
 #endif
                if (index != OSD1) {
                        /* here used freescale osd1/osd2 */
-                       osd_log_dbg2("before blend0: set osd%d freescale\n",
+                       osd_log_dbg2(MODULE_BLEND,
+                               "before blend0: set osd%d freescale\n",
                                index);
                        osd_set_freescale(index, blending);
                }
@@ -6720,7 +6733,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                if (index >= OSD_MAX)
                        return;
                if (index != OSD1) {
-                       osd_log_dbg2("before blend1: set osd%d freescale\n",
+                       osd_log_dbg2(MODULE_BLEND,
+                               "before blend1: set osd%d freescale\n",
                                index);
                        osd_set_freescale(index, blending);
                }
@@ -6801,7 +6815,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                        osd_setting_blend2(blending);
                }
                /* here freescale osd0 used */
-               osd_log_dbg2("after blend: set osd%d freescale\n", index);
+               osd_log_dbg2(MODULE_BLEND,
+                       "after blend: set osd%d freescale\n", index);
                osd_set_freescale(index, blending);
                /* save freescale output */
                output1_data.x =
@@ -6817,7 +6832,7 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                        osd_hw.free_dst_data[index].y_end -
                        osd_hw.free_dst_data[index].y_start + 1;
 
-               osd_log_dbg2("position_x=%d, y=%d\n",
+               osd_log_dbg2(MODULE_BLEND, "position_x=%d, y=%d\n",
                        osd_hw.disp_info.position_x,
                        osd_hw.disp_info.position_y);
 
@@ -6825,7 +6840,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                if (index >= OSD_MAX)
                        return;
                /* here freescale osd1/osd2 used */
-               osd_log_dbg2("before blend1: set osd%d freescale\n", index);
+               osd_log_dbg2(MODULE_BLEND,
+               "before blend1: set osd%d freescale\n", index);
                osd_set_freescale(index, blending);
 #ifdef OSD_BLEND_SHIFT_WORKAROUND
                layer_blend->input1 = BLEND_NO_DIN;
@@ -6895,7 +6911,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                if (index >= OSD_MAX)
                        return;
                if (index != OSD1) {
-                       osd_log_dbg2("index=%d, need set freescale\n", index);
+                       osd_log_dbg2(MODULE_BLEND,
+                               "index=%d, need set freescale\n", index);
                        osd_set_freescale(index, blending);
                }
                osd_setting_blend0_input(index, blending);
@@ -6907,7 +6924,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                layer_blend->input2 = input2;
                index = blend_din_to_osd(layer_blend->input1, blending);
                if (index != OSD1) {
-                       osd_log_dbg2("blend1 input1: set osd%d freescale\n",
+                       osd_log_dbg2(MODULE_BLEND,
+                               "blend1 input1: set osd%d freescale\n",
                                index);
                        osd_set_freescale(index, blending);
                }
@@ -6920,7 +6938,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                if (index >= OSD_MAX)
                        return;
                if (index != OSD1) {
-                       osd_log_dbg2("blend1 input2: set osd%d freescale\n",
+                       osd_log_dbg2(MODULE_BLEND,
+                               "blend1 input2: set osd%d freescale\n",
                                index);
                        osd_set_freescale(index, blending);
                }
@@ -6981,7 +7000,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                        osd_setting_blend2(blending);
                }
 
-               osd_log_dbg("after blend2: set osd%d freescale\n", index);
+               osd_log_dbg(MODULE_BLEND,
+                       "after blend2: set osd%d freescale\n", index);
                osd_set_freescale(index, blending);
                /* save freescale output */
                output1_data.x =
@@ -6999,7 +7019,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                index = blend_din_to_osd(BLEND_DIN3, blending);
                if (index >= OSD_MAX)
                        return;
-               osd_log_dbg2("before blend1: set osd%d freescale\n", index);
+               osd_log_dbg2(MODULE_BLEND,
+                       "before blend1: set osd%d freescale\n", index);
                osd_set_freescale(index, blending);
                layer_blend->input1_data.x =
                        osd_hw.free_dst_data[index].x_start +
@@ -7017,7 +7038,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                index = blend_din_to_osd(BLEND_DIN4, blending);
                if (index >= OSD_MAX)
                        return;
-               osd_log_dbg2("before blend1: set osd%d freescale\n", index);
+               osd_log_dbg2(MODULE_BLEND,
+                       "before blend1: set osd%d freescale\n", index);
                osd_set_freescale(index, blending);
                layer_blend->input2_data.x =
                        osd_hw.free_dst_data[index].x_start +
@@ -7084,7 +7106,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                blending->blend_din = BLEND_DIN3;
                index = blend_din_to_osd(BLEND_DIN3, blending);
                if (index != OSD1) {
-                       osd_log_dbg2("before blend1: set osd%d freescale\n",
+                       osd_log_dbg2(MODULE_BLEND,
+                               "before blend1: set osd%d freescale\n",
                                index);
                        osd_set_freescale(index, blending);
                }
@@ -7117,7 +7140,7 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                output1_data.h =
                        osd_hw.free_dst_data[OSD1].y_end -
                        osd_hw.free_dst_data[OSD1].y_start + 1;
-               osd_log_dbg2("output1_data:%d,%d,%d,%d\n",
+               osd_log_dbg2(MODULE_BLEND, "output1_data:%d,%d,%d,%d\n",
                        output1_data.x,
                        output1_data.w,
                        output1_data.y,
@@ -7127,7 +7150,8 @@ static void set_blend_path(struct hw_osd_blending_s *blending)
                /* din4 ==> vpp */
                index = blend_din_to_osd(BLEND_DIN4, blending);
                blending->blend_din = BLEND_DIN4;
-               osd_log_dbg2("bypass blend1: set osd%d freescale\n", index);
+               osd_log_dbg2(MODULE_BLEND,
+                       "bypass blend1: set osd%d freescale\n", index);
                osd_set_freescale(index, blending);
 
                layer_blend->input2_data.x =
@@ -7289,7 +7313,8 @@ static void uniformization_fb(u32 index,
                        blending->dst_data.w + blending->dst_data.x,
                        osd_hw.disp_info.background_w);
        }
-       osd_log_dbg2("uniformization:osd%d:dst_data:%d,%d,%d,%d\n",
+       osd_log_dbg2(MODULE_BLEND,
+               "uniformization:osd%d:dst_data:%d,%d,%d,%d\n",
                index,
                blending->dst_data.x,
                blending->dst_data.y,
@@ -7312,7 +7337,8 @@ static void adjust_dst_position(void)
                                osd_hw.dst_data[i].x = 0;
                        if (osd_hw.dst_data[i].y < 0)
                                osd_hw.dst_data[i].y = 0;
-                       osd_log_dbg2("adjust dst_data:osd%d:%d,%d,%d,%d\n",
+                       osd_log_dbg2(MODULE_BLEND,
+                               "adjust dst_data:osd%d:%d,%d,%d,%d\n",
                                i,
                                osd_hw.dst_data[i].x,
                                osd_hw.dst_data[i].y,
@@ -7349,7 +7375,8 @@ static int osd_setting_order(void)
        blending->layer_cnt = get_available_layers();
        set_blend_order(blending);
 
-       osd_log_dbg("layer_cnt:%d\n", blending->layer_cnt);
+       osd_log_dbg(MODULE_BLEND, "layer_cnt:%d\n",
+               blending->layer_cnt);
 
        blending->b_exchange_din = false;
        blending->b_exchange_blend_in = false;
@@ -7369,10 +7396,9 @@ static int osd_setting_order(void)
        vinfo_height = osd_hw.field_out_en ?
                (osd_hw.vinfo_height * 2) : osd_hw.vinfo_height;
        if (line1 >= vinfo_height) {
-               if (osd_hw.osd_display_debug == ENCP_LINE_VSYNC)
-                       osd_log_info(
-                               "enter osd_setting_order:cnt=%d,encp line=%d\n",
-                               cnt, line1);
+               osd_log_dbg(MODULE_RENDER,
+                       "enter osd_setting_order:cnt=%d,encp line=%d\n",
+                       cnt, line1);
                osd_wait_vsync_hw();
                line1 = get_enter_encp_line();
        }
@@ -7437,10 +7463,9 @@ static int osd_setting_order(void)
        save_blend_reg(blend_reg);
        spin_unlock_irqrestore(&osd_lock, lock_flags);
        line2 = get_exit_encp_line();
-       if (osd_hw.osd_display_debug == ENCP_LINE)
-               osd_log_info(
-                       "enter osd_setting_order:cnt=%d,encp line=%d\n",
-                       cnt, line2);
+       osd_log_dbg2(MODULE_RENDER,
+               "enter osd_setting_order:cnt=%d,encp line=%d\n",
+               cnt, line2);
        if (line2 < line1)
                osd_log_info("osd line %d,%d\n", line1, line2);
        osd_wait_vsync_hw();
@@ -7463,7 +7488,7 @@ static void osd_setting_default_hwc(void)
        u32 postbld_src3_sel = 3, postbld_src4_sel = 0;
        u32 postbld_osd1_premult = 0, postbld_osd2_premult = 0;
 
-       osd_log_dbg("osd_setting_default_hwc\n");
+       osd_log_dbg(MODULE_BASE, "osd_setting_default_hwc\n");
        /* depend on din0_premult_en */
        postbld_osd1_premult = 1;
        /* depend on din_premult_en bit 4 */
@@ -7550,12 +7575,6 @@ static bool set_old_hwc_freescale(u32 index)
                osd_hw.free_dst_data[index].y_start = y_start;
                osd_hw.free_dst_data[index].y_end = y_end;
        }
-       osd_log_dbg("free_dst_data: %x,%x,%x,%x\n",
-               osd_hw.free_dst_data[index].x_start,
-               osd_hw.free_dst_data[index].x_end,
-               osd_hw.free_dst_data[index].y_start,
-               osd_hw.free_dst_data[index].y_end);
-
        /* set dummy_data alpha */
        height_dst = osd_hw.free_dst_data[index].y_end -
                        osd_hw.free_dst_data[index].y_start + 1;
@@ -8653,7 +8672,7 @@ void osd_cursor_hw(u32 index, s16 x, s16 y, s16 xstart, s16 ystart, u32 osd_w,
        if (index != 1)
                return;
 
-       osd_log_dbg2("cursor: x=%d, y=%d, x0=%d, y0=%d, w=%d, h=%d\n",
+       osd_log_dbg(MODULE_CURSOR, "cursor: x=%d, y=%d, x0=%d, y0=%d, w=%d, h=%d\n",
                        x, y, xstart, ystart, osd_w, osd_h);
 
        if (osd_hw.free_scale_mode[OSD1]) {
@@ -8709,7 +8728,7 @@ void osd_cursor_hw(u32 index, s16 x, s16 y, s16 xstart, s16 ystart, u32 osd_w,
                osd_hw.pandata[OSD2].y_end = osd_h - 1;
                x -= osd_w;
                y -= osd_h;
-               osd_log_dbg2("x=%d,y=%d\n", x, y);
+               osd_log_dbg(MODULE_CURSOR, "x=%d,y=%d\n", x, y);
        }
        /*
         * Use pandata to show a partial cursor when it is at the edge because
@@ -8786,7 +8805,7 @@ void osd_cursor_hw(u32 index, s16 x, s16 y, s16 xstart, s16 ystart, u32 osd_w,
                osd_hw.pandata[OSD2].y_end - osd_hw.pandata[OSD2].y_start;
        add_to_update_list(OSD2, OSD_COLOR_MODE);
        add_to_update_list(OSD2, DISP_GEOMETRY);
-       osd_log_dbg2("dispdata: %d,%d,%d,%d\n",
+       osd_log_dbg(MODULE_CURSOR, "dispdata: %d,%d,%d,%d\n",
                osd_hw.dispdata[OSD2].x_start, osd_hw.dispdata[OSD2].x_end,
                osd_hw.dispdata[OSD2].y_start, osd_hw.dispdata[OSD2].y_end);
 }
@@ -8802,7 +8821,7 @@ void osd_cursor_hw_no_scale(u32 index, s16 x, s16 y, s16 xstart, s16 ystart,
        if (index != 1)
                return;
 
-       osd_log_dbg2("cursor: x=%d, y=%d, x0=%d, y0=%d, w=%d, h=%d\n",
+       osd_log_dbg(MODULE_CURSOR, "cursor: x=%d, y=%d, x0=%d, y0=%d, w=%d, h=%d\n",
                        x, y, xstart, ystart, osd_w, osd_h);
 
        if (osd_hw.free_scale_mode[OSD1]) {
@@ -8848,7 +8867,7 @@ void osd_cursor_hw_no_scale(u32 index, s16 x, s16 y, s16 xstart, s16 ystart,
                osd_hw.pandata[OSD2].y_end = osd_h - 1;
                x -= osd_w;
                y -= osd_h;
-               osd_log_dbg2("x=%d,y=%d\n", x, y);
+               osd_log_dbg(MODULE_CURSOR, "x=%d,y=%d\n", x, y);
        }
 
 
@@ -8931,7 +8950,7 @@ void osd_cursor_hw_no_scale(u32 index, s16 x, s16 y, s16 xstart, s16 ystart,
                osd_hw.pandata[OSD2].y_end - osd_hw.pandata[OSD2].y_start;
        add_to_update_list(OSD2, OSD_COLOR_MODE);
        add_to_update_list(OSD2, DISP_GEOMETRY);
-       osd_log_dbg2("dispdata: %d,%d,%d,%d\n",
+       osd_log_dbg(MODULE_CURSOR, "dispdata: %d,%d,%d,%d\n",
                osd_hw.dispdata[OSD2].x_start, osd_hw.dispdata[OSD2].x_end,
                osd_hw.dispdata[OSD2].y_start, osd_hw.dispdata[OSD2].y_end);
 }
@@ -9222,7 +9241,7 @@ static bool osd_direct_render(struct osd_plane_map_s *plane_map)
                        memset(vaddr, 0x0,
                                plane_map->byte_stride*plane_map->src_h);
        }
-       osd_log_dbg("canvas_id=%x, phy_addr=%x\n",
+       osd_log_dbg(MODULE_RENDER, "canvas_id=%x, phy_addr=%x\n",
                osd_hw.fb_gem[index].canvas_idx, phy_addr);
        canvas_config(osd_hw.fb_gem[index].canvas_idx,
                phy_addr,
@@ -9255,12 +9274,14 @@ static bool osd_direct_render(struct osd_plane_map_s *plane_map)
                osd_hw.dst_data[index].y = plane_map->dst_y;
                osd_hw.dst_data[index].w = plane_map->dst_w;
                osd_hw.dst_data[index].h = plane_map->dst_h;
-               osd_log_dbg2("index=%d\n", index);
-               osd_log_dbg2("order=%d\n", osd_hw.order[index]);
-               osd_log_dbg2("premult_en=%d\n", osd_hw.premult_en[index]);
-               osd_log_dbg2("osd_afbcd_en=%d\n",
+               osd_log_dbg2(MODULE_RENDER, "index=%d\n", index);
+               osd_log_dbg2(MODULE_RENDER, "order=%d\n",
+                       osd_hw.order[index]);
+               osd_log_dbg2(MODULE_RENDER, "premult_en=%d\n",
+                       osd_hw.premult_en[index]);
+               osd_log_dbg2(MODULE_RENDER, "osd_afbcd_en=%d\n",
                        osd_hw.osd_afbcd[index].enable);
-               osd_log_dbg2("osd_afbcd_inter_format=%d\n",
+               osd_log_dbg2(MODULE_RENDER, "osd_afbcd_inter_format=%d\n",
                        osd_hw.osd_afbcd[index].inter_format);
                return 0;
        }
@@ -9377,17 +9398,20 @@ static bool osd_direct_render(struct osd_plane_map_s *plane_map)
                        else
                                osd_set_dummy_data(index, 0xff);
                }
-               osd_log_dbg2("pandata x=%d,x_end=%d,y=%d,y_end=%d\n",
+               osd_log_dbg2(MODULE_RENDER,
+                       "pandata x=%d,x_end=%d,y=%d,y_end=%d\n",
                        osd_hw.pandata[index].x_start,
                        osd_hw.pandata[index].x_end,
                        osd_hw.pandata[index].y_start,
                        osd_hw.pandata[index].y_end);
-               osd_log_dbg2("plane_map:src_x=%d,src_y=%d,src_w=%d,src_h=%d\n",
+               osd_log_dbg2(MODULE_RENDER,
+                       "plane_map:src_x=%d,src_y=%d,src_w=%d,src_h=%d\n",
                        plane_map->src_x,
                        plane_map->src_y,
                        plane_map->src_w,
                        plane_map->src_h);
-               osd_log_dbg2("fence_map:dst_x=%d,dst_y=%d,dst_w=%d,dst_h=%d\n",
+               osd_log_dbg2(MODULE_RENDER,
+                       "fence_map:dst_x=%d,dst_y=%d,dst_w=%d,dst_h=%d\n",
                        plane_map->dst_x,
                        plane_map->dst_y,
                        plane_map->dst_w,
@@ -9590,22 +9614,26 @@ static void osd_cursor_move(struct osd_plane_map_s *plane_map)
                osd_hw.dispdata[index].y_start = y_start;
                osd_hw.dispdata[index].y_end = y_end;
        }
-       osd_log_dbg2("plane_map:src_x=%d,src_y=%d,src_w=%d,src_h=%d\n",
+       osd_log_dbg2(MODULE_CURSOR,
+               "plane_map:src_x=%d,src_y=%d,src_w=%d,src_h=%d\n",
                plane_map->src_x,
                plane_map->src_y,
                plane_map->src_w,
                plane_map->src_h);
-       osd_log_dbg2("fence_map:dst_x=%d,dst_y=%d,dst_w=%d,dst_h=%d\n",
+       osd_log_dbg2(MODULE_CURSOR,
+               "fence_map:dst_x=%d,dst_y=%d,dst_w=%d,dst_h=%d\n",
                plane_map->dst_x,
                plane_map->dst_y,
                plane_map->dst_w,
                plane_map->dst_h);
-       osd_log_dbg2("cursor pandata x=%d,x_end=%d,y=%d,y_end=%d\n",
+       osd_log_dbg2(MODULE_CURSOR,
+               "cursor pandata x=%d,x_end=%d,y=%d,y_end=%d\n",
                osd_hw.pandata[index].x_start,
                osd_hw.pandata[index].x_end,
                osd_hw.pandata[index].y_start,
                osd_hw.pandata[index].y_end);
-       osd_log_dbg2("cursor dispdata x=%d,x_end=%d,y=%d,y_end=%d\n",
+       osd_log_dbg2(MODULE_CURSOR,
+               "cursor dispdata x=%d,x_end=%d,y=%d,y_end=%d\n",
                osd_hw.dispdata[index].x_start,
                osd_hw.dispdata[index].x_end,
                osd_hw.dispdata[index].y_start,
index 351937b..c4dc7cf 100644 (file)
@@ -72,7 +72,7 @@ uint32_t osd_cbus_read(uint32_t reg)
 
        } else
                ret = (uint32_t)aml_read_cbus(reg);
-       osd_log_dbg3("%s(0x%x)=0x%x\n", __func__, reg, ret);
+       osd_log_dbg3(MODULE_BASE, "%s(0x%x)=0x%x\n", __func__, reg, ret);
 
        return ret;
 };
@@ -87,7 +87,7 @@ void osd_cbus_write(uint32_t reg,
                writel(val, osd_reg_map.vir_addr + addr);
        } else
                aml_write_cbus(reg, val);
-       osd_log_dbg3("%s(0x%x, 0x%x)\n", __func__, reg, val);
+       osd_log_dbg3(MODULE_BASE, "%s(0x%x, 0x%x)\n", __func__, reg, val);
 };
 
 
@@ -104,7 +104,7 @@ uint32_t osd_reg_read(uint32_t reg)
 
        } else
                ret = (uint32_t)aml_read_vcbus(reg);
-       osd_log_dbg3("%s(0x%x)=0x%x\n", __func__, reg, ret);
+       osd_log_dbg3(MODULE_BASE, "%s(0x%x)=0x%x\n", __func__, reg, ret);
 
        return ret;
 };
@@ -120,7 +120,7 @@ void osd_reg_write(uint32_t reg,
        } else
                aml_write_vcbus(reg, val);
        update_backup_reg(reg, val);
-       osd_log_dbg3("%s(0x%x, 0x%x)\n", __func__, reg, val);
+       osd_log_dbg3(MODULE_BASE, "%s(0x%x, 0x%x)\n", __func__, reg, val);
 };
 
 void osd_reg_set_mask(uint32_t reg,
index 003654c..d3412ca 100644 (file)
 #define OSD_LOG_LEVEL_DEBUG2 2
 #define OSD_LOG_LEVEL_DEBUG3 3
 
+#define MODULE_BASE   (1 << 0)
+#define MODULE_RENDER (1 << 1)
+#define MODULE_FENCE  (1 << 2)
+#define MODULE_BLEND  (1 << 3)
+#define MODULE_CURSOR (1 << 4)
+
 extern unsigned int osd_log_level;
+extern unsigned int osd_log_module;
 
 #undef pr_fmt
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -37,25 +44,30 @@ extern unsigned int osd_log_level;
 #define osd_log_err(fmt, ...) \
        pr_err(fmt, ##__VA_ARGS__)
 
-#define osd_log_dbg(fmt, ...) \
+#define osd_log_dbg(moudle, fmt, ...) \
        do { \
                if (osd_log_level >= OSD_LOG_LEVEL_DEBUG) { \
-                       pr_info(fmt, ##__VA_ARGS__); \
+                       if (moudle & osd_log_module) { \
+                               pr_info(fmt, ##__VA_ARGS__); \
+                       } \
                } \
        } while (0)
 
-#define osd_log_dbg2(fmt, ...) \
+#define osd_log_dbg2(moudle, fmt, ...) \
        do { \
                if (osd_log_level >= OSD_LOG_LEVEL_DEBUG2) { \
-                       pr_info(fmt, ##__VA_ARGS__); \
+                       if (moudle & osd_log_module) { \
+                               pr_info(fmt, ##__VA_ARGS__); \
+                       } \
                } \
        } while (0)
 
-#define osd_log_dbg3(fmt, ...) \
+#define osd_log_dbg3(moudle, fmt, ...) \
        do { \
                if (osd_log_level >= OSD_LOG_LEVEL_DEBUG3) { \
-                       pr_info(fmt, ##__VA_ARGS__); \
+                       if (moudle & osd_log_module) { \
+                               pr_info(fmt, ##__VA_ARGS__); \
+                       } \
                } \
        } while (0)
-
 #endif
index da16b2c..d6320c8 100644 (file)
@@ -175,7 +175,7 @@ _find_color_format(struct fb_var_screeninfo *var)
            || (var->blue.length == 0) ||
            var->bits_per_pixel != (var->red.length + var->green.length +
                    var->blue.length + var->transp.length)) {
-               osd_log_dbg("not provide color length, use default color\n");
+               osd_log_dbg(MODULE_BASE, "not provide color length, use default color\n");
                found = &default_color_format_array[upper_margin];
        } else {
                for (i = upper_margin; i >= lower_margin; i--) {
@@ -216,7 +216,7 @@ static int osd_ext_check_var(struct fb_var_screeninfo *var,
        color_format_pt = _find_color_format(var);
        if (color_format_pt == NULL || color_format_pt->color_index == 0)
                return -EFAULT;
-       osd_log_dbg("select color format :index %d, bpp %d\n",
+       osd_log_dbg(MODULE_BASE, "select color format :index %d, bpp %d\n",
                    color_format_pt->color_index,
                    color_format_pt->bpp);
        fbdev->color = color_format_pt;
@@ -233,7 +233,7 @@ static int osd_ext_check_var(struct fb_var_screeninfo *var,
        var->transp.length = color_format_pt->transp_length;
        var->transp.msb_right = color_format_pt->transp_msb_right;
        var->bits_per_pixel = color_format_pt->bpp;
-       osd_log_dbg("rgba(L/O):%d/%d-%d/%d-%d/%d-%d/%d\n",
+       osd_log_dbg(MODULE_BASE, "rgba(L/O):%d/%d-%d/%d-%d/%d-%d/%d\n",
                    var->red.length, var->red.offset,
                    var->green.length, var->green.offset,
                    var->blue.length, var->blue.offset,
@@ -431,7 +431,8 @@ static int osd_ext_ioctl(struct fb_info *info, unsigned int cmd,
                case COLOR_INDEX_24_888_B:
                case COLOR_INDEX_24_RGB:
                case COLOR_INDEX_YUV_422:
-                       osd_log_dbg("set osd color key 0x%x\n", src_colorkey);
+                       osd_log_dbg(MODULE_BASE,
+                               "set osd color key 0x%x\n", src_colorkey);
                        fbdev->color_key = src_colorkey;
                        osd_ext_set_color_key_hw(info->node - 2,
                                fbdev->color->color_index, src_colorkey);
@@ -448,7 +449,7 @@ static int osd_ext_ioctl(struct fb_info *info, unsigned int cmd,
                case COLOR_INDEX_24_888_B:
                case COLOR_INDEX_24_RGB:
                case COLOR_INDEX_YUV_422:
-                       osd_log_dbg("set osd color key %s\n",
+                       osd_log_dbg(MODULE_BASE, "set osd color key %s\n",
                                        srckey_enable ? "enable" : "disable");
                        if (srckey_enable != 0) {
                                fbdev->enable_key_flag |= KEYCOLOR_FLAG_TARGET;
@@ -1408,7 +1409,8 @@ osd_ext_probe(struct platform_device *pdev)
                osd_log_err("not found mem_size from dt\n");
                osd_ext_memory = 0;
        } else {
-               osd_log_dbg("mem_size: 0x%x, 0x%x\n", memsize[0], memsize[1]);
+               osd_log_dbg(MODULE_BASE,
+                       "mem_size: 0x%x, 0x%x\n", memsize[0], memsize[1]);
                fb_rmem_size[0] = memsize[0];
                fb_rmem_paddr[0] = fb_rmem.base;
                if ((OSD_COUNT == 2) && ((memsize[0] + memsize[1]) <=
index e19e7bb..0cc29a3 100644 (file)
@@ -285,8 +285,8 @@ static int out_ext_fence_create(int *release_fence_fd, u32 *val, u32 buf_num)
        }
 
        sync_fence_install(outer_fence, out_fence_fd);
-       osd_log_dbg("---------------------------------------\n");
-       osd_log_dbg("return out fence fd:%d\n", out_fence_fd);
+       osd_log_dbg(MODULE_FENCE, "---------------------------------------\n");
+       osd_log_dbg(MODULE_FENCE, "return out fence fd:%d\n", out_fence_fd);
        *release_fence_fd = out_fence_fd;
        return out_fence_fd;
 
@@ -1229,7 +1229,7 @@ void osd_ext_pan_display_fence(struct osd_fence_map_s *fence_map)
                ret = osd_ext_wait_buf_ready(fence_map);
 
                if (ret < 0)
-                       osd_log_dbg("fence wait ret %d\n", ret);
+                       osd_log_dbg(MODULE_FENCE, "fence wait ret %d\n", ret);
        }
 
        if (ret) {
@@ -1254,7 +1254,7 @@ void osd_ext_pan_display_fence(struct osd_fence_map_s *fence_map)
                        osd_log_err("------NOT signal out_fence ERROR\n");
        }
 
-       osd_log_dbg("offset[%d-%d]x[%d-%d]y[%d-%d]\n",
+       osd_log_dbg(MODULE_FENCE, "offset[%d-%d]x[%d-%d]y[%d-%d]\n",
                    xoffset, yoffset, osd_ext_hw.pandata[index].x_start,
                    osd_ext_hw.pandata[index].x_end,
                    osd_ext_hw.pandata[index].y_start,