blob: 08e345d27d61392179a22f58156c538a508c5c62 [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
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -070032/**
33 * sde_cp_crtc_init(): Initialize color processing lists for a crtc.
34 * Should be called during crtc initialization.
35 * @crtc: Pointer to sde_crtc.
36 */
37void sde_cp_crtc_init(struct drm_crtc *crtc);
38
39/**
40 * sde_cp_crtc_install_properties(): Installs the color processing
41 * properties for a crtc.
42 * Should be called during crtc initialization.
43 * @crtc: Pointer to crtc.
44 */
45void sde_cp_crtc_install_properties(struct drm_crtc *crtc);
46
47/**
48 * sde_cp_crtc_destroy_properties: Destroys color processing
49 * properties for a crtc.
50 * should be called during crtc de-initialization.
51 * @crtc: Pointer to crtc.
52 */
53void sde_cp_crtc_destroy_properties(struct drm_crtc *crtc);
54
55/**
56 * sde_cp_crtc_set_property: Set a color processing property
57 * for a crtc.
58 * Should be during atomic set property.
59 * @crtc: Pointer to crtc.
60 * @property: Property that needs to enabled/disabled.
61 * @val: Value of property.
62 */
63int sde_cp_crtc_set_property(struct drm_crtc *crtc,
64 struct drm_property *property, uint64_t val);
65
66/**
67 * sde_cp_crtc_apply_properties: Enable/disable properties
68 * for a crtc.
69 * Should be called during atomic commit call.
70 * @crtc: Pointer to crtc.
71 */
72void sde_cp_crtc_apply_properties(struct drm_crtc *crtc);
73
74/**
75 * sde_cp_crtc_get_property: Get value of color processing property
76 * for a crtc.
77 * Should be during atomic get property.
78 * @crtc: Pointer to crtc.
79 * @property: Property that needs to enabled/disabled.
80 * @val: Value of property.
81 *
82 */
83int sde_cp_crtc_get_property(struct drm_crtc *crtc,
84 struct drm_property *property, uint64_t *val);
Gopikrishnaiah Anandan7f6ef942016-06-20 15:50:00 -070085
86/**
87 * sde_cp_crtc_suspend: Suspend the crtc features
88 * @crtc: Pointer to crtc.
89 */
90void sde_cp_crtc_suspend(struct drm_crtc *crtc);
91
92/**
93 * sde_cp_crtc_resume: Resume the crtc features
94 * @crtc: Pointer to crtc.
95 */
96void sde_cp_crtc_resume(struct drm_crtc *crtc);
Gopikrishnaiah Anandan5154c712017-02-27 17:48:24 -080097
98/**
99 * sde_cp_ad_interrupt: Api to enable/disable ad interrupt
100 * @crtc: Pointer to crtc.
101 * @en: Variable to enable/disable interrupt.
102 * @irq: Pointer to irq callback
103 */
104int sde_cp_ad_interrupt(struct drm_crtc *crtc, bool en,
105 struct sde_irq_callback *irq);
Ping Lie505f3b2017-06-19 14:19:08 -0700106
107/**
108 * sde_cp_crtc_pre_ipc: Handle color processing features
109 * before entering IPC
110 * @crtc: Pointer to crtc.
111 */
112void sde_cp_crtc_pre_ipc(struct drm_crtc *crtc);
113
114/**
115 * sde_cp_crtc_post_ipc: Handle color processing features
116 * after exiting IPC
117 * @crtc: Pointer to crtc.
118 */
119void sde_cp_crtc_post_ipc(struct drm_crtc *crtc);
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -0700120#endif /*_SDE_COLOR_PROCESSING_H */