/* * We hold a reference to the fb_info in file->private_data, * but if the current registered fb has changed, we don't * actually want to use it. * * So look up the fb_info using the inode minor number, * and just verify it against the reference we have.
*/ staticstruct fb_info *file_fb_info(struct file *file)
{ struct inode *inode = file_inode(file); int fbidx = iminor(inode); struct fb_info *info = registered_fb[fbidx];
if (info != file->private_data)
info = NULL; return info;
}
if (!info) return -ENODEV;
fb = info->fbops; switch (cmd) { case FBIOGET_VSCREENINFO: case FBIOPUT_VSCREENINFO: case FBIOPAN_DISPLAY: case FBIOGET_CON2FBMAP: case FBIOPUT_CON2FBMAP:
arg = (unsignedlong) compat_ptr(arg);
fallthrough; case FBIOBLANK:
ret = do_fb_ioctl(info, cmd, arg); break;
case FBIOGET_FSCREENINFO:
ret = fb_get_fscreeninfo(info, cmd, arg); break;
case FBIOGETCMAP: case FBIOPUTCMAP:
ret = fb_getput_cmap(info, cmd, arg); break;
default: if (fb->fb_compat_ioctl)
ret = fb->fb_compat_ioctl(info, cmd, arg); break;
} return ret;
} #endif
if (fb_WARN_ON_ONCE(info, !info->fbops->fb_mmap)) return -ENODEV;
mutex_lock(&info->mm_lock);
res = info->fbops->fb_mmap(info, vma);
mutex_unlock(&info->mm_lock);
return res;
}
staticint fb_open(struct inode *inode, struct file *file)
__acquires(&info->lock)
__releases(&info->lock)
{ int fbidx = iminor(inode); struct fb_info *info; int res = 0;
info = get_fb_info(fbidx); if (!info) {
request_module("fb%d", fbidx);
info = get_fb_info(fbidx); if (!info) return -ENODEV;
} if (IS_ERR(info)) return PTR_ERR(info);
lock_fb_info(info); if (!try_module_get(info->fbops->owner)) {
res = -ENODEV; goto out;
}
file->private_data = info; if (info->fbops->fb_open) {
res = info->fbops->fb_open(info, 1); if (res)
module_put(info->fbops->owner);
} #ifdef CONFIG_FB_DEFERRED_IO if (info->fbdefio)
fb_deferred_io_open(info, inode, file); #endif
out:
unlock_fb_info(info); if (res)
put_fb_info(info); return res;
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.17Bemerkung:
(vorverarbeitet am 2026-06-07)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.