output:fix repaint func not to skip first buffer 25/22925/2
authorVeeresh Kadasani <external.vkadasani@jp.adit-jv.com>
Tue, 12 Nov 2019 06:44:19 +0000 (15:44 +0900)
committerVeeresh Kadasani <external.vkadasani@jp.adit-jv.com>
Thu, 14 Nov 2019 01:59:20 +0000 (01:59 +0000)
Bug-AGL: SPEC-2946

transmitter skipped the first buffer and was not pushed
to remote side.

Change-Id: I242a4623b180e0115cffc2e9b0935697530bfc1c
Signed-off-by: Veeresh Kadasani <external.vkadasani@jp.adit-jv.com>
waltham-transmitter/transmitter-plugin/output.c
waltham-transmitter/transmitter-plugin/plugin.c

index 0676655..853889b 100644 (file)
@@ -196,7 +196,7 @@ transmitter_output_repaint(struct weston_output *base,
 
        wl_list_for_each_reverse(view, &compositor->view_list, link) {
                bool found_surface = false;
-               if (view->output == &output->base) {
+               if (view->output == &output->base && (view->surface->width >= 64 && view->surface->height >= 64)) {
                        found_output = true;
                        wl_list_for_each(txs, &remote->surface_list, link) {
                                if (txs->surface == view->surface) {
@@ -228,9 +228,24 @@ transmitter_output_repaint(struct weston_output *base,
                                        break;
                                }
                        }
-                       if (!found_surface)
-                               transmitter_api->surface_push_to_remote(view->surface,
+                       if (!found_surface){
+                               txs = transmitter_api->surface_push_to_remote(view->surface,
                                                                        remote, NULL);
+                               output->renderer->dmafd =
+                                               api->get_dma_fd_from_view(&output->base, view, &output->renderer->buf_stride);
+                               if (output->renderer->dmafd < 0) {
+                                       weston_log("Failed to get dmafd\n");
+                                       goto out;
+                               }
+                               output->renderer->surface_width = view->surface->width;
+                               output->renderer->surface_height = view->surface->height;
+
+                               output->renderer->repaint_output(output);
+                               output->renderer->dmafd = NULL;
+                               transmitter_api->surface_gather_state(txs);
+                               weston_buffer_reference(&view->surface->buffer_ref, NULL);
+                               break;
+                       }
                }
        }
        if (!found_output)
@@ -256,16 +271,13 @@ transmitter_assign_planes(struct weston_output *base,void *repaint_data) {
        struct weston_view *view;
 
        wl_list_for_each_reverse(view, &compositor->view_list, link) {
-               if (view->output == &output->base) {
-                       wl_list_for_each(txs, &remote->surface_list, link) {
-                               if (txs->surface == view->surface)
-                                       view->surface->keep_buffer = true;
-
-                       }
+               if (view->output == &output->base && (view->surface->width >= 64 && view->surface->height >= 64)) {
+                       view->surface->keep_buffer = true;
                }
        }
 }
 
+
 static int
 transmitter_output_enable(struct weston_output *base)
 {
index 65ebdf6..d372c65 100644 (file)
@@ -260,6 +260,7 @@ transmitter_surface_set_ivi_id(struct weston_transmitter_surface *txs)
 
                        txs->wthp_ivi_surface = wthp_ivi_application_surface_create
                                (dpy->application, ivi_surf->id_surface,  txs->wthp_surf);
+                       wth_connection_flush(remote->display->connection);
                        weston_log("surface ID %d\n", ivi_surf->id_surface);
                        if(!txs->wthp_ivi_surface){
                                weston_log("Failed to create txs->ivi_surf\n");
@@ -325,6 +326,7 @@ transmitter_surface_push_to_remote(struct weston_surface *ws,
        if (!txs->wthp_surf) {
                weston_log("txs->wthp_surf is NULL\n");
                txs->wthp_surf = wthp_compositor_create_surface(remote->display->compositor);
+               wth_connection_flush(remote->display->connection);
                transmitter_surface_set_ivi_id(txs);
        }