From: Pengcheng Chen Date: Wed, 5 Dec 2018 05:45:55 +0000 (+0800) Subject: osd: add osd log module control [2/2] X-Git-Tag: hardkernel-4.9.236-104~2082 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07d9084d85e1059272de3bc5a72468755b75cd6a;p=platform%2Fkernel%2Flinux-amlogic.git osd: add osd log module control [2/2] 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 --- diff --git a/drivers/amlogic/media/osd/osd_drm.c b/drivers/amlogic/media/osd/osd_drm.c index 86083a8..0fe7be3 100644 --- a/drivers/amlogic/media/osd/osd_drm.c +++ b/drivers/amlogic/media/osd/osd_drm.c @@ -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}, diff --git a/drivers/amlogic/media/osd/osd_fb.c b/drivers/amlogic/media/osd/osd_fb.c index b2d11f5..48c92ae 100644 --- a/drivers/amlogic/media/osd/osd_fb.c +++ b/drivers/amlogic/media/osd/osd_fb.c @@ -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) { @@ -3203,6 +3227,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, @@ -3273,6 +3299,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, @@ -3714,7 +3742,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) { @@ -3781,7 +3808,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 diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index 4d5e8d3..f7a15174 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -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) @@ -1241,7 +1239,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); @@ -1259,8 +1257,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) @@ -1283,10 +1280,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) @@ -1333,7 +1329,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; } @@ -1375,7 +1371,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; } @@ -1419,7 +1415,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 } @@ -1798,7 +1794,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; } @@ -2285,8 +2281,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(); } @@ -3078,7 +3075,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); @@ -3940,17 +3937,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, @@ -4023,7 +4023,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; @@ -4150,7 +4150,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, @@ -4467,7 +4468,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); @@ -4481,7 +4483,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; @@ -4535,7 +4537,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, @@ -5540,7 +5542,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; @@ -5550,7 +5552,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); } @@ -5558,7 +5560,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; @@ -5568,14 +5570,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) @@ -5614,9 +5616,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) { @@ -5632,7 +5634,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]] < @@ -5648,7 +5650,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 |= @@ -5666,7 +5668,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]); @@ -5689,7 +5691,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)) { @@ -5744,7 +5747,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], @@ -5789,9 +5792,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) { @@ -5807,7 +5810,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]] < @@ -5823,7 +5826,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 |= @@ -5872,12 +5875,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] = @@ -5893,7 +5896,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], @@ -5948,13 +5951,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, @@ -5978,7 +5981,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 >= osd_hw.osd_meson_dev.viu1_osd_count) { osd_log_err("error osd index=%d\n", index); @@ -6036,7 +6039,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 */ @@ -6051,7 +6054,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]); @@ -6119,7 +6122,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); } @@ -6133,12 +6136,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, @@ -6221,13 +6224,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, @@ -6297,7 +6302,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, @@ -6323,7 +6329,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, @@ -6359,7 +6366,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, @@ -6424,7 +6431,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, @@ -6523,10 +6530,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); } @@ -6601,7 +6610,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 */ @@ -6664,13 +6673,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, @@ -6711,7 +6720,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, @@ -6763,7 +6773,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, @@ -6818,8 +6829,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; @@ -6838,7 +6849,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; @@ -6898,7 +6910,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); } @@ -6913,7 +6926,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); } @@ -6994,7 +7008,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 = @@ -7010,7 +7025,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); @@ -7018,7 +7033,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; @@ -7088,7 +7104,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); @@ -7100,7 +7117,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); } @@ -7113,7 +7131,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); } @@ -7174,7 +7193,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 = @@ -7192,7 +7212,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 + @@ -7210,7 +7231,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 + @@ -7277,7 +7299,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); } @@ -7310,7 +7333,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, @@ -7320,7 +7343,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 = @@ -7463,7 +7487,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, @@ -7486,7 +7511,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, @@ -7523,7 +7549,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; @@ -7543,10 +7570,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(); } @@ -7611,10 +7637,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(); @@ -7637,7 +7662,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 */ @@ -7724,12 +7749,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; @@ -8859,7 +8878,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]) { @@ -8915,7 +8934,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 @@ -8992,7 +9011,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); } @@ -9008,7 +9027,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]) { @@ -9054,7 +9073,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); } @@ -9137,7 +9156,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); } @@ -9428,7 +9447,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, @@ -9461,12 +9480,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; } @@ -9583,17 +9604,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, @@ -9796,22 +9820,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, diff --git a/drivers/amlogic/media/osd/osd_io.c b/drivers/amlogic/media/osd/osd_io.c index 351937b..c4dc7cf 100644 --- a/drivers/amlogic/media/osd/osd_io.c +++ b/drivers/amlogic/media/osd/osd_io.c @@ -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, diff --git a/drivers/amlogic/media/osd/osd_log.h b/drivers/amlogic/media/osd/osd_log.h index 003654c..d3412ca 100644 --- a/drivers/amlogic/media/osd/osd_log.h +++ b/drivers/amlogic/media/osd/osd_log.h @@ -26,7 +26,14 @@ #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 diff --git a/drivers/amlogic/media/osd_ext/osd_fb.c b/drivers/amlogic/media/osd_ext/osd_fb.c index da16b2c..d6320c8d 100644 --- a/drivers/amlogic/media/osd_ext/osd_fb.c +++ b/drivers/amlogic/media/osd_ext/osd_fb.c @@ -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]) <= diff --git a/drivers/amlogic/media/osd_ext/osd_hw.c b/drivers/amlogic/media/osd_ext/osd_hw.c index e19e7bb..0cc29a3 100644 --- a/drivers/amlogic/media/osd_ext/osd_hw.c +++ b/drivers/amlogic/media/osd_ext/osd_hw.c @@ -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,