dra7xx-evm: weston: add changes for AGL home screen
[AGL/meta-agl.git] / meta-agl-bsp / meta-ti / recipes-arago / weston / weston / 0001-weston1.9.0-Enabling-DRM-backend-with-multiple-displ.patch
1 From 15d9f155fdb3abffc348e81b1560702801994715 Mon Sep 17 00:00:00 2001
2 From: Karthik Ramanan <a0393906@ti.com>
3 Date: Mon, 11 Jan 2016 11:51:30 -0500
4 Subject: [PATCH 1/2] weston1.9.0: Enabling DRM backend with multiple displays
5
6 There are three main issues that this patch tries to address
7
8  1. Black screen when running weston
9  2. Support for multiple displays
10  3. Handling missing VBlanks
11
12 There is an issue with missing VBlanks for LCD and
13 HDMI connectors which leads to display not getting refreshed.
14 This patch can be considered as a workaround.
15
16 Signed-off-by: Karthik Ramanan <a0393906@ti.com>
17 ---
18  src/compositor-drm.c | 10 ++++++++--
19  1 file changed, 8 insertions(+), 2 deletions(-)
20
21 diff --git a/src/compositor-drm.c b/src/compositor-drm.c
22 index 6777bf8..15ddba8 100644
23 --- a/src/compositor-drm.c
24 +++ b/src/compositor-drm.c
25 @@ -686,7 +686,7 @@ drm_output_repaint(struct weston_output *output_base,
26                         .request.sequence = 1,
27                 };
28  
29 -               if ((!s->current && !s->next) ||
30 +               if ((!s->current && !s->next) &&
31                     !drm_sprite_crtc_supported(output, s->possible_crtcs))
32                         continue;
33  
34 @@ -847,6 +847,7 @@ page_flip_handler(int fd, unsigned int frame,
35  {
36         struct drm_output *output = (struct drm_output *) data;
37         struct timespec ts;
38 +       uint32_t bail;
39         uint32_t flags = PRESENTATION_FEEDBACK_KIND_VSYNC |
40                          PRESENTATION_FEEDBACK_KIND_HW_COMPLETION |
41                          PRESENTATION_FEEDBACK_KIND_HW_CLOCK;
42 @@ -864,9 +865,14 @@ page_flip_handler(int fd, unsigned int frame,
43  
44         output->page_flip_pending = 0;
45  
46 +       if(output->vblank_pending) {
47 +               weston_log("VBlank is pending for connector = %d, frame = %d\n", output->connector_id, frame);
48 +               bail = 1;
49 +       }
50 +
51         if (output->destroy_pending)
52                 drm_output_destroy(&output->base);
53 -       else if (!output->vblank_pending) {
54 +       else if (!output->vblank_pending || bail ) {
55                 ts.tv_sec = sec;
56                 ts.tv_nsec = usec * 1000;
57                 weston_output_finish_frame(&output->base, &ts, flags);
58 -- 
59 1.9.1
60