我在我的intel图形驱动程序(i915)代码中添加了一些打印件。在构建之后,我用新的驱动程序替换了 /lib/modules/4.2.0-16-generic/kernel/drivers/gpu/drm/i915 / 中的默认驱动程序i915.ko。系统重启后,我可以看到这个驱动程序已正确加载,但dmesg没有我在驱动程序代码中添加的打印件。它似乎是从其他地方加载旧驱动程序。 以下是我在驱动程序代码中添加的一些打印件,用于验证修改后的驱动程序是否已加载。
static int __init i915_init(void)
{
printk("Inside i915_init ");
driver.num_ioctls = i915_max_ioctl;
printk("Inside i915_init ");
#if defined(CONFIG_DRM_I915_KMS)
printk("Inside i915_init ");
if (i915.modeset != 0)
driver.driver_features |= DRIVER_MODESET;
printk("Inside i915_init ");
#endif
printk("Inside i915_init ");
if (i915.modeset == 1)
driver.driver_features |= DRIVER_MODESET;
printk("Inside i915_init ");
#ifdef CONFIG_VGA_CONSOLE
printk("Inside i915_init ");
if (vgacon_text_force() && i915.modeset == -1)
driver.driver_features &= ~DRIVER_MODESET;
#endif
printk("Inside i915_init ");
if (!(driver.driver_features & DRIVER_MODESET)) {
driver.get_vblank_timestamp = NULL;
/* Silently fail loading to not upset userspace. */
DRM_DEBUG_DRIVER("KMS and UMS disabled.\n");
return 0;
}
printk("Inside i915_init ");
if (i915.nuclear_pageflip)
driver.driver_features |= DRIVER_ATOMIC;
printk("Inside i915_init ");
return drm_pci_init(&driver, &i915_pci_driver);
}