aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dsi.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dsi.h')
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.h69
1 files changed, 16 insertions, 53 deletions
diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
index 8fe2064dd804..2784ac442368 100644
--- a/drivers/gpu/drm/i915/intel_dsi.h
+++ b/drivers/gpu/drm/i915/intel_dsi.h
@@ -26,6 +26,7 @@
26 26
27#include <drm/drmP.h> 27#include <drm/drmP.h>
28#include <drm/drm_crtc.h> 28#include <drm/drm_crtc.h>
29#include <drm/drm_mipi_dsi.h>
29#include "intel_drv.h" 30#include "intel_drv.h"
30 31
31/* Dual Link support */ 32/* Dual Link support */
@@ -33,53 +34,13 @@
33#define DSI_DUAL_LINK_FRONT_BACK 1 34#define DSI_DUAL_LINK_FRONT_BACK 1
34#define DSI_DUAL_LINK_PIXEL_ALT 2 35#define DSI_DUAL_LINK_PIXEL_ALT 2
35 36
36struct intel_dsi_device { 37struct intel_dsi_host;
37 unsigned int panel_id;
38 const char *name;
39 const struct intel_dsi_dev_ops *dev_ops;
40 void *dev_priv;
41};
42
43struct intel_dsi_dev_ops {
44 bool (*init)(struct intel_dsi_device *dsi);
45
46 void (*panel_reset)(struct intel_dsi_device *dsi);
47
48 void (*disable_panel_power)(struct intel_dsi_device *dsi);
49
50 /* one time programmable commands if needed */
51 void (*send_otp_cmds)(struct intel_dsi_device *dsi);
52
53 /* This callback must be able to assume DSI commands can be sent */
54 void (*enable)(struct intel_dsi_device *dsi);
55
56 /* This callback must be able to assume DSI commands can be sent */
57 void (*disable)(struct intel_dsi_device *dsi);
58
59 int (*mode_valid)(struct intel_dsi_device *dsi,
60 struct drm_display_mode *mode);
61
62 bool (*mode_fixup)(struct intel_dsi_device *dsi,
63 const struct drm_display_mode *mode,
64 struct drm_display_mode *adjusted_mode);
65
66 void (*mode_set)(struct intel_dsi_device *dsi,
67 struct drm_display_mode *mode,
68 struct drm_display_mode *adjusted_mode);
69
70 enum drm_connector_status (*detect)(struct intel_dsi_device *dsi);
71
72 bool (*get_hw_state)(struct intel_dsi_device *dev);
73
74 struct drm_display_mode *(*get_modes)(struct intel_dsi_device *dsi);
75
76 void (*destroy) (struct intel_dsi_device *dsi);
77};
78 38
79struct intel_dsi { 39struct intel_dsi {
80 struct intel_encoder base; 40 struct intel_encoder base;
81 41
82 struct intel_dsi_device dev; 42 struct drm_panel *panel;
43 struct intel_dsi_host *dsi_hosts[I915_MAX_PORTS];
83 44
84 struct intel_connector *attached_connector; 45 struct intel_connector *attached_connector;
85 46
@@ -137,16 +98,18 @@ struct intel_dsi {
137 u16 panel_pwr_cycle_delay; 98 u16 panel_pwr_cycle_delay;
138}; 99};
139 100
140/* XXX: Transitional before dual port configuration */ 101struct intel_dsi_host {
141static inline enum port intel_dsi_pipe_to_port(enum pipe pipe) 102 struct mipi_dsi_host base;
142{ 103 struct intel_dsi *intel_dsi;
143 if (pipe == PIPE_A) 104 enum port port;
144 return PORT_A; 105
145 else if (pipe == PIPE_B) 106 /* our little hack */
146 return PORT_C; 107 struct mipi_dsi_device *device;
108};
147 109
148 WARN(1, "DSI on pipe %c, assuming port C\n", pipe_name(pipe)); 110static inline struct intel_dsi_host *to_intel_dsi_host(struct mipi_dsi_host *h)
149 return PORT_C; 111{
112 return container_of(h, struct intel_dsi_host, base);
150} 113}
151 114
152#define for_each_dsi_port(__port, __ports_mask) \ 115#define for_each_dsi_port(__port, __ports_mask) \
@@ -162,6 +125,6 @@ extern void vlv_enable_dsi_pll(struct intel_encoder *encoder);
162extern void vlv_disable_dsi_pll(struct intel_encoder *encoder); 125extern void vlv_disable_dsi_pll(struct intel_encoder *encoder);
163extern u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp); 126extern u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp);
164 127
165extern struct intel_dsi_dev_ops vbt_generic_dsi_display_ops; 128struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id);
166 129
167#endif /* _INTEL_DSI_H */ 130#endif /* _INTEL_DSI_H */