Gopikrishnaiah Anandan | e0e5e0c | 2016-05-25 11:05:33 -0700 | [diff] [blame] | 1 | /* 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 Anandan | 5154c71 | 2017-02-27 17:48:24 -0800 | [diff] [blame] | 18 | struct sde_irq_callback; |
| 19 | |
Benet Clark | d009b1d | 2016-06-27 14:45:59 -0700 | [diff] [blame] | 20 | /* |
| 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 | */ |
| 26 | enum sde_memcolor_type { |
| 27 | MEMCOLOR_SKIN = 0, |
| 28 | MEMCOLOR_SKY, |
| 29 | MEMCOLOR_FOLIAGE |
| 30 | }; |
| 31 | |
Gopikrishnaiah Anandan | e0e5e0c | 2016-05-25 11:05:33 -0700 | [diff] [blame] | 32 | /** |
| 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 | */ |
| 37 | void 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 | */ |
| 45 | void 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 | */ |
| 53 | void 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 | */ |
| 63 | int 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 | */ |
| 72 | void 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 | */ |
| 83 | int sde_cp_crtc_get_property(struct drm_crtc *crtc, |
| 84 | struct drm_property *property, uint64_t *val); |
Gopikrishnaiah Anandan | 7f6ef94 | 2016-06-20 15:50:00 -0700 | [diff] [blame] | 85 | |
| 86 | /** |
| 87 | * sde_cp_crtc_suspend: Suspend the crtc features |
| 88 | * @crtc: Pointer to crtc. |
| 89 | */ |
| 90 | void 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 | */ |
| 96 | void sde_cp_crtc_resume(struct drm_crtc *crtc); |
Gopikrishnaiah Anandan | 5154c71 | 2017-02-27 17:48:24 -0800 | [diff] [blame] | 97 | |
| 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 | */ |
| 104 | int sde_cp_ad_interrupt(struct drm_crtc *crtc, bool en, |
| 105 | struct sde_irq_callback *irq); |
Gopikrishnaiah Anandan | e0e5e0c | 2016-05-25 11:05:33 -0700 | [diff] [blame] | 106 | #endif /*_SDE_COLOR_PROCESSING_H */ |