summaryrefslogtreecommitdiff
path: root/chromium/ui/ozone/platform/drm/mojom/drm_device.mojom
blob: cd641061ef7f608da486b8f7e2837b44c947a602 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Copyright 2017 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.

module ui.ozone.mojom;

import "mojo/public/mojom/base/file.mojom";
import "mojo/public/mojom/base/file_path.mojom";
import "ui/display/mojom/display_configuration_params.mojom";
import "ui/display/mojom/display_constants.mojom";
import "ui/display/mojom/display_mode.mojom";
import "ui/display/mojom/display_snapshot.mojom";
import "ui/display/mojom/gamma_ramp_rgb_entry.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
import "ui/gfx/mojom/accelerated_widget.mojom";
import "ui/ozone/platform/drm/mojom/device_cursor.mojom";

// The viz process on CrOS implements the DrmDevice
// service to let the viz host and clients manage DRM displays.
// All functions in DrmDevice are implemented by the lower privilege viz
// process.
interface DrmDevice {
  // Creates scanout capable DRM buffers to back |widget|. |initial_bounds| is
  // used to calculate the initial size of the DRM bufffer backing |widget| and
  // it can be modified later by calling SetWindowBounds().
  CreateWindow(gfx.mojom.AcceleratedWidget widget,
               gfx.mojom.Rect initial_bounds);

  // Destroys the DRM buffers backing |widget|.
  DestroyWindow(gfx.mojom.AcceleratedWidget widget);

  // Sets the size of the DRM buffer for |widget|.
  SetWindowBounds(gfx.mojom.AcceleratedWidget widget, gfx.mojom.Rect bounds);

  // Takes control of the display and invoke a provided callback with a boolean
  // status.
  TakeDisplayControl() => (bool success);

  // Releases control of the display and invoke a provided callback with a
  // boolean status.
  RelinquishDisplayControl() => (bool success);

  // Requests a callback providing a list of the available displays.
  RefreshNativeDisplays() =>
      (array<display.mojom.DisplaySnapshot> display_snapshots);

  // Transfers ownership of a DRM device to the GPU process.
  AddGraphicsDevice(mojo_base.mojom.FilePath path,
                    mojo_base.mojom.File file);

  // Instructs the GPU to abandon a DRM device.
  RemoveGraphicsDevice(mojo_base.mojom.FilePath path);

  // Asks whether or not an incoming udev change event is blocked.
  // |event_props| is a map of a display UDEV event's property name and its
  // value. The list of a UDEV event's properties can be seen when running
  // $ udevadm monitor --property on a DUT.
  ShouldDisplayEventTriggerConfiguration(map<string, string> event_props) =>
      (bool should_trigger);

  // Configures (Enables/Disables) DRM displays, returns whether or not the
  // configuration was successful.
  ConfigureNativeDisplays(
      array<display.mojom.DisplayConfigurationParams> config_requests) =>
    (bool config_success);

  // Gets high-definition content protection (HDCP) (DRM as in
  // digital rights management) state.
  GetHDCPState(int64 display_id) =>
      (int64 display_id, bool success, display.mojom.HDCPState state,
       display.mojom.ContentProtectionMethod protection_method);

  // Sets high-definition content protection (HDCP) (DRM as in
  // digital rights management) state.
  SetHDCPState(int64 display_id, display.mojom.HDCPState state,
               display.mojom.ContentProtectionMethod protection_method) =>
      (int64 display_id, bool success);

  // Sets a 3x3 color transform matrix on the display hardware.
  // TODO: Consider using a different type for the color matrix.
  // https://crbug.com/846975.
  SetColorMatrix(int64 display_id, array<float, 9> color_matrix);

  // Sets a color correction gamma lookup table.
  SetGammaCorrection(int64 display_id,
                     array<display.mojom.GammaRampRGBEntry> degamma_lut,
                     array<display.mojom.GammaRampRGBEntry> gamma_lut);

  // Sets the state of the privacy screen feature, returns whether or not the
  // configuration was successful.
  SetPrivacyScreen(int64 display_id, bool enabled) => (bool success);

  // Provides a DeviceCursor interface. The provided interface needs to be
  // associated because the AcceleratedWidgets referenced by its methods are
  // registered via CreateWindow() in this interface.
  GetDeviceCursor(pending_associated_receiver<DeviceCursor> cursor);
};