Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c376d681 authored by Mike Ma's avatar Mike Ma Committed by Android (Google) Code Review
Browse files

Merge "Updating ConfigurationDataGet api to include edid data."

parents de8d64a8 a08194b0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -191,7 +191,8 @@ struct SurfaceInfo {
enum class ConfigFileType : uint32_t {
  kLensMetrics,
  kDeviceMetrics,
  kDeviceConfiguration
  kDeviceConfiguration,
  kDeviceEdid
};

struct DisplayProtocol {
+2 −0
Original line number Diff line number Diff line
@@ -85,6 +85,8 @@ enum {
  DVR_CONFIGURATION_DATA_DEVICE_METRICS = 1,
  // Request the per device configuration data file.
  DVR_CONFIGURATION_DATA_DEVICE_CONFIG = 2,
  // Request the edid data for the display.
  DVR_CONFIGURATION_DATA_DEVICE_EDID = 3,
};

// dvr_display_manager.h
+18 −0
Original line number Diff line number Diff line
@@ -44,6 +44,18 @@ DisplayService::DisplayService(Hwc2::Composer* hidl,
           Endpoint::Create(display::DisplayProtocol::kClientPath)) {
    hardware_composer_.Initialize(
        hidl, primary_display_id, request_display_callback);

    uint8_t port;
    const auto error = hidl->getDisplayIdentificationData(
        primary_display_id, &port, &display_identification_data_);
    if (error != android::hardware::graphics::composer::V2_1::Error::NONE) {
      if (error !=
          android::hardware::graphics::composer::V2_1::Error::UNSUPPORTED) {
        ALOGI("DisplayService: identification data error\n");
      } else {
        ALOGI("DisplayService: identification data unsupported\n");
      }
    }
}

bool DisplayService::IsInitialized() const {
@@ -204,6 +216,12 @@ pdx::Status<std::string> DisplayService::OnGetConfigurationData(
    case display::ConfigFileType::kDeviceConfiguration:
      property_name = kDvrDeviceConfigProperty;
      break;
    case display::ConfigFileType::kDeviceEdid:
      if (display_identification_data_.size() == 0) {
        return ErrorStatus(ENOENT);
      }
      return std::string(display_identification_data_.begin(),
                         display_identification_data_.end());
    default:
      return ErrorStatus(EINVAL);
  }
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@
#include "epoll_event_dispatcher.h"
#include "hardware_composer.h"

#include "DisplayHardware/DisplayIdentification.h"

namespace android {
namespace dvr {

@@ -117,6 +119,8 @@ class DisplayService : public pdx::ServiceBase<DisplayService> {

  DisplayService(const DisplayService&) = delete;
  void operator=(const DisplayService&) = delete;

  DisplayIdentificationData display_identification_data_;
};

}  // namespace dvr