-remove use of deprecated QList::find()
-give up with closing as soon as the first plugin->queryClose() returns false
-by the way, use foreach() here and there

svn path=/trunk/KDE/kdepim/kontact/src/; revision=784488

--- kontact/src/mainwindow.cpp
+++ kontact/src/mainwindow.cpp
@@ -926,17 +926,10 @@
 {
   Core::readProperties( config );

-  QStringList activePlugins = config.readEntry( "ActivePlugins",QStringList() );
-  QList<Plugin*>::ConstIterator it = mPlugins.begin();
-  QList<Plugin*>::ConstIterator end = mPlugins.end();
-  for ( ; it != end; ++it ) {
-    Plugin *plugin = *it;
-    if ( !plugin->isRunningStandalone() ) {
-      QStringList::ConstIterator activePlugin = activePlugins.find( plugin->identifier() );
-      if ( activePlugin != activePlugins.end() ) {
-        plugin->readProperties( config );
-      }
-    }
+  QSet<QString> activePlugins = QSet<QString>::fromList( config.readEntry( "ActivePlugins",QStringList() ) );
+  foreach ( Plugin* plugin, mPlugins ) {
+    if ( !plugin->isRunningStandalone() && activePlugins.contains( plugin->identifier() ) )
+      plugin->readProperties( config );
   }
 }

@@ -946,11 +939,9 @@

   QStringList activePlugins;

-  KPluginInfo::List::Iterator it = mPluginInfos.begin();
-  KPluginInfo::List::Iterator end = mPluginInfos.end();
-  for ( ; it != end; ++it ) {
-    if ( it->isPluginEnabled() ) {
-      Plugin *plugin = pluginFromInfo( *it );
+  foreach ( const KPluginInfo& pluginInfo, mPluginInfos ) {
+    if ( pluginInfo.isPluginEnabled() ) {
+      Plugin *plugin = pluginFromInfo( pluginInfo );
       if ( plugin ) {
         activePlugins.append( plugin->identifier() );
         plugin->saveProperties( config );
@@ -966,17 +957,13 @@
   if ( kapp->sessionSaving() || mReallyClose )
     return true;

-  bool localClose = true;
-  QList<Plugin*>::ConstIterator end = mPlugins.end();
-  QList<Plugin*>::ConstIterator it = mPlugins.begin();
-  for ( ; it != end; ++it ) {
-    Plugin *plugin = *it;
+  foreach ( Plugin* plugin, mPlugins ) {
     if ( !plugin->isRunningStandalone() )
       if ( !plugin->queryClose() )
-        localClose = false;
-  }
-
-  return localClose;
+        return false;
+  }
+
+  return true;
 }

 void MainWindow::slotShowStatusMsg( const QString &msg )


Remove awful hack and see if we really have a problem or not

svn path=/branches/proko2/kdepim/; revision=363688

--- korganizer/kogroupware.cpp
+++ korganizer/kogroupware.cpp
@@ -80,7 +80,11 @@
   // being all done loading and start the scheduling after that. Even
   // better fix would be that we would be able to locate the resource
   // an event is saved in even though the resource is deactivated
-  QTimer::singleShot( 60000, this, SLOT( slotStartScheduling() ) );
+  //QTimer::singleShot( 60000, this, SLOT( slotStartScheduling() ) );
+
+  // It could be that the hack ^ is not needed after all. Test that for
+  // a while. *sigh* - experimenting programming is bad
+  slotStartScheduling();
 }

 FreeBusyManager *KOGroupware::freeBusyManager()


SVN_MERGE
Merged revisions 1001591 via svnmerge from
svn+ssh://tmcguire@svn.kde.org/home/kde/branches/kdepim/enterprise4/kdepim

................
  r1001591 | winterz | 2009-07-23 19:57:09 +0200 (Thu, 23 Jul 2009) | 72 lines

  Merged revisions 1001496 via svnmerge from
  https://svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim

  ........
    r1001496 | vkrause | 2009-07-23 09:05:16 -0400 (Thu, 23 Jul 2009) | 66 lines

    Merge the following stuff from the ancient proko2 branch. Should fix
    various issues with invitations if you have access to a calendar of
    aanother person that is also invited.

    Kolab issue 3724

    ------------------------------------------------------------------------
    r519272 | tilladam | 2006-03-16 19:35:12 +0100 (Thu, 16 Mar 2006) | 2 lines

    Change the buttons to "Store" and "Throw away" as requested.

    ------------------------------------------------------------------------
    r513844 | tilladam | 2006-02-26 18:59:04 +0100 (Sun, 26 Feb 2006) | 2 lines

    Make sure the transaction is cleaned up also in the error case.

    ------------------------------------------------------------------------
    r513842 | tilladam | 2006-02-26 18:53:37 +0100 (Sun, 26 Feb 2006) | 4 lines

    In case an update or cancel message is processed for an incidence that
    cannot be found, inform the user, instead of blindly adding a new
    version of the incidence. (proko2 issue 1128)

    ------------------------------------------------------------------------
    r365868 | dfaure | 2004-11-24 18:19:08 +0100 (Wed, 24 Nov 2004) | 2 lines

    Can't update readonly events.

    ------------------------------------------------------------------------
    r365849 | dfaure | 2004-11-24 17:12:01 +0100 (Wed, 24 Nov 2004) | 4 lines

    Looking at the status is too unreliable since we have several versions of the event
    and libical gets confused - the whole point of this code is to do the equivalent
    with some more logic.

    ------------------------------------------------------------------------
    r365838 | dfaure | 2004-11-24 16:17:15 +0100 (Wed, 24 Nov 2004) | 2 lines

    Reworked logic to actually fix issue526

    ------------------------------------------------------------------------
    r365807 | dfaure | 2004-11-24 14:26:14 +0100 (Wed, 24 Nov 2004) | 2 lines

    More debug output (to get more info out of michel)

    ------------------------------------------------------------------------
    r365223 | dfaure | 2004-11-22 21:24:57 +0100 (Mon, 22 Nov 2004) | 3 lines

    Tentative fix for https://intevation.de/roundup/kolab/issue526 as discussed with Till.
    The server died so full testing isn't possible tonight though.

    ------------------------------------------------------------------------
    r365196 | tilladam | 2004-11-22 20:22:17 +0100 (Mon, 22 Nov 2004) | 4 lines

    Add an additional const QString &attendee parameter to acceptTransaction
    and acceptRequests so that we can compare which of the attendees in the
    event is the one we are supposed to act upon.

    ------------------------------------------------------------------------
    r364294 | tilladam | 2004-11-19 18:03:43 +0100 (Fri, 19 Nov 2004) | 4 lines

    Add unknown attendees which did not appear in the original event as
    voluntary/optional attendees. This happens when people reply that were
    invited as part of a server side distribution list. Patch by Bo.
  ........
................

svn path=/trunk/KDE/kdepim/; revision=1004684

--- korganizer/kogroupware.cpp
+++ korganizer/kogroupware.cpp
@@ -209,7 +209,7 @@
     }
     if ( KOPrefs::instance()->outlookCompatCounterProposals() ||
          !action.startsWith( QLatin1String( "counter" ) ) ) {
-      scheduler.acceptTransaction( incidence, method, status );
+      scheduler.acceptTransaction( incidence, method, status, receiver );
     }
   } else if ( action.startsWith( QLatin1String( "cancel" ) ) ) {
     // Delete the old incidence, if one is present


fastuidraw/painter/stroked_path: closing edge bug fix + more explicit way of tracking joins and caps

--- src/fastuidraw/painter/stroked_path.cpp
+++ src/fastuidraw/painter/stroked_path.cpp
@@ -127,13 +127,9 @@
     float m_bevel_lambda;
     fastuidraw::vec2 m_bevel_normal;

-    /* if non-negative, indicates that m_pt1
-       is where an edge ends and is the join-ID
-       from the join ordering comiing naturally
-       from TessellatedPath. The natural ordering
-       is that first we
-     */
-    int m_join_id;
+    bool m_ends_at_join;
+    bool m_is_cap_start, m_is_cap_end;
+    int m_contour_ID, m_edge_ID;
   };

   /* An EdgeStore stores the temporary data of the data in
@@ -160,8 +156,7 @@
   private:

     void
-    process_edge(int join_id,
-                 const fastuidraw::TessellatedPath &P, PathData &path_data,
+    process_edge(const fastuidraw::TessellatedPath &P, PathData &path_data,
                  unsigned int contour, unsigned int edge,
                  std::vector<SingleSubEdge> &dst, fastuidraw::BoundingBox<float> &bx);

@@ -229,26 +224,23 @@
     std::vector<float> m_clip_scratch_floats;
   };

-  class Flopper
+  class JoinSource
   {
   public:
-    /* what chunk a given cap/join will reside on
+    /* the contour ID of the join
      */
-    unsigned int m_chunk;
-
-    /* the depth value to use for the cap's/join's
-       attribute data
+    unsigned int m_contour_ID;
+
+    /* the edge ID of the edge going into the join
      */
-    unsigned int m_depth_value;
-
-    /* the join ID from the canonical join ordering
-     */
-    unsigned int m_join_id;
-
-    /* attribute value to pass to DashEvaluator
-       when deciding if to keep the join
-     */
-    fastuidraw::PainterAttribute m_attrib;
+    unsigned int m_edge_ID;
+  };
+
+  class CapSource
+  {
+  public:
+    unsigned int m_contour_ID;
+    bool m_is_start_cap;
   };

   class ChunkSetPrivate
@@ -376,16 +368,14 @@
     count_vertices_indices(SubEdgeCullingHierarchy *src,
                            unsigned int &vertex_cnt,
                            unsigned int &index_cnt,
-                           unsigned int &depth_cnt,
-                           unsigned int &join_depth,
-                           unsigned int &cap_depth);
+                           unsigned int &depth_cnt);
     void
     compute_depth_ranges(unsigned int edge_depth,
                          unsigned int join_depth,
                          unsigned int cap_depth);

     fastuidraw::vecN<StrokedPathSubset*, 2> m_children;
-    unsigned int m_depth_count, m_join_depth_count, m_cap_depth_count;
+    unsigned int m_depth_count;

     /* book keeping for edges.
      */
@@ -404,13 +394,13 @@

     /* book keeping for joins.
      */
-    std::vector<Flopper> m_joins;
+    std::vector<JoinSource> m_joins;
     fastuidraw::range_type<unsigned int> m_joins_depth;
     fastuidraw::range_type<unsigned int> m_joins_depth_with_children;

     /* book keeping for caps.
      */
-    std::vector<Flopper> m_caps;
+    std::vector<CapSource> m_caps;
     fastuidraw::range_type<unsigned int> m_caps_depth;
     fastuidraw::range_type<unsigned int> m_caps_depth_with_children;
   };
@@ -1110,23 +1100,21 @@
   fastuidraw::BoundingBox<float> closing_edges_bb, non_closing_edges_bb;

   path_data.m_per_contour_data.resize(P.number_contours());
-  for(unsigned int o = 0, join_id = 0; o < P.number_contours(); ++o)
+  for(unsigned int o = 0; o < P.number_contours(); ++o)
     {
       path_data.m_per_contour_data[o].m_edge_data_store.resize(P.number_edges(o));
       path_data.m_per_contour_data[o].m_start_contour_pt = P.unclosed_contour_point_data(o).front();
       path_data.m_per_contour_data[o].m_end_contour_pt = P.unclosed_contour_point_data(o).back();
-      for(unsigned int e = 1; e + 1 < P.number_edges(o); ++e, ++join_id)
+      for(unsigned int e = 0; e < P.number_edges(o); ++e)
         {
-          process_edge(join_id, P, path_data, o, e, non_closing_edges, non_closing_edges_bb);
-        }
-    }
-
-  for(unsigned int o = 0, join_id = 0; o < P.number_contours(); ++o, join_id += 2)
-    {
-      if(P.number_edges(o) >= 2)
-        {
-          process_edge(join_id + 0, P, path_data, o, 0, non_closing_edges, non_closing_edges_bb);
-          process_edge(join_id + 1, P, path_data, o, P.number_edges(o) - 1, non_closing_edges, non_closing_edges_bb);
+          if(e + 1 != P.number_edges(o))
+            {
+              process_edge(P, path_data, o, e, non_closing_edges, non_closing_edges_bb);
+            }
+          else
+            {
+              process_edge(P, path_data, o, e, closing_edges, closing_edges_bb);
+            }
         }
     }

@@ -1149,8 +1137,7 @@

 void
 EdgeStore::
-process_edge(int join_id,
-             const fastuidraw::TessellatedPath &P, PathData &path_data,
+process_edge(const fastuidraw::TessellatedPath &P, PathData &path_data,
              unsigned int contour, unsigned int edge,
              std::vector<SingleSubEdge> &dst, fastuidraw::BoundingBox<float> &bx)
 {
@@ -1186,9 +1173,14 @@
             }
         }

+      sub_edge.m_contour_ID = contour;
+      sub_edge.m_edge_ID = edge;
+      sub_edge.m_is_cap_start = (i == R.m_begin) && (0 == edge);
+      sub_edge.m_is_cap_end = (i + 2 == R.m_end) && (P.number_edges(contour) == edge + 2);
+
       if(i == R.m_begin)
         {
-          sub_edge.m_join_id = join_id;
+          sub_edge.m_ends_at_join = true;
           sub_edge.m_bevel_lambda = 0.0f;
           sub_edge.m_has_bevel = false;
           path_data.m_per_contour_data[contour].write_edge_data(edge).m_begin_normal = normal;
@@ -1200,7 +1192,7 @@
         }
       else
         {
-          sub_edge.m_join_id = -1;
+          sub_edge.m_ends_at_join = true;
           sub_edge.m_bevel_lambda = CommonJoinData::compute_lambda(last_normal, normal);
           sub_edge.m_has_bevel = true;
           sub_edge.m_bevel_normal = last_normal;
@@ -1406,11 +1398,11 @@
   edge_depth = m_depth.m_end;

   m_joins_depth.m_begin = join_depth;
-  m_joins_depth.m_end = join_depth + m_join_depth_count;
+  m_joins_depth.m_end = join_depth + m_joins.size();
   join_depth = m_joins_depth.m_end;

   m_caps_depth.m_begin = cap_depth;
-  m_caps_depth.m_end = cap_depth + m_cap_depth_count;
+  m_caps_depth.m_end = cap_depth + m_caps.size();
   cap_depth = m_caps_depth.m_end;

   if(m_children[1])
@@ -1462,8 +1454,7 @@
     }

   unsigned int index_cnt, vertex_cnt;
-  count_vertices_indices(src, vertex_cnt, index_cnt,
-                         m_depth_count, m_join_depth_count, m_cap_depth_count);
+  count_vertices_indices(src, vertex_cnt, index_cnt, m_depth_count);

   m_data_chunk = total_chunks;
@@ -1488,15 +1479,11 @@
 count_vertices_indices(SubEdgeCullingHierarchy *src,
                        unsigned int &vertex_cnt,
                        unsigned int &index_cnt,
-                       unsigned int &depth_cnt,
-                       unsigned int &join_depth,
-                       unsigned int &cap_depth)
+                       unsigned int &depth_cnt)
 {
   vertex_cnt = 0u;
   index_cnt = 0u;
   depth_cnt = src->m_sub_edges.size();
-  join_depth = 0;
-  cap_depth = 0;
   for(unsigned int i = 0, endi = depth_cnt; i < endi; ++i)
     {
       const SingleSubEdge &v(src->m_sub_edges[i]);
@@ -1506,17 +1493,33 @@
           index_cnt += 3;
         }

-      if(v.m_join_id != -1)
+      if(v.m_ends_at_join)
         {
-          Flopper entry;
-
-          entry.m_chunk = join_depth;
-          entry.m_depth_value = join_depth;
-          entry.m_join_id = v.m_join_id;
+          JoinSource entry;
+
+          entry.m_contour_ID = v.m_contour_ID;
+          entry.m_edge_ID = v.m_edge_ID;
           m_joins.push_back(entry);
-          ++join_depth;
         }

+      if(v.m_is_cap_start)
+        {
+          CapSource entry;
+
+          entry.m_contour_ID = v.m_contour_ID;
+          entry.m_is_start_cap = true;
+          m_caps.push_back(entry);
+        }
+
+      if(v.m_is_cap_end)
+        {
+          CapSource entry;
+
+          entry.m_contour_ID = v.m_contour_ID;
+          entry.m_is_start_cap = false;
+          m_caps.push_back(entry);
+        }
+
       vertex_cnt += points_per_segment;
       index_cnt += indices_per_segment_without_bevel;
     }
@@ -1762,13 +1765,17 @@
       process_sub_edge(data_src[k], d, attribute_data, index_data, v, i);
     }

-  for(unsigned int v = vertex_data_range.m_begin; v < vertex_data_range.m_end; ++v)
-    {
-      fastuidraw::StrokedPath::point P;
-      fastuidraw::StrokedPath::point::unpack_point(&P, attribute_data[v]);
-      FASTUIDRAWassert(P.depth() >= depth.m_begin);
-      FASTUIDRAWassert(P.depth() < depth.m_end);
-    }
+  #ifdef FASTUIDRAW_DEBUG
+    {
+      for(unsigned int v = vertex_data_range.m_begin; v < vertex_data_range.m_end; ++v)
+        {
+          fastuidraw::StrokedPath::point P;
+          fastuidraw::StrokedPath::point::unpack_point(&P, attribute_data[v]);
+          FASTUIDRAWassert(P.depth() >= depth.m_begin);
+          FASTUIDRAWassert(P.depth() < depth.m_end);
+        }
+    }
+  #endif

   K = e->data_chunk_with_children();
   vertex_data_range = e->vertex_data_range_with_children();
@@ -1782,13 +1789,17 @@
   index_adjusts[K] = -int(vertex_data_range.m_begin);
   zranges[K] = fastuidraw::range_type<int>(depth.m_begin, depth.m_end);

-  for(unsigned int v = vertex_data_range.m_begin; v < vertex_data_range.m_end; ++v)
-    {
-      fastuidraw::StrokedPath::point P;
-      fastuidraw::StrokedPath::point::unpack_point(&P, attribute_data[v]);
-      FASTUIDRAWassert(P.depth() >= depth.m_begin);
-      FASTUIDRAWassert(P.depth() < depth.m_end);
-    }
+  #ifdef FASTUIDRAW_DEBUG
+    {
+      for(unsigned int v = vertex_data_range.m_begin; v < vertex_data_range.m_end; ++v)
+        {
+          fastuidraw::StrokedPath::point P;
+          fastuidraw::StrokedPath::point::unpack_point(&P, attribute_data[v]);
+          FASTUIDRAWassert(P.depth() >= depth.m_begin);
+          FASTUIDRAWassert(P.depth() < depth.m_end);
+        }
+    }
+  #endif
 }

 void


I did it again

I did it again

--- ksp_plugin/planetarium.cpp
+++ ksp_plugin/planetarium.cpp
@@ -189,8 +189,7 @@
                      trajectory.EvaluatePosition(t));

       estimated_tan²_error =
-          perspective_.Tan²AngularDistance(estimated_position,
-                                           position);
+          perspective_.Tan²AngularDistance(estimated_position, position) / 16;
       ++steps_attempted;
     } while (estimated_tan²_error > tan²_angular_resolution);
     ++steps_accepted;


Remove the old Method.cpp file, which was empty.

--- src/Method.cpp
+++ src/Method.cpp
@@ -1,26 +0,0 @@
-#include "Method.hpp"
-
-
-namespace autobind {
-
-//
-// void Method::codegenCall(std::ostream &out) const
-// {
-// 	out << "self->object." << name();
-// 	codegenCallArgs(out);
-// 	out << ";\n";
-// }
-//
-//
-// void Method::codegenMethodTable(std::ostream &out) const
-// {
-// 	auto docstring = processDocString(this->docstring());
-//
-// 	out << boost::format("{\"%1%\", (PyCFunction) %2%, METH_VARARGS, %3%},\n")
-// 		% unqualifiedName()
-// 		% implName()
-// 		% ("\"" + docstring + "\"");
-// }
-//
-} // autobind
-


[Fix build] TileRasterMode value passed to IsReadyToDraw must be initialized.

TBR=vmpstr,jamesr

Review URL: https://codereview.chromium.org/16268021

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@204787 0039d316-1c4b-4281-b951-d872f2087c98

--- cc/resources/tile_manager.cc
+++ cc/resources/tile_manager.cc
@@ -361,7 +361,7 @@
     const Tile* tile = *it;
     const ManagedTileState& mts = tile->managed_state();

-    TileRasterMode mode;
+    TileRasterMode mode = HIGH_QUALITY_RASTER_MODE;
     if (tile->IsReadyToDraw(&mode) &&
         !mts.tile_versions[mode].requires_resource())
       continue;
@@ -622,7 +622,7 @@
 }

 void TileManager::FreeUnusedResourcesForTile(Tile* tile) {
-  TileRasterMode used_mode;
+  TileRasterMode used_mode = HIGH_QUALITY_RASTER_MODE;
   bool version_is_used = tile->IsReadyToDraw(&used_mode);
   for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) {
     if (!version_is_used || mode != used_mode)


fix typo in params path on PC

fix typo in params path on PC

--- selfdrive/common/params.cc
+++ selfdrive/common/params.cc
@@ -33,7 +33,7 @@
 #if defined(QCOM) || defined(QCOM2)
 const std::string default_params_path = "/data/params";
 #else
-const std::string default_params_path = getenv_default("BASEDIR", "persists/params", "/data/params");
+const std::string default_params_path = getenv_default("BASEDIR", "/persist/params", "/data/params");
 #endif

 #if defined(QCOM) || defined(QCOM2)
@@ -45,7 +45,6 @@

 volatile sig_atomic_t params_do_exit = 0;
 void params_sig_handler(int signal) {
-  std::cout << "got signal" << std::endl;
   params_do_exit = 1;
 }


modeld process time logging to DEBUG (#1720)

Co-authored-by: Jason Young <68c46a606457643eab92053c1c05574abb26f861@comma.ai>

--- selfdrive/modeld/modeld.cc
+++ selfdrive/modeld/modeld.cc
@@ -216,7 +216,7 @@
         model_publish(pm, extra.frame_id, model_buf, extra.timestamp_eof);
         posenet_publish(pm, extra.frame_id, model_buf, extra.timestamp_eof);

-        LOG("model process: %.2fms, from last %.2fms", mt2-mt1, mt1-last);
+        LOGD("model process: %.2fms, from last %.2fms", mt2-mt1, mt1-last);
         last = mt1;
       }


ResourceManager: Improve performance

ResourceManager: Improve performance

Avoid creating a lot of string objects while parsing stat file

Change-Id: I459b7e4a594a1066d855c904cef0b2f74aaf57d1

--- server/ResourceManager.cpp
+++ server/ResourceManager.cpp
@@ -34,16 +34,24 @@
 static int maxOpenFiles = 0;
 static int maxThreads = 0;

-static void
-tokenize (std::string str, char sep, std::vector<std::string> &tokens)
+static int
+get_int (std::string &str, char sep, int nToken)
 {
   size_t start = str.find_first_not_of (sep), end;
+  int count = 0;

   while (start != std::string::npos) {
     end = str.find (sep, start);
-    tokens.push_back (str.substr (start, end - start) );
+
+    if (count++ == nToken) {
+      str[end] = '\0';
+      return atoi (&str.c_str() [start]);
+    }
+
     start = str.find_first_not_of (sep, end);
   }
+
+  return 0;
 }

 static int
@@ -51,14 +59,11 @@
 {
   std::string stat;
   std::ifstream stat_file ("/proc/self/stat");
-  std::vector <std::string> tokens;

   std::getline (stat_file, stat);
-  tokenize (stat, ' ', tokens);
-
   stat_file.close();

-  return atoi (tokens[19].c_str() );
+  return get_int (stat, ' ', 19);
 }

 static int


Improved forward and backward history in filebrowser. (#928)

--- src/filebrowser/file-browser-dialog.cpp
+++ src/filebrowser/file-browser-dialog.cpp
@@ -838,14 +838,20 @@

 void FileBrowserDialog::goForward()
 {
-    QString path = forward_history_.pop();
+    QString path;
+    if (!forward_history_.empty()) {
+        path = forward_history_.pop();
+    }
     backward_history_.push(current_path_);
     enterPath(path);
 }

 void FileBrowserDialog::goBackward()
 {
-    QString path = backward_history_.pop();
+    QString path;
+    if (!backward_history_.empty()) {
+        path = backward_history_.pop();
+    }
     forward_history_.push(current_path_);
     enterPath(path);
 }
@@ -856,6 +862,7 @@
         return;
     }
     backward_history_.push(current_path_);
+    forward_history_.clear();
     enterPath("/");
 }

@@ -907,6 +914,8 @@
     for(int i = 1; i <= id; i++)
       path += current_lpath_[i] + "/";

+    backward_history_.push(current_path_);
+    forward_history_.clear();
     enterPath(path);
 }


layers: GH1244, Fix Compressed BufferImageCopy errs

CmdCopyBufferToImage and CmdCopyImageToBuffer were validating
compressed image attributes against the valid usage conditions
for uncompressed images. Added check for compressed images and
skipped this validation, and TODO for future compressed VU addition.

