码迷,mamicode.com
首页 > 其他好文 > 详细

xorg初始化过程,没有配置文件,用默认值

时间:2015-02-14 22:40:17      阅读:303      评论:0      收藏:0      [点我收藏+]

标签:内核编译

[    32.314] (==) No screen section available. Using defaults.
[    32.314] (**) |-->Screen "Default Screen Section" (0)
[    32.314] (**) |   |-->Monitor "<default monitor>"
[    32.315] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.


static Bool

configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
             MessageType from)
{
    int count = 0;
    XF86ConfDisplayPtr dispptr;
    XF86ConfAdaptorLinkPtr conf_adaptor;
    Bool defaultMonitor = FALSE;
    XF86ConfScreenRec local_conf_screen;

    if (!conf_screen) {
        memset(&local_conf_screen, 0, sizeof(local_conf_screen));
        conf_screen = &local_conf_screen;
        conf_screen->scrn_identifier = "Default Screen Section";
        xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n");
    }

    xf86Msg(from, "|-->Screen \"%s\" (%d)\n", conf_screen->scrn_identifier,
            scrnum);
    /*
     * now we fill in the elements of the screen
     */
    screenp->id = conf_screen->scrn_identifier;
    screenp->screennum = scrnum;
    screenp->defaultdepth = conf_screen->scrn_defaultdepth;
    screenp->defaultbpp = conf_screen->scrn_defaultbpp;
    screenp->defaultfbbpp = conf_screen->scrn_defaultfbbpp;
    screenp->monitor = xnfcalloc(1, sizeof(MonRec));
    /* If no monitor is specified, create a default one. */
    if (!conf_screen->scrn_monitor) {
        XF86ConfMonitorRec defMon;

        memset(&defMon, 0, sizeof(defMon));
        defMon.mon_identifier = "<default monitor>";
        if (!configMonitor(screenp->monitor, &defMon))
            return FALSE;
        defaultMonitor = TRUE;
    }
    else {
        if (!configMonitor(screenp->monitor, conf_screen->scrn_monitor))
            return FALSE;
    }
    /* Configure the device. If there isn‘t one configured, attach to the
     * first inactive one that we can configure. If there‘s none that work,
     * set it to NULL so that the section can be autoconfigured later */
    screenp->device = xnfcalloc(1, sizeof(GDevRec));
    if ((!conf_screen->scrn_device) && (xf86configptr->conf_device_lst)) {
        conf_screen->scrn_device = xf86configptr->conf_device_lst;
        xf86Msg(X_DEFAULT, "No device specified for screen \"%s\".\n"
                "\tUsing the first device section listed.\n", screenp->id);
    }
    if (configDevice(screenp->device, conf_screen->scrn_device, TRUE)) {
        screenp->device->myScreenSection = screenp;
    }
    else {
        screenp->device = NULL;
    }
    screenp->options = conf_screen->scrn_option_lst;

    /*
     * figure out how many display subsections there are and fill them in
     */
    dispptr = conf_screen->scrn_display_lst;
    while (dispptr) {
        count++;
        dispptr = (XF86ConfDisplayPtr) dispptr->list.next;
    }
    screenp->displays = xnfalloc((count) * sizeof(DispRec));
    screenp->numdisplays = count;

    /* Fill in the default Virtual size, if any */
    if (conf_screen->scrn_virtualX && conf_screen->scrn_virtualY) {
        for (count = 0, dispptr = conf_screen->scrn_display_lst;
             dispptr;
             dispptr = (XF86ConfDisplayPtr) dispptr->list.next, count++) {
            screenp->displays[count].virtualX = conf_screen->scrn_virtualX;
            screenp->displays[count].virtualY = conf_screen->scrn_virtualY;
        }
    }

    /* Now do the per-Display Virtual sizes */
    count = 0;
    dispptr = conf_screen->scrn_display_lst;
    while (dispptr) {
        configDisplay(&(screenp->displays[count]), dispptr);
        count++;
        dispptr = (XF86ConfDisplayPtr) dispptr->list.next;
    }

    /*
     * figure out how many videoadaptor references there are and fill them in
     */
    conf_adaptor = conf_screen->scrn_adaptor_lst;
    while (conf_adaptor) {
        count++;
        conf_adaptor = (XF86ConfAdaptorLinkPtr) conf_adaptor->list.next;
    }
    screenp->xvadaptors = xnfalloc((count) * sizeof(confXvAdaptorRec));
    screenp->numxvadaptors = 0;
    conf_adaptor = conf_screen->scrn_adaptor_lst;
    while (conf_adaptor) {
        if (configXvAdaptor(&(screenp->xvadaptors[screenp->numxvadaptors]),
                            conf_adaptor->al_adaptor))
            screenp->numxvadaptors++;
        conf_adaptor = (XF86ConfAdaptorLinkPtr) conf_adaptor->list.next;
    }

    if (defaultMonitor) {
        xf86Msg(X_DEFAULT, "No monitor specified for screen \"%s\".\n"
                "\tUsing a default monitor configuration.\n", screenp->id);
    }
    return TRUE;
}

xorg初始化过程,没有配置文件,用默认值

标签:内核编译

原文地址:http://blog.csdn.net/oldlinux/article/details/43820455

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!