[PATCH 00/15] Share TTM code among framebuffer drivers

Thomas Zimmermann tzimmermann at suse.de
Tue Apr 9 07:50:40 UTC 2019


Hi

Am 09.04.19 um 09:12 schrieb kraxel at redhat.com:
>   Hi,
> 
>> If not for TTM, what would be the alternative? One VMA manager per
>> memory region per device?
> 
> Depends pretty much on the device.
> 
> The cirrus is a display device with only 4 MB of vram.  You can't fit
> much in there.  A single 1024x768 @ 24bpp framebuffer needs more 50%
> of the video memory already.  Which is why the cirrus driver (before the
> rewrite) had to migrate buffers from/to vram on every page flip[1].  Which
> is one[2] of the reasons why cirrus (after rewrite) doesn't ttm-manage the
> vram any more.  gem objects are managed with the shmem helpers instead
> and the active framebuffer is blitted to vram.
> 
> The qemu stdvga (bochs driver) has 16 MB vram by default and can be
> configured to have up to 256 MB.  Plenty of room even for multiple 4k
> framebuffers if needed.  So for the bochs driver all the ttm bo
> migration logic is not needed, it could just store everything in vram.
> 
> A set of drm_gem_vram_* helpers would do the job for bochs.

Thanks for clarifying. drm_gem_vram_* (and drm_vram_mm for Simple TTM)
is probably a better name for the data structures.

> I'd expect the same applies to the vbox driver.
> 
> Dunno about the other drm drivers and the fbdev drivers you plan to
> migrate over.

The AST HW can support up to 512 MiB, but 32-64 MiB seems more realistic
for a server. It's similar with mgag200 HW. The old fbdev-supported
device are all somewhere in the range between cirrus and bochs. Some
drivers would probably benefit from the cirrus approach, some could use
VRAM directly.

Best regards
Thomas

> 
> cheers,
>   Gerd
> 
> [1] Note: The page-flip migration logic is present in some of the other
>     drivers too, not sure whenever they actually need that due to being low
>     on vram too or whenever they just copied the old cirrus code ...
> 
> [2] The other reason is that this allow to convert formats at blit time,
>     which helps to deal with some cirrus hardware limitations.
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20190409/935e8e56/attachment.sig>


More information about the dri-devel mailing list