aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2015-01-16 07:27:20 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-27 03:51:13 -0500
commit36d21f4c557a2b18ed7c9d254060d4ca07a6c5c7 (patch)
tree577ad53b0b1672c316f7e43c83f8476d3aa57a74
parent7f6a6a4a19f236ba068a2501f7ee0acc26051cac (diff)
drm/i915/dsi: remove unnecessary dsi device callbacks
Remove all the trivial and/or dummy callbacks from intel dsi device ops. Merge send_otp_cmds into panel_reset as they're called back to back. This will be helpful for switching to use drm_panel for the callbacks. If we ever need the additional callbacks, we should add them to drm_panel funcs. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-By: Shobhit Kumar <shobhit.kumar@intel.com> [danvet: Resolve tiny conflict with ongoing atomic work.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.c32
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.h20
-rw-r--r--drivers/gpu/drm/i915/intel_dsi_panel_vbt.c45
3 files changed, 5 insertions, 92 deletions
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 973222788c41..c56c4150fc13 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -70,12 +70,6 @@ static void band_gap_reset(struct drm_i915_private *dev_priv)
70 mutex_unlock(&dev_priv->dpio_lock); 70 mutex_unlock(&dev_priv->dpio_lock);
71} 71}
72 72
73static struct intel_dsi *intel_attached_dsi(struct drm_connector *connector)
74{
75 return container_of(intel_attached_encoder(connector),
76 struct intel_dsi, base);
77}
78
79static inline bool is_vid_mode(struct intel_dsi *intel_dsi) 73static inline bool is_vid_mode(struct intel_dsi *intel_dsi)
80{ 74{
81 return intel_dsi->operation_mode == INTEL_DSI_VIDEO_MODE; 75 return intel_dsi->operation_mode == INTEL_DSI_VIDEO_MODE;
@@ -99,7 +93,6 @@ static bool intel_dsi_compute_config(struct intel_encoder *encoder,
99 struct intel_connector *intel_connector = intel_dsi->attached_connector; 93 struct intel_connector *intel_connector = intel_dsi->attached_connector;
100 struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode; 94 struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;
101 struct drm_display_mode *adjusted_mode = &config->base.adjusted_mode; 95 struct drm_display_mode *adjusted_mode = &config->base.adjusted_mode;
102 struct drm_display_mode *mode = &config->base.mode;
103 96
104 DRM_DEBUG_KMS("\n"); 97 DRM_DEBUG_KMS("\n");
105 98
@@ -109,10 +102,6 @@ static bool intel_dsi_compute_config(struct intel_encoder *encoder,
109 /* DSI uses short packets for sync events, so clear mode flags for DSI */ 102 /* DSI uses short packets for sync events, so clear mode flags for DSI */
110 adjusted_mode->flags = 0; 103 adjusted_mode->flags = 0;
111 104
112 if (intel_dsi->dev.dev_ops->mode_fixup)
113 return intel_dsi->dev.dev_ops->mode_fixup(&intel_dsi->dev,
114 mode, adjusted_mode);
115
116 return true; 105 return true;
117} 106}
118 107
@@ -269,9 +258,6 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)
269 if (intel_dsi->dev.dev_ops->panel_reset) 258 if (intel_dsi->dev.dev_ops->panel_reset)
270 intel_dsi->dev.dev_ops->panel_reset(&intel_dsi->dev); 259 intel_dsi->dev.dev_ops->panel_reset(&intel_dsi->dev);
271 260
272 if (intel_dsi->dev.dev_ops->send_otp_cmds)
273 intel_dsi->dev.dev_ops->send_otp_cmds(&intel_dsi->dev);
274
275 for_each_dsi_port(port, intel_dsi->ports) 261 for_each_dsi_port(port, intel_dsi->ports)
276 wait_for_dsi_fifo_empty(intel_dsi, port); 262 wait_for_dsi_fifo_empty(intel_dsi, port);
277 263
@@ -484,7 +470,6 @@ intel_dsi_mode_valid(struct drm_connector *connector,
484{ 470{
485 struct intel_connector *intel_connector = to_intel_connector(connector); 471 struct intel_connector *intel_connector = to_intel_connector(connector);
486 struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode; 472 struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;
487 struct intel_dsi *intel_dsi = intel_attached_dsi(connector);
488 473
489 DRM_DEBUG_KMS("\n"); 474 DRM_DEBUG_KMS("\n");
490 475
@@ -500,7 +485,7 @@ intel_dsi_mode_valid(struct drm_connector *connector,
500 return MODE_PANEL; 485 return MODE_PANEL;
501 } 486 }
502 487
503 return intel_dsi->dev.dev_ops->mode_valid(&intel_dsi->dev, mode); 488 return MODE_OK;
504} 489}
505 490
506/* return txclkesc cycles in terms of divider and duration in us */ 491/* return txclkesc cycles in terms of divider and duration in us */
@@ -749,20 +734,7 @@ static void intel_dsi_pre_pll_enable(struct intel_encoder *encoder)
749static enum drm_connector_status 734static enum drm_connector_status
750intel_dsi_detect(struct drm_connector *connector, bool force) 735intel_dsi_detect(struct drm_connector *connector, bool force)
751{ 736{
752 struct intel_dsi *intel_dsi = intel_attached_dsi(connector); 737 return connector_status_connected;
753 struct intel_encoder *intel_encoder = &intel_dsi->base;
754 enum intel_display_power_domain power_domain;
755 enum drm_connector_status connector_status;
756 struct drm_i915_private *dev_priv = intel_encoder->base.dev->dev_private;
757
758 DRM_DEBUG_KMS("\n");
759 power_domain = intel_display_port_power_domain(intel_encoder);
760
761 intel_display_power_get(dev_priv, power_domain);
762 connector_status = intel_dsi->dev.dev_ops->detect(&intel_dsi->dev);
763 intel_display_power_put(dev_priv, power_domain);
764
765 return connector_status;
766} 738}
767 739
768static int intel_dsi_get_modes(struct drm_connector *connector) 740static int intel_dsi_get_modes(struct drm_connector *connector)
diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
index 2bb8c46c7889..22f87036a256 100644
--- a/drivers/gpu/drm/i915/intel_dsi.h
+++ b/drivers/gpu/drm/i915/intel_dsi.h
@@ -47,33 +47,13 @@ struct intel_dsi_dev_ops {
47 47
48 void (*disable_panel_power)(struct intel_dsi_device *dsi); 48 void (*disable_panel_power)(struct intel_dsi_device *dsi);
49 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 */ 50 /* This callback must be able to assume DSI commands can be sent */
54 void (*enable)(struct intel_dsi_device *dsi); 51 void (*enable)(struct intel_dsi_device *dsi);
55 52
56 /* This callback must be able to assume DSI commands can be sent */ 53 /* This callback must be able to assume DSI commands can be sent */
57 void (*disable)(struct intel_dsi_device *dsi); 54 void (*disable)(struct intel_dsi_device *dsi);
58 55
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); 56 struct drm_display_mode *(*get_modes)(struct intel_dsi_device *dsi);
75
76 void (*destroy) (struct intel_dsi_device *dsi);
77}; 57};
78 58
79struct intel_dsi { 59struct intel_dsi {
diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
index 5493aef5a6a3..b0e7327a485f 100644
--- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
+++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
@@ -559,18 +559,6 @@ static bool generic_init(struct intel_dsi_device *dsi)
559 return true; 559 return true;
560} 560}
561 561
562static int generic_mode_valid(struct intel_dsi_device *dsi,
563 struct drm_display_mode *mode)
564{
565 return MODE_OK;
566}
567
568static bool generic_mode_fixup(struct intel_dsi_device *dsi,
569 const struct drm_display_mode *mode,
570 struct drm_display_mode *adjusted_mode) {
571 return true;
572}
573
574static void generic_panel_reset(struct intel_dsi_device *dsi) 562static void generic_panel_reset(struct intel_dsi_device *dsi)
575{ 563{
576 struct intel_dsi *intel_dsi = container_of(dsi, struct intel_dsi, dev); 564 struct intel_dsi *intel_dsi = container_of(dsi, struct intel_dsi, dev);
@@ -580,26 +568,18 @@ static void generic_panel_reset(struct intel_dsi_device *dsi)
580 char *sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_ASSERT_RESET]; 568 char *sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_ASSERT_RESET];
581 569
582 generic_exec_sequence(intel_dsi, sequence); 570 generic_exec_sequence(intel_dsi, sequence);
583}
584
585static void generic_disable_panel_power(struct intel_dsi_device *dsi)
586{
587 struct intel_dsi *intel_dsi = container_of(dsi, struct intel_dsi, dev);
588 struct drm_device *dev = intel_dsi->base.base.dev;
589 struct drm_i915_private *dev_priv = dev->dev_private;
590
591 char *sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_DEASSERT_RESET];
592 571
572 sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP];
593 generic_exec_sequence(intel_dsi, sequence); 573 generic_exec_sequence(intel_dsi, sequence);
594} 574}
595 575
596static void generic_send_otp_cmds(struct intel_dsi_device *dsi) 576static void generic_disable_panel_power(struct intel_dsi_device *dsi)
597{ 577{
598 struct intel_dsi *intel_dsi = container_of(dsi, struct intel_dsi, dev); 578 struct intel_dsi *intel_dsi = container_of(dsi, struct intel_dsi, dev);
599 struct drm_device *dev = intel_dsi->base.base.dev; 579 struct drm_device *dev = intel_dsi->base.base.dev;
600 struct drm_i915_private *dev_priv = dev->dev_private; 580 struct drm_i915_private *dev_priv = dev->dev_private;
601 581
602 char *sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP]; 582 char *sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_DEASSERT_RESET];
603 583
604 generic_exec_sequence(intel_dsi, sequence); 584 generic_exec_sequence(intel_dsi, sequence);
605} 585}
@@ -626,16 +606,6 @@ static void generic_disable(struct intel_dsi_device *dsi)
626 generic_exec_sequence(intel_dsi, sequence); 606 generic_exec_sequence(intel_dsi, sequence);
627} 607}
628 608
629static enum drm_connector_status generic_detect(struct intel_dsi_device *dsi)
630{
631 return connector_status_connected;
632}
633
634static bool generic_get_hw_state(struct intel_dsi_device *dev)
635{
636 return true;
637}
638
639static struct drm_display_mode *generic_get_modes(struct intel_dsi_device *dsi) 609static struct drm_display_mode *generic_get_modes(struct intel_dsi_device *dsi)
640{ 610{
641 struct intel_dsi *intel_dsi = container_of(dsi, struct intel_dsi, dev); 611 struct intel_dsi *intel_dsi = container_of(dsi, struct intel_dsi, dev);
@@ -646,20 +616,11 @@ static struct drm_display_mode *generic_get_modes(struct intel_dsi_device *dsi)
646 return dev_priv->vbt.lfp_lvds_vbt_mode; 616 return dev_priv->vbt.lfp_lvds_vbt_mode;
647} 617}
648 618
649static void generic_destroy(struct intel_dsi_device *dsi) { }
650
651/* Callbacks. We might not need them all. */
652struct intel_dsi_dev_ops vbt_generic_dsi_display_ops = { 619struct intel_dsi_dev_ops vbt_generic_dsi_display_ops = {
653 .init = generic_init, 620 .init = generic_init,
654 .mode_valid = generic_mode_valid,
655 .mode_fixup = generic_mode_fixup,
656 .panel_reset = generic_panel_reset, 621 .panel_reset = generic_panel_reset,
657 .disable_panel_power = generic_disable_panel_power, 622 .disable_panel_power = generic_disable_panel_power,
658 .send_otp_cmds = generic_send_otp_cmds,
659 .enable = generic_enable, 623 .enable = generic_enable,
660 .disable = generic_disable, 624 .disable = generic_disable,
661 .detect = generic_detect,
662 .get_hw_state = generic_get_hw_state,
663 .get_modes = generic_get_modes, 625 .get_modes = generic_get_modes,
664 .destroy = generic_destroy,
665}; 626};