Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa219a0d authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-intel-next-fixes-2015-04-15' of...

Merge tag 'drm-intel-next-fixes-2015-04-15' of git://anongit.freedesktop.org/drm-intel into drm-next

Misc i915 fixes.

* tag 'drm-intel-next-fixes-2015-04-15' of git://anongit.freedesktop.org/drm-intel:
  drm/i915: Dont enable CS_PARSER_ERROR interrupts at all
  drm/i915: Move drm_framebuffer_unreference out of struct_mutex for takeover
  drm/i915: Allocate connector state together with the connectors
  drm/i915/chv: Remove DPIO force latency causing interpair skew issue
  drm/i915: Don't cancel DRRS worker synchronously for flush/invalidate
  drm/i915: Fix locking in DRRS flush/invalidate hooks
parents 4a112488 37ef01ab
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -3598,14 +3598,12 @@ static int i8xx_irq_postinstall(struct drm_device *dev)
		~(I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |
		  I915_DISPLAY_PIPE_B_EVENT_INTERRUPT |
		  I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT |
		  I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT |
		  I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT);
		  I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT);
	I915_WRITE16(IMR, dev_priv->irq_mask);

	I915_WRITE16(IER,
		     I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |
		     I915_DISPLAY_PIPE_B_EVENT_INTERRUPT |
		     I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT |
		     I915_USER_INTERRUPT);
	POSTING_READ16(IER);

@@ -3767,14 +3765,12 @@ static int i915_irq_postinstall(struct drm_device *dev)
		  I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |
		  I915_DISPLAY_PIPE_B_EVENT_INTERRUPT |
		  I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT |
		  I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT |
		  I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT);
		  I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT);

	enable_mask =
		I915_ASLE_INTERRUPT |
		I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |
		I915_DISPLAY_PIPE_B_EVENT_INTERRUPT |
		I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT |
		I915_USER_INTERRUPT;

	if (I915_HAS_HOTPLUG(dev)) {
+1 −1
Original line number Diff line number Diff line
@@ -851,7 +851,7 @@ void intel_crt_init(struct drm_device *dev)
	if (!crt)
		return;

	intel_connector = kzalloc(sizeof(*intel_connector), GFP_KERNEL);
	intel_connector = intel_connector_alloc();
	if (!intel_connector) {
		kfree(crt);
		return;
+2 −2
Original line number Diff line number Diff line
@@ -2200,7 +2200,7 @@ intel_ddi_init_dp_connector(struct intel_digital_port *intel_dig_port)
	struct intel_connector *connector;
	enum port port = intel_dig_port->port;

	connector = kzalloc(sizeof(*connector), GFP_KERNEL);
	connector = intel_connector_alloc();
	if (!connector)
		return NULL;

@@ -2219,7 +2219,7 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port *intel_dig_port)
	struct intel_connector *connector;
	enum port port = intel_dig_port->port;

	connector = kzalloc(sizeof(*connector), GFP_KERNEL);
	connector = intel_connector_alloc();
	if (!connector)
		return NULL;

+36 −40
Original line number Diff line number Diff line
@@ -5636,6 +5636,34 @@ static void intel_connector_check_state(struct intel_connector *connector)
	}
}

int intel_connector_init(struct intel_connector *connector)
{
	struct drm_connector_state *connector_state;

	connector_state = kzalloc(sizeof *connector_state, GFP_KERNEL);
	if (!connector_state)
		return -ENOMEM;

	connector->base.state = connector_state;
	return 0;
}

struct intel_connector *intel_connector_alloc(void)
{
	struct intel_connector *connector;

	connector = kzalloc(sizeof *connector, GFP_KERNEL);
	if (!connector)
		return NULL;

	if (intel_connector_init(connector) < 0) {
		kfree(connector);
		return NULL;
	}

	return connector;
}

/* Even simpler default implementation, if there's really no special case to
 * consider. */
