Esempio n. 1
0
static void show_all(struct nvhost_master *m, struct output *o)
{
	nvhost_module_busy(m->dev);

	m->op.debug.show_mlocks(m, o);
	show_syncpts(m, o);
	show_channels(m, o);

	nvhost_module_idle(m->dev);
}
Esempio n. 2
0
File: debug.c Progetto: 020gzh/linux
static void show_all_no_fifo(struct host1x *host1x, struct output *o)
{
	struct host1x_channel *ch;

	host1x_hw_show_mlocks(host1x, o);
	show_syncpts(host1x, o);
	host1x_debug_output(o, "---- channels ----\n");

	host1x_for_each_channel(host1x, ch)
		show_channels(ch, o, false);
}
Esempio n. 3
0
File: debug.c Progetto: 020gzh/linux
static void show_all(struct host1x *m, struct output *o)
{
	struct host1x_channel *ch;

	host1x_hw_show_mlocks(m, o);
	show_syncpts(m, o);
	host1x_debug_output(o, "---- channels ----\n");

	host1x_for_each_channel(m, ch)
		show_channels(ch, o, true);
}
Esempio n. 4
0
int
main(int argc, char **argv)
{
	pthread_t signal_thread;
	static thread_data tdata;
	int result;
	int option_index;
	struct option long_options[] = {
		{ "bell",	   0, NULL, 'b'},
		{ "help",	   0, NULL, 'h'},
		{ "version",   0, NULL, 'v'},
		{ "list",	   0, NULL, 'l'},
		{ "driver",    1, NULL, 'd'},
		{0, 0, NULL, 0} /* terminate */
	};

	tdata.hModule = NULL;
	tdata.dwSpace = 0;
	tdata.table = NULL;
	char *driver = NULL;
	boolean use_bell = FALSE;

	while((result = getopt_long(argc, argv, "bhvln:d:",
								long_options, &option_index)) != -1) {
		switch(result) {
		case 'b':
			use_bell = TRUE;
			break;
		case 'h':
			fprintf(stderr, "\n");
			show_usage(argv[0]);
			fprintf(stderr, "\n");
			show_options();
			fprintf(stderr, "\n");
			show_channels();
			fprintf(stderr, "\n");
			exit(0);
			break;
		case 'v':
			fprintf(stderr, "%s %s\n", argv[0], version);
			fprintf(stderr, "signal check utility for BonDriver based tuners.\n");
			exit(0);
			break;
		case 'l':
			show_channels();
			exit(0);
			break;
		case 'd':
			driver = optarg;
			break;
		}
	}

	if(argc - optind < 1) {
		fprintf(stderr, "channel must be specified!\n");
		fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]);
		return 1;
	}

	/* set tune_persistent flag */
	tdata.tune_persistent = TRUE;

	/* spawn signal handler thread */
	init_signal_handlers(&signal_thread, &tdata);

	/* tune */
	if(tune(argv[optind], &tdata, driver) != 0)
		return 1;

	while(1) {
		if(f_exit)
			break;
		tdata.pIBon->PurgeTsStream();	// 凡ドラはCh設定時からストリームデータをバッファに溜め込むため追加
		/* show signal strength */
		calc_cn(&tdata, use_bell);
		sleep(1);
	}

	/* wait for signal thread */
	pthread_kill(signal_thread, SIGUSR1);
	pthread_join(signal_thread, NULL);

	/* close tuner */
	if(close_tuner(&tdata) != 0)
		return 1;

	return 0;
}
Esempio n. 5
0
int
main(int argc, char **argv)
{
    int msqid;
    int msgflg = IPC_CREAT | 0666;
    key_t key = 0;
    char *channel = NULL;
    int ch=0, recsec = 0, extsec=0;
    message_buf sbuf;
    size_t buf_length;

    int result;
    int option_index;
    struct option long_options[] = {
        { "pid",       1, NULL, 'p'},
        { "channel",   1, NULL, 'c'},
        { "extend",    1, NULL, 'e'},
        { "time",      1, NULL, 't'},
        { "help",      0, NULL, 'h'},
        { "version",   0, NULL, 'v'},
        { "list",      0, NULL, 'l'},
        {0, 0, NULL, 0} /* terminate */
    };

    while((result = getopt_long(argc, argv, "p:c:e:t:hvl",
                                long_options, &option_index)) != -1) {
        switch(result) {
        case 'h':
            fprintf(stderr, "\n");
            show_usage(argv[0]);
            fprintf(stderr, "\n");
            show_options();
            fprintf(stderr, "\n");
            show_channels();
            fprintf(stderr, "\n");
            exit(0);
            break;
        case 'v':
            fprintf(stderr, "%s %s\n", argv[0], version);
            fprintf(stderr, "control command for recpt1.\n");
            exit(0);
            break;
        case 'l':
            show_channels();
            exit(0);
            break;
        /* following options require argument */
        case 'p':
            key = (key_t)atoi(optarg);
            fprintf(stderr, "Pid = %d\n", key);
            break;
        case 'c':
            channel = optarg;
            ch = atoi(channel);
            if (ch)
                fprintf(stderr, "Channel = %d\n", ch);
            else
                fprintf(stderr, "Channel = %s\n", channel);
            break;
        case 'e':
            parse_time(optarg, &extsec);
            fprintf(stderr, "Extend %d sec\n", extsec);
            break;
        case 't':
            parse_time(optarg, &recsec);
            fprintf(stderr, "Total recording time = %d sec\n", recsec);
            break;
        }
    }

    if(!key) {
        fprintf(stderr, "Arguments are necessary!\n");
        fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]);
        exit(1);
    }

    if ((msqid = msgget(key, msgflg )) < 0) {
        perror("msgget");
        exit(1);
    }

    sbuf.mtype = 1;
    if (ch)
        sprintf(sbuf.mtext, "ch=%d t=%d e=%d", ch, recsec, extsec);
    else
        sprintf(sbuf.mtext, "ch=%s t=%d e=%d", channel, recsec, extsec);

    buf_length = strlen(sbuf.mtext) + 1 ;

    if (msgsnd(msqid, &sbuf, buf_length, IPC_NOWAIT) < 0) {
        perror("msgsnd");
        exit(1);
    }

    exit(0);
}