change e_comp_wl_video.h symbols and some logs
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 8 Jan 2018 12:50:03 +0000 (21:50 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 8 Jan 2018 12:50:03 +0000 (21:50 +0900)
Change-Id: Ia195ce4c24c7b501ee4967518343308b33effd18

src/bin/e_comp_wl_video.c
src/bin/e_comp_wl_video.h
src/bin/e_hwc_window.c
src/bin/e_output.c
src/bin/e_output_hwc_windows.c

index 65220b96154b771290fcfe311c06af4f2b0a1644..c7e01213d55ff852ac753d545874f78281612469 100644 (file)
@@ -1676,25 +1676,56 @@ _e_video_commit_handler(tdm_layer *layer, unsigned int sequence,
 }
 
 EINTERN void
-e_video_commit_data_release(E_Client *ec, unsigned int sequence,
+e_comp_wl_video_hwc_window_commit_data_release(E_Hwc_Window *hwc_window, unsigned int sequence,
                             unsigned int tv_sec, unsigned int tv_usec)
 {
+   E_Client *ec = NULL;
    E_Video *video = NULL;
    Eina_List *l = NULL;
    E_Video_Layer *video_layer;
 
-   if (!ec) return;
+   EINA_SAFETY_ON_NULL_RETURN(hwc_window);
+
+   ec = hwc_window->ec;
+   EINA_SAFETY_ON_NULL_RETURN(ec);
 
    EINA_LIST_FOREACH(video_list, l, video)
+     if (video->ec == ec) break;
+   EINA_SAFETY_ON_NULL_RETURN(video);
+
+   video_layer = video->layer;
+   EINA_SAFETY_ON_NULL_RETURN(video_layer);
+
+   _e_video_commit_handler(NULL, sequence, tv_sec, tv_usec, video);
+}
+
+EINTERN tbm_surface_h
+e_comp_wl_video_hwc_widow_surface_get(E_Hwc_Window *hwc_window)
+{
+   E_Client *ec = NULL;
+   Eina_List *l = NULL;
+   E_Video *video = NULL;
+   E_Video_Layer *video_layer;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, NULL);
+
+   if (!e_hwc_window_is_video(hwc_window))
      {
-        if (video->ec == ec) break;
+       ERR("ehw:%p is NOT Video HWC window.", hwc_window);
+       return NULL;
      }
-   if (!video) return;
+
+   ec = hwc_window->ec;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
+
+   EINA_LIST_FOREACH(video_list, l, video)
+     if (video->ec == ec) break;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(video, NULL);
 
    video_layer = video->layer;
-   if (!video_layer) return;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(video_layer, NULL);
 
-   _e_video_commit_handler(NULL, sequence, tv_sec, tv_usec, video);
+   return hwc_window->tsurface;
 }
 
 static void
index 5387c3400db4dc027b247fb1399ad56503c32038..ed4ce112a5ac14539799f359c4b1b2aca5dc3fce 100644 (file)
@@ -15,7 +15,8 @@ EINTERN void e_comp_wl_video_shutdown(void);
 
 EINTERN tdm_layer* e_comp_wl_video_layer_get(tdm_output *output);
 
-EINTERN void e_video_commit_data_release(E_Client *ec, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec);
+EINTERN void          e_comp_wl_video_hwc_window_commit_data_release(E_Hwc_Window *hwc_window, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec);
+EINTERN tbm_surface_h e_comp_wl_video_hwc_widow_surface_get(E_Hwc_Window *hwc_window);
 
 #define C(b,m)              (((b) >> (m)) & 0xFF)
 #define FOURCC_STR(id)      C(id,0), C(id,8), C(id,16), C(id,24)
index eb2584f886e856e047f7e060b5b54369a7c321fa..4fa2fb2c9317531ce6cec307cd873bf39a76419e 100644 (file)
@@ -40,6 +40,13 @@ _get_wayland_tbm_client_queue(E_Client *ec)
    EINA_SAFETY_ON_NULL_RETURN_VAL(wl_surface, NULL);
 
    cqueue = wayland_tbm_server_client_queue_get(wl_comp_data->tbm.server, wl_surface);
+   if (!cqueue)
+     {
+        ELOGF("HWC-WINS", " ehw:%p has no wl_tbm_server_client_queue. -- {%25s}, state:%s, zpos:%d, deleted:%s",
+              ec->pixmap, ec, ec->hwc_window, ec->icccm.title,
+              e_hwc_window_state_string_get(ec->hwc_window->state),
+              ec->hwc_window->zpos, ec->hwc_window->is_deleted ? "yes" : "no");
+     }
    EINA_SAFETY_ON_NULL_RETURN_VAL(cqueue, NULL);
 
    return cqueue;
@@ -419,7 +426,12 @@ _e_hwc_window_client_cb_new(void *data EINA_UNUSED, E_Client *ec)
    EINA_SAFETY_ON_NULL_RETURN(ec);
 
    zone = ec->zone;
-   EINA_SAFETY_ON_NULL_RETURN(zone);
+   if (!zone)
+     {
+        ELOGF("HWC-WINS", "Try to create hwc_window, but it couldn't.(no zone)", ec->pixmap, ec);
+        return;
+     }
+
    EINA_SAFETY_ON_NULL_RETURN(zone->output_id);
 
    output = e_output_find(zone->output_id);
index d95c355a78e5ab46ea63d72e030d286f796b98b3..0349c1ca2fd26e8d178b974f74949f7f743446b1 100644 (file)
@@ -2511,7 +2511,6 @@ e_output_commit(E_Output *output)
      {
         if (!e_output_hwc_windows_commit(output->output_hwc))
           {
-             ERR("fail e_output_hwc_windows_commit");
              return EINA_FALSE;
           }
      }
index 06c11b2c0104db4dae9d7e0025d1f79bb82760aa..9d10ba128a5a9c9b53a10a9f3e724be55d1a0e64 100644 (file)
@@ -194,7 +194,7 @@ _e_output_hwc_windows_commit_handler(tdm_output *toutput, unsigned int sequence,
                                   void *user_data)
 {
    const Eina_List *l;
-   E_Hwc_Window *window;
+   E_Hwc_Window *hwc_window;
    E_Output_Hwc *output_hwc = (E_Output_Hwc *)user_data;
 
    EINA_SAFETY_ON_NULL_RETURN(output_hwc);
@@ -205,11 +205,11 @@ _e_output_hwc_windows_commit_handler(tdm_output *toutput, unsigned int sequence,
         output_hwc->pp_tsurface = NULL;
      }
 
-   EINA_LIST_FOREACH(e_output_hwc_windows_get(output_hwc), l, window)
+   EINA_LIST_FOREACH(e_output_hwc_windows_get(output_hwc), l, hwc_window)
      {
-         if (!e_hwc_window_commit_data_release(window)) continue;
-         if (e_hwc_window_is_video(window))
-           e_video_commit_data_release(window->ec, sequence, tv_sec, tv_usec);
+         if (!e_hwc_window_commit_data_release(hwc_window)) continue;
+         if (e_hwc_window_is_video(hwc_window))
+           e_comp_wl_video_hwc_window_commit_data_release(hwc_window, sequence, tv_sec, tv_usec);
      }
 
    /* 'wait_commit' is mechanism to make 'fetch and commit' no more than one time per a frame;
@@ -232,7 +232,16 @@ _e_output_hwc_windows_can_commit(E_Output *output)
      {
         if (!e_hwc_window_is_on_hw_overlay(hwc_window)) continue;
 
-        if (!hwc_window->tsurface) can_commit = EINA_FALSE;
+        if (!hwc_window->tsurface)
+          {
+             ELOGF("HWC-WINS", " ehw:%p has no ts. -- {%25s}, state:%s, zpos:%d, deleted:%s",
+                   hwc_window->ec ? hwc_window->ec->pixmap : NULL, hwc_window->ec,
+                   hwc_window, hwc_window->ec ? hwc_window->ec->icccm.title : "UNKNOWN",
+                   e_hwc_window_state_string_get(hwc_window->state),
+                   hwc_window->zpos, hwc_window->is_deleted ? "yes" : "no");
+
+             can_commit = EINA_FALSE;
+          }
      }
 
    return can_commit;