gc unused stuff in HW abstraction layer (#36465)

* gc unused stuff in HW abstraction layer

* lil more
pull/36468/head
Adeeb Shihadeh 3 weeks ago committed by GitHub
parent 17152484c2
commit 538ec25ad9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      system/hardware/base.h
  2. 19
      system/hardware/tici/hardware.h
  3. 2
      tools/replay/framereader.cc

@ -10,7 +10,6 @@
// no-op base hw class // no-op base hw class
class HardwareNone { class HardwareNone {
public: public:
static std::string get_os_version() { return ""; }
static std::string get_name() { return ""; } static std::string get_name() { return ""; }
static cereal::InitData::DeviceType get_device_type() { return cereal::InitData::DeviceType::UNKNOWN; } static cereal::InitData::DeviceType get_device_type() { return cereal::InitData::DeviceType::UNKNOWN; }
static int get_voltage() { return 0; } static int get_voltage() { return 0; }
@ -22,14 +21,7 @@ public:
return {}; return {};
} }
static void reboot() {}
static void poweroff() {}
static void set_brightness(int percent) {}
static void set_ir_power(int percentage) {} static void set_ir_power(int percentage) {}
static void set_display_power(bool on) {}
static bool get_ssh_enabled() { return false; }
static void set_ssh_enabled(bool enabled) {}
static bool PC() { return false; } static bool PC() { return false; }
static bool TICI() { return false; } static bool TICI() { return false; }

@ -13,12 +13,6 @@
class HardwareTici : public HardwareNone { class HardwareTici : public HardwareNone {
public: public:
static bool TICI() { return true; }
static bool AGNOS() { return true; }
static std::string get_os_version() {
return "AGNOS " + util::read_file("/VERSION");
}
static std::string get_name() { static std::string get_name() {
std::string model = util::read_file("/sys/firmware/devicetree/base/model"); std::string model = util::read_file("/sys/firmware/devicetree/base/model");
return util::strip(model.substr(std::string("comma ").size())); return util::strip(model.substr(std::string("comma ").size()));
@ -56,16 +50,6 @@ public:
return serial; return serial;
} }
static void reboot() { std::system("sudo reboot"); }
static void poweroff() { std::system("sudo poweroff"); }
static void set_brightness(int percent) {
float max = std::stof(util::read_file("/sys/class/backlight/panel0-backlight/max_brightness"));
std::ofstream("/sys/class/backlight/panel0-backlight/brightness") << int(percent * (max / 100.0f)) << "\n";
}
static void set_display_power(bool on) {
std::ofstream("/sys/class/backlight/panel0-backlight/bl_power") << (on ? "0" : "4") << "\n";
}
static void set_ir_power(int percent) { static void set_ir_power(int percent) {
auto device = get_device_type(); auto device = get_device_type();
if (device == cereal::InitData::DeviceType::TICI || if (device == cereal::InitData::DeviceType::TICI ||
@ -104,7 +88,4 @@ public:
return ret; return ret;
} }
static bool get_ssh_enabled() { return Params().getBool("SshEnabled"); }
static void set_ssh_enabled(bool enabled) { Params().putBool("SshEnabled", enabled); }
}; };

@ -40,7 +40,7 @@ struct DecoderManager {
std::unique_ptr<VideoDecoder> decoder; std::unique_ptr<VideoDecoder> decoder;
#ifndef __APPLE__ #ifndef __APPLE__
if (Hardware::TICI() && hw_decoder) { if (!Hardware::PC() && hw_decoder) {
decoder = std::make_unique<QcomVideoDecoder>(); decoder = std::make_unique<QcomVideoDecoder>();
} else } else
#endif #endif

Loading…
Cancel
Save