From 2894cd2a9d438356fb8d6bec8c1a70c38187125a Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Wed, 25 Nov 2020 10:43:01 +1000 Subject: [PATCH] https://github.com/commaai/openpilot/commit/71930a4b9674037f494b622fb0002904b2e35a2a https://github.com/commaai/openpilot/commit/160fd207a5087754408d829f39b24d1f1c508df2 https://github.com/commaai/openpilot/commit/b75259ad07ff8c8467f2921766fc3d89cf8c3c82 --- cereal/car.capnp | 2 +- cereal/log.capnp | 3 +++ launch_chffrplus.sh | 3 +++ selfdrive/controls/controlsd.py | 2 -- selfdrive/controls/lib/events.py | 8 -------- selfdrive/controls/lib/planner.py | 3 --- selfdrive/modeld/thneed/thneed.cc | 7 +++++++ selfdrive/modeld/thneed/thneed.h | 1 + 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/cereal/car.capnp b/cereal/car.capnp index 99707c156..a0dfcdaea 100644 --- a/cereal/car.capnp +++ b/cereal/car.capnp @@ -103,7 +103,6 @@ struct CarEvent @0x9b1657f34caf3ad3 { deviceFalling @90; fanMalfunction @91; cameraMalfunction @92; - modelLagWarning @93; gasUnavailableDEPRECATED @3; dataNeededDEPRECATED @16; @@ -117,6 +116,7 @@ struct CarEvent @0x9b1657f34caf3ad3 { canErrorPersistentDEPRECATED @83; focusRecoverActiveDEPRECATED @86; neosUpdateRequiredDEPRECATED @88; + modelLagWarningDEPRECATED @93; #dp preLaneChangeLeftALC @94; diff --git a/cereal/log.capnp b/cereal/log.capnp index 6169c41a9..2ca65c815 100644 --- a/cereal/log.capnp +++ b/cereal/log.capnp @@ -629,6 +629,7 @@ struct ModelData { frameDropPerc @13 :Float32; timestampEof @9 :UInt64; modelExecutionTime @14 :Float32; + rawPred @15 :Data; path @1 :PathData; leftLane @2 :PathData; @@ -696,6 +697,7 @@ struct ModelDataV2 { frameDropPerc @2 :Float32; timestampEof @3 :UInt64; modelExecutionTime @15 :Float32; + rawPred @16 :Data; position @4 :XYZTData; orientation @5 :XYZTData; @@ -1953,6 +1955,7 @@ struct OrbKeyFrame { struct DriverState { frameId @0 :UInt32; modelExecutionTime @14 :Float32; + rawPred @15 :Data; descriptorDEPRECATED @1 :List(Float32); stdDEPRECATED @2 :Float32; diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 08baac73b..56499a17d 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -34,6 +34,9 @@ function two_init { echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu0/governor echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu2/governor + # GPU + echo "performance" > /sys/class/devfreq/b00000.qcom,kgsl-3d0/governor + # /sys/class/devfreq/soc:qcom,mincpubw is the only one left at "powersave" # it seems to gain nothing but a wasted 500mW diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 2df6fd19a..52b0b9831 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -252,8 +252,6 @@ class Controls: if self.sm['model'].frameDropPerc > 20 and not SIMULATION: self.events.add(EventName.modeldLagging) - elif self.sm['model'].frameDropPerc > 2 and not SIMULATION: - self.events.add(EventName.modelLagWarning) # Only allow engagement with brake pressed when stopped behind another stopped car if not self.sm['dragonConf'].dpAtl and CS.brakePressed and self.sm['plan'].vTargetFuture >= STARTING_TARGET_SPEED \ diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index eddecf9b0..d13b3d9e7 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -481,14 +481,6 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo Priority.LOW, VisualAlert.steerRequired, AudibleAlert.chimePrompt, 1., 1., 1.), }, - EventName.modelLagWarning: { - ET.WARNING: Alert( - _("TAKE CONTROL"), - _("Driving Model Lagging"), - AlertStatus.userPrompt, AlertSize.mid, - Priority.LOW, VisualAlert.steerRequired, AudibleAlert.chimePrompt, 1., 1., 1.), - }, - EventName.fanMalfunction: { ET.PERMANENT: NormalPermanentAlert(_("Fan Malfunction"), _("Contact Support")), }, diff --git a/selfdrive/controls/lib/planner.py b/selfdrive/controls/lib/planner.py index b381736e4..0f810cf96 100755 --- a/selfdrive/controls/lib/planner.py +++ b/selfdrive/controls/lib/planner.py @@ -15,10 +15,7 @@ from selfdrive.controls.lib.fcw import FCWChecker from selfdrive.controls.lib.long_mpc import LongitudinalMpc from selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX -MAX_SPEED = 255.0 - LON_MPC_STEP = 0.2 # first step is 0.2s -MAX_SPEED_ERROR = 2.0 AWARENESS_DECEL = -0.2 # car smoothly decel at .2m/s^2 when user is distracted # lookup tables VS speed to determine min and max accels in cruise diff --git a/selfdrive/modeld/thneed/thneed.cc b/selfdrive/modeld/thneed/thneed.cc index 4c1adc1ab..e08370a70 100644 --- a/selfdrive/modeld/thneed/thneed.cc +++ b/selfdrive/modeld/thneed/thneed.cc @@ -39,6 +39,13 @@ int ioctl(int filedes, unsigned long request, void *argp) { // save the fd if (request == IOCTL_KGSL_GPUOBJ_ALLOC) g_fd = filedes; + if (request == IOCTL_KGSL_DRAWCTXT_CREATE) { + struct kgsl_drawctxt_create *create = (struct kgsl_drawctxt_create *)argp; + create->flags &= ~KGSL_CONTEXT_PRIORITY_MASK; + create->flags |= 1 << KGSL_CONTEXT_PRIORITY_SHIFT; // priority from 1-15, 1 is max priority + printf("creating context with flags 0x%x\n", create->flags); + } + if (thneed != NULL) { if (request == IOCTL_KGSL_GPU_COMMAND) { struct kgsl_gpu_command *cmd = (struct kgsl_gpu_command *)argp; diff --git a/selfdrive/modeld/thneed/thneed.h b/selfdrive/modeld/thneed/thneed.h index 07e54e134..a145a2847 100644 --- a/selfdrive/modeld/thneed/thneed.h +++ b/selfdrive/modeld/thneed/thneed.h @@ -8,6 +8,7 @@ #include #include "include/msm_kgsl.h" #include +#include #include using namespace std;