Ajay Singh Parmar | 7766887 | 2017-03-28 21:36:15 -0700 | [diff] [blame] | 1 | /* |
Narender Ankam | 1afbd17 | 2020-03-16 17:27:44 +0530 | [diff] [blame] | 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. |
Ajay Singh Parmar | 7766887 | 2017-03-28 21:36:15 -0700 | [diff] [blame] | 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 and |
| 6 | * only version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | #ifndef _DP_DISPLAY_H_ |
| 16 | #define _DP_DISPLAY_H_ |
| 17 | |
| 18 | #include <drm/drmP.h> |
Ajay Singh Parmar | 9c842d4 | 2017-09-21 13:02:05 -0700 | [diff] [blame] | 19 | #include <drm/msm_drm.h> |
Ajay Singh Parmar | 7766887 | 2017-03-28 21:36:15 -0700 | [diff] [blame] | 20 | |
| 21 | #include "dp_panel.h" |
| 22 | |
Ajay Singh Parmar | 7766887 | 2017-03-28 21:36:15 -0700 | [diff] [blame] | 23 | struct dp_display { |
| 24 | struct drm_device *drm_dev; |
| 25 | struct dp_bridge *bridge; |
Padmanabhan Komanduru | d84b38b | 2017-05-24 04:24:57 -0700 | [diff] [blame] | 26 | struct drm_connector *connector; |
| 27 | bool is_connected; |
Narender Ankam | 96d7054 | 2019-12-12 14:42:59 +0530 | [diff] [blame] | 28 | bool is_primary; |
Padmanabhan Komanduru | d5eae9d | 2017-06-22 19:23:36 +0530 | [diff] [blame] | 29 | u32 max_pclk_khz; |
Narender Ankam | b6e39e5 | 2019-12-25 21:48:19 +0530 | [diff] [blame] | 30 | bool yuv_support; |
Ajay Singh Parmar | 7766887 | 2017-03-28 21:36:15 -0700 | [diff] [blame] | 31 | |
| 32 | int (*enable)(struct dp_display *dp_display); |
| 33 | int (*post_enable)(struct dp_display *dp_display); |
| 34 | |
| 35 | int (*pre_disable)(struct dp_display *dp_display); |
| 36 | int (*disable)(struct dp_display *dp_display); |
| 37 | |
| 38 | int (*set_mode)(struct dp_display *dp_display, |
| 39 | struct dp_display_mode *mode); |
Narender Ankam | de42624 | 2019-12-23 20:54:31 +0530 | [diff] [blame] | 40 | int (*validate_mode)(struct dp_display *dp_display, |
| 41 | u32 mode_pclk_khz, u32 flags); |
Padmanabhan Komanduru | fdafc41 | 2017-09-11 13:13:38 +0530 | [diff] [blame] | 42 | int (*get_modes)(struct dp_display *dp_display, |
| 43 | struct dp_display_mode *dp_mode); |
Narender Ankam | de42624 | 2019-12-23 20:54:31 +0530 | [diff] [blame] | 44 | int (*get_dc_support)(struct dp_display *dp_display, |
| 45 | u32 mode_pclk_khz, u32 out_format, bool dc_enable); |
Ajay Singh Parmar | 7766887 | 2017-03-28 21:36:15 -0700 | [diff] [blame] | 46 | int (*prepare)(struct dp_display *dp_display); |
| 47 | int (*unprepare)(struct dp_display *dp_display); |
Padmanabhan Komanduru | 15e757d | 2017-05-24 04:07:31 -0700 | [diff] [blame] | 48 | int (*request_irq)(struct dp_display *dp_display); |
Samantha Tran | 2d1ed73 | 2017-07-31 17:30:14 -0700 | [diff] [blame] | 49 | struct dp_debug *(*get_debug)(struct dp_display *dp_display); |
Ajay Singh Parmar | 315e585 | 2017-11-23 21:47:32 -0800 | [diff] [blame] | 50 | void (*post_open)(struct dp_display *dp_display); |
Ajay Singh Parmar | 87af50b | 2017-12-22 22:22:55 -0800 | [diff] [blame] | 51 | int (*config_hdr)(struct dp_display *dp_display, |
Ajay Singh Parmar | 9c842d4 | 2017-09-21 13:02:05 -0700 | [diff] [blame] | 52 | struct drm_msm_ext_hdr_metadata *hdr_meta); |
Ajay Singh Parmar | 315e585 | 2017-11-23 21:47:32 -0800 | [diff] [blame] | 53 | void (*post_init)(struct dp_display *dp_display); |
Narender Ankam | 96d7054 | 2019-12-12 14:42:59 +0530 | [diff] [blame] | 54 | int (*get_display_type)(struct dp_display *dp_display, |
| 55 | const char **display_type); |
Narender Ankam | 71580a0 | 2019-12-27 14:43:29 +0530 | [diff] [blame^] | 56 | bool (*vsc_sdp_supported)(struct dp_display *dp_display); |
Ajay Singh Parmar | 7766887 | 2017-03-28 21:36:15 -0700 | [diff] [blame] | 57 | }; |
| 58 | |
Padmanabhan Komanduru | 6375861 | 2017-05-23 01:47:18 -0700 | [diff] [blame] | 59 | int dp_display_get_num_of_displays(void); |
| 60 | int dp_display_get_displays(void **displays, int count); |
Chirag Khurana | ce2aa51 | 2019-11-20 18:27:03 +0530 | [diff] [blame] | 61 | bool dp_connector_mode_needs_full_range(void *display); |
Narender Ankam | 1afbd17 | 2020-03-16 17:27:44 +0530 | [diff] [blame] | 62 | enum sde_csc_type dp_connector_get_csc_type(struct drm_connector *conn, |
| 63 | void *data); |
Ajay Singh Parmar | 7766887 | 2017-03-28 21:36:15 -0700 | [diff] [blame] | 64 | #endif /* _DP_DISPLAY_H_ */ |