Joonbum Ko [Fri, 11 Oct 2024 02:34:26 +0000 (11:34 +0900)]
Package version up to 1.11.9
Change-Id: I9113542506f92c984f6344bd1a15b12bf7495ca9
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 11 Oct 2024 02:28:36 +0000 (11:28 +0900)]
utils_gthread: modify thread's mutex locking mechanism
- Add init_done flag to struct tpl_gthread to check if
the initialization in thread is completed.
- Remove unncessary locking mutex thread->thread_mutex.
This fix can be resolve deadlock problem below.
wake up thread
_thread_source_dispatch
g_mutex_lock -> lock thread_mutex // this locking is not neccessary
__gsource_remove_and_destroy
g_source_unref
__thread_func_surf_finalize
tpl_gmutex_lock -> lock surf_mutex
_thread_wl_egl_surface_fini
_buffers_force_release
tbm_surface_internal_unref
__cb_wl_egl_buffer_free
tpl_gsource_destroy
-> lock thread_mutex // it will cause deadlock
Change-Id: I8c755173efaff57da2384f9fb88c8cdd651b2217
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
TaeHyeon Jeong [Thu, 10 Oct 2024 08:52:29 +0000 (17:52 +0900)]
tpl: Add check id after tpl_gthread_add_idle()
Change-Id: Ib0376bfdae54df2e309365ca8e487d89053ca170
TaeHyeon Jeong [Thu, 10 Oct 2024 05:40:01 +0000 (14:40 +0900)]
tpl: Add tpl_gsource_remove()
- This can remove the gsource registered in a specific GMainContext.
Change-Id: I2d0b1f15da0270a1e17577e045bcd06092689a76
TaeHyeon Jeong [Thu, 10 Oct 2024 05:39:35 +0000 (14:39 +0900)]
tpl: Modify tpl_gcond_timed_wait()
AS-IS
- Calculate the end_time for g_cond_wait_until() in tpl_gcond_timed_wait().
PROBLEM
- When a spurious wakeup occurs, the end_time is recalculated. so, it may wait longer than expected waiting time.
TO-BE
- Calculating the end_time is performed only once.
Change-Id: Ia7c85e94549469ce3feae4b47b75945e23b7c88d
Joonbum Ko [Tue, 8 Oct 2024 02:17:00 +0000 (11:17 +0900)]
Package version up to 1.11.8
Change-Id: If0d097a6ac32038d3f76bb70437f45ca33063893
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 8 Oct 2024 00:50:19 +0000 (09:50 +0900)]
wl_egl: add surf_trace_begin/end
- By using the surface, it was possible to measure what was ambiguous
to be measured using the change in buffer state (like below)
LAST_COMMIT ~ RELEASE : Delay in buffer release event from server
LAST_RELEASE ~ DEQUEUE : Delay in rendering job from EGL caller
- enum surface_trace_period has been added
INITIALIZING
- to check the total elapsed time until surface_init done
LAST_REL_TO_DEQ_REQUESTED
- the period from when last buffer release to when dequeue is requested
- to check if there is a delay in rendering requests between frames
DEQ_REQUEST_TO_DEQ_DONE
- The period from when can_dequeue is called to when dequeue is completed
WAIT_VBL_TO_VBL_DONE
- The period from when wait_vblank to when vblank done callback is called
- to check if there is a delay in client vblank event processing
LAST_COMMIT_TO_REL
- The period from when the last surface commit to when
buffer release event processed
- to check if there is a delay in server or thread's event processing
- For each trace_period, even if _surf_trace_begin is called multiple times,
only the last call will be recorded and calling _surf_trace_end calculates
the elapsed time for that period.
Change-Id: I62fb3617faa3c823d56404414b9dc68fd2a84f91
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 2 Oct 2024 07:42:29 +0000 (16:42 +0900)]
wl_egl: change the management of buffer status
struct buffer_status_info
- This replaces status_to_string and is a structure that has the
maximum expected time to reach each status.
_update_buffer_status
- Called when changing the status of each buffer, it measures the
time taken to reach the requested status and prints out error logs
if it is greater than expected.
Newly added status
- CREATED and CANCELED have been added to further refine the status
of the buffer.
Change-Id: I3e7daaafe7472cf1ff85c5b134e196644e723e39
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Mon, 30 Sep 2024 06:03:15 +0000 (15:03 +0900)]
wl_egl: subdivided the buffer_status
subdivided status below
1. WAITING_SIGNALED ~ WAITING_VBLANK
-> WAITING_SIGNALED ~ SIGNALED / SIGNALED ~ WAITING_VBLANK
2. WAITING_VBLANK ~ COMMITTED
-> WAITING_VBLANK ~ VBLANK_DONE / VBLANK_DONE ~ COMMITTED
Change-Id: I19acb9deba8221e6b18056fc9a0d01f7dd5c737f
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Changyeon Lee [Wed, 11 Sep 2024 04:35:06 +0000 (13:35 +0900)]
Package version up to 1.11.7
Change-Id: Ic7635317e29e44a6afd1ed59b2138c91dc51a0f4
Changyeon Lee [Wed, 11 Sep 2024 04:26:27 +0000 (13:26 +0900)]
utils: Include tbm_debug.h
tbm_surface_internal_dump_xxx api was moved in tbm_debug.h
Change-Id: I583467d8bd5cbf285c47af0ce518994ef014b029
jinbong.lee [Tue, 9 Jul 2024 12:53:42 +0000 (12:53 +0000)]
Package version up to 1.11.6
Change-Id: Ib53ffe765d0b1b22c5d336ebe6da63f72027304c
jinbong.lee [Tue, 9 Jul 2024 12:35:50 +0000 (12:35 +0000)]
Revert "wl_egl: add exception checking to find invalid wl_egl_buffer"
This reverts commit
c74b4ab60aa2a82a66b01fac6125af0566fc73da.
- That exception check doesn't protected with wl_egl_surface->buffers_mutex.
- _thread_wl_surface_commit function is called inside of wl_egl_buffer->mutex is locked.
- It means wl_egl_buffer is available when _thread_wl_surface_commit is called.
- If wl_egl_surface->buffers_mutex is used inside of wl_egl_buffer->mutex then deadlock will be occurred.
Change-Id: I688f963827590f045bd3f97a7d6298e5281fb6e1
Joonbum Ko [Tue, 2 Jul 2024 00:56:08 +0000 (09:56 +0900)]
Package version up to 1.11.5
Change-Id: I7f65d49f6125e39617db98d1cbeae83c62b38e51
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 2 Jul 2024 01:51:11 +0000 (10:51 +0900)]
build: add include folder to separate tpl.h
Change-Id: I9c96a8b61ea9b16a0f9df1af11d309151c528a7b
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 2 Jul 2024 01:21:20 +0000 (10:21 +0900)]
wl_egl: lowered the log level of [SERIAL] to debug
Change-Id: I4ec758a5a4cc9f95fca77ca9070b849ad8c69dde
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 2 Jul 2024 00:55:44 +0000 (09:55 +0900)]
wl_egl: fix the problem caused by use_after_free
Change-Id: I2389ed6f709be843951f1e822571733e3faf4023
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 21 May 2024 10:34:12 +0000 (19:34 +0900)]
Package version up to 1.11.4
Change-Id: I0745b62398471136bb9470dce4f2cbf9159ddb39
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 28 Jun 2024 08:16:00 +0000 (17:16 +0900)]
build: fix build error related to wayland-egl-tizen
Change-Id: Ia28852ef48958fd29e2c7e4fa6c7652b23720cfb
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 21 May 2024 10:10:31 +0000 (19:10 +0900)]
wl_egl: implement set_pre_commit_callback
Change-Id: I223fd84d00c9e951d04d4149d3851c6c57c38610
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 21 May 2024 10:05:50 +0000 (19:05 +0900)]
wayland-egl-tizen: add new API to set pre_commit callback.
Set pre-commit callback with data to wl_egl_window.
The registered callback function will be called with the data
immedately before the frame's wl_surface_commit.
The callback registered before calling eglSwapBuffers will be called
at the time the swap requested buffer is attached.
* Important *
- Since the callback may be called from a separate thread that performs
wl_surface_commit, protection is required if there is a critical section
inside the callback function.
- To avoid poor performance or complicated lifecycle issues,
it is recommended that the behavior inside the callback function be concise.
- This API should be called from one thread.
- If it is called multiple times in a frame, the previously registered ones
are overwritten.
* Callback Options *
- ONCE : The registered callback and data are stored in the buffer requested
for swap when calling eglSwapBuffers and then initialized.
The callback function is called only once when the buffer requested
for swap is committed, and is not called after that.
- CONTINUOUS : Once the callback and data are registered, the callback function
is called continuously until it is released.
To release the callback, simply pass NULL to func.
Change-Id: Ic08c6dd1aeafe88d4059760f6bbffbd9d0da8c05
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 27 Jun 2024 01:01:37 +0000 (10:01 +0900)]
wayland-egl-tizen: change info log to use tag prefix
Change-Id: Ia4267ae1543dc52c2b5b3c5116f9eaf22dc95cb2
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 23 May 2024 03:51:19 +0000 (12:51 +0900)]
wayland-egl-tizen: add internal function to get tizen_private
Change-Id: I69ebd607b0ba1fe3af38e325426e63d68ab909b4
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 3 May 2024 08:29:11 +0000 (17:29 +0900)]
Package version up to 1.11.3
Change-Id: Ie44a2200ef7a05d2d33b67745af5b99d9ac31571
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 3 May 2024 08:26:22 +0000 (17:26 +0900)]
wl_egl: modify some operation related with buffer serial
- The point of storing the serial to wl_egl_buffer was
changed from dequeue to enqueue.
Change-Id: I060fb29da38b5e16d8fcc2c453db6250b9a89327
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 12 Apr 2024 03:59:10 +0000 (12:59 +0900)]
wl_egl: add logs to print elapsed time
Change-Id: Ie910e39d5ec15800dd04db1d7198a40361dd9e8f
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 12 Apr 2024 04:13:51 +0000 (13:13 +0900)]
wl_egl: add exception checking to find invalid wl_egl_buffer
Change-Id: If5d66523e1d190d2c341f81ff01edf3411c2f3b5
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 31 Jan 2024 11:02:55 +0000 (20:02 +0900)]
Package version up to 1.11.2
Change-Id: Ide2da7a347b003d6811f4067adf80a553385097d
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 17 Jan 2024 05:04:55 +0000 (14:04 +0900)]
wl_egl: check is_activated after calling can_dequeue
- to resolve regression issue related to support frontbuffer rendering mode.
- The issue was caused by the commit below
wl_egl: remove checking activated when dequeue buffer
c362b0b2860d1ebab098956e2567aeef8313952c
- Actual buffer will be attached when calling tbm_surface_queue_can_dequeue().
So calling wayland_tbm_client_queue_check_activate() at dequeue_buffer
is not appropriate.
Change-Id: I88b58a62bc42537d7bd8fe1d446a343fd40aab7b
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
jphnix [Tue, 30 Jan 2024 10:33:55 +0000 (10:33 +0000)]
Add missing Lock
- gthread->loop is held with thread_mutex.
- But it doesn't hold thread_mutex in tpl_gthread_add_idle
Change-Id: Ibaddbcf7e4d4b9ec661ee69c0a95dbc517970ea2
jphnix [Wed, 31 Jan 2024 05:46:09 +0000 (05:46 +0000)]
Move protected area by mutex
- surface->post_interval is needed to be protected by mutex
Change-Id: I8f70ccb15e38fcfc24f2a4d326eeea6003eba9e8
jphnix [Tue, 30 Jan 2024 10:51:47 +0000 (10:51 +0000)]
Fix missed protection by lock
- dequeued_buffers buffer can be NULL in mutex protection.
- but checking it is NULL is used without mutex protection.
- so it is need to fix.
Change-Id: Ifd57d769c760cd43f2816ab9477560dc0f1e5ae5
Joonbum Ko [Thu, 18 Jan 2024 06:21:03 +0000 (15:21 +0900)]
Package version up to 1.11.1
Change-Id: I9106d5403ea315c729ce23e3e01d0f671040bc32
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 18 Jan 2024 06:05:36 +0000 (15:05 +0900)]
wl_egl: improve end-of-use guarantee for previous buffers
AS-IS
- Dequeue thread waits for the wl-egl-thread to send signal
after commit the buffer that was last enqueued.
PROBLEMS
- Complex mutex locking is required to access last_enq_buffer.
- Complex process is required to validate last_enq_buffer.
TO-BE
- The list of buffers in use is traversed by wl-egl-thread
and signal is sent when all buffers enqeueued after queue reset
are committed.
Change-Id: Ib81186c2cc1faf856372c0a668b47ffc615258eb
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 17 Jan 2024 05:04:55 +0000 (14:04 +0900)]
wl_egl: add missing is_activated flag setting
Change-Id: I091d812f9354bd98e5b19a6eb35df83d92c45473
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 17 Jan 2024 04:40:11 +0000 (13:40 +0900)]
wl_egl: queue resize will be run in thread
AS-IS
- In an arbitrary thread where wl_egl_window_resize called,
if the reisze callback is called inside it,
and reset the tbm_surface_queue to the requested size.
PROBLEMS
- It is difficult to protect against all cases of resizing at
unpredictable times.
TO-BE
- All resets of the tbm_surface_queue are performed only in
wl-egl-thread.
Change-Id: Idaa6609594e47321c3c28715d46001ff8269711a
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 16 Jan 2024 09:03:53 +0000 (18:03 +0900)]
wl_egl: queue force flush will be run in thread
AS-IS
- In case where can_dequeue returns timeout error,
the operation of forcibly flushing the tbm_queue and
emptying buffer list of wl_egl_surface were performed in
the parent thread (dequeue thread).
PROBLEMS
- Whenever a buffer lis is traversed, the thread should be paused,
but the timeout error is often occured in pausing operation.
- In order to flush tbm_queue, it is necessary to use complex
mutex locking.
TO-BE
- The operation of emptying the queue and buffer list is performed
in the wl-egl-thread.
- The parent thread waits for the operation in the wl-egl-thread
to be completed, and in the following cases, it is regarded as an
error situation and causes the dequeue to return NULL.
1. If the result of tpl_gcond_timed_wait is a timeout error
2. If the result of tbm_surface_queue_can_dequeue is not 1 even
after receiving the signal from the wl-egl-thread.
Change-Id: Ibe65330f508d2193a02fd5fe43ba1b651dc0499c
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Mon, 15 Jan 2024 07:43:14 +0000 (16:43 +0900)]
delete unused variable
Change-Id: I5e53e461444bc0776d46cdd998e879538af74f57
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 12 Jan 2024 11:38:41 +0000 (20:38 +0900)]
wl_egl: change buffers_mutex to tpl_gmutex_rec from tpl_gmutex
- When buffers are released while traversing the buffer list,
both traversal and deletion from the list in wl_egl_buffer_free
must be protected by buffers_mutex.
- Since it is possible to continuously lock on the same thread,
changed buffers_mutex to use GRecMutex.
Change-Id: I22ee38bfb19f2cef84b5a0b681ed9f37e20a54e3
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 12 Jan 2024 11:37:21 +0000 (20:37 +0900)]
utils_gthread: add APIs to use GRecMutex
Change-Id: I4a6931f756d33658a332b9579a6dd0d42321c655
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 12 Jan 2024 08:10:23 +0000 (17:10 +0900)]
wl_egl: implement idle_cb that waits for buffers to be finalized
AS-IS
- The parent thread waits for buffer to be released in
traversing the buffer list of surface.
PROBLEMS
- Whenever a buffer lis is traversed, the thread should be paused,
but the timeout error is often occured in pausing operation.
TO-BE
- Perform the operation of releasing buffer while traversing
buffer list in __idle_cb_buffers_finalize.
- __idle_cb_buffers_finalize is called whenever the main loop's idles,
and not called after all buffers are released.
- The parent thread sets a timeout (1s) and waits for all buffers
to be released, and if the timeout error occurs, forcibly releases
the buffers that were not released just before tbm_queue destroy.
Change-Id: I6a31786dbe5b7340f7b9b8b00741d5fc3009c78b
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 10 Jan 2024 10:19:40 +0000 (19:19 +0900)]
utils_gthread: add a new API to attach idle source
Change-Id: Ic28c36f5b8d67cfd2f967b130cb854d1a9301ecf
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
jinbong, Lee [Tue, 19 Sep 2023 04:50:56 +0000 (13:50 +0900)]
modify the locking buffer->mutex to include surface_commit
- In the case when _thread_wl_surface_commit() is called after
the mutex of wl_egl_buffer has been unlocked in the thread,
the wl_egl_buffer may be freed in the parent thread.
- In that case, a problem occurs during commit operation.
Therefore, the buffer must be maintained until the commit is completed.
Change-Id: I994b4ed1a1c8670d3f6f25ec580681875ece7c0a
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 2 Jan 2024 11:09:34 +0000 (20:09 +0900)]
handle null exception when printing protocol errors
- Sometimes the interface obtained from wl_display_get_protocol_error
is NULL when interface has already been destroyed.
Change-Id: I0fe2fe9b759682078366bdc5fe4076e9f66a6d8a
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
jinbong, Lee [Wed, 10 Jan 2024 11:10:42 +0000 (11:10 +0000)]
Implementation for SwapInterval is zero
- asynchronous swap mode implementation for benchmark
- Clearing waiting-buffers will be run in vblank event's callback,
because of vblank callback will be called at least once if there is a buffer waiting to commit
- add vblank_enable flag it can be changed during runtime, and it is related with post_interval & vblank
Change-Id: Ieb50ebad4350b293fa7e243ce960f125ee7029dd
Joonbum Ko [Thu, 30 Nov 2023 04:53:26 +0000 (13:53 +0900)]
clean up type casting lines for readability
Change-Id: Ic7910b7e474cc796db67a4cf8c509dab0d8f641d
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 30 Nov 2023 02:05:54 +0000 (11:05 +0900)]
remove the duplicate codes from the signal sending
Change-Id: I303b2293ec399a7107f1c49956e4cb234253e034
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 29 Nov 2023 07:31:29 +0000 (16:31 +0900)]
Package version up to 1.10.10
Change-Id: Ic54f49fb9c580ef58a4bd11ff946c0b0b10503b6
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 29 Nov 2023 07:14:44 +0000 (16:14 +0900)]
change wait_idle timeout from 200ms to 500ms
- There are often cases where scheduling is not received
for more than 200ms in unexpectable situations such as cpu contension.
- Since wait_idle is called in parts where synchronization is absolutely necessary,
it is necessary to minimize the problem by increasing it to 500ms.
Change-Id: I2844a5700f12a77668df526ce65bd5d6f486b56a
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 29 Nov 2023 07:11:37 +0000 (16:11 +0900)]
disable printing buffer list when flusher called
- Although this info logs are not absolutely necessary,
it may cause a seg fault in some situations.
- It must be modified later.
Change-Id: Idfe95f940058ed194f7f62064ee767979e167dd7
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
jinbong, Lee [Tue, 19 Sep 2023 05:24:10 +0000 (14:24 +0900)]
Package version up to 1.10.9
Change-Id: I0d6d6d7bdd7709481d591b245e0d3c936deb5dfd
jinbong, Lee [Tue, 19 Sep 2023 05:23:11 +0000 (14:23 +0900)]
Move wl_display_flush after wayland_tbm_client_destroy_buffer
- When wayland_tbm_client_destroy_buffer() is called,
then we need to send message to server as soon as possible
Change-Id: I4abc7e273d7103526b8fde550601fa5993bd3e9b
jinbong, Lee [Mon, 18 Sep 2023 06:37:32 +0000 (15:37 +0900)]
Package version up to 1.10.8
Change-Id: Ibc178293f788b1a372ac9f4e7288d7d2aa7b7b5d
jinbong, Lee [Mon, 18 Sep 2023 06:19:41 +0000 (15:19 +0900)]
Enqueued tbm_surface is needed to unref when surface's finalize is called
- If main thread called __tpl_wl_egl_surface_fini(),
then sometimes enqueued buffer can be remained before acquire.
so in that case tbm_surface must be unreferenced.
Change-Id: I3482feca808deec9c238d5ca32ee46c9ebeec401
jinbong, Lee [Mon, 18 Sep 2023 06:13:55 +0000 (15:13 +0900)]
protect wl_egl_buffer->wl_buffer with mutex_lock
- wl_egl_buffer->wl_buffer is must protected when call wl_egl_display && wl_egl_display->wl_tbm_client
Change-Id: I223f1521b1f412914194226ce69a996fc4ef91db
jinbong, Lee [Tue, 29 Aug 2023 11:06:33 +0000 (20:06 +0900)]
Package version up to 1.10.7
Change-Id: I7fc5a01433d47123fca4a008bbfec74dbc9d9c01
jinbong, Lee [Tue, 29 Aug 2023 10:56:54 +0000 (19:56 +0900)]
Remove double free situation
- if (source->fd_type == FD_TYPE_FENCE && source->type == SOURCE_TYPE_DISPOSABLE)
then g_source_remove_unix_fd, g_source_destroy, g_source_unref is called twice for source->gsource.
- it can cause error like that free already freed memory or free with invalid pointer (garbage value)
Change-Id: I44e3b1d50b0710d9cd2ddcf8e8c8f4215acff344
Joonbum Ko [Mon, 24 Jul 2023 07:15:58 +0000 (16:15 +0900)]
Package version up to 1.10.6
Change-Id: Ie0023ea5aaf82238fb8c50fec70e6c4bc676b642
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 18 Jul 2023 10:40:25 +0000 (19:40 +0900)]
wl_vk: untrack the swapchain_buffers when destroy_swapchain called
Change-Id: I72ed5fdf2fec9f00fa25e5bc87ea26501d1042f9
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Xuelian Bai [Mon, 24 Jul 2023 03:15:17 +0000 (11:15 +0800)]
Fix a typo
This typo will cause frozen for all vulkan app, since display dispatch
didn't work
Change-Id: Ibd3d753e35c0825bb7a6bc008baa4ace2fb076ff
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
Joonbum Ko [Mon, 17 Jul 2023 07:37:55 +0000 (16:37 +0900)]
Package version up to 1.10.5
Change-Id: I1a3e22b04d5b73a5ba2f4dceb80f8202e5e6af93
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Mon, 17 Jul 2023 07:35:16 +0000 (16:35 +0900)]
utils_gthread: do not make data into NULL before the source is destroyed
- Even if thread call the g_source_destroy & unref it, it may not be destroyed
immediately. (waiting for dispatch in g_main_context)
- source->data will be changed to NULL only when it destroyed perfectly.
Change-Id: Iecf8ce7599a0ad92346fe7dc802bfcebbb7cd25c
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 11 Jul 2023 06:47:59 +0000 (15:47 +0900)]
Package version up to 1.10.4
Change-Id: I480c76e12c88d8e9d972e7903d1fbaae6b39a72c
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 11 Jul 2023 06:33:48 +0000 (15:33 +0900)]
wl_egl: close fence_fd when gsource finalized
- Even though when main thread have called tpl_gsource_destroy for
fence_waiting_source, which has not yet signaled, gsource may not be
completely destroyed because it might be in dispatch queue in g_main_context.
- In this case, if the fence_waiting_source is dispatched, it can try
to commit with the invalid wl_egl_buffer that has already been freed.
- This commit makes to prevent operating with an invalid wl_egl_buffer
and to close fence_fd properly.
Change-Id: Ibce274b062bf8a6354a76464fca8f1e10b77c7b8
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Mon, 10 Jul 2023 11:06:47 +0000 (20:06 +0900)]
utils_gthread: add enum type to distinguish the fd type
Change-Id: Idca314bb4cb28cae973c56b9bc99a32195924e47
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Mon, 10 Jul 2023 08:24:02 +0000 (17:24 +0900)]
wl_vk: change the event message processing
Change-Id: I6d3b6c7aa7b5289fb1b91a9c3f9cb563499fabd4
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 7 Jul 2023 04:09:29 +0000 (13:09 +0900)]
log: add & apply TPL_LOG_D instead of TPL_DEBUG
- TPL_LOG_D can print the tag manually.
- The prefix of almost all logs is modified to print wl_egl_surface
to distinguish each wl_egl_surface.
Change-Id: I68a5b450693ed0d9422a9ba72e119f56235d7a32
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 15 Jun 2023 07:02:37 +0000 (16:02 +0900)]
wl_egl: remove checking activated when dequeue buffer
- Actual buffer will be attached when calling tbm_surface_queue_can_dequeue().
So calling wayland_tbm_client_queue_check_activate() at dequeue_buffer
is not appropriate.
Change-Id: Ie5500aa50f396e4a76160c703932d6c805e93d3d
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 2 Jun 2023 04:21:49 +0000 (13:21 +0900)]
Package version up to 1.10.3
Change-Id: I4f29af23350c5f5c8ffcea997021256f579f93b1
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 2 Jun 2023 04:15:03 +0000 (13:15 +0900)]
wl_egl/vk: use new tdm API to handle pending events.
refer to
https://review.tizen.org/gerrit/#/c/platform/core/uifw/libtdm/+/293679/
client: Add new API to handle pending events
fb76bf4
Change-Id: I036bc7b9f704b9f1bd250a6c651d5c90a9d94a65
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 14 Apr 2023 10:00:36 +0000 (19:00 +0900)]
wl_egl: Initialize vblank_done flag when dequeue timeout occured
- Rarely, even if client cannot receive vblank event from tdm server,
timeout may occur in can_dequeue.
- In this case, if wl_egl_surface->vblank_done flag
is not initialized to TPL_TRUE, problem situation may occur
waiting vblank without calling tdm_client_vblank_wait
after force_flush(can_dequeue_timeout).
Change-Id: If3f8eee13b5ae91a3728f189f53aa25720696b12
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Xuelian Bai [Thu, 23 Mar 2023 06:07:12 +0000 (06:07 +0000)]
Merge "Fix memory leak" into tizen
Xuelian Bai [Tue, 21 Mar 2023 06:56:27 +0000 (14:56 +0800)]
Fix memory leak
Wait until tbm_queue is destroyed, on pixel phone swapchain is destroyed
before tbm_queue is destroyed, then tbm_queue is never destroyed, then
cause memory leak
Change-Id: I897be13684f0e1f901aad751111c1e469414e178
Jinbong Lee [Mon, 20 Mar 2023 07:53:38 +0000 (07:53 +0000)]
Merge changes Ibac91ed8,I7e6a6891,I779718fd into tizen
* changes:
Package version up to 1.10.2
wl_egl: Implement the backend function of fence_sync_is_available
Add new API checks if fence sync is available
jinbong, Lee [Fri, 17 Mar 2023 10:27:02 +0000 (19:27 +0900)]
wl_egl : remive wl_egl_buffer in vblank's waiting buffers when wl_egl_buffer is freed
- Bug fix
. if __cb_wl_egl_buffer_free is called then some wl_egl_buffer can be in waiting buffers for vblank.
so it must be removed it before wl_egl_buffer is freed.
Change-Id: Ia08a7ecc6dcfd8f9d63e644b7cb733740672666b
Joonbum Ko [Fri, 17 Mar 2023 10:45:17 +0000 (19:45 +0900)]
Package version up to 1.10.2
Change-Id: Ibac91ed8fd994c1882d9433bc4dbedfd20cfdf21
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 27 Jan 2023 11:16:44 +0000 (20:16 +0900)]
wl_egl: Implement the backend function of fence_sync_is_available
Change-Id: I7e6a6891ff12b6869e66cf3a2d5f64098b04cb94
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 27 Jan 2023 11:08:05 +0000 (20:08 +0900)]
Add new API checks if fence sync is available
/**
* Check the surface can support fence sync mechanism.
*
* It is recommended that checking fence sync is available
* for every frame because the results may change depending on
* frontbuffer rendering is activated or not.
*
* @param surface surface to check fence sync is available.
* @return TPL_TRUE if tpl_surface can support it.
*/
tpl_bool_t
tpl_surface_fence_sync_is_available(tpl_surface_t *surface);
- This API helps DDK to determine whether to deliver the acquire_fence
to signal the render complete when call the surface_enqueue.
- In backend where waiting fence is not implemented,
the result of fixed to TPL_FALSE will be returned.
- The result from the backend with the waiting fence implementation
depends on whether the frontbuffer rendering is activated.
Change-Id: I779718fdc7e8efc7890e17b0d4df4d81974a7907
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 12 Jan 2023 08:15:40 +0000 (17:15 +0900)]
Package version up to 1.10.1
Change-Id: I8018c7726952577eda15361b938c722e09f7b13c
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 12 Jan 2023 08:15:20 +0000 (17:15 +0900)]
wayland-egl-tizen: Add description of set_frontbuffer_mode
Change-Id: Ic9e966c1b7b7f4064996765cb5e4f63cd55f813a
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 12 Jan 2023 07:16:50 +0000 (16:16 +0900)]
wl_egl: support for frontbuffer mode set by surface
- Patch for supporting this API.
wl_egl_window_tizen_set_frontbuffer_mode()
AS-IS:
- If the application, which wants to use frontbuffer rendering,
sets the frontbuffer mode using setenv(), EGL driver checks whether
frontbuffer mode is set using getenv() and if it true calls
tpl_surface_set_frontbuffer_mode().
PROBLEMS:
- The operation using setenv()/getenv() is not thread safe.
- Using env value to set frontbuffer mode cannot manage on/off in runtime.
- Using env value to set frontbuffer mode cannot set by surface.
TO-BE:
- Application would be better to use this API
wl_egl_window_tizen_set_frontbuffer_mode()
- This API makes supports the setting of frontbuffer mode
to the desired surface(window).
- This API gurantee thread safety using tpl_surface object lock.
- Using this API can help application to turn on/off
the frontbuffer mode in runtime.
Change-Id: I608309869dcb9d0bd0ba42c7e54afee6da1b5e04
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 4 Jan 2023 07:49:41 +0000 (16:49 +0900)]
wl_egl_thread: prepare for the failure of pause_in_idle
- The calling tpl_gthread_pause_in_idle() move from force_flush()
to outside.
- Add locking wl_event_mutex after trying tpl_gthread_pause_in_idle.
- Locking wl_event_mutex is a secondary means of preparing for
the failure of tpl_gthread_pause_in_idle().
If tpl_gthread_pause_in_idle()is successful,
locking wl_event_mutex does not affect.
Change-Id: I35132da013f67921c0f6deecc0909118461f3872
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 4 Jan 2023 07:29:57 +0000 (16:29 +0900)]
utils_gthread: cancel pause when wait_idle failed
- If the tpl_gthread_wait_idle fails with timeout,
it should be unlock pause_mutex immediately.
Change-Id: If33cc3c0b617ca34bb63d110d927e0dd7c022526
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Tue, 6 Dec 2022 08:51:24 +0000 (17:51 +0900)]
wl_egl: Delete calling wait_idle in surface_fini
- tpl_gthread_wait_idle will be called in tpl_gthread_pause_in_idle()
tpl_gthread_pause_in_idle will be called in buffer_clear()
So, calling wait_idle() is duplicated & meaningless operation
Change-Id: I50b2aa2e73f5a22be5860ab3e6be241def2d862f
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 2 Dec 2022 07:17:32 +0000 (16:17 +0900)]
utils_gthread: Prevent deadlock caused by wait_idle
Deadlock situation: Multi-threaded and multi surfaces for each thread
T2: call pause_in_idle()->wait_idle()
cond_wait() until idle signaled
T1: call wait_idle()
wait for lock idle_mutex
T2: _thread_idle_cb unlock idle_mutex,
set is_idle to TPL_TRUE
and wait to lock pause_mutex
T1: change is_idle to TPL_FALSE
cond_wait()
T2: cannot exit from while loop
still cond_wait()
- is_idle changing should be set TPL_FALSE after cond_wait finished
Change-Id: I44292e486a1b9f686ec28bc0ae10ddedf94a48e3
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 2 Dec 2022 01:52:44 +0000 (10:52 +0900)]
Package version up to 1.9.14
Change-Id: Id42e31cefc898f35fb9d84a8f949513a77eac515
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 2 Dec 2022 01:51:23 +0000 (10:51 +0900)]
utils_gthread: Add missed initializing paused flag
This missed line can cause deadlock issue.
Change-Id: I8d098e79010133dec4d7cc2cec071213cd02ec1a
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
jinbong, Lee [Wed, 30 Nov 2022 06:59:49 +0000 (15:59 +0900)]
Package version up to 1.9.13
Change-Id: I73f1638107fb67870bbc782cf970de7e35e2ff47
jinbong, Lee [Wed, 30 Nov 2022 06:47:33 +0000 (15:47 +0900)]
remove vblank's waiting_buffers in _tbm_queue_force_flush for prevent committing flushed tbm_surface
Change-Id: Ic91aa678659b12c9ce80bce87504deef2e4299af
Joonbum Ko [Wed, 30 Nov 2022 04:47:29 +0000 (13:47 +0900)]
utils_gthread: Change to use g_cond_wait_until to wait idle
- In some cases, signal was sent by idle_callback but
there is a problem that this signal is lost and g_cond_wait
cannot be awakened.
- Above case can cause deadlock problem.
- So set 200ms timeout ms with using g_cond_wait_until instead of
g_cond_wait.
Change-Id: Ib0a549616f74a9fb39e78f7b37b1b8b09e16031d
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 18 Nov 2022 08:40:21 +0000 (17:40 +0900)]
Package version up to 1.9.12
Change-Id: I24145794da2f4bd1505ee64518a427092c6472de
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 18 Nov 2022 08:30:17 +0000 (17:30 +0900)]
wl_egl: Set last_enq_buffer before tbm enqueue
- Since the operation from queue_enqueue to surface_commit
can be done at a time slice in thread, last_enq_buffer
must be set to enqueued tbm_surface before tbm queue enqueue
to initialize with NULL when do surface_commit.
Change-Id: I8b753abf44f92d4de4dab43185a7a29cb30c59fd
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Fri, 18 Nov 2022 08:21:49 +0000 (17:21 +0900)]
wl_egl: Use buffers list instead of buffers array
- If surface use array to track buffers,
index management is difficult and difficult
to assign a suitable size.
- The use of list can reduce some of the potential problems
that can occur from complex management.
Change-Id: I9a4574f542cde0ad8d32fed575d03e1a2c861b0b
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 17 Nov 2022 08:33:11 +0000 (17:33 +0900)]
wl_egl: Apply pause and wait_idle at buffer clear
AS-IS
Using wl_event_mutex lock to pause thread.
Using wl_event_mutex is not good way to pause thread
because locking wl_event_mutex can effect other wayland threads.
TO-BE
Using tpl_gthread_pause_in_idle is better way than before.
Because locking on idle allows thread to handle other tasks.
Change-Id: I47a1b82a91ede648ceb8a8a1e7967fa56950ba00
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Wed, 16 Nov 2022 08:21:08 +0000 (17:21 +0900)]
utils_gthread: Add new functions to pause/continue thread
tpl_gthread_wait_idle
- Create a new idle source and attach it to thread context.
This function will be blocked until idle callback is called.
If the thread has some worksto be handled, wait for
the thread to finish it.
tpl_gthread_pause_in_idle
- Pause the thread when idle callback is called.
tpl_gthread_continue
- Continue the paused thread.
Change-Id: I5a2aaf3b8b9579306246234d252b643b6cc0bf3e
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 10 Nov 2022 14:57:16 +0000 (23:57 +0900)]
Package version up to 1.9.11
Change-Id: I03d05215651ab24596e24a9a8d011cd7a4940b2f
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 10 Nov 2022 14:45:49 +0000 (23:45 +0900)]
wl_egl: Print additional INFO logs at buffer_clear
Change-Id: I5cbd4b6b96bc149407969834d4147aeebb3cf2e2
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 10 Nov 2022 10:36:33 +0000 (19:36 +0900)]
wl_egl: Set timeout for buffer_clear to 500ms
- Some system condition problems may cause signal after 200ms.
Change-Id: I40bdbf7cc862e0026228b85644eda60f15b86dec
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 27 Oct 2022 23:35:20 +0000 (08:35 +0900)]
Package version up to 1.9.10
Change-Id: I43791c514fa7abd274b238d7cdfbc3489e8278eb
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Joonbum Ko [Thu, 27 Oct 2022 15:02:58 +0000 (00:02 +0900)]
wl_egl: Add defense code for fake signal in buffer_clear
tpl_gcond_timed_wait is changed to be called within the while loop.
It will repeat the process of checking status even if it wakes up
due to Fake Signal.
Change-Id: Ia66810da64ba2830c166f01dcb2f2f4615fc8e4f
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>