Change-Id: I09a7dc98cb0f925c7486ef9f2d6de31411c7ea1c

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -8472,14 +8472,29 @@
                                                                           const IMAGE_STATE *img, const VkBufferImageCopy *region,
                                                                           const uint32_t i, const char *function) {
     bool skip = false;
-    VkExtent3D granularity = GetScaledItg(dev_data, cb_node, img);
-    skip |= CheckItgSize(dev_data, cb_node, region->bufferOffset, granularity.width, i, function, "bufferOffset");
-    skip |= CheckItgInt(dev_data, cb_node, region->bufferRowLength, granularity.width, i, function, "bufferRowLength");
-    skip |= CheckItgInt(dev_data, cb_node, region->bufferImageHeight, granularity.width, i, function, "bufferImageHeight");
-    skip |= CheckItgOffset(dev_data, cb_node, &region->imageOffset, &granularity, i, function, "imageOffset");
-    VkExtent3D subresource_extent = GetImageSubresourceExtent(img, &region->imageSubresource);
-    skip |= CheckItgExtent(dev_data, cb_node, &region->imageExtent, &region->imageOffset, &granularity, &subresource_extent, i,
-                           function, "imageExtent");
+    if (vk_format_is_compressed(img->createInfo.format) == true) {
+        // TODO: Add granularity checking for compressed formats
+
+        // bufferRowLength must be a multiple of the compressed texel block width
+        // bufferImageHeight must be a multiple of the compressed texel block height
+        // all members of imageOffset must be a multiple of the corresponding dimensions of the compressed texel block
+        // bufferOffset must be a multiple of the compressed texel block size in bytes
+        // imageExtent.width must be a multiple of the compressed texel block width or (imageExtent.width + imageOffset.x)
+        //     must equal the image subresource width
+        // imageExtent.height must be a multiple of the compressed texel block height or (imageExtent.height + imageOffset.y)
+        //     must equal the image subresource height
+        // imageExtent.depth must be a multiple of the compressed texel block depth or (imageExtent.depth + imageOffset.z)
+        //     must equal the image subresource depth
+    } else {
+        VkExtent3D granularity = GetScaledItg(dev_data, cb_node, img);
+        skip |= CheckItgSize(dev_data, cb_node, region->bufferOffset, granularity.width, i, function, "bufferOffset");
+        skip |= CheckItgInt(dev_data, cb_node, region->bufferRowLength, granularity.width, i, function, "bufferRowLength");
+        skip |= CheckItgInt(dev_data, cb_node, region->bufferImageHeight, granularity.width, i, function, "bufferImageHeight");
+        skip |= CheckItgOffset(dev_data, cb_node, &region->imageOffset, &granularity, i, function, "imageOffset");
+        VkExtent3D subresource_extent = GetImageSubresourceExtent(img, &region->imageSubresource);
+        skip |= CheckItgExtent(dev_data, cb_node, &region->imageExtent, &region->imageOffset, &granularity, &subresource_extent, i,
+                               function, "imageExtent");
+    }
     return skip;
 }


Minor code simplification in Module.cpp

Minor code simplification in Module.cpp

Former-commit-id: 216965f1b8b4827c44f21394f4330fe7837d6fa8

--- src/Module.cpp
+++ src/Module.cpp
@@ -186,31 +186,28 @@
         llvm::LLVMContext context;
         std::unique_ptr<llvm::Module> llvm_module(compile_module_to_llvm_module(*this, context));

-        if (!output_files.object_name.empty() || !output_files.static_library_name.empty()) {
-            // We must always generate the object files here, either because they are
-            // needed directly, or as temporary inputs to create a static library.
-            // If they are just temporary inputs, we delete them when we're done,
-            // to minimize the cruft left laying around in build products directory.
-            std::unique_ptr<TemporaryObjectFileDir> temp_dir;
-
-            std::string object_name = output_files.object_name;
-            if (object_name.empty()) {
-                temp_dir = std::unique_ptr<TemporaryObjectFileDir>(new TemporaryObjectFileDir());
-                object_name = temp_dir->add_temp_object_file(output_files.static_library_name, "", target());
+        if (!output_files.object_name.empty()) {
+            debug(1) << "Module.compile(): object_name " << output_files.object_name << "\n";
+            auto out = make_raw_fd_ostream(output_files.object_name);
+            compile_llvm_module_to_object(*llvm_module, *out);
+        }
+        if (!output_files.static_library_name.empty()) {
+            // To simplify the code, we always create a temporary object output
+            // here, even if output_files.object_name was also set: in practice,
+            // no real-world code ever sets both object_name and static_library_name
+            // at the same time, so there is no meaningful performance advantage
+            // to be had.
+            TemporaryObjectFileDir temp_dir;
+            {
+                std::string object_name = temp_dir.add_temp_object_file(output_files.static_library_name, "", target());
+                debug(1) << "Module.compile(): temporary object_name " << object_name << "\n";
+                    auto out = make_raw_fd_ostream(object_name);
+                compile_llvm_module_to_object(*llvm_module, *out);
+                out->flush();  // create_static_library() is happier if we do this
             }
-
-            {
-                debug(1) << "Module.compile(): object_name " << object_name << "\n";
-                auto out = make_raw_fd_ostream(object_name);
-                compile_llvm_module_to_object(*llvm_module, *out);
-                out->flush();
-            }
-
-            if (!output_files.static_library_name.empty()) {
-                debug(1) << "Module.compile(): static_library_name " << output_files.static_library_name << "\n";
-                Target base_target(target().os, target().arch, target().bits);
-                create_static_library({object_name}, base_target, output_files.static_library_name);
-            }
+            debug(1) << "Module.compile(): static_library_name " << output_files.static_library_name << "\n";
+            Target base_target(target().os, target().arch, target().bits);
+            create_static_library(temp_dir.files(), base_target, output_files.static_library_name);
         }
         if (!output_files.assembly_name.empty()) {
             debug(1) << "Module.compile(): assembly_name " << output_files.assembly_name << "\n";
@@ -342,9 +339,8 @@

         Module module = module_producer(sub_fn_name, sub_fn_target);
         Outputs sub_out = add_suffixes(output_files, suffix);
-        if (sub_out.object_name.empty()) {
-            sub_out.object_name = temp_dir.add_temp_object_file(output_files.static_library_name, suffix, target);
-        }
+        internal_assert(sub_out.object_name.empty());
+        sub_out.object_name = temp_dir.add_temp_object_file(output_files.static_library_name, suffix, target);
         module.compile(sub_out);

         static_assert(sizeof(uint64_t)*8 >= Target::FeatureEnd, "Features will not fit in uint64_t");


layers: Impose singlesample/multisample constraints on input attachment descriptors

Signed-off-by: Chris Forbes <c3279c50043e18e9442c1ae071cafa0e7a4ca967@google.com>

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -2687,7 +2687,9 @@
                 return DESCRIPTOR_REQ_VIEW_TYPE_3D;
             case spv::DimCube:
                 return arrayed ? DESCRIPTOR_REQ_VIEW_TYPE_CUBE_ARRAY : DESCRIPTOR_REQ_VIEW_TYPE_CUBE;
-            default:  // subpass, buffer, etc.
+            case spv::DimSubpassData:
+                return msaa ? DESCRIPTOR_REQ_MULTI_SAMPLE : DESCRIPTOR_REQ_SINGLE_SAMPLE;
+            default:  // buffer, etc.
                 return 0;
             }
         }


swr: [rasterizer memory] Add missing store tiles function

Storing color hot tile to 8bit w-major stencil format.

Reviewed-by: Bruce Cherniak <a5345730962d952f474b19e983398300e1cb5f29@intel.com>

--- src/gallium/drivers/swr/rasterizer/memory/StoreTile.cpp
+++ src/gallium/drivers/swr/rasterizer/memory/StoreTile.cpp
@@ -1523,7 +1523,7 @@

     PFN_STORE_TILES pfnStoreTiles = nullptr;

-    if ((renderTargetIndex <= SWR_ATTACHMENT_COLOR7) && (pDstSurface->tileMode != SWR_TILE_MODE_WMAJOR))
+    if (renderTargetIndex <= SWR_ATTACHMENT_COLOR7)
     {
         pfnStoreTiles = sStoreTilesTableColor[pDstSurface->tileMode][pDstSurface->format];
     }
@@ -1713,4 +1713,7 @@

     InitStoreTilesTableDepth<SWR_TILE_MODE_YMAJOR>(sStoreTilesTableDepth);
     InitStoreTilesTableStencil<SWR_TILE_MODE_WMAJOR>(sStoreTilesTableStencil);
+
+    // special color hot tile -> 8-bit WMAJOR
+    sStoreTilesTableColor[SWR_TILE_MODE_WMAJOR][R8_UINT] = StoreMacroTile<TilingTraits<SWR_TILE_MODE_WMAJOR, 8>, R32G32B32A32_FLOAT, R8_UINT>::Store;
 }


Add a legacy wrapper to multitarget libraries

--- src/Module.cpp
+++ src/Module.cpp
@@ -12,6 +12,7 @@
 #include "IROperator.h"
 #include "Outputs.h"
 #include "StmtToHtml.h"
+#include "WrapExternStages.h"

 using Halide::Internal::debug;

@@ -408,6 +409,10 @@

     Module wrapper_module(fn_name, wrapper_target);
     wrapper_module.append(LoweredFunc(fn_name, base_target_args, wrapper_body, LoweredFunc::ExternalPlusMetadata));
+
+    // Add a wrapper to accept old buffer_ts
+    add_legacy_wrapper(wrapper_module, wrapper_module.functions().back());
+
     wrapper_module.compile(Outputs().object(temp_dir.add_temp_object_file(output_files.static_library_name, "_wrapper", base_target, /* in_front*/ true)));

     if (!output_files.c_header_name.empty()) {


Debug commit to catch the issue with startingTask

--- src/Module.cpp
+++ src/Module.cpp
@@ -192,6 +192,15 @@
             throw ExecutionAbortedException(pTask->name() + "::prepareTask",
                     "task cancellation during taskStartingMutex lock wait");

+        if (startingTask != pTask)
+        {
+        	poco_fatal(logger(), pTask->name() + " <<<  << < <<  < << < < < << < < <<< < < < < < < < <  < < < < < < < <  <<< < < < < <  <<");
+        	if (!startingTask.isNull())
+        	    poco_fatal(logger(),startingTask->name() + " names me");
+        	Poco::Thread::sleep(1000);
+        }
+
+
         if (pTask->isSlave())
         {
             Poco::Mutex::ScopedLock lock(taskMngtMutex);
@@ -232,7 +241,18 @@
     catch (...)
     {
         parametersTreated();
-        safeReleaseAllInPorts(triggingPort());
+        try
+        {
+        	safeReleaseAllInPorts(triggingPort());
+        }
+        catch (Poco::Exception& e)
+        {
+        	poco_fatal(logger(),name()
+        			+ ".run: safeReleaseAllInPorts: "
+					+ e.displayText()
+					+ " === = ==  = = = =  == = = == === = = = ===");
+        	throw;
+        }
         releaseProcessingMutex();
         throw;
     }
@@ -252,10 +272,20 @@
 	}
 	catch (...)
 	{
-		releaseAllInPorts();
-		releaseAllOutPorts();
-        releaseProcessingMutex();
-        releaseOutputMutex();
+		try
+		{
+			releaseAllInPorts();
+			releaseAllOutPorts();
+			releaseProcessingMutex();
+			releaseOutputMutex();
+		}
+		catch (std::exception& e)
+		{
+			poco_fatal(logger(), name()
+				+ ".run error: " + std::string(e.what())
+				+ " == = = = = =  = = = = == ==  = = = = == =  == = =");
+			throw;
+		}
 		throw;
 	}

@@ -1003,13 +1033,24 @@
 	resetTargets();
 	try
 	{
-	    startingTask = NULL;
+//		startingTask = NULL;
+	    if (startingTask)
+	    {
+		    poco_error(logger(), name()
+            + ": a task is starting... "
+            "It should not happen since cancel is done. "
+			"== = = == = == == = == = = = = == == = = = == = ");
+			poco_bugcheck_msg((name()
+			+ ": a task is starting... "
+			"It should not happen since cancel is done. ").c_str());
+	    }
 //	    processing = false;
 		if (processing)
 		{
 		    poco_error(logger(), name()
             + ": a task is processing... "
-            "It should not happen since cancel is done. ");
+            "It should not happen since cancel is done. "
+			"== = = == = == == = == = = = = == == = = = == = ");
 			poco_bugcheck_msg((name()
 			+ ": a task is processing... "
 			"It should not happen since cancel is done. ").c_str());


layers: Fix var names in CmdClear[C|DS]image

Change-Id: I3206d734401cb162b219ed9d0a169786a3b5c4c4

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -8872,7 +8872,7 @@
 VKAPI_ATTR void VKAPI_CALL CmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout,
                                               const VkClearColorValue *pColor, uint32_t rangeCount,
                                               const VkImageSubresourceRange *pRanges) {
-    bool skip_call = false;
+    bool skip = false;
     layer_data *dev_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map);
     std::unique_lock<std::mutex> lock(global_lock);
     // TODO : Verify memory is in VK_IMAGE_STATE_CLEAR state
@@ -8880,7 +8880,7 @@
     auto cb_node = getCBNode(dev_data, commandBuffer);
     auto image_state = getImageState(dev_data, image);
     if (cb_node && image_state) {
-        skip_call |= ValidateMemoryIsBoundToImage(dev_data, image_state, "vkCmdClearColorImage()", VALIDATION_ERROR_02527);
+        skip |= ValidateMemoryIsBoundToImage(dev_data, image_state, "vkCmdClearColorImage()", VALIDATION_ERROR_02527);
         AddCommandBufferBindingImage(dev_data, cb_node, image_state);
         std::function<bool()> function = [=]() {
             SetImageMemoryValid(dev_data, image_state, true);
@@ -8888,25 +8888,25 @@
         };
         cb_node->validate_functions.push_back(function);

-        skip_call |= ValidateCmd(dev_data, cb_node, CMD_CLEARCOLORIMAGE, "vkCmdClearColorImage()");
+        skip |= ValidateCmd(dev_data, cb_node, CMD_CLEARCOLORIMAGE, "vkCmdClearColorImage()");
         UpdateCmdBufferLastCmd(dev_data, cb_node, CMD_CLEARCOLORIMAGE);
-        skip_call |= insideRenderPass(dev_data, cb_node, "vkCmdClearColorImage()", VALIDATION_ERROR_01096);
+        skip |= insideRenderPass(dev_data, cb_node, "vkCmdClearColorImage()", VALIDATION_ERROR_01096);
     } else {
         assert(0);
     }
     for (uint32_t i = 0; i < rangeCount; ++i) {
-        skip_call |= ValidateImageAttributes(dev_data, image_state, pRanges[i]);
-        skip_call |= VerifyClearImageLayout(dev_data, cb_node, image, pRanges[i], imageLayout, "vkCmdClearColorImage()");
+        skip |= ValidateImageAttributes(dev_data, image_state, pRanges[i]);
+        skip |= VerifyClearImageLayout(dev_data, cb_node, image, pRanges[i], imageLayout, "vkCmdClearColorImage()");
         RecordClearImageLayout(dev_data, cb_node, image, pRanges[i], imageLayout);
     }
     lock.unlock();
-    if (!skip_call) dev_data->dispatch_table.CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
+    if (!skip) dev_data->dispatch_table.CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
 }

 VKAPI_ATTR void VKAPI_CALL CmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout,
                                                      const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount,
                                                      const VkImageSubresourceRange *pRanges) {
-    bool skip_call = false;
+    bool skip = false;
     layer_data *dev_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map);
     std::unique_lock<std::mutex> lock(global_lock);
     // TODO : Verify memory is in VK_IMAGE_STATE_CLEAR state
