| From 621569253b34788e096adda8132010d0a17d0844 Mon Sep 17 00:00:00 2001 |
| From: Qian Hu <Qian.Hu@mediatek.com> |
| Date: Tue, 24 Sep 2019 11:31:09 +0800 |
| Subject: [PATCH 3/8] [PATCH 3/9] compose-engine: turn to pixman if gl init |
| fail |
| |
| if init_gl fail then turn to pixman to compose buffer |
| |
| Signed-off-by: Qian Hu <Qian.Hu@mediatek.com> |
| --- |
| libweston/compositor-drm.c | 9 +++++++-- |
| 1 file changed, 7 insertions(+), 2 deletions(-) |
| |
| diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c |
| index 3891176..ef38a64 100644 |
| --- a/libweston/compositor-drm.c |
| +++ b/libweston/compositor-drm.c |
| @@ -3921,6 +3921,7 @@ init_egl(struct drm_backend *b) |
| |
| if (drm_backend_create_gl_renderer(b) < 0) { |
| gbm_device_destroy(b->gbm); |
| + b->gbm = NULL; |
| return -1; |
| } |
| |
| @@ -6766,8 +6767,12 @@ drm_backend_create(struct weston_compositor *compositor, |
| } |
| } else { |
| if (init_egl(b) < 0) { |
| - weston_log("failed to initialize egl\n"); |
| - goto err_udev_dev; |
| + weston_log("failed to initialize egl, use pixman\n"); |
| + if (init_pixman(b) < 0) { |
| + weston_log("failed to initialize pixman renderer\n"); |
| + goto err_udev_dev; |
| + } |
| + b->use_pixman = 1; |
| } |
| } |
| |
| -- |
| 2.6.4 |
| |