Message ID | 20190506082649.942-1-tzimmermann@suse.de (mailing list archive) |
---|---|
Headers | show |
Series | Share TTM code among DRM framebuffer drivers | expand |
> GEM VRAM could implement PRIME helpers, which would allow for using > the generic fbcon. bochs_gem_prime_*() functions with this series applied look like you can just rename them & move over to vram helpers. It's not a full prime implementation, specifically actual export/import isn't there. But pin+vmap (needed by generic fbcon) is implemented. cheers, Gerd
On Mon, May 06, 2019 at 10:26:30AM +0200, Thomas Zimmermann wrote: > Several simple framebuffer drivers copy most of the TTM code from each > other. The implementation is always the same; except for the name of > some data structures. > > As recently discussed, this patch set provides generic memory-management > code for simple framebuffers with dedicated video memory. It further > converts the respective drivers to the generic code. The shared code > is basically the same implementation as the one copied among individual > drivers. > > The patch set contains two major changes: first, it introduces > |struct drm_gem_vram_object| and helpers (GEM VRAM). It's a GEM object > that is backed by VRAM. The type's purpose is somewhat similar to > |struct drm_gem_{cma, shmem}_object|: it provides an commom implementation > that handles all the basic cases. Second, the patch set introduces > |struct drm_vram_mm| and helpers (VRAM MM). It's an implementation of a > basic memory manager for VRAM. > > Both, GEM VRAM and VRAM MM, support buffer placement in VRAM and system > memory. Both can be used independedly from each other if desired by the > DRM driver. Looks good to me overall, some small nits in replies to patches. > Currently ast, bochs, mgag200, vboxvideo and hisilicon/hibmc can use > these helpers. I've tested bochs on qemu, works fine. What is the testing status of the other drivers? cheers, Gerd
Hi Am 06.05.19 um 14:43 schrieb Gerd Hoffmann: > On Mon, May 06, 2019 at 10:26:30AM +0200, Thomas Zimmermann wrote: >> Several simple framebuffer drivers copy most of the TTM code from each >> other. The implementation is always the same; except for the name of >> some data structures. >> >> As recently discussed, this patch set provides generic memory-management >> code for simple framebuffers with dedicated video memory. It further >> converts the respective drivers to the generic code. The shared code >> is basically the same implementation as the one copied among individual >> drivers. >> >> The patch set contains two major changes: first, it introduces >> |struct drm_gem_vram_object| and helpers (GEM VRAM). It's a GEM object >> that is backed by VRAM. The type's purpose is somewhat similar to >> |struct drm_gem_{cma, shmem}_object|: it provides an commom implementation >> that handles all the basic cases. Second, the patch set introduces >> |struct drm_vram_mm| and helpers (VRAM MM). It's an implementation of a >> basic memory manager for VRAM. >> >> Both, GEM VRAM and VRAM MM, support buffer placement in VRAM and system >> memory. Both can be used independedly from each other if desired by the >> DRM driver. > > Looks good to me overall, some small nits in replies to patches. > >> Currently ast, bochs, mgag200, vboxvideo and hisilicon/hibmc can use >> these helpers. > > I've tested bochs on qemu, works fine. Thank you! > What is the testing status of the other drivers? I've tested ast and mgag200 on hardware. I only compiled the others, including bochs. I did verify that the code I replaced is basically the same as in the new helpers. Best regards Thomas > cheers, > Gerd > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel >
Hi Am 06.05.19 um 14:22 schrieb Gerd Hoffmann: >> GEM VRAM could implement PRIME helpers, which would allow for using >> the generic fbcon. > > bochs_gem_prime_*() functions with this series applied look like you can > just rename them & move over to vram helpers. > > It's not a full prime implementation, specifically actual export/import > isn't there. But pin+vmap (needed by generic fbcon) is implemented. I did have a patch to do this, but then I read that prime requires DMA for buffer sharing and bochs works only because it's emulated. If bochs' implementation is complete enough to be useful for other drivers, I'll add it to the patch set. Best regards Thomas > cheers, > Gerd >
On Mon, May 06, 2019 at 03:09:20PM +0200, Thomas Zimmermann wrote: > Hi > > Am 06.05.19 um 14:22 schrieb Gerd Hoffmann: > >> GEM VRAM could implement PRIME helpers, which would allow for using > >> the generic fbcon. > > > > bochs_gem_prime_*() functions with this series applied look like you can > > just rename them & move over to vram helpers. > > > > It's not a full prime implementation, specifically actual export/import > > isn't there. But pin+vmap (needed by generic fbcon) is implemented. > > I did have a patch to do this, but then I read that prime requires DMA > for buffer sharing and bochs works only because it's emulated. For actual buffer sharing with other drivers yes because dma-bufs typically are a bunch of pages (struct page**) and live in RAM. Not sure whenever it is possible or useful to place the vram in ZONE_DEVICE to get page structs for it, then export buffers located in vram that way without copying them over to main memory. I suspect most importers would fail to properly setup PCI-PCI dma in that case. > If bochs' implementation is complete enough to be useful for other > drivers, I'll add it to the patch set. It's good enough for generic fbcon. cheers, Gerd
On Mon, May 06, 2019 at 04:20:34PM +0200, Gerd Hoffmann wrote: > On Mon, May 06, 2019 at 03:09:20PM +0200, Thomas Zimmermann wrote: > > Hi > > > > Am 06.05.19 um 14:22 schrieb Gerd Hoffmann: > > >> GEM VRAM could implement PRIME helpers, which would allow for using > > >> the generic fbcon. > > > > > > bochs_gem_prime_*() functions with this series applied look like you can > > > just rename them & move over to vram helpers. > > > > > > It's not a full prime implementation, specifically actual export/import > > > isn't there. But pin+vmap (needed by generic fbcon) is implemented. > > > > I did have a patch to do this, but then I read that prime requires DMA > > for buffer sharing and bochs works only because it's emulated. > > For actual buffer sharing with other drivers yes because dma-bufs > typically are a bunch of pages (struct page**) and live in RAM. > > Not sure whenever it is possible or useful to place the vram in > ZONE_DEVICE to get page structs for it, then export buffers located > in vram that way without copying them over to main memory. I suspect > most importers would fail to properly setup PCI-PCI dma in that case. Christian König is working on p2p dma-buf sharing. Not sure that's worth it for virtual devices, but could be fun to wire up I guess. -Daniel > > > If bochs' implementation is complete enough to be useful for other > > drivers, I'll add it to the patch set. > > It's good enough for generic fbcon. > > cheers, > Gerd >