/* Main entry point. If the dialog for this demo doesn't yet exist, creates * it. Otherwise, destroys it. */ GtkWidget * do_changedisplay (GtkWidget *do_widget) { static ChangeDisplayInfo *info = NULL; if (!info) { GtkWidget *content_area; GtkWidget *vbox; GtkWidget *frame; info = g_new0 (ChangeDisplayInfo, 1); info->window = gtk_dialog_new_with_buttons ("Change Screen or display", GTK_WINDOW (do_widget), 0, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, "Change", GTK_RESPONSE_OK, NULL); gtk_window_set_default_size (GTK_WINDOW (info->window), 300, 400); g_signal_connect (info->window, "response", G_CALLBACK (response_cb), info); g_signal_connect (info->window, "destroy", G_CALLBACK (destroy_cb), &info); content_area = gtk_dialog_get_content_area (GTK_DIALOG (info->window)); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); frame = create_display_frame (info); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); frame = create_screen_frame (info); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); initialize_displays (info); gtk_widget_show_all (info->window); return info->window; } else { gtk_widget_destroy (info->window); return NULL; } }
static int omap_dss_probe(struct platform_device *pdev) { struct omap_dss_platform_data *pdata = pdev->dev.platform_data; int r; dss.pdev = pdev; r = get_dss_clocks(); if (r) goto fail0; dss_clk_enable_all_no_ctx(); dss.ctx_id = dss_get_ctx_id(); DSSDBG("initial ctx id %u\n", dss.ctx_id); r = dss_init(); if (r) { DSSERR("Failed to initialize DSS\n"); goto fail0; } #ifdef CONFIG_OMAP2_DSS_RFBI r = rfbi_init(); if (r) { DSSERR("Failed to initialize rfbi\n"); goto fail0; } #endif r = dpi_init(); if (r) { DSSERR("Failed to initialize dpi\n"); goto fail0; } r = dispc_init(); if (r) { DSSERR("Failed to initialize dispc\n"); goto fail0; } #ifdef CONFIG_OMAP2_DSS_VENC r = venc_init(); if (r) { DSSERR("Failed to initialize venc\n"); goto fail0; } #endif if (cpu_is_omap34xx()) { #ifdef CONFIG_OMAP2_DSS_SDI r = sdi_init(); if (r) { DSSERR("Failed to initialize SDI\n"); goto fail0; } #endif #ifdef CONFIG_OMAP2_DSS_DSI r = dsi_init(); if (r) { DSSERR("Failed to initialize DSI\n"); goto fail0; } #endif } initialize_displays(pdata); r = initialize_sysfs(&pdev->dev); if (r) goto fail0; initialize_overlays(def_disp_name); dss_clk_disable_all(); return 0; /* XXX fail correctly */ fail0: return r; }