void intel_connector_dpms(struct drm_connector *connector, int mode)
@@ -13003,7 +13031,6 @@ static void intel_setup_outputs(struct drm_device *dev)
{
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct intel_encoder *encoder;
	struct drm_connector *connector;
	bool dpd_is_edp = false;

	intel_lvds_init(dev);
@@ -13139,39 +13166,6 @@ static void intel_setup_outputs(struct drm_device *dev)
	if (SUPPORTS_TV(dev))
		intel_tv_init(dev);

	/*
	 * FIXME:  We don't have full atomic support yet, but we want to be
	 * able to enable/test plane updates via the atomic interface in the
	 * meantime.  However as soon as we flip DRIVER_ATOMIC on, the DRM core
	 * will take some atomic codepaths to lookup properties during
	 * drmModeGetConnector() that unconditionally dereference
	 * connector->state.
	 *
	 * We create a dummy connector state here for each connector to ensure
	 * the DRM core doesn't try to dereference a NULL connector->state.
	 * The actual connector properties will never be updated or contain
	 * useful information, but since we're doing this specifically for
	 * testing/debug of the plane operations (and only when a specific
	 * kernel module option is given), that shouldn't really matter.
	 *
	 * We are also relying on these states to convert the legacy mode set
	 * to use a drm_atomic_state struct. The states are kept consistent
	 * with actual state, so that it is safe to rely on that instead of
	 * the staged config.
	 *
	 * Once atomic support for crtc's + connectors lands, this loop should
	 * be removed since we'll be setting up real connector state, which
	 * will contain Intel-specific properties.
	 */
	list_for_each_entry(connector,
			    &dev->mode_config.connector_list,
			    head) {
		if (!WARN_ON(connector->state)) {
			connector->state = kzalloc(sizeof(*connector->state),
						   GFP_KERNEL);
		}
	}

	intel_psr_init(dev);

	for_each_intel_encoder(dev, encoder) {
@@ -14265,6 +14259,7 @@ void intel_modeset_gem_init(struct drm_device *dev)
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct drm_crtc *c;
	struct drm_i915_gem_object *obj;
	int ret;

	mutex_lock(&dev->struct_mutex);
	intel_init_gt_powersave(dev);
@@ -14289,16 +14284,18 @@ void intel_modeset_gem_init(struct drm_device *dev)
	 * pinned & fenced.  When we do the allocation it's too early
	 * for this.
	 */
	mutex_lock(&dev->struct_mutex);
	for_each_crtc(dev, c) {
		obj = intel_fb_obj(c->primary->fb);
		if (obj == NULL)
			continue;

		if (intel_pin_and_fence_fb_obj(c->primary,
		mutex_lock(&dev->struct_mutex);
		ret = intel_pin_and_fence_fb_obj(c->primary,
						 c->primary->fb,
						 c->primary->state,
					       NULL)) {
						 NULL);
		mutex_unlock(&dev->struct_mutex);
		if (ret) {
			DRM_ERROR("failed to pin boot fb on pipe %d\n",
				  to_intel_crtc(c)->pipe);
			drm_framebuffer_unreference(c->primary->fb);
@@ -14306,7 +14303,6 @@ void intel_modeset_gem_init(struct drm_device *dev)
			update_state_fb(c->primary);
		}
	}
	mutex_unlock(&dev->struct_mutex);

	intel_backlight_register(dev);
}
+18 −15
Original line number Diff line number Diff line
@@ -2742,11 +2742,6 @@ static void chv_pre_enable_dp(struct intel_encoder *encoder)

	/* Program Tx lane latency optimal setting*/
	for (i = 0; i < 4; i++) {
		/* Set the latency optimal bit */
		data = (i == 1) ? 0x0 : 0x6;
		vlv_dpio_write(dev_priv, pipe, CHV_TX_DW11(ch, i),
				data << DPIO_FRC_LATENCY_SHFIT);

		/* Set the upar bit */
		data = (i == 1) ? 0x0 : 0x1;
		vlv_dpio_write(dev_priv, pipe, CHV_TX_DW14(ch, i),
@@ -5157,7 +5152,6 @@ static void intel_edp_drrs_downclock_work(struct work_struct *work)
			downclock_mode->vrefresh);

unlock:

	mutex_unlock(&dev_priv->drrs.mutex);
}

@@ -5179,12 +5173,17 @@ void intel_edp_drrs_invalidate(struct drm_device *dev,
	struct drm_crtc *crtc;
	enum pipe pipe;

	if (!dev_priv->drrs.dp)
	if (dev_priv->drrs.type == DRRS_NOT_SUPPORTED)
		return;

	cancel_delayed_work_sync(&dev_priv->drrs.work);
	cancel_delayed_work(&dev_priv->drrs.work);

	mutex_lock(&dev_priv->drrs.mutex);
	if (!dev_priv->drrs.dp) {
		mutex_unlock(&dev_priv->drrs.mutex);
		return;
	}

	crtc = dp_to_dig_port(dev_priv->drrs.dp)->base.base.crtc;
	pipe = to_intel_crtc(crtc)->pipe;

@@ -5218,12 +5217,17 @@ void intel_edp_drrs_flush(struct drm_device *dev,
	struct drm_crtc *crtc;
	enum pipe pipe;

	if (!dev_priv->drrs.dp)
	if (dev_priv->drrs.type == DRRS_NOT_SUPPORTED)
		return;

	cancel_delayed_work_sync(&dev_priv->drrs.work);
	cancel_delayed_work(&dev_priv->drrs.work);

	mutex_lock(&dev_priv->drrs.mutex);
	if (!dev_priv->drrs.dp) {
		mutex_unlock(&dev_priv->drrs.mutex);
		return;
	}

	crtc = dp_to_dig_port(dev_priv->drrs.dp)->base.base.crtc;
	pipe = to_intel_crtc(crtc)->pipe;
	dev_priv->drrs.busy_frontbuffer_bits &= ~frontbuffer_bits;
@@ -5294,6 +5298,9 @@ intel_dp_drrs_init(struct intel_connector *intel_connector,
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct drm_display_mode *downclock_mode = NULL;

	INIT_DELAYED_WORK(&dev_priv->drrs.work, intel_edp_drrs_downclock_work);
	mutex_init(&dev_priv->drrs.mutex);

	if (INTEL_INFO(dev)->gen <= 6) {
		DRM_DEBUG_KMS("DRRS supported for Gen7 and above\n");
		return NULL;
@@ -5312,10 +5319,6 @@ intel_dp_drrs_init(struct intel_connector *intel_connector,
		return NULL;
	}

	INIT_DELAYED_WORK(&dev_priv->drrs.work, intel_edp_drrs_downclock_work);

	mutex_init(&dev_priv->drrs.mutex);

	dev_priv->drrs.type = dev_priv->vbt.drrs_type;

	dev_priv->drrs.refresh_rate_type = DRRS_HIGH_RR;
@@ -5587,7 +5590,7 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port)
	if (!intel_dig_port)
		return;

	intel_connector = kzalloc(sizeof(*intel_connector), GFP_KERNEL);
	intel_connector = intel_connector_alloc();
	if (!intel_connector) {
		kfree(intel_dig_port);
		return;
Loading