blob: 533bc6c869d6d696dad8c72fe45cb9fe400a505c [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;
Padmanabhan Komandurud5eae9d2017-06-22 19:23:36 +053028 u32 max_pclk_khz;
Ajay Singh Parmar77668872017-03-28 21:36:15 -070029
30 int (*enable)(struct dp_display *dp_display);
31 int (*post_enable)(struct dp_display *dp_display);
32
33 int (*pre_disable)(struct dp_display *dp_display);
34 int (*disable)(struct dp_display *dp_display);
35
36 int (*set_mode)(struct dp_display *dp_display,
37 struct dp_display_mode *mode);
Narender Ankamde426242019-12-23 20:54:31 +053038 int (*validate_mode)(struct dp_display *dp_display,
39 u32 mode_pclk_khz, u32 flags);
Padmanabhan Komandurufdafc412017-09-11 13:13:38 +053040 int (*get_modes)(struct dp_display *dp_display,
41 struct dp_display_mode *dp_mode);
Narender Ankamde426242019-12-23 20:54:31 +053042 int (*get_dc_support)(struct dp_display *dp_display,
43 u32 mode_pclk_khz, u32 out_format, bool dc_enable);
Ajay Singh Parmar77668872017-03-28 21:36:15 -070044 int (*prepare)(struct dp_display *dp_display);
45 int (*unprepare)(struct dp_display *dp_display);
Padmanabhan Komanduru15e757d2017-05-24 04:07:31 -070046 int (*request_irq)(struct dp_display *dp_display);
Samantha Tran2d1ed732017-07-31 17:30:14 -070047 struct dp_debug *(*get_debug)(struct dp_display *dp_display);
Ajay Singh Parmar315e5852017-11-23 21:47:32 -080048 void (*post_open)(struct dp_display *dp_display);
Ajay Singh Parmar87af50b2017-12-22 22:22:55 -080049 int (*config_hdr)(struct dp_display *dp_display,
Ajay Singh Parmar9c842d42017-09-21 13:02:05 -070050 struct drm_msm_ext_hdr_metadata *hdr_meta);
Ajay Singh Parmar315e5852017-11-23 21:47:32 -080051 void (*post_init)(struct dp_display *dp_display);
Ajay Singh Parmar77668872017-03-28 21:36:15 -070052};
53
Padmanabhan Komanduru63758612017-05-23 01:47:18 -070054int dp_display_get_num_of_displays(void);
55int dp_display_get_displays(void **displays, int count);
Chirag Khuranace2aa512019-11-20 18:27:03 +053056bool dp_connector_mode_needs_full_range(void *display);
Narender Ankam1afbd172020-03-16 17:27:44 +053057enum sde_csc_type dp_connector_get_csc_type(struct drm_connector *conn,
58 void *data);
Ajay Singh Parmar77668872017-03-28 21:36:15 -070059#endif /* _DP_DISPLAY_H_ */