void ge2dgen_const_color(ge2d_context_t *wq, unsigned color) { ge2d_dp_gen_t *dp_gen_cfg = ge2d_wq_get_dp_gen(wq); if(dp_gen_cfg->alu_const_color != color) { dp_gen_cfg->alu_const_color = color; wq->config.update_flag |= UPDATE_DP_GEN; } }
void ge2dgent_src_gbalpha(ge2d_context_t *wq, unsigned char alpha) { ge2d_dp_gen_t *dp_gen_cfg = ge2d_wq_get_dp_gen(wq); if(dp_gen_cfg->src1_gb_alpha != alpha) { dp_gen_cfg->src1_gb_alpha = alpha; wq->config.update_flag |= UPDATE_DP_GEN; } }
void ge2dgen_antiflicker(ge2d_context_t *wq,unsigned long enable) { ge2d_dp_gen_t *dp_gen_cfg = ge2d_wq_get_dp_gen(wq); enable = enable?1:0; if(dp_gen_cfg->antiflick_en != enable) { dp_gen_cfg->antiflick_en=enable; wq->config.update_flag |= UPDATE_DP_GEN; } }
void ge2dgen_src_key(ge2d_context_t *wq, int en, int key, int keymask,int keymode) { ge2d_dp_gen_t *dp_gen_cfg = ge2d_wq_get_dp_gen(wq); if(dp_gen_cfg->src1_key_en != en || dp_gen_cfg->src1_key != key || dp_gen_cfg->src1_key_mask != keymask || dp_gen_cfg->src1_key_mode != keymode) { dp_gen_cfg->src1_key_en = en&0x1; dp_gen_cfg->src1_key = key; dp_gen_cfg->src1_key_mask = keymask; dp_gen_cfg->src1_key_mode=keymode&0x1; dp_gen_cfg->src1_vsc_bank_length = 4; dp_gen_cfg->src1_hsc_bank_length = 4; wq->config.update_flag |= UPDATE_DP_GEN; } }
void ge2dgen_src(ge2d_context_t *wq, unsigned canvas_addr, unsigned format) { ge2d_src1_data_t *src1_data_cfg = ge2d_wq_get_src_data(wq); ge2d_src1_gen_t *src1_gen_cfg = ge2d_wq_get_src_gen(wq); ge2d_dp_gen_t *dp_gen_cfg = ge2d_wq_get_dp_gen(wq); ge2d_src2_dst_data_t *src2_dst_data_cfg = ge2d_wq_get_dst_data(wq); if ((format != src1_data_cfg->format_all) || (canvas_addr != src1_data_cfg->canaddr)) { src1_data_cfg->canaddr = canvas_addr; _set_src1_format(src1_data_cfg, src1_gen_cfg, dp_gen_cfg, format, src2_dst_data_cfg->dst_format_all); wq->config.update_flag |= UPDATE_SRC_DATA; wq->config.update_flag |= UPDATE_SRC_GEN; wq->config.update_flag |= UPDATE_DP_GEN; } }
static void inline _bitblt_noalpha(ge2d_context_t *wq, int src_x, int src_y, int w, int h, int dst_x, int dst_y, int block) { ge2d_cmd_t *ge2d_cmd_cfg = ge2d_wq_get_cmd(wq); ge2d_dp_gen_t *dp_gen_cfg = ge2d_wq_get_dp_gen(wq); if(dp_gen_cfg->alu_const_color != 0xff) { dp_gen_cfg->alu_const_color = 0xff; wq->config.update_flag |= UPDATE_DP_GEN; } ge2d_cmd_cfg->src1_x_start = src_x; ge2d_cmd_cfg->src1_x_end = src_x+w-1; ge2d_cmd_cfg->src1_y_start = src_y; ge2d_cmd_cfg->src1_y_end = src_y+h-1; ge2d_cmd_cfg->dst_x_start = dst_x; ge2d_cmd_cfg->dst_x_end = dst_x+w-1; ge2d_cmd_cfg->dst_y_start = dst_y; ge2d_cmd_cfg->dst_y_end = dst_y+h-1; ge2d_cmd_cfg->sc_hsc_en = 0; ge2d_cmd_cfg->sc_vsc_en = 0; ge2d_cmd_cfg->hsc_rpt_p0_num = 0; ge2d_cmd_cfg->vsc_rpt_l0_num = 0; ge2d_cmd_cfg->hsc_div_en = 0; ge2d_cmd_cfg->color_blend_mode = OPERATION_LOGIC; ge2d_cmd_cfg->color_logic_op = LOGIC_OPERATION_COPY; ge2d_cmd_cfg->alpha_blend_mode = OPERATION_LOGIC; ge2d_cmd_cfg->alpha_logic_op = LOGIC_OPERATION_SET; ge2d_cmd_cfg->wait_done_flag = block; ge2d_wq_add_work(wq); }