blob: 3742eda146cf6c48dc5bd1f0fb7b0ff126482240 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stddef.h>
#include <stdint.h>
#include <vector>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "ui/display/types/display_constants.h"
#include "ui/gfx/geometry/point.h"
#include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
typedef struct _drmModeModeInfo drmModeModeInfo;
namespace ui {
class DrmDevice;
class HardwareDisplayControllerInfo;
class ScreenManager;
struct GammaRampRGBEntry;
class DrmDisplay {
DrmDisplay(ScreenManager* screen_manager,
const scoped_refptr<DrmDevice>& drm);
int64_t display_id() const { return display_id_; }
scoped_refptr<DrmDevice> drm() const { return drm_; }
uint32_t crtc() const { return crtc_; }
uint32_t connector() const { return connector_; }
const std::vector<drmModeModeInfo>& modes() const { return modes_; }
DisplaySnapshot_Params Update(HardwareDisplayControllerInfo* info,
size_t device_index);
bool Configure(const drmModeModeInfo* mode, const gfx::Point& origin);
bool GetHDCPState(HDCPState* state);
bool SetHDCPState(HDCPState state);
void SetColorCorrection(const std::vector<GammaRampRGBEntry>& degamma_lut,
const std::vector<GammaRampRGBEntry>& gamma_lut,
const std::vector<float>& correction_matrix);
ScreenManager* screen_manager_; // Not owned.
int64_t display_id_ = -1;
scoped_refptr<DrmDevice> drm_;
uint32_t crtc_ = 0;
uint32_t connector_ = 0;
std::vector<drmModeModeInfo> modes_;
gfx::Point origin_;
} // namespace ui