Remove TDM_CONFIG_KEY_GENERAL_HWC_COMMIT_USE_GLOBAL_FPS 78/320278/2
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 25 Feb 2025 11:10:42 +0000 (20:10 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Wed, 26 Feb 2025 06:01:03 +0000 (15:01 +0900)
Change-Id: I4209f95b8187e5a0a8c028f2ed79cf8c2c83bf70

src/tdm_config.h
src/tdm_hwc.c
src/tdm_private.h
src/tdm_private_types.h
src/tdm_vblank.c

index 5f752f2f58efc155dde3bbcd80fc78cb040f44fe..a32cac73d0a86825a1643155bbf83bf860f06da4 100644 (file)
@@ -114,12 +114,6 @@ tdm_config_set_string(const char *key, const char *value);
  */
 #define TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT  "general:virtual_output"
 
-/* use the global fps to commit. [0(disable), 1(enable)]
- * default: 0
- * ex) 1
- */
-#define TDM_CONFIG_KEY_GENERAL_HWC_COMMIT_USE_GLOBAL_FPS  "general:hwc_commit_use_global_fps"
-
 /*** debug keys **************************************************************/
 
 /* debugging module list. [0(disable), 1(enable)]
index c2695c0f012edc7268240c2089e4f5572538dc84..a99cc0b384f1c9f8be2431464310962aae3330c4 100644 (file)
@@ -70,9 +70,6 @@
        TDM_RETURN_IF_FAIL(private_output != NULL); \
        private_display = private_output->private_display
 
-static int hwc_use_vblank;
-static unsigned int hwc_vblank_fps;
-
 static tdm_private_hwc_window *
 _tdm_hwc_find_private_hwc_window(tdm_private_hwc *private_hwc, tdm_hwc_window *hwc_window_backend)
 {
@@ -223,99 +220,6 @@ _tdm_hwc_cb_commit_hal_tdm(hal_tdm_hwc *hwc_backend, unsigned int sequence,
        TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
 }
 
-/* LCOV_EXCL_START */
-static void
-_tdm_hwc_got_wait_vblank(unsigned int sequence,
-                                                unsigned int tv_sec, unsigned int tv_usec, void *user_data)
-{
-       tdm_private_hwc_commit_handler *hwc_commit_handler = user_data;
-       tdm_private_hwc *private_hwc;
-       tdm_thread_cb_hwc_commit hwc_commit;
-
-       private_hwc = hwc_commit_handler->private_hwc;
-       private_hwc->private_output->layer_waiting_vblank = 0;
-
-       memset(&hwc_commit, 0, sizeof hwc_commit);
-       hwc_commit.base.type = TDM_THREAD_CB_HWC_COMMIT;
-       hwc_commit.base.length = sizeof hwc_commit;
-       hwc_commit.base.object_stamp = private_hwc->stamp;
-       hwc_commit.base.data = hwc_commit_handler;
-       hwc_commit.base.sync = 0;
-       hwc_commit.sequence = sequence;
-       hwc_commit.tv_sec = tv_sec;
-       hwc_commit.tv_usec = tv_usec;
-
-       _tdm_hwc_thread_cb_commit(private_hwc->private_output->private_display, private_hwc, &hwc_commit.base, user_data);
-}
-
-static void
-_tdm_hwc_cb_wait_vblank(tdm_vblank *vblank, tdm_error error, unsigned int sequence,
-                                               unsigned int tv_sec, unsigned int tv_usec, void *user_data)
-{
-       tdm_private_hwc_commit_handler *hwc_commit_handler = user_data;
-       tdm_private_output *private_output = NULL;
-       tdm_private_display *private_display;
-
-       if (!hwc_commit_handler->use_vblank)
-               return;
-
-       TDM_RETURN_IF_FAIL(hwc_commit_handler != NULL);
-       TDM_RETURN_IF_FAIL(hwc_commit_handler->private_hwc != NULL);
-
-       private_output = hwc_commit_handler->private_hwc->private_output;
-       TDM_RETURN_IF_FAIL(private_output != NULL);
-
-       private_display = private_output->private_display;
-
-       _pthread_mutex_lock(&private_display->lock);
-
-       _tdm_hwc_got_wait_vblank(sequence, tv_sec, tv_usec, user_data);
-
-       _pthread_mutex_unlock(&private_display->lock);
-}
-
-static tdm_error
-_tdm_hwc_vblank(tdm_private_hwc *private_hwc, tdm_private_hwc_commit_handler *hwc_commit_handler)
-{
-       tdm_private_display *private_display;
-       tdm_private_output *private_output;
-       tdm_error ret = TDM_ERROR_NONE;
-
-       private_output = private_hwc->private_output;
-       TDM_RETURN_VAL_IF_FAIL(private_output != NULL, TDM_ERROR_INVALID_PARAMETER);
-       private_display = private_output->private_display;
-
-       if (!private_output->vblank) {
-               /* tdm_vblank APIs is for server. it should be called in unlock status*/
-               _pthread_mutex_unlock(&private_display->lock);
-               private_output->vblank = tdm_vblank_create(private_display, private_output, NULL);
-               _pthread_mutex_lock(&private_display->lock);
-               TDM_RETURN_VAL_IF_FAIL(private_output->vblank != NULL, TDM_ERROR_OPERATION_FAILED);
-       }
-
-       if (!private_output->layer_waiting_vblank) {
-               ret = tdm_vblank_set_fps(private_output->vblank, hwc_vblank_fps);
-               if (ret != TDM_ERROR_NONE)
-                       goto done;
-
-               private_output->layer_waiting_vblank = 1;
-
-               /* tdm_vblank APIs is for server. it should be called in unlock status*/
-               _pthread_mutex_unlock(&private_display->lock);
-               ret = tdm_vblank_wait(private_output->vblank, 0, 0, 1, _tdm_hwc_cb_wait_vblank, hwc_commit_handler);
-               _pthread_mutex_lock(&private_display->lock);
-               if (ret != TDM_ERROR_NONE) {
-                       if (!TDM_OUTPUT_DPMS_VSYNC_IS_OFF(private_output->current_dpms_value)) {
-                               private_output->layer_waiting_vblank = 0;
-                       }
-               }
-       }
-
-done:
-       return ret;
-}
-/* LCOV_EXCL_STOP */
-
 INTERN tdm_error
 tdm_hwc_init(tdm_private_display *private_display)
 {
@@ -324,20 +228,6 @@ tdm_hwc_init(tdm_private_display *private_display)
        return TDM_ERROR_NONE;
 }
 
-INTERN void
-tdm_hwc_set_vblank(unsigned int fps)
-{
-       hwc_use_vblank = 1;
-       hwc_vblank_fps = fps;
-}
-
-INTERN void
-tdm_hwc_unset_vblank(void)
-{
-       hwc_use_vblank = 0;
-       hwc_vblank_fps = 0;
-}
-
 EXTERN tdm_hwc_window *
 tdm_hwc_create_window(tdm_hwc *hwc, tdm_error *error)
 {
@@ -931,35 +821,15 @@ tdm_hwc_commit(tdm_hwc *hwc, int sync, tdm_hwc_commit_handler func, void *user_d
                }
        }
 
-       if (hwc_use_vblank) {
-               /* LCOV_EXCL_START */
-               hwc_commit_handler->use_vblank = 1;
-
-               if (private_module->use_hal_tdm)
-                       ret = (tdm_error)hal_tdm_hwc_commit((hal_tdm_hwc *)private_hwc->hwc_backend, sync, NULL);
-               else
-                       ret = func_hwc->hwc_commit(private_hwc->hwc_backend, sync, NULL);
-               TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, commit_failed);
-
-               ret = _tdm_hwc_vblank(private_hwc, hwc_commit_handler);
-               if (ret == TDM_ERROR_NONE) {
-                       if (tdm_debug_module & TDM_DEBUG_COMMIT)
-                               TDM_INFO("hwc(%d) backend commit: wait vblank handle(%p) func(%p) user_data(%p)",
-                                       private_hwc->index, hwc_commit_handler, func, user_data);
-               } else
-                       goto commit_failed;
-               /* LCOV_EXCL_STOP */
-       } else {
-               if (private_module->use_hal_tdm)
-                       ret = (tdm_error)hal_tdm_hwc_commit((hal_tdm_hwc *)private_hwc->hwc_backend, sync, hwc_commit_handler);
-               else
-                       ret = func_hwc->hwc_commit(private_hwc->hwc_backend, sync, hwc_commit_handler);
-               TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, commit_failed);
+       if (private_module->use_hal_tdm)
+               ret = (tdm_error)hal_tdm_hwc_commit((hal_tdm_hwc *)private_hwc->hwc_backend, sync, hwc_commit_handler);
+       else
+               ret = func_hwc->hwc_commit(private_hwc->hwc_backend, sync, hwc_commit_handler);
+       TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, commit_failed);
 
-               if (tdm_debug_module & TDM_DEBUG_COMMIT)
-                       TDM_INFO("hwc(%d) backend commit: handle(%p) func(%p) user_data(%p)",
-                                       private_hwc->index, hwc_commit_handler, func, user_data);
-       }
+       if (tdm_debug_module & TDM_DEBUG_COMMIT)
+               TDM_INFO("hwc(%d) backend commit: handle(%p) func(%p) user_data(%p)",
+                               private_hwc->index, hwc_commit_handler, func, user_data);
 
        if (tdm_ttrace_module & TDM_TTRACE_HWC)
                TDM_TRACE_ASYNC_BEGIN((intptr_t)hwc_commit_handler, "[HWC_COMMIT~HANDLER] %d",
index 1f912c54f61e1c1b01b0bfffa02dddbcad325b1b..cdb87dcf686eda5faa30bf30a5f67cfe101431e1 100644 (file)
@@ -190,10 +190,6 @@ tdm_pp_destroy_internal(tdm_private_pp *private_pp);
 
 tdm_error
 tdm_hwc_init(tdm_private_display *private_display);
-void
-tdm_hwc_set_vblank(unsigned int fps);
-void
-tdm_hwc_unset_vblank(void);
 tdm_hwc_window *
 tdm_hwc_window_create_internal(tdm_private_hwc *private_hwc, tdm_error *error);
 void
index 7c646e1e34c1736791dfbfcea8fa72f9c0fccdd5..b30fdb46ae8b31476386a4acae68d191f242a9c3 100644 (file)
@@ -515,7 +515,6 @@ struct _tdm_private_hwc_commit_handler {
        void *user_data;
 
        pid_t owner_tid;
-       int use_vblank;
 };
 
 struct _tdm_private_layer_commit_handler {
index 691542ba4b9467143e8901c7170e5623ddce5c77..a20768618077c52c519b321cfcdad831a7ff7634 100644 (file)
@@ -170,7 +170,6 @@ static struct list_head valid_wait_list;
 static struct list_head create_handler_list;
 static unsigned int vblank_list_inited;
 static unsigned int vblank_global_fps;
-static unsigned int hwc_commit_use_global_fps;
 static double stamp = 0;
 
 static void _tdm_vblank_cb_vblank_SW(tdm_private_display *private_display, void *object, tdm_thread_cb_base *cb_base, void *user_data);
@@ -602,13 +601,6 @@ tdm_vblank_enable_global_fps(unsigned int enable, unsigned int fps)
                v->check_HW_or_SW = 1;
        }
 
-       if (hwc_commit_use_global_fps) {
-               if (enable)
-                       tdm_hwc_set_vblank(fps);
-               else
-                       tdm_hwc_unset_vblank();
-       }
-
        pthread_mutex_unlock(&valid_list_lock);
 
        return TDM_ERROR_NONE;
@@ -750,8 +742,6 @@ tdm_vblank_init(tdm_display *dpy)
        tdm_thread_cb_set_find_func(TDM_THREAD_CB_VBLANK_SW, _tdm_vblank_find_object);
        tdm_thread_cb_set_find_func(TDM_THREAD_CB_VBLANK_CREATE, _tdm_vblank_find_display);
 
-       hwc_commit_use_global_fps = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_HWC_COMMIT_USE_GLOBAL_FPS, 0);
-
        vblank_list_inited = 1;
 
        return TDM_ERROR_NONE;