static int ge2d_open(struct inode *inode, struct file *file) { ge2d_context_t *context; //we create one ge2d workqueue for this file handler. if(NULL==(context=create_ge2d_work_queue())) { amlog_level(LOG_LEVEL_HIGH,"can't create work queue \r\n"); return -1; } amlog_level(LOG_LEVEL_LOW,"open one ge2d device\n"); file->private_data=context; ge2d_device.open_count++; return 0; }
int osd_ext_clone_task_start(void) { if (s_osd_ext_clone.inited) { osd_log_info("osd_ext_clone_task already started.\n"); return 0; } osd_log_info("osd_ext_clone_task start.\n"); if (s_osd_ext_clone.ge2d_context == NULL) s_osd_ext_clone.ge2d_context = create_ge2d_work_queue(); memset(&s_osd_ext_clone.ge2d_config, 0, sizeof(struct config_para_ex_s)); s_osd_ext_clone.inited = true; return 0; }
int osd_clone_task_start(void) { if (s_osd_clone.inited) { printk("osd_clone_task already started.\n"); return 0; } printk("osd_clone_task start.\n"); #if MESON_CPU_TYPE >= MESON_CPU_TYPE_MESON6 switch_mod_gate_by_name("ge2d", 1); #endif if (s_osd_clone.ge2d_context == NULL) s_osd_clone.ge2d_context = create_ge2d_work_queue(); memset(&s_osd_clone.ge2d_config, 0, sizeof(config_para_ex_t)); s_osd_clone.inited = true; return 0; }
int osd_init_progress_bar(void) { struct src_dst_info_s *op_info = &progress_bar.op_info; const struct vinfo_s *vinfo = progress_bar.vinfo; struct osd_fb_dev_s *fb_dev; struct canvas_s cs; struct config_para_s *cfg = &ge2d_config; struct ge2d_context_s *context = ge2d_context; u32 step = 1; memset(&progress_bar, 0, sizeof(struct osd_progress_bar_s)); vinfo = get_current_vinfo(); progress_bar.bar_border = (((vinfo->field_height ? vinfo->field_height : vinfo->height) * 4 / 720)>>2)<<2; progress_bar.bar_width = (((vinfo->width * 200 / 1280)>>2)<<2) + progress_bar.bar_border; progress_bar.bar_height = (((vinfo->field_height ? vinfo->field_height : vinfo->height) * 32 / 720) >> 2) << 2; if (0 == init_fb1_first(vinfo)) { fb_dev = gp_fbdev_list[1]; if (NULL == fb_dev) { pr_debug("fb1 should exit!!!"); return -EFAULT; } canvas_read(OSD2_CANVAS_INDEX, &cs); context = create_ge2d_work_queue(); if (!context) { pr_debug("create work queue error\n"); return -EFAULT; } memset(cfg, 0, sizeof(struct config_para_s)); cfg->src_dst_type = OSD1_OSD1; cfg->src_format = GE2D_FORMAT_S32_ARGB; cfg->src_planes[0].addr = cs.addr; cfg->src_planes[0].w = cs.width / 4; cfg->src_planes[0].h = cs.height; cfg->dst_planes[0].addr = cs.addr; cfg->dst_planes[0].w = cs.width / 4; cfg->dst_planes[0].h = cs.height; if (ge2d_context_config(context, cfg) < 0) { pr_debug("ge2d config error.\n"); return -EFAULT; } if (NULL == context) { pr_debug("ge2d_context is NULL!!!!!!\n"); return -EFAULT; } progress_bar.ge2d_context = context; pr_debug("progress bar setup ge2d device OK\n"); /* clear dst rect */ op_info->color = 0x000000bf; op_info->dst_rect.x = 0; op_info->dst_rect.y = 0; op_info->dst_rect.w = vinfo->width; op_info->dst_rect.h = vinfo->field_height ? vinfo->field_height : vinfo->height; fillrect(context, op_info->dst_rect.x, op_info->dst_rect.y, op_info->dst_rect.w, op_info->dst_rect.h, op_info->color); pr_debug("clear dstrect is - (%d, %d)-(%d, %d) -\n", op_info->dst_rect.x, op_info->dst_rect.y, op_info->dst_rect.w, op_info->dst_rect.h); /* show fb1 */ console_lock(); osd_blank(0, fb_dev->fb_info); console_unlock(); op_info->color = 0x555555ff; op_info->dst_rect.x = (vinfo->width / 2) - progress_bar.bar_width; op_info->dst_rect.y = ((vinfo->field_height ? vinfo->field_height : vinfo->height) * 9) / 10; op_info->dst_rect.w = progress_bar.bar_width * 2; op_info->dst_rect.h = progress_bar.bar_height; pr_debug("fill==dst:%d-%d-%d-%d\n", op_info->dst_rect.x, op_info->dst_rect.y, op_info->dst_rect.w, op_info->dst_rect.h); fillrect(context, op_info->dst_rect.x, op_info->dst_rect.y, op_info->dst_rect.w, op_info->dst_rect.h, op_info->color); } else { pr_debug("fb1 init failed, exit!!!"); return -EFAULT; } /* initial op info before draw actrualy */ op_info->dst_rect.x += progress_bar.bar_border; op_info->dst_rect.y += progress_bar.bar_border; op_info->dst_rect.w = (progress_bar.bar_width - progress_bar.bar_border) * 2 * step/100; op_info->dst_rect.h = progress_bar.bar_height - progress_bar.bar_border * 2; op_info->color = 0xffffff; return 0; }