  };
  
  typedef struct UIScene {
    bool calibration_valid = false;
    bool wide_cam = true;
    mat3 view_from_calib = DEFAULT_CALIBRATION;
    mat3 view_from_wide_calib = DEFAULT_CALIBRATION;
    cereal::PandaState::PandaType pandaType;
  
    // modelV2
 
</s> remove   std::mutex frame_lock;
 </s> add   std::recursive_mutex frame_lock; </s> remove 
  if (sm.updated("carState")) {
    float v_ego = sm["carState"].getCarState().getVEgo();
    // TODO: support replays without ecam by using fcam
    // Wide or narrow cam dependent on speed
    if ((v_ego < 10) || s->wide_cam_only) {
      scene.wide_cam = true;
    } else if (v_ego > 15) {
      scene.wide_cam = false;
    }
  }
 </s> add  </s> remove   updateFrameMat();
 </s> add  </s> remove static void update_model(UIState *s, const cereal::ModelDataV2::Reader &model) {
 </s> add void update_model(UIState *s, const cereal::ModelDataV2::Reader &model) { </s> remove   void setStreamType(VisionStreamType type) { stream_type = type; }
 </s> add 
  bool calibration_wide_valid  = false;
  };
  
  typedef struct UIScene {
    bool calibration_valid = false;
  bool calibration_wide_valid  = false;
    bool wide_cam = true;
    mat3 view_from_calib = DEFAULT_CALIBRATION;
    mat3 view_from_wide_calib = DEFAULT_CALIBRATION;
    cereal::PandaState::PandaType pandaType;
  
    // modelV2
keep keep keep add keep keep keep keep keep keep
 UI: draw onroad objects on right frame (#26306)

* update before draw

* fix a lot of janky

* fix more flicker

* cleanup

* fix flicker when opening settings

* simplify 
selfdrive/ui/ui.h