Closed enunes closed 6 years ago
@yuq as you suggested, I referenced the renderlib implementation for imx/etnaviv and ported the method to lima. It should now be allocating a dumb buffer with the kms driver and importing to lima. Let me know if the code can be improved. I tested this with the Allwinner A20 (DE 1.0) and H3 (DE 2.0) and it works in both for me with kmscube, eglkms, gbm-surface. @fourkbomb @superna9999 @mmind I also changed the allocation for the other display drivers, would be nice if you could test this on the other SoCs too.
Thanks for the review. I separated it in functions and it ended up in a slightly larger refactor of lima_resource_create. Retested and keeps working for me. Let me know if something still can be improved.
Just to confirm, on my Rockchip boards everything works similar as before this change.
This patch modifies the renderonly implementation to allocate a dumb buffer for scanout in the kms driver and import it in lima. In contrast, the previous renderonly implementation allocated a contiguous buffer in lima and exported to the kms driver. As stated in Issue #29, changing this around is useful to lima because lima currently supports the contiguous allocation method mostly to satisfy the requirement of exporting a scanout buffer to a kms display driver (which may not support non-contiguous buffers). So with this change, the contiguous allocation method may be dropped in the future to reduce the complexity of the memory allocation in lima.
Signed-off-by: Erico Nunes nunes.erico@gmail.com