e_info: -hwc -hwc_trace are changed 07/193507/4
authorJuyeon Lee <juyeonne.lee@samsung.com>
Wed, 21 Nov 2018 07:43:13 +0000 (16:43 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Tue, 27 Nov 2018 10:43:01 +0000 (10:43 +0000)
-hwc : had on and off option, added 3rd option to print out hwc information
       0 means hwc policy deactive
       1 means hwc policy active
       2 means prints out plane info regarding hwc
-trace : the option name is changed from -hwc_trace to -trace
       for the genernal purpose of log trace
       -trace hwc 1,0 turns on and off of plane_trace_debug

Change-Id: Ia0f68615558a8eab010d294e03b2f4b8537b81a8

src/bin/e_info_client.c
src/bin/e_info_server.c
src/bin/e_info_shared_types.h

index 36807f7..b403936 100644 (file)
@@ -2959,53 +2959,52 @@ _e_info_client_proc_output_mode(int argc, char **argv)
 }
 
 static void
-_e_info_client_proc_hwc_trace(int argc, char **argv)
+_e_info_client_proc_trace(int argc, char **argv)
 {
    uint32_t onoff;
 
-   if (argc < 3)
-     {
-        printf("Error Check Args: enlightenment_info -hwc_trace [0/1/2]\n");
-        return;
-     }
+   if (argc < 4)
+     goto arg_err;
 
-   onoff = atoi(argv[2]);
+   onoff = atoi(argv[3]);
 
-   if (onoff == 1 || onoff == 0 || onoff == 2)
+   if (onoff == 1 || onoff == 0)
      {
-        if (!_e_info_client_eldbus_message_with_args("hwc_trace_message", NULL, "i", onoff))
+        if (eina_streq(argv[2], "hwc"))
           {
-             printf("_e_info_client_eldbus_message_with_args error");
+             if (!_e_info_client_eldbus_message_with_args("trace_message_hwc", NULL, "i", onoff))
+               {
+                  printf("_e_info_client_eldbus_message_with_args error");
+               }
              return;
           }
      }
-   else
-     printf("Error Check Args: enlightenment_info -hwc_trace [0/1/2]\n");
+
+arg_err:
+   printf("Error Check Args: enlightenment_info -trace %s\n", USAGE_TRACE);
 }
 
 static void
 _e_info_client_proc_hwc(int argc, char **argv)
 {
-   uint32_t onoff;
+   uint32_t param;
 
    if (argc < 3)
-     {
-        printf("Error Check Args: enlightenment_info -hwc [1: on, 0: off]\n");
-        return;
-     }
+     goto arg_err;
 
-   onoff = atoi(argv[2]);
+   param = atoi(argv[2]);
 
-   if (onoff == 1 || onoff == 0)
+   if (param == 1 || param == 0 || param == 2)
      {
-        if (!_e_info_client_eldbus_message_with_args("hwc", NULL, "i", onoff))
+        if (!_e_info_client_eldbus_message_with_args("hwc", NULL, "i", param))
           {
              printf("_e_info_client_eldbus_message_with_args error");
-             return;
           }
+        return;
      }
-   else
-     printf("Error Check Args: enlightenment_info -hwc [1: on, 0: off]\n");
+
+arg_err:
+     printf("Error Check Args: enlightenment_info -hwc [0: off, 1: on, 2: info]\n");
 
 }
 
@@ -4840,10 +4839,10 @@ static ProcInfo procs_to_tracelogs[] =
    },
 #endif
    {
-      "hwc_trace",
-      "[off: 0, on: 1, info:2]",
-      "Show the hwc trace log",
-      _e_info_client_proc_hwc_trace
+      "trace",
+      "[hwc] [off: 0, on: 1]",
+      "Show the trace log in detail",
+      _e_info_client_proc_trace
    },
 };
 
@@ -5001,8 +5000,8 @@ static ProcInfo procs_to_execute[] =
    },
    {
       "hwc",
-      "[on: 1, off: 0]",
-      "HW composite [on 1, off 0]",
+      "[on: 1, off: 0, 2: info]",
+      "HW composite policy on(1) and off(0), or prints info(2) via dlog",
       _e_info_client_proc_hwc
    },
    {
index eec9d33..9b7e88d 100644 (file)
@@ -4169,9 +4169,9 @@ static Eldbus_Message *
 e_info_server_cb_hwc(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
 {
    Eldbus_Message *reply = eldbus_message_method_return_new(msg);
-   uint32_t onoff;
+   uint32_t info;
 
-   if (!eldbus_message_arguments_get(msg, "i", &onoff))
+   if (!eldbus_message_arguments_get(msg, "i", &info))
      {
         ERR("Error getting arguments.");
         return reply;
@@ -4183,10 +4183,21 @@ e_info_server_cb_hwc(const Eldbus_Service_Interface *iface EINA_UNUSED, const El
         return reply;
      }
 
-   if (onoff == 1)
-     e_comp_hwc_deactive_set(EINA_FALSE);
-   else if (onoff == 0)
-     e_comp_hwc_deactive_set(EINA_TRUE);
+   switch (info)
+     {
+      case 0:
+        e_comp_hwc_deactive_set(EINA_TRUE);
+        break;
+
+      case 1:
+        e_comp_hwc_deactive_set(EINA_FALSE);
+        break;
+
+      default:
+      case 2:
+        e_comp_screen_hwc_info_debug();
+        break;
+     }
 
    return reply;
 }
@@ -5703,7 +5714,7 @@ static const Eldbus_Method methods[] = {
    { "dump_selected_buffers", ELDBUS_ARGS({"ss", "dump_selected_buffers"}), NULL, _e_info_server_cb_selected_buffer_dump, 0 },
    { "dump_screen", ELDBUS_ARGS({"s", "dump_screen"}), NULL, _e_info_server_cb_screen_dump, 0 },
    { "output_mode", ELDBUS_ARGS({SIGNATURE_OUTPUT_MODE_CLIENT, "output mode"}), ELDBUS_ARGS({"a("SIGNATURE_OUTPUT_MODE_SERVER")", "array of ec"}), _e_info_server_cb_output_mode, 0 },
-   { "hwc_trace_message", ELDBUS_ARGS({"i", "hwc_trace_message"}), NULL, e_info_server_cb_hwc_trace_message, 0},
+   { "trace_message_hwc", ELDBUS_ARGS({"i", "trace_message_hwc"}), NULL, e_info_server_cb_hwc_trace_message, 0},
    { "hwc", ELDBUS_ARGS({"i", "hwc"}), NULL, e_info_server_cb_hwc, 0},
    { "show_plane_state", NULL, NULL, e_info_server_cb_show_plane_state, 0},
    { "show_pending_commit", NULL, ELDBUS_ARGS({"a("VALUE_TYPE_FOR_PENDING_COMMIT")", "array of pending commit"}), e_info_server_cb_show_pending_commit, 0},
index 26124f8..6f605c0 100644 (file)
@@ -225,5 +225,13 @@ typedef enum
    "\tgeometry [ x][ y][ w][ h]     : change desktop screen given geometry\n"        \
    "\tzoom     [zx][zy][cx][cy]     : scale desktop screen\n"
 
+/* -------------------------------------------------------------------------- */
+/* TRACE                                                                      */
+/* -------------------------------------------------------------------------- */
+#define USAGE_TRACE                                                  \
+   "[hwc] [off: 0, on: 1]\n"                                \
+   "Example:\n"                                                      \
+   "\tenlightenment_info -trace hwc 1\n"                             \
+   "\tenlightenment_info -trace hwc 0\n"
 
 #endif /* end of _E_INFO_SHARED_TYPES_ */