e_hwc_window_queue: handle failure of the buffer allocation 21/295021/2 accepted/tizen/unified/20230630.124053
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 21 Jun 2023 10:28:28 +0000 (19:28 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 30 Jun 2023 01:26:05 +0000 (01:26 +0000)
if the buffer allocation is failed, queue size and get size
are different.
it causes a problem of client does not have idle buffer after
client receives activate event of queue.

Change-Id: Ia37ad6308c9cf5be42286b3c24c54c1d7c6ef8e7

src/bin/e_hwc_window_queue.c

index 27e0183..bdb937c 100644 (file)
@@ -762,6 +762,13 @@ _e_hwc_window_queue_buffers_get(E_Hwc_Window_Queue *queue)
    tsq_err = tbm_surface_queue_get_surfaces(queue->tqueue, surfaces, &get_size);
    EINA_SAFETY_ON_FALSE_GOTO(tsq_err == TBM_SURFACE_QUEUE_ERROR_NONE, fail);
 
+   if (size != get_size)
+     {
+        EHWQERR("fail to allocate buffer (size:%d get_size:%d)",
+                NULL, queue->hwc, queue, size, get_size);
+        goto fail;
+     }
+
    for (i = 0; i < get_size; i++)
      {
         queue_buffer= e_hwc_window_queue_buffer_find(queue, surfaces[i]);