Commit 3f751d65 authored by Jani Nikula's avatar Jani Nikula

drm/i915/dsi: stop using the drm_panel framework completely

Now that we've stopped using the drm_panel hooks, there aren't any
benefits left with using the drm_panel framework. Remove the rest of the
drm_panel use. No functional changes.
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarBob Paauwe <bob.j.paauwe@intel.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Cc: Madhav Chauhan <madhav.chauhan@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Bob Paauwe <bob.j.paauwe@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/6602e36641451952065092401bd6e6cfbe93e208.1488810382.git.jani.nikula@intel.com
parent b9e56754
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <drm/drm_crtc.h> #include <drm/drm_crtc.h>
#include <drm/drm_edid.h> #include <drm/drm_edid.h>
#include <drm/i915_drm.h> #include <drm/i915_drm.h>
#include <drm/drm_panel.h>
#include <drm/drm_mipi_dsi.h> #include <drm/drm_mipi_dsi.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
...@@ -1642,12 +1641,6 @@ static void intel_dsi_encoder_destroy(struct drm_encoder *encoder) ...@@ -1642,12 +1641,6 @@ static void intel_dsi_encoder_destroy(struct drm_encoder *encoder)
{ {
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
if (intel_dsi->panel) {
drm_panel_detach(intel_dsi->panel);
/* XXX: Logically this call belongs in the panel driver. */
drm_panel_remove(intel_dsi->panel);
}
/* dispose of the gpios */ /* dispose of the gpios */
if (intel_dsi->gpio_panel) if (intel_dsi->gpio_panel)
gpiod_put(intel_dsi->gpio_panel); gpiod_put(intel_dsi->gpio_panel);
...@@ -1805,8 +1798,7 @@ void intel_dsi_init(struct drm_i915_private *dev_priv) ...@@ -1805,8 +1798,7 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
intel_dsi->dsi_hosts[port] = host; intel_dsi->dsi_hosts[port] = host;
} }
intel_dsi->panel = intel_dsi_vbt_init(intel_dsi, MIPI_DSI_GENERIC_PANEL_ID); if (!intel_dsi_vbt_init(intel_dsi, MIPI_DSI_GENERIC_PANEL_ID)) {
if (!intel_dsi->panel) {
DRM_DEBUG_KMS("no device found\n"); DRM_DEBUG_KMS("no device found\n");
goto err; goto err;
} }
...@@ -1840,10 +1832,8 @@ void intel_dsi_init(struct drm_i915_private *dev_priv) ...@@ -1840,10 +1832,8 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
intel_connector_attach_encoder(intel_connector, intel_encoder); intel_connector_attach_encoder(intel_connector, intel_encoder);
drm_panel_attach(intel_dsi->panel, connector);
mutex_lock(&dev->mode_config.mutex); mutex_lock(&dev->mode_config.mutex);
intel_dsi_vbt_get_modes(intel_dsi->panel); intel_dsi_vbt_get_modes(intel_dsi);
list_for_each_entry(scan, &connector->probed_modes, head) { list_for_each_entry(scan, &connector->probed_modes, head) {
if ((scan->type & DRM_MODE_TYPE_PREFERRED)) { if ((scan->type & DRM_MODE_TYPE_PREFERRED)) {
fixed_mode = drm_mode_duplicate(dev, scan); fixed_mode = drm_mode_duplicate(dev, scan);
......
...@@ -39,7 +39,6 @@ struct intel_dsi_host; ...@@ -39,7 +39,6 @@ struct intel_dsi_host;
struct intel_dsi { struct intel_dsi {
struct intel_encoder base; struct intel_encoder base;
struct drm_panel *panel;
struct intel_dsi_host *dsi_hosts[I915_MAX_PORTS]; struct intel_dsi_host *dsi_hosts[I915_MAX_PORTS];
/* GPIO Desc for CRC based Panel control */ /* GPIO Desc for CRC based Panel control */
...@@ -146,8 +145,8 @@ u32 intel_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp, ...@@ -146,8 +145,8 @@ u32 intel_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp,
void intel_dsi_reset_clocks(struct intel_encoder *encoder, void intel_dsi_reset_clocks(struct intel_encoder *encoder,
enum port port); enum port port);
struct drm_panel *intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id); bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id);
int intel_dsi_vbt_get_modes(struct drm_panel *panel); int intel_dsi_vbt_get_modes(struct intel_dsi *intel_dsi);
enum mipi_dsi_pixel_format pixel_format_from_register_bits(u32 fmt); enum mipi_dsi_pixel_format pixel_format_from_register_bits(u32 fmt);
#endif /* _INTEL_DSI_H */ #endif /* _INTEL_DSI_H */
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <drm/drm_crtc.h> #include <drm/drm_crtc.h>
#include <drm/drm_edid.h> #include <drm/drm_edid.h>
#include <drm/i915_drm.h> #include <drm/i915_drm.h>
#include <drm/drm_panel.h>
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <video/mipi_display.h> #include <video/mipi_display.h>
...@@ -38,16 +37,6 @@ ...@@ -38,16 +37,6 @@
#include "intel_drv.h" #include "intel_drv.h"
#include "intel_dsi.h" #include "intel_dsi.h"
struct vbt_panel {
struct drm_panel panel;
struct intel_dsi *intel_dsi;
};
static inline struct vbt_panel *to_vbt_panel(struct drm_panel *panel)
{
return container_of(panel, struct vbt_panel, panel);
}
#define MIPI_TRANSFER_MODE_SHIFT 0 #define MIPI_TRANSFER_MODE_SHIFT 0
#define MIPI_VIRTUAL_CHANNEL_SHIFT 1 #define MIPI_VIRTUAL_CHANNEL_SHIFT 1
#define MIPI_PORT_SHIFT 3 #define MIPI_PORT_SHIFT 3
...@@ -492,36 +481,31 @@ void intel_dsi_exec_vbt_sequence(struct intel_dsi *intel_dsi, ...@@ -492,36 +481,31 @@ void intel_dsi_exec_vbt_sequence(struct intel_dsi *intel_dsi,
} }
} }
int intel_dsi_vbt_get_modes(struct drm_panel *panel) int intel_dsi_vbt_get_modes(struct intel_dsi *intel_dsi)
{ {
struct vbt_panel *vbt_panel = to_vbt_panel(panel); struct intel_connector *connector = intel_dsi->attached_connector;
struct intel_dsi *intel_dsi = vbt_panel->intel_dsi;
struct drm_device *dev = intel_dsi->base.base.dev; struct drm_device *dev = intel_dsi->base.base.dev;
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_display_mode *mode; struct drm_display_mode *mode;
if (!panel->connector)
return 0;
mode = drm_mode_duplicate(dev, dev_priv->vbt.lfp_lvds_vbt_mode); mode = drm_mode_duplicate(dev, dev_priv->vbt.lfp_lvds_vbt_mode);
if (!mode) if (!mode)
return 0; return 0;
mode->type |= DRM_MODE_TYPE_PREFERRED; mode->type |= DRM_MODE_TYPE_PREFERRED;
drm_mode_probed_add(panel->connector, mode); drm_mode_probed_add(&connector->base, mode);
return 1; return 1;
} }
struct drm_panel *intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id) bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
{ {
struct drm_device *dev = intel_dsi->base.base.dev; struct drm_device *dev = intel_dsi->base.base.dev;
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
struct mipi_config *mipi_config = dev_priv->vbt.dsi.config; struct mipi_config *mipi_config = dev_priv->vbt.dsi.config;
struct mipi_pps_data *pps = dev_priv->vbt.dsi.pps; struct mipi_pps_data *pps = dev_priv->vbt.dsi.pps;
struct drm_display_mode *mode = dev_priv->vbt.lfp_lvds_vbt_mode; struct drm_display_mode *mode = dev_priv->vbt.lfp_lvds_vbt_mode;
struct vbt_panel *vbt_panel;
u32 bpp; u32 bpp;
u32 tlpx_ns, extra_byte_count, bitrate, tlpx_ui; u32 tlpx_ns, extra_byte_count, bitrate, tlpx_ui;
u32 ui_num, ui_den; u32 ui_num, ui_den;
...@@ -584,7 +568,7 @@ struct drm_panel *intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id) ...@@ -584,7 +568,7 @@ struct drm_panel *intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
if (mipi_config->target_burst_mode_freq < if (mipi_config->target_burst_mode_freq <
computed_ddr) { computed_ddr) {
DRM_ERROR("Burst mode freq is less than computed\n"); DRM_ERROR("Burst mode freq is less than computed\n");
return NULL; return false;
} }
burst_mode_ratio = DIV_ROUND_UP( burst_mode_ratio = DIV_ROUND_UP(
...@@ -594,7 +578,7 @@ struct drm_panel *intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id) ...@@ -594,7 +578,7 @@ struct drm_panel *intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
pclk = DIV_ROUND_UP(pclk * burst_mode_ratio, 100); pclk = DIV_ROUND_UP(pclk * burst_mode_ratio, 100);
} else { } else {
DRM_ERROR("Burst mode target is not set\n"); DRM_ERROR("Burst mode target is not set\n");
return NULL; return false;
} }
} else } else
burst_mode_ratio = 100; burst_mode_ratio = 100;
...@@ -805,19 +789,10 @@ struct drm_panel *intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id) ...@@ -805,19 +789,10 @@ struct drm_panel *intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
intel_dsi->panel_off_delay = pps->panel_off_delay / 10; intel_dsi->panel_off_delay = pps->panel_off_delay / 10;
intel_dsi->panel_pwr_cycle_delay = pps->panel_power_cycle_delay / 10; intel_dsi->panel_pwr_cycle_delay = pps->panel_power_cycle_delay / 10;
/* This is cheating a bit with the cleanup. */
vbt_panel = devm_kzalloc(dev->dev, sizeof(*vbt_panel), GFP_KERNEL);
if (!vbt_panel)
return NULL;
vbt_panel->intel_dsi = intel_dsi;
drm_panel_init(&vbt_panel->panel);
drm_panel_add(&vbt_panel->panel);
/* a regular driver would get the device in probe */ /* a regular driver would get the device in probe */
for_each_dsi_port(port, intel_dsi->ports) { for_each_dsi_port(port, intel_dsi->ports) {
mipi_dsi_attach(intel_dsi->dsi_hosts[port]->device); mipi_dsi_attach(intel_dsi->dsi_hosts[port]->device);
} }
return &vbt_panel->panel; return true;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment