blob: 922df7e755aec45c40c49520b56842bde05a5d99 [file] [log] [blame]
Ajay Singh Parmar77668872017-03-28 21:36:15 -07001/*
Narender Ankam1afbd172020-03-16 17:27:44 +05302 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
Ajay Singh Parmar77668872017-03-28 21:36:15 -07003 *
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 Parmar9c842d42017-09-21 13:02:05 -070019#include <drm/msm_drm.h>
Ajay Singh Parmar77668872017-03-28 21:36:15 -070020
21#include "dp_panel.h"
22
Ajay Singh Parmar77668872017-03-28 21:36:15 -070023struct dp_display {
24 struct drm_device *drm_dev;
25 struct dp_bridge *bridge;
Padmanabhan Komandurud84b38b2017-05-24 04:24:57 -070026 struct drm_connector *connector;
27 bool is_connected;
Narender Ankam96d70542019-12-12 14:42:59 +053028 bool is_primary;
Padmanabhan Komandurud5eae9d2017-06-22 19:23:36 +053029 u32 max_pclk_khz;
Narender Ankamb6e39e52019-12-25 21:48:19 +053030 bool yuv_support;
Ajay Singh Parmar77668872017-03-28 21:36:15 -070031
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 Ankamde426242019-12-23 20:54:31 +053040 int (*validate_mode)(struct dp_display *dp_display,
41 u32 mode_pclk_khz, u32 flags);
Padmanabhan Komandurufdafc412017-09-11 13:13:38 +053042 int (*get_modes)(struct dp_display *dp_display,
43 struct dp_display_mode *dp_mode);
Narender Ankamde426242019-12-23 20:54:31 +053044 int (*get_dc_support)(struct dp_display *dp_display,
45 u32 mode_pclk_khz, u32 out_format, bool dc_enable);
Ajay Singh Parmar77668872017-03-28 21:36:15 -070046 int (*prepare)(struct dp_display *dp_display);
47 int (*unprepare)(struct dp_display *dp_display);
Padmanabhan Komanduru15e757d2017-05-24 04:07:31 -070048 int (*request_irq)(struct dp_display *dp_display);
Samantha Tran2d1ed732017-07-31 17:30:14 -070049 struct dp_debug *(*get_debug)(struct dp_display *dp_display);
Ajay Singh Parmar315e5852017-11-23 21:47:32 -080050 void (*post_open)(struct dp_display *dp_display);
Ajay Singh Parmar87af50b2017-12-22 22:22:55 -080051 int (*config_hdr)(struct dp_display *dp_display,
Ajay Singh Parmar9c842d42017-09-21 13:02:05 -070052 struct drm_msm_ext_hdr_metadata *hdr_meta);
Ajay Singh Parmar315e5852017-11-23 21:47:32 -080053 void (*post_init)(struct dp_display *dp_display);
Narender Ankam96d70542019-12-12 14:42:59 +053054 int (*get_display_type)(struct dp_display *dp_display,
55 const char **display_type);
Narender Ankam71580a02019-12-27 14:43:29 +053056 bool (*vsc_sdp_supported)(struct dp_display *dp_display);
Ajay Singh Parmar77668872017-03-28 21:36:15 -070057};
58
Padmanabhan Komanduru63758612017-05-23 01:47:18 -070059int dp_display_get_num_of_displays(void);
60int dp_display_get_displays(void **displays, int count);
Chirag Khuranace2aa512019-11-20 18:27:03 +053061bool dp_connector_mode_needs_full_range(void *display);
Narender Ankam1afbd172020-03-16 17:27:44 +053062enum sde_csc_type dp_connector_get_csc_type(struct drm_connector *conn,
63 void *data);
Ajay Singh Parmar77668872017-03-28 21:36:15 -070064#endif /* _DP_DISPLAY_H_ */