kmsprint: improve property enum prints
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 11 Aug 2016 09:47:34 +0000 (12:47 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 23 Sep 2016 11:46:55 +0000 (14:46 +0300)
utils/kmsprint.cpp

index e6a4be49ee907b8d214c9d184e1dc54596af47a7..7f02b41c80e53a4b5e238fd7dbf6daf53c51a24a 100644 (file)
@@ -138,10 +138,10 @@ static string format_property(const Property* prop, uint64_t val)
                for (auto kvp : prop->get_enums()) {
                        if (val & (1 << kvp.first))
                                v.push_back(kvp.second);
-                       vall.push_back(kvp.second);
+                       vall.push_back(sformat("%s=0x%x", kvp.second.c_str(), 1 << kvp.first));
                }
 
-               ret += sformat("%s (%s)", join(v, "|").c_str(), join(vall, "|").c_str());
+               ret += sformat("0x%llx (%s) [%s]", val, join(v, "|").c_str(), join(vall, "|").c_str());
 
                break;
        }
@@ -170,10 +170,10 @@ static string format_property(const Property* prop, uint64_t val)
                for (auto kvp : prop->get_enums()) {
                        if (val == kvp.first)
                                cur = kvp.second;
-                       vall.push_back(kvp.second);
+                       vall.push_back(sformat("%s=%llu", kvp.second.c_str(), kvp.first));
                }
 
-               ret += sformat("%s (%s)", cur.c_str(), join(vall, "|").c_str());
+               ret += sformat("%llu (%s) [%s]", val, cur.c_str(), join(vall, "|").c_str());
 
                break;
        }