blob: aff07efa751e384deb1ff1977d802dffc692c143 [file] [log] [blame]
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -07001/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#ifndef _SDE_COLOR_PROCESSING_H
15#define _SDE_COLOR_PROCESSING_H
16#include <drm/drm_crtc.h>
17
Gopikrishnaiah Anandan5154c712017-02-27 17:48:24 -080018struct sde_irq_callback;
19
Benet Clarkd009b1d2016-06-27 14:45:59 -070020/*
21 * PA MEMORY COLOR types
22 * @MEMCOLOR_SKIN Skin memory color type
23 * @MEMCOLOR_SKY Sky memory color type
24 * @MEMCOLOR_FOLIAGE Foliage memory color type
25 */
26enum sde_memcolor_type {
27 MEMCOLOR_SKIN = 0,
28 MEMCOLOR_SKY,
29 MEMCOLOR_FOLIAGE
30};
31
Xu Yang056d39b2017-07-11 16:34:13 +080032/*
33 * PA HISTOGRAM modes
34 * @HIST_DISABLED Histogram disabled
35 * @HIST_ENABLED Histogram enabled
36 */
37enum sde_hist_modes {
38 HIST_DISABLED,
39 HIST_ENABLED
40};
41
42/**
43 * struct drm_prop_enum_list - drm structure for creating enum property and
44 * enumerating values
45 */
46static const struct drm_prop_enum_list sde_hist_modes[] = {
47 {HIST_DISABLED, "hist_off"},
48 {HIST_ENABLED, "hist_on"},
49};
50
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -070051/**
52 * sde_cp_crtc_init(): Initialize color processing lists for a crtc.
53 * Should be called during crtc initialization.
54 * @crtc: Pointer to sde_crtc.
55 */
56void sde_cp_crtc_init(struct drm_crtc *crtc);
57
58/**
59 * sde_cp_crtc_install_properties(): Installs the color processing
60 * properties for a crtc.
61 * Should be called during crtc initialization.
62 * @crtc: Pointer to crtc.
63 */
64void sde_cp_crtc_install_properties(struct drm_crtc *crtc);
65
66/**
67 * sde_cp_crtc_destroy_properties: Destroys color processing
68 * properties for a crtc.
69 * should be called during crtc de-initialization.
70 * @crtc: Pointer to crtc.
71 */
72void sde_cp_crtc_destroy_properties(struct drm_crtc *crtc);
73
74/**
75 * sde_cp_crtc_set_property: Set a color processing property
76 * for a crtc.
77 * Should be during atomic set property.
78 * @crtc: Pointer to crtc.
79 * @property: Property that needs to enabled/disabled.
80 * @val: Value of property.
81 */
82int sde_cp_crtc_set_property(struct drm_crtc *crtc,
83 struct drm_property *property, uint64_t val);
84
85/**
86 * sde_cp_crtc_apply_properties: Enable/disable properties
87 * for a crtc.
88 * Should be called during atomic commit call.
89 * @crtc: Pointer to crtc.
90 */
91void sde_cp_crtc_apply_properties(struct drm_crtc *crtc);
92
93/**
94 * sde_cp_crtc_get_property: Get value of color processing property
95 * for a crtc.
96 * Should be during atomic get property.
97 * @crtc: Pointer to crtc.
98 * @property: Property that needs to enabled/disabled.
99 * @val: Value of property.
100 *
101 */
102int sde_cp_crtc_get_property(struct drm_crtc *crtc,
103 struct drm_property *property, uint64_t *val);
Gopikrishnaiah Anandan7f6ef942016-06-20 15:50:00 -0700104
105/**
106 * sde_cp_crtc_suspend: Suspend the crtc features
107 * @crtc: Pointer to crtc.
108 */
109void sde_cp_crtc_suspend(struct drm_crtc *crtc);
110
111/**
112 * sde_cp_crtc_resume: Resume the crtc features
113 * @crtc: Pointer to crtc.
114 */
115void sde_cp_crtc_resume(struct drm_crtc *crtc);
Gopikrishnaiah Anandan5154c712017-02-27 17:48:24 -0800116
117/**
118 * sde_cp_ad_interrupt: Api to enable/disable ad interrupt
119 * @crtc: Pointer to crtc.
120 * @en: Variable to enable/disable interrupt.
121 * @irq: Pointer to irq callback
122 */
123int sde_cp_ad_interrupt(struct drm_crtc *crtc, bool en,
124 struct sde_irq_callback *irq);
Ping Lie505f3b2017-06-19 14:19:08 -0700125
126/**
127 * sde_cp_crtc_pre_ipc: Handle color processing features
128 * before entering IPC
129 * @crtc: Pointer to crtc.
130 */
131void sde_cp_crtc_pre_ipc(struct drm_crtc *crtc);
132
133/**
134 * sde_cp_crtc_post_ipc: Handle color processing features
135 * after exiting IPC
136 * @crtc: Pointer to crtc.
137 */
138void sde_cp_crtc_post_ipc(struct drm_crtc *crtc);
Xu Yang5e53c2e2017-07-11 16:46:28 +0800139
140/**
141 * sde_cp_hist_interrupt: Api to enable/disable histogram interrupt
142 * @crtc: Pointer to crtc.
143 * @en: Variable to enable/disable interrupt.
144 * @irq: Pointer to irq callback
145 */
146int sde_cp_hist_interrupt(struct drm_crtc *crtc_drm, bool en,
147 struct sde_irq_callback *hist_irq);
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -0700148#endif /*_SDE_COLOR_PROCESSING_H */