Blame view

include/drm/drm_color_mgmt.h 2.33 KB
f1e2f66ce   Daniel Vetter   drm: Extract drm_...
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
  /*
   * Copyright (c) 2016 Intel Corporation
   *
   * Permission to use, copy, modify, distribute, and sell this software and its
   * documentation for any purpose is hereby granted without fee, provided that
   * the above copyright notice appear in all copies and that both that copyright
   * notice and this permission notice appear in supporting documentation, and
   * that the name of the copyright holders not be used in advertising or
   * publicity pertaining to distribution of the software without specific,
   * written prior permission.  The copyright holders make no representations
   * about the suitability of this software for any purpose.  It is provided "as
   * is" without express or implied warranty.
   *
   * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
   * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
   * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
   * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
   * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
   * OF THIS SOFTWARE.
   */
  
  #ifndef __DRM_COLOR_MGMT_H__
  #define __DRM_COLOR_MGMT_H__
  
  #include <linux/ctype.h>
d1841d328   Jyri Sarha   drm: drm_color_mg...
27
  struct drm_crtc;
80f690e9e   Jyri Sarha   drm: Add optional...
28
  struct drm_plane;
d1841d328   Jyri Sarha   drm: drm_color_mg...
29

8f2e045ec   Jani Nikula   drm/color: un-inl...
30
  uint32_t drm_color_lut_extract(uint32_t user_input, uint32_t bit_precision);
f1e2f66ce   Daniel Vetter   drm: Extract drm_...
31
32
33
34
35
36
37
  void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc,
  				uint degamma_lut_size,
  				bool has_ctm,
  				uint gamma_lut_size);
  
  int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
  				 int gamma_size);
41204dfee   Ville Syrjälä   drm: Introduce dr...
38
39
40
41
42
43
44
45
46
47
48
  /**
   * drm_color_lut_size - calculate the number of entries in the LUT
   * @blob: blob containing the LUT
   *
   * Returns:
   * The number of entries in the color LUT stored in @blob.
   */
  static inline int drm_color_lut_size(const struct drm_property_blob *blob)
  {
  	return blob->length / sizeof(struct drm_color_lut);
  }
80f690e9e   Jyri Sarha   drm: Add optional...
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  enum drm_color_encoding {
  	DRM_COLOR_YCBCR_BT601,
  	DRM_COLOR_YCBCR_BT709,
  	DRM_COLOR_YCBCR_BT2020,
  	DRM_COLOR_ENCODING_MAX,
  };
  
  enum drm_color_range {
  	DRM_COLOR_YCBCR_LIMITED_RANGE,
  	DRM_COLOR_YCBCR_FULL_RANGE,
  	DRM_COLOR_RANGE_MAX,
  };
  
  int drm_plane_create_color_properties(struct drm_plane *plane,
  				      u32 supported_encodings,
  				      u32 supported_ranges,
  				      enum drm_color_encoding default_encoding,
  				      enum drm_color_range default_range);
f1e2f66ce   Daniel Vetter   drm: Extract drm_...
67
  #endif