XenevaOS
Loading...
Searching...
No Matches
drm_colorop.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
22 *
23 * Authors: AMD
24 *
25 */
26
27#ifndef __DRM_COLOROP_H__
28#define __DRM_COLOROP_H__
29
30#include <drm/drm_mode_object.h>
31#include <drm/drm_mode.h>
32#include <drm/drm_property.h>
33
34/* DRM colorop flags */
35#define DRM_COLOROP_FLAG_ALLOW_BYPASS (1<<0) /* Allow bypass on the drm_colorop */
36
136
143
144 /*
145 * Color properties
146 *
147 * The following fields are not always valid, their usage depends
148 * on the colorop type. See their associated comment for more
149 * information.
150 */
151
159 bool bypass;
160
167
174
185
192
199
202};
203
214 void (*destroy)(struct drm_colorop *colorop);
215};
216
231
240
245 unsigned int index;
246
249
257
267
268 /*
269 * Color properties
270 *
271 * The following fields are not always valid, their usage depends
272 * on the colorop type. See their associated comment for more
273 * information.
274 */
275
278
286
294
302
315
322
329
336
343
350
357
368
375
378};
379
380#define obj_to_colorop(x) container_of(x, struct drm_colorop, base)
381
392static inline struct drm_colorop *drm_colorop_find(struct drm_device *dev,
393 struct drm_file *file_priv,
394 uint32_t id)
395{
396 struct drm_mode_object *mo;
397
399 return mo ? obj_to_colorop(mo) : NULL;
400}
401
403void drm_colorop_cleanup(struct drm_colorop *colorop);
404
406 struct drm_plane *plane, const struct drm_colorop_funcs *funcs,
407 u64 supported_tfs, uint32_t flags);
409 struct drm_plane *plane,
410 const struct drm_colorop_funcs *funcs,
411 uint32_t lut_size,
412 enum drm_colorop_lut1d_interpolation_type interpolation,
415 struct drm_plane *plane, const struct drm_colorop_funcs *funcs,
418 struct drm_plane *plane, const struct drm_colorop_funcs *funcs,
421 struct drm_plane *plane, const struct drm_colorop_funcs *funcs,
422 uint32_t lut_size,
423 enum drm_colorop_lut3d_interpolation_type interpolation,
425
426struct drm_colorop_state *
428
430 struct drm_colorop_state *state);
431
440
442
450static inline unsigned int drm_colorop_index(const struct drm_colorop *colorop)
451{
452 return colorop->index;
453}
454
455#define drm_for_each_colorop(colorop, dev) \
456 list_for_each_entry(colorop, &(dev)->mode_config.colorop_list, head)
457
466
475
476const char *
478
479const char *
481
483
484#endif /* __DRM_COLOROP_H__ */
uint8_t flags
Definition virtio.h:0
unsigned int uint32_t
Definition acefiex.h:163
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
#define NULL
Definition actypes.h:561
drm_colorop_type
Definition drm_mode.h:883
drm_colorop_lut1d_interpolation_type
Definition drm_mode.h:973
#define DRM_MODE_OBJECT_COLOROP
Definition drm_mode.h:621
drm_colorop_lut3d_interpolation_type
Definition drm_mode.h:961
size_t size_t const struct drm_bridge_funcs * funcs
Definition drm_bridge.h:1300
void drm_colorop_reset(struct drm_colorop *colorop)
const char * drm_get_colorop_type_name(enum drm_colorop_type type)
drm_colorop_curve_1d_type
Definition drm_colorop.h:42
@ DRM_COLOROP_1D_CURVE_PQ_125_EOTF
Definition drm_colorop.h:77
@ DRM_COLOROP_1D_CURVE_GAMMA22
Definition drm_colorop.h:119
@ DRM_COLOROP_1D_CURVE_BT2020_INV_OETF
Definition drm_colorop.h:95
@ DRM_COLOROP_1D_CURVE_COUNT
Definition drm_colorop.h:134
@ DRM_COLOROP_1D_CURVE_SRGB_EOTF
Definition drm_colorop.h:53
@ DRM_COLOROP_1D_CURVE_GAMMA22_INV
Definition drm_colorop.h:128
@ DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF
Definition drm_colorop.h:86
@ DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF
Definition drm_colorop.h:62
@ DRM_COLOROP_1D_CURVE_BT2020_OETF
Definition drm_colorop.h:109
#define obj_to_colorop(x)
Definition drm_colorop.h:380
int drm_plane_colorop_mult_init(struct drm_device *dev, struct drm_colorop *colorop, struct drm_plane *plane, const struct drm_colorop_funcs *funcs, uint32_t flags)
const char * drm_get_colorop_lut3d_interpolation_name(enum drm_colorop_lut3d_interpolation_type type)
int drm_plane_colorop_ctm_3x4_init(struct drm_device *dev, struct drm_colorop *colorop, struct drm_plane *plane, const struct drm_colorop_funcs *funcs, uint32_t flags)
const char * drm_get_colorop_lut1d_interpolation_name(enum drm_colorop_lut1d_interpolation_type type)
void drm_colorop_destroy(struct drm_colorop *colorop)
void drm_colorop_cleanup(struct drm_colorop *colorop)
int drm_plane_colorop_curve_1d_init(struct drm_device *dev, struct drm_colorop *colorop, struct drm_plane *plane, const struct drm_colorop_funcs *funcs, u64 supported_tfs, uint32_t flags)
void drm_colorop_atomic_destroy_state(struct drm_colorop *colorop, struct drm_colorop_state *state)
struct drm_colorop_state * drm_atomic_helper_colorop_duplicate_state(struct drm_colorop *colorop)
void drm_colorop_pipeline_destroy(struct drm_device *dev)
int drm_plane_colorop_3dlut_init(struct drm_device *dev, struct drm_colorop *colorop, struct drm_plane *plane, const struct drm_colorop_funcs *funcs, uint32_t lut_size, enum drm_colorop_lut3d_interpolation_type interpolation, uint32_t flags)
void drm_colorop_set_next_property(struct drm_colorop *colorop, struct drm_colorop *next)
int drm_plane_colorop_curve_1d_lut_init(struct drm_device *dev, struct drm_colorop *colorop, struct drm_plane *plane, const struct drm_colorop_funcs *funcs, uint32_t lut_size, enum drm_colorop_lut1d_interpolation_type interpolation, uint32_t flags)
const char * drm_get_colorop_curve_1d_type_name(enum drm_colorop_curve_1d_type type)
struct drm_mode_object * drm_mode_object_find(struct drm_device *dev, struct drm_file *file_priv, uint32_t id, uint32_t type)
struct drm_plane * plane
Definition drm_plane.h:828
const struct device * dev
Definition drm_print.h:519
uint64_t u64
Definition kernel.h:17
int const struct list_head const struct list_head struct list_head * head
Definition list_sort.h:13
Definition drm_atomic.h:480
Definition drm_colorop.h:207
void(* destroy)(struct drm_colorop *colorop)
Definition drm_colorop.h:214
Definition drm_colorop.h:140
struct drm_atomic_commit * state
Definition drm_colorop.h:201
uint64_t multiplier
Definition drm_colorop.h:173
enum drm_colorop_lut3d_interpolation_type lut3d_interpolation
Definition drm_colorop.h:198
enum drm_colorop_curve_1d_type curve_1d_type
Definition drm_colorop.h:166
bool bypass
Definition drm_colorop.h:159
struct drm_property_blob * data
Definition drm_colorop.h:184
enum drm_colorop_lut1d_interpolation_type lut1d_interpolation
Definition drm_colorop.h:191
struct drm_colorop * colorop
Definition drm_colorop.h:142
Definition drm_colorop.h:228
struct drm_plane * plane
Definition drm_colorop.h:256
enum drm_colorop_type type
Definition drm_colorop.h:285
struct drm_property * type_property
Definition drm_colorop.h:301
const struct drm_colorop_funcs * funcs
Definition drm_colorop.h:377
struct drm_colorop_state * state
Definition drm_colorop.h:266
struct drm_property * lut3d_interpolation_property
Definition drm_colorop.h:356
struct drm_device * dev
Definition drm_colorop.h:230
struct drm_property * curve_1d_type_property
Definition drm_colorop.h:335
struct drm_property * data_property
Definition drm_colorop.h:367
struct drm_property * next_property
Definition drm_colorop.h:374
struct drm_object_properties properties
Definition drm_colorop.h:277
struct drm_property * size_property
Definition drm_colorop.h:349
struct drm_colorop * next
Definition drm_colorop.h:293
struct drm_property * multiplier_property
Definition drm_colorop.h:342
struct drm_property * lut1d_interpolation_property
Definition drm_colorop.h:328
uint32_t size
Definition drm_colorop.h:321
unsigned int index
Definition drm_colorop.h:245
struct drm_property * bypass_property
Definition drm_colorop.h:314
struct drm_mode_object base
Definition drm_colorop.h:248
Definition drm_device.h:75
Definition drm_file.h:165
Definition drm_mode_object.h:55
Definition drm_mode_object.h:67
Definition drm_plane.h:641
Definition drm_property.h:216
Definition drm_property.h:80
Definition list.h:11
#define state(x)