lima: fix xserver page flip fail for full screen client

Need to import client buffer to display drm device, otherwise
get following xserver error log:

[   190.982] (WW) modeset(0): Page flip failed: No such file or directory
[   190.982] (EE) modeset(0): present flip failed

With this fix, full screen x11 client can display its window
buffer directly without a copy. Tested on Allwinner H3, 1080p
full screen glxgears go from 163FPS to 173FPS.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9038>
This commit is contained in:
Qiang Yu 2021-02-14 18:41:10 +08:00 committed by Marge Bot
parent d7184aa15b
commit 4aac98f8a6
1 changed files with 12 additions and 0 deletions

View File

@ -361,6 +361,18 @@ lima_resource_from_handle(struct pipe_screen *pscreen,
else
res->levels[0].width = pres->width0;
if (screen->ro) {
/* Make sure that renderonly has a handle to our buffer in the
* display's fd, so that a later renderonly_get_handle()
* returns correct handles or GEM names.
*/
res->scanout =
renderonly_create_gpu_import_for_resource(pres,
screen->ro,
NULL);
/* ignore failiure to allow importing non-displayable buffer */
}
return pres;
err_out: