static int intel_dsi_get_modes(struct drm_connector *connector)
{
	struct intel_connector *intel_connector = to_intel_connector(connector);
	struct intel_dsi *intel_dsi = intel_attached_dsi(connector);
	struct drm_display_mode *mode;
	struct drm_display_mode *input_mode = NULL;
	DRM_DEBUG_KMS("\n");

	if (!intel_connector->panel.fixed_mode) {
		DRM_DEBUG_KMS("no fixed mode\n");
		return 0;
	}

	input_mode = intel_connector->panel.fixed_mode;
	mode = drm_mode_duplicate(connector->dev,
				  input_mode);
	if (!mode) {
		DRM_DEBUG_KMS("drm_mode_duplicate failed\n");
		return 0;
	}

	drm_mode_probed_add(connector, mode);
	/*Fill the panel info here*/
	intel_dsi->dev.dev_ops->get_info(0, connector);
	return 1;
}
Exemplo n.º 2
0
static enum drm_connector_status
intel_dsi_detect(struct drm_connector *connector, bool force)
{
	struct intel_dsi *intel_dsi = intel_attached_dsi(connector);
	DRM_DEBUG_KMS("\n");
	return intel_dsi->dev.dev_ops->detect(&intel_dsi->dev);
}
static int intel_dsi_set_property(struct drm_connector *connector,
		struct drm_property *property,
		uint64_t val)
{
	struct intel_dsi *intel_dsi = intel_attached_dsi(connector);
	struct drm_i915_private *dev_priv = connector->dev->dev_private;
	struct intel_connector *intel_connector = to_intel_connector(connector);
	struct intel_encoder *encoder = intel_connector->encoder;
	struct intel_crtc *intel_crtc = encoder->new_crtc;
	int ret;

	ret = drm_object_property_set_value(&connector->base, property, val);
	if (ret)
		return ret;

	if (property == dev_priv->force_pfit_property) {

		if (intel_connector->panel.fitting_mode == val)
			return 0;

		intel_connector->panel.fitting_mode = val;

		if (IS_VALLEYVIEW(dev_priv->dev)) {

			/* In case of BYT_CR platform with the panasonic panel of
			 * resolution 19x10, panel fitter needs to be enabled always
			 * becoz we simulate the 12x8 mode due to memory limitation
			 */
			if ((dev_priv->scaling_reqd) ||
			(BYT_CR_CONFIG && (i915_mipi_panel_id ==
				MIPI_DSI_PANASONIC_VXX09F006A00_PANEL_ID))) {
				if (intel_connector->panel.fitting_mode == PFIT_OFF)
					return 0;
			}

			intel_gmch_panel_fitting(intel_crtc, &intel_crtc->config,
				intel_connector->panel.fitting_mode);
			DRM_DEBUG_DRIVER("panel fitting mode = %x", intel_connector->panel.fitting_mode);
			return 0;
		} else
			goto done;
	}

	if (property == dev_priv->scaling_src_size_property) {
		intel_crtc->scaling_src_size = val;
		DRM_DEBUG_DRIVER("src size = %x", intel_crtc->scaling_src_size);
		return 0;
	}
done:
	if (intel_dsi->base.base.crtc)
		intel_crtc_restore_mode(intel_dsi->base.base.crtc);
	return 0;
}
Exemplo n.º 4
0
static enum drm_connector_status
intel_dsi_detect(struct drm_connector *connector, bool force)
{
	struct intel_dsi *intel_dsi = intel_attached_dsi(connector);
	struct intel_encoder *intel_encoder = &intel_dsi->base;
	enum intel_display_power_domain power_domain;
	enum drm_connector_status connector_status;
	struct drm_i915_private *dev_priv = intel_encoder->base.dev->dev_private;

	DRM_DEBUG_KMS("\n");
	power_domain = intel_display_port_power_domain(intel_encoder);

	intel_display_power_get(dev_priv, power_domain);
	connector_status = intel_dsi->dev.dev_ops->detect(&intel_dsi->dev);
	intel_display_power_put(dev_priv, power_domain);

	return connector_status;
}
static int intel_dsi_set_property(struct drm_connector *connector,
		struct drm_property *property,
		uint64_t val)
{
	struct intel_dsi *intel_dsi = intel_attached_dsi(connector);
	struct drm_i915_private *dev_priv = connector->dev->dev_private;
	struct intel_connector *intel_connector = to_intel_connector(connector);
	struct intel_encoder *encoder = intel_connector->encoder;
	struct intel_crtc *intel_crtc = encoder->new_crtc;
	int ret;

	ret = drm_object_property_set_value(&connector->base, property, val);
	if (ret)
		return ret;

	if (property == dev_priv->force_pfit_property) {

		if (intel_connector->panel.fitting_mode == val)
			return 0;

		intel_connector->panel.fitting_mode = val;

		if (IS_VALLEYVIEW(dev_priv->dev)) {
			intel_gmch_panel_fitting(intel_crtc, &intel_crtc->config,
				intel_connector->panel.fitting_mode);
			DRM_DEBUG_DRIVER("panel fitting mode = %x", intel_connector->panel.fitting_mode);
			return 0;
		} else
			goto done;
	}

	if (property == dev_priv->scaling_src_size_property) {
		intel_crtc->scaling_src_size = val;
		DRM_DEBUG_DRIVER("src size = %x", intel_crtc->scaling_src_size);
		return 0;
	}
done:
	if (intel_dsi->base.base.crtc)
		intel_crtc_restore_mode(intel_dsi->base.base.crtc);
	return 0;
}
static int intel_dsi_mode_valid(struct drm_connector *connector,
				struct drm_display_mode *mode)
{
	struct intel_connector *intel_connector = to_intel_connector(connector);
	struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;
	struct intel_dsi *intel_dsi = intel_attached_dsi(connector);

	DRM_DEBUG_KMS("\n");

	if (mode->flags & DRM_MODE_FLAG_DBLSCAN) {
		DRM_DEBUG_KMS("MODE_NO_DBLESCAN\n");
		return MODE_NO_DBLESCAN;
	}

	if (fixed_mode) {
		if (mode->hdisplay > fixed_mode->hdisplay)
			return MODE_PANEL;
		if (mode->vdisplay > fixed_mode->vdisplay)
			return MODE_PANEL;
	}

	return intel_dsi->dev.dev_ops->mode_valid(&intel_dsi->dev, mode);
}
static enum drm_connector_status
intel_dsi_detect(struct drm_connector *connector, bool force)
{
    struct intel_dsi *intel_dsi = intel_attached_dsi(connector);
    DRM_DEBUG_KMS("\n");

#ifndef BYT_DUAL_MIPI_DSI
    //intel_panel_setup_backlight moved to intel_dsi_init
    return intel_dsi->dev.dev_ops->detect(&intel_dsi->dev);
#else
	if (i915_enable_dummy_dsi) {
		return  connector_status_connected;
	}

   
      mutex_lock(&dual_display_status.dual_display_mutex);

   	//printk("dual display status :%d",dual_display_status.pipeb_status );
    if (( dual_display_status.pipeb_status == PIPE_ON_PROCESSING )||
			( dual_display_status.pipeb_status == PIPE_ON ))
      {			
	 mutex_unlock(&dual_display_status.dual_display_mutex);
         return intel_dsi->dev.dev_ops->detect(&intel_dsi->dev);
     }
    if (( dual_display_status.pipeb_status == PIPE_OFF_PROCESSING )||
			( dual_display_status.pipeb_status == PIPE_OFF ))
   {
   	mutex_unlock(&dual_display_status.dual_display_mutex);
         return  connector_status_disconnected;
   }
    else  {
        mutex_unlock(&dual_display_status.dual_display_mutex);
        return  connector_status_disconnected;
    }
#endif

}