@@ -8914,7 +8914,7 @@
     auto cb_node = getCBNode(dev_data, commandBuffer);
     auto image_state = getImageState(dev_data, image);
     if (cb_node && image_state) {
-        skip_call |= ValidateMemoryIsBoundToImage(dev_data, image_state, "vkCmdClearDepthStencilImage()", VALIDATION_ERROR_02528);
+        skip |= ValidateMemoryIsBoundToImage(dev_data, image_state, "vkCmdClearDepthStencilImage()", VALIDATION_ERROR_02528);
         AddCommandBufferBindingImage(dev_data, cb_node, image_state);
         std::function<bool()> function = [=]() {
             SetImageMemoryValid(dev_data, image_state, true);
@@ -8922,19 +8922,19 @@
         };
         cb_node->validate_functions.push_back(function);

-        skip_call |= ValidateCmd(dev_data, cb_node, CMD_CLEARDEPTHSTENCILIMAGE, "vkCmdClearDepthStencilImage()");
+        skip |= ValidateCmd(dev_data, cb_node, CMD_CLEARDEPTHSTENCILIMAGE, "vkCmdClearDepthStencilImage()");
         UpdateCmdBufferLastCmd(dev_data, cb_node, CMD_CLEARDEPTHSTENCILIMAGE);
-        skip_call |= insideRenderPass(dev_data, cb_node, "vkCmdClearDepthStencilImage()", VALIDATION_ERROR_01111);
+        skip |= insideRenderPass(dev_data, cb_node, "vkCmdClearDepthStencilImage()", VALIDATION_ERROR_01111);
     } else {
         assert(0);
     }

     for (uint32_t i = 0; i < rangeCount; ++i) {
-        skip_call |= VerifyClearImageLayout(dev_data, cb_node, image, pRanges[i], imageLayout, "vkCmdClearDepthStencilImage()");
+        skip |= VerifyClearImageLayout(dev_data, cb_node, image, pRanges[i], imageLayout, "vkCmdClearDepthStencilImage()");
         RecordClearImageLayout(dev_data, cb_node, image, pRanges[i], imageLayout);
     }
     lock.unlock();
-    if (!skip_call)
+    if (!skip)
         dev_data->dispatch_table.CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
 }


Fix a couple of locations that should have been passing show_window = true in NavigateParams.

BUG=none
TEST=

Bug 1: open an incognito window. switch back to the non-incognito window then right click a link and choose "open in incognito window." link should be opened in new tab in existing incognito window and that window activated. bug is that this happens but window is not activated.
Bug 2: open an app frame (e.g. chrome --app=http://mail.google.com/). click on a link that would open a new tab (which can't be opened in an app frame). If an existing chrome window would be the target that window is never activated.
Review URL: http://codereview.chromium.org/5219005

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@66818 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

--- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc
@@ -2731,6 +2731,7 @@
   params.referrer = referrer;
   params.disposition = disposition;
   params.tabstrip_add_types = TabStripModel::ADD_NONE;
+  params.show_window = true;
   browser::Navigate(&params);
 }

@@ -2781,6 +2782,7 @@
           tabstrip_model()->GetWrapperIndex(source));
   params.disposition = disposition;
   params.window_bounds = initial_pos;
+  params.show_window = true;
   browser::Navigate(&params);
 }


fix preview of CW arcs

fix preview of CW arcs

--- src/NCCode.cpp
+++ src/NCCode.cpp
@@ -284,6 +284,11 @@
 		angle_step = (end_angle - start_angle) / number_of_points;
 	} // End if - else

+	if (m_dir == -1)
+	{
+		// fix preview problem for cw arcs
+		angle_step = -angle_step;
+	} // End if - else
 	points.push_back( gp_Pnt( prev_po->m_x[0], prev_po->m_x[1], prev_po->m_x[2] ) );

 	for(unsigned int i = 0; i< number_of_points; i++)


(unstable) [added] patch by Galameed: fixed bazaar fee reductions, Mantis 2670

git-svn-id: e4cf3396f21da4a5d638eecf7e3b4dd52b27f938@6187 c3d1530f-68f5-4bd0-87dc-8ef779617e40

--- MMOCoreORB/src/server/zone/managers/auction/AuctionManagerImplementation.cpp
+++ MMOCoreORB/src/server/zone/managers/auction/AuctionManagerImplementation.cpp
@@ -279,9 +279,9 @@
 		StringIdChatParameter str("@base_player:sale_fee");

 		float costReduction = 1;
-		if(player->hasSkill("crafting_merchant_sales_1"))
+		if(player->hasSkill("crafting_merchant_sales_01"))
 				costReduction = .80f;
-		if(player->hasSkill("crafting_merchant_sales_3"))
+		if(player->hasSkill("crafting_merchant_sales_03"))
 				costReduction = .60f;

 		if (item->isPremiumAuction()) {


Fix comment

Fix comment

--- main/src/Topology/split.cc
+++ main/src/Topology/split.cc
@@ -316,7 +316,7 @@
       if (loop->get(Direction::Down, oth) == _ed_end.get())
         loop->insert_child(_ins_vert.get(), pos);
     }
-    // CHeck that theloop is aface boundary
+    // CHeck that the loop is aface boundary
     Iterator<Type::LOOP, Type::FACE> faces(loop);
     if (faces.size() != 1)
       continue;


Changed DAG signatures from 6.1.0 and 6.1.1 to 1.0 and 1.1, thus decoupling the DAG file format version for whatever the current version of Condor happens to be.

--- src/condor_dagman/parse.C
+++ src/condor_dagman/parse.C
@@ -13,14 +13,14 @@
 static const unsigned int numSigs = 2;

 static const char * SigString[numSigs] = {
-    "### DAGMan 6.1.0",
-    "### DAGMan 6.1.1",
+    "### DAGMan 1.0",
+    "### DAGMan 1.1",
 };

 enum SigIndex {
     SigInvalid   = -1,
-    DAGMAN_610,
-    DAGMAN_611
+    DAGMAN_1_0,
+    DAGMAN_1_1
 };

 //-----------------------------------------------------------------------------
@@ -173,7 +173,7 @@
         //
         // Example Syntax is:  SCRIPT (PRE|POST) JobName ScriptName Args ...
         //
-        else if (sigIndex == DAGMAN_611 &&
+        else if (sigIndex == DAGMAN_1_1 &&
                  strcasecmp(token, "SCRIPT") == 0) {
             const char * example = "SCRIPT (PRE|POST) JobName Script Args ...";
             Job * job = NULL;
@@ -340,7 +340,7 @@
             debug_println (DEBUG_QUIET,
                            "%s(%d): Expected JOB %sor PARENT token",
                            filename, lineNumber,
-                           sigIndex == DAGMAN_611 ? ", SCRIPT, " : "");
+                           sigIndex == DAGMAN_1_1 ? ", SCRIPT, " : "");
             fclose(fp);
             return false;
         }


swr: remove warning about multi-layer surfaces

We now support clearing these, and actually rendering to multiple layers
would require GS support, which will fail in much more spectacular ways
for now. Once that is hooked up, there won't be anything else to do
here.

Signed-off-by: Ilia Mirkin <bcbbb7aa705ec3a5fc5824c01a845186c3d62fca@alum.mit.edu>
Reviewed-by: Tim Rowley <54947742fe7299a578dbb84f6c782c6c4c668d8f@intel.com>

--- src/gallium/drivers/swr/swr_context.cpp
+++ src/gallium/drivers/swr/swr_context.cpp
@@ -62,10 +62,6 @@
          ps->u.tex.level = surf_tmpl->u.tex.level;
          ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
          ps->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
-         if (ps->u.tex.first_layer != ps->u.tex.last_layer) {
-            debug_printf("creating surface with multiple layers, rendering "
-                         "to first layer only\n");
-         }
       } else {
          /* setting width as number of elements should get us correct
           * renderbuffer width */


layers: Remove validate_buffer_usage_flags() function

Replaced with validateBufferUsageFlags()

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -418,20 +418,6 @@
     return validate_usage_flags(dev_data, image_node->createInfo.usage, desired, strict,
                                 reinterpret_cast<const uint64_t &>(image_node->image), VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
                                 "image", func_name, usage_string);
-}
-
-// Helper function to validate usage flags for buffers
-// Pulls buffer info and then sends actual vs. desired usage off to helper above where
-//  an error will be flagged if usage is not correct
-static bool validate_buffer_usage_flags(layer_data *dev_data, VkBuffer buffer, VkFlags desired, VkBool32 strict,
-                                            char const *func_name, char const *usage_string) {
-    bool skip_call = false;
-    auto buffer_node = getBufferNode(dev_data, buffer);
-    if (buffer_node) {
-        skip_call = validate_usage_flags(dev_data, buffer_node->createInfo.usage, desired, strict, (uint64_t)buffer,
-                                         VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, "buffer", func_name, usage_string);
-    }
-    return skip_call;
 }

 // Helper function to validate usage flags for buffers
@@ -5663,11 +5649,11 @@
                                  reinterpret_cast<const uint64_t &>(pCreateInfo->buffer));
         }
     }
-    // In order to create a valid buffer view, the buffer must have been created with at least one of the
-    // following flags:  UNIFORM_TEXEL_BUFFER_BIT or STORAGE_TEXEL_BUFFER_BIT
-    skip_call = validate_buffer_usage_flags(dev_data, pCreateInfo->buffer,
-                                            VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT,
-                                            false, "vkCreateBufferView()", "VK_BUFFER_USAGE_[STORAGE|UNIFORM]_TEXEL_BUFFER_BIT");
+        // In order to create a valid buffer view, the buffer must have been created with at least one of the
+        // following flags:  UNIFORM_TEXEL_BUFFER_BIT or STORAGE_TEXEL_BUFFER_BIT
+        validateBufferUsageFlags(dev_data, buf_node,
+                                 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, false,
+                                 "vkCreateBufferView()", "VK_BUFFER_USAGE_[STORAGE|UNIFORM]_TEXEL_BUFFER_BIT");
     return skip_call;
 }


Add IOGroup and Alias to PIO description map

Signed-off-by: Brad Geltz <e42f3ad4099980ea02f08e076efbee5cf9d4a803@intel.com>

--- service/src/PlatformIO.cpp
+++ service/src/PlatformIO.cpp
@@ -58,76 +58,130 @@
     const std::map<const std::string, const std::string>
     PlatformIOImp::m_signal_descriptions = {
         {"BOARD_ENERGY",
-         "Total energy measured on the server's board. "},
+         "    description: Total energy measured on the server's board.\n"
+         "    iogroup: CNL\n"
+         "    alias_for: CNL::BOARD_ENERGY"},
         {"BOARD_POWER",
-         "Power measured on the server's board. "},
+         "    description: Power measured on the server's board.\n"
+         "    iogroup: CNL\n"
+         "    alias_for: CNL::BOARD_POWER"},
         {"CPU_CYCLES_REFERENCE",
-         "The count of the number of cycles while the logical processor is not in a "
+         "    description: The count of the number of cycles while the logical processor is not in a "
          "halt state and not in a stop-clock state. The count rate is fixed at the "
-         "TIMESTAMP_COUNT rate."},
+         "TIMESTAMP_COUNT rate.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::FIXED_CTR2:CPU_CLK_UNHALTED_REF_TSC"},
         {"CPU_CYCLES_THREAD",
-         "The count of the number of cycles while the logical processor is not in a "
-         "halt state.  The count rate may change based on core frequency."},
+         "    description: The count of the number of cycles while the logical processor is not in a "
+         "halt state.  The count rate may change based on core frequency.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::FIXED_CTR1:CPU_CLK_UNHALTED_THREAD"},
         {"CPU_ENERGY",
-         "An increasing meter of energy consumed by the package over time. It will "
-         "reset periodically due to roll-over."},
+         "    description: An increasing meter of energy consumed by the package over time. It will "
+         "reset periodically due to roll-over.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::PKG_ENERGY_STATUS:ENERGY"},
         {"CPU_FREQUENCY_MAX",
-         "Maximum processor frequency."},
+         "    description: Maximum processor frequency.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::TURBO_RATIO_LIMIT:MAX_RATIO_LIMIT_0 or if HWP is enabled MSR::HWP_CAPABILITIES:HIGHEST_PERFORMANCE"},
         {"CPU_FREQUENCY_STATUS",
-         "The current operating frequency of the CPU."},
+         "    description: The current operating frequency of the CPU.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::PERF_STATUS:FREQ"},
         {"CPU_INSTRUCTIONS_RETIRED",
-         "The count of the number of instructions executed."},
+         "    description: The count of the number of instructions executed.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::FIXED_CTR0:INST_RETIRED_ANY"},
         {"CPU_POWER_LIMIT_CONTROL",
-         "The average power usage limit over the time window specified in "
-         "PL1_TIME_WINDOW."},
+         "    description: The average power usage limit over the time window specified in "
+         "PL1_TIME_WINDOW.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::PKG_POWER_LIMIT:PL1_POWER_LIMIT"},
         {"CPU_POWER_TIME_WINDOW",
-         "The time window associated with power limit 1."},
+         "    description: The time window associated with power limit 1.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::PKG_POWER_LIMIT:PL1_TIME_WINDOW"},
         {"CPU_POWER_MAX_AVAIL",
-         "The maximum power limit based on the electrical specification."},
+         "    description: The maximum power limit based on the electrical specification.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::PKG_POWER_INFO:MAX_POWER"},
         {"CPU_POWER_MIN_AVAIL",
-         "The minimum power limit based on the electrical specification."},
+         "    description: The minimum power limit based on the electrical specification.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::PKG_POWER_INFO:MIN_POWER"},
         {"CPU_POWER_LIMIT_DEFAULT",
-         "Maximum power to stay within the thermal limits based on the design (TDP)."},
+         "    description: Maximum power to stay within the thermal limits based on the design (TDP).\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::PKG_POWER_INFO:THERMAL_SPEC_POWER"},
         {"CPU_POWER",
-         "Total power aggregated over the processor package."},
+         "    description: Total power aggregated over the processor package.  Derived from CPU_ENERGY.\n"
+         "    iogroup: MSR"}, // This is not an alias.  This is a defined signal in the MSRIOGroup.
         {"CPU_TIMESTAMP_COUNTER",
-         "An always running, monotonically increasing counter that is "
+         "    description: An always running, monotonically increasing counter that is "
          "incremented at a constant rate.  For use as a wall clock "
-         "timer."},
+         "timer.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::TIME_STAMP_COUNTER:TIMESTAMP_COUNT"},
         {"CPU_UNCORE_FREQUENCY_STATUS",
-         "Target operating frequency of the uncore."},
+         "    description: Target operating frequency of the uncore.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::UNCORE_PERF_STATUS:FREQ"},
         {"DRAM_ENERGY",
-         "An increasing meter of energy consumed by the DRAM over time. It will reset "
-         "periodically due to roll-over."},
+         "    description: An increasing meter of energy consumed by the DRAM over time. It will reset "
+         "periodically due to roll-over.\n"
+         "    iogroup: MSR\n"
+         "    alias_for: MSR::DRAM_ENERGY_STATUS:ENERGY"},
         {"DRAM_POWER",
-         "Total power aggregated over the DRAM DIMMs associated with a NUMA node."},
+         "    description: Total power aggregated over the DRAM DIMMs associated with a NUMA node. "
+         "Derived from DRAM_ENERGY.\n"
+         "    iogroup: MSR"},
         {"EPOCH_COUNT",
-         "Number of completed executions of an epoch.  Prior to the first call "
+         "    description: Number of completed executions of an epoch.  Prior to the first call "
          "by the application to geopm_prof_epoch() the signal returns as -1. "
-         "With each call to geopm_prof_epoch() the count increases by one."},
+         "With each call to geopm_prof_epoch() the count increases by one.\n"
+         "    iogroup: Epoch"},
         {"GPU_CORE_ACTIVITY",
-         "GPU compute core activity expressed as a ratio of cycles."},
+         "    description: GPU compute core activity expressed as a ratio of cycles.\n"
+         "    iogroup: DCGM\n"
+         "    alias_for: DCGM::SM_ACTIVE"},
         {"GPU_CORE_FREQENCY_MAX_AVAIL",
-         "Maximum supported GPU core frequency over the specified domain."},
-        {"GPU_CORE_FREQENCY_MIN_AVAIL",
-         "Minimum supported GPU core frequency over the specified domain."},
+         "    description: Maximum supported GPU core frequency over the specified domain.\n"
+         "    iogroup: LevelZero, NVML\n"
+         "    alias_for: LEVELZERO::GPU_CORE_FREQUENCY_MAX_AVAIL, NVML::GPU_CORE_FREQUENCY_MAX_AVAIL"},
+        {"GPU_CORE_FREQUENCY_MIN_AVAIL",
+         "    description: Minimum supported GPU core frequency over the specified domain.\n"
+         "    iogroup: LevelZero, NVML\n"
+         "    alias_for: LEVELZERO::GPU_CORE_FREQUENCY_MIN_AVAIL, NVML::GPU_CORE_FREQUENCY_MIN_AVAIL"},
         {"GPU_CORE_FREQUENCY_STATUS",
-         "Average achieved GPU core frequency over the specified domain."},
+         "    description: Average achieved GPU core frequency over the specified domain.\n"
+         "    iogroup: LevelZero, NVML\n"
+         "    alias_for: LEVELZERO::GPU_CORE_FREQUENCY_STATUS, NVML::GPU_CORE_FREQUENCY_STATUS"},
         {"GPU_ENERGY",
-         "Total energy aggregated over the GPU package."},
+         "    description: Total energy aggregated over the GPU package.\n"
+         "    iogroup: LevelZero, NVML\n"
+         "    alias_for: LEVELZERO::GPU_ENERGY, NVML::GPU_ENERGY_CONSUMPTION_TOTAL"},
         {"GPU_POWER",
-         "Total power aggregated over the GPU package."},
+         "    description: Total power aggregated over the GPU package. Derived from GPU_ENERGY.\n"
+         "    iogroup: LevelZero, NVML"},
         {"GPU_TEMPERATURE",
-         "Average GPU temperature in degrees Celsius."},
+         "    description: Average GPU temperature in degrees Celsius.\n"
+         "    iogroup: NVML\n"
+         "    alias_for: NVML::GPU_TEMPERATURE"},
         {"GPU_UNCORE_ACTIVITY",
-         "GPU memory access activity expressed as a ratio of cycles."},
+         "    description: GPU memory access activity expressed as a ratio of cycles.\n"
+         "    iogroup: DCGM\n"
+         "    alias_for: DCGM::DRAM_ACTIVE"},
         {"GPU_UTILIZATION",
-         "Average GPU utilization expressed as a ratio of cycles."},
+         "    description: Average GPU utilization expressed as a ratio of cycles.\n"
+         "    iogroup: LevelZero, NVML\n"
+         "    alias_for: LEVELZERO::GPU_UTILIZATION, NVML::GPU_UTILIZATION"},
         {"REGION_HASH",
-         "The hash of the region of code currently being "
-         "run by all ranks, otherwise GEOPM_REGION_HASH_UNMARKED."},
+         "    description: The hash of the region of code currently being "
+         "run by all ranks, otherwise GEOPM_REGION_HASH_UNMARKED.\n"
+         "    iogroup: Profile"},
         {"REGION_HINT",
-         "The region hint associated with the currently "
+         "    description: The region hint associated with the currently "
          "running region.  For any interval when all ranks are within an MPI "
          "function inside of a user defined region, the hint will change from the "
          "hint associated with the user defined region to GEOPM_REGION_HINT_NETWORK. "
@@ -135,13 +189,17 @@
          "there is an interval within the region when all ranks are within an MPI "
          "function, GEOPM will not attribute the time spent within the MPI function as "
          "MPI time in the report files.  It will be instead attributed to the time "
-         "spent in the region as a whole."},
+         "spent in the region as a whole.\n"
+         "    iogroup: Profile"},
         {"REGION_PROGRESS",
-         "Minimum per-rank reported progress through the current region."},
+         "    description: Minimum per-rank reported progress through the current region.\n"
+         "    iogroup: Profile"},
         {"REGION_RUNTIME",
-         "Maximum per-rank of the last recorded runtime for the current region."},
+         "    description: Maximum per-rank of the last recorded runtime for the current region.\n"
+         "    iogroup: Profile"},
         {"TIME",
-         "Time elapsed since the beginning of execution."}
+         "    description: Time elapsed since the beginning of execution.\n"
+         "    iogroup: Time"}
     };

     const std::map<const std::string, const std::string>


Fix Download In Progress prompt on browser close (regression)

Before reviewing, please read this brief history of the is_attempting_to_close_browser_ branch.

https://chromiumcodereview.appspot.com/10749002
12 months ago by Ben Goodger
Before this CL, is_attempting_to_close_browser_ was set to true in ShouldCloseWindow() *after* CanCloseWithInProgressDownloads() was called, so that the `if (is_attempting_to_close_browser_)return...` branch in OkToCloseWithInProgressDownloads() would only be taken while the Download In Progress dialog is displaying.
After this CL, UnloadController::is_attempting_to_close_browser_ is set to true in TabStripEmpty(), which is called *before* ShouldCloseWindow(), so that the is_attempting_to_close_browser_ branch in OkToCloseWithInProgressDownloads() would *always* (or perhaps just more often?) be taken.

https://codereview.chromium.org/7466033
23 months ago by Randy
This CL moved the `if (is_attempting_to_close_browser_) return...` branch from CanCloseWithInProgressDownloads() to its current location in OkToCloseWithInProgressDownloads(). This branch was not documented either before or after this CL.

https://codereview.chromium.org/1654011
39 months ago by georgey
This CL adds the is_attempting_to_close_browser_ branch to CanCloseWithInProgressDownloads(). In this revision, that flag is only true between ShouldCloseWindow() (after CanCloseWithInProgressDownloads() has a chance to prevent the window from closing) and CancelWindowClose(), so it seems that the intended purpose of the branch is to make CanCloseWithInProgressDownloads() return true while the Download In Progress dialog is displaying.

Why should CanCloseWithInProgressDownloads() return true while the Download In Progress dialog is displaying? How could it be called, if there's a modal dialog preventing the user from interacting with the browser? Even if it can be called from javascript or somewhere else, wouldn't it be acceptable to close the browser if all downloads are complete without waiting for the user to deal with the dialog?

I'm happy to find another way to make OkToCloseWithInProgressDownloads() return OK while the Download In Progress dialog is displaying if there's a reason for it. This might be a liberal interpretation of the 'when in doubt, rip it out' philosophy, but I don't think it is.

PS1@r211430

BUG=153294
R=asanka@chromium.org, ben@chromium.org, rdsmith@chromium.org

Review URL: https://codereview.chromium.org/19209002

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@212403 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc
@@ -679,9 +679,6 @@
   DCHECK(num_downloads_blocking);
   *num_downloads_blocking = 0;

-  if (IsAttemptingToCloseBrowser())
-    return DOWNLOAD_CLOSE_OK;
-
   // If we're not running a full browser process with a profile manager
   // (testing), it's ok to close the browser.
   if (!g_browser_process->profile_manager())
@@ -720,7 +717,8 @@
   // those downloads would be cancelled by our window (-> profile) close.
   DownloadService* download_service =
       DownloadServiceFactory::GetForProfile(profile());
-  if (profile_window_count == 0 && download_service->DownloadCount() > 0 &&
+  if ((profile_window_count == 0) &&
+      (download_service->DownloadCount() > 0) &&
       profile()->IsOffTheRecord()) {
     *num_downloads_blocking = download_service->DownloadCount();
     return DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE;


preview of full CW arcs finally fixed (hopefully)

this was happening only on full CW circles; arcs < full circle displayed ok

--- src/NCCode.cpp
+++ src/NCCode.cpp
@@ -277,6 +277,10 @@
 	{
 		// It's a full circle.
 		angle_step = (2 * PI) / number_of_points;
+		if (m_dir == -1)
+		{
+			angle_step = -angle_step; // fix preview of full cw arcs
+		}
 	} // End if - then
 	else
 	{


Fix CCS program port assignment for western MC

Change-Id: I6a05af295497b15e93a932bab4db8ded51cbbb7d
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/23577
Tested-by: Jenkins Server
Reviewed-by: STEPHEN GLANCY <7301c4b00f53e5772c2576cd0c5f485155c2ece1@us.ibm.com>
Tested-by: Hostboot CI
Reviewed-by: Louis Stermole <a2bef96d502debd02962600aef4d81d949c35039@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <ab93eca12e43608f33daa16a67357cd7b7e867ab@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.C
+++ src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.C
@@ -228,8 +228,8 @@
         // Kick off the CCS engine - per port. No broadcast mode for CCS (per Shelton 9/23/15)
         for (auto p : i_ports)
         {
-            FAPI_DBG("executing CCS array for port %d (%s)", mss::pos(p), mss::c_str(p));
-            FAPI_TRY( select_ports( i_target, mss::pos(p)) );
+            FAPI_DBG("executing CCS array for port %d (%s)", mss::relative_pos<TARGET_TYPE_MCBIST>(p), mss::c_str(p));
+            FAPI_TRY( select_ports( i_target, mss::relative_pos<TARGET_TYPE_MCBIST>(p)) );
             FAPI_TRY( execute_inst_array(i_target, i_program) );
         }
     }


Cleaned up logging in SafeMsg::getPtr

Cleaned up logging in SafeMsg::getPtr

--- src/condor_io/SafeMsg.cpp
+++ src/condor_io/SafeMsg.cpp
@@ -1175,15 +1175,13 @@
 		} else if(!tempDir->dEntry[tempPkt].dGram) { // was the last packet
 			if( D_FULLDEBUG & DebugFlags )
 				dprintf(D_NETWORK,
-				        "\nSafeMsg::getPtr: get to end & '%c'\
-					  not found\n", delim);
+				        "SafeMsg::getPtr: get to end & '%c' not found\n", delim);
 			return -1;
 		}
 	}

 	if( D_FULLDEBUG & DebugFlags )
