rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | From 46cee2c18276062d45817fd38fedfa737f16f776 Mon Sep 17 00:00:00 2001 |
| 2 | From: Jia Rong <jia.rong@mediatek.com> |
| 3 | Date: Fri, 20 Apr 2018 11:23:00 +0800 |
| 4 | Subject: [PATCH 3/9] compose-engine: turn to pixman if gl init fail |
| 5 | |
| 6 | if init_gl fail then turn to pixman to compose buffer |
| 7 | Test: test ok |
| 8 | |
| 9 | Change-Id: I18979e4d6cc2d12e51bc12e7be581e919b3166e8 |
| 10 | Signed-off-by: Jia Rong <jia.rong@mediatek.com> |
| 11 | CR-Id: AUTO00016576 |
| 12 | --- |
| 13 | libweston/compositor-drm.c | 9 +++++++-- |
| 14 | 1 file changed, 7 insertions(+), 2 deletions(-) |
| 15 | |
| 16 | diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c |
| 17 | index 1d38f05..4a5cd67 100644 |
| 18 | --- a/libweston/compositor-drm.c |
| 19 | +++ b/libweston/compositor-drm.c |
| 20 | @@ -1642,6 +1642,7 @@ init_egl(struct drm_backend *b) |
| 21 | |
| 22 | if (drm_backend_create_gl_renderer(b) < 0) { |
| 23 | gbm_device_destroy(b->gbm); |
| 24 | + b->gbm = NULL; |
| 25 | return -1; |
| 26 | } |
| 27 | |
| 28 | @@ -3261,8 +3262,12 @@ drm_backend_create(struct weston_compositor *compositor, |
| 29 | } |
| 30 | } else { |
| 31 | if (init_egl(b) < 0) { |
| 32 | - weston_log("failed to initialize egl\n"); |
| 33 | - goto err_udev_dev; |
| 34 | + weston_log("failed to initialize egl, use pixman\n"); |
| 35 | + if (init_pixman(b) < 0) { |
| 36 | + weston_log("failed to initialize pixman renderer\n"); |
| 37 | + goto err_udev_dev; |
| 38 | + } |
| 39 | + b->use_pixman = 1; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | -- |
| 44 | 1.9.1 |
| 45 | |