Ajay Singh Parmar | 0d6250b | 2017-04-02 14:08:51 -0700 | [diff] [blame] | 1 | /* |
Narender Ankam | 96d7054 | 2019-12-12 14:42:59 +0530 | [diff] [blame^] | 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. |
Ajay Singh Parmar | 0d6250b | 2017-04-02 14:08:51 -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_DRM_H_ |
| 16 | #define _DP_DRM_H_ |
| 17 | |
| 18 | #include <linux/types.h> |
| 19 | #include <drm/drmP.h> |
| 20 | #include <drm/drm_crtc.h> |
| 21 | #include <drm/drm_crtc_helper.h> |
| 22 | |
| 23 | #include "msm_drv.h" |
| 24 | #include "dp_display.h" |
| 25 | |
| 26 | struct dp_bridge { |
| 27 | struct drm_bridge base; |
| 28 | u32 id; |
| 29 | |
| 30 | struct dp_display *display; |
| 31 | struct dp_display_mode dp_mode; |
| 32 | }; |
| 33 | |
| 34 | /** |
Ajay Singh Parmar | 87af50b | 2017-12-22 22:22:55 -0800 | [diff] [blame] | 35 | * dp_connector_config_hdr - callback to configure HDR |
Ajay Singh Parmar | 9c842d4 | 2017-09-21 13:02:05 -0700 | [diff] [blame] | 36 | * @display: Pointer to private display handle |
Ajay Singh Parmar | 87af50b | 2017-12-22 22:22:55 -0800 | [diff] [blame] | 37 | * @c_state: connect state data |
Ajay Singh Parmar | 9c842d4 | 2017-09-21 13:02:05 -0700 | [diff] [blame] | 38 | * Returns: Zero on success |
| 39 | */ |
Ajay Singh Parmar | 87af50b | 2017-12-22 22:22:55 -0800 | [diff] [blame] | 40 | int dp_connector_config_hdr(void *display, |
| 41 | struct sde_connector_state *c_state); |
Ajay Singh Parmar | 9c842d4 | 2017-09-21 13:02:05 -0700 | [diff] [blame] | 42 | |
| 43 | /** |
Ajay Singh Parmar | 0d6250b | 2017-04-02 14:08:51 -0700 | [diff] [blame] | 44 | * dp_connector_post_init - callback to perform additional initialization steps |
| 45 | * @connector: Pointer to drm connector structure |
Ajay Singh Parmar | 0d6250b | 2017-04-02 14:08:51 -0700 | [diff] [blame] | 46 | * @display: Pointer to private display handle |
| 47 | * Returns: Zero on success |
| 48 | */ |
Alan Kwong | 769fba9 | 2017-11-13 16:50:36 -0500 | [diff] [blame] | 49 | int dp_connector_post_init(struct drm_connector *connector, void *display); |
Ajay Singh Parmar | 0d6250b | 2017-04-02 14:08:51 -0700 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * dp_connector_detect - callback to determine if connector is connected |
| 53 | * @connector: Pointer to drm connector structure |
| 54 | * @force: Force detect setting from drm framework |
| 55 | * @display: Pointer to private display handle |
| 56 | * Returns: Connector 'is connected' status |
| 57 | */ |
| 58 | enum drm_connector_status dp_connector_detect(struct drm_connector *conn, |
| 59 | bool force, |
| 60 | void *display); |
| 61 | |
| 62 | /** |
| 63 | * dp_connector_get_modes - callback to add drm modes via drm_mode_probed_add() |
| 64 | * @connector: Pointer to drm connector structure |
| 65 | * @display: Pointer to private display handle |
| 66 | * Returns: Number of modes added |
| 67 | */ |
| 68 | int dp_connector_get_modes(struct drm_connector *connector, |
| 69 | void *display); |
| 70 | |
| 71 | /** |
| 72 | * dp_connector_mode_valid - callback to determine if specified mode is valid |
| 73 | * @connector: Pointer to drm connector structure |
| 74 | * @mode: Pointer to drm mode structure |
| 75 | * @display: Pointer to private display handle |
| 76 | * Returns: Validity status for specified mode |
| 77 | */ |
| 78 | enum drm_mode_status dp_connector_mode_valid(struct drm_connector *connector, |
| 79 | struct drm_display_mode *mode, |
| 80 | void *display); |
| 81 | |
Tatenda Chipeperekwa | 9f2abe1 | 2017-05-25 12:06:22 -0700 | [diff] [blame] | 82 | /** |
Jeykumar Sankaran | 446a5f1 | 2017-05-09 20:30:39 -0700 | [diff] [blame] | 83 | * dp_connector_get_mode_info - retrieve information of the mode selected |
Tatenda Chipeperekwa | 9f2abe1 | 2017-05-25 12:06:22 -0700 | [diff] [blame] | 84 | * @drm_mode: Display mode set for the display |
Jeykumar Sankaran | 446a5f1 | 2017-05-09 20:30:39 -0700 | [diff] [blame] | 85 | * @mode_info: Out parameter. Information of the mode |
Tatenda Chipeperekwa | 9f2abe1 | 2017-05-25 12:06:22 -0700 | [diff] [blame] | 86 | * @max_mixer_width: max width supported by HW layer mixer |
Alan Kwong | b1bca60 | 2017-09-18 17:28:45 -0400 | [diff] [blame] | 87 | * @display: Pointer to private display structure |
Tatenda Chipeperekwa | 9f2abe1 | 2017-05-25 12:06:22 -0700 | [diff] [blame] | 88 | * Returns: zero on success |
| 89 | */ |
Jeykumar Sankaran | 446a5f1 | 2017-05-09 20:30:39 -0700 | [diff] [blame] | 90 | int dp_connector_get_mode_info(const struct drm_display_mode *drm_mode, |
| 91 | struct msm_mode_info *mode_info, |
Alan Kwong | b1bca60 | 2017-09-18 17:28:45 -0400 | [diff] [blame] | 92 | u32 max_mixer_width, void *display); |
Tatenda Chipeperekwa | 9f2abe1 | 2017-05-25 12:06:22 -0700 | [diff] [blame] | 93 | |
Ajay Singh Parmar | 0d6250b | 2017-04-02 14:08:51 -0700 | [diff] [blame] | 94 | int dp_connector_get_info(struct msm_display_info *info, void *display); |
| 95 | |
Ajay Singh Parmar | 315e585 | 2017-11-23 21:47:32 -0800 | [diff] [blame] | 96 | /** |
| 97 | * dp_connector_post_open - handle the post open functionalites |
| 98 | * @display: Pointer to private display structure |
| 99 | */ |
| 100 | void dp_connector_post_open(void *display); |
Padmanabhan Komanduru | 71aec2d | 2017-08-30 20:07:59 +0530 | [diff] [blame] | 101 | |
Narender Ankam | 96d7054 | 2019-12-12 14:42:59 +0530 | [diff] [blame^] | 102 | /** |
| 103 | * dp_conn_set_info_blob - callback to perform info blob initialization |
| 104 | * @connector: Pointer to drm connector structure |
| 105 | * @info: Pointer to sde connector info structure |
| 106 | * @display: Pointer to private display handle |
| 107 | * @mode_info: Pointer to mode info structure |
| 108 | * Returns: Zero on success |
| 109 | */ |
| 110 | int dp_connnector_set_info_blob(struct drm_connector *connector, |
| 111 | void *info, void *display, struct msm_mode_info *mode_info); |
| 112 | |
Ajay Singh Parmar | 0d6250b | 2017-04-02 14:08:51 -0700 | [diff] [blame] | 113 | int dp_drm_bridge_init(void *display, |
| 114 | struct drm_encoder *encoder); |
| 115 | |
| 116 | void dp_drm_bridge_deinit(void *display); |
| 117 | #endif /* _DP_DRM_H_ */ |
| 118 | |