Example #1
0
int board_init(void)
{
	/* address of boot parameters */
	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;

	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
	setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info_loc);
	setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info3);

#if defined(CONFIG_VIDEO_IPUV3)
	setup_display();
#endif

#ifdef CONFIG_TDX_CMD_IMX_MFGR
	(void) pmic_init();
#endif

#ifdef CONFIG_SATA
	setup_sata();
#endif

	setup_iomux_gpio();

	return 0;
}
Example #2
0
int board_init(void)
{
	/* address of boot parameters */
	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;

#ifdef CONFIG_VIDEO_IPUV3
	setup_display();
#endif
#ifdef CONFIG_SYS_I2C
	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info0);
	setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
	setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);
#endif
#ifdef CONFIG_DWC_AHSATA
	setup_sata();
#endif
#ifdef CONFIG_CMD_BMODE
	add_board_boot_modes(board_boot_modes);
#endif
#ifdef CONFIG_USB_EHCI_MX6
	imx_iomux_v3_setup_multiple_pads(
		usb_otg_pads, ARRAY_SIZE(usb_otg_pads));
#endif
	return 0;
}
Example #3
0
static void
global_setup (void)
{
    setup_stack (&parse_stack, parse_stack_buffer,
                 sizeof (parse_stack_buffer));
    setup_display ();
    setup_sgf ();

    set_defaults();
    if (configfile_load(SETTINGS_FILENAME, config,
                        sizeof(config)/sizeof(*config),
                        SETTINGS_MIN_VERSION ) < 0)
    {
        /* If the loading failed, save a new config file (as the disk is
           already spinning) */

        /* set defaults again just in case (don't know if they can ever
         * be messed up by configfile_load, and it's basically free anyway)
         */
        set_defaults();

        configfile_save(SETTINGS_FILENAME, config,
                        sizeof(config)/sizeof(*config),
                        SETTINGS_VERSION);
    }
}
Example #4
0
int main(void) {
	int i;
	int shmid;
	setup_display();
	shm_unlink(SHMOBJ_PATH);
	transfer_pixmap = (char*)malloc(DISPLAY_WIDTH * DISPLAY_HEIGHT);
	pixmap = (char*)malloc(DISPLAY_WIDTH * DISPLAY_HEIGHT);
	int shared_seg_size = DISPLAY_WIDTH * DISPLAY_HEIGHT;

	key_t key = ftok("/tmp/foo", 'A');
	shmid = shmget (key,shared_seg_size,IPC_CREAT|0600);
	if (shmid==-1) {
	    perror("shmget");
	    exit(1);
	  }

	pixmap = shmat(shmid, 0, 0);

	memset(transfer_pixmap, 0, DISPLAY_WIDTH * DISPLAY_HEIGHT);
	memset(pixmap, 0, DISPLAY_WIDTH * DISPLAY_HEIGHT);

	int x, y;

	while (1) {
		pixmap_to_strange_pixmap();
		push_foo();
	}

}
int board_init(void)
{
	/* address of boot parameters */
	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;

	/* I2C 2 and 3 setup - I2C 3 hw mux with EIM */
	if (is_mx6dq() || is_mx6dqp())
		setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &mx6q_i2c_pad_info1);
	else
		setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &mx6dl_i2c_pad_info1);
	/* I2C 3 Steer */
	gpio_direction_output(IMX_GPIO_NR(5, 4), 1);
	SETUP_IOMUX_PADS(i2c3_pads);
#ifndef CONFIG_SYS_FLASH_CFI
	if (is_mx6dq() || is_mx6dqp())
		setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &mx6q_i2c_pad_info2);
	else
		setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &mx6dl_i2c_pad_info2);
#endif
	gpio_direction_output(IMX_GPIO_NR(1, 15), 1);
	SETUP_IOMUX_PADS(port_exp);

#ifdef CONFIG_VIDEO_IPUV3
	setup_display();
#endif

#ifdef CONFIG_MTD_NOR_FLASH
	setup_iomux_eimnor();