-		dprintf(D_NETWORK, "SafeMsg::_longMsg::getPtr:\
-		                    found delim = %c & length = %lu\n",
+		dprintf(D_NETWORK, "SafeMsg::_longMsg::getPtr: found delim = %c & length = %lu\n",
 			  delim, (unsigned long)n);
 	if( n > tempBufLen ) {
 		if(tempBuf) {


CLEANUP: remove assertion that fails harmlessly when not in game

--- src/game/client/swarm/asw_in_camera.cpp
+++ src/game/client/swarm/asw_in_camera.cpp
@@ -272,7 +272,6 @@
 	Assert( engine->IsLocalPlayerResolvable() );

 	C_ASW_Player *pPlayer = C_ASW_Player::GetLocalASWPlayer();
-	Assert( pPlayer );
 	if ( !pPlayer )
 	{
 		return;


Cleanups.

Cleanups.

git-svn-id: 9d271b02f21ef92375d53f3a729673c5fe5e0adf@2092 5fc10e88-4e10-11de-b850-9977aa68d080

--- cpl/tabletop_pushing/src/tabletop_pushing_perception_node.cpp
+++ cpl/tabletop_pushing/src/tabletop_pushing_perception_node.cpp
@@ -111,12 +111,12 @@
 // #define DISPLAY_GRAPHCUT 1
 // #define VISUALIZE_GRAPH_WEIGHTS 1
 // #define DISPLAY_ARM_PROBS 1
-// #define DISPLAY_FOREARM_CIRCLES 1
+// #define DISPLAY_ARM_CIRCLES 1

 // #define WRITE_INPUT_TO_DISK 1
 // #define WRITE_CUTS_TO_DISK 1
 // #define WRITE_FLOWS_TO_DISK 1
-// #define WRITE_FOREARMS_TO_DISK 1
+// #define WRITE_ARMS_TO_DISK 1

 // Functional IFDEFS
 // #define REMOVE_SMALL_BLOBS
@@ -569,93 +569,6 @@
     outs.push_back(t_scores);
     return outs;
   }
-
-//   std::vector<cv::Mat> baseLKOptic(cv::Mat& cur_bw, cv::Mat& prev_bw)
-//   {
-//     cv::Mat Ix(cur_bw.size(), CV_32FC1);
-//     cv::Mat Iy(cur_bw.size(), CV_32FC1);
-//     cv::Mat cur_blur(cur_bw.size(), cur_bw.type());
-//     cv::Mat prev_blur(prev_bw.size(), prev_bw.type());
-//     cv::Mat It = cur_bw - prev_bw;
-
-//     // Get image derivatives
-//     cv::filter2D(cur_bw, Ix, CV_32F, dx_kernel_);
-//     cv::filter2D(cur_bw, Iy, CV_32F, dy_kernel_);
-
-// #ifdef DISPLAY_OPT_FLOW_INTERNALS
-//     cv::imshow("cur_bw", cur_bw);
-//     cv::imshow("prev_bw", prev_bw);
-//     cv::imshow("It", It);
-//     cv::imshow("Ix", Ix);
-//     cv::imshow("Iy", Iy);
-// #endif // DISPLAY_OPT_FLOW_INTERNALS
-
-//     cv::Mat Ixx = Ix.mul(Ix);
-//     cv::Mat Iyy = Iy.mul(Iy);
-//     cv::Mat Ixy = Ix.mul(Iy);
-//     cv::Mat Ixt = Ix.mul(It);
-//     cv::Mat Iyt = Iy.mul(It);
-
-//     cv::Mat w11(cur_bw.size(), CV_32FC1);
-//     cv::Mat w22(cur_bw.size(), CV_32FC1);
-//     cv::Mat w12(cur_bw.size(), CV_32FC1);
-//     cv::filter2D(Ixx, w11, optic_g_kernel_);
-//     cv::filter2D(Iyy, w22, optic_g_kernel_);
-//     cv::filter2D(Ixy, w12, optic_g_kernel_);
-
-//     cv::Mat g1(cur_bw.size(), CV_32FC1);
-//     cv::Mat g2(cur_bw.size(), CV_32FC1);
-//     cv::filter2D(Ixt, g1, optic_g_kernel_);
-//     cv::filter2D(Iyt, g2, optic_g_kernel_);
-
-//     int win_radius = win_size_/2;
-//     cv::Mat flow_u(cur_bw.size(), CV_32FC1, cv::Scalar(0.0));
-//     cv::Mat flow_v(cur_bw.size(), CV_32FC1, cv::Scalar(0.0));
-//     cv::Mat t_scores(cur_bw.size(), CV_32FC1, cv::Scalar(0.0));
-//     for (int r = win_radius; r < Ix.rows-win_radius; ++r)
-//     {
-//       for (int c = win_radius; c < Ix.cols-win_radius; ++c)
-//       {
-//         float sIxx = 0.0;
-//         float sIyy = 0.0;
-//         float sIxy = 0.0;
-//         float sIxt = 0.0;
-//         float sIyt = 0.0;
-//         for (int y = r-win_radius; y <= r+win_radius; ++y)
-//         {
-//           for (int x = c-win_radius; x <= c+win_radius; ++x)
-//           {
-//             sIxx += Ix.at<float>(y,x)*Ix.at<float>(y,x);
-//             sIyy += Iy.at<float>(y,x)*Iy.at<float>(y,x);
-//             sIxy += Ix.at<float>(y,x)*Iy.at<float>(y,x);
-//             sIxt += Ix.at<float>(y,x)*It.at<float>(y,x);
-//             sIyt += Iy.at<float>(y,x)*It.at<float>(y,x);
-//           }
-//         }
-
-//         float det = sIxx*sIyy - sIxy*sIxy;
-//         cv::Vec2f uv;
-//         if (det == 0.0)
-//         {
-//           uv[0] = 0.0;
-//           uv[1] = 0.0;
-//         }
-//         else
-//         {
-//           uv[0] = (-sIyy*sIxt + sIxy*sIyt)/det;
-//           uv[1] = (sIxy*sIxt - sIxx*sIyt)/det;
-//         }
-//         flow_u.at<float>(r,c) = uv[0];
-//         flow_v.at<float>(r,c) = uv[1];
-//         t_scores.at<float>(r,c) = (sIxx+sIyy)*(sIxx+sIyy)/(det);
-//       }
-//     }
-//     std::vector<cv::Mat> outs;
-//     outs.push_back(flow_u);
-//     outs.push_back(flow_v);
-//     outs.push_back(t_scores);
-//     return outs;
-//   }

   cv::Mat reduce(cv::Mat& input /*, cv::Mat kernel*/)
   {
@@ -1570,14 +1483,16 @@

     std::vector<cv::Mat> flow_outs = lkflow_(color_frame, prev_color_frame);

-    std::vector<cv::Point> forearms = projectForearmPoseIntoImage(cur_camera_header_);
+    std::vector<cv::Point> arms = projectArmPoseIntoImage(cur_camera_header_);
+
     // TODO: Use this structure after segmenting moving form non-moving to
     // segment arm from not-arm
+    // getColorModels(color_frame_hsv, arms);

     cv::Mat color_frame_f(color_frame_hsv.size(), CV_32FC3);
     color_frame_hsv.convertTo(color_frame_f, CV_32FC3, 1.0/255, 0);
     cv::Mat cut = mgc_(color_frame_f, depth_frame, flow_outs[0], flow_outs[1],
-                       flow_outs[2], cur_workspace_mask_, forearms);
+                       flow_outs[2], cur_workspace_mask_, arms);

     cv::Mat cleaned_cut(cut.size(), CV_8UC1);
@@ -1620,9 +1535,6 @@
     motion_img_msg.encoding = sensor_msgs::image_encodings::TYPE_8UC3;
     motion_img_pub_.publish(motion_img_msg.toImageMsg());

-    // Figure out arm locations
-    // cv::Mat arm_probs = arm_detect_.imageArmProbability(color_frame_hsv);
-
 #ifdef WRITE_INPUT_TO_DISK
     std::stringstream input_out_name;
     input_out_name << base_output_path_ << "input" << tracker_count_ << ".tiff";
@@ -1660,17 +1572,17 @@
     cv::imwrite(cut_out_name.str(), moving_regions_img);
 #endif // WRITE_CUTS_TO_DISK

-#ifdef WRITE_FOREARMS_TO_DISK
+#ifdef WRITE_ARMS_TO_DISK
     std::stringstream arm_out_name;
     arm_out_name << base_output_path_ << "arm" << tracker_count_ << ".tiff";
-    cv::Mat forearm_write_img(color_frame.size(), CV_8UC3);
-    forearm_write_img = color_frame.clone();
-    for (unsigned int i = 0; i < forearms.size(); ++i)
-    {
-      cv::circle(forearm_write_img, forearms[i], 2, cv::Scalar(0,255,0));
-    }
-    cv::imwrite(arm_out_name.str(), forearm_write_img);
-#endif // WRITE_FOREARMS_TO_DISK
+    cv::Mat arm_write_img(color_frame.size(), CV_8UC3);
+    arm_write_img = color_frame.clone();
+    for (unsigned int i = 0; i < arms.size(); ++i)
+    {
+      cv::circle(arm_write_img, arms[i], 2, cv::Scalar(0,255,0));
+    }
+    cv::imwrite(arm_out_name.str(), arm_write_img);
+#endif // WRITE_ARMS_TO_DISK

 #ifdef DISPLAY_INPUT_COLOR
     std::vector<cv::Mat> hsv;
@@ -1680,14 +1592,14 @@
     // cv::imshow("intensity", hsv[2]);
     cv::imshow("input_color", color_frame);
 #endif // DISPLAY_INPUT_COLOR
-#ifdef DISPLAY_FOREARM_CIRCLES
-    cv::Mat forearms_img(color_frame.size(), CV_8UC3);
-    forearms_img = color_frame.clone();
-    for (unsigned int i = 0; i < forearms.size(); ++i)
-    {
-      cv::circle(forearms_img, forearms[i], 2, cv::Scalar(0,255,0));
-    }
-    cv::imshow("forearms", forearms_img);
+#ifdef DISPLAY_ARM_CIRCLES
+    cv::Mat arms_img(color_frame.size(), CV_8UC3);
+    arms_img = color_frame.clone();
+    for (unsigned int i = 0; i < arms.size(); ++i)
+    {
+      cv::circle(arms_img, arms[i], 2, cv::Scalar(0,255,0));
+    }
+    cv::imshow("arms", arms_img);
 #endif
 #ifdef DISPLAY_INPUT_DEPTH
     cv::imshow("input_depth", depth_frame);
@@ -1807,7 +1719,7 @@
     }
   }

-  std::vector<cv::Point> projectForearmPoseIntoImage(std_msgs::Header img_header)
+  std::vector<cv::Point> projectArmPoseIntoImage(std_msgs::Header img_header)
   {
     // Project all arm joints into image
     std::vector<cv::Point> arm_locs;


Propagates Variable.ref in Flow::Eliminate()

I ran into an issue where the .ref-ness of a Variable disappeared after flow analysis.  This fixes the issue, so I guess there must have been a transformation that eliminated the output node.  I think it's reasonable because the neighboring code also propagates other Variable properties like .in and .out.

--- myelin/flow.cc
+++ myelin/flow.cc
@@ -1141,6 +1141,7 @@
     }
     if (output->in) input->in = true;
     if (output->out) input->out = true;
+    if (output->ref) input->ref = true;
     for (Operation *target : ops_) {
       for (int i = 0; i < target->inputs.size(); ++i) {
         if (target->inputs[i] == output) {


fix for https://savannah.cern.ch/bugs/?87633

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@41315 27541ba8-7e3a-0410-8455-c3a389f83636

--- math/smatrix/test/kalman.C
+++ math/smatrix/test/kalman.C
@@ -125,7 +125,7 @@
    ts.SetTextSize(0.031);
    tt.SetTextColor(kRed);
    tt.SetTextSize(0.031);
-   char text[10];
+   char text[20];
    ts.SetTextAlign(22);
    for (i=0;i<=nx;i++) {
       line.DrawLine(xmin+i*dx,ymin,xmin+i*dx,ymax);


trying out calling readSpeedResponses before setting speeds, as recomended in sensorapi.h

--- packages/qubo_vehicle_layer/thrusters/src/thruster_tortuga.cpp
+++ packages/qubo_vehicle_layer/thrusters/src/thruster_tortuga.cpp
@@ -18,8 +18,12 @@
     // setSpeeds(sensor_fd, msg.data[0], msg.data[1], msg.data[2], msg.data[3], msg.data[4], msg.data[5]);
     // printf("fd = %x\n",fd);

+    int retR = readSpeedResponses(sensor_fd);
+    int retS = setSpeeds(sensor_fd, 128, 128, 128, 128, 128, 128);
+
     ROS_ERROR("thruster state = %x\n", readThrusterState(sensor_fd));
-    ROS_ERROR("set speed returns %x\n",  setSpeeds(sensor_fd, 128, 128, 128, 128, 128, 128));
+    ROS_ERROR("set speed returns %x\n", retS);
+    ROS_ERROR("read speed returns %x\n", retR);
 }

 void ThrusterTortugaNode::publish(){


corrected macro for calculating averge separation for baryon-antibaryon pairs

--- PWGCF/FEMTOSCOPY/macros/Train/ProtonLambdaFemto/AvgSep/ConfigFemtoAnalysis.C
+++ PWGCF/FEMTOSCOPY/macros/Train/ProtonLambdaFemto/AvgSep/ConfigFemtoAnalysis.C
@@ -355,9 +355,7 @@
 	      sqp4cetaphitpc[aniter]->SetTPCExitSepMinimum(-1.);
 	      //SetMinAvgSeparation w if'ach ponizej

-	      //sqp3cetaphitpc[aniter] = new AliFemtoPairCutAntiGamma();
 	      sqp5cetaphitpc[aniter] = new AliFemtoPairCutRadialDistance();
-	      sqp5cetaphitpc[aniter]->SetMagneticFieldSign(-1.0); //-1->field1, 1->field3
 	      sqp5cetaphitpc[aniter]->SetPhiStarDifferenceMinimum(0.012);
 	      sqp5cetaphitpc[aniter]->SetEtaDifferenceMinimum(0.017);
 	      sqp5cetaphitpc[aniter]->SetShareQualityMax(1.0);
@@ -418,8 +416,8 @@
 		}
 	      else if(ichg == 4) //V0APL
 		{
-		  sqp4cetaphitpc[aniter]->SetMinAvgSeparation(0,0); //0 - track-pos, 1 - track-neg
-		  sqp4cetaphitpc[aniter]->SetMinAvgSeparation(1,11);
+		  //sqp4cetaphitpc[aniter]->SetMinAvgSeparation(0,0); //0 - track-pos, 1 - track-neg
+		  //sqp4cetaphitpc[aniter]->SetMinAvgSeparation(1,11);
 		  anetaphitpc[aniter]->SetV0SharedDaughterCut(performSharedDaughterCut);
 		  anetaphitpc[aniter]->SetEventCut(mecetaphitpc[aniter]);
 		  anetaphitpc[aniter]->SetFirstParticleCut(dtc1etaphitpc[aniter]);


layers: Add helper to collect shader's use of input attachments

Signed-off-by: Chris Forbes <c3279c50043e18e9442c1ae071cafa0e7a4ca967@google.com>

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -1545,6 +1545,38 @@
             } else if (builtin == -1) {
                 /* An interface block instance */
                 collect_interface_block_members(src, out, blocks, is_array_of_verts, id, type, is_patch);
+            }
+        }
+    }
+}
+
+static void collect_interface_by_input_attachment_index(debug_report_data *report_data, shader_module const *src,
+                                                        std::unordered_set<uint32_t> const &accessible_ids,
+                                                        std::vector<std::pair<uint32_t, interface_var>> &out) {
+
+    for (auto insn : *src) {
+        if (insn.opcode() == spv::OpDecorate) {
+            if (insn.word(2) == spv::DecorationInputAttachmentIndex) {
+                auto attachment_index = insn.word(3);
+                auto id = insn.word(1);
+
+                if (accessible_ids.count(id)) {
+                    auto def = src->get_def(id);
+                    assert(def != src->end());
+
+                    if (def.opcode() == spv::OpVariable && insn.word(3) == spv::StorageClassUniformConstant) {
+                        /* TODO: arrays of input attachments: the descriptor
+                         * side only consumes one binding, but each array
+                         * element will consume an additional attachment index */
+                        interface_var v;
+                        v.id = id;
+                        v.type_id = def.word(1);
+                        v.offset = 0;
+                        v.is_patch = false;
+                        v.is_block_member = false;
+                        out.emplace_back(attachment_index, v);
+                    }
+                }
             }
         }
     }


storage_service: Fix indentation after previous patch

Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@scylladb.com>

--- service/storage_service.cc
+++ service/storage_service.cc
@@ -632,102 +632,100 @@
 // Runs inside seastar::async context
 future<> storage_service::bootstrap() {
     return seastar::async([this] {
-
-    auto bootstrap_rbno = is_repair_based_node_ops_enabled(streaming::stream_reason::bootstrap);
-
-    set_mode(mode::BOOTSTRAP);
-    slogger.debug("bootstrap: rbno={} replacing={}", bootstrap_rbno, is_replacing());
-
-    // Wait until we know tokens of existing node before announcing replacing status.
-    slogger.info("Wait until local node knows tokens of peer nodes");
-    _gossiper.wait_for_range_setup().get();
-
-    _db.invoke_on_all([this] (replica::database& db) {
-        for (auto& cf : db.get_non_system_column_families()) {
-            cf->notify_bootstrap_or_replace_start();
-        }
-    }).get();
-
-    if (!is_replacing()) {
-        int retry = 0;
-        while (get_token_metadata_ptr()->count_normal_token_owners() == 0) {
-            if (retry++ < 500) {
-                sleep_abortable(std::chrono::milliseconds(10), _abort_source).get();
-                continue;
-            }
-            // We're joining an existing cluster, so there are normal nodes in the cluster.
-            // We've waited for tokens to arrive.
-            // But we didn't see any normal token owners. Something's wrong, we cannot proceed.
-            throw std::runtime_error{
-                    "Failed to learn about other nodes' tokens during bootstrap. Make sure that:\n"
-                    " - the node can contact other nodes in the cluster,\n"
-                    " - the `ring_delay` parameter is large enough (the 30s default should be enough for small-to-middle-sized clusters),\n"
-                    " - a node with this IP didn't recently leave the cluster. If it did, wait for some time first (the IP is quarantined),\n"
-                    "and retry the bootstrap."};
-        }
-
-        // Even if we reached this point before but crashed, we will make a new CDC generation.
-        // It doesn't hurt: other nodes will (potentially) just do more generation switches.
-        // We do this because with this new attempt at bootstrapping we picked a different set of tokens.
-
-        // Update pending ranges now, so we correctly count ourselves as a pending replica
-        // when inserting the new CDC generation.
-        if (!bootstrap_rbno) {
-            // When is_repair_based_node_ops_enabled is true, the bootstrap node
-            // will use node_ops_cmd to bootstrap, node_ops_cmd will update the pending ranges.
-            slogger.debug("bootstrap: update pending ranges: endpoint={} bootstrap_tokens={}", get_broadcast_address(), _bootstrap_tokens);
-            mutate_token_metadata([this] (mutable_token_metadata_ptr tmptr) {
-                auto endpoint = get_broadcast_address();
-                tmptr->add_bootstrap_tokens(_bootstrap_tokens, endpoint);
-                return update_pending_ranges(std::move(tmptr), format("bootstrapping node {}", endpoint));
-            }).get();
-        }
-
-        // After we pick a generation timestamp, we start gossiping it, and we stick with it.
-        // We don't do any other generation switches (unless we crash before complecting bootstrap).
-        assert(!_cdc_gen_id);
-
-        _cdc_gen_id = _cdc_gen_service.local().make_new_generation(_bootstrap_tokens, !is_first_node()).get0();
-
-        if (!bootstrap_rbno) {
-            // When is_repair_based_node_ops_enabled is true, the bootstrap node
-            // will use node_ops_cmd to bootstrap, bootstrapping gossip status is not needed for bootstrap.
-            _gossiper.add_local_application_state({
-                { gms::application_state::TOKENS, versioned_value::tokens(_bootstrap_tokens) },
-                { gms::application_state::CDC_GENERATION_ID, versioned_value::cdc_generation_id(_cdc_gen_id) },
-                { gms::application_state::STATUS, versioned_value::bootstrapping(_bootstrap_tokens) },
-            }).get();
-
-            slogger.info("sleeping {} ms for pending range setup", get_ring_delay().count());
-            _gossiper.wait_for_range_setup().get();
-            dht::boot_strapper bs(_db, _stream_manager, _abort_source, get_broadcast_address(), _bootstrap_tokens, get_token_metadata_ptr());
+        auto bootstrap_rbno = is_repair_based_node_ops_enabled(streaming::stream_reason::bootstrap);
+
+        set_mode(mode::BOOTSTRAP);
+        slogger.debug("bootstrap: rbno={} replacing={}", bootstrap_rbno, is_replacing());
+
+        // Wait until we know tokens of existing node before announcing replacing status.
+        slogger.info("Wait until local node knows tokens of peer nodes");
+        _gossiper.wait_for_range_setup().get();
+
+        _db.invoke_on_all([this] (replica::database& db) {
+            for (auto& cf : db.get_non_system_column_families()) {
+                cf->notify_bootstrap_or_replace_start();
+            }
+        }).get();
+
+        if (!is_replacing()) {
+            int retry = 0;
+            while (get_token_metadata_ptr()->count_normal_token_owners() == 0) {
+                if (retry++ < 500) {
+                    sleep_abortable(std::chrono::milliseconds(10), _abort_source).get();
+                    continue;
+                }
+                // We're joining an existing cluster, so there are normal nodes in the cluster.
+                // We've waited for tokens to arrive.
+                // But we didn't see any normal token owners. Something's wrong, we cannot proceed.
+                throw std::runtime_error{
+                        "Failed to learn about other nodes' tokens during bootstrap. Make sure that:\n"
+                        " - the node can contact other nodes in the cluster,\n"
+                        " - the `ring_delay` parameter is large enough (the 30s default should be enough for small-to-middle-sized clusters),\n"
+                        " - a node with this IP didn't recently leave the cluster. If it did, wait for some time first (the IP is quarantined),\n"
+                        "and retry the bootstrap."};
+            }
+
+            // Even if we reached this point before but crashed, we will make a new CDC generation.
+            // It doesn't hurt: other nodes will (potentially) just do more generation switches.
+            // We do this because with this new attempt at bootstrapping we picked a different set of tokens.
+
+            // Update pending ranges now, so we correctly count ourselves as a pending replica
+            // when inserting the new CDC generation.
+            if (!bootstrap_rbno) {
+                // When is_repair_based_node_ops_enabled is true, the bootstrap node
+                // will use node_ops_cmd to bootstrap, node_ops_cmd will update the pending ranges.
+                slogger.debug("bootstrap: update pending ranges: endpoint={} bootstrap_tokens={}", get_broadcast_address(), _bootstrap_tokens);
+                mutate_token_metadata([this] (mutable_token_metadata_ptr tmptr) {
+                    auto endpoint = get_broadcast_address();
+                    tmptr->add_bootstrap_tokens(_bootstrap_tokens, endpoint);
+                    return update_pending_ranges(std::move(tmptr), format("bootstrapping node {}", endpoint));
+                }).get();
+            }
+
+            // After we pick a generation timestamp, we start gossiping it, and we stick with it.
+            // We don't do any other generation switches (unless we crash before complecting bootstrap).
+            assert(!_cdc_gen_id);
+
+            _cdc_gen_id = _cdc_gen_service.local().make_new_generation(_bootstrap_tokens, !is_first_node()).get0();
+
+            if (!bootstrap_rbno) {
+                // When is_repair_based_node_ops_enabled is true, the bootstrap node
+                // will use node_ops_cmd to bootstrap, bootstrapping gossip status is not needed for bootstrap.
+                _gossiper.add_local_application_state({
+                    { gms::application_state::TOKENS, versioned_value::tokens(_bootstrap_tokens) },
+                    { gms::application_state::CDC_GENERATION_ID, versioned_value::cdc_generation_id(_cdc_gen_id) },
+                    { gms::application_state::STATUS, versioned_value::bootstrapping(_bootstrap_tokens) },
+                }).get();
+
+                slogger.info("sleeping {} ms for pending range setup", get_ring_delay().count());
+                _gossiper.wait_for_range_setup().get();
+                dht::boot_strapper bs(_db, _stream_manager, _abort_source, get_broadcast_address(), _bootstrap_tokens, get_token_metadata_ptr());
+                slogger.info("Starting to bootstrap...");
+                bs.bootstrap(streaming::stream_reason::bootstrap, _gossiper).get();
+            } else {
+                // Even with RBNO bootstrap we need to announce the new CDC generation immediately after it's created.
+                _gossiper.add_local_application_state({
+                    { gms::application_state::CDC_GENERATION_ID, versioned_value::cdc_generation_id(_cdc_gen_id) },
+                }).get();
+                slogger.info("Starting to bootstrap...");
+                run_bootstrap_ops();
+            }
+        } else {
+            auto replace_addr = get_replace_address();
+            slogger.debug("Removing replaced endpoint {} from system.peers", *replace_addr);
+            _sys_ks.local().remove_endpoint(*replace_addr).get();
+            _group0->leave_group0(replace_addr).get();
             slogger.info("Starting to bootstrap...");
-            bs.bootstrap(streaming::stream_reason::bootstrap, _gossiper).get();
-        } else {
-            // Even with RBNO bootstrap we need to announce the new CDC generation immediately after it's created.
-            _gossiper.add_local_application_state({
-                { gms::application_state::CDC_GENERATION_ID, versioned_value::cdc_generation_id(_cdc_gen_id) },
-            }).get();
-            slogger.info("Starting to bootstrap...");
-            run_bootstrap_ops();
-        }
-    } else {
-        auto replace_addr = get_replace_address();
-        slogger.debug("Removing replaced endpoint {} from system.peers", *replace_addr);
-        _sys_ks.local().remove_endpoint(*replace_addr).get();
-        _group0->leave_group0(replace_addr).get();
-        slogger.info("Starting to bootstrap...");
-        run_replace_ops();
-    }
-
-    _db.invoke_on_all([this] (replica::database& db) {
-        for (auto& cf : db.get_non_system_column_families()) {
-            cf->notify_bootstrap_or_replace_end();
-        }
-    }).get();
-
-    slogger.info("Bootstrap completed! for the tokens {}", _bootstrap_tokens);
-
+            run_replace_ops();
+        }
+
+        _db.invoke_on_all([this] (replica::database& db) {
+            for (auto& cf : db.get_non_system_column_families()) {
+                cf->notify_bootstrap_or_replace_end();
+            }
+        }).get();
+
+        slogger.info("Bootstrap completed! for the tokens {}", _bootstrap_tokens);
     });
 }


new implementation of Cyclotomic (#215)

new implementation of Cyclotomic (#215)

--- src/NumbTh.cpp
+++ src/NumbTh.cpp
@@ -427,24 +427,65 @@
   return -1;
 }

-/* Compute cyclotomic polynomial */
-NTL::ZZX Cyclotomic(long N)
-{
-  NTL::ZZX Num,Den,G,F;
-  NTL::set(Num); NTL::set(Den);
-  long m,d;
-  for (d=1; d<=N; d++)
-    { if ((N%d)==0)
-         { clear(G);
-           SetCoeff(G,N/d,1); SetCoeff(G,0,-1);
-           m=mobius(d);
-           if (m==1)       { Num*=G; }
-           else if (m==-1) { Den*=G; }
+// Based on Algorithm 4 (the Sparse Power Series Algorithm) from
+// ANDREW ARNOLD AND MICHAEL MONAGAN, CALCULATING CYCLOTOMIC POLYNOMIALS,
+// MATHEMATICS OF COMPUTATION, Volume 80, Number 276, October 2011,
+// Pages 2359-2379
+
+NTL::ZZX Cyclotomic(long n)
+{
+   helib::assertEq(n > 1, true, "n > 1");
+
+   std::vector<long> facs;
+   factorize(facs, n);
+
+   long k = facs.size();
+
+   long radn = 1;
+   long phi_radn = 1;
+   for (long i: range(k)) {
+      radn *= facs[i];
+      phi_radn *= (facs[i]-1);
+   }
+
+   long D = phi_radn/2;
+   NTL::Vec<NTL::ZZ> A;
+   A.SetLength(D+1);
+   A[0] = 1;
+   for (long i = 1; i <= D; i++) A[i] = 0;
+
+   for (long bits: range(1L << k)) {
+      long d = 1;
+      long parity = k & 1;
+      for (long pos: range(k)) {
+         if ((1L << pos) & bits) {
+            d *= facs[pos];
+            parity = 1 - parity;
          }
-    }
-  F=Num/Den;
-  return F;
-}
+      }
+
+      if (parity == 0) {
+         for (long i = D; i >= d; i--)
+            A[i] -= A[i-d];
+      }
+      else {
+         for (long i = d; i <= D; i++)
+            A[i] += A[i-d];
+      }
+   }
+
+   long q = n/radn;
+   long phi_n = phi_radn * q;
+   NTL::ZZX res;
+   res.rep.SetLength(phi_n+1);
+   for (long i = 0; i <= D; i++)
+      res.rep[i*q] = A[i];
+   for (long i = D+1; i <= phi_radn; i++)
+      res.rep[i*q] = A[phi_radn-i];
+
+   return res;
+}
+

 /* Find a primitive root modulo N */
 long primroot(long N,long phiN)


Add register API for PHY Rank Pair registers

Fix access_delay_regs ut by choosing rank based on given rank pair
Put rank functions into a rank namespace

Change-Id: I3dda214c680047a33851371ebf0f861c287dced6
Original-Change-Id: I57e0dc54e78c7b72df346fb902d5188330503919
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29372
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <7301c4b00f53e5772c2576cd0c5f485155c2ece1@us.ibm.com>
Reviewed-by: Brian R. Silver <af0eed78d989d9597decc8b92fa6db01ef8b58e0@us.ibm.com>
Reviewed-by: JACOB L. HARVEY <3228c361e36065d481020c968085ab1d20e47d22@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <ab93eca12e43608f33daa16a67357cd7b7e867ab@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C
+++ src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C
@@ -163,7 +163,7 @@
         //

         // Setup PER_ZCAL_CONFIG based on the number of ranks on the DIMM in either slot.
-        FAPI_TRY( mss::ranks(i_target, l_ranks) );
+        FAPI_TRY( mss::rank::ranks(i_target, l_ranks) );

         for (auto r : l_ranks)
         {
@@ -209,7 +209,7 @@
         // need to do it twice for the PHY? BRS
         fapi2::buffer<uint64_t> l_rank_config;

-        FAPI_TRY( mss::get_rank_pairs(i_target, l_pairs) );
+        FAPI_TRY( mss::rank::get_rank_pairs(i_target, l_pairs) );

         for (auto pair : l_pairs)
         {


Flaky Chrome Frame ContextMenu tests.

Flaky Chrome Frame ContextMenu tests.

CFTxtField{Copy,Cut,Delete,Paste,Redo,Undo} time out sporadically on IE6.

BUG=119660
TEST=none
TBR=robertshield@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9839066

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@128556 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome_frame/test/ui_test.cc
+++ chrome_frame/test/ui_test.cc
@@ -780,7 +780,8 @@
 }

 // Test CF text field context menu - cut.
-TEST_F(ContextMenuTest, CFTxtFieldCut) {
+// Times out sporadically http://crbug.com/119660.
+TEST_F(ContextMenuTest, FLAKY_CFTxtFieldCut) {
   server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag());
   AccObjectMatcher txtfield_matcher(L"", L"editable text");

@@ -803,7 +804,8 @@
 }

 // Test CF text field context menu - copy.
-TEST_F(ContextMenuTest, CFTxtFieldCopy) {
+// Times out sporadically http://crbug.com/119660.
+TEST_F(ContextMenuTest, FLAKY_CFTxtFieldCopy) {
   server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag());
   AccObjectMatcher txtfield_matcher(L"", L"editable text");

@@ -828,7 +830,8 @@
 }

 // Test CF text field context menu - paste.
-TEST_F(ContextMenuTest, DISABLED_CFTxtFieldPaste) {
+// Times out sporadically http://crbug.com/119660.
+TEST_F(ContextMenuTest, FLAKY_CFTxtFieldPaste) {
   server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag());
   AccObjectMatcher txtfield_matcher(L"", L"editable text");

@@ -851,7 +854,8 @@
 }

 // Test CF text field context menu - delete.
-TEST_F(ContextMenuTest, CFTxtFieldDelete) {
+// Times out sporadically http://crbug.com/119660.
+TEST_F(ContextMenuTest, FLAKY_CFTxtFieldDelete) {
   server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag());
   AccObjectMatcher txtfield_matcher(L"", L"editable text");

@@ -891,7 +895,8 @@
 }

 // Test CF text field context menu - undo.
-TEST_F(ContextMenuTest, CFTxtFieldUndo) {
+// Times out sporadically http://crbug.com/119660.
+TEST_F(ContextMenuTest, FLAKY_CFTxtFieldUndo) {
   server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag());
   AccObjectMatcher txtfield_matcher(L"", L"editable text");

@@ -918,7 +923,8 @@
 }

 // Test CF text field context menu - redo.
-TEST_F(ContextMenuTest, CFTxtFieldRedo) {
+// Times out sporadically http://crbug.com/119660.
+TEST_F(ContextMenuTest, FLAKY_CFTxtFieldRedo) {
   server_mock_.ExpectAndServeAnyRequests(CFInvocation::MetaTag());
   AccObjectMatcher txtfield_matcher(L"", L"editable text");
   InSequence expect_in_sequence_for_scope;