[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2020-09-21 Thread Stephen Rothwell
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..
--- 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(>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(, 0, sizeof(iommu));
 -  iommu.priv = (void *)-1;
 -  pdev->dev.iommu = 
 +  /* HACK to disable iommu for the fake device; force identity mapping */
 +  pdev->dev.iommu = _iommu;
  #endif
+   if (!devres_open_group(>dev, NULL, GFP_KERNEL)) {
+   put_device(>dev);
+   return NULL;
+   }
+ 
+   i915 = devm_drm_dev_alloc(>dev, _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(>dev, NULL);
+   put_device(>dev);
+ 
+   return NULL;
+   }
  
pci_set_drvdata(pdev, i915);
+   i915->drm.pdev = pdev;
  
dev_pm_domain_set(>dev, _domain);
pm_runtime_enable(>dev);


pgpwdguEmv59V.pgp
Description: OpenPGP digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2020-04-14 Thread Stephen Rothwell
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


pgp3sWvkrCG8F.pgp
Description: OpenPGP digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2019-08-19 Thread Stephen Rothwell
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


pgpiRtxafXuIb.pgp
Description: OpenPGP digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2019-05-22 Thread Stephen Rothwell
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..
--- 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;
  


pgpe8uWOMNN65.pgp
Description: OpenPGP digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2019-05-22 Thread Stephen Rothwell
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..
--- 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 */


pgpQC2MwzhVBm.pgp
Description: OpenPGP digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2019-03-18 Thread Stephen Rothwell
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..
--- 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(>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([1], [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 = _state->infoframes.avi.avi;
const struct drm_display_mode *adjusted_mode =
_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(,
 - 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(, conn_state);
++  drm_hdmi_avi_infoframe_colorspace(frame, conn_state);
+ 
 -  drm_hdmi_avi_infoframe_quant_range(,
 - conn_state->connector,
 +  drm_hdmi_avi_infoframe_quant_range(frame, connector,
   adjusted_mode,
   crtc_state->limited_color_range ?
   HDMI_QUANTIZATION_RANGE_LIMITED :


pgpTgNHGjE6ZS.pgp
Description: OpenPGP digital signature

[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2019-01-15 Thread Stephen Rothwell
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..
--- 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
);
  
/* 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, ))
-   return false;
++  if (ret || intel_dp->force_dsc_en) {
+   ret = intel_dp_dsc_compute_config(intel_dp, pipe_config,
+ conn_state, );
+   if (ret < 0)
+   return ret;
}
  
if (pipe_config->dsc_params.compression_enable) {
diff --cc drivers/gpu/drm/i915/intel_drv.h
index 5e5ceec7c004,19d9abd2666e..
--- 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,


pgpzI5Z66v3ay.pgp
Description: OpenPGP digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2017-07-20 Thread Stephen Rothwell
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  
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..
> --- 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
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2017-07-19 Thread Stephen Rothwell
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..
--- 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);
  
/*
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2017-05-24 Thread Stephen Rothwell
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  
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..
> --- 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 =
>  +_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(_state->base,
>  +   _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(_x, _y, plane_state, 0);
>  +offset = intel_compute_tile_offset(_x, _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)
>   {
> 

[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2017-05-22 Thread Stephen Rothwell
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..
--- 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 =
 +  _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(_state->base,
 + _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(_x, _y, plane_state, 0);
 +  offset = intel_compute_tile_offset(_x, _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);

[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2017-03-06 Thread Stephen Rothwell
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..
--- 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(>debugfs_lock);
-   list_add(>list, >debugfs_list);
-   mutex_unlock(>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),
- _forcewake_fops);
-   if (!ent)
-   return -ENOMEM;
- 
-   return drm_add_fake_info_node(minor, ent, _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 = _priv->hotplug;
 +
 +  seq_printf(m, "Threshold: %d\n", hotplug->hpd_storm_threshold);
 +  seq_printf(m, "Detected: %s\n",
 + yesno(delayed_work_pending(>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 = _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, _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(_priv->irq_lock);
 +  

[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2017-01-02 Thread Stephen Rothwell
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..
--- 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;
  
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2017-01-02 Thread Stephen Rothwell
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..
--- 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;
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2017-01-02 Thread Stephen Rothwell
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..
--- 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(_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_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;
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2017-01-02 Thread Stephen Rothwell
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..
--- 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[] = {
>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(>dev->struct_mutex);
 +  lockdep_assert_held(>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(>mm, min_size,
-   alignment, cache_level,
-   start, end);
-   } else
-   drm_mm_init_scan(>mm, min_size, alignment, cache_level);
+   drm_mm_scan_init_with_range(, >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:
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2016-10-23 Thread Stephen Rothwell
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..
--- 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,
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2016-05-03 Thread Daniel Vetter
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 

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..
> --- 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(_priv->gpu_error)) 
> {
>  -u32 reset_counter;
>  -
>  -reset_counter = atomic_read(_priv->gpu_error.reset_counter);
>  -mutex_unlock(>struct_mutex);
>  +mutex_unlock(>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
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2016-05-02 Thread Stephen Rothwell
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..
--- 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(_priv->gpu_error)) 
{
 -  u32 reset_counter;
 -
 -  reset_counter = atomic_read(_priv->gpu_error.reset_counter);
 -  mutex_unlock(>struct_mutex);
 +  mutex_unlock(>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);
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2016-04-26 Thread Stephen Rothwell
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..
--- 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(_dp->aux, 0x000, intel_dp->dpcd,
-   sizeof(intel_dp->dpcd)) < 0)
+   if (drm_dp_dpcd_read(_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(_dp->aux, 
DP_EDP_DPCD_REV,
++  (drm_dp_dpcd_read(_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",
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2015-12-13 Thread Stephen Rothwell
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 Rothwells...@canb.auug.org.au

diff --cc drivers/gpu/drm/i915/intel_dp.c
index ae4c21febbb5,9b10526cc6dd..
--- 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 = _dig_port->base;
encoder = _encoder->base;
  
 -  drm_encoder_init(dev, _encoder->base, _dp_enc_funcs,
 -   DRM_MODE_ENCODER_TMDS, NULL);
 +  if (drm_encoder_init(dev, _encoder->base, _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;
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2015-10-14 Thread Stephen Rothwell
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 Rothwells...@canb.auug.org.au

diff --cc drivers/gpu/drm/i915/i915_irq.c
index e24378ee7eda,bc732eb52b50..
--- 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)) & 0xff;
  }
  
- 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. */
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] linux-next: manual merge of the drm-misc tree with the drm-intel tree

2015-09-28 Thread Stephen Rothwell
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 Rothwells...@canb.auug.org.au
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx