// SPDX-License-Identifier: GPL-2.0-or-later /* * Generic System Framebuffers * Copyright (c) 2012-2013 David Herrmann <dh.herrmann@gmail.com>
*/
/* * simple-framebuffer probing * Try to convert "screen_info" into a "simple-framebuffer" compatible mode. * If the mode is incompatible, we return "false" and let the caller create * legacy nodes instead.
*/
/* * If the 64BIT_BASE capability is set, ext_lfb_base will contain the * upper half of the base address. Assemble the address, then make sure * it is valid and we can actually access it.
*/
base = si->lfb_base; if (si->capabilities & VIDEO_CAPABILITY_64BIT_BASE)
base |= (u64)si->ext_lfb_base << 32; if (!base || (u64)(resource_size_t)base != base) {
printk(KERN_DEBUG "sysfb: inaccessible VRAM base\n"); return ERR_PTR(-EINVAL);
}
/* * Don't use lfb_size as IORESOURCE size, since it may contain the * entire VMEM, and thus require huge mappings. Use just the part we * need, that is, the part where the framebuffer is located. But verify * that it does not exceed the advertised VMEM. * Note that in case of VBE, the lfb_size is shifted by 16 bits for * historical reasons.
*/
size = si->lfb_size; if (si->orig_video_isVGA == VIDEO_TYPE_VLFB)
size <<= 16;
length = mode->height * mode->stride; if (length > size) {
printk(KERN_WARNING "sysfb: VRAM smaller than advertised\n"); return ERR_PTR(-EINVAL);
}
length = PAGE_ALIGN(length);
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.