void TexPacket::alloc(unsigned int _width, unsigned int _height) { width = _width; height = _height; if (tex || fb) { WARNING("WARNING: TexPacket::alloc on non-zero tex/fb: " << tex << "/" << fb); } if (width > 10000 || height > 10000) { assert(0); } alloc_tex(width, height, tex); alloc_fb(tex, fb); Graphics::gl_errors("TexPacket::alloc"); }
int video_reserve(ulong *addrp) { struct udevice *dev; ulong size; gd->video_top = *addrp; for (uclass_find_first_device(UCLASS_VIDEO, &dev); dev; uclass_find_next_device(&dev)) { size = alloc_fb(dev, addrp); debug("%s: Reserving %lx bytes at %lx for video device '%s'\n", __func__, size, *addrp, dev->name); } gd->video_bottom = *addrp; debug("Video frame buffers from %lx to %lx\n", gd->video_bottom, gd->video_top); return 0; }
/* Post-relocation, allocate memory for the frame buffer */ static int video_post_bind(struct udevice *dev) { ulong addr = gd->video_top; ulong size; /* Before relocation there is nothing to do here */ if ((!gd->flags & GD_FLG_RELOC)) return 0; size = alloc_fb(dev, &addr); if (addr < gd->video_bottom) { /* Device tree node may need the 'u-boot,dm-pre-reloc' tag */ printf("Video device '%s' cannot allocate frame buffer memory -ensure the device is set up before relocation\n", dev->name); return -ENOSPC; } debug("%s: Claiming %lx bytes at %lx for video device '%s'\n", __func__, size, addr, dev->name); gd->video_bottom = addr; return 0; }