亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問板塊 發(fā)新帖
查看: 1996 | 回復(fù): 0
打印 上一主題 下一主題

DRM內(nèi)核代碼分析之二 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2009-06-20 21:54 |只看該作者 |倒序?yàn)g覽

                                                                                    話未完畢,AMD/ATI的TTM+KMS已經(jīng)進(jìn)git了……
    所以,還是得抓緊,2.6.31出來(lái),就更復(fù)雜了。GEM+TTM兩套DRM內(nèi)存管理子系統(tǒng)。開源的分裂或自由,隨你怎么想。
    接著從i915.ko的編譯文件出發(fā)。drivers/gpu/drm/i915/i915_drv.c
   
static unsigned int i915_modeset = -1;
module_param_named(modeset, i915_modeset, int, 0400);
   
    這幾行代碼,就是處理grub中,給內(nèi)核傳的參數(shù)"i915.modeset=1".
    很簡(jiǎn)單,所以看看變量“i915_modeset”如何影響代碼執(zhí)行的。直接跳到i915_init函數(shù)。
   
#if defined(CONFIG_DRM_I915_KMS)
        if (i915_modeset != 0)
                driver.driver_features |= DRIVER_MODESET;
#endif
        if (i915_modeset == 1)
                driver.driver_features |= DRIVER_MODESET;
#ifdef CONFIG_VGA_CONSOLE
        if (vgacon_text_force() && i915_modeset == -1)
                driver.driver_features &= ~DRIVER_MODESET;
#endif
   
   只是影響一些flag的。關(guān)系到KMS是否開啟。
   分析函數(shù), 大頭的是結(jié)構(gòu)體“static struct drm_driver driver”里面的函數(shù)回調(diào)。
   先貼一段:
   
static struct drm_driver driver = {
        /* don't use mtrr's here, the Xserver or user space app should
         * deal with them for intel hardware.
         */
        .driver_features =
            DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | /* DRIVER_USE_MTRR |*/
            DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM,
        .load = i915_driver_load,
        .unload = i915_driver_unload,
        .open = i915_driver_open,
        .lastclose = i915_driver_lastclose,
        .preclose = i915_driver_preclose,
        .postclose = i915_driver_postclose,
        .suspend = i915_suspend,
        .resume = i915_resume,
        .device_is_agp = i915_driver_device_is_agp,
        .enable_vblank = i915_enable_vblank,
        .irq_preinstall = i915_driver_irq_preinstall,
        .irq_postinstall = i915_driver_irq_postinstall,
        .irq_uninstall = i915_driver_irq_uninstall,
        .irq_handler = i915_driver_irq_handler,
        .reclaim_buffers = drm_core_reclaim_buffers,
        .get_map_ofs = drm_core_get_map_ofs,
        .get_reg_ofs = drm_core_get_reg_ofs,
        .master_create = i915_master_create,
        .master_destroy = i915_master_destroy,
#if defined(CONFIG_DEBUG_FS)
        .debugfs_init = i915_gem_debugfs_init,
        .debugfs_cleanup = i915_gem_debugfs_cleanup,
#endif
        .gem_init_object = i915_gem_init_object,
        .gem_free_object = i915_gem_free_object,
        .gem_vm_ops = &i915_gem_vm_ops,
        .ioctls = i915_ioctls,
        .fops = {
                 .owner = THIS_MODULE,
                 .open = drm_open,
                 .release = drm_release,
                 .ioctl = drm_ioctl,
                 .mmap = drm_gem_mmap,
                 .poll = drm_poll,
                 .fasync = drm_fasync,
#ifdef CONFIG_COMPAT
                 .compat_ioctl = i915_compat_ioctl,
#endif
        },
        .pci_driver = {
                 .name = DRIVER_NAME,
                 .id_table = pciidlist,
                 .probe = i915_pci_probe,
                 .remove = i915_pci_remove,
#ifdef CONFIG_PM
                 .resume = i915_pci_resume,
                 .suspend = i915_pci_suspend,
#endif
        },
        .name = DRIVER_NAME,
        .desc = DRIVER_DESC,
        .date = DRIVER_DATE,
        .major = DRIVER_MAJOR,
        .minor = DRIVER_MINOR,
        .patchlevel = DRIVER_PATCHLEVEL,
};
   粗略看了一下,
        .gem_init_object = i915_gem_init_object,
        .gem_free_object = i915_gem_free_object,
        .gem_vm_ops = &i915_gem_vm_ops,
        .ioctls = i915_ioctls,
        ...
        .ioctl = drm_ioctl,
        .mmap = drm_gem_mmap,
   將是分析的難點(diǎn).
   "struct drm_ioctl_desc i915_ioctls[]" 又是N多的回調(diào)函數(shù)……

   
               
               
               
               
               
               

本文來(lái)自ChinaUnix博客,如果查看原文請(qǐng)點(diǎn):http://blog.chinaunix.net/u/6547/showart_1971886.html
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP