chromium/ui/display/util/edid_parser.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "ui/display/util/edid_parser.h"

#include <stddef.h>

#include <algorithm>
#include <bitset>

#include "base/check.h"
#include "base/containers/span.h"
#include "base/hash/hash.h"
#include "base/hash/md5.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/numerics/byte_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "third_party/abseil-cpp/absl/strings/ascii.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "ui/display/util/display_util.h"
#include "ui/gfx/geometry/size.h"

namespace display {
namespace {

constexpr char kParseEdidFailureMetric[] =;
constexpr char kParseExternalDisplayEdidOptionalsMetric[] =;
constexpr char kBlockZeroSerialNumberTypeMetric[] =;
constexpr char kNumOfSerialNumbersProvidedByExternalDisplay[] =;
constexpr uint8_t kMaxSerialNumberCount =;
constexpr uint8_t kDisplayIdExtensionTag =;

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class ParseEdidFailure {};

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused. This enum is used to track the
// availability (or lack thereof) of optional fields during EDID parsing.
enum class ParseEdidOptionals {};

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused. This enum is used to track the
// serial number types that can be retrieved from an EDID's block zero.
enum class BlockZeroSerialNumberType {};

BlockZeroSerialNumberType GetSerialNumberType(
    base::span<const uint8_t, 4u> serial_number) {}
}  // namespace

EdidParser::EdidParser(std::vector<uint8_t>&& edid_blob, bool is_external)
    :{}

EdidParser::EdidParser(EdidParser&& other) = default;
EdidParser& EdidParser::operator=(EdidParser&& other) = default;
EdidParser::~EdidParser() = default;

uint32_t EdidParser::GetProductCode() const {}

int64_t EdidParser::GetIndexBasedDisplayId(uint8_t output_index) const {}

int64_t EdidParser::GetEdidBasedDisplayId() const {}

// static
void EdidParser::SplitProductCodeInManufacturerIdAndProductId(
    int64_t product_code,
    uint16_t* manufacturer_id,
    uint16_t* product_id) {}

// static
std::string EdidParser::ManufacturerIdToString(uint16_t manufacturer_id) {}

// static
std::string EdidParser::ProductIdToString(uint16_t product_id) {}

bool EdidParser::TileCanScaleToFit() const {}

void EdidParser::ParseEdid(const std::vector<uint8_t>& edid) {}

// TODO(b/316356595): Move DisplayID parsing into its own class.
// NOTE: Refer to figure Figure 2-1 of VESA DisplayID Standard Version 2.1 for
// how DisplayID Structure v2.0 is laid out as an EDID extension.
void EdidParser::ParseDisplayIdExtension(const std::vector<uint8_t>& edid,
                                         size_t extension_offset) {}

// DisplayID 1.3 and 2.0 tiled display data blocks look identical, at
// least for the current set of fields. Consult both of the specs before
// parsing more fields.
void EdidParser::ParseTiledDisplayBlock(const std::vector<uint8_t>& edid,
                                        size_t block_offset) {}

void EdidParser::ReportEdidOptionalsForExternalDisplay() const {}

}  // namespace display