#endif
	return 0;
}
int board_early_init_f(void)
{
	setup_iomux_uart();
	setup_iomux_gpio();

	setup_display();
	return 0;
}
int board_early_init_f(void)
{
	setup_iomux_uart();
#if defined(CONFIG_VIDEO_IPUV3)
	setup_display();
#endif
	return 0;
}
int board_early_init_f(void)
{
	setup_iomux_uart();
	setup_iomux_gpio();

	gpio_direction_output(SOFT_RESET_GPIO, 1);
	gpio_direction_output(SD2_DRIVER_ENABLE, 1);
	setup_display();
	set_gpr_register();
	return 0;
}
int board_early_init_f(void)
{
	setup_iomux_uart();

	imx_iomux_v3_setup_multiple_pads(init_pads, ARRAY_SIZE(init_pads));
	setup_buttons();

#if defined(CONFIG_VIDEO_IPUV3)
	setup_display();
#endif
	return 0;
}
Example #10
0
int board_early_init_f(void)
{
	setup_iomux_uart();

#ifdef CONFIG_SYS_USE_NAND
    setup_gpmi_nand();
#endif

#if defined(CONFIG_VIDEO_IPUV3)
	setup_display();
#endif
	return 0;
}
Example #11
0
int board_init(void)
{
	int ret = 0;

	/* address of boot parameters */
	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;

#ifdef CONFIG_VIDEO_IPUV3
	ret = setup_display();
#endif

	return ret;
}
Example #12
0
int board_early_init_f(void)
{
	setup_iomux_uart();
#if defined(CONFIG_VIDEO_IPUV3)
	setup_display();
#endif
#ifdef CONFIG_CMD_SATA
	/* Only mx6q wandboard has SATA */
	if (is_cpu_type(MXC_CPU_MX6Q))
		setup_sata();
#endif

	return 0;
}
int board_early_init_f(void)
{
	int ret = 0;
	setup_iomux_uart();

#ifdef CONFIG_VIDEO_IPUV3
	ret = setup_display();
#endif

#ifdef CONFIG_USB_EHCI_MX6
	setup_usb();
#endif
	return ret;
}
Example #14
0
int board_init(void)
{
	/* Address of boot parameters */
	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;

#ifdef CONFIG_NAND_MXS
	setup_gpmi_nand();
#endif

#ifdef CONFIG_VIDEO_IPUV3
	setup_display();
#endif

	return 0;
}
Example #15
0
int board_early_init_f(void)
{
	imx_iomux_v3_setup_multiple_pads(pwr_intb_pads,
					 ARRAY_SIZE(pwr_intb_pads));
#ifndef CONFIG_TDX_APALIS_IMX6_V1_0
	setup_iomux_dte_uart();
#else
	setup_iomux_dce_uart();
#endif

#if defined(CONFIG_VIDEO_IPUV3)
	setup_display();
#endif
	return 0;
}
int board_early_init_f(void)
{
	setup_iomux_uart();

	/* Disable wl1271 */
	gpio_direction_input(WL12XX_WL_IRQ_GP);
	gpio_direction_output(WL12XX_WL_ENABLE_GP, 0);
	gpio_direction_output(WL12XX_BT_ENABLE_GP, 0);

	imx_iomux_v3_setup_multiple_pads(wl12xx_pads, ARRAY_SIZE(wl12xx_pads));

#if defined(CONFIG_VIDEO_IPUV3)
	setup_display();
#endif
	return 0;
}
Example #17
0
bool
set_size_board (int width, int height)
{
    if (width < MIN_BOARD_SIZE || width > MAX_BOARD_SIZE ||
        height < MIN_BOARD_SIZE || height > MAX_BOARD_SIZE)
    {
        return false;
    }
    else
    {
        board_width = width;
        board_height = height;
        setup_display ();
        return true;
    }
}
Example #18
0
static void *
petri_init (Display *dpy, Window win)
{
    struct state *st = (struct state *) calloc (1, sizeof(*st));
    st->dpy = dpy;
    st->window = win;

    st->delay = get_integer_resource (st->dpy, "delay", "Delay");
    st->orthlim = 1;

    setup_display (st);
    setup_arr (st);
    randblip (st, 1);
    
    return st;
}
Example #19
0
int board_early_init_f(void)
{
    setup_iomux_uart();

    set_gpios(gpios_out_high, ARRAY_SIZE(gpios_out_high), 1);
    set_gpios(gpios_out_low, ARRAY_SIZE(gpios_out_low), 0);
    gpio_direction_input(WL12XX_WL_IRQ_GP);

    imx_iomux_v3_setup_multiple_pads(wl12xx_pads, ARRAY_SIZE(wl12xx_pads));
    imx_iomux_v3_setup_multiple_pads(init_pads, ARRAY_SIZE(init_pads));
    setup_buttons();

#if defined(CONFIG_VIDEO_IPUV3)
    setup_display();
#endif
    return 0;
}
Example #20
0
int board_early_init_f(void)
{
	setup_iomux_uart();
#if defined(CONFIG_VIDEO_IPUV3)
	setup_display();
#endif

#ifdef CONFIG_SYS_USE_SPINOR
	setup_spinor();
#endif

#ifdef CONFIG_CMD_SATA
	setup_sata();
#endif

	return 0;
}
Example #21
0
int board_early_init_f(void)
{
	setup_iomux_uart();

	/* Disable wl1271 For Nitrogen6w */
	gpio_direction_input(WL12XX_WL_IRQ_GP);
	gpio_direction_output(WL12XX_WL_ENABLE_GP, 0);
	gpio_direction_output(WL12XX_BT_ENABLE_GP, 0);
	gpio_direction_output(GP_USB_OTG_PWR, 0); /* OTG power off */

	imx_iomux_v3_setup_multiple_pads(wl12xx_pads, ARRAY_SIZE(wl12xx_pads));
	setup_buttons();

#if defined(CONFIG_VIDEO_IPUV3)
	setup_display();
#endif
	return 0;
}
int board_early_init_f(void)
{
	setup_iomux_uart();

	imx_iomux_v3_setup_multiple_pads(usb_pads, ARRAY_SIZE(usb_pads));

	/* Disable WiFi/BT */
	gpio_direction_input(WIFI_WL_IRQ_GP);
	gpio_direction_output(WIFI_WL_ENABLE_GP, 0);
	gpio_direction_output(WIFI_BT_ENABLE_GP, 0);
	gpio_direction_output(WIFI_BT_REG_ON, 0);

	imx_iomux_v3_setup_multiple_pads(wifi_pads, ARRAY_SIZE(wifi_pads));

#if defined(CONFIG_VIDEO_IPUV3)
	setup_display();
#endif
	return 0;
}
Example #23
0
int board_init(void)
{
	/* address of boot parameters */
	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;

#ifdef CONFIG_MXC_SPI
	setup_spi();
#endif
	if (is_mx6dq() || is_mx6dqp())
		setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &mx6q_i2c_pad_info1);
	else
		setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &mx6dl_i2c_pad_info1);
#if defined(CONFIG_VIDEO_IPUV3)
	setup_display();
#endif
#ifdef CONFIG_USB_EHCI_MX6
	setup_usb();
#endif

	return 0;
}
Example #24
0
int board_early_init_f(void)
{
    u32 cputype = cpu_type(get_cpu_rev());

    switch (cputype) {
    case MXC_CPU_MX6SOLO:
        board_type = BOARD_IS_RIOTBOARD;
        break;
    case MXC_CPU_MX6D:
        board_type = BOARD_IS_MARSBOARD;
        break;
    }

    setup_iomux_uart();

    if (board_type == BOARD_IS_RIOTBOARD)
        imx_iomux_v3_setup_multiple_pads(
            tft_pads_riot, ARRAY_SIZE(tft_pads_riot));
    else if (board_type == BOARD_IS_MARSBOARD)
        imx_iomux_v3_setup_multiple_pads(
            tft_pads_mars, ARRAY_SIZE(tft_pads_mars));
#if defined(CONFIG_VIDEO_IPUV3)
    /* power ON LCD */
    gpio_direction_output(IMX_GPIO_NR(1, 29) , 1);
    /* touch interrupt is an input */
    gpio_direction_input(IMX_GPIO_NR(6, 14));
    /* power ON backlight */
    gpio_direction_output(IMX_GPIO_NR(6, 15) , 1);
    /* set backlight level to off */
    if (board_type == BOARD_IS_RIOTBOARD)
        gpio_direction_output(IMX_GPIO_NR(1, 18) , 0);
    else if (board_type == BOARD_IS_MARSBOARD)
        gpio_direction_output(IMX_GPIO_NR(2, 10) , 0);
    setup_display();
#endif

    return 0;
}
Example #25
0
void init_data(gamedata &g){

  init_gameconstants(g);

  init_gamedata(g);

  // save the config
  saveConfig(ap_home, "apricots.cfg", g);

  // Set Random seed
  srand(time(0));

  /* Initialize defaults, Video and Audio */
  if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK)==-1)){
    fprintf(stderr, "Could not initialize SDL: %s.\n", SDL_GetError());
    exit(-1);
  }

  SDL_JoystickEventState(SDL_ENABLE);

  setup_display(g);

  // Set Window title
  SDL_WM_SetCaption("Apricots", NULL);

  // Hide cursor
  SDL_ShowCursor(0);
  
  load_shapes(g, g.images);

  load_font(g.virtualscreen, g.whitefont, g.greenfont);
  
  init_sound(g.sound);

  loadPlaneInfo(g);

}
Example #26
0
int main() {

    //-----------------------------------------------------
    // SFML and rendering setup
    //-----------------------------------------------------
    setup_display();

    //-----------------------------------------------------
    // Main game loop
    //-----------------------------------------------------
    while (running) {

        //Get the time at the beginning of the frame
        start = std::chrono::steady_clock::now();

        process_input();
        update();

        //Only render one in 2 frames
        if(frame_count++%2==0){
            render();
        }

        //Calculate how long the frame took to process
        end = std::chrono::steady_clock::now();
        long long microseconds = std::chrono::duration_cast<std::chrono::microseconds>(end-start).count();

        //Sleep if the processing took less than what is necessary to achieve 60 FPS
        if(( MICRO_SECONDS_PER_FRAME - microseconds ) > 0){
            usleep((MICRO_SECONDS_PER_FRAME - microseconds));
        }

    }

    return 0;
}
Example #27
0
unsigned int mfb_get_screen_size() {
	setup_display();
	return (s_screen_width << 16) | s_screen_height;
}
Example #28
0
void* mfb_open(const char* title, int width, int height, unsigned int flags, int scale)
{
	XSetWindowAttributes windowAttributes;
	XSizeHints sizeHints;
	XImage* image;
	Window window;
	WindowInfo* window_info;

	if (!setup_display()) {
		return 0;
	}

	//TODO: Handle no title/borderless 
	(void)flags;

	width *= scale;
	height *= scale;

	Window defaultRootWindow = DefaultRootWindow(s_display);

	windowAttributes.border_pixel = BlackPixel(s_display, s_screen);
	windowAttributes.background_pixel = BlackPixel(s_display, s_screen);
	windowAttributes.backing_store = NotUseful;

	window = XCreateWindow(s_display, defaultRootWindow, (s_screen_width - width) / 2,
					(s_screen_height - height) / 2, width, height, 0, s_depth, InputOutput,
					s_visual, CWBackPixel | CWBorderPixel | CWBackingStore,
					&windowAttributes);
	if (!window) {
		printf("Unable to create X11 Window\n");
		return 0;
	}

	//XSelectInput(s_display, s_window, KeyPressMask | KeyReleaseMask);
	XStoreName(s_display, window, title);

	XSelectInput(s_display, window, ButtonPressMask | KeyPressMask | KeyReleaseMask | ButtonReleaseMask);

	if (!(flags & WINDOW_RESIZE)) {
		sizeHints.flags = PPosition | PMinSize | PMaxSize;
		sizeHints.x = 0;
		sizeHints.y = 0;
		sizeHints.min_width = width;
		sizeHints.max_width = width;
		sizeHints.min_height = height;
		sizeHints.max_height = height;
  		XSetWMNormalHints(s_display, window, &sizeHints);
	}

  	XClearWindow(s_display, window);
  	XMapRaised(s_display, window);
	XFlush(s_display);

	image = XCreateImage(s_display, CopyFromParent, s_depth, ZPixmap, 0, NULL, width, height, 32, width * 4);

	if (!image) {
		XDestroyWindow(s_display, window);
		printf("Unable to create XImage\n");
		return 0;
	}

	window_info = (WindowInfo*)malloc(sizeof(WindowInfo));
	window_info->key_callback = 0;
	window_info->rust_data = 0;
	window_info->window = window;
	window_info->ximage = image;
	window_info->scale = scale;
	window_info->width = width;
	window_info->height = height;
	window_info->draw_buffer = malloc(width * height * 4);
	window_info->update = 1;

	XSetWMProtocols(s_display, window, &s_wm_delete_window, 1);

	XSaveContext(s_display, window, s_context, (XPointer) window_info);

	image->data = (char*)window_info->draw_buffer;

	s_window_count += 1;

	return (void*)window_info;
}
Example #29
0
void main(int argc, char **argv)
{
      int i=21,forcer=0; /* init variables. */
      Display *p_disp;
      FILE *fpo;
      char text[]="MultiSliceRTPsession0";

    /* Create the top-level shell widget and initialize the toolkit */
    argcount = 0;
    XtSetArg(args[argcount], XmNallowShellResize, False); argcount++;
    XtSetArg(args[argcount], XmNtitle,       APP_TITLE); argcount++;
    XtSetArg(args[argcount], XmNiconName,   ICON_TITLE); argcount++;
    top_level = XtAppInitialize(&app, "Slice", NULL, 0,
                                &argc, argv, NULL, args, argcount);
    theAppName = argv[0];

    #include "command_slice.c"
 
    /* Create the main window widget */
    argcount = 0;
/*    XtSetArg(args[argcount], XmNwidth ,  WIDTH); argcount++;
      XtSetArg(args[argcount], XmNheight, HEIGHT); argcount++; */
    main_window = XmCreateRowColumn(top_level, "Main", args, argcount);
    XtManageChild(main_window);
    p_disp=XtDisplay(main_window);
if(forcer != 1)
{
/*      if(XFetchBytes(p_disp,&i) != NULL){ if(i==21){
      fprintf(stderr,"\nOnly one copy of MultiSlice can run at one time...\nslice -forceload will forcibly load a second copy.\nSelf-Destruct Initialised...\nSecond copy destructed...OK\n");
      XtCloseDisplay(XtDisplay(main_window));exit(-1);}}
      i=21; XStoreBytes(p_disp,text,i); */
if((fopen("slicetempyhsTN","r")) != 0){
      fprintf(stderr,"\nOnly one copy of MultiSlice RTP can run at one time...\nslice -forceload will forcibly load a second copy if \n the first one was terminated incorrectly.\n");
      system("cat slicetempyhsTN");
      fprintf(stderr,"\nSelf-destruct initialised...\nSecond copy destructed...OK\n");
      XtCloseDisplay(XtDisplay(main_window));exit(-1);}}
      i=0;
      strcpy(tempfileold,"slicetempyhsT");
      strcpy(tempfilenew,"slicetempyhsT");
      addcharac[1]='\0';
      strcat(tempfilenew,addcharac);
      system("echo First copy of MultiSliceRTP started at :- >slicetempyhsTN");
      system("date >>slicetempyhsTN");
      for(i=0;i<11;i++){yhs_filename[i]=0;squash[i]=0;squash[i+10]=0;} 
      i=0;
fprintf(stderr,"\n\n-------------------MultiSlice RTP Status Messages-------------------\n");
fprintf(stderr,"Launching application...");
system("date");
fprintf(stderr,"Load and select file(s) to process...\n");

    /* Create the main menu */ 
    create_main_menu(main_window);

 
    /* Create the drawing area 1 */
    argcount = 0;
    XtSetArg(args[argcount], XmNwidth ,  IMAGE_WIDTH); argcount++;
    XtSetArg(args[argcount], XmNheight, IMAGE_HEIGHT); argcount++;
    draw_1 = XmCreateDrawingArea(top_level, "draw_1", args, argcount);
/*    XtManageChild(draw_1); */
 
    /* Create the drawing area 2 */
    argcount = 0;
    XtSetArg(args[argcount], XmNwidth ,  IMAGE_WIDTH); argcount++;
    XtSetArg(args[argcount], XmNheight, IMAGE_HEIGHT); argcount++;
    draw_2 = XmCreateDrawingArea(top_level, "draw_2", args, argcount);
/*    XtManageChild(draw_2); */
 
    /* Create a watch cursor */
    theCursor = XCreateFontCursor(XtDisplay(main_window), XC_watch);

    /* Create the icon window for the application */
    app_icon = XCreateBitmapFromData(XtDisplay(top_level),
                                     DefaultRootWindow(XtDisplay(top_level)),
                                     icon_bits, icon_width, icon_height);
    argcount = 0;
    XtSetArg(args[argcount], XmNiconPixmap, app_icon); argcount++;
    XtSetValues(top_level, args, argcount);

  
    XtAppAddTimeOut(app,2*1000,update_time,NULL); 
 
    /* Realize all widgets */
    XtRealizeWidget(top_level);

    /* Make some initializations */
    setup_display (top_level);
    create_region_list(&region_list);


    /* Event handling loop--keep processing events until done */
    XtAppMainLoop(app);


}
Example #30
0
int main(int argc, char *argv[]) {
	struct sigaction act;
	int argn = 1, ret;

	{
		const char *home = getenv("HOME");
		if (home) {
			char *conffile = xmalloc(strlen(home) + sizeof(CONFIG_FILE) + 2);
			strcpy(conffile, home);
			strcat(conffile, "/" CONFIG_FILE);
			xconfig_parse_file(evilwm_options, conffile);
			free(conffile);
		}
	}
	ret = xconfig_parse_cli(evilwm_options, argc, argv, &argn);
	if (ret == XCONFIG_MISSING_ARG) {
		fprintf(stderr, "%s: missing argument to `%s'\n", argv[0], argv[argn]);
		exit(1);
	} else if (ret == XCONFIG_BAD_OPTION) {
		if (0 == strcmp(argv[argn], "-h")
				|| 0 == strcmp(argv[argn], "--help")) {
			helptext();
			exit(0);
#ifdef STDIO
		} else if (0 == strcmp(argv[argn], "-V")
				|| 0 == strcmp(argv[argn], "--version")) {
			LOG_INFO("evilwm version " VERSION "\n");
			exit(0);
#endif
		} else {
			helptext();
			exit(1);
		}
	}

	if (opt_grabmask1) grabmask1 = parse_modifiers(opt_grabmask1);
	if (opt_grabmask2) grabmask2 = parse_modifiers(opt_grabmask2);
	if (opt_altmask) altmask = parse_modifiers(opt_altmask);

	wm_exit = 0;
	act.sa_handler = handle_signal;
	sigemptyset(&act.sa_mask);
	act.sa_flags = 0;
	sigaction(SIGTERM, &act, NULL);
	sigaction(SIGINT, &act, NULL);
	sigaction(SIGHUP, &act, NULL);

	setup_display();

	event_main_loop();

	/* Quit Nicely */
	while (clients_stacking_order)
		remove_client(clients_stacking_order->data);
	XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
	if (font) XFreeFont(dpy, font);
	{
		int i;
		for (i = 0; i < num_screens; i++) {
			ewmh_deinit_screen(&screens[i]);
			XFreeGC(dpy, screens[i].invert_gc);
			XInstallColormap(dpy, DefaultColormap(dpy, i));
		}
	}
	free(screens);
	XCloseDisplay(dpy);

	return 0;
}