e_hwc_window_queue: add comparing size of client and queue 28/210228/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 11 Jul 2019 06:57:30 +0000 (15:57 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 16 Jul 2019 08:22:31 +0000 (17:22 +0900)
Change-Id: I28341a45d28fc8825b35fe87445dcde866a044aa

src/bin/e_hwc_window_queue.c
src/bin/e_hwc_window_queue.h

index fcd77596cc13c85e5241b3a4539dc38cafaa0e52..7d051f57832a865332651a86ca9821d01d7d76de 100644 (file)
@@ -652,10 +652,25 @@ static Eina_Bool
 _e_hwc_window_queue_prepare_set(E_Hwc_Window_Queue *queue, E_Hwc_Window *hwc_window)
 {
    struct wayland_tbm_client_queue *cqueue = NULL;
+   E_Client *ec = NULL;
 
    if (eina_list_data_find(queue->user_pending_set, hwc_window) == hwc_window)
      _e_hwc_window_queue_user_pending_set_remove(queue, hwc_window);
 
+   ec = hwc_window->ec;
+   if (!ec)
+     {
+        EHWQERR("client is deleted", NULL, queue->hwc, queue);
+        return EINA_FALSE;
+     }
+
+   if ((queue->width != ec->w) || (queue->height != ec->h))
+     {
+        EHWQERR("size mismatch queue(%dx%d) client(%dx%d)",
+                ec, queue->hwc, queue, queue->width, queue->height, ec->w, ec->h);
+        return EINA_FALSE;
+     }
+
    cqueue = _user_cqueue_get(hwc_window->ec);
    if (!cqueue)
      {
@@ -907,6 +922,9 @@ _e_hwc_window_queue_create(tbm_surface_queue_h tqueue)
                                               queue);
    EINA_SAFETY_ON_FALSE_GOTO(tsq_err == TBM_SURFACE_QUEUE_ERROR_NONE, fail);
 
+   queue->width = tbm_surface_queue_get_height(tqueue);
+   queue->height = tbm_surface_queue_get_width(tqueue);
+   queue->format = tbm_surface_queue_get_format(tqueue);
    queue->tqueue = tqueue;
 
    wl_signal_init(&queue->destroy_signal);
index ca7675a20fb31f78445fbca405c979be646dfa85..005d4e6eeaab27a61c4b9d8bc384f148619fd799 100644 (file)
@@ -37,6 +37,11 @@ struct _E_Hwc_Window_Queue
    E_Hwc_Window_Queue_State          state;
 
    Eina_Bool                         is_target;
+
+
+   int                               width;
+   int                               height;
+   tbm_format                        format;
 };
 
 struct _E_Hwc_Window_Queue_Buffer