LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2019-05-22 23:58 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2019-05-22 23:58 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Ramalingam C,
	Uma Shankar, Ville Syrjälä

[-- Attachment #1: Type: text/plain, Size: 1569 bytes --]

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  include/drm/drm_mode_config.h

between commit:

  585b000de23b ("drm: move content protection property to mode_config")

from the drm-intel tree and commit:

  fbb5d0353c62 ("drm: Add HDR source metadata property")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/drm/drm_mode_config.h
index 5764ee3c7453,c031b5a9d8d1..000000000000
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@@ -836,12 -836,13 +836,19 @@@ struct drm_mode_config 
  	 */
  	struct drm_property *writeback_out_fence_ptr_property;
  
 +	/**
 +	 * @content_protection_property: DRM ENUM property for content
 +	 * protection. See drm_connector_attach_content_protection_property().
 +	 */
 +	struct drm_property *content_protection_property;
 +
+ 	/**
+ 	 * hdr_output_metadata_property: Connector property containing hdr
+ 	 * metatda. This will be provided by userspace compositors based
+ 	 * on HDR content
+ 	 */
+ 	struct drm_property *hdr_output_metadata_property;
+ 
  	/* dumb ioctl parameters */
  	uint32_t preferred_depth, prefer_shadow;
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2020-09-22  3:34 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2020-09-22  3:34 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi
  Cc: Chris Wilson, Linux Next Mailing List, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 2558 bytes --]

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/selftests/mock_gem_device.c

between commit:

  9f9f4101fc98 ("drm/i915/selftests: Push the fake iommu device from the stack to data")

from the drm-intel tree and commit:

  cd01269d11a3 ("drm/i915/selftests: align more to real device lifetimes")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/selftests/mock_gem_device.c
index 397c313a8b69,c207d2239791..000000000000
--- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
@@@ -118,12 -116,11 +116,11 @@@ static struct dev_pm_domain pm_domain 
  
  struct drm_i915_private *mock_gem_device(void)
  {
 -	struct drm_i915_private *i915;
 -	struct pci_dev *pdev;
  #if IS_ENABLED(CONFIG_IOMMU_API) && defined(CONFIG_INTEL_IOMMU)
 -	struct dev_iommu iommu;
 +	static struct dev_iommu fake_iommu = { .priv = (void *)-1 };
  #endif
 +	struct drm_i915_private *i915;
 +	struct pci_dev *pdev;
- 	int err;
  
  	pdev = kzalloc(sizeof(*pdev), GFP_KERNEL);
  	if (!pdev)
@@@ -141,11 -132,28 +132,26 @@@
  	dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
  
  #if IS_ENABLED(CONFIG_IOMMU_API) && defined(CONFIG_INTEL_IOMMU)
 -	/* HACK HACK HACK to disable iommu for the fake device; force identity mapping */
 -	memset(&iommu, 0, sizeof(iommu));
 -	iommu.priv = (void *)-1;
 -	pdev->dev.iommu = &iommu;
 +	/* HACK to disable iommu for the fake device; force identity mapping */
 +	pdev->dev.iommu = &fake_iommu;
  #endif
+ 	if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) {
+ 		put_device(&pdev->dev);
+ 		return NULL;
+ 	}
+ 
+ 	i915 = devm_drm_dev_alloc(&pdev->dev, &mock_driver,
+ 				  struct drm_i915_private, drm);
+ 	if (IS_ERR(i915)) {
+ 		pr_err("Failed to allocate mock GEM device: err=%ld\n", PTR_ERR(i915));
+ 		devres_release_group(&pdev->dev, NULL);
+ 		put_device(&pdev->dev);
+ 
+ 		return NULL;
+ 	}
  
  	pci_set_drvdata(pdev, i915);
+ 	i915->drm.pdev = pdev;
  
  	dev_pm_domain_set(&pdev->dev, &pm_domain);
  	pm_runtime_enable(&pdev->dev);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2020-04-15  1:52 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2020-04-15  1:52 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Lyude Paul,
	Ville Syrjälä

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/display/intel_dp_mst.c

between commit:

  743acd115070 ("drm/i915: Get rid of silly void* from MST code")

from the drm-intel tree and commit:

  20c22ad32957 ("drm/dp_mst: Remove drm_dp_mst_has_audio()")

from the drm-misc tree.

I fixed it up (I just used the latter version) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.



-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2019-08-20  2:19 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2019-08-20  2:19 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Christian König, Chris Wilson

