[PATCH 2/2] drm/tegra: Acquire a reference to the IOVA cache

2018-04-22 Thread Thierry Reding
From: Thierry Reding 

The IOVA API uses a memory cache to allocate IOVA nodes from. To make
sure that this cache is available, obtain a reference to it and release
the reference when the cache is no longer needed.

On 64-bit ARM this is hidden by the fact that the DMA mapping API gets
that reference and never releases it. On 32-bit ARM, however, the DMA
mapping API doesn't do that, so allocation of IOVA nodes fails.

Signed-off-by: Thierry Reding 
---
 drivers/gpu/drm/tegra/drm.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 4a696fa274a3..0540b0741df6 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -115,6 +115,10 @@ static int tegra_drm_load(struct drm_device *drm, unsigned 
long flags)
goto free;
}
 
+   err = iova_cache_get();
+   if (err < 0)
+   goto domain;
+
geometry = &tegra->domain->geometry;
gem_start = geometry->aperture_start;
gem_end = geometry->aperture_end - CARVEOUT_SZ;
@@ -205,11 +209,12 @@ static int tegra_drm_load(struct drm_device *drm, 
unsigned long flags)
tegra_drm_fb_free(drm);
 config:
drm_mode_config_cleanup(drm);
-
+domain:
if (tegra->domain) {
mutex_destroy(&tegra->mm_lock);
drm_mm_takedown(&tegra->mm);
put_iova_domain(&tegra->carveout.domain);
+   iova_cache_put();
iommu_domain_free(tegra->domain);
}
 free:
@@ -236,6 +241,7 @@ static void tegra_drm_unload(struct drm_device *drm)
mutex_destroy(&tegra->mm_lock);
drm_mm_takedown(&tegra->mm);
put_iova_domain(&tegra->carveout.domain);
+   iova_cache_put();
iommu_domain_free(tegra->domain);
}
 
-- 
2.17.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/2] drm/tegra: Fix order of teardown in IOMMU case

2018-04-22 Thread Thierry Reding
From: Thierry Reding 

The original code works fine, this is merely a cosmetic change to make
the teardown order the reverse of the setup order.

Signed-off-by: Thierry Reding 
---
 drivers/gpu/drm/tegra/drm.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 1cfe1e7e2feb..4a696fa274a3 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -207,10 +207,10 @@ static int tegra_drm_load(struct drm_device *drm, 
unsigned long flags)
drm_mode_config_cleanup(drm);
 
if (tegra->domain) {
-   iommu_domain_free(tegra->domain);
-   drm_mm_takedown(&tegra->mm);
mutex_destroy(&tegra->mm_lock);
+   drm_mm_takedown(&tegra->mm);
put_iova_domain(&tegra->carveout.domain);
+   iommu_domain_free(tegra->domain);
}
 free:
kfree(tegra);
@@ -233,10 +233,10 @@ static void tegra_drm_unload(struct drm_device *drm)
return;
 
if (tegra->domain) {
-   iommu_domain_free(tegra->domain);
-   drm_mm_takedown(&tegra->mm);
mutex_destroy(&tegra->mm_lock);
+   drm_mm_takedown(&tegra->mm);
put_iova_domain(&tegra->carveout.domain);
+   iommu_domain_free(tegra->domain);
}
 
kfree(tegra);
-- 
2.17.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


RE: [Intel-gfx] [PATCH v5 1/2] drm: content-type property for HDMI connector

2018-04-22 Thread Lisovskiy, Stanislav

> This table is seriously deprecated, because it's unreadable and
> unmaintainable. Quoting from the docs:

> "Because this table is very unwieldy, do not add any new properties here.
> Instead document them in a section above."

> We haven't yet moved all the existing properties over to the new layout
> (patches very much welcome, especially if you spot that an entire area
> you're touching like HDMI properties isn't moved yet). But the old table
> is very much not cool to add stuff to.

> Sorry that I didn't notice this earlier, missed it in the diffstat.

>> as optional.
>> I think it might be a bit misleading, if I add that one to standard 
>> connector properties,
>> there are probably should be created some HDMI specific property chapter 
>> then, as there
>> are already plenty of HDMI specific ones(force audio, broadcast rgb, aspect 
>> ratio).
>>
>> Shouldn't it then go in a separate patch may be? Because this work is surely 
>> needed, however
>> goes a bit out of scope of this patch.

> Don't make it worse by adding more unmaintainable and unreadable entries
> to this table. That's the minimum. Moving all the standard hdmi properties
> first would obviously be even better. That also makes reviewing easier,
> since it's clearer what's there already, and how your new thing fits in.

Ok, then I think I will add a new section called HDMI Specific Connector 
Properties 
under Standard Connector Properties and move content type description there. 
I can add another entries there too, however would prefer to do it in a 
separate patch
as those are not subject of that commit.

