int mcde_dss_enable_overlay(struct mcde_overlay *ovly) { int ret; if (!ovly->ddev->chnl_state) return -EINVAL; if (!ovly->state) { struct mcde_ovly_state *state; state = mcde_ovly_get(ovly->ddev->chnl_state); if (IS_ERR(state)) { ret = PTR_ERR(state); dev_warn(&ovly->ddev->dev, "Failed to acquire overlay\n"); return ret; } ovly->state = state; } apply_overlay(ovly, &ovly->info, true); dev_vdbg(&ovly->ddev->dev, "Overlay enabled, chnl=%d\n", ovly->ddev->chnl_id); return 0; }
int mcde_splash_txt(void) { int err = 0; struct mcde_rectangle rect; static struct mcde_ovly_state *ovly = NULL; u32 width; u32 height; u32 lcd_bpp; u8 *paddr; u32 stride; u32 xpos = 0; u32 ypos = 0; paddr = (u8 *) CONFIG_SYS_VIDEO_FB_ADRS; width = CONFIG_SYS_DISPLAY_NATIVE_X_RES; height = CONFIG_SYS_DISPLAY_NATIVE_Y_RES; lcd_bpp = 16; stride = width * lcd_bpp / 8; stride = (stride + 7) & 0xFFFFFFF8; /* pad to 64-bit boundary */ if(ovly == NULL) { /* dss_enable_overlay */ ovly = mcde_ovly_get(chnl); if (IS_ERR(ovly)) { err = PTR_ERR(ovly); printf("%s: Failed to get channel\n", __func__); return -err; } } mcde_ovly_set_source_buf(ovly, (u32) paddr); mcde_ovly_set_source_info(ovly, stride,main_display.default_pixel_format); mcde_ovly_set_source_area(ovly, 0, 0, width, height); if (width == main_display.native_x_res) xpos = 0; else xpos = (main_display.native_x_res - width) / 2; if (height == main_display.native_y_res) ypos = 0; else ypos = (main_display.native_y_res - height) / 2; mcde_ovly_set_dest_pos(ovly, xpos, ypos, 0); mcde_ovly_apply(ovly); rect.x = 0; rect.y = 0; rect.w = main_display.native_x_res; rect.h = main_display.native_y_res; mcde_chnl_update(chnl,&rect); return 0; }