[-- Attachment #1: Type: text/plain, Size: 798 bytes --]

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c

between commit:

  70d6894d1456 ("drm/i915: Serialize against vma moves")

from the drm-intel tree and commit:

  52791eeec1d9 ("dma-buf: rename reservation_object to dma_resv")

from the drm-misc tree.

I fixed it up (the former removed the code changed by the latter) and
can carry the fix as necessary. This is now fixed as far as linux-next
is concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.



-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2019-05-22 23:53 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2019-05-22 23:53 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Ramalingam C,
	Uma Shankar, Ville Syrjälä

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/drm_atomic_uapi.c

between commit:

  585b000de23b ("drm: move content protection property to mode_config")

from the drm-intel tree and commit:

  fbb5d0353c62 ("drm: Add HDR source metadata property")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/drm_atomic_uapi.c
index 4131e669785a,125605ff45af..000000000000
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@@ -814,7 -823,10 +823,10 @@@ drm_atomic_connector_get_property(struc
  		*val = state->colorspace;
  	} else if (property == connector->scaling_mode_property) {
  		*val = state->scaling_mode;
+ 	} else if (property == config->hdr_output_metadata_property) {
+ 		*val = state->hdr_output_metadata ?
+ 			state->hdr_output_metadata->base.id : 0;
 -	} else if (property == connector->content_protection_property) {
 +	} else if (property == config->content_protection_property) {
  		*val = state->content_protection;
  	} else if (property == config->writeback_fb_id_property) {
  		/* Writeback framebuffer is one-shot, write and forget */

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2019-03-19  0:51 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2019-03-19  0:51 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Ville Syrjälä,
	Uma Shankar, Maarten Lankhorst

[-- Attachment #1: Type: text/plain, Size: 4213 bytes --]

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/intel_hdmi.c

between commit:

  fbf08556ed43 ("drm/i915: Precompute HDMI infoframes")

from the drm-intel tree and commit:

  2f146b78d5a9 ("drm/i915: Attach colorspace property and enable modeset")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/intel_hdmi.c
index ecfec5d3292e,765718b606d8..000000000000
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@@ -638,70 -469,39 +638,72 @@@ static void intel_write_infoframe(struc
  	buffer[3] = 0;
  	len++;
  
 -	intel_dig_port->write_infoframe(encoder,
 -					crtc_state,
 -					frame->any.type, buffer, len);
 +	intel_dig_port->write_infoframe(encoder, crtc_state, type, buffer, len);
  }
  
 -static void intel_hdmi_set_avi_infoframe(struct intel_encoder *encoder,
 -					 const struct intel_crtc_state *crtc_state,
 -					 const struct drm_connector_state *conn_state)
 +void intel_read_infoframe(struct intel_encoder *encoder,
 +			  const struct intel_crtc_state *crtc_state,
 +			  enum hdmi_infoframe_type type,
 +			  union hdmi_infoframe *frame)
  {
 +	struct intel_digital_port *intel_dig_port = enc_to_dig_port(&encoder->base);
 +	u8 buffer[VIDEO_DIP_DATA_SIZE];
 +	int ret;
 +
 +	if ((crtc_state->infoframes.enable &
 +	     intel_hdmi_infoframe_enable(type)) == 0)
 +		return;
 +
 +	intel_dig_port->read_infoframe(encoder, crtc_state,
 +				       type, buffer, sizeof(buffer));
 +
 +	/* Fill the 'hole' (see big comment above) at position 3 */
 +	memmove(&buffer[1], &buffer[0], 3);
 +
 +	/* see comment above for the reason for this offset */
 +	ret = hdmi_infoframe_unpack(frame, buffer + 1, sizeof(buffer) - 1);
 +	if (ret) {
 +		DRM_DEBUG_KMS("Failed to unpack infoframe type 0x%02x\n", type);
 +		return;
 +	}
 +
 +	if (frame->any.type != type)
 +		DRM_DEBUG_KMS("Found the wrong infoframe type 0x%x (expected 0x%02x)\n",
 +			      frame->any.type, type);
 +}
 +
 +static bool
 +intel_hdmi_compute_avi_infoframe(struct intel_encoder *encoder,
 +				 struct intel_crtc_state *crtc_state,
 +				 struct drm_connector_state *conn_state)
 +{
 +	struct hdmi_avi_infoframe *frame = &crtc_state->infoframes.avi.avi;
  	const struct drm_display_mode *adjusted_mode =
  		&crtc_state->base.adjusted_mode;
 -	union hdmi_infoframe frame;
 +	struct drm_connector *connector = conn_state->connector;
  	int ret;
  
 -	ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
 -						       conn_state->connector,
 +	if (!crtc_state->has_infoframe)
 +		return true;
 +
 +	crtc_state->infoframes.enable |=
 +		intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_AVI);
 +
 +	ret = drm_hdmi_avi_infoframe_from_display_mode(frame, connector,
  						       adjusted_mode);
 -	if (ret < 0) {
 -		DRM_ERROR("couldn't fill AVI infoframe\n");
 -		return;
 -	}
 +	if (ret)
 +		return false;
  
  	if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420)
 -		frame.avi.colorspace = HDMI_COLORSPACE_YUV420;
 +		frame->colorspace = HDMI_COLORSPACE_YUV420;
  	else if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR444)
 -		frame.avi.colorspace = HDMI_COLORSPACE_YUV444;
 +		frame->colorspace = HDMI_COLORSPACE_YUV444;
  	else
 -		frame.avi.colorspace = HDMI_COLORSPACE_RGB;
 +		frame->colorspace = HDMI_COLORSPACE_RGB;
  
 -	drm_hdmi_avi_infoframe_colorspace(&frame.avi, conn_state);
++	drm_hdmi_avi_infoframe_colorspace(frame, conn_state);
+ 
 -	drm_hdmi_avi_infoframe_quant_range(&frame.avi,
 -					   conn_state->connector,
 +	drm_hdmi_avi_infoframe_quant_range(frame, connector,
  					   adjusted_mode,
  					   crtc_state->limited_color_range ?
  					   HDMI_QUANTIZATION_RANGE_LIMITED :

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2019-01-16  1:27 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2019-01-16  1:27 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI, Jani Nikula, Joonas Lahtinen,
	Rodrigo Vivi
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Manasi Navare, Imre Deak, Lyude Paul

[-- Attachment #1: Type: text/plain, Size: 2769 bytes --]

Hi all,

Today's linux-next merge of the drm-misc tree got conflicts in:

  drivers/gpu/drm/i915/intel_dp.c
  drivers/gpu/drm/i915/intel_drv.h

between commits:

  e845f099f1c6 ("drm/i915/dsc: Add Per connector debugfs node for DSC support/enable")
  f6bff60e927b ("drm/i915/icl: Fix HPD handling for TypeC legacy ports")

from the drm-intel tree and commit:

  96550555a78c ("drm/i915: Pass down rc in intel_encoder->compute_config()")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/intel_dp.c
index 0a3ac98a779e,d18b72b5f0b8..000000000000
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@@ -2062,11 -2055,11 +2066,12 @@@ intel_dp_compute_link_config(struct int
  							&limits);
  
  	/* enable compression if the mode doesn't fit available BW */
 -	if (ret) {
 +	DRM_DEBUG_KMS("Force DSC en = %d\n", intel_dp->force_dsc_en);
- 	if (!ret || intel_dp->force_dsc_en) {
- 		if (!intel_dp_dsc_compute_config(intel_dp, pipe_config,
- 						 conn_state, &limits))
- 			return false;
++	if (ret || intel_dp->force_dsc_en) {
+ 		ret = intel_dp_dsc_compute_config(intel_dp, pipe_config,
+ 						  conn_state, &limits);
+ 		if (ret < 0)
+ 			return ret;
  	}
  
  	if (pipe_config->dsc_params.compression_enable) {
diff --cc drivers/gpu/drm/i915/intel_drv.h
index 5e5ceec7c004,19d9abd2666e..000000000000
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@@ -1816,10 -1805,10 +1815,10 @@@ void intel_dp_sink_set_decompression_st
  					   bool enable);
  void intel_dp_encoder_reset(struct drm_encoder *encoder);
  void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder);
 -void intel_dp_encoder_destroy(struct drm_encoder *encoder);
 +void intel_dp_encoder_flush_work(struct drm_encoder *encoder);
- bool intel_dp_compute_config(struct intel_encoder *encoder,
- 			     struct intel_crtc_state *pipe_config,
- 			     struct drm_connector_state *conn_state);
+ int intel_dp_compute_config(struct intel_encoder *encoder,
+ 			    struct intel_crtc_state *pipe_config,
+ 			    struct drm_connector_state *conn_state);
  bool intel_dp_is_edp(struct intel_dp *intel_dp);
  bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
  enum irqreturn intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port,

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the drm-misc tree with the drm-intel tree
  2017-07-20  1:23 Stephen Rothwell
@ 2017-07-21  0:11 ` Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2017-07-21  0:11 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI, Dave Airlie
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List

Hi all,

The following conflict now exists between the drm and drm-intel trees.

On Thu, 20 Jul 2017 11:23:33 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the drm-misc tree got a conflict in:
> 
>   drivers/gpu/drm/i915/i915_drv.c
> 
> between commit:
> 
>   99c539bef538 ("drm/i915: unregister interfaces first in unload")
> 
> from the drm-intel tree and commit:
> 
>   baf54385af78 ("drm/i915: Drop drm_vblank_cleanup")
> 
> from the drm-misc tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc drivers/gpu/drm/i915/i915_drv.c
> index f406aec8a499,04d9bd84ee43..000000000000
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@@ -1386,8 -1367,8 +1384,6 @@@ void i915_driver_unload(struct drm_devi
>   
>   	intel_gvt_cleanup(dev_priv);
>   
> - 	drm_vblank_cleanup(dev);
>  -	i915_driver_unregister(dev_priv);
> --
>   	intel_modeset_cleanup(dev);
>   
>   	/*

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2017-07-20  1:23 Stephen Rothwell
  2017-07-21  0:11 ` Stephen Rothwell
  0 siblings, 1 reply; 23+ messages in thread
From: Stephen Rothwell @ 2017-07-20  1:23 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/i915_drv.c

between commit:

  99c539bef538 ("drm/i915: unregister interfaces first in unload")

from the drm-intel tree and commit:

  baf54385af78 ("drm/i915: Drop drm_vblank_cleanup")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/i915_drv.c
index f406aec8a499,04d9bd84ee43..000000000000
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@@ -1386,8 -1367,8 +1384,6 @@@ void i915_driver_unload(struct drm_devi
  
  	intel_gvt_cleanup(dev_priv);
  
- 	drm_vblank_cleanup(dev);
 -	i915_driver_unregister(dev_priv);
--
  	intel_modeset_cleanup(dev);
  
  	/*

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the drm-misc tree with the drm-intel tree
  2017-05-23  2:00 Stephen Rothwell
@ 2017-05-25  1:53 ` Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2017-05-25  1:53 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Daniel Vetter, Intel Graphics, DRI, Linux-Next Mailing List,
	Linux Kernel Mailing List, Robert Foss, Ville Syrjälä

Hi Dave,

Just cc'ing you as I guess you will need to fix this up at some point.

On Tue, 23 May 2017 12:00:32 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
> 
> Today's linux-next merge of the drm-misc tree got a conflict in:
> 
>   drivers/gpu/drm/i915/intel_display.c
> 
> between commits:
> 
>   1cecc830e6b6 ("drm/i915: Refactor CURBASE calculation")
>   024faac7d59b ("drm/i915: Support variable cursor height on ivb+")
> 
> from the drm-intel tree and commit:
> 
>   c2c446ad2943 ("drm: Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ to UAPI")
> 
> from the drm-misc tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc drivers/gpu/drm/i915/intel_display.c
> index 8217ed0e7132,6a037b856d96..000000000000
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@@ -9144,102 -9138,6 +9144,102 @@@ out
>   	return active;
>   }
>   
>  +static u32 intel_cursor_base(const struct intel_plane_state *plane_state)
>  +{
>  +	struct drm_i915_private *dev_priv =
>  +		to_i915(plane_state->base.plane->dev);
>  +	const struct drm_framebuffer *fb = plane_state->base.fb;
>  +	const struct drm_i915_gem_object *obj = intel_fb_obj(fb);
>  +	u32 base;
>  +
>  +	if (INTEL_INFO(dev_priv)->cursor_needs_physical)
>  +		base = obj->phys_handle->busaddr;
>  +	else
>  +		base = intel_plane_ggtt_offset(plane_state);
>  +
>  +	base += plane_state->main.offset;
>  +
>  +	/* ILK+ do this automagically */
>  +	if (HAS_GMCH_DISPLAY(dev_priv) &&
> - 	    plane_state->base.rotation & DRM_ROTATE_180)
> ++	    plane_state->base.rotation & DRM_MODE_ROTATE_180)
>  +		base += (plane_state->base.crtc_h *
>  +			 plane_state->base.crtc_w - 1) * fb->format->cpp[0];
>  +
>  +	return base;
>  +}
>  +
>  +static u32 intel_cursor_position(const struct intel_plane_state *plane_state)
>  +{
>  +	int x = plane_state->base.crtc_x;
>  +	int y = plane_state->base.crtc_y;
>  +	u32 pos = 0;
>  +
>  +	if (x < 0) {
>  +		pos |= CURSOR_POS_SIGN << CURSOR_X_SHIFT;
>  +		x = -x;
>  +	}
>  +	pos |= x << CURSOR_X_SHIFT;
>  +
>  +	if (y < 0) {
>  +		pos |= CURSOR_POS_SIGN << CURSOR_Y_SHIFT;
>  +		y = -y;
>  +	}
>  +	pos |= y << CURSOR_Y_SHIFT;
>  +
>  +	return pos;
>  +}
>  +
>  +static bool intel_cursor_size_ok(const struct intel_plane_state *plane_state)
>  +{
>  +	const struct drm_mode_config *config =
>  +		&plane_state->base.plane->dev->mode_config;
>  +	int width = plane_state->base.crtc_w;
>  +	int height = plane_state->base.crtc_h;
>  +
>  +	return width > 0 && width <= config->cursor_width &&
>  +		height > 0 && height <= config->cursor_height;
>  +}
>  +
>  +static int intel_check_cursor(struct intel_crtc_state *crtc_state,
>  +			      struct intel_plane_state *plane_state)
>  +{
>  +	const struct drm_framebuffer *fb = plane_state->base.fb;
>  +	int src_x, src_y;
>  +	u32 offset;
>  +	int ret;
>  +
>  +	ret = drm_plane_helper_check_state(&plane_state->base,
>  +					   &plane_state->clip,
>  +					   DRM_PLANE_HELPER_NO_SCALING,
>  +					   DRM_PLANE_HELPER_NO_SCALING,
>  +					   true, true);
>  +	if (ret)
>  +		return ret;
>  +
>  +	if (!fb)
>  +		return 0;
>  +
>  +	if (fb->modifier != DRM_FORMAT_MOD_LINEAR) {
>  +		DRM_DEBUG_KMS("cursor cannot be tiled\n");
>  +		return -EINVAL;
>  +	}
>  +
>  +	src_x = plane_state->base.src_x >> 16;
>  +	src_y = plane_state->base.src_y >> 16;
>  +
>  +	intel_add_fb_offsets(&src_x, &src_y, plane_state, 0);
>  +	offset = intel_compute_tile_offset(&src_x, &src_y, plane_state, 0);
>  +
>  +	if (src_x != 0 || src_y != 0) {
>  +		DRM_DEBUG_KMS("Arbitrary cursor panning not supported\n");
>  +		return -EINVAL;
>  +	}
>  +
>  +	plane_state->main.offset = offset;
>  +
>  +	return 0;
>  +}
>  +
>   static u32 i845_cursor_ctl(const struct intel_crtc_state *crtc_state,
>   			   const struct intel_plane_state *plane_state)
>   {
> @@@ -9389,154 -9245,116 +9389,154 @@@ static u32 i9xx_cursor_ctl(const struc
>   	return cntl;
>   }
>   
>  -static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base,
>  -			       const struct intel_plane_state *plane_state)
>  +static bool i9xx_cursor_size_ok(const struct intel_plane_state *plane_state)
>   {
>  -	struct drm_device *dev = crtc->dev;
>  -	struct drm_i915_private *dev_priv = to_i915(dev);
>  -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>  -	int pipe = intel_crtc->pipe;
>  -	uint32_t cntl = 0;
>  +	struct drm_i915_private *dev_priv =
>  +		to_i915(plane_state->base.plane->dev);
>  +	int width = plane_state->base.crtc_w;
>  +	int height = plane_state->base.crtc_h;
>   
>  -	if (plane_state && plane_state->base.visible)
>  -		cntl = plane_state->ctl;
>  +	if (!intel_cursor_size_ok(plane_state))
>  +		return false;
>   
>  -	if (intel_crtc->cursor_cntl != cntl) {
>  -		I915_WRITE_FW(CURCNTR(pipe), cntl);
>  -		POSTING_READ_FW(CURCNTR(pipe));
>  -		intel_crtc->cursor_cntl = cntl;
>  +	/* Cursor width is limited to a few power-of-two sizes */
>  +	switch (width) {
>  +	case 256:
>  +	case 128:
>  +	case 64:
>  +		break;
>  +	default:
>  +		return false;
>   	}
>   
>  -	/* and commit changes on next vblank */
>  -	I915_WRITE_FW(CURBASE(pipe), base);
>  -	POSTING_READ_FW(CURBASE(pipe));
>  +	/*
>  +	 * IVB+ have CUR_FBC_CTL which allows an arbitrary cursor
>  +	 * height from 8 lines up to the cursor width, when the
>  +	 * cursor is not rotated. Everything else requires square
>  +	 * cursors.
>  +	 */
>  +	if (HAS_CUR_FBC(dev_priv) &&
> - 	    plane_state->base.rotation & DRM_ROTATE_0) {
> ++	    plane_state->base.rotation & DRM_MODE_ROTATE_0) {
>  +		if (height < 8 || height > width)
>  +			return false;
>  +	} else {
>  +		if (height != width)
>  +			return false;
>  +	}
>   
>  -	intel_crtc->cursor_base = base;
>  +	return true;
>   }
>   
>  -/* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */
>  -static void intel_crtc_update_cursor(struct drm_crtc *crtc,
>  -				     const struct intel_plane_state *plane_state)
>  +static int i9xx_check_cursor(struct intel_plane *plane,
>  +			     struct intel_crtc_state *crtc_state,
>  +			     struct intel_plane_state *plane_state)
>   {
>  -	struct drm_device *dev = crtc->dev;
>  -	struct drm_i915_private *dev_priv = to_i915(dev);
>  -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>  -	int pipe = intel_crtc->pipe;
>  -	u32 base = intel_crtc->cursor_addr;
>  -	unsigned long irqflags;
>  -	u32 pos = 0;
>  -
>  -	if (plane_state) {
>  -		int x = plane_state->base.crtc_x;
>  -		int y = plane_state->base.crtc_y;
>  +	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
>  +	const struct drm_framebuffer *fb = plane_state->base.fb;
>  +	enum pipe pipe = plane->pipe;
>  +	int ret;
>   
>  -		if (x < 0) {
>  -			pos |= CURSOR_POS_SIGN << CURSOR_X_SHIFT;
>  -			x = -x;
>  -		}
>  -		pos |= x << CURSOR_X_SHIFT;
>  +	ret = intel_check_cursor(crtc_state, plane_state);
>  +	if (ret)
>  +		return ret;
>   
>  -		if (y < 0) {
>  -			pos |= CURSOR_POS_SIGN << CURSOR_Y_SHIFT;
>  -			y = -y;
>  -		}
>  -		pos |= y << CURSOR_Y_SHIFT;
>  +	/* if we want to turn off the cursor ignore width and height */
>  +	if (!fb)
>  +		return 0;
>   
>  -		/* ILK+ do this automagically */
>  -		if (HAS_GMCH_DISPLAY(dev_priv) &&
>  -		    plane_state->base.rotation & DRM_MODE_ROTATE_180) {
>  -			base += (plane_state->base.crtc_h *
>  -				 plane_state->base.crtc_w - 1) * 4;
>  -		}
>  +	/* Check for which cursor types we support */
>  +	if (!i9xx_cursor_size_ok(plane_state)) {
>  +		DRM_DEBUG("Cursor dimension %dx%d not supported\n",
>  +			  plane_state->base.crtc_w,
>  +			  plane_state->base.crtc_h);
>  +		return -EINVAL;
>   	}
>   
>  -	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
>  +	if (fb->pitches[0] != plane_state->base.crtc_w * fb->format->cpp[0]) {
>  +		DRM_DEBUG_KMS("Invalid cursor stride (%u) (cursor width %d)\n",
>  +			      fb->pitches[0], plane_state->base.crtc_w);
>  +		return -EINVAL;
>  +	}
>   
>  -	I915_WRITE_FW(CURPOS(pipe), pos);
>  +	/*
>  +	 * There's something wrong with the cursor on CHV pipe C.
>  +	 * If it straddles the left edge of the screen then
>  +	 * moving it away from the edge or disabling it often
>  +	 * results in a pipe underrun, and often that can lead to
>  +	 * dead pipe (constant underrun reported, and it scans
>  +	 * out just a solid color). To recover from that, the
>  +	 * display power well must be turned off and on again.
>  +	 * Refuse the put the cursor into that compromised position.
>  +	 */
>  +	if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_C &&
>  +	    plane_state->base.visible && plane_state->base.crtc_x < 0) {
>  +		DRM_DEBUG_KMS("CHV cursor C not allowed to straddle the left screen edge\n");
>  +		return -EINVAL;
>  +	}
>   
>  -	if (IS_I845G(dev_priv) || IS_I865G(dev_priv))
>  -		i845_update_cursor(crtc, base, plane_state);
>  -	else
>  -		i9xx_update_cursor(crtc, base, plane_state);
>  +	plane_state->ctl = i9xx_cursor_ctl(crtc_state, plane_state);
>   
>  -	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
>  +	return 0;
>   }
>   
>  -static bool cursor_size_ok(struct drm_i915_private *dev_priv,
>  -			   uint32_t width, uint32_t height)
>  +static void i9xx_update_cursor(struct intel_plane *plane,
>  +			       const struct intel_crtc_state *crtc_state,
>  +			       const struct intel_plane_state *plane_state)
>   {
>  -	if (width == 0 || height == 0)
>  -		return false;
>  +	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
>  +	enum pipe pipe = plane->pipe;
>  +	u32 cntl = 0, base = 0, pos = 0, fbc_ctl = 0;
>  +	unsigned long irqflags;
>   
>  -	/*
>  -	 * 845g/865g are special in that they are only limited by
>  -	 * the width of their cursors, the height is arbitrary up to
>  -	 * the precision of the register. Everything else requires
>  -	 * square cursors, limited to a few power-of-two sizes.
>  -	 */
>  -	if (IS_I845G(dev_priv) || IS_I865G(dev_priv)) {
>  -		if ((width & 63) != 0)
>  -			return false;
>  +	if (plane_state && plane_state->base.visible) {
>  +		cntl = plane_state->ctl;
>   
>  -		if (width > (IS_I845G(dev_priv) ? 64 : 512))
>  -			return false;
>  +		if (plane_state->base.crtc_h != plane_state->base.crtc_w)
>  +			fbc_ctl = CUR_FBC_CTL_EN | (plane_state->base.crtc_h - 1);
>   
>  -		if (height > 1023)
>  -			return false;
>  +		base = intel_cursor_base(plane_state);
>  +		pos = intel_cursor_position(plane_state);
>  +	}
>  +
>  +	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
>  +
>  +	/*
>  +	 * On some platforms writing CURCNTR first will also
>  +	 * cause CURPOS to be armed by the CURBASE write.
>  +	 * Without the CURCNTR write the CURPOS write would
>  +	 * arm itself.
>  +	 *
>  +	 * CURCNTR and CUR_FBC_CTL are always
>  +	 * armed by the CURBASE write only.
>  +	 */
>  +	if (plane->cursor.base != base ||
>  +	    plane->cursor.size != fbc_ctl ||
>  +	    plane->cursor.cntl != cntl) {
>  +		I915_WRITE_FW(CURCNTR(pipe), cntl);
>  +		if (HAS_CUR_FBC(dev_priv))
>  +			I915_WRITE_FW(CUR_FBC_CTL(pipe), fbc_ctl);
>  +		I915_WRITE_FW(CURPOS(pipe), pos);
>  +		I915_WRITE_FW(CURBASE(pipe), base);
>  +
>  +		plane->cursor.base = base;
>  +		plane->cursor.size = fbc_ctl;
>  +		plane->cursor.cntl = cntl;
>   	} else {
>  -		switch (width | height) {
>  -		case 256:
>  -		case 128:
>  -			if (IS_GEN2(dev_priv))
>  -				return false;
>  -		case 64:
>  -			break;
>  -		default:
>  -			return false;
>  -		}
>  +		I915_WRITE_FW(CURPOS(pipe), pos);
>   	}
>   
>  -	return true;
>  +	POSTING_READ_FW(CURBASE(pipe));
>  +
>  +	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
>  +}
>  +
>  +static void i9xx_disable_cursor(struct intel_plane *plane,
>  +				struct intel_crtc *crtc)
>  +{
>  +	i9xx_update_cursor(plane, NULL, NULL);
>   }
>   
>  +
>   /* VESA 640x480x72Hz mode to set on the pipe */
>   static struct drm_display_mode load_detect_mode = {
>   	DRM_MODE("640x480", DRM_MODE_TYPE_DEFAULT, 31500, 640, 664,

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2017-05-23  2:00 Stephen Rothwell
  2017-05-25  1:53 ` Stephen Rothwell
  0 siblings, 1 reply; 23+ messages in thread
From: Stephen Rothwell @ 2017-05-23  2:00 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Robert Foss,
	Ville Syrjälä

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/intel_display.c

between commits:

  1cecc830e6b6 ("drm/i915: Refactor CURBASE calculation")
  024faac7d59b ("drm/i915: Support variable cursor height on ivb+")

from the drm-intel tree and commit:

  c2c446ad2943 ("drm: Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ to UAPI")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/intel_display.c
index 8217ed0e7132,6a037b856d96..000000000000
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@@ -9144,102 -9138,6 +9144,102 @@@ out
  	return active;
  }
  
 +static u32 intel_cursor_base(const struct intel_plane_state *plane_state)
 +{
 +	struct drm_i915_private *dev_priv =
 +		to_i915(plane_state->base.plane->dev);
 +	const struct drm_framebuffer *fb = plane_state->base.fb;
 +	const struct drm_i915_gem_object *obj = intel_fb_obj(fb);
 +	u32 base;
 +
 +	if (INTEL_INFO(dev_priv)->cursor_needs_physical)
 +		base = obj->phys_handle->busaddr;
 +	else
 +		base = intel_plane_ggtt_offset(plane_state);
 +
 +	base += plane_state->main.offset;
 +
 +	/* ILK+ do this automagically */
 +	if (HAS_GMCH_DISPLAY(dev_priv) &&
- 	    plane_state->base.rotation & DRM_ROTATE_180)
++	    plane_state->base.rotation & DRM_MODE_ROTATE_180)
 +		base += (plane_state->base.crtc_h *
 +			 plane_state->base.crtc_w - 1) * fb->format->cpp[0];
 +
 +	return base;
 +}
 +
 +static u32 intel_cursor_position(const struct intel_plane_state *plane_state)
 +{
 +	int x = plane_state->base.crtc_x;
 +	int y = plane_state->base.crtc_y;
 +	u32 pos = 0;
 +
 +	if (x < 0) {
 +		pos |= CURSOR_POS_SIGN << CURSOR_X_SHIFT;
 +		x = -x;
 +	}
 +	pos |= x << CURSOR_X_SHIFT;
 +
 +	if (y < 0) {
 +		pos |= CURSOR_POS_SIGN << CURSOR_Y_SHIFT;
 +		y = -y;
 +	}
 +	pos |= y << CURSOR_Y_SHIFT;
 +
 +	return pos;
 +}
 +
 +static bool intel_cursor_size_ok(const struct intel_plane_state *plane_state)
 +{
 +	const struct drm_mode_config *config =
 +		&plane_state->base.plane->dev->mode_config;
 +	int width = plane_state->base.crtc_w;
 +	int height = plane_state->base.crtc_h;
 +
 +	return width > 0 && width <= config->cursor_width &&
 +		height > 0 && height <= config->cursor_height;
 +}
 +
 +static int intel_check_cursor(struct intel_crtc_state *crtc_state,
 +			      struct intel_plane_state *plane_state)
 +{
 +	const struct drm_framebuffer *fb = plane_state->base.fb;
 +	int src_x, src_y;
 +	u32 offset;
 +	int ret;
 +
 +	ret = drm_plane_helper_check_state(&plane_state->base,
 +					   &plane_state->clip,
 +					   DRM_PLANE_HELPER_NO_SCALING,
 +					   DRM_PLANE_HELPER_NO_SCALING,
 +					   true, true);
 +	if (ret)
 +		return ret;
 +
 +	if (!fb)
 +		return 0;
 +
 +	if (fb->modifier != DRM_FORMAT_MOD_LINEAR) {
 +		DRM_DEBUG_KMS("cursor cannot be tiled\n");
 +		return -EINVAL;
 +	}
 +
 +	src_x = plane_state->base.src_x >> 16;
 +	src_y = plane_state->base.src_y >> 16;
 +
 +	intel_add_fb_offsets(&src_x, &src_y, plane_state, 0);
 +	offset = intel_compute_tile_offset(&src_x, &src_y, plane_state, 0);
 +
 +	if (src_x != 0 || src_y != 0) {
 +		DRM_DEBUG_KMS("Arbitrary cursor panning not supported\n");
 +		return -EINVAL;
 +	}
 +
 +	plane_state->main.offset = offset;
 +
 +	return 0;
 +}
 +
  static u32 i845_cursor_ctl(const struct intel_crtc_state *crtc_state,
  			   const struct intel_plane_state *plane_state)
  {
@@@ -9389,154 -9245,116 +9389,154 @@@ static u32 i9xx_cursor_ctl(const struc
  	return cntl;
  }
  
 -static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base,
 -			       const struct intel_plane_state *plane_state)
 +static bool i9xx_cursor_size_ok(const struct intel_plane_state *plane_state)
  {
 -	struct drm_device *dev = crtc->dev;
 -	struct drm_i915_private *dev_priv = to_i915(dev);
 -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 -	int pipe = intel_crtc->pipe;
 -	uint32_t cntl = 0;
 +	struct drm_i915_private *dev_priv =
 +		to_i915(plane_state->base.plane->dev);
 +	int width = plane_state->base.crtc_w;
 +	int height = plane_state->base.crtc_h;
  
 -	if (plane_state && plane_state->base.visible)
 -		cntl = plane_state->ctl;
 +	if (!intel_cursor_size_ok(plane_state))
 +		return false;
  
 -	if (intel_crtc->cursor_cntl != cntl) {
 -		I915_WRITE_FW(CURCNTR(pipe), cntl);
 -		POSTING_READ_FW(CURCNTR(pipe));
 -		intel_crtc->cursor_cntl = cntl;
 +	/* Cursor width is limited to a few power-of-two sizes */
 +	switch (width) {
 +	case 256:
 +	case 128:
 +	case 64:
 +		break;
 +	default:
 +		return false;
  	}
  
 -	/* and commit changes on next vblank */
 -	I915_WRITE_FW(CURBASE(pipe), base);
 -	POSTING_READ_FW(CURBASE(pipe));
 +	/*
 +	 * IVB+ have CUR_FBC_CTL which allows an arbitrary cursor
 +	 * height from 8 lines up to the cursor width, when the
 +	 * cursor is not rotated. Everything else requires square
 +	 * cursors.
 +	 */
 +	if (HAS_CUR_FBC(dev_priv) &&
- 	    plane_state->base.rotation & DRM_ROTATE_0) {
++	    plane_state->base.rotation & DRM_MODE_ROTATE_0) {
 +		if (height < 8 || height > width)
 +			return false;
 +	} else {
 +		if (height != width)
 +			return false;
 +	}
  
 -	intel_crtc->cursor_base = base;
 +	return true;
  }
  
 -/* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */
 -static void intel_crtc_update_cursor(struct drm_crtc *crtc,
 -				     const struct intel_plane_state *plane_state)
 +static int i9xx_check_cursor(struct intel_plane *plane,
 +			     struct intel_crtc_state *crtc_state,
 +			     struct intel_plane_state *plane_state)
  {
 -	struct drm_device *dev = crtc->dev;
 -	struct drm_i915_private *dev_priv = to_i915(dev);
 -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 -	int pipe = intel_crtc->pipe;
 -	u32 base = intel_crtc->cursor_addr;
 -	unsigned long irqflags;
 -	u32 pos = 0;
 -
 -	if (plane_state) {
 -		int x = plane_state->base.crtc_x;
 -		int y = plane_state->base.crtc_y;
 +	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
 +	const struct drm_framebuffer *fb = plane_state->base.fb;
 +	enum pipe pipe = plane->pipe;
 +	int ret;
  
 -		if (x < 0) {
 -			pos |= CURSOR_POS_SIGN << CURSOR_X_SHIFT;
 -			x = -x;
 -		}
 -		pos |= x << CURSOR_X_SHIFT;
 +	ret = intel_check_cursor(crtc_state, plane_state);
 +	if (ret)
 +		return ret;
  
 -		if (y < 0) {
 -			pos |= CURSOR_POS_SIGN << CURSOR_Y_SHIFT;
 -			y = -y;
 -		}
 -		pos |= y << CURSOR_Y_SHIFT;
 +	/* if we want to turn off the cursor ignore width and height */
 +	if (!fb)
 +		return 0;
  
 -		/* ILK+ do this automagically */
 -		if (HAS_GMCH_DISPLAY(dev_priv) &&
 -		    plane_state->base.rotation & DRM_MODE_ROTATE_180) {
 -			base += (plane_state->base.crtc_h *
 -				 plane_state->base.crtc_w - 1) * 4;
 -		}
 +	/* Check for which cursor types we support */
 +	if (!i9xx_cursor_size_ok(plane_state)) {
 +		DRM_DEBUG("Cursor dimension %dx%d not supported\n",
 +			  plane_state->base.crtc_w,
 +			  plane_state->base.crtc_h);
 +		return -EINVAL;
  	}
  
 -	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
 +	if (fb->pitches[0] != plane_state->base.crtc_w * fb->format->cpp[0]) {
 +		DRM_DEBUG_KMS("Invalid cursor stride (%u) (cursor width %d)\n",
 +			      fb->pitches[0], plane_state->base.crtc_w);
 +		return -EINVAL;
 +	}
  
 -	I915_WRITE_FW(CURPOS(pipe), pos);
 +	/*
 +	 * There's something wrong with the cursor on CHV pipe C.
 +	 * If it straddles the left edge of the screen then
 +	 * moving it away from the edge or disabling it often
 +	 * results in a pipe underrun, and often that can lead to
 +	 * dead pipe (constant underrun reported, and it scans
 +	 * out just a solid color). To recover from that, the
 +	 * display power well must be turned off and on again.
 +	 * Refuse the put the cursor into that compromised position.
 +	 */
 +	if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_C &&
 +	    plane_state->base.visible && plane_state->base.crtc_x < 0) {
 +		DRM_DEBUG_KMS("CHV cursor C not allowed to straddle the left screen edge\n");
 +		return -EINVAL;
 +	}
  
 -	if (IS_I845G(dev_priv) || IS_I865G(dev_priv))
 -		i845_update_cursor(crtc, base, plane_state);
 -	else
 -		i9xx_update_cursor(crtc, base, plane_state);
 +	plane_state->ctl = i9xx_cursor_ctl(crtc_state, plane_state);
  
 -	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 +	return 0;
  }
  
 -static bool cursor_size_ok(struct drm_i915_private *dev_priv,
 -			   uint32_t width, uint32_t height)
 +static void i9xx_update_cursor(struct intel_plane *plane,
 +			       const struct intel_crtc_state *crtc_state,
 +			       const struct intel_plane_state *plane_state)
  {
 -	if (width == 0 || height == 0)
 -		return false;
 +	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
 +	enum pipe pipe = plane->pipe;
 +	u32 cntl = 0, base = 0, pos = 0, fbc_ctl = 0;
 +	unsigned long irqflags;
  
 -	/*
 -	 * 845g/865g are special in that they are only limited by
 -	 * the width of their cursors, the height is arbitrary up to
 -	 * the precision of the register. Everything else requires
 -	 * square cursors, limited to a few power-of-two sizes.
 -	 */
 -	if (IS_I845G(dev_priv) || IS_I865G(dev_priv)) {
 -		if ((width & 63) != 0)
 -			return false;
 +	if (plane_state && plane_state->base.visible) {
 +		cntl = plane_state->ctl;
  
 -		if (width > (IS_I845G(dev_priv) ? 64 : 512))
 -			return false;
 +		if (plane_state->base.crtc_h != plane_state->base.crtc_w)
 +			fbc_ctl = CUR_FBC_CTL_EN | (plane_state->base.crtc_h - 1);
  
 -		if (height > 1023)
 -			return false;
 +		base = intel_cursor_base(plane_state);
 +		pos = intel_cursor_position(plane_state);
 +	}
 +
 +	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
 +
 +	/*
 +	 * On some platforms writing CURCNTR first will also
 +	 * cause CURPOS to be armed by the CURBASE write.
 +	 * Without the CURCNTR write the CURPOS write would
 +	 * arm itself.
 +	 *
 +	 * CURCNTR and CUR_FBC_CTL are always
 +	 * armed by the CURBASE write only.
 +	 */
 +	if (plane->cursor.base != base ||
 +	    plane->cursor.size != fbc_ctl ||
 +	    plane->cursor.cntl != cntl) {
 +		I915_WRITE_FW(CURCNTR(pipe), cntl);
 +		if (HAS_CUR_FBC(dev_priv))
 +			I915_WRITE_FW(CUR_FBC_CTL(pipe), fbc_ctl);
 +		I915_WRITE_FW(CURPOS(pipe), pos);
 +		I915_WRITE_FW(CURBASE(pipe), base);
 +
 +		plane->cursor.base = base;
 +		plane->cursor.size = fbc_ctl;
 +		plane->cursor.cntl = cntl;
  	} else {
 -		switch (width | height) {
 -		case 256:
 -		case 128:
 -			if (IS_GEN2(dev_priv))
 -				return false;
 -		case 64:
 -			break;
 -		default:
 -			return false;
 -		}
 +		I915_WRITE_FW(CURPOS(pipe), pos);
  	}
  
 -	return true;
 +	POSTING_READ_FW(CURBASE(pipe));
 +
 +	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 +}
 +
 +static void i9xx_disable_cursor(struct intel_plane *plane,
 +				struct intel_crtc *crtc)
 +{
 +	i9xx_update_cursor(plane, NULL, NULL);
  }
  
 +
  /* VESA 640x480x72Hz mode to set on the pipe */
  static struct drm_display_mode load_detect_mode = {
  	DRM_MODE("640x480", DRM_MODE_TYPE_DEFAULT, 31500, 640, 664,

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2017-03-06 23:48 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2017-03-06 23:48 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI
  Cc: linux-next, linux-kernel, Noralf Trønnes, Chris Wilson, Lyude

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/i915_debugfs.c

between commits:

  418e3cd80051 ("drm/i915: Show the current i915_params in debugfs/i915_capabilites")
  317eaa95081b ("drm/i915/debugfs: Add i915_hpd_storm_ctl")

from the drm-intel tree and commit:

  b05eeb0f47a3 ("drm/i915: Remove i915_debugfs_unregister()")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/i915_debugfs.c
index 478f19d2f3d8,7d7244798507..000000000000
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@@ -35,49 -35,6 +35,23 @@@ static inline struct drm_i915_private *
  	return to_i915(node->minor->dev);
  }
  
- /* As the drm_debugfs_init() routines are called before dev->dev_private is
-  * allocated we need to hook into the minor for release. */
- static int
- drm_add_fake_info_node(struct drm_minor *minor,
- 		       struct dentry *ent,
- 		       const void *key)
- {
- 	struct drm_info_node *node;
- 
- 	node = kmalloc(sizeof(*node), GFP_KERNEL);
- 	if (node == NULL) {
- 		debugfs_remove(ent);
- 		return -ENOMEM;
- 	}
- 
- 	node->minor = minor;
- 	node->dent = ent;
- 	node->info_ent = (void *)key;
- 
- 	mutex_lock(&minor->debugfs_lock);
- 	list_add(&node->list, &minor->debugfs_list);
- 	mutex_unlock(&minor->debugfs_lock);
- 
- 	return 0;
- }
- 
 +static __always_inline void seq_print_param(struct seq_file *m,
 +					    const char *name,
 +					    const char *type,
 +					    const void *x)
 +{
 +	if (!__builtin_strcmp(type, "bool"))
 +		seq_printf(m, "i915.%s=%s\n", name, yesno(*(const bool *)x));
 +	else if (!__builtin_strcmp(type, "int"))
 +		seq_printf(m, "i915.%s=%d\n", name, *(const int *)x);
 +	else if (!__builtin_strcmp(type, "unsigned int"))
 +		seq_printf(m, "i915.%s=%u\n", name, *(const unsigned int *)x);
 +	else if (!__builtin_strcmp(type, "char *"))
 +		seq_printf(m, "i915.%s=%s\n", name, *(const char **)x);
 +	else
 +		BUILD_BUG();
 +}
 +
  static int i915_capabilities(struct seq_file *m, void *data)
  {
  	struct drm_i915_private *dev_priv = node_to_i915(m->private);
@@@ -4646,112 -4567,6 +4620,81 @@@ static const struct file_operations i91
  	.release = i915_forcewake_release,
  };
  
- static int i915_forcewake_create(struct dentry *root, struct drm_minor *minor)
- {
- 	struct dentry *ent;
- 
- 	ent = debugfs_create_file("i915_forcewake_user",
- 				  S_IRUSR,
- 				  root, to_i915(minor->dev),
- 				  &i915_forcewake_fops);
- 	if (!ent)
- 		return -ENOMEM;
- 
- 	return drm_add_fake_info_node(minor, ent, &i915_forcewake_fops);
- }
- 
 +static int i915_hpd_storm_ctl_show(struct seq_file *m, void *data)
 +{
 +	struct drm_i915_private *dev_priv = m->private;
 +	struct i915_hotplug *hotplug = &dev_priv->hotplug;
 +
 +	seq_printf(m, "Threshold: %d\n", hotplug->hpd_storm_threshold);
 +	seq_printf(m, "Detected: %s\n",
 +		   yesno(delayed_work_pending(&hotplug->reenable_work)));
 +
 +	return 0;
 +}
 +
 +static ssize_t i915_hpd_storm_ctl_write(struct file *file,
 +					const char __user *ubuf, size_t len,
 +					loff_t *offp)
 +{
 +	struct seq_file *m = file->private_data;
 +	struct drm_i915_private *dev_priv = m->private;
 +	struct i915_hotplug *hotplug = &dev_priv->hotplug;
 +	unsigned int new_threshold;
 +	int i;
 +	char *newline;
 +	char tmp[16];
 +
 +	if (len >= sizeof(tmp))
 +		return -EINVAL;
 +
 +	if (copy_from_user(tmp, ubuf, len))
 +		return -EFAULT;
 +
 +	tmp[len] = '\0';
 +
 +	/* Strip newline, if any */
 +	newline = strchr(tmp, '\n');
 +	if (newline)
 +		*newline = '\0';
 +
 +	if (strcmp(tmp, "reset") == 0)
 +		new_threshold = HPD_STORM_DEFAULT_THRESHOLD;
 +	else if (kstrtouint(tmp, 10, &new_threshold) != 0)
 +		return -EINVAL;
 +
 +	if (new_threshold > 0)
 +		DRM_DEBUG_KMS("Setting HPD storm detection threshold to %d\n",
 +			      new_threshold);
 +	else
 +		DRM_DEBUG_KMS("Disabling HPD storm detection\n");
 +
 +	spin_lock_irq(&dev_priv->irq_lock);
 +	hotplug->hpd_storm_threshold = new_threshold;
 +	/* Reset the HPD storm stats so we don't accidentally trigger a storm */
 +	for_each_hpd_pin(i)
 +		hotplug->stats[i].count = 0;
 +	spin_unlock_irq(&dev_priv->irq_lock);
 +
 +	/* Re-enable hpd immediately if we were in an irq storm */
 +	flush_delayed_work(&dev_priv->hotplug.reenable_work);
 +
 +	return len;
 +}
 +
 +static int i915_hpd_storm_ctl_open(struct inode *inode, struct file *file)
 +{
 +	return single_open(file, i915_hpd_storm_ctl_show, inode->i_private);
 +}
 +
 +static const struct file_operations i915_hpd_storm_ctl_fops = {
 +	.owner = THIS_MODULE,
 +	.open = i915_hpd_storm_ctl_open,
 +	.read = seq_read,
 +	.llseek = seq_lseek,
 +	.release = single_release,
 +	.write = i915_hpd_storm_ctl_write
 +};
 +
- static int i915_debugfs_create(struct dentry *root,
- 			       struct drm_minor *minor,
- 			       const char *name,
- 			       const struct file_operations *fops)
- {
- 	struct dentry *ent;
- 
- 	ent = debugfs_create_file(name,
- 				  S_IRUGO | S_IWUSR,
- 				  root, to_i915(minor->dev),
- 				  fops);
- 	if (!ent)
- 		return -ENOMEM;
- 
- 	return drm_add_fake_info_node(minor, ent, fops);
- }
- 
  static const struct drm_info_list i915_debugfs_list[] = {
  	{"i915_capabilities", i915_capabilities, 0},
  	{"i915_gem_objects", i915_gem_object_info, 0},

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2017-01-03  2:14 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2017-01-03  2:14 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI
  Cc: linux-next, linux-kernel, Ville Syrjälä

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/intel_pm.c

between commit:

  e339d67eeb02 ("drm/i915: Pass crtc state to vlv_compute_wm_level()")

from the drm-intel tree and commit:

  353c85989963 ("drm: Replace drm_format_plane_cpp() with fb->format->cpp[]")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/intel_pm.c
index 4b12637e2084,ce03d9d5aca6..000000000000
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@@ -991,13 -960,13 +991,13 @@@ static uint16_t vlv_compute_wm_level(co
  	if (dev_priv->wm.pri_latency[level] == 0)
  		return USHRT_MAX;
  
 -	if (!state->base.visible)
 +	if (!plane_state->base.visible)
  		return 0;
  
- 	cpp = drm_format_plane_cpp(plane_state->base.fb->pixel_format, 0);
 -	cpp = state->base.fb->format->cpp[0];
 -	clock = crtc->config->base.adjusted_mode.crtc_clock;
 -	htotal = crtc->config->base.adjusted_mode.crtc_htotal;
 -	width = crtc->config->pipe_src_w;
++	cpp = plane_state->base.fb->format->cpp[0];
 +	clock = adjusted_mode->crtc_clock;
 +	htotal = adjusted_mode->crtc_htotal;
 +	width = crtc_state->pipe_src_w;
  	if (WARN_ON(htotal == 0))
  		htotal = 1;
  

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2017-01-03  2:08 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2017-01-03  2:08 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI
  Cc: linux-next, linux-kernel, Ville Syrjälä

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/intel_overlay.c

between commit:

  39ccc04e7435 ("drm/i915: Use primary plane->state for overlay ckey setup")

from the drm-intel tree and commits:

  1967b34d5afb ("drm/i915: Add local 'fb' variables")
  438b74a5497c ("drm: Nuke fb->pixel_format")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/intel_overlay.c
index c95362327ffb,568d194435fd..000000000000
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@@ -722,10 -666,8 +722,10 @@@ static void update_colorkey(struct inte
  	if (overlay->color_key_enabled)
  		flags |= DST_KEY_ENABLE;
  
 -	switch (fb->format->format) {
 +	if (state->base.visible)
- 		format = state->base.fb->pixel_format;
++		format = state->base.fb->format->format;
 +
 +	switch (format) {
  	case DRM_FORMAT_C8:
  		key = 0;
  		flags |= CLK_RGB8I_MASK;

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2017-01-03  1:59 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2017-01-03  1:59 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI; +Cc: linux-next, linux-kernel, Chris Wilson

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/i915_vma.c

between commit:

  7d1d9aea3ee0 ("drm/i915: Tidy i915_gem_valid_gtt_space()")

from the drm-intel tree and commit:

  3f85fb3462dc ("drm: Wrap drm_mm_node.hole_follows")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/i915_vma.c
index e008e4e8b481,325b917c5ad7..000000000000
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@@ -327,16 -313,18 +327,16 @@@ bool i915_gem_valid_gtt_space(struct i9
  	if (vma->vm->mm.color_adjust == NULL)
  		return true;
  
 -	if (!drm_mm_node_allocated(gtt_space))
 -		return true;
 -
 -	if (list_empty(&gtt_space->node_list))
 -		return true;
 +	/* Only valid to be called on an already inserted vma */
 +	GEM_BUG_ON(!drm_mm_node_allocated(node));
 +	GEM_BUG_ON(list_empty(&node->node_list));
  
 -	other = list_entry(gtt_space->node_list.prev, struct drm_mm_node, node_list);
 -	if (other->allocated && !drm_mm_hole_follows(other) && other->color != cache_level)
 +	other = list_prev_entry(node, node_list);
- 	if (color_differs(other, cache_level) && !other->hole_follows)
++	if (color_differs(other, cache_level) && !drm_mm_hole_follows(other))
  		return false;
  
 -	other = list_entry(gtt_space->node_list.next, struct drm_mm_node, node_list);
 -	if (other->allocated && !drm_mm_hole_follows(gtt_space) && other->color != cache_level)
 +	other = list_next_entry(node, node_list);
- 	if (color_differs(other, cache_level) && !node->hole_follows)
++	if (color_differs(other, cache_level) && !drm_mm_hole_follows(node))
  		return false;
  
  	return true;

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2017-01-03  1:50 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2017-01-03  1:50 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI; +Cc: linux-next, linux-kernel, Chris Wilson

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/i915_gem_evict.c

between commit:

  49d73912cbfc ("drm/i915: Convert vm->dev backpointer to vm->i915")

from the drm-intel tree and commit:

  9a71e277888b ("drm: Extract struct drm_mm_scan from struct drm_mm")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/i915_gem_evict.c
index 6457fd0c33a8,85ceff1b74b6..000000000000
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@@ -96,7 -99,8 +99,8 @@@ i915_gem_evict_something(struct i915_ad
  			 u64 start, u64 end,
  			 unsigned flags)
  {
 -	struct drm_i915_private *dev_priv = to_i915(vm->dev);
 +	struct drm_i915_private *dev_priv = vm->i915;
+ 	struct drm_mm_scan scan;
  	struct list_head eviction_list;
  	struct list_head *phases[] = {
  		&vm->inactive_list,
@@@ -104,9 -108,10 +108,10 @@@
  		NULL,
  	}, **phase;
  	struct i915_vma *vma, *next;
+ 	struct drm_mm_node *node;
  	int ret;
  
 -	lockdep_assert_held(&vm->dev->struct_mutex);
 +	lockdep_assert_held(&vm->i915->drm.struct_mutex);
  	trace_i915_gem_evict(vm, min_size, alignment, flags);
  
  	/*
@@@ -122,21 -127,12 +127,19 @@@
  	 * On each list, the oldest objects lie at the HEAD with the freshest
  	 * object on the TAIL.
  	 */
- 	if (start != 0 || end != vm->total) {
- 		drm_mm_init_scan_with_range(&vm->mm, min_size,
- 					    alignment, cache_level,
- 					    start, end);
- 	} else
- 		drm_mm_init_scan(&vm->mm, min_size, alignment, cache_level);
+ 	drm_mm_scan_init_with_range(&scan, &vm->mm,
+ 				    min_size, alignment, cache_level,
+ 				    start, end,
+ 				    flags & PIN_HIGH ? DRM_MM_CREATE_TOP : 0);
  
 -	if (flags & PIN_NONBLOCK)
 +	/* Retire before we search the active list. Although we have
 +	 * reasonable accuracy in our retirement lists, we may have
 +	 * a stray pin (preventing eviction) that can only be resolved by
 +	 * retiring.
 +	 */
 +	if (!(flags & PIN_NONBLOCK))
 +		i915_gem_retire_requests(dev_priv);
 +	else
  		phases[1] = NULL;
  
  search_again:

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2016-10-23 23:59 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2016-10-23 23:59 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI
  Cc: linux-next, linux-kernel, Ville Syrjälä, Paulo Zanoni

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/intel_pm.c

between commit:

  1186fa85eb9b ("drm/i915/gen9: minimum scanlines for Y tile is not always 4")

from the drm-intel tree and commit:

  bd2ef25d921c ("drm: Add drm_rotation_90_or_270()")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/intel_pm.c
index ea01b406d776,1472400ddce3..000000000000
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@@ -3601,42 -3560,6 +3601,42 @@@ static int skl_compute_plane_wm(const s
  	cpp = drm_format_plane_cpp(fb->pixel_format, 0);
  	plane_pixel_rate = skl_adjusted_plane_pixel_rate(cstate, intel_pstate);
  
- 	if (intel_rotation_90_or_270(pstate->rotation)) {
++	if (drm_rotation_90_or_270(pstate->rotation)) {
 +		int cpp = (fb->pixel_format == DRM_FORMAT_NV12) ?
 +			drm_format_plane_cpp(fb->pixel_format, 1) :
 +			drm_format_plane_cpp(fb->pixel_format, 0);
 +
 +		switch (cpp) {
 +		case 1:
 +			y_min_scanlines = 16;
 +			break;
 +		case 2:
 +			y_min_scanlines = 8;
 +			break;
 +		case 4:
 +			y_min_scanlines = 4;
 +			break;
 +		default:
 +			MISSING_CASE(cpp);
 +			return -EINVAL;
 +		}
 +	} else {
 +		y_min_scanlines = 4;
 +	}
 +
 +	plane_bytes_per_line = width * cpp;
 +	if (fb->modifier[0] == I915_FORMAT_MOD_Y_TILED ||
 +	    fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED) {
 +		plane_blocks_per_line =
 +		      DIV_ROUND_UP(plane_bytes_per_line * y_min_scanlines, 512);
 +		plane_blocks_per_line /= y_min_scanlines;
 +	} else if (fb->modifier[0] == DRM_FORMAT_MOD_NONE) {
 +		plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512)
 +					+ 1;
 +	} else {
 +		plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512);
 +	}
 +
  	method1 = skl_wm_method1(plane_pixel_rate, cpp, latency);
  	method2 = skl_wm_method2(plane_pixel_rate,
  				 cstate->base.adjusted_mode.crtc_htotal,

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the drm-misc tree with the drm-intel tree
  2016-05-03  3:24 Stephen Rothwell
@ 2016-05-03  7:54 ` Daniel Vetter
  0 siblings, 0 replies; 23+ messages in thread
From: Daniel Vetter @ 2016-05-03  7:54 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Daniel Vetter, intel-gfx, dri-devel, linux-next, linux-kernel,
	Maarten Lankhorst, Chris Wilson

On Tue, May 03, 2016 at 01:24:12PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the drm-misc tree got a conflict in:
> 
>   drivers/gpu/drm/i915/intel_display.c
> 
> between commits:
> 
>   f7e5838bb37d ("drm/i915: Simplify reset_counter handling during atomic modesetting")
> 
> from the drm-intel tree and commit:
> 
>   81072bfd13f2 ("drm/i915: Rename async to nonblock.")
> 
> from the drm-misc tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

I kinda wonder whether there's some way we could share these conflict
resolutions among various trees. At least one really valuable part of
doing my own drm-intel-nightly integration tree is that I can soak merges
for a few days before I bake them in for eternity ...

Topic for KS I guess?

Cheers, Daniel

> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc drivers/gpu/drm/i915/intel_display.c
> index ff60241b1f76,5d29b838d8d7..000000000000
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@@ -13462,9 -13414,12 +13462,9 @@@ static int intel_atomic_prepare_commit(
>   		return ret;
>   
>   	ret = drm_atomic_helper_prepare_planes(dev, state);
>  -	if (!ret && !nonblock && !i915_reset_in_progress(&dev_priv->gpu_error)) {
>  -		u32 reset_counter;
>  -
>  -		reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);
>  -		mutex_unlock(&dev->struct_mutex);
>  +	mutex_unlock(&dev->struct_mutex);
>   
> - 	if (!ret && !async) {
> ++	if (!ret && !nonblock) {
>   		for_each_plane_in_state(state, plane, plane_state, i) {
>   			struct intel_plane_state *intel_plane_state =
>   				to_intel_plane_state(plane_state);

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2016-05-03  3:24 Stephen Rothwell
  2016-05-03  7:54 ` Daniel Vetter
  0 siblings, 1 reply; 23+ messages in thread
From: Stephen Rothwell @ 2016-05-03  3:24 UTC (permalink / raw)
  To: Daniel Vetter, intel-gfx, dri-devel
  Cc: linux-next, linux-kernel, Maarten Lankhorst, Chris Wilson

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/intel_display.c

between commits:

  f7e5838bb37d ("drm/i915: Simplify reset_counter handling during atomic modesetting")

from the drm-intel tree and commit:

  81072bfd13f2 ("drm/i915: Rename async to nonblock.")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/intel_display.c
index ff60241b1f76,5d29b838d8d7..000000000000
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@@ -13462,9 -13414,12 +13462,9 @@@ static int intel_atomic_prepare_commit(
  		return ret;
  
  	ret = drm_atomic_helper_prepare_planes(dev, state);
 -	if (!ret && !nonblock && !i915_reset_in_progress(&dev_priv->gpu_error)) {
 -		u32 reset_counter;
 -
 -		reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);
 -		mutex_unlock(&dev->struct_mutex);
 +	mutex_unlock(&dev->struct_mutex);
  
- 	if (!ret && !async) {
++	if (!ret && !nonblock) {
  		for_each_plane_in_state(state, plane, plane_state, i) {
  			struct intel_plane_state *intel_plane_state =
  				to_intel_plane_state(plane_state);

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2016-04-27  2:32 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2016-04-27  2:32 UTC (permalink / raw)
  To: Daniel Vetter, intel-gfx, dri-devel
  Cc: linux-next, linux-kernel, Lyude, Yetunde Adebisi

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/intel_dp.c

between commit:

  86ee27b5aa75 ("drm/i915: Read eDP Display control capability registers")

from the drm-intel tree and commit:

  9f085ebb1a50 ("rm/i915: Get rid of intel_dp_dpcd_read_wake()")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/i915/intel_dp.c
index 6bb0b2340e7c,b52676a032f9..000000000000
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@@ -3747,9 -3744,10 +3714,9 @@@ intel_dp_get_dpcd(struct intel_dp *inte
  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
  	struct drm_device *dev = dig_port->base.base.dev;
  	struct drm_i915_private *dev_priv = dev->dev_private;
 -	uint8_t rev;
  
- 	if (intel_dp_dpcd_read_wake(&intel_dp->aux, 0x000, intel_dp->dpcd,
- 				    sizeof(intel_dp->dpcd)) < 0)
+ 	if (drm_dp_dpcd_read(&intel_dp->aux, 0x000, intel_dp->dpcd,
+ 			     sizeof(intel_dp->dpcd)) < 0)
  		return false; /* aux transfer failed */
  
  	DRM_DEBUG_KMS("DPCD: %*ph\n", (int) sizeof(intel_dp->dpcd), intel_dp->dpcd);
@@@ -3803,15 -3801,6 +3770,15 @@@
  			DRM_DEBUG_KMS("PSR2 %s on sink",
  				dev_priv->psr.psr2_support ? "supported" : "not supported");
  		}
 +
 +		/* Read the eDP Display control capabilities registers */
 +		memset(intel_dp->edp_dpcd, 0, sizeof(intel_dp->edp_dpcd));
 +		if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP] & DP_DPCD_DISPLAY_CONTROL_CAPABLE) &&
- 				(intel_dp_dpcd_read_wake(&intel_dp->aux, DP_EDP_DPCD_REV,
++				(drm_dp_dpcd_read(&intel_dp->aux, DP_EDP_DPCD_REV,
 +						intel_dp->edp_dpcd, sizeof(intel_dp->edp_dpcd)) ==
 +								sizeof(intel_dp->edp_dpcd)))
 +			DRM_DEBUG_KMS("EDP DPCD : %*ph\n", (int) sizeof(intel_dp->edp_dpcd),
 +					intel_dp->edp_dpcd);
  	}
  
  	DRM_DEBUG_KMS("Display Port TPS3 support: source %s, sink %s\n",

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2015-12-14  1:06 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2015-12-14  1:06 UTC (permalink / raw)
  To: Daniel Vetter, intel-gfx, dri-devel
  Cc: linux-next, linux-kernel, Ville Syrjälä, Sudip Mukherjee

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/intel_dp.c

between commit:

  893da0c9bcb2 ("drm/i915: check for return value")

from the drm-intel tree and commit:

  13a3d91f17a5 ("drm: Pass 'name' to drm_encoder_init()")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/gpu/drm/i915/intel_dp.c
index ae4c21febbb5,9b10526cc6dd..000000000000
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@@ -6009,9 -5976,8 +6009,9 @@@ intel_dp_init(struct drm_device *dev
  	intel_encoder = &intel_dig_port->base;
  	encoder = &intel_encoder->base;
  
 -	drm_encoder_init(dev, &intel_encoder->base, &intel_dp_enc_funcs,
 -			 DRM_MODE_ENCODER_TMDS, NULL);
 +	if (drm_encoder_init(dev, &intel_encoder->base, &intel_dp_enc_funcs,
- 			     DRM_MODE_ENCODER_TMDS))
++			     DRM_MODE_ENCODER_TMDS, NULL))
 +		goto err_encoder_init;
  
  	intel_encoder->compute_config = intel_dp_compute_config;
  	intel_encoder->disable = intel_disable_dp;

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2015-10-15  2:04 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2015-10-15  2:04 UTC (permalink / raw)
  To: Daniel Vetter, intel-gfx, dri-devel
  Cc: linux-next, linux-kernel, Ville Syrjälä, Thierry Reding

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/i915_irq.c

between commit:

  fd8f507c0de9 ("drm/i915: s/PIPE_FRMCOUNT_GM45/PIPE_FRMCOUNT_G4X/ etc.")

from the drm-intel tree and commit:

  88e72717c2de ("drm/irq: Use unsigned int pipe in public API")

from the drm-misc tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/gpu/drm/i915/i915_irq.c
index e24378ee7eda,bc732eb52b50..000000000000
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@@ -710,11 -611,12 +710,11 @@@ static u32 i915_get_vblank_counter(stru
  	return (((high1 << 8) | low) + (pixel >= vbl_start)) & 0xffffff;
  }
  
- static u32 g4x_get_vblank_counter(struct drm_device *dev, int pipe)
 -static u32 gm45_get_vblank_counter(struct drm_device *dev, unsigned int pipe)
++static u32 g4x_get_vblank_counter(struct drm_device *dev, unsigned int pipe)
  {
  	struct drm_i915_private *dev_priv = dev->dev_private;
 -	int reg = PIPE_FRMCOUNT_GM45(pipe);
  
 -	return I915_READ(reg);
 +	return I915_READ(PIPE_FRMCOUNT_G4X(pipe));
  }
  
  /* raw reads, only for fast reads of display block, no need for forcewake etc. */

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the drm-misc tree with the drm-intel tree
@ 2015-09-29  1:26 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2015-09-29  1:26 UTC (permalink / raw)
  To: Daniel Vetter, intel-gfx, dri-devel
  Cc: linux-next, linux-kernel, Ville Syrjälä

Hi all,

Today's linux-next merge of the drm-misc tree got a conflict in:

  drivers/gpu/drm/i915/intel_audio.c

between commit:

  b8abe859c9d6 ("drm/i915: Always call the adjusted mode 'adjusted_mode'")

from the drm-intel tree and commit:

  9e5a3b529e84 ("drm: Remove the 'mode' argument from drm_select_eld()")

from the drm-misc tree.

I fixed it up (I used the drm-misc tree version) and can carry the fix
as necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2020-09-22  3:34 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22 23:58 linux-next: manual merge of the drm-misc tree with the drm-intel tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2020-09-22  3:34 Stephen Rothwell
2020-04-15  1:52 Stephen Rothwell
2019-08-20  2:19 Stephen Rothwell
2019-05-22 23:53 Stephen Rothwell
2019-03-19  0:51 Stephen Rothwell
2019-01-16  1:27 Stephen Rothwell
2017-07-20  1:23 Stephen Rothwell
2017-07-21  0:11 ` Stephen Rothwell
2017-05-23  2:00 Stephen Rothwell
2017-05-25  1:53 ` Stephen Rothwell
2017-03-06 23:48 Stephen Rothwell
2017-01-03  2:14 Stephen Rothwell
2017-01-03  2:08 Stephen Rothwell
2017-01-03  1:59 Stephen Rothwell
2017-01-03  1:50 Stephen Rothwell
2016-10-23 23:59 Stephen Rothwell
2016-05-03  3:24 Stephen Rothwell
2016-05-03  7:54 ` Daniel Vetter
2016-04-27  2:32 Stephen Rothwell
2015-12-14  1:06 Stephen Rothwell
2015-10-15  2:04 Stephen Rothwell
2015-09-29  1:26 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).