>
> Best Regards,
>
> Lisovskiy Stanislav
>
> > ---
> >  Documentation/gpu/kms-properties.csv |  1 +
> >  drivers/gpu/drm/drm_atomic.c | 17 ++
> >  drivers/gpu/drm/drm_connector.c  | 51 
> >  drivers/gpu/drm/drm_edid.c   |  2 ++
> >  include/drm/drm_connector.h  | 18 ++
> >  include/drm/drm_mode_config.h|  5 +++
> >  include/uapi/drm/drm_mode.h  |  7 
> >  7 files changed, 101 insertions(+)
> >
> > diff --git a/Documentation/gpu/kms-properties.csv 
> > b/Documentation/gpu/kms-properties.csv
> > index 6b28b014cb7d..a91c9211b8d6 100644
> > --- a/Documentation/gpu/kms-properties.csv
> > +++ b/Documentation/gpu/kms-properties.csv
> > @@ -17,6 +17,7 @@ Owner Module/Drivers,Group,Property Name,Type,Property 
> > Values,Object attached,De
> >  ,Virtual GPU,“suggested X”,RANGE,"Min=0, 
> > Max=0x",Connector,property to suggest an X offset for a connector
> >  ,,“suggested Y”,RANGE,"Min=0, Max=0x",Connector,property to 
> > suggest an Y offset for a connector
> >  ,Optional,"""aspect ratio""",ENUM,"{ ""None"", ""4:3"", ""16:9"" 
> > }",Connector,TDB
> > +,Optional,"""content type""",ENUM,"{ ""No data"", ""Graphics"", ""Photo"", 
> > ""Cinema"", ""Game"" }",Connector,TBD
> >  i915,Generic,"""Broadcast RGB""",ENUM,"{ ""Automatic"", ""Full"", 
> > ""Limited 16:235"" }",Connector,"When this property is set to Limited 
> > 16:235 and CTM is set, the hardware will be programmed with the result of 
> > the multiplication of CTM by the limited range matrix to ensure the pixels 
> > normaly in the range 0..1.0 are remapped to the range 16/255..235/255."
> >  ,,“audio”,ENUM,"{ ""force-dvi"", ""off"", ""auto"", ""on"" }",Connector,TBD
> >  ,SDVO-TV,“mode”,ENUM,"{ ""NTSC_M"", ""NTSC_J"", ""NTSC_443"", ""PAL_B"" } 
> > etc.",Connector,TBD
> > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> > index 7d25c42f22db..479499f5848e 100644
> > --- a/drivers/gpu/drm/drm_atomic.c
> > +++ b/drivers/gpu/drm/drm_atomic.c
> > @@ -1266,6 +1266,15 @@ static int drm_atomic_connector_set_property(struct 
> > drm_connector *connector,
> >   state->link_status = val;
> >   } else if (property == config->aspect_ratio_property) {
> >   state->picture_aspect_ratio = val;
> > + } else if (property == config->content_type_property) {
> > + /*
> > +  * Lowest two bits of content_type property control
> > +  * content_type, bit 2 controls itc bit.
> > +  * It was decided to have a single property called
> > +  * content_type, instead of content_type and itc.
> > +  */
> > + state->content_type = val & 3;
> > + state->it_content = val >> 2;
> >   } else if (property == connector->scaling_mode_property) {
> >   state->scaling_mode = val;
> >   } else if (property == connector->content_protection_property) {
> > @@ -1351,6 +1360,14 @@ drm_atomic_connector_get_property(struct 
> > drm_connector *connector,
> >   *val = state->link_status;
> >   } else if (property == config->aspect_ratio_property) {
> >   *val = state->picture_aspect_ratio;
> > + } else if (property == config->content_type_property) {
> > + /*
> > +  * Lowest two bits of conte

Re: [PATCH v11 09/11] drm: Expose modes with aspect ratio, only if requested

2018-04-22 Thread Nautiyal, Ankit K



On 4/20/2018 7:52 PM, Ville Syrjälä wrote:

On Fri, Apr 20, 2018 at 07:01:49PM +0530, Nautiyal, Ankit K wrote:

From: Ankit Nautiyal 

We parse the EDID and add all the modes in the connector's modelist.
This adds CEA modes with aspect ratio information too, regardless of
whether user space requested this information or not.

This patch prunes the modes with aspect-ratio information, from a
connector's modelist, if the user-space has not set the aspect ratio
DRM client cap. However if such a mode is unique in the list, it is
kept in the list, with aspect-ratio flags reset.

Cc: Ville Syrjala 
Cc: Shashank Sharma 
Cc: Jose Abreu 

Signed-off-by: Ankit Nautiyal 

V3: As suggested by Ville, modified the mechanism of pruning of modes
 with aspect-ratio, if the aspect-ratio is not supported. Instead
 of straight away pruning such a mode, the mode is retained with
 aspect ratio bits set to zero, provided it is unique.
V4: rebase
V5: Addressed review comments from Ville:
 -used a pointer to store last valid mode.
 -avoided, modifying of picture_aspect_ratio in kernel mode,
  instead only flags bits of user mode are reset (if aspect-ratio
  is not supported).
V6: As suggested by Ville, corrected the mode pruning logic and
 elaborated the mode pruning logic and the assumptions taken.
V7: rebase
V8: rebase
V9: rebase
V10: rebase
V11: Fixed the issue caused in kms_3d test, and enhanced the pruning
  logic to correctly identify and prune modes with aspect-ratio,
  if aspect-ratio cap is not set.
---
  drivers/gpu/drm/drm_connector.c | 56 +++--
  1 file changed, 48 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index b3cde89..865ee354 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -1531,15 +1531,35 @@ static struct drm_encoder 
*drm_connector_get_encoder(struct drm_connector *conne
return connector->encoder;
  }
  
-static bool drm_mode_expose_to_userspace(const struct drm_display_mode *mode,

-const struct drm_file *file_priv)
+static bool
+drm_mode_expose_to_userspace(const struct drm_display_mode *mode,
+const struct drm_display_mode *modelist,
+const struct drm_file *file_priv)
  {
/*
 * If user-space hasn't configured the driver to expose the stereo 3D
 * modes, don't expose them.
 */
+   struct drm_display_mode *mode_itr;
+
if (!file_priv->stereo_allowed && drm_mode_is_stereo(mode))
return false;
+   /*
+* If user-space hasn't configured the driver to expose the modes
+* with aspect-ratio, don't expose them. However if such a mode
+* is unique, let it be exposed, but reset the aspect-ratio flags
+* while preparing the list of user-modes.
+*/
+   if (!file_priv->aspect_ratio_allowed &&
+   mode->picture_aspect_ratio != HDMI_PICTURE_ASPECT_NONE) {
+   list_for_each_entry(mode_itr, &modelist->head, head)
+   if (drm_mode_match(mode_itr, mode,
+  DRM_MODE_MATCH_TIMINGS |
+  DRM_MODE_MATCH_CLOCK |
+  DRM_MODE_MATCH_FLAGS |
+  DRM_MODE_MATCH_3D_FLAGS))
+   return false;
+   }
  
  	return true;

  }
@@ -1550,7 +1570,7 @@ int drm_mode_getconnector(struct drm_device *dev, void 
*data,
struct drm_mode_get_connector *out_resp = data;
struct drm_connector *connector;
struct drm_encoder *encoder;
-   struct drm_display_mode *mode;
+   struct drm_display_mode *mode, *tmp, modelist;
int mode_count = 0;
int encoders_count = 0;
int ret = 0;
@@ -1605,23 +1625,37 @@ int drm_mode_getconnector(struct drm_device *dev, void 
*data,
out_resp->subpixel = connector->display_info.subpixel_order;
out_resp->connection = connector->status;
  
+	INIT_LIST_HEAD(&modelist.head);

Why are we using a struct drm_display_mode to get a simple list_head?


Yes you are right, we can use the simple list_head here. I was trying to 
use modelist as first mode, and goofed up.

Its a mistake, I will correct it in next patchset.




+
/* delayed so we get modes regardless of pre-fill_modes state */
list_for_each_entry(mode, &connector->modes, head)
-   if (drm_mode_expose_to_userspace(mode, file_priv))
+   if (drm_mode_expose_to_userspace(mode, &modelist,
+file_priv)) {
+   struct drm_display_mode *tmp_mode;
+
+   tmp_mode = drm_mode_duplicate(dev, mode);

Duplicating every mode seems rather wasteful. I suppose we could
just add another list_head t

Re: [PATCH v11 07/11] drm: Add helper functions to handle aspect-ratio flag bits

2018-04-22 Thread Nautiyal, Ankit K



On 4/20/2018 7:42 PM, Ville Syrjälä wrote:

On Fri, Apr 20, 2018 at 07:01:47PM +0530, Nautiyal, Ankit K wrote:

From: Ankit Nautiyal 

This patch adds helper functions for determining if aspect-ratio is
expected in user-mode and for allowing/disallowing the aspect-ratio,
if its not expected.

Signed-off-by: Ankit Nautiyal 
---
  drivers/gpu/drm/drm_modes.c | 47 +
  include/drm/drm_modes.h |  4 
  2 files changed, 51 insertions(+)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index c395a24..d6133e8 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1759,3 +1759,50 @@ bool drm_mode_is_420(const struct drm_display_info 
*display,
drm_mode_is_420_also(display, mode);
  }
  EXPORT_SYMBOL(drm_mode_is_420);
+
+/**
+ * drm_mode_aspect_ratio_allowed - checks if the aspect-ratio information
+ * is expected from the user-mode.
+ *
+ * If the user has set aspect-ratio cap, then the flag of the user-mode is
+ * allowed to contain aspect-ratio value.
+ * If the user does not set aspect-ratio cap, then the only value allowed in 
the
+ * flags bits is aspect-ratio NONE.
+ *
+ * @file_priv: file private structure to get the user capabilities
+ * @umode: drm_mode_modeinfo struct, whose flag carry the aspect ratio
+ * information.
+ *
+ * Returns:
+ * true if the aspect-ratio info is allowed in the user-mode flags.
+ * false, otherwise.
+ */
+bool
+drm_mode_aspect_ratio_allowed(const struct drm_file *file_priv,
+ struct drm_mode_modeinfo *umode)
+{
+   return file_priv->aspect_ratio_allowed || (umode->flags &
+   DRM_MODE_FLAG_PIC_AR_MASK) == DRM_MODE_FLAG_PIC_AR_NONE;

Odd line split here. Makes this a bit hard to read.
I would split after the ||


Agreed. I wasn't sure how to let it have better readability and less 
than 80 char length

at the same time. Will fix this.




+}
+EXPORT_SYMBOL(drm_mode_aspect_ratio_allowed);

Do we actually need to export these? I don't think so.

But I might be wrong. It's a bit hard to see with the way
you split this patch with the actual users in a different patch.


These helper functions are used in drm_mode_atomic.c, drm_mode_crtc.c, 
and drm_mode_get_connector.c
The patches are split as to have modes-set handling separate and the 
exposing of connector separate.
Do you suggest this patch to be merged with the patch for handling 
aspect-ratio in modeset?



+
+/**
+ * drm_mode_filter_aspect_ratio_flags - filters the aspect-ratio bits in the
+ * user-mode flags.
+ *
+ * Checks if the aspect-ratio information is allowed. Resets the aspect-ratio
+ * bits in the user-mode flags, if aspect-ratio info is not allowed.
+ *
+ * @file_priv: file private structure to get the user capabilities.
+ * @umode: drm_mode_modeinfo struct, whose flags' aspect-ratio bits needs to
+ * be filtered.
+ *
+ */
+void
+drm_mode_filter_aspect_ratio_flags(const struct drm_file *file_priv,
+  struct drm_mode_modeinfo *umode)
+{
+   if (!drm_mode_aspect_ratio_allowed(file_priv, umode))
+   umode->flags &= ~DRM_MODE_FLAG_PIC_AR_MASK;
+}
+EXPORT_SYMBOL(drm_mode_filter_aspect_ratio_flags);
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
index 2f78b7e..e0b060d 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -461,6 +461,10 @@ bool drm_mode_is_420_also(const struct drm_display_info 
*display,
  const struct drm_display_mode *mode);
  bool drm_mode_is_420(const struct drm_display_info *display,
 const struct drm_display_mode *mode);
+bool drm_mode_aspect_ratio_allowed(const struct drm_file *file_priv,
+  struct drm_mode_modeinfo *umode);
+void drm_mode_filter_aspect_ratio_flags(const struct drm_file *file_priv,
+   struct drm_mode_modeinfo *umode);
  
  struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,

  int hdisplay, int vdisplay, int vrefresh,
--
2.7.4


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v11 06/11] drm: Add DRM client cap for aspect-ratio

2018-04-22 Thread Nautiyal, Ankit K



On 4/20/2018 7:37 PM, Ville Syrjälä wrote:

On Fri, Apr 20, 2018 at 07:01:46PM +0530, Nautiyal, Ankit K wrote:

From: Ankit Nautiyal 

To enable aspect-ratio support in DRM, blindly exposing the aspect
ratio information along with mode, can break things in existing
user-spaces which have no intention or support to use this aspect
ratio information.

To avoid this, a new drm client cap is required to enable a
user-space to advertise if it supports modes with aspect-ratio. Based
on this cap value, the kernel will take a call on exposing the aspect
ratio info in modes or not.

This patch adds the client cap for aspect-ratio.

Cc: Ville Syrjala 
Cc: Shashank Sharma 
Signed-off-by: Ankit Nautiyal 

V3: rebase
V4: As suggested by Marteen Lankhorst modified the commit message
 explaining the need to use the DRM cap for aspect-ratio. Also,
 tweaked the comment lines in the code for better understanding and
 clarity, as recommended by Shashank Sharma.
V5: rebase
V6: rebase
V7: rebase
V8: rebase
V9: rebase
V10: added comment explaining that no userspace breaks on aspect-ratio
  mode bits.

Reviewed-by: Shashank Sharma 
---
  drivers/gpu/drm/drm_ioctl.c | 9 +
  include/drm/drm_file.h  | 8 
  include/uapi/drm/drm.h  | 7 +++
  3 files changed, 24 insertions(+)

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index af78291..39c8eab 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -325,6 +325,15 @@ drm_setclientcap(struct drm_device *dev, void *data, 
struct drm_file *file_priv)
file_priv->atomic = req->value;
file_priv->universal_planes = req->value;
break;
+   case DRM_CLIENT_CAP_ASPECT_RATIO:
+   if (req->value > 1)
+   return -EINVAL;
+   /*
+* No Atomic userspace blows up on aspect ratio mode bits. Checked in
+* wayland/weston, xserver, and hardware-composer modeset paths.
+*/

Bogus indentation.


Thanks to point that out, will fix this.


Also where's the aspect_ratio_allowed handling for the atomic cap?
Or did we decide against it after all?


As discussed, aspect ratio is handled in the atomic modeset path, where 
in the modeset requests with aspect-ratios

are rejected, if the aspect-ratio cap not set.
The part which is dropped is - hiding the aspect-ratio information, 
while returning a mode blob in the drm_mode_get_blob
if the cap is not set. The patch was dropped as no user-space currently 
uses getblob ioctl to get the mode-blob.


Regards,
Ankit



+   file_priv->aspect_ratio_allowed = req->value;
+   break;
default:
return -EINVAL;
}
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index 5176c37..02b7dde 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -182,6 +182,14 @@ struct drm_file {
unsigned atomic:1;
  
  	/**

+* @aspect_ratio_allowed:
+*
+* True, if client can handle picture aspect ratios, and has requested
+* to pass this information along with the mode.
+*/
+   unsigned aspect_ratio_allowed:1;
+
+   /**
 * @is_master:
 *
 * This client is the creator of @master. Protected by struct
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 6fdff59..9c660e1 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -680,6 +680,13 @@ struct drm_get_cap {
   */
  #define DRM_CLIENT_CAP_ATOMIC 3
  
+/**

+ * DRM_CLIENT_CAP_ASPECT_RATIO
+ *
+ * If set to 1, the DRM core will provide aspect ratio information in modes.
+ */
+#define DRM_CLIENT_CAP_ASPECT_RATIO4
+
  /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
  struct drm_set_client_cap {
__u64 capability;
--
2.7.4


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/virtio: fix vq wait_event condition

2018-04-22 Thread Dave Airlie
On 20 April 2018 at 17:22, Gerd Hoffmann  wrote:
> On Tue, Apr 03, 2018 at 11:59:04AM +0200, Gerd Hoffmann wrote:
>> Wait until we have enough space in the virt queue to actually queue up
>> our request.  Avoids the guest spinning in case we have a non-zero
>> amount of free entries but not enough for the request.
>
> Ping airlied, can you please either pick it up or review so I can commit
> myself?

Just in case it got lost from my phone,

Reviewed-by: Dave Airlie 

>
> thanks,
>   Gerd
>
>> Cc: sta...@vger.kernel.org
>> Reported-by: Alain Magloire 
>> Signed-off-by: Gerd Hoffmann 
>> ---
>>  drivers/gpu/drm/virtio/virtgpu_vq.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c 
>> b/drivers/gpu/drm/virtio/virtgpu_vq.c
>> index 48e4f1df6e..020070d483 100644
>> --- a/drivers/gpu/drm/virtio/virtgpu_vq.c
>> +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
>> @@ -293,7 +293,7 @@ static int virtio_gpu_queue_ctrl_buffer_locked(struct 
>> virtio_gpu_device *vgdev,
>>   ret = virtqueue_add_sgs(vq, sgs, outcnt, incnt, vbuf, GFP_ATOMIC);
>>   if (ret == -ENOSPC) {
>>   spin_unlock(&vgdev->ctrlq.qlock);
>> - wait_event(vgdev->ctrlq.ack_queue, vq->num_free);
>> + wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= outcnt + 
>> incnt);
>>   spin_lock(&vgdev->ctrlq.qlock);
>>   goto retry;
>>   } else {
>> @@ -368,7 +368,7 @@ static int virtio_gpu_queue_cursor(struct 
>> virtio_gpu_device *vgdev,
>>   ret = virtqueue_add_sgs(vq, sgs, outcnt, 0, vbuf, GFP_ATOMIC);
>>   if (ret == -ENOSPC) {
>>   spin_unlock(&vgdev->cursorq.qlock);
>> - wait_event(vgdev->cursorq.ack_queue, vq->num_free);
>> + wait_event(vgdev->cursorq.ack_queue, vq->num_free >= outcnt);
>>   spin_lock(&vgdev->cursorq.qlock);
>>   goto retry;
>>   } else {
>> --
>> 2.9.3
>>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 0/2] qxl: two fixes.

2018-04-22 Thread Dave Airlie
On 20 April 2018 at 17:22, Gerd Hoffmann  wrote:
>> Gerd Hoffmann (2):
>>   qxl: fix qxl_release_{map,unmap}
>>   qxl: keep separate release_bo pointer
>
> Ping airlied, can you please either pick it up or review so I can commit
> myself?

Sorry, been on holidays,

Both of these are
Reviewed-by: Dave Airlie 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: dw-hdmi-i2s: Remove owner assignment from platform_driver

2018-04-22 Thread Fabio Estevam
Andrzej/Archit,

Any comments?

On Thu, Mar 15, 2018 at 3:04 PM, Fabio Estevam  wrote:
> From: Fabio Estevam 
>
> platform_driver does not need to set the owner field, as this will
> be populated by the driver core.
>
> Generated by scripts/coccinelle/api/platform_no_drv_owner.cocci.
>
> Signed-off-by: Fabio Estevam 
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c 
> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
> index 3b7e5c5..8f9c8a6 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
> @@ -152,7 +152,6 @@ static struct platform_driver snd_dw_hdmi_driver = {
> .remove = snd_dw_hdmi_remove,
> .driver = {
> .name = DRIVER_NAME,
> -   .owner = THIS_MODULE,
> },
>  };
>  module_platform_driver(snd_dw_hdmi_driver);
> --
> 2.7.4
>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 0/2] drm/exynos/mixer: fixes for interlaced mode

2018-04-22 Thread Inki Dae


2018년 04월 20일 21:44에 Andrzej Hajda 이(가) 쓴 글:
> On 12.03.2018 08:12, Andrzej Hajda wrote:
>> On 20.02.2018 07:45, Andrzej Hajda wrote:
>>> Hi Inki,
>>>
>>> On 02.02.2018 16:11, Andrzej Hajda wrote:
 Hi Inki, Tobias,

 This is reviewed/updated/tested Tobias's patch addressing page-faults
 in Video Processor in interlaced mode. Plus preliminary patch fixing Mixer
 interlaced mode.

 Regards
 Andrzej
>>> Gentle ping.
>> Ping.
> 
> Ping, almost three months passed.
>

Oops, really sorry. I forgot this. Merged.

Thanks,
Inki Dae
 
> Regards
> Andrzej
> 
>>
>> --
>> Regards
>> Andrzej
>>
>>> Regards
>>> Andrzej
>>>
 Andrzej Hajda (1):
   drm/exynos/mixer: fix synchronization check in interlaced mode

 Tobias Jakobi (1):
   drm/exynos: mixer: avoid Oops in vp_video_buffer()

  drivers/gpu/drm/exynos/exynos_mixer.c | 22 +-
  drivers/gpu/drm/exynos/regs-mixer.h   |  1 +
  2 files changed, 18 insertions(+), 5 deletions(-)

>>> ___
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>> ___
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" 
> in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[git pull] drm fixes for rc2 (or rc3)

2018-04-22 Thread Dave Airlie
Hi Linus,

Just back at work today, I've pulled all the rc2 fixes pulls that were
outstanding, and pushed them out. If I missed rc2, no worries they
should all be fine for rc3.

i915 has an oops fix, and two race fixes, along with some gvt fixes
amdgpu has a dark screen fix, clk/voltage fix and vega12 smu fix
exynos just drops some code.

There is also a backmerge in here due to some unfortunate drm-misc
timing, but should be all fine.

Thanks,
Dave.

The following changes since commit a10beabba213924d876f2d10ca9351aeab93f58a:

  Merge branch 'drm-next-4.17' of
git://people.freedesktop.org/~agd5f/linux into drm-next (2018-04-13
09:25:21 +1000)

are available in the Git repository at:

  git://people.freedesktop.org/~airlied/linux tags/drm-fixes-for-v4.17-rc2

for you to fetch changes up to 221bda4b5f1abfd74159d7bf3703affa62468030:

  Merge branch 'drm-next-4.17' of
git://people.freedesktop.org/~agd5f/linux into drm-next (2018-04-23
08:54:06 +1000)


exynos, i915, vc4, amdgpu fixes


Changbin Du (2):
  drm/i915/gvt: Missed to cancel dma map for ggtt entries
  drm/i915/gvt: Cancel dma map when resetting ggtt entries

Chris Wilson (2):
  drm/i915/execlists: Clear user-active flag on preemption completion
  drm/i915: Call i915_perf_fini() on init_hw error unwind

Daniel J Blueman (1):
  drm/vc4: Fix memory leak during BO teardown

Daniel Stone (3):
  drm/exynos: Move GEM BOs to drm_framebuffer
  drm/exynos: Move dma_addr out of exynos_drm_fb
  drm/exynos: exynos_drm_fb -> drm_framebuffer

Dave Airlie (4):
  Merge tag 'drm-misc-fixes-2018-04-18-1' of
git://anongit.freedesktop.org/drm/drm-misc into drm-next
  Merge tag 'drm-intel-next-fixes-2018-04-19' of
git://anongit.freedesktop.org/drm/drm-intel into drm-next
  Merge tag 'exynos-drm-fixes-for-v4.17-rc2' of
git://git.kernel.org/.../daeinki/drm-exynos into drm-next
  Merge branch 'drm-next-4.17' of
git://people.freedesktop.org/~agd5f/linux into drm-next

Gaurav K Singh (1):
  drm/i915/audio: Fix audio detection issue on GLK

Gerd Hoffmann (1):
  drm/i915/gvt: throw error on unhandled vfio ioctls

Gustavo A. R. Silva (1):
  drm/i915/gvt: Mark expected switch fall-through in handle_g2v_notification

Harry Wentland (1):
  drm/amd/display: Don't program bypass on linear regamma LUT

Imre Deak (1):
  drm/i915: Fix LSPCON TMDS output buffer enabling from low-power state

Jani Nikula (1):
  drm/i915/bios: filter out invalid DDC pins from VBT child devices

Joonas Lahtinen (1):
  Merge tag 'gvt-fixes-2018-04-03' of
https://github.com/intel/gvt-linux into drm-intel-next-fixes

Kenneth Feng (1):
  drm/amd/powerplay: header file interface to SMU update

Ramalingam C (1):
  drm: Fix HDCP downstream dev count read

Rex Zhu (1):
  drm/amd/pp: Fix bug voltage can't be OD separately on VI

Sean Paul (1):
  Merge airlied/drm-next into drm-misc-fixes

Tina Zhang (1):
  drm/i915/gvt: Add drm_format_mod update

Tvrtko Ursulin (1):
  drm/i915/pmu: Inspect runtime PM state more carefully while estimating RC6

Xidong Wang (1):
  drm/i915: Do no use kfree() to free a kmem_cache_alloc() return value

Xiong Zhang (2):
  drm/i915/gvt: Delete redundant error message in fb_decode.c
  drm/i915/gvt: Disable primary/sprite/cursor plane at virtual
display initialization

Zhipeng Gong (1):
  drm/i915/gvt: Make MI_USER_INTERRUPT nop in cmd parser

 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 20 --
 drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c|  3 +-
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c|  7 ---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c   | 16 +++--
 .../drm/amd/powerplay/inc/vega12/smu9_driver_if.h  |  4 +-
 drivers/gpu/drm/drm_dp_dual_mode_helper.c  | 39 +---
 drivers/gpu/drm/exynos/exynos_drm_fb.c | 73 +-
 drivers/gpu/drm/i915/gvt/cmd_parser.c  |  1 +
 drivers/gpu/drm/i915/gvt/display.c | 10 +++
 drivers/gpu/drm/i915/gvt/dmabuf.c  |  1 +
 drivers/gpu/drm/i915/gvt/fb_decoder.c  | 27 +++-
 drivers/gpu/drm/i915/gvt/gtt.c | 52 ---
 drivers/gpu/drm/i915/gvt/gtt.h |  2 +-
 drivers/gpu/drm/i915/gvt/handlers.c|  1 +
 drivers/gpu/drm/i915/gvt/kvmgt.c   |  2 +-
 drivers/gpu/drm/i915/i915_drv.c| 27 
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |  2 +-
 drivers/gpu/drm/i915/i915_pmu.c| 37 ---
 drivers/gpu/drm/i915/intel_audio.c |  2 +-
 drivers/gpu/drm/i915/intel_bios.c  | 13 ++--
 drivers/gpu/drm/i915/intel_lrc.c   |  9 +++
 drivers/gpu/drm/vc4/vc4_bo.c   |  2 +
 drivers/gpu/drm/vc4/vc4_validate_shaders.c 

[PATCH v2 8/8] drm: rcar-du: Add support for CRC computation

2018-04-22 Thread Laurent Pinchart
Implement CRC computation configuration and reporting through the DRM
debugfs-based CRC API. The CRC source can be configured to any input
plane or the pipeline output.

Signed-off-by: Laurent Pinchart 
---
Changes since v1:

- Format the source names using plane IDs instead of plane indices
---
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 156 +++--
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h |  19 
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c  |   7 ++
 3 files changed, 176 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c 
b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index c4420538ec85..d71d709fe3d9 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -691,6 +691,52 @@ static const struct drm_crtc_helper_funcs 
crtc_helper_funcs = {
.atomic_disable = rcar_du_crtc_atomic_disable,
 };
 
+static struct drm_crtc_state *
+rcar_du_crtc_atomic_duplicate_state(struct drm_crtc *crtc)
+{
+   struct rcar_du_crtc_state *state;
+   struct rcar_du_crtc_state *copy;
+
+   if (WARN_ON(!crtc->state))
+   return NULL;
+
+   state = to_rcar_crtc_state(crtc->state);
+   copy = kmemdup(state, sizeof(*state), GFP_KERNEL);
+   if (copy == NULL)
+   return NULL;
+
+   __drm_atomic_helper_crtc_duplicate_state(crtc, ©->state);
+
+   return ©->state;
+}
+
+static void rcar_du_crtc_atomic_destroy_state(struct drm_crtc *crtc,
+ struct drm_crtc_state *state)
+{
+   __drm_atomic_helper_crtc_destroy_state(state);
+   kfree(to_rcar_crtc_state(state));
+}
+
+static void rcar_du_crtc_reset(struct drm_crtc *crtc)
+{
+   struct rcar_du_crtc_state *state;
+
+   if (crtc->state) {
+   rcar_du_crtc_atomic_destroy_state(crtc, crtc->state);
+   crtc->state = NULL;
+   }
+
+   state = kzalloc(sizeof(*state), GFP_KERNEL);
+   if (state == NULL)
+   return;
+
+   state->crc.source = VSP1_DU_CRC_NONE;
+   state->crc.index = 0;
+
+   crtc->state = &state->state;
+   crtc->state->crtc = crtc;
+}
+
 static int rcar_du_crtc_enable_vblank(struct drm_crtc *crtc)
 {
struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
@@ -710,15 +756,111 @@ static void rcar_du_crtc_disable_vblank(struct drm_crtc 
*crtc)
rcrtc->vblank_enable = false;
 }
 
-static const struct drm_crtc_funcs crtc_funcs = {
-   .reset = drm_atomic_helper_crtc_reset,
+static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc,
+  const char *source_name,
+  size_t *values_cnt)
+{
+   struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
+   struct drm_modeset_acquire_ctx ctx;
+   struct drm_crtc_state *crtc_state;
+   struct drm_atomic_state *state;
+   enum vsp1_du_crc_source source;
+   unsigned int index = 0;
+   unsigned int i;
+   int ret;
+
+   /*
+* Parse the source name. Supported values are "plane%u" to compute the
+* CRC on an input plane (%u is the plane ID), and "auto" to compute the
+* CRC on the composer (VSP) output.
+*/
+   if (!source_name) {
+   source = VSP1_DU_CRC_NONE;
+   } else if (!strcmp(source_name, "auto")) {
+   source = VSP1_DU_CRC_OUTPUT;
+   } else if (strstarts(source_name, "plane")) {
+   source = VSP1_DU_CRC_PLANE;
+
+   ret = kstrtouint(source_name + strlen("plane"), 10, &index);
+   if (ret < 0)
+   return ret;
+
+   for (i = 0; i < rcrtc->vsp->num_planes; ++i) {
+   if (index == rcrtc->vsp->planes[i].plane.base.id) {
+   index = i;
+   break;
+   }
+   }
+
+   if (i >= rcrtc->vsp->num_planes)
+   return -EINVAL;
+   } else {
+   return -EINVAL;
+   }
+
+   *values_cnt = 1;
+
+   /* Perform an atomic commit to set the CRC source. */
+   drm_modeset_acquire_init(&ctx, 0);
+
+   state = drm_atomic_state_alloc(crtc->dev);
+   if (!state) {
+   ret = -ENOMEM;
+   goto unlock;
+   }
+
+   state->acquire_ctx = &ctx;
+
+retry:
+   crtc_state = drm_atomic_get_crtc_state(state, crtc);
+   if (!IS_ERR(crtc_state)) {
+   struct rcar_du_crtc_state *rcrtc_state;
+
+   rcrtc_state = to_rcar_crtc_state(crtc_state);
+   rcrtc_state->crc.source = source;
+   rcrtc_state->crc.index = index;
+
+   ret = drm_atomic_commit(state);
+   } else {
+   ret = PTR_ERR(crtc_state);
+   }
+
+   if (ret == -EDEADLK) {
+   drm_atomic_state_clear(state);
+   drm_modeset_backoff(&ctx);
+   goto retry;
+   }
+
+   drm_ato

[PATCH v2 4/8] v4l: vsp1: Document the vsp1_du_atomic_config structure

2018-04-22 Thread Laurent Pinchart
The structure is used in the API that the VSP1 driver exposes to the DU
driver. Documenting it is thus important.

Signed-off-by: Laurent Pinchart 
---
Changes since v1:

- Fixed typo
---
 include/media/vsp1.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/include/media/vsp1.h b/include/media/vsp1.h
index 68a8abe4fac5..ff7ef894465d 100644
--- a/include/media/vsp1.h
+++ b/include/media/vsp1.h
@@ -41,6 +41,16 @@ struct vsp1_du_lif_config {
 int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index,
  const struct vsp1_du_lif_config *cfg);
 
+/**
+ * struct vsp1_du_atomic_config - VSP atomic configuration parameters
+ * @pixelformat: plane pixel format (V4L2 4CC)
+ * @pitch: line pitch in bytes, for all planes
+ * @mem: DMA memory address for each plane of the frame buffer
+ * @src: source rectangle in the frame buffer (integer coordinates)
+ * @dst: destination rectangle on the display (integer coordinates)
+ * @alpha: alpha value (0: fully transparent, 255: fully opaque)
+ * @zpos: Z position of the plane (from 0 to number of planes minus 1)
+ */
 struct vsp1_du_atomic_config {
u32 pixelformat;
unsigned int pitch;
-- 
Regards,

Laurent Pinchart

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 6/8] v4l: vsp1: Add support for the DISCOM entity

2018-04-22 Thread Laurent Pinchart
The DISCOM calculates a CRC on a configurable window of the frame. It
interfaces to the VSP through the UIF glue, hence the name used in the
code.

The module supports configuration of the CRC window through the crop
rectangle on the ink pad of the corresponding entity. However, unlike
the traditional V4L2 subdevice model, the crop rectangle does not
influence the format on the source pad.

Modeling the DISCOM as a sink-only entity would allow adhering to the
V4L2 subdevice model at the expense of more complex code in the driver,
as at the hardware level the UIF is handled as a sink+source entity. As
the DISCOM is only present in R-Car Gen3 VSP-D and VSP-DL instances it
is not exposed to userspace through V4L2 but controlled through the DU
driver. We can thus change this model later if needed without fear of
affecting userspace.

Signed-off-by: Laurent Pinchart 
---
Changes since v1:

- Don't return uninitialized value from uif_set_selection()
---
 drivers/media/platform/vsp1/Makefile  |   2 +-
 drivers/media/platform/vsp1/vsp1.h|   4 +
 drivers/media/platform/vsp1/vsp1_drv.c|  20 +++
 drivers/media/platform/vsp1/vsp1_entity.c |   6 +
 drivers/media/platform/vsp1/vsp1_entity.h |   1 +
 drivers/media/platform/vsp1/vsp1_regs.h   |  41 +
 drivers/media/platform/vsp1/vsp1_uif.c| 271 ++
 drivers/media/platform/vsp1/vsp1_uif.h|  32 
 8 files changed, 376 insertions(+), 1 deletion(-)
 create mode 100644 drivers/media/platform/vsp1/vsp1_uif.c
 create mode 100644 drivers/media/platform/vsp1/vsp1_uif.h

diff --git a/drivers/media/platform/vsp1/Makefile 
b/drivers/media/platform/vsp1/Makefile
index 596775f932c0..4bb4dcbef7b5 100644
--- a/drivers/media/platform/vsp1/Makefile
+++ b/drivers/media/platform/vsp1/Makefile
@@ -5,6 +5,6 @@ vsp1-y  += vsp1_rpf.o 
vsp1_rwpf.o vsp1_wpf.o
 vsp1-y += vsp1_clu.o vsp1_hsit.o vsp1_lut.o
 vsp1-y += vsp1_brx.o vsp1_sru.o vsp1_uds.o
 vsp1-y += vsp1_hgo.o vsp1_hgt.o vsp1_histo.o
-vsp1-y += vsp1_lif.o
+vsp1-y += vsp1_lif.o vsp1_uif.o
 
 obj-$(CONFIG_VIDEO_RENESAS_VSP1)   += vsp1.o
diff --git a/drivers/media/platform/vsp1/vsp1.h 
b/drivers/media/platform/vsp1/vsp1.h
index 9cf4e1c4b036..33f632331474 100644
--- a/drivers/media/platform/vsp1/vsp1.h
+++ b/drivers/media/platform/vsp1/vsp1.h
@@ -36,10 +36,12 @@ struct vsp1_lut;
 struct vsp1_rwpf;
 struct vsp1_sru;
 struct vsp1_uds;
+struct vsp1_uif;
 
 #define VSP1_MAX_LIF   2
 #define VSP1_MAX_RPF   5
 #define VSP1_MAX_UDS   3
+#define VSP1_MAX_UIF   2
 #define VSP1_MAX_WPF   4
 
 #define VSP1_HAS_LUT   (1 << 1)
@@ -60,6 +62,7 @@ struct vsp1_device_info {
unsigned int lif_count;
unsigned int rpf_count;
unsigned int uds_count;
+   unsigned int uif_count;
unsigned int wpf_count;
unsigned int num_bru_inputs;
bool uapi;
@@ -86,6 +89,7 @@ struct vsp1_device {
struct vsp1_rwpf *rpf[VSP1_MAX_RPF];
struct vsp1_sru *sru;
struct vsp1_uds *uds[VSP1_MAX_UDS];
+   struct vsp1_uif *uif[VSP1_MAX_UIF];
struct vsp1_rwpf *wpf[VSP1_MAX_WPF];
 
struct list_head entities;
diff --git a/drivers/media/platform/vsp1/vsp1_drv.c 
b/drivers/media/platform/vsp1/vsp1_drv.c
index 331a2e0af0d3..d29f9c4baebe 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -35,6 +35,7 @@
 #include "vsp1_rwpf.h"
 #include "vsp1_sru.h"
 #include "vsp1_uds.h"
+#include "vsp1_uif.h"
 #include "vsp1_video.h"
 
 /* 
-
@@ -409,6 +410,19 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
list_add_tail(&uds->entity.list_dev, &vsp1->entities);
}
 
+   for (i = 0; i < vsp1->info->uif_count; ++i) {
+   struct vsp1_uif *uif;
+
+   uif = vsp1_uif_create(vsp1, i);
+   if (IS_ERR(uif)) {
+   ret = PTR_ERR(uif);
+   goto done;
+   }
+
+   vsp1->uif[i] = uif;
+   list_add_tail(&uif->entity.list_dev, &vsp1->entities);
+   }
+
for (i = 0; i < vsp1->info->wpf_count; ++i) {
struct vsp1_rwpf *wpf;
 
@@ -513,6 +527,9 @@ static int vsp1_device_init(struct vsp1_device *vsp1)
for (i = 0; i < vsp1->info->uds_count; ++i)
vsp1_write(vsp1, VI6_DPR_UDS_ROUTE(i), VI6_DPR_NODE_UNUSED);
 
+   for (i = 0; i < vsp1->info->uif_count; ++i)
+   vsp1_write(vsp1, VI6_DPR_UIF_ROUTE(i), VI6_DPR_NODE_UNUSED);
+
vsp1_write(vsp1, VI6_DPR_SRU_ROUTE, VI6_DPR_NODE_UNUSED);
vsp1_write(vsp1, VI6_DPR_LUT_ROUTE, VI6_DPR_NODE_UNUSED);
vsp1_write(vsp1, VI6_DPR_CLU_ROUTE, VI6_DPR_NODE_UNUSED);

[PATCH v2 2/8] v4l: vsp1: Share the CLU, LIF and LUT set_fmt pad operation code

2018-04-22 Thread Laurent Pinchart
The implementation of the set_fmt pad operation is identical in the
three modules. Move it to a generic helper function.

Signed-off-by: Laurent Pinchart 
---
 drivers/media/platform/vsp1/vsp1_clu.c| 65 +--
 drivers/media/platform/vsp1/vsp1_entity.c | 75 +++
 drivers/media/platform/vsp1/vsp1_entity.h |  6 +++
 drivers/media/platform/vsp1/vsp1_lif.c| 65 +--
 drivers/media/platform/vsp1/vsp1_lut.c| 65 +--
 5 files changed, 116 insertions(+), 160 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_clu.c 
b/drivers/media/platform/vsp1/vsp1_clu.c
index 9626b6308585..96a448e1504c 100644
--- a/drivers/media/platform/vsp1/vsp1_clu.c
+++ b/drivers/media/platform/vsp1/vsp1_clu.c
@@ -114,18 +114,18 @@ static const struct v4l2_ctrl_config clu_mode_control = {
  * V4L2 Subdevice Pad Operations
  */
 
+static const unsigned int clu_codes[] = {
+   MEDIA_BUS_FMT_ARGB_1X32,
+   MEDIA_BUS_FMT_AHSV_1X32,
+   MEDIA_BUS_FMT_AYUV8_1X32,
+};
+
 static int clu_enum_mbus_code(struct v4l2_subdev *subdev,
  struct v4l2_subdev_pad_config *cfg,
  struct v4l2_subdev_mbus_code_enum *code)
 {
-   static const unsigned int codes[] = {
-   MEDIA_BUS_FMT_ARGB_1X32,
-   MEDIA_BUS_FMT_AHSV_1X32,
-   MEDIA_BUS_FMT_AYUV8_1X32,
-   };
-
-   return vsp1_subdev_enum_mbus_code(subdev, cfg, code, codes,
- ARRAY_SIZE(codes));
+   return vsp1_subdev_enum_mbus_code(subdev, cfg, code, clu_codes,
+ ARRAY_SIZE(clu_codes));
 }
 
 static int clu_enum_frame_size(struct v4l2_subdev *subdev,
@@ -141,51 +141,10 @@ static int clu_set_format(struct v4l2_subdev *subdev,
  struct v4l2_subdev_pad_config *cfg,
  struct v4l2_subdev_format *fmt)
 {
-   struct vsp1_clu *clu = to_clu(subdev);
-   struct v4l2_subdev_pad_config *config;
-   struct v4l2_mbus_framefmt *format;
-   int ret = 0;
-
-   mutex_lock(&clu->entity.lock);
-
-   config = vsp1_entity_get_pad_config(&clu->entity, cfg, fmt->which);
-   if (!config) {
-   ret = -EINVAL;
-   goto done;
-   }
-
-   /* Default to YUV if the requested format is not supported. */
-   if (fmt->format.code != MEDIA_BUS_FMT_ARGB_1X32 &&
-   fmt->format.code != MEDIA_BUS_FMT_AHSV_1X32 &&
-   fmt->format.code != MEDIA_BUS_FMT_AYUV8_1X32)
-   fmt->format.code = MEDIA_BUS_FMT_AYUV8_1X32;
-
-   format = vsp1_entity_get_pad_format(&clu->entity, config, fmt->pad);
-
-   if (fmt->pad == CLU_PAD_SOURCE) {
-   /* The CLU output format can't be modified. */
-   fmt->format = *format;
-   goto done;
-   }
-
-   format->code = fmt->format.code;
-   format->width = clamp_t(unsigned int, fmt->format.width,
-   CLU_MIN_SIZE, CLU_MAX_SIZE);
-   format->height = clamp_t(unsigned int, fmt->format.height,
-CLU_MIN_SIZE, CLU_MAX_SIZE);
-   format->field = V4L2_FIELD_NONE;
-   format->colorspace = V4L2_COLORSPACE_SRGB;
-
-   fmt->format = *format;
-
-   /* Propagate the format to the source pad. */
-   format = vsp1_entity_get_pad_format(&clu->entity, config,
-   CLU_PAD_SOURCE);
-   *format = fmt->format;
-
-done:
-   mutex_unlock(&clu->entity.lock);
-   return ret;
+   return vsp1_subdev_set_pad_format(subdev, cfg, fmt, clu_codes,
+ ARRAY_SIZE(clu_codes),
+ CLU_MIN_SIZE, CLU_MIN_SIZE,
+ CLU_MAX_SIZE, CLU_MAX_SIZE);
 }
 
 /* 
-
diff --git a/drivers/media/platform/vsp1/vsp1_entity.c 
b/drivers/media/platform/vsp1/vsp1_entity.c
index 72354caf5746..239df047efd0 100644
--- a/drivers/media/platform/vsp1/vsp1_entity.c
+++ b/drivers/media/platform/vsp1/vsp1_entity.c
@@ -307,6 +307,81 @@ int vsp1_subdev_enum_frame_size(struct v4l2_subdev *subdev,
return ret;
 }
 
+/*
+ * vsp1_subdev_set_pad_format - Subdev pad set_fmt handler
+ * @subdev: V4L2 subdevice
+ * @cfg: V4L2 subdev pad configuration
+ * @fmt: V4L2 subdev format
+ * @codes: Array of supported media bus codes
+ * @ncodes: Number of supported media bus codes
+ * @min_width: Minimum image width
+ * @min_height: Minimum image height
+ * @max_width: Maximum image width
+ * @max_height: Maximum image height
+ *
+ * This function implements the subdev set_fmt pad operation for entities that
+ * do not support scaling or cropping. It defaults to the first supplied media
+ * bus code if the requested code isn't supported, clamps the size to

[PATCH v2 3/8] v4l: vsp1: Reset the crop and compose rectangles in the set_fmt helper

2018-04-22 Thread Laurent Pinchart
To make vsp1_subdev_set_pad_format() usable by entities that support
selection rectangles, we need to reset the crop and compose rectangles
when setting the format on the sink pad. Do so and replace the custom
set_fmt implementation of the histogram code by a call to
vsp1_subdev_set_pad_format().

Resetting the crop and compose rectangles for entities that don't
support crop and compose has no adverse effect as the rectangles are
ignored anyway.

Signed-off-by: Laurent Pinchart 
---
 drivers/media/platform/vsp1/vsp1_entity.c | 16 +
 drivers/media/platform/vsp1/vsp1_histo.c  | 59 +++
 2 files changed, 20 insertions(+), 55 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_entity.c 
b/drivers/media/platform/vsp1/vsp1_entity.c
index 239df047efd0..181a583aecad 100644
--- a/drivers/media/platform/vsp1/vsp1_entity.c
+++ b/drivers/media/platform/vsp1/vsp1_entity.c
@@ -335,6 +335,7 @@ int vsp1_subdev_set_pad_format(struct v4l2_subdev *subdev,
struct vsp1_entity *entity = to_vsp1_entity(subdev);
struct v4l2_subdev_pad_config *config;
struct v4l2_mbus_framefmt *format;
+   struct v4l2_rect *selection;
unsigned int i;
int ret = 0;
 
@@ -377,6 +378,21 @@ int vsp1_subdev_set_pad_format(struct v4l2_subdev *subdev,
format = vsp1_entity_get_pad_format(entity, config, 1);
*format = fmt->format;
 
+   /* Reset the crop and compose rectangles */
+   selection = vsp1_entity_get_pad_selection(entity, config, fmt->pad,
+ V4L2_SEL_TGT_CROP);
+   selection->left = 0;
+   selection->top = 0;
+   selection->width = format->width;
+   selection->height = format->height;
+
+   selection = vsp1_entity_get_pad_selection(entity, config, fmt->pad,
+ V4L2_SEL_TGT_COMPOSE);
+   selection->left = 0;
+   selection->top = 0;
+   selection->width = format->width;
+   selection->height = format->height;
+
 done:
mutex_unlock(&entity->lock);
return ret;
diff --git a/drivers/media/platform/vsp1/vsp1_histo.c 
b/drivers/media/platform/vsp1/vsp1_histo.c
index 029181c1fb61..5e15c8ff88d9 100644
--- a/drivers/media/platform/vsp1/vsp1_histo.c
+++ b/drivers/media/platform/vsp1/vsp1_histo.c
@@ -389,65 +389,14 @@ static int histo_set_format(struct v4l2_subdev *subdev,
struct v4l2_subdev_format *fmt)
 {
struct vsp1_histogram *histo = subdev_to_histo(subdev);
-   struct v4l2_subdev_pad_config *config;
-   struct v4l2_mbus_framefmt *format;
-   struct v4l2_rect *selection;
-   unsigned int i;
-   int ret = 0;
 
if (fmt->pad != HISTO_PAD_SINK)
return histo_get_format(subdev, cfg, fmt);
 
-   mutex_lock(&histo->entity.lock);
-
-   config = vsp1_entity_get_pad_config(&histo->entity, cfg, fmt->which);
-   if (!config) {
-   ret = -EINVAL;
-   goto done;
-   }
-
-   /*
-* Default to the first format if the requested format is not
-* supported.
-*/
-   for (i = 0; i < histo->num_formats; ++i) {
-   if (fmt->format.code == histo->formats[i])
-   break;
-   }
-   if (i == histo->num_formats)
-   fmt->format.code = histo->formats[0];
-
-   format = vsp1_entity_get_pad_format(&histo->entity, config, fmt->pad);
-
-   format->code = fmt->format.code;
-   format->width = clamp_t(unsigned int, fmt->format.width,
-   HISTO_MIN_SIZE, HISTO_MAX_SIZE);
-   format->height = clamp_t(unsigned int, fmt->format.height,
-HISTO_MIN_SIZE, HISTO_MAX_SIZE);
-   format->field = V4L2_FIELD_NONE;
-   format->colorspace = V4L2_COLORSPACE_SRGB;
-
-   fmt->format = *format;
-
-   /* Reset the crop and compose rectangles */
-   selection = vsp1_entity_get_pad_selection(&histo->entity, config,
- fmt->pad, V4L2_SEL_TGT_CROP);
-   selection->left = 0;
-   selection->top = 0;
-   selection->width = format->width;
-   selection->height = format->height;
-
-   selection = vsp1_entity_get_pad_selection(&histo->entity, config,
- fmt->pad,
- V4L2_SEL_TGT_COMPOSE);
-   selection->left = 0;
-   selection->top = 0;
-   selection->width = format->width;
-   selection->height = format->height;
-
-done:
-   mutex_unlock(&histo->entity.lock);
-   return ret;
+   return vsp1_subdev_set_pad_format(subdev, cfg, fmt,
+ histo->formats, histo->num_formats,
+ HISTO_MIN_SIZE, HISTO_MIN_SIZE,
+ HISTO_MAX_SIZE, HISTO_MAX_SIZE);
 }
 
 static const struct v4l2_subd

[PATCH v2 7/8] v4l: vsp1: Integrate DISCOM in display pipeline

2018-04-22 Thread Laurent Pinchart
The DISCOM is used to compute CRCs on display frames. Integrate it in
the display pipeline at the output of the blending unit to process
output frames.

Computing CRCs on input frames is possible by positioning the DISCOM at
a different point in the pipeline. This use case isn't supported at the
moment and could be implemented by extending the API between the VSP1
and DU drivers if needed.

Signed-off-by: Laurent Pinchart 
---
 drivers/media/platform/vsp1/vsp1_drm.c | 115 -
 drivers/media/platform/vsp1/vsp1_drm.h |  12 
 2 files changed, 124 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_drm.c 
b/drivers/media/platform/vsp1/vsp1_drm.c
index 5fc31578f9b0..7864b43a90e1 100644
--- a/drivers/media/platform/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/vsp1/vsp1_drm.c
@@ -22,6 +22,7 @@
 #include "vsp1_lif.h"
 #include "vsp1_pipe.h"
 #include "vsp1_rwpf.h"
+#include "vsp1_uif.h"
 
 #define BRX_NAME(e)(e)->type == VSP1_ENTITY_BRU ? "BRU" : "BRS"
 
@@ -35,8 +36,13 @@ static void vsp1_du_pipeline_frame_end(struct vsp1_pipeline 
*pipe,
struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe);
bool complete = completion == VSP1_DL_FRAME_END_COMPLETED;
 
-   if (drm_pipe->du_complete)
-   drm_pipe->du_complete(drm_pipe->du_private, complete, 0);
+   if (drm_pipe->du_complete) {
+   struct vsp1_entity *uif = drm_pipe->uif;
+   u32 crc;
+
+   crc = uif ? vsp1_uif_get_crc(to_uif(&uif->subdev)) : 0;
+   drm_pipe->du_complete(drm_pipe->du_private, complete, crc);
+   }
 
if (completion & VSP1_DL_FRAME_END_INTERNAL) {
drm_pipe->force_brx_release = false;
@@ -48,10 +54,65 @@ static void vsp1_du_pipeline_frame_end(struct vsp1_pipeline 
*pipe,
  * Pipeline Configuration
  */
 
+/*
+ * Insert the UIF in the pipeline between the prev and next entities. If no UIF
+ * is available connect the two entities directly.
+ */
+static int vsp1_du_insert_uif(struct vsp1_device *vsp1,
+ struct vsp1_pipeline *pipe,
+ struct vsp1_entity *uif,
+ struct vsp1_entity *prev, unsigned int prev_pad,
+ struct vsp1_entity *next, unsigned int next_pad)
+{
+   int ret;
+
+   if (uif) {
+   struct v4l2_subdev_format format;
+
+   prev->sink = uif;
+   prev->sink_pad = UIF_PAD_SINK;
+
+   memset(&format, 0, sizeof(format));
+   format.which = V4L2_SUBDEV_FORMAT_ACTIVE;
+   format.pad = prev_pad;
+
+   ret = v4l2_subdev_call(&prev->subdev, pad, get_fmt, NULL,
+  &format);
+   if (ret < 0)
+   return ret;
+
+   format.pad = UIF_PAD_SINK;
+
+   ret = v4l2_subdev_call(&uif->subdev, pad, set_fmt, NULL,
+  &format);
+   if (ret < 0)
+   return ret;
+
+   dev_dbg(vsp1->dev, "%s: set format %ux%u (%x) on UIF sink\n",
+   __func__, format.format.width, format.format.height,
+   format.format.code);
+
+   /*
+* The UIF doesn't mangle the format between its sink and
+* source pads, so there is no need to retrieve the format on
+* its source pad.
+*/
+
+   uif->sink = next;
+   uif->sink_pad = next_pad;
+   } else {
+   prev->sink = next;
+   prev->sink_pad = next_pad;
+   }
+
+   return 0;
+}
+
 /* Setup one RPF and the connected BRx sink pad. */
 static int vsp1_du_pipeline_setup_rpf(struct vsp1_device *vsp1,
  struct vsp1_pipeline *pipe,
  struct vsp1_rwpf *rpf,
+ struct vsp1_entity *uif,
  unsigned int brx_input)
 {
struct v4l2_subdev_selection sel;
@@ -122,6 +183,12 @@ static int vsp1_du_pipeline_setup_rpf(struct vsp1_device 
*vsp1,
if (ret < 0)
return ret;
 
+   /* Insert and configure the UIF if available. */
+   ret = vsp1_du_insert_uif(vsp1, pipe, uif, &rpf->entity, RWPF_PAD_SOURCE,
+pipe->brx, brx_input);
+   if (ret < 0)
+   return ret;
+
/* BRx sink, propagate the format from the RPF source. */
format.pad = brx_input;
 
@@ -297,7 +364,10 @@ static unsigned int rpf_zpos(struct vsp1_device *vsp1, 
struct vsp1_rwpf *rpf)
 static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,
struct vsp1_pipeline *pipe)
 {
+   struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe);
struct vsp1_rwpf *inputs[VSP1_MAX_RPF] = { NULL, };

[PATCH v2 5/8] v4l: vsp1: Extend the DU API to support CRC computation

2018-04-22 Thread Laurent Pinchart
Add a parameter (in the form of a structure to ease future API
extensions) to the VSP atomic flush handler to pass CRC source
configuration, and pass the CRC value to the completion callback.

Signed-off-by: Laurent Pinchart 
---
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c  |  6 --
 drivers/media/platform/vsp1/vsp1_drm.c |  6 --
 drivers/media/platform/vsp1/vsp1_drm.h |  2 +-
 include/media/vsp1.h   | 29 +++--
 4 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c 
b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
index 2c260c33840b..bdcec201591f 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
@@ -31,7 +31,7 @@
 #include "rcar_du_kms.h"
 #include "rcar_du_vsp.h"
 
-static void rcar_du_vsp_complete(void *private, bool completed)
+static void rcar_du_vsp_complete(void *private, bool completed, u32 crc)
 {
struct rcar_du_crtc *crtc = private;
 
@@ -102,7 +102,9 @@ void rcar_du_vsp_atomic_begin(struct rcar_du_crtc *crtc)
 
 void rcar_du_vsp_atomic_flush(struct rcar_du_crtc *crtc)
 {
-   vsp1_du_atomic_flush(crtc->vsp->vsp, crtc->vsp_pipe);
+   struct vsp1_du_atomic_pipe_config cfg = { { 0, } };
+
+   vsp1_du_atomic_flush(crtc->vsp->vsp, crtc->vsp_pipe, &cfg);
 }
 
 /* Keep the two tables in sync. */
diff --git a/drivers/media/platform/vsp1/vsp1_drm.c 
b/drivers/media/platform/vsp1/vsp1_drm.c
index 2b29a83dceb9..5fc31578f9b0 100644
--- a/drivers/media/platform/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/vsp1/vsp1_drm.c
@@ -36,7 +36,7 @@ static void vsp1_du_pipeline_frame_end(struct vsp1_pipeline 
*pipe,
bool complete = completion == VSP1_DL_FRAME_END_COMPLETED;
 
if (drm_pipe->du_complete)
-   drm_pipe->du_complete(drm_pipe->du_private, complete);
+   drm_pipe->du_complete(drm_pipe->du_private, complete, 0);
 
if (completion & VSP1_DL_FRAME_END_INTERNAL) {
drm_pipe->force_brx_release = false;
@@ -739,8 +739,10 @@ EXPORT_SYMBOL_GPL(vsp1_du_atomic_update);
  * vsp1_du_atomic_flush - Commit an atomic update
  * @dev: the VSP device
  * @pipe_index: the DRM pipeline index
+ * @cfg: atomic pipe configuration
  */
-void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index)
+void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index,
+ const struct vsp1_du_atomic_pipe_config *cfg)
 {
struct vsp1_device *vsp1 = dev_get_drvdata(dev);
struct vsp1_drm_pipeline *drm_pipe = &vsp1->drm->pipe[pipe_index];
diff --git a/drivers/media/platform/vsp1/vsp1_drm.h 
b/drivers/media/platform/vsp1/vsp1_drm.h
index f4af1b2b12d6..e5b88b28806c 100644
--- a/drivers/media/platform/vsp1/vsp1_drm.h
+++ b/drivers/media/platform/vsp1/vsp1_drm.h
@@ -35,7 +35,7 @@ struct vsp1_drm_pipeline {
wait_queue_head_t wait_queue;
 
/* Frame synchronisation */
-   void (*du_complete)(void *, bool);
+   void (*du_complete)(void *data, bool completed, u32 crc);
void *du_private;
 };
 
diff --git a/include/media/vsp1.h b/include/media/vsp1.h
index ff7ef894465d..ac63a9928a79 100644
--- a/include/media/vsp1.h
+++ b/include/media/vsp1.h
@@ -34,7 +34,7 @@ struct vsp1_du_lif_config {
unsigned int width;
unsigned int height;
 
-   void (*callback)(void *, bool);
+   void (*callback)(void *data, bool completed, u32 crc);
void *callback_data;
 };
 
@@ -61,11 +61,36 @@ struct vsp1_du_atomic_config {
unsigned int zpos;
 };
 
+/**
+ * enum vsp1_du_crc_source - Source used for CRC calculation
+ * @VSP1_DU_CRC_NONE: CRC calculation disabled
+ * @VSP_DU_CRC_PLANE: Perform CRC calculation on an input plane
+ * @VSP_DU_CRC_OUTPUT: Perform CRC calculation on the composed output
+ */
+enum vsp1_du_crc_source {
+   VSP1_DU_CRC_NONE,
+   VSP1_DU_CRC_PLANE,
+   VSP1_DU_CRC_OUTPUT,
+};
+
+/**
+ * struct vsp1_du_atomic_pipe_config - VSP atomic pipe configuration parameters
+ * @crc.source: source for CRC calculation
+ * @crc.index: index of the CRC source plane (when crc.source is set to plane)
+ */
+struct vsp1_du_atomic_pipe_config {
+   struct  {
+   enum vsp1_du_crc_source source;
+   unsigned int index;
+   } crc;
+};
+
 void vsp1_du_atomic_begin(struct device *dev, unsigned int pipe_index);
 int vsp1_du_atomic_update(struct device *dev, unsigned int pipe_index,
  unsigned int rpf,
  const struct vsp1_du_atomic_config *cfg);
-void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index);
+void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index,
+ const struct vsp1_du_atomic_pipe_config *cfg);
 int vsp1_du_map_sg(struct device *dev, struct sg_table *sgt);
 void vsp1_du_unmap_sg(struct device *dev, struct sg_table *sgt);
 
-- 
Regards,

Laurent Pinchart

___
d

[PATCH v2 1/8] v4l: vsp1: Use SPDX license headers

2018-04-22 Thread Laurent Pinchart
Adopt the SPDX license identifier headers to ease license compliance
management. All files in the driver are licensed under the GPLv2+ except
for the vsp1_regs.h file which is licensed under the GPLv2. This is
likely an oversight, but fixing this requires contacting the copyright
owners and is out of scope for this patch.

While at it fix the file descriptions to match file names where copy and
paste error occurred.

Signed-off-by: Laurent Pinchart 
---
 drivers/media/platform/vsp1/vsp1.h| 6 +-
 drivers/media/platform/vsp1/vsp1_brx.c| 6 +-
 drivers/media/platform/vsp1/vsp1_brx.h| 6 +-
 drivers/media/platform/vsp1/vsp1_clu.c| 6 +-
 drivers/media/platform/vsp1/vsp1_clu.h| 6 +-
 drivers/media/platform/vsp1/vsp1_dl.c | 8 ++--
 drivers/media/platform/vsp1/vsp1_dl.h | 6 +-
 drivers/media/platform/vsp1/vsp1_drm.c| 8 ++--
 drivers/media/platform/vsp1/vsp1_drm.h| 6 +-
 drivers/media/platform/vsp1/vsp1_drv.c| 6 +-
 drivers/media/platform/vsp1/vsp1_entity.c | 6 +-
 drivers/media/platform/vsp1/vsp1_entity.h | 6 +-
 drivers/media/platform/vsp1/vsp1_hgo.c| 6 +-
 drivers/media/platform/vsp1/vsp1_hgo.h| 6 +-
 drivers/media/platform/vsp1/vsp1_hgt.c| 6 +-
 drivers/media/platform/vsp1/vsp1_hgt.h| 6 +-
 drivers/media/platform/vsp1/vsp1_histo.c  | 6 +-
 drivers/media/platform/vsp1/vsp1_histo.h  | 6 +-
 drivers/media/platform/vsp1/vsp1_hsit.c   | 6 +-
 drivers/media/platform/vsp1/vsp1_hsit.h   | 6 +-
 drivers/media/platform/vsp1/vsp1_lif.c| 6 +-
 drivers/media/platform/vsp1/vsp1_lif.h| 6 +-
 drivers/media/platform/vsp1/vsp1_lut.c| 6 +-
 drivers/media/platform/vsp1/vsp1_lut.h| 6 +-
 drivers/media/platform/vsp1/vsp1_pipe.c   | 6 +-
 drivers/media/platform/vsp1/vsp1_pipe.h   | 6 +-
 drivers/media/platform/vsp1/vsp1_regs.h   | 5 +
 drivers/media/platform/vsp1/vsp1_rpf.c| 6 +-
 drivers/media/platform/vsp1/vsp1_rwpf.c   | 6 +-
 drivers/media/platform/vsp1/vsp1_rwpf.h   | 6 +-
 drivers/media/platform/vsp1/vsp1_sru.c| 6 +-
 drivers/media/platform/vsp1/vsp1_sru.h| 6 +-
 drivers/media/platform/vsp1/vsp1_uds.c| 6 +-
 drivers/media/platform/vsp1/vsp1_uds.h| 6 +-
 drivers/media/platform/vsp1/vsp1_video.c  | 6 +-
 drivers/media/platform/vsp1/vsp1_video.h  | 6 +-
 drivers/media/platform/vsp1/vsp1_wpf.c| 6 +-
 37 files changed, 39 insertions(+), 186 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1.h 
b/drivers/media/platform/vsp1/vsp1.h
index 894cc725c2d4..9cf4e1c4b036 100644
--- a/drivers/media/platform/vsp1/vsp1.h
+++ b/drivers/media/platform/vsp1/vsp1.h
@@ -1,14 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * vsp1.h  --  R-Car VSP1 Driver
  *
  * Copyright (C) 2013-2014 Renesas Electronics Corporation
  *
  * Contact: Laurent Pinchart (laurent.pinch...@ideasonboard.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 #ifndef __VSP1_H__
 #define __VSP1_H__
diff --git a/drivers/media/platform/vsp1/vsp1_brx.c 
b/drivers/media/platform/vsp1/vsp1_brx.c
index b4af1d546022..3beec18fd863 100644
--- a/drivers/media/platform/vsp1/vsp1_brx.c
+++ b/drivers/media/platform/vsp1/vsp1_brx.c
@@ -1,14 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * vsp1_brx.c  --  R-Car VSP1 Blend ROP Unit (BRU and BRS)
  *
  * Copyright (C) 2013 Renesas Corporation
  *
  * Contact: Laurent Pinchart (laurent.pinch...@ideasonboard.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include 
diff --git a/drivers/media/platform/vsp1/vsp1_brx.h 
b/drivers/media/platform/vsp1/vsp1_brx.h
index 927aa4254c0f..6abbb8c3343c 100644
--- a/drivers/media/platform/vsp1/vsp1_brx.h
+++ b/drivers/media/platform/vsp1/vsp1_brx.h
@@ -1,14 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * vsp1_brx.h  --  R-Car VSP1 Blend ROP Unit (BRU and BRS)
  *
  * Copyright (C) 2013 Renesas Corporation
  *
  * Contact: Laurent Pinchart (laurent.pinch...@ideasonboard.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 #ifndef __VSP1_BRX_H__
 #define __VSP1_BRX_H__
diff --git a/drivers/media/platform/vsp1/vsp1_clu.c 
b/drivers/media/platform/vsp1/vsp1_clu.c
index f2fb26e5ab4e..9626b6308585 100644
--- a/drivers/media/platform/vsp1/vsp1_clu.c
+++ b/drivers/media/platform/vsp1/vsp1_clu.c
@

[PATCH v2 0/8] R-Car DU: Support CRC calculation

2018-04-22 Thread Laurent Pinchart
Hello,

This patch series adds support for CRC calculation to the rcar-du-drm driver.

CRC calculation is supported starting at the Renesas R-Car Gen3 SoCs, as
earlier versions don't have the necessary hardware. On Gen3 SoCs, the CRC is
computed by the DISCOM module part of the VSP-D and VSP-DL.

The DISCOM is interfaced to the VSP through the UIF glue and appears as a VSP
entity with a sink pad and a source pad.

The series starts with a switch to SPDX license headers in patch 1/8, prompted
by a checkpatch.pl warning for a later patch that complained about missing
SPDX license headers. It then continues with cleanup and refactoring. Patches
2/8 and 3/8 prepare for DISCOM and UIF support by extending generic code to
make it usable for the UIF. Patch 4/8 documents a structure that will receive
new fields.

Patch 5/8 then extends the API exposed by the VSP driver to the DU driver to
support CRC computation configuration and reporting. The patch unfortunately
needs to touch both the VSP and DU drivers, so the whole series will need to
be merged through a single tree.

Patch 5/8 adds support for the DISCOM and UIF in the VSP driver, patch 7/8
integrates it in the DRM pipeline, and patch 8/8 finally implements the CRC
API in the DU driver to expose CRC computation to userspace.

The hardware supports computing the CRC at any arbitrary point in the
pipeline on a configurable window of the frame. This patch series supports CRC
computation on input planes or pipeline output, but on the full frame only.
Support for CRC window configuration can be added later if needed but will
require extending the userspace API, as the DRM/KMS CRC API doesn't support
this feature.

Compared to v1, the CRC source names for plane inputs are now constructed from
plane IDs instead of plane indices. This allows userspace to match CRC sources
with planes.

Note that exposing the DISCOM and UIF though the V4L2 API isn't supported as
the module is only found in VSP-D and VSP-DL instances that are not exposed
through V4L2. It is possible to expose those instances through V4L2 with a
small modification to the driver for testing purpose. If the need arises to
test DISCOM and UIF with such an out-of-tree patch, support for CRC reporting
through a V4L2 control can be added later without affecting how CRC is exposed
through the DRM/KMS API.

The patches are based on top of the "[PATCH v2 00/15] R-Car VSP1: Dynamically
assign blend units to display pipelines" patch series, itself based on top of
the Linux media master branch and scheduled for merge in v4.18. The new base
caused heavy conflicts, requiring this series to be merged through the V4L2
tree. Once the patches receive the necessary review I will ask Dave to ack the
merge plan.

For convenience the patches are available at

git://linuxtv.org/pinchartl/media.git vsp1-discom-v2-20180423

The code has been tested through the kms-test-crc.py script part of the DU
test suite available at

git://git.ideasonboard.com/renesas/kms-tests.git discom

Laurent Pinchart (8):
  v4l: vsp1: Use SPDX license headers
  v4l: vsp1: Share the CLU, LIF and LUT set_fmt pad operation code
  v4l: vsp1: Reset the crop and compose rectangles in the set_fmt helper
  v4l: vsp1: Document the vsp1_du_atomic_config structure
  v4l: vsp1: Extend the DU API to support CRC computation
  v4l: vsp1: Add support for the DISCOM entity
  v4l: vsp1: Integrate DISCOM in display pipeline
  drm: rcar-du: Add support for CRC computation

 drivers/gpu/drm/rcar-du/rcar_du_crtc.c| 156 -
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h|  19 +++
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c |  13 +-
 drivers/media/platform/vsp1/Makefile  |   2 +-
 drivers/media/platform/vsp1/vsp1.h|  10 +-
 drivers/media/platform/vsp1/vsp1_brx.c|   6 +-
 drivers/media/platform/vsp1/vsp1_brx.h|   6 +-
 drivers/media/platform/vsp1/vsp1_clu.c|  71 ++--
 drivers/media/platform/vsp1/vsp1_clu.h|   6 +-
 drivers/media/platform/vsp1/vsp1_dl.c |   8 +-
 drivers/media/platform/vsp1/vsp1_dl.h |   6 +-
 drivers/media/platform/vsp1/vsp1_drm.c| 127 --
 drivers/media/platform/vsp1/vsp1_drm.h|  20 ++-
 drivers/media/platform/vsp1/vsp1_drv.c|  26 ++-
 drivers/media/platform/vsp1/vsp1_entity.c | 103 +++-
 drivers/media/platform/vsp1/vsp1_entity.h |  13 +-
 drivers/media/platform/vsp1/vsp1_hgo.c|   6 +-
 drivers/media/platform/vsp1/vsp1_hgo.h|   6 +-
 drivers/media/platform/vsp1/vsp1_hgt.c|   6 +-
 drivers/media/platform/vsp1/vsp1_hgt.h|   6 +-
 drivers/media/platform/vsp1/vsp1_histo.c  |  65 +--
 drivers/media/platform/vsp1/vsp1_histo.h  |   6 +-
 drivers/media/platform/vsp1/vsp1_hsit.c   |   6 +-
 drivers/media/platform/vsp1/vsp1_hsit.h   |   6 +-
 drivers/media/platform/vsp1/vsp1_lif.c|  71 ++--
 drivers/media/platform/vsp1/vsp1_lif.h|   6 +-
 drivers/media/platform/vsp1/vsp1_lut.c|  71 ++--
 drivers/media/platform/vsp1/vsp1_lut.h   

[PATCH] drm/nouveau: fix temp/pwm visibility, skip hwmon when no sensors exist

2018-04-22 Thread Ilia Mirkin
A NV34 GPU was seeing temp and pwm entries in hwmon, which would error
out when read. These should not have been visible, but also the whole
hwmon object should just not have been registered in the first place.

Signed-off-by: Ilia Mirkin 
---
 drivers/gpu/drm/nouveau/nouveau_hwmon.c | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c 
b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
index 7c965648df80..44178b4c3599 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
@@ -327,7 +327,7 @@ nouveau_temp_is_visible(const void *data, u32 attr, int 
channel)
struct nouveau_drm *drm = nouveau_drm((struct drm_device *)data);
struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
 
-   if (therm && therm->attr_get && nvkm_therm_temp_get(therm) < 0)
+   if (!therm || !therm->attr_get || nvkm_therm_temp_get(therm) < 0)
return 0;
 
switch (attr) {
@@ -351,8 +351,8 @@ nouveau_pwm_is_visible(const void *data, u32 attr, int 
channel)
struct nouveau_drm *drm = nouveau_drm((struct drm_device *)data);
struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
 
-   if (therm && therm->attr_get && therm->fan_get &&
-   therm->fan_get(therm) < 0)
+   if (!therm || !therm->attr_get || !therm->fan_get ||
+   therm->fan_get(therm) < 0)
return 0;
 
switch (attr) {
@@ -707,13 +707,20 @@ nouveau_hwmon_init(struct drm_device *dev)
 {
 #if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE))
struct nouveau_drm *drm = nouveau_drm(dev);
+   struct nvkm_iccsense *iccsense = nvxx_iccsense(&drm->client.device);
struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
+   struct nvkm_volt *volt = nvxx_volt(&drm->client.device);
const struct attribute_group *special_groups[N_ATTR_GROUPS];
struct nouveau_hwmon *hwmon;
struct device *hwmon_dev;
int ret = 0;
int i = 0;
 
+   if (!iccsense && !therm && !volt) {
+   NV_DEBUG(drm, "Skipping hwmon registration\n");
+   return 0;
+   }
+
hwmon = drm->hwmon = kzalloc(sizeof(*hwmon), GFP_KERNEL);
if (!hwmon)
return -ENOMEM;
@@ -749,6 +756,9 @@ nouveau_hwmon_fini(struct drm_device *dev)
 #if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE))
struct nouveau_hwmon *hwmon = nouveau_hwmon(dev);
 
+   if (!hwmon)
+   return;
+
if (hwmon->hwmon)
hwmon_device_unregister(hwmon->hwmon);
 
-- 
2.16.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/vc4: Add support for plane alpha

2018-04-22 Thread kbuild test robot
Hi Stefan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v4.17-rc1]
[also build test ERROR on next-20180420]
[cannot apply to anholt/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Stefan-Schake/drm-vc4-Add-support-for-plane-alpha/20180423-002110
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sh 

All errors (new ones prefixed by >>):

   drivers/gpu/drm/vc4/vc4_plane.c: In function 'vc4_plane_reset':
>> drivers/gpu/drm/vc4/vc4_plane.c:204:14: error: 'struct drm_plane_state' has 
>> no member named 'alpha'
 plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE;
 ^~
>> drivers/gpu/drm/vc4/vc4_plane.c:204:24: error: 'DRM_BLEND_ALPHA_OPAQUE' 
>> undeclared (first use in this function)
 plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE;
   ^~
   drivers/gpu/drm/vc4/vc4_plane.c:204:24: note: each undeclared identifier is 
reported only once for each function it appears in
   In file included from drivers/gpu/drm/vc4/vc4_plane.c:28:0:
   drivers/gpu/drm/vc4/vc4_plane.c: In function 'vc4_plane_mode_set':
   drivers/gpu/drm/vc4/vc4_plane.c:557:23: error: 'struct drm_plane_state' has 
no member named 'alpha'
   VC4_SET_FIELD(state->alpha >> 8, SCALER_POS0_FIXED_ALPHA) |
  ^
   drivers/gpu/drm/vc4/vc4_regs.h:18:24: note: in definition of macro 
'VC4_SET_FIELD'
  uint32_t fieldval = (value) << field##_SHIFT;  \
   ^
   drivers/gpu/drm/vc4/vc4_plane.c:574:25: error: 'struct drm_plane_state' has 
no member named 'alpha'
 mix_plane_alpha = state->alpha != DRM_BLEND_ALPHA_OPAQUE &&
^~
   drivers/gpu/drm/vc4/vc4_plane.c:574:36: error: 'DRM_BLEND_ALPHA_OPAQUE' 
undeclared (first use in this function)
 mix_plane_alpha = state->alpha != DRM_BLEND_ALPHA_OPAQUE &&
   ^~
   drivers/gpu/drm/vc4/vc4_plane.c: In function 'vc4_plane_init':
>> drivers/gpu/drm/vc4/vc4_plane.c:952:2: error: implicit declaration of 
>> function 'drm_plane_create_alpha_property'; did you mean 
>> 'drm_plane_create_zpos_property'? [-Werror=implicit-function-declaration]
 drm_plane_create_alpha_property(plane);
 ^~~
 drm_plane_create_zpos_property
   cc1: some warnings being treated as errors

vim +204 drivers/gpu/drm/vc4/vc4_plane.c

   191  
   192  /* Called during init to allocate the plane's atomic state. */
   193  static void vc4_plane_reset(struct drm_plane *plane)
   194  {
   195  struct vc4_plane_state *vc4_state;
   196  
   197  WARN_ON(plane->state);
   198  
   199  vc4_state = kzalloc(sizeof(*vc4_state), GFP_KERNEL);
   200  if (!vc4_state)
   201  return;
   202  
   203  plane->state = &vc4_state->base;
 > 204  plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE;
   205  vc4_state->base.plane = plane;
   206  }
   207  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 106177] overclocking doesn't work with 4.17-rc1

2018-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106177

Bug ID: 106177
   Summary: overclocking doesn't work with 4.17-rc1
   Product: DRI
   Version: DRI git
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: haa...@frickel.club

RX 480.

I noticed a while ago that overclocking didn't work on
drm-next-4.17-wip/drm-next-4.18-wip, but now it's gotten into mainline.

With linux 4.16.3 overclockling works fine.

With 4.17-rc1 the setting doesn't "stick" and the clocks aren't increased:

root@c-pc ~ # cat /sys/class/drm/card0/device/pp_sclk_od
0
root@c-pc ~ # cat /sys/class/drm/card0/device/pp_dpm_sclk
0: 300Mhz *
1: 608Mhz
2: 910Mhz
3: 1077Mhz
4: 1145Mhz
5: 1191Mhz
6: 1236Mhz
7: 1288Mhz
root@c-pc ~ # echo 2 > /sys/class/drm/card0/device/pp_sclk_od
root@c-pc ~ # cat /sys/class/drm/card0/device/pp_sclk_od
0
root@c-pc ~ # cat /sys/class/drm/card0/device/pp_dpm_sclk
0: 300Mhz *
1: 608Mhz
2: 910Mhz
3: 1077Mhz
4: 1145Mhz
5: 1191Mhz
6: 1236Mhz
7: 1288Mhz

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[radeon-alex:amd-staging-drm-next 226/251] drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:494:25: sparse: cast to restricted __le16

2018-04-22 Thread kbuild test robot
tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head:   a0c072e23e6f2543a12009d312387356c870f14f
commit: ace1073bfa90b6ccc9c2d9959c3603008d656b3d [226/251] drm/amdgpu: add save 
restore list cntl gpm and srm firmware support
reproduce:
# apt-get install sparse
git checkout ace1073bfa90b6ccc9c2d9959c3603008d656b3d
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   drivers/gpu/drm/amd/amdgpu/clearstate_gfx9.h:937:7: sparse: Using plain 
integer as NULL pointer
   drivers/gpu/drm/amd/amdgpu/clearstate_gfx9.h:941:7: sparse: Using plain 
integer as NULL pointer
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:339:28: sparse: incorrect type in 
assignment (different base types) @@expected unsigned int volatile 
[unsigned] [usertype]  @@got latile [unsigned] [usertype] 
 @@
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:339:28:expected unsigned int 
volatile [unsigned] [usertype] 
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:339:28:got restricted __le32 
[usertype] 
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:408:41: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:409:46: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:410:59: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:411:64: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:412:41: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:413:46: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:414:58: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:415:63: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:416:41: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:417:46: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:418:58: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:419:63: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:421:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:462:36: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:463:41: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:473:35: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:474:40: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:484:35: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:485:40: sparse: cast to restricted 
__le32
>> drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:494:25: sparse: cast to restricted 
>> __le16
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:495:25: sparse: cast to restricted 
__le16
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:499:36: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:500:41: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:502:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:504:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:506:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:508:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:510:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:512:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:514:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:516:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:518:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:528:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:530:57: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:535:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:537:53: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:550:36: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:551:41: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:563:17: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:565:17: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:577:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:577:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:577:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:584:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:584:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:584:25: sparse: cast to restricted 
__le32
   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:5

[Bug 102646] [dc] Screen flickering under amdgpu-experimental [buggy auto power profile]

2018-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=102646

--- Comment #28 from Justin Mitzel  ---
I'm not sure what the status of this bug is, but it's only gotten worse with
kernel 4.16 and the amd-staging-drm-next branch.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 105883] booting with kernel using amd-staging-drm-next on 2400G hangs

2018-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105883

--- Comment #13 from Joshua Lee  ---
To be clear, the Furmark was being run in his host system, not within a VM.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 105883] booting with kernel using amd-staging-drm-next on 2400G hangs

2018-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105883

--- Comment #12 from Joshua Lee  ---
Someone on the /r/VFIO discord with a Ryzen APU (he usually boots his VM from
the console, rather than having a graphical host) confirmed the crashiness by
running Furmark, which crashed his GPU driver in ten minutes; his dmesg showed
that as well.

13877  0.1  0.0  0 0 pts/1ZNl+ 10:09   0:00 [GpuTest] 
[90972.383503] [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx timeout,
last signaled seq=36081, last emitted seq=36083
[90972.383512] [drm] IP block:psp is hung!
[90972.383514] [drm] GPU recovery disabled.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 106175] amdgpu.dc=1 shows performance issues with Xorg compositors when moving windows

2018-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106175

--- Comment #1 from tempel.jul...@gmail.com ---
Created attachment 138988
  --> https://bugs.freedesktop.org/attachment.cgi?id=138988&action=edit
xorg log

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 106175] amdgpu.dc=1 shows performance issues with Xorg compositors when moving windows

2018-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106175

Bug ID: 106175
   Summary: amdgpu.dc=1 shows performance issues with Xorg
compositors when moving windows
   Product: DRI
   Version: unspecified
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: DRM/AMDgpu
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: tempel.jul...@gmail.com

Created attachment 138987
  --> https://bugs.freedesktop.org/attachment.cgi?id=138987&action=edit
dmesg

When amdgpu.dc=1 and an Xorg compositor are enabled at the same time, there is
stuttering when moving windows.
It's most visible with Compton (which is completely stutter-free when
amdgpu.dc=0), but also KWin and to a lesser extent also Gnome-Mutter.
It happens also with GPU clocks forced to maximum, so it doesn't seem to be a
powersaving issue.
In the recent past, there was an issue with performance degrading when
amdgpu.dc=1 and an Xorg compositor are enabled and the hardware mouse cursor
was used, maybe it's still related (just guessing though)?

Tested with Linux 4.17 RC1 and drm-next-4.18-wip (4.16.1.52132fd03)
xorg-server 1.19.6+13+gd0d1a694f (amdgpu DDX & modesetting)
RX 560

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104082] amdgpu 0000:07:00.0: swiotlb buffer is full (sz: 2097152 bytes)

2018-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104082

--- Comment #42 from Stratos Zolotas  ---
I can confirm that I'm getting the backtraces on Opensuse Tumbleweed with
4.16.2 kernel installed. They appear fewer times now but every time I have a
flickering on my monitors (using a 3 monitor setup).

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel