Re: [PATCH 32/40] drm/amd/display/amdgpu_dm/amdgpu_dm: Mark 'link_bandwidth_kbps' as __maybe_unused

2020-11-30 Thread Lee Jones
On Mon, 30 Nov 2020, Alex Deucher wrote:

> On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
> >
> > 'link_bandwidth_kbps' is always obtained, but only used if
> > CONFIG_DRM_AMD_DC_DCN is defined.
> 
> Probably better to just move this under CONFIG_DRM_AMD_DC_DCN.  I'll
> send a patch.

I considered that, but thought there would have been good reason for
the clause break just for dc_link_bandwidth_kbps().

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[GIT PULL] exynos-drm-next

2020-11-30 Thread Inki Dae
Hi Dave,

   Just a new mode support for HDMI and two clenups.

   Please kindly let me know if there is any problem.

Thanks,
Inki Dae


The following changes since commit 22f8c80566c4a29a0d8b5ebf24aa1fd1679b39e5:

  Merge tag 'drm-misc-next-2020-11-18' of 
ssh://git.freedesktop.org/git/drm/drm-misc into drm-next (2020-11-27 09:36:33 
+1000)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos 
tags/exynos-drm-next-for-v5.11

for you to fetch changes up to e11e6df2a86779cfc73c4fb2e957ff7a70d89f68:

  drm/exynos: use exynos_dsi as drvdata (2020-12-01 11:38:29 +0900)


Add a new mode support for HDMI
- support for 1920x1200x60Hz mode.

Cleanups
- Drop in_bridge_node from exynos_dsi
- Use a exynos_dsi object instead of a encoder object as drvdata.


Marek Szyprowski (1):
  drm/exynos/hdmi: add support for 1920x1200@60Hz mode

Michael Tretter (2):
  drm/exynos: remove in_bridge_node from exynos_dsi
  drm/exynos: use exynos_dsi as drvdata

 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 31 ---
 drivers/gpu/drm/exynos/exynos_hdmi.c|  9 +
 2 files changed, 21 insertions(+), 19 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3] dt-bindings: display: mcde: Convert to YAML schema

2020-11-30 Thread Rob Herring
On Sun, 15 Nov 2020 19:51:45 +0100, Linus Walleij wrote:
> This moves the MCDE bindings over to using the YAML schema
> to describe the ST-Ericsson MCDE display controller,
> making use of the generic DSI controller schema.
> 
> In the process we correct an error in the old text bindings:
> the clocks for the SDI host controllers were specified as
> part of the main MCDE component while they should be
> specified in the DSI host controller subnodes. This was
> a leftover from an earlier iteration of the first patch
> series adding the MCDE.
> 
> We also add the "port" node, we will use this when adding
> LCD panels using the direct parallel interface DPI instead
> of DSI.
> 
> Cc: devicet...@vger.kernel.org
> Signed-off-by: Linus Walleij 
> ---
> ChangeLog v2->v3:
> - Add resets to the bindings for future-proofing, set
>   additionalProperties: false
> - Extend commit message to explain the the old bindings
>   were incorrect.
> ChangeLog v1->v2:
> - Cut the description on the interrupts.
> - Drop maxItems: 3 on clocks and clock-names: implicit from
>   the number of listed items.
> - Tag the DSI ports with unevaluatedProperties: false
> - Tag the MCDE as such with additionalProperties: true
> - It was a bit hard to test this because of the code base
>   being out of phase with the validation tools but it seems
>   to check out.
> ---
>  .../devicetree/bindings/display/ste,mcde.txt  | 104 ---
>  .../devicetree/bindings/display/ste,mcde.yaml | 169 ++
>  2 files changed, 169 insertions(+), 104 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/display/ste,mcde.txt
>  create mode 100644 Documentation/devicetree/bindings/display/ste,mcde.yaml
> 

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


[PATCH v3 3/3] drm/virtio: consider dma-fence context when signaling

2020-11-30 Thread Gurchetan Singh
This an incremental refactor towards multiple dma-fence contexts
in virtio-gpu.  Since all fences are still allocated using
_gpu_fence_driver.context, nothing should break and every
processed fence will be signaled.

The overall idea is every 3D context can allocate a number of
dma-fence contexts.  Each dma-fence context refers to it's own
timeline.

For example, consider the following case where virgl submits
commands to the GPU (fence ids 1, 3) and does a metadata query with
the CPU (fence id 5).  In a different process, gfxstream submits
commands to the GPU (fence ids 2, 4).

fence_id (_fence.seqno)   | 1 2 3 4 5
--|---
fence_ctx 0 (virgl gpu)   | 1   3
fence_ctx 1 (virgl metadata query)| 5
fence_ctx 2 (gfxstream gpu)   |   2   4

With multiple fence contexts, we can wait for the metadata query
to finish without waiting for the virgl gpu to finish.  virgl gpu
does not have to wait for gfxstream gpu.  The fence id still is the
monotonically increasing sequence number, but it's only revelant to
the specific dma-fence context.

To fully enable this feature, we'll need to:
  - have each 3d context allocate a number of fence contexts. Not
too hard with explicit context initialization on the horizon.
  - have guest userspace specify fence context when performing
ioctls.
  - tag each fence emitted to the host with the fence context
information.  virtio_gpu_ctrl_hdr has padding + flags available,
so that should be easy.

This change goes in the direction specified above, by:
  - looking up the virtgpu_fence given a fence_id
  - signalling all prior fences in a given context
  - signalling current fence

v2: fix grammar in comment
v3: add r-b tags

Reviewed-by: Anthoine Bourgeois 
Signed-off-by: Gurchetan Singh 
---
 drivers/gpu/drm/virtio/virtgpu_drv.h   |  1 +
 drivers/gpu/drm/virtio/virtgpu_fence.c | 39 --
 2 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h 
b/drivers/gpu/drm/virtio/virtgpu_drv.h
index 6a232553c99b..d9dbc4f258f3 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -136,6 +136,7 @@ struct virtio_gpu_fence_driver {
 
 struct virtio_gpu_fence {
struct dma_fence f;
+   uint64_t fence_id;
struct virtio_gpu_fence_driver *drv;
struct list_head node;
 };
diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c 
b/drivers/gpu/drm/virtio/virtgpu_fence.c
index b35fcd1d02d7..d28e25e8409b 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fence.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fence.c
@@ -51,7 +51,7 @@ static bool virtio_gpu_fence_signaled(struct dma_fence *f)
 
 static void virtio_gpu_fence_value_str(struct dma_fence *f, char *str, int 
size)
 {
-   snprintf(str, size, "%llu", f->seqno);
+   snprintf(str, size, "[%llu, %llu]", f->context, f->seqno);
 }
 
 static void virtio_gpu_timeline_value_str(struct dma_fence *f, char *str,
@@ -99,7 +99,7 @@ void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
unsigned long irq_flags;
 
spin_lock_irqsave(>lock, irq_flags);
-   fence->f.seqno = ++drv->current_fence_id;
+   fence->fence_id = fence->f.seqno = ++drv->current_fence_id;
dma_fence_get(>f);
list_add_tail(>node, >fences);
spin_unlock_irqrestore(>lock, irq_flags);
@@ -107,24 +107,45 @@ void virtio_gpu_fence_emit(struct virtio_gpu_device 
*vgdev,
trace_dma_fence_emit(>f);
 
cmd_hdr->flags |= cpu_to_le32(VIRTIO_GPU_FLAG_FENCE);
-   cmd_hdr->fence_id = cpu_to_le64(fence->f.seqno);
+   cmd_hdr->fence_id = cpu_to_le64(fence->fence_id);
 }
 
 void virtio_gpu_fence_event_process(struct virtio_gpu_device *vgdev,
u64 fence_id)
 {
struct virtio_gpu_fence_driver *drv = >fence_drv;
-   struct virtio_gpu_fence *fence, *tmp;
+   struct virtio_gpu_fence *signaled, *curr, *tmp;
unsigned long irq_flags;
 
spin_lock_irqsave(>lock, irq_flags);
atomic64_set(>fence_drv.last_fence_id, fence_id);
-   list_for_each_entry_safe(fence, tmp, >fences, node) {
-   if (fence_id < fence->f.seqno)
+   list_for_each_entry_safe(curr, tmp, >fences, node) {
+   if (fence_id != curr->fence_id)
continue;
-   dma_fence_signal_locked(>f);
-   list_del(>node);
-   dma_fence_put(>f);
+
+   signaled = curr;
+
+   /*
+* Signal any fences with a strictly smaller sequence number
+* than the current signaled fence.
+*/
+   list_for_each_entry_safe(curr, tmp, >fences, node) {
+   /* dma-fence contexts must match */
+   if (signaled->f.context != curr->f.context)
+   continue;
+
+   if (!dma_fence_is_later(>f, >f))
+ 

[PATCH v3 2/3] drm/virtio: rework virtio_fence_signaled

2020-11-30 Thread Gurchetan Singh
virtio_gpu_fence_event_process sets the last_fence_id and
subsequently calls dma_fence_signal_locked(..).

dma_fence_signal_locked(..) sets DMA_FENCE_FLAG_SIGNALED_BIT,
which is actually checked before _fence_ops.(*signaled) is
called.

The check for last_fence_id is therefore a bit redundant, and
it will not be sufficient to check the last_fence_id for multiple
synchronization timelines.  Remove it.

v3: add r-b tags

Signed-off-by: Gurchetan Singh 
Reviewed-by: Anthoine Bourgeois 
---
 drivers/gpu/drm/virtio/virtgpu_fence.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c 
b/drivers/gpu/drm/virtio/virtgpu_fence.c
index 586034c90587..b35fcd1d02d7 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fence.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fence.c
@@ -42,14 +42,10 @@ static const char *virtio_gpu_get_timeline_name(struct 
dma_fence *f)
 
 static bool virtio_gpu_fence_signaled(struct dma_fence *f)
 {
-   struct virtio_gpu_fence *fence = to_virtio_gpu_fence(f);
-
-   if (WARN_ON_ONCE(fence->f.seqno == 0))
-   /* leaked fence outside driver before completing
-* initialization with virtio_gpu_fence_emit */
-   return false;
-   if (atomic64_read(>drv->last_fence_id) >= fence->f.seqno)
-   return true;
+   /* leaked fence outside driver before completing
+* initialization with virtio_gpu_fence_emit.
+*/
+   WARN_ON_ONCE(f->seqno == 0);
return false;
 }
 
-- 
2.29.2.454.gaff20da3a2-goog

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


[PATCH v3 1/3] drm/virtio: virtio_{blah} --> virtio_gpu_{blah}

2020-11-30 Thread Gurchetan Singh
virtio_gpu typically uses the prefix virtio_gpu, but there are
a few places where the virtio prefix is used.  Modify this for
consistency.

v3: add r-b tags

Signed-off-by: Gurchetan Singh 
Reviewed-by: Anthoine Bourgeois 
---
 drivers/gpu/drm/virtio/virtgpu_debugfs.c | 24 ++
 drivers/gpu/drm/virtio/virtgpu_fence.c   | 32 +---
 2 files changed, 30 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_debugfs.c 
b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
index 5fefc88d47e4..c2b20e0ee030 100644
--- a/drivers/gpu/drm/virtio/virtgpu_debugfs.c
+++ b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
@@ -28,14 +28,13 @@
 
 #include "virtgpu_drv.h"
 
-static void virtio_add_bool(struct seq_file *m, const char *name,
-   bool value)
+static void virtio_gpu_add_bool(struct seq_file *m, const char *name,
+   bool value)
 {
seq_printf(m, "%-16s : %s\n", name, value ? "yes" : "no");
 }
 
-static void virtio_add_int(struct seq_file *m, const char *name,
-  int value)
+static void virtio_gpu_add_int(struct seq_file *m, const char *name, int value)
 {
seq_printf(m, "%-16s : %d\n", name, value);
 }
@@ -45,13 +44,16 @@ static int virtio_gpu_features(struct seq_file *m, void 
*data)
struct drm_info_node *node = (struct drm_info_node *)m->private;
struct virtio_gpu_device *vgdev = node->minor->dev->dev_private;
 
-   virtio_add_bool(m, "virgl", vgdev->has_virgl_3d);
-   virtio_add_bool(m, "edid", vgdev->has_edid);
-   virtio_add_bool(m, "indirect", vgdev->has_indirect);
-   virtio_add_bool(m, "resource uuid", vgdev->has_resource_assign_uuid);
-   virtio_add_bool(m, "blob resources", vgdev->has_resource_blob);
-   virtio_add_int(m, "cap sets", vgdev->num_capsets);
-   virtio_add_int(m, "scanouts", vgdev->num_scanouts);
+   virtio_gpu_add_bool(m, "virgl", vgdev->has_virgl_3d);
+   virtio_gpu_add_bool(m, "edid", vgdev->has_edid);
+   virtio_gpu_add_bool(m, "indirect", vgdev->has_indirect);
+
+   virtio_gpu_add_bool(m, "resource uuid",
+   vgdev->has_resource_assign_uuid);
+
+   virtio_gpu_add_bool(m, "blob resources", vgdev->has_resource_blob);
+   virtio_gpu_add_int(m, "cap sets", vgdev->num_capsets);
+   virtio_gpu_add_int(m, "scanouts", vgdev->num_scanouts);
if (vgdev->host_visible_region.len) {
seq_printf(m, "%-16s : 0x%lx +0x%lx\n", "host visible region",
   (unsigned long)vgdev->host_visible_region.addr,
diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c 
b/drivers/gpu/drm/virtio/virtgpu_fence.c
index 728ca36f6327..586034c90587 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fence.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fence.c
@@ -27,22 +27,22 @@
 
 #include "virtgpu_drv.h"
 
-#define to_virtio_fence(x) \
+#define to_virtio_gpu_fence(x) \
container_of(x, struct virtio_gpu_fence, f)
 
-static const char *virtio_get_driver_name(struct dma_fence *f)
+static const char *virtio_gpu_get_driver_name(struct dma_fence *f)
 {
return "virtio_gpu";
 }
 
-static const char *virtio_get_timeline_name(struct dma_fence *f)
+static const char *virtio_gpu_get_timeline_name(struct dma_fence *f)
 {
return "controlq";
 }
 
-static bool virtio_fence_signaled(struct dma_fence *f)
+static bool virtio_gpu_fence_signaled(struct dma_fence *f)
 {
-   struct virtio_gpu_fence *fence = to_virtio_fence(f);
+   struct virtio_gpu_fence *fence = to_virtio_gpu_fence(f);
 
if (WARN_ON_ONCE(fence->f.seqno == 0))
/* leaked fence outside driver before completing
@@ -53,25 +53,26 @@ static bool virtio_fence_signaled(struct dma_fence *f)
return false;
 }
 
-static void virtio_fence_value_str(struct dma_fence *f, char *str, int size)
+static void virtio_gpu_fence_value_str(struct dma_fence *f, char *str, int 
size)
 {
snprintf(str, size, "%llu", f->seqno);
 }
 
-static void virtio_timeline_value_str(struct dma_fence *f, char *str, int size)
+static void virtio_gpu_timeline_value_str(struct dma_fence *f, char *str,
+ int size)
 {
-   struct virtio_gpu_fence *fence = to_virtio_fence(f);
+   struct virtio_gpu_fence *fence = to_virtio_gpu_fence(f);
 
snprintf(str, size, "%llu",
 (u64)atomic64_read(>drv->last_fence_id));
 }
 
-static const struct dma_fence_ops virtio_fence_ops = {
-   .get_driver_name = virtio_get_driver_name,
-   .get_timeline_name   = virtio_get_timeline_name,
-   .signaled= virtio_fence_signaled,
-   .fence_value_str = virtio_fence_value_str,
-   .timeline_value_str  = virtio_timeline_value_str,
+static const struct dma_fence_ops virtio_gpu_fence_ops = {
+   .get_driver_name = virtio_gpu_get_driver_name,
+   .get_timeline_name   = virtio_gpu_get_timeline_name,
+ 

Re: [Intel-gfx] [RFC v2 3/8] drm/i915: Keep track of pwm-related backlight hooks separately

2020-11-30 Thread Lyude Paul
On Thu, 2020-11-26 at 13:57 +0200, Jani Nikula wrote:
> On Thu, 26 Nov 2020, Dave Airlie  wrote:
> > On Thu, 17 Sept 2020 at 03:19, Lyude Paul  wrote:
> > > 
> > > Currently, every different type of backlight hook that i915 supports is
> > > pretty straight forward - you have a backlight, probably through PWM
> > > (but maybe DPCD), with a single set of platform-specific hooks that are
> > > used for controlling it.
> > > 
> > > HDR backlights, in particular VESA and Intel's HDR backlight
> > > implementations, can end up being more complicated. With Intel's
> > > proprietary interface, HDR backlight controls always run through the
> > > DPCD. When the backlight is in SDR backlight mode however, the driver
> > > may need to bypass the TCON and control the backlight directly through
> > > PWM.
> > > 
> > > So, in order to support this we'll need to split our backlight callbacks
> > > into two groups: a set of high-level backlight control callbacks in
> > > intel_panel, and an additional set of pwm-specific backlight control
> > > callbacks. This also implies a functional changes for how these
> > > callbacks are used:
> > > 
> > > * We now keep track of two separate backlight level ranges, one for the
> > >   high-level backlight, and one for the pwm backlight range
> > > * We also keep track of backlight enablement and PWM backlight
> > >   enablement separately
> > > * Since the currently set backlight level might not be the same as the
> > >   currently programmed PWM backlight level, we stop setting
> > >   panel->backlight.level with the currently programmed PWM backlight
> > >   level in panel->backlight.pwm_funcs.setup(). Instead, we rely
> > >   on the higher level backlight control functions to retrieve the
> > >   current PWM backlight level (in this case, intel_pwm_get_backlight()).
> > >   Note that there are still a few PWM backlight setup callbacks that
> > >   do actually need to retrieve the current PWM backlight level, although
> > >   we no longer save this value in panel->backlight.level like before.
> > > * panel->backlight.pwm_funcs.enable()/disable() both accept a PWM
> > >   brightness level, unlike their siblings
> > >   panel->backlight.enable()/disable(). This is so we can calculate the
> > >   actual PWM brightness level we want to set on disable/enable in the
> > >   higher level backlight enable()/disable() functions, since this value
> > >   might be scaled from a brightness level that doesn't come from PWM.
> > 
> > Oh this patch is a handful, I can see why people stall out here.
> > 
> > I'm going to be annoying maintainer and see if you can clean this up a
> > bit in advance of this patch.
> 
> Agreed. And not looking into and requesting this earlier is on me.
> 
> The thing that still keeps bugging me about the DPCD brightness control
> in general is that it's a historical mistake to put all of this under
> i915. (Again, mea culpa.) The standard DPCD brightness control should
> really be under drm core, in one form or another.

JFYI - I already actually have a WIP series to move all of the VESA standard
brightness stuff into the DRM core (especially since I am adding support for
the VESA interface to nouveau). It is pretty important to do so especially
considering some of the ways panel manufacturers seem to have consistently
gotten some portions of the spec wrong (there's currently a bug on almost
every panel I've run into, minus some panels in laptops that run ChromeOS,
where they interpret the brightness value as LSB aligned and not MSB aligned
(which is what the eDP spec actually says), because almost everyone misread
it. So, definitely the kind of stuff we'd want to keep in the drm core to make
maintaining quirks like this easier.

> 
> I'm not asking to fix that here. But I *am* wondering if the series
> makes that harder. What would it look like if we did have that unicorn
> of a brightness connector property? How would that tie into the hooks we
> have?

Re: making it harder, not really. But either way I'm planning on doing the
work for this anyway :)

> 
> Maybe the answer is that the DPCD backlight functions should just be
> library code in drm core that the drivers could call. In the long run,
> i915 really can't be the only one needing this stuff.
> 
> We haven't implemented the mixed modes of DPCD and eDP PWM pin
> brightness control. But the point is, the library code can't call into
> i915 specific eDP PWM pin control code. The proprietary HDR brightness
> code will still be i915 specific, but does it make sense to have a mixed
> mode there that will be completely different from what a mixed mode with
> the standard VESA DPCD brightness could be?
> 
> I.e. what should be the entry points for the hooks, and who calls what?

I think i915 is actually exactly where we want the hooks for this particular
backlight interface, mostly because amdgpu already had to implement their own
backlight control interface for similar reasons to Intel. From what I've seen,
the 

Re: [PATCH v4 1/2] dt-bindings: dp-connector: add binding for DisplayPort connector

2020-11-30 Thread Rob Herring
On Mon, 30 Nov 2020 13:29:18 +0200, Tomi Valkeinen wrote:
> Add binding for DisplayPort connector. A few notes:
> 
> * Similar to hdmi-connector, it has hpd-gpios as an optional property,
>   as the HPD could also be handled by, e.g., the DP bridge.
> 
> * dp-pwr-supply, which provides 3.3V on DP_PWR pin, is optional, as it
>   is not strictly required: standard DP cables do not even have the pin
>   connected.
> 
> * Connector type. Full size and mini connectors are identical except for
>   the connector size and form, so I believe there is no functional need
>   for this property. But similar to 'label' property, it might be used
>   to present information about the connector to the userspace.
> 
> * No eDP. There's really no "eDP connector", as it's always a custom
>   made connection between the DP and the DP panel, although the eDP spec
>   does offer a few suggested pin setups. So possibly there is no need for
>   edp-connector binding, but even if there is, I don't want to guess what
>   it could look like, and could it be part of the dp-connector binding.
> 
> * No DP++. I'm not familiar with DP++. DP++ might need an i2c bus added
>   to the bindings.
> 
> Signed-off-by: Tomi Valkeinen 
> Reviewed-by: Laurent Pinchart 
> ---
>  .../display/connector/dp-connector.yaml   | 56 +++
>  1 file changed, 56 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/connector/dp-connector.yaml
> 

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


Re: [PATCH v4 80/80] drm/omap: dsi: fix DCS_CMD_ENABLE

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:38PM +0200, Tomi Valkeinen wrote:
> We only need to set VC_CTRL:DCS_CMD_ENABLE for command mode panels when
> the HW has DSI_QUIRK_DCS_CMD_CONFIG_VC quirk. The old code did this
> right by accident, but now we set DCS_CMD_ENABLE for video mode panels
> too.
> 
> Fix this by skipping the set for video mode.
> 
> Signed-off-by: Tomi Valkeinen 

Reviewed-by: Laurent Pinchart 

> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index ffecacd7350a..d52bef0c7aa2 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -3401,7 +3401,8 @@ static void dsi_setup_dsi_vcs(struct dsi_data *dsi)
>   REG_FLD_MOD(dsi, DSI_VC_CTRL(VC_VIDEO), 1, 1, 1); /* SOURCE_VP */
>   dsi->vc[VC_VIDEO].source = DSI_VC_SOURCE_VP;
>  
> - if (dsi->data->quirks & DSI_QUIRK_DCS_CMD_CONFIG_VC)
> + if ((dsi->data->quirks & DSI_QUIRK_DCS_CMD_CONFIG_VC) &&
> + !(dsi->dsidev->mode_flags & MIPI_DSI_MODE_VIDEO))
>   REG_FLD_MOD(dsi, DSI_VC_CTRL(VC_VIDEO), 1, 30, 30); /* 
> DCS_CMD_ENABLE */
>  
>   dsi_vc_enable(dsi, VC_CMD, 1);

-- 
Regards,

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


Re: [PATCH v4 79/80] drm/omap: dsi: remove ulps support

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:37PM +0200, Tomi Valkeinen wrote:
> ULPS doesn't work, and I have been unable to get it to work. As ULPS is
> a minor power-saving feature which requires substantial amount of
> non-trivial code, and we have trouble just getting and
> keeping DSI working at all, remove ULPS support.
> 
> When the DSI driver works reliably for command and video mode displays,
> someone interested can add it back.
> 
> Signed-off-by: Tomi Valkeinen 

Reviewed-by: Laurent Pinchart 

> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 297 +-
>  drivers/gpu/drm/omapdrm/dss/dsi.h |   4 -
>  2 files changed, 8 insertions(+), 293 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 6e9c99402540..ffecacd7350a 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -53,8 +53,6 @@
>  #define REG_FLD_MOD(dsi, idx, val, start, end) \
>   dsi_write_reg(dsi, idx, FLD_MOD(dsi_read_reg(dsi, idx), val, start, 
> end))
>  
> -static void dsi_set_ulps_auto(struct dsi_data *dsi, bool enable);
> -
>  static int dsi_init_dispc(struct dsi_data *dsi);
>  static void dsi_uninit_dispc(struct dsi_data *dsi);
>  
> @@ -688,44 +686,6 @@ static int dsi_unregister_isr_vc(struct dsi_data *dsi, 
> int vc,
>   return r;
>  }
>  
> -static int dsi_register_isr_cio(struct dsi_data *dsi, omap_dsi_isr_t isr,
> - void *arg, u32 mask)
> -{
> - unsigned long flags;
> - int r;
> -
> - spin_lock_irqsave(>irq_lock, flags);
> -
> - r = _dsi_register_isr(isr, arg, mask, dsi->isr_tables.isr_table_cio,
> - ARRAY_SIZE(dsi->isr_tables.isr_table_cio));
> -
> - if (r == 0)
> - _omap_dsi_set_irqs_cio(dsi);
> -
> - spin_unlock_irqrestore(>irq_lock, flags);
> -
> - return r;
> -}
> -
> -static int dsi_unregister_isr_cio(struct dsi_data *dsi, omap_dsi_isr_t isr,
> -   void *arg, u32 mask)
> -{
> - unsigned long flags;
> - int r;
> -
> - spin_lock_irqsave(>irq_lock, flags);
> -
> - r = _dsi_unregister_isr(isr, arg, mask, dsi->isr_tables.isr_table_cio,
> - ARRAY_SIZE(dsi->isr_tables.isr_table_cio));
> -
> - if (r == 0)
> - _omap_dsi_set_irqs_cio(dsi);
> -
> - spin_unlock_irqrestore(>irq_lock, flags);
> -
> - return r;
> -}
> -
>  static u32 dsi_get_errors(struct dsi_data *dsi)
>  {
>   unsigned long flags;
> @@ -1450,56 +1410,6 @@ static void dsi_cio_timings(struct dsi_data *dsi)
>   dsi_write_reg(dsi, DSI_DSIPHY_CFG2, r);
>  }
>  
> -/* lane masks have lane 0 at lsb. mask_p for positive lines, n for negative 
> */
> -static void dsi_cio_enable_lane_override(struct dsi_data *dsi,
> -  unsigned int mask_p,
> -  unsigned int mask_n)
> -{
> - int i;
> - u32 l;
> - u8 lptxscp_start = dsi->num_lanes_supported == 3 ? 22 : 26;
> -
> - l = 0;
> -
> - for (i = 0; i < dsi->num_lanes_supported; ++i) {
> - unsigned int p = dsi->lanes[i].polarity;
> -
> - if (mask_p & (1 << i))
> - l |= 1 << (i * 2 + (p ? 0 : 1));
> -
> - if (mask_n & (1 << i))
> - l |= 1 << (i * 2 + (p ? 1 : 0));
> - }
> -
> - /*
> -  * Bits in REGLPTXSCPDAT4TO0DXDY:
> -  * 17: DY0 18: DX0
> -  * 19: DY1 20: DX1
> -  * 21: DY2 22: DX2
> -  * 23: DY3 24: DX3
> -  * 25: DY4 26: DX4
> -  */
> -
> - /* Set the lane override configuration */
> -
> - /* REGLPTXSCPDAT4TO0DXDY */
> - REG_FLD_MOD(dsi, DSI_DSIPHY_CFG10, l, lptxscp_start, 17);
> -
> - /* Enable lane override */
> -
> - /* ENLPTXSCPDAT */
> - REG_FLD_MOD(dsi, DSI_DSIPHY_CFG10, 1, 27, 27);
> -}
> -
> -static void dsi_cio_disable_lane_override(struct dsi_data *dsi)
> -{
> - /* Disable lane override */
> - REG_FLD_MOD(dsi, DSI_DSIPHY_CFG10, 0, 27, 27); /* ENLPTXSCPDAT */
> - /* Reset the lane override configuration */
> - /* REGLPTXSCPDAT4TO0DXDY */
> - REG_FLD_MOD(dsi, DSI_DSIPHY_CFG10, 0, 22, 17);
> -}
> -
>  static int dsi_cio_wait_tx_clk_esc_reset(struct dsi_data *dsi)
>  {
>   int t, i;
> @@ -1674,32 +1584,6 @@ static int dsi_cio_init(struct dsi_data *dsi)
>   l = FLD_MOD(l, 0x1fff, 12, 0);  /* STOP_STATE_COUNTER_IO */
>   dsi_write_reg(dsi, DSI_TIMING1, l);
>  
> - if (dsi->ulps_enabled) {
> - unsigned int mask_p;
> - int i;
> -
> - DSSDBG("manual ulps exit\n");
> -
> - /* ULPS is exited by Mark-1 state for 1ms, followed by
> -  * stop state. DSS HW cannot do this via the normal
> -  * ULPS exit sequence, as after reset the DSS HW thinks
> -  * that we are not in ULPS mode, and refuses to send the
> -  * sequence. So we need to send the ULPS 

Re: [PATCH v4 78/80] drm/omap: dsi: fix and cleanup ddr_clk_always_on

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:36PM +0200, Tomi Valkeinen wrote:
> The driver ignores MIPI_DSI_CLOCK_NON_CONTINUOUS, and always uses
> non-continuous clock.
> 
> Fix this by using MIPI_DSI_CLOCK_NON_CONTINUOUS and at the same time,
> drop ddr_clk_always_on field which seems pretty useless.
> 
> Signed-off-by: Tomi Valkeinen 

Reviewed-by: Laurent Pinchart 

> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 12 +---
>  drivers/gpu/drm/omapdrm/dss/dsi.h |  2 --
>  2 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 6d20245495ac..6e9c99402540 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -1734,11 +1734,10 @@ static int dsi_cio_init(struct dsi_data *dsi)
>  
>   dsi_cio_timings(dsi);
>  
> - if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
> - /* DDR_CLK_ALWAYS_ON */
> - REG_FLD_MOD(dsi, DSI_CLK_CTRL,
> - dsi->vm_timings.ddr_clk_always_on, 13, 13);
> - }
> + /* DDR_CLK_ALWAYS_ON */
> + REG_FLD_MOD(dsi, DSI_CLK_CTRL,
> + !(dsi->dsidev->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS),
> + 13, 13);
>  
>   dsi->ulps_enabled = false;
>  
> @@ -3641,7 +3640,7 @@ static void dsi_setup_dsi_vcs(struct dsi_data *dsi)
>   dsi_force_tx_stop_mode_io(dsi);
>  
>   /* start the DDR clock by sending a NULL packet */
> - if (dsi->vm_timings.ddr_clk_always_on)
> + if (!(dsi->dsidev->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS))
>   dsi_vc_send_null(dsi, VC_CMD, dsi->dsidev->channel);
>  }
>  
> @@ -4150,7 +4149,6 @@ static bool dsi_vm_calc_blanking(struct 
> dsi_clk_calc_ctx *ctx)
>   dsi_vm->hfp_blanking_mode = 1;
>   dsi_vm->hbp_blanking_mode = 1;
>  
> - dsi_vm->ddr_clk_always_on = cfg->ddr_clk_always_on;
>   dsi_vm->window_sync = 4;
>  
>   /* setup DISPC videomode */
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.h 
> b/drivers/gpu/drm/omapdrm/dss/dsi.h
> index 7cc2cc748ed9..3543828e30eb 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.h
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.h
> @@ -209,7 +209,6 @@ struct omap_dss_dsi_videomode_timings {
>  
>   enum omap_dss_dsi_trans_mode trans_mode;
>  
> - bool ddr_clk_always_on;
>   int window_sync;
>  };
>  
> @@ -221,7 +220,6 @@ struct omap_dss_dsi_config {
>   unsigned long hs_clk_min, hs_clk_max;
>   unsigned long lp_clk_min, lp_clk_max;
>  
> - bool ddr_clk_always_on;
>   enum omap_dss_dsi_trans_mode trans_mode;
>  };
> 

-- 
Regards,

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


Re: [PATCH v4 77/80] drm/omap: dsi: split video mode enable/disable into separate func

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:35PM +0200, Tomi Valkeinen wrote:
> Clean up the code by separating video-mode enable/disable code into
> functions of their own.
> 
> Signed-off-by: Tomi Valkeinen 

Reviewed-by: Laurent Pinchart 

> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 101 +-
>  1 file changed, 57 insertions(+), 44 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 27d0d119668b..6d20245495ac 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -3207,12 +3207,61 @@ static int dsi_configure_pins(struct dsi_data *dsi,
>   return 0;
>  }
>  
> -static void dsi_enable_video_output(struct omap_dss_device *dssdev, int vc)
> +static int dsi_enable_video_mode(struct dsi_data *dsi, int vc)
>  {
> - struct dsi_data *dsi = to_dsi_data(dssdev);
>   int bpp = mipi_dsi_pixel_format_to_bpp(dsi->pix_fmt);
>   u8 data_type;
>   u16 word_count;
> +
> + switch (dsi->pix_fmt) {
> + case MIPI_DSI_FMT_RGB888:
> + data_type = MIPI_DSI_PACKED_PIXEL_STREAM_24;
> + break;
> + case MIPI_DSI_FMT_RGB666:
> + data_type = MIPI_DSI_PIXEL_STREAM_3BYTE_18;
> + break;
> + case MIPI_DSI_FMT_RGB666_PACKED:
> + data_type = MIPI_DSI_PACKED_PIXEL_STREAM_18;
> + break;
> + case MIPI_DSI_FMT_RGB565:
> + data_type = MIPI_DSI_PACKED_PIXEL_STREAM_16;
> + break;
> + default:
> + return -EINVAL;
> + }
> +
> + dsi_if_enable(dsi, false);
> + dsi_vc_enable(dsi, vc, false);
> +
> + /* MODE, 1 = video mode */
> + REG_FLD_MOD(dsi, DSI_VC_CTRL(vc), 1, 4, 4);
> +
> + word_count = DIV_ROUND_UP(dsi->vm.hactive * bpp, 8);
> +
> + dsi_vc_write_long_header(dsi, vc, dsi->dsidev->channel, data_type,
> + word_count, 0);
> +
> + dsi_vc_enable(dsi, vc, true);
> + dsi_if_enable(dsi, true);
> +
> + return 0;
> +}
> +
> +static void dsi_disable_video_mode(struct dsi_data *dsi, int vc)
> +{
> + dsi_if_enable(dsi, false);
> + dsi_vc_enable(dsi, vc, false);
> +
> + /* MODE, 0 = command mode */
> + REG_FLD_MOD(dsi, DSI_VC_CTRL(vc), 0, 4, 4);
> +
> + dsi_vc_enable(dsi, vc, true);
> + dsi_if_enable(dsi, true);
> +}
> +
> +static void dsi_enable_video_output(struct omap_dss_device *dssdev, int vc)
> +{
> + struct dsi_data *dsi = to_dsi_data(dssdev);
>   int r;
>  
>   r = dsi_init_dispc(dsi);
> @@ -3222,37 +3271,9 @@ static void dsi_enable_video_output(struct 
> omap_dss_device *dssdev, int vc)
>   }
>  
>   if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
> - switch (dsi->pix_fmt) {
> - case MIPI_DSI_FMT_RGB888:
> - data_type = MIPI_DSI_PACKED_PIXEL_STREAM_24;
> - break;
> - case MIPI_DSI_FMT_RGB666:
> - data_type = MIPI_DSI_PIXEL_STREAM_3BYTE_18;
> - break;
> - case MIPI_DSI_FMT_RGB666_PACKED:
> - data_type = MIPI_DSI_PACKED_PIXEL_STREAM_18;
> - break;
> - case MIPI_DSI_FMT_RGB565:
> - data_type = MIPI_DSI_PACKED_PIXEL_STREAM_16;
> - break;
> - default:
> - r = -EINVAL;
> - goto err_pix_fmt;
> - }
> -
> - dsi_if_enable(dsi, false);
> - dsi_vc_enable(dsi, vc, false);
> -
> - /* MODE, 1 = video mode */
> - REG_FLD_MOD(dsi, DSI_VC_CTRL(vc), 1, 4, 4);
> -
> - word_count = DIV_ROUND_UP(dsi->vm.hactive * bpp, 8);
> -
> - dsi_vc_write_long_header(dsi, vc, dsi->dsidev->channel, 
> data_type,
> - word_count, 0);
> -
> - dsi_vc_enable(dsi, vc, true);
> - dsi_if_enable(dsi, true);
> + r = dsi_enable_video_mode(dsi, vc);
> + if (r)
> + goto err_video_mode;
>   }
>  
>   r = dss_mgr_enable(>output);
> @@ -3266,7 +3287,7 @@ static void dsi_enable_video_output(struct 
> omap_dss_device *dssdev, int vc)
>   dsi_if_enable(dsi, false);
>   dsi_vc_enable(dsi, vc, false);
>   }
> -err_pix_fmt:
> +err_video_mode:
>   dsi_uninit_dispc(dsi);
>   dev_err(dsi->dev, "failed to enable DSI encoder!\n");
>   return;
> @@ -3276,16 +3297,8 @@ static void dsi_disable_video_output(struct 
> omap_dss_device *dssdev, int vc)
>  {
>   struct dsi_data *dsi = to_dsi_data(dssdev);
>  
> - if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
> - dsi_if_enable(dsi, false);
> - dsi_vc_enable(dsi, vc, false);
> -
> - /* MODE, 0 = command mode */
> - REG_FLD_MOD(dsi, DSI_VC_CTRL(vc), 0, 4, 4);
> -
> - dsi_vc_enable(dsi, vc, true);
> - 

Re: [PATCH v4 76/80] drm/omap: dsi: cleanup initial vc setup

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:34PM +0200, Tomi Valkeinen wrote:
> As we now have a fixed setup for VCs (VC0 for video stream, VC1 for
> commands), we can simplify the VC setup.
> 
> Signed-off-by: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 85 +++
>  1 file changed, 31 insertions(+), 54 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index ff8ace957291..27d0d119668b 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -2017,40 +2017,6 @@ static void dsi_vc_initial_config(struct dsi_data 
> *dsi, int vc)
>   dsi->vc[vc].source = DSI_VC_SOURCE_L4;
>  }
>  
> -static int dsi_vc_config_source(struct dsi_data *dsi, int vc,
> - enum dsi_vc_source source)
> -{
> - if (dsi->vc[vc].source == source)
> - return 0;
> -
> - DSSDBG("Source config of VC %d", vc);
> -
> - dsi_sync_vc(dsi, vc);
> -
> - dsi_vc_enable(dsi, vc, 0);
> -
> - /* VC_BUSY */
> - if (!wait_for_bit_change(dsi, DSI_VC_CTRL(vc), 15, 0)) {
> - DSSERR("vc(%d) busy when trying to config for VP\n", vc);
> - return -EIO;
> - }
> -
> - /* SOURCE, 0 = L4, 1 = video port */
> - REG_FLD_MOD(dsi, DSI_VC_CTRL(vc), source, 1, 1);
> -
> - /* DCS_CMD_ENABLE */
> - if (dsi->data->quirks & DSI_QUIRK_DCS_CMD_CONFIG_VC) {
> - bool enable = source == DSI_VC_SOURCE_VP;
> - REG_FLD_MOD(dsi, DSI_VC_CTRL(vc), enable, 30, 30);
> - }
> -
> - dsi_vc_enable(dsi, vc, 1);
> -
> - dsi->vc[vc].source = source;
> -
> - return 0;
> -}
> -
>  static void dsi_vc_enable_hs(struct omap_dss_device *dssdev, int vc,
>   bool enable)
>  {
> @@ -2072,10 +2038,6 @@ static void dsi_vc_enable_hs(struct omap_dss_device 
> *dssdev, int vc,
>   dsi_if_enable(dsi, 1);
>  
>   dsi_force_tx_stop_mode_io(dsi);
> -
> - /* start the DDR clock by sending a NULL packet */
> - if (dsi->vm_timings.ddr_clk_always_on && enable)
> - dsi_vc_send_null(dsi, vc, dsi->dsidev->channel);
>  }
>  
>  static void dsi_vc_flush_long_data(struct dsi_data *dsi, int vc)
> @@ -2270,8 +2232,6 @@ static int dsi_vc_send_long(struct dsi_data *dsi, int 
> vc,
>   return -EINVAL;
>   }
>  
> - dsi_vc_config_source(dsi, vc, DSI_VC_SOURCE_L4);
> -
>   dsi_vc_write_long_header(dsi, vc, msg->channel, msg->type, msg->tx_len, 
> 0);
>  
>   p = msg->tx_buf;
> @@ -2331,8 +2291,6 @@ static int dsi_vc_send_short(struct dsi_data *dsi, int 
> vc,
>   DSSDBG("dsi_vc_send_short(ch%d, dt %#x, b1 %#x, b2 %#x)\n",
>  vc, msg->type, pkt.header[1], pkt.header[2]);
>  
> - dsi_vc_config_source(dsi, vc, DSI_VC_SOURCE_L4);
> -
>   if (FLD_GET(dsi_read_reg(dsi, DSI_VC_CTRL(vc)), 16, 16)) {
>   DSSERR("ERROR FIFO FULL, aborting transfer\n");
>   return -EINVAL;
> @@ -3351,8 +3309,6 @@ static void dsi_update_screen_dispc(struct dsi_data 
> *dsi)
>  
>   DSSDBG("dsi_update_screen_dispc(%dx%d)\n", w, h);
>  
> - dsi_vc_config_source(dsi, vc, DSI_VC_SOURCE_VP);
> -
>   bytespp = mipi_dsi_pixel_format_to_bpp(dsi->pix_fmt) / 8;
>   bytespl = w * bytespp;
>   bytespf = bytespl * h;
> @@ -3522,9 +3478,7 @@ static int dsi_update_channel(struct omap_dss_device 
> *dssdev, int vc)
>  
>   dsi_set_ulps_auto(dsi, false);
>  
> - dsi_vc_enable_hs(dssdev, vc, !(dsi->dsidev->mode_flags & 
> MIPI_DSI_MODE_LPM));

Why is this not needed anymore ?

> -
> - r = _dsi_send_nop(dsi, vc, dsi->dsidev->channel);
> + r = _dsi_send_nop(dsi, VC_CMD, dsi->dsidev->channel);
>   if (r < 0) {
>   DSSWARN("failed to send nop between frames: %d\n", r);
>   goto err;
> @@ -3649,6 +3603,35 @@ static int dsi_configure_dsi_clocks(struct dsi_data 
> *dsi)
>   return 0;
>  }
>  
> +static void dsi_setup_dsi_vcs(struct dsi_data *dsi)
> +{
> + /* Setup VC_CMD for LP and cpu transfers */
> + REG_FLD_MOD(dsi, DSI_VC_CTRL(VC_CMD), 0, 9, 9); /* LP */
> +
> + REG_FLD_MOD(dsi, DSI_VC_CTRL(VC_CMD), 0, 1, 1); /* SOURCE_L4 */
> + dsi->vc[VC_CMD].source = DSI_VC_SOURCE_L4;
> +
> + /* Setup VC_VIDEO for HS and dispc transfers */
> + REG_FLD_MOD(dsi, DSI_VC_CTRL(VC_VIDEO), 1, 9, 9); /* HS */
> +
> + REG_FLD_MOD(dsi, DSI_VC_CTRL(VC_VIDEO), 1, 1, 1); /* SOURCE_VP */
> + dsi->vc[VC_VIDEO].source = DSI_VC_SOURCE_VP;
> +
> + if (dsi->data->quirks & DSI_QUIRK_DCS_CMD_CONFIG_VC)
> + REG_FLD_MOD(dsi, DSI_VC_CTRL(VC_VIDEO), 1, 30, 30); /* 
> DCS_CMD_ENABLE */
> +
> + dsi_vc_enable(dsi, VC_CMD, 1);
> + dsi_vc_enable(dsi, VC_VIDEO, 1);
> +
> + dsi_if_enable(dsi, 1);
> +
> + dsi_force_tx_stop_mode_io(dsi);
> +
> + /* start the DDR clock by sending a NULL packet */
> + if (dsi->vm_timings.ddr_clk_always_on)
> + 

Re: [PATCH v4 75/80] drm/omap: dsi: rename dsi_display_* functions

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:33PM +0200, Tomi Valkeinen wrote:
> The function names have evolved to be very confusing, and bunch of them
> have "display" in them even if the function doesn't deal with display as
> such (e.g. dsi_display_enable which just enables the DSI interface).
> Rename them by dropping the "display".
> 
> Signed-off-by: Tomi Valkeinen 

Reviewed-by: Laurent Pinchart 

> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 36 +++
>  1 file changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index d23fc43f1d1e..ff8ace957291 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -55,8 +55,8 @@
>  
>  static void dsi_set_ulps_auto(struct dsi_data *dsi, bool enable);
>  
> -static int dsi_display_init_dispc(struct dsi_data *dsi);
> -static void dsi_display_uninit_dispc(struct dsi_data *dsi);
> +static int dsi_init_dispc(struct dsi_data *dsi);
> +static void dsi_uninit_dispc(struct dsi_data *dsi);
>  
>  static int dsi_vc_send_null(struct dsi_data *dsi, int vc, int channel);
>  
> @@ -3257,7 +3257,7 @@ static void dsi_enable_video_output(struct 
> omap_dss_device *dssdev, int vc)
>   u16 word_count;
>   int r;
>  
> - r = dsi_display_init_dispc(dsi);
> + r = dsi_init_dispc(dsi);
>   if (r) {
>   dev_err(dsi->dev, "failed to init dispc!\n");
>   return;
> @@ -3309,7 +3309,7 @@ static void dsi_enable_video_output(struct 
> omap_dss_device *dssdev, int vc)
>   dsi_vc_enable(dsi, vc, false);
>   }
>  err_pix_fmt:
> - dsi_display_uninit_dispc(dsi);
> + dsi_uninit_dispc(dsi);
>   dev_err(dsi->dev, "failed to enable DSI encoder!\n");
>   return;
>  }
> @@ -3331,7 +3331,7 @@ static void dsi_disable_video_output(struct 
> omap_dss_device *dssdev, int vc)
>  
>   dss_mgr_disable(>output);
>  
> - dsi_display_uninit_dispc(dsi);
> + dsi_uninit_dispc(dsi);
>  }
>  
>  static void dsi_update_screen_dispc(struct dsi_data *dsi)
> @@ -3577,7 +3577,7 @@ static int dsi_configure_dispc_clocks(struct dsi_data 
> *dsi)
>   return 0;
>  }
>  
> -static int dsi_display_init_dispc(struct dsi_data *dsi)
> +static int dsi_init_dispc(struct dsi_data *dsi)
>  {
>   enum omap_channel dispc_channel = dsi->output.dispc_channel;
>   int r;
> @@ -3622,7 +3622,7 @@ static int dsi_display_init_dispc(struct dsi_data *dsi)
>   return r;
>  }
>  
> -static void dsi_display_uninit_dispc(struct dsi_data *dsi)
> +static void dsi_uninit_dispc(struct dsi_data *dsi)
>  {
>   enum omap_channel dispc_channel = dsi->output.dispc_channel;
>  
> @@ -3649,7 +3649,7 @@ static int dsi_configure_dsi_clocks(struct dsi_data 
> *dsi)
>   return 0;
>  }
>  
> -static int dsi_display_init_dsi(struct dsi_data *dsi)
> +static int dsi_init_dsi(struct dsi_data *dsi)
>  {
>   int r;
>  
> @@ -3713,7 +3713,7 @@ static int dsi_display_init_dsi(struct dsi_data *dsi)
>   return r;
>  }
>  
> -static void dsi_display_uninit_dsi(struct dsi_data *dsi, bool 
> disconnect_lanes,
> +static void dsi_uninit_dsi(struct dsi_data *dsi, bool disconnect_lanes,
>  bool enter_ulps)
>  {
>   if (enter_ulps && !dsi->ulps_enabled)
> @@ -3736,7 +3736,7 @@ static void dsi_display_uninit_dsi(struct dsi_data 
> *dsi, bool disconnect_lanes,
>   }
>  }
>  
> -static void dsi_display_enable(struct dsi_data *dsi)
> +static void dsi_enable(struct dsi_data *dsi)
>  {
>   int r;
>  
> @@ -3750,7 +3750,7 @@ static void dsi_display_enable(struct dsi_data *dsi)
>  
>   _dsi_initialize_irq(dsi);
>  
> - r = dsi_display_init_dsi(dsi);
> + r = dsi_init_dsi(dsi);
>   if (r)
>   goto err_init_dsi;
>  
> @@ -3762,10 +3762,10 @@ static void dsi_display_enable(struct dsi_data *dsi)
>   dsi_runtime_put(dsi);
>  err_get_dsi:
>   mutex_unlock(>lock);
> - DSSDBG("dsi_display_ulps_enable FAILED\n");
> + DSSDBG("dsi_enable FAILED\n");
>  }
>  
> -static void dsi_display_disable(struct dsi_data *dsi,
> +static void dsi_disable(struct dsi_data *dsi,
>   bool disconnect_lanes, bool enter_ulps)
>  {
>   WARN_ON(!dsi_bus_is_locked(dsi));
> @@ -3777,7 +3777,7 @@ static void dsi_display_disable(struct dsi_data *dsi,
>   dsi_sync_vc(dsi, 2);
>   dsi_sync_vc(dsi, 3);
>  
> - dsi_display_uninit_dsi(dsi, disconnect_lanes, enter_ulps);
> + dsi_uninit_dsi(dsi, disconnect_lanes, enter_ulps);
>  
>   dsi_runtime_put(dsi);
>  
> @@ -3807,7 +3807,7 @@ static void omap_dsi_ulps_work_callback(struct 
> work_struct *work)
>  
>   dsi_enable_te(dsi, false);
>  
> - dsi_display_disable(dsi, false, true);
> + dsi_disable(dsi, false, true);
>  
>   dsi_bus_unlock(dsi);
>  }
> @@ -3828,7 +3828,7 @@ static void dsi_set_ulps_auto(struct dsi_data *dsi, 
> bool enable)
>   

Re: [PATCH v4 74/80] drm/omap: dsi: display_disable cleanup

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:32PM +0200, Tomi Valkeinen wrote:
> We can drop dsi_display_disable() which just calls
> _dsi_display_disable(), and rename _dsi_display_disable() to
> dsi_display_disable().

Same comment as for the previous patch. I'd actually squash the two.

Reviewed-by: Laurent Pinchart 

> Signed-off-by: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 19 +++
>  1 file changed, 3 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index e50418db71ef..d23fc43f1d1e 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -63,8 +63,6 @@ static int dsi_vc_send_null(struct dsi_data *dsi, int vc, 
> int channel);
>  static ssize_t _omap_dsi_host_transfer(struct dsi_data *dsi, int vc,
>  const struct mipi_dsi_msg *msg);
>  
> -static void dsi_display_disable(struct omap_dss_device *dssdev);
> -
>  #ifdef DSI_PERF_MEASURE
>  static bool dsi_perf;
>  module_param(dsi_perf, bool, 0644);
> @@ -3767,7 +3765,7 @@ static void dsi_display_enable(struct dsi_data *dsi)
>   DSSDBG("dsi_display_ulps_enable FAILED\n");
>  }
>  
> -static void _dsi_display_disable(struct dsi_data *dsi,
> +static void dsi_display_disable(struct dsi_data *dsi,
>   bool disconnect_lanes, bool enter_ulps)
>  {
>   WARN_ON(!dsi_bus_is_locked(dsi));
> @@ -3786,17 +3784,6 @@ static void _dsi_display_disable(struct dsi_data *dsi,
>   mutex_unlock(>lock);
>  }
>  
> -static void dsi_display_disable(struct omap_dss_device *dssdev)
> -{
> - struct dsi_data *dsi = to_dsi_data(dssdev);
> -
> - WARN_ON(!dsi_bus_is_locked(dsi));
> -
> - DSSDBG("dsi_display_disable\n");
> -
> - _dsi_display_disable(dsi, true, false);
> -}
> -
>  static int dsi_enable_te(struct dsi_data *dsi, bool enable)
>  {
>   dsi->te_enabled = enable;
> @@ -3820,7 +3807,7 @@ static void omap_dsi_ulps_work_callback(struct 
> work_struct *work)
>  
>   dsi_enable_te(dsi, false);
>  
> - _dsi_display_disable(dsi, false, true);
> + dsi_display_disable(dsi, false, true);
>  
>   dsi_bus_unlock(dsi);
>  }
> @@ -4954,7 +4941,7 @@ static void dsi_bridge_disable(struct drm_bridge 
> *bridge)
>  
>   dsi_disable_video_output(dssdev, VC_VIDEO);
>  
> - dsi_display_disable(dssdev);
> + dsi_display_disable(dsi, true, false);
>  
>   dsi_bus_unlock(dsi);
>  }

-- 
Regards,

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


Re: [PATCH v4 73/80] drm/omap: dsi: display_enable cleanup

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:31PM +0200, Tomi Valkeinen wrote:
> We can drop dsi_display_enable(), which just calls
> _dsi_display_enable(), and rename _dsi_display_enable() to
> dsi_display_enable().

How about adding a comment here to explain why the WARN_ON() is needed
anymore ?

Reviewed-by: Laurent Pinchart 

> Signed-off-by: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 16 +++-
>  1 file changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 4f79d6c664ff..e50418db71ef 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -3738,7 +3738,7 @@ static void dsi_display_uninit_dsi(struct dsi_data 
> *dsi, bool disconnect_lanes,
>   }
>  }
>  
> -static void _dsi_display_enable(struct dsi_data *dsi)
> +static void dsi_display_enable(struct dsi_data *dsi)
>  {
>   int r;
>  
> @@ -3767,16 +3767,6 @@ static void _dsi_display_enable(struct dsi_data *dsi)
>   DSSDBG("dsi_display_ulps_enable FAILED\n");
>  }
>  
> -static void dsi_display_enable(struct omap_dss_device *dssdev)
> -{
> - struct dsi_data *dsi = to_dsi_data(dssdev);
> - DSSDBG("dsi_display_enable\n");
> -
> - WARN_ON(!dsi_bus_is_locked(dsi));
> -
> - _dsi_display_enable(dsi);
> -}
> -
>  static void _dsi_display_disable(struct dsi_data *dsi,
>   bool disconnect_lanes, bool enter_ulps)
>  {
> @@ -3851,7 +3841,7 @@ static void dsi_set_ulps_auto(struct dsi_data *dsi, 
> bool enable)
>   return;
>  
>   dsi_bus_lock(dsi);
> - _dsi_display_enable(dsi);
> + dsi_display_enable(dsi);
>   dsi_enable_te(dsi, true);
>   dsi_bus_unlock(dsi);
>   }
> @@ -4942,7 +4932,7 @@ static void dsi_bridge_enable(struct drm_bridge *bridge)
>  
>   dsi_bus_lock(dsi);
>  
> - dsi_display_enable(dssdev);
> + dsi_display_enable(dsi);
>  
>   dsi_enable_video_output(dssdev, VC_VIDEO);
>  

-- 
Regards,

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


Re: [PATCH v4 72/80] drm/omap: dsi: move enable/disable to bridge enable/disable

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:30PM +0200, Tomi Valkeinen wrote:
> Clean up the code by inlining dsi_enable_video_outputs and
> dsi_disable_video_outputs functions.
> 
> Signed-off-by: Tomi Valkeinen 

Reviewed-by: Laurent Pinchart 

> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 55 +--
>  1 file changed, 22 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index a01e09c9b477..4f79d6c664ff 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -3336,20 +3336,6 @@ static void dsi_disable_video_output(struct 
> omap_dss_device *dssdev, int vc)
>   dsi_display_uninit_dispc(dsi);
>  }
>  
> -static void dsi_disable_video_outputs(struct omap_dss_device *dssdev)
> -{
> - struct dsi_data *dsi = to_dsi_data(dssdev);
> -
> - dsi_bus_lock(dsi);
> - dsi->video_enabled = false;
> -
> - dsi_disable_video_output(dssdev, VC_VIDEO);
> -
> - dsi_display_disable(dssdev);
> -
> - dsi_bus_unlock(dsi);
> -}
> -
>  static void dsi_update_screen_dispc(struct dsi_data *dsi)
>  {
>   unsigned int bytespp;
> @@ -3791,23 +3777,6 @@ static void dsi_display_enable(struct omap_dss_device 
> *dssdev)
>   _dsi_display_enable(dsi);
>  }
>  
> -static void dsi_enable_video_outputs(struct omap_dss_device *dssdev)
> -{
> - struct dsi_data *dsi = to_dsi_data(dssdev);
> -
> - dsi_bus_lock(dsi);
> -
> - dsi_display_enable(dssdev);
> -
> - dsi_enable_video_output(dssdev, VC_VIDEO);
> -
> - dsi->video_enabled = true;
> -
> - dsi_set_ulps_auto(dsi, true);
> -
> - dsi_bus_unlock(dsi);
> -}
> -
>  static void _dsi_display_disable(struct dsi_data *dsi,
>   bool disconnect_lanes, bool enter_ulps)
>  {
> @@ -4969,15 +4938,35 @@ static void dsi_bridge_mode_set(struct drm_bridge 
> *bridge,
>  static void dsi_bridge_enable(struct drm_bridge *bridge)
>  {
>   struct dsi_data *dsi = drm_bridge_to_dsi(bridge);
> + struct omap_dss_device *dssdev = >output;
>  
> - dsi_enable_video_outputs(>output);
> + dsi_bus_lock(dsi);
> +
> + dsi_display_enable(dssdev);
> +
> + dsi_enable_video_output(dssdev, VC_VIDEO);
> +
> + dsi->video_enabled = true;
> +
> + dsi_set_ulps_auto(dsi, true);
> +
> + dsi_bus_unlock(dsi);
>  }
>  
>  static void dsi_bridge_disable(struct drm_bridge *bridge)
>  {
>   struct dsi_data *dsi = drm_bridge_to_dsi(bridge);
> + struct omap_dss_device *dssdev = >output;
> +
> + dsi_bus_lock(dsi);
> +
> + dsi->video_enabled = false;
> +
> + dsi_disable_video_output(dssdev, VC_VIDEO);
>  
> - dsi_disable_video_outputs(>output);
> + dsi_display_disable(dssdev);
> +
> + dsi_bus_unlock(dsi);
>  }
>  
>  static const struct drm_bridge_funcs dsi_bridge_funcs = {

-- 
Regards,

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


Re: [PATCH v4 71/80] drm/omap: dsi: move structs & defines to dsi.h

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:29PM +0200, Tomi Valkeinen wrote:
> Move structs and defines to a private dsi.h header file to make dsi.c a
> bit easier to navigate. Also move the (now) private structs and defines
> from omapdss.h to dsi.h.

I usually tend to keep structures used by a single .c file in that file,
but it's a matter of personal preference I suppose.

> Signed-off-by: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 384 +-
>  drivers/gpu/drm/omapdrm/dss/dsi.h | 456 ++
>  drivers/gpu/drm/omapdrm/dss/omapdss.h |  64 
>  3 files changed, 457 insertions(+), 447 deletions(-)
>  create mode 100644 drivers/gpu/drm/omapdrm/dss/dsi.h
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 019814a0a264..a01e09c9b477 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -45,73 +45,7 @@
>  
>  #define DSI_CATCH_MISSING_TE
>  
> -struct dsi_reg { u16 module; u16 idx; };
> -
> -#define DSI_REG(mod, idx)((const struct dsi_reg) { mod, idx })
> -
> -/* DSI Protocol Engine */
> -
> -#define DSI_PROTO0
> -#define DSI_PROTO_SZ 0x200
> -
> -#define DSI_REVISION DSI_REG(DSI_PROTO, 0x)
> -#define DSI_SYSCONFIGDSI_REG(DSI_PROTO, 0x0010)
> -#define DSI_SYSSTATUSDSI_REG(DSI_PROTO, 0x0014)
> -#define DSI_IRQSTATUSDSI_REG(DSI_PROTO, 0x0018)
> -#define DSI_IRQENABLEDSI_REG(DSI_PROTO, 0x001C)
> -#define DSI_CTRL DSI_REG(DSI_PROTO, 0x0040)
> -#define DSI_GNQ  DSI_REG(DSI_PROTO, 0x0044)
> -#define DSI_COMPLEXIO_CFG1   DSI_REG(DSI_PROTO, 0x0048)
> -#define DSI_COMPLEXIO_IRQ_STATUS DSI_REG(DSI_PROTO, 0x004C)
> -#define DSI_COMPLEXIO_IRQ_ENABLE DSI_REG(DSI_PROTO, 0x0050)
> -#define DSI_CLK_CTRL DSI_REG(DSI_PROTO, 0x0054)
> -#define DSI_TIMING1  DSI_REG(DSI_PROTO, 0x0058)
> -#define DSI_TIMING2  DSI_REG(DSI_PROTO, 0x005C)
> -#define DSI_VM_TIMING1   DSI_REG(DSI_PROTO, 0x0060)
> -#define DSI_VM_TIMING2   DSI_REG(DSI_PROTO, 0x0064)
> -#define DSI_VM_TIMING3   DSI_REG(DSI_PROTO, 0x0068)
> -#define DSI_CLK_TIMING   DSI_REG(DSI_PROTO, 0x006C)
> -#define DSI_TX_FIFO_VC_SIZE  DSI_REG(DSI_PROTO, 0x0070)
> -#define DSI_RX_FIFO_VC_SIZE  DSI_REG(DSI_PROTO, 0x0074)
> -#define DSI_COMPLEXIO_CFG2   DSI_REG(DSI_PROTO, 0x0078)
> -#define DSI_RX_FIFO_VC_FULLNESS  DSI_REG(DSI_PROTO, 0x007C)
> -#define DSI_VM_TIMING4   DSI_REG(DSI_PROTO, 0x0080)
> -#define DSI_TX_FIFO_VC_EMPTINESS DSI_REG(DSI_PROTO, 0x0084)
> -#define DSI_VM_TIMING5   DSI_REG(DSI_PROTO, 0x0088)
> -#define DSI_VM_TIMING6   DSI_REG(DSI_PROTO, 0x008C)
> -#define DSI_VM_TIMING7   DSI_REG(DSI_PROTO, 0x0090)
> -#define DSI_STOPCLK_TIMING   DSI_REG(DSI_PROTO, 0x0094)
> -#define DSI_VC_CTRL(n)   DSI_REG(DSI_PROTO, 0x0100 + (n 
> * 0x20))
> -#define DSI_VC_TE(n) DSI_REG(DSI_PROTO, 0x0104 + (n * 0x20))
> -#define DSI_VC_LONG_PACKET_HEADER(n) DSI_REG(DSI_PROTO, 0x0108 + (n * 0x20))
> -#define DSI_VC_LONG_PACKET_PAYLOAD(n)DSI_REG(DSI_PROTO, 0x010C + (n 
> * 0x20))
> -#define DSI_VC_SHORT_PACKET_HEADER(n)DSI_REG(DSI_PROTO, 0x0110 + (n 
> * 0x20))
> -#define DSI_VC_IRQSTATUS(n)  DSI_REG(DSI_PROTO, 0x0118 + (n * 0x20))
> -#define DSI_VC_IRQENABLE(n)  DSI_REG(DSI_PROTO, 0x011C + (n * 0x20))
> -
> -/* DSIPHY_SCP */
> -
> -#define DSI_PHY  1
> -#define DSI_PHY_OFFSET   0x200
> -#define DSI_PHY_SZ   0x40
> -
> -#define DSI_DSIPHY_CFG0  DSI_REG(DSI_PHY, 0x)
> -#define DSI_DSIPHY_CFG1  DSI_REG(DSI_PHY, 0x0004)
> -#define DSI_DSIPHY_CFG2  DSI_REG(DSI_PHY, 0x0008)
> -#define DSI_DSIPHY_CFG5  DSI_REG(DSI_PHY, 0x0014)
> -#define DSI_DSIPHY_CFG10 DSI_REG(DSI_PHY, 0x0028)
> -
> -/* DSI_PLL_CTRL_SCP */
> -
> -#define DSI_PLL  2
> -#define DSI_PLL_OFFSET   0x300
> -#define DSI_PLL_SZ   0x20
> -
> -#define DSI_PLL_CONTROL  DSI_REG(DSI_PLL, 0x)
> -#define DSI_PLL_STATUS   DSI_REG(DSI_PLL, 0x0004)
> -#define DSI_PLL_GO   DSI_REG(DSI_PLL, 0x0008)
> -#define DSI_PLL_CONFIGURATION1   DSI_REG(DSI_PLL, 0x000C)
> -#define DSI_PLL_CONFIGURATION2   DSI_REG(DSI_PLL, 0x0010)
> +#include "dsi.h"
>  
>  #define REG_GET(dsi, idx, start, end) \
>   FLD_GET(dsi_read_reg(dsi, idx), start, end)
> 

Re: [PATCH v4 70/80] drm/panel: panel-dsi-cm: drop unneeded includes

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:28PM +0200, Tomi Valkeinen wrote:
> Drop unneeded includes.
> 
> Signed-off-by: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/panel/panel-dsi-cm.c | 5 -
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c 
> b/drivers/gpu/drm/panel/panel-dsi-cm.c
> index ec87b785871f..91ed8237a1c2 100644
> --- a/drivers/gpu/drm/panel/panel-dsi-cm.c
> +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c
> @@ -9,12 +9,7 @@
>  #include 
>  #include 
>  #include 
> -#include 

This could go to the patch that moves TE handling to the code.

>  #include 
> -#include 

I'd keep module.h as you use macros it defines, and we shouldn't depend
in indirect includes.

Reviewed-by: Laurent Pinchart 

> -#include 
> -#include 
> -#include 
>  #include 
>  
>  #include 

-- 
Regards,

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


Re: [PATCH v4 69/80] drm/panel: panel-dsi-cm: add panel database to driver

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:27PM +0200, Tomi Valkeinen wrote:
> Add a panel database to the driver instead of reading propertes from DT
> data. This is similar to panel-simple, and I believe it's more future
> safe way to handle the panels.

No need to care about backward compatibility ?

> Signed-off-by: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/panel/panel-dsi-cm.c | 107 +--
>  1 file changed, 69 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c 
> b/drivers/gpu/drm/panel/panel-dsi-cm.c
> index c17ed728c695..ec87b785871f 100644
> --- a/drivers/gpu/drm/panel/panel-dsi-cm.c
> +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c
> @@ -22,10 +22,7 @@
>  #include 
>  #include 
>  
> -#include 
>  #include 
> -#include 
> -#include 
>  
>  #define DCS_GET_ID1  0xda
>  #define DCS_GET_ID2  0xdb
> @@ -33,6 +30,18 @@
>  
>  #define DCS_REGULATOR_SUPPLY_NUM 2
>  
> +static const struct of_device_id dsicm_of_match[];
> +
> +struct dsic_panel_data {
> + u32 xres;
> + u32 yres;
> + u32 refresh;
> + u32 width_mm;
> + u32 height_mm;
> + u32 max_hs_rate;
> + u32 max_lp_rate;
> +};
> +
>  struct panel_drv_data {
>   struct mipi_dsi_device *dsi;
>   struct drm_panel panel;
> @@ -48,16 +57,14 @@ struct panel_drv_data {
>*/
>   unsigned long   hw_guard_wait;  /* max guard time in jiffies */
>  
> - /* panel HW configuration from DT or platform data */
> + const struct dsic_panel_data *panel_data;
> +
>   struct gpio_desc *reset_gpio;
>  
>   struct regulator_bulk_data supplies[DCS_REGULATOR_SUPPLY_NUM];
>  
>   bool use_dsi_backlight;
>  
> - int width_mm;
> - int height_mm;
> -
>   /* runtime variables */
>   bool enabled;
>  
> @@ -455,11 +462,8 @@ static int dsicm_get_modes(struct drm_panel *panel,
>   return -ENOMEM;
>   }
>  
> - drm_mode_set_name(mode);
> - mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> -
> - connector->display_info.width_mm = ddata->width_mm;
> - connector->display_info.height_mm = ddata->height_mm;
> + connector->display_info.width_mm = ddata->panel_data->width_mm;
> + connector->display_info.height_mm = ddata->panel_data->height_mm;
>  
>   drm_mode_probed_add(connector, mode);
>  
> @@ -476,15 +480,10 @@ static const struct drm_panel_funcs dsicm_panel_funcs = 
> {
>  
>  static int dsicm_probe_of(struct mipi_dsi_device *dsi)
>  {
> - struct device_node *node = dsi->dev.of_node;
>   struct backlight_device *backlight;
>   struct panel_drv_data *ddata = mipi_dsi_get_drvdata(dsi);
> - struct display_timing timing;
> - struct videomode vm = {
> - .hactive = 864,
> - .vactive = 480,
> - };
>   int err;
> + struct drm_display_mode *mode = >mode;
>  
>   ddata->reset_gpio = devm_gpiod_get(>dev, "reset", GPIOD_OUT_LOW);
>   if (IS_ERR(ddata->reset_gpio)) {
> @@ -493,23 +492,16 @@ static int dsicm_probe_of(struct mipi_dsi_device *dsi)
>   return err;
>   }
>  
> - err = of_get_display_timing(node, "panel-timing", );
> - if (!err) {
> - videomode_from_timing(, );
> - } else {
> - dev_warn(>dev,
> -  "failed to get video timing, using defaults\n");
> - }
> -
> - if (!vm.pixelclock)
> - vm.pixelclock = vm.hactive * vm.vactive * 60;
> - drm_display_mode_from_videomode(, >mode);
> -
> - ddata->width_mm = 0;
> - of_property_read_u32(node, "width-mm", >width_mm);
> -
> - ddata->height_mm = 0;
> - of_property_read_u32(node, "height-mm", >height_mm);
> + mode->hdisplay = mode->hsync_start = mode->hsync_end = mode->htotal =
> + ddata->panel_data->xres;
> + mode->vdisplay = mode->vsync_start = mode->vsync_end = mode->vtotal =
> + ddata->panel_data->yres;
> + mode->clock = ddata->panel_data->xres * ddata->panel_data->yres *
> + ddata->panel_data->refresh / 1000;
> + mode->width_mm = ddata->panel_data->width_mm;
> + mode->height_mm = ddata->panel_data->height_mm;
> + mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> + drm_mode_set_name(mode);
>  
>   ddata->supplies[0].supply = "vpnl";
>   ddata->supplies[1].supply = "vddi";
> @@ -536,6 +528,7 @@ static int dsicm_probe(struct mipi_dsi_device *dsi)
>   struct panel_drv_data *ddata;
>   struct backlight_device *bldev = NULL;
>   struct device *dev = >dev;
> + const struct of_device_id *id;
>   int r;
>  
>   dev_dbg(dev, "probe\n");
> @@ -547,6 +540,12 @@ static int dsicm_probe(struct mipi_dsi_device *dsi)
>   mipi_dsi_set_drvdata(dsi, ddata);
>   ddata->dsi = dsi;
>  
> + id = of_match_node(dsicm_of_match, dev->of_node);
> + if (!id)
> + return -ENODEV;
> +
> + ddata->panel_data = 

Re: [PATCH v4 68/80] drm/panel: panel-dsi-cm: remove extra 'if'

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:26PM +0200, Tomi Valkeinen wrote:
> We have a useless 'if' in the dsicm_bl_update_status(), a left over from
> the conversion to DRM model. Drop the if.
> 
> Signed-off-by: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/panel/panel-dsi-cm.c | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c 
> b/drivers/gpu/drm/panel/panel-dsi-cm.c
> index 1e7f73340736..c17ed728c695 100644
> --- a/drivers/gpu/drm/panel/panel-dsi-cm.c
> +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c
> @@ -194,7 +194,7 @@ static int dsicm_set_update_window(struct panel_drv_data 
> *ddata)
>  static int dsicm_bl_update_status(struct backlight_device *dev)
>  {
>   struct panel_drv_data *ddata = dev_get_drvdata(>dev);
> - int r = 0;
> + int r;
>   int level;
>  
>   if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
> @@ -207,11 +207,9 @@ static int dsicm_bl_update_status(struct 
> backlight_device *dev)
>  
>   mutex_lock(>lock);
>  
> - if (ddata->enabled) {
> - if (!r)
> - r = dsicm_dcs_write_1(
> - ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, level);
> - }
> + if (ddata->enabled)
> + r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS,
> +   level);

If !ddata->enabled, won't r be uninitialized ?

>  
>   mutex_unlock(>lock);
>  

-- 
Regards,

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


Re: [PATCH v4 67/80] drm/omap: dsi: use separate VCs for cmd and video

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:25PM +0200, Tomi Valkeinen wrote:
> For command mode panels we can use a single VC for sending command and
> video data, even if we have to change the data source for that VC when
> going from command to video or vice versa.
> 
> However, with video mode panels we want to keep the pixel data VC
> enabled, and use another VC for command data, and the commands will get
> interleaved into the pixel data.
> 
> This patch makes the driver use VC0 for commands and VC1 for video.
> 
> Signed-off-by: Tomi Valkeinen 

Reviewed-by: Laurent Pinchart 

> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 12 +++-
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 41d6231d6e31..019814a0a264 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -452,7 +452,9 @@ static bool dsi_perf;
>  module_param(dsi_perf, bool, 0644);
>  #endif
>  
> -#define VC_DEFAULT 0
> +/* Note: for some reason video mode seems to work only if VC_VIDEO is 0 */
> +#define VC_VIDEO 0
> +#define VC_CMD   1
>  
>  #define drm_bridge_to_dsi(bridge) \
>   container_of(bridge, struct dsi_data, bridge)
> @@ -3723,7 +3725,7 @@ static void dsi_disable_video_outputs(struct 
> omap_dss_device *dssdev)
>   dsi_bus_lock(dsi);
>   dsi->video_enabled = false;
>  
> - dsi_disable_video_output(dssdev, VC_DEFAULT);
> + dsi_disable_video_output(dssdev, VC_VIDEO);
>  
>   dsi_display_disable(dssdev);
>  
> @@ -3946,7 +3948,7 @@ static int dsi_update_channel(struct omap_dss_device 
> *dssdev, int vc)
>  
>  static int dsi_update_all(struct omap_dss_device *dssdev)
>  {
> - return dsi_update_channel(dssdev, VC_DEFAULT);
> + return dsi_update_channel(dssdev, VC_VIDEO);
>  }
>  
>  /* Display funcs */
> @@ -4179,7 +4181,7 @@ static void dsi_enable_video_outputs(struct 
> omap_dss_device *dssdev)
>  
>   dsi_display_enable(dssdev);
>  
> - dsi_enable_video_output(dssdev, VC_DEFAULT);
> + dsi_enable_video_output(dssdev, VC_VIDEO);
>  
>   dsi->video_enabled = true;
>  
> @@ -4936,7 +4938,7 @@ static ssize_t omap_dsi_host_transfer(struct 
> mipi_dsi_host *host,
>  {
>   struct dsi_data *dsi = host_to_omap(host);
>   int r;
> - int vc = VC_DEFAULT;
> + int vc = VC_CMD;
>  
>   dsi_bus_lock(dsi);
>  

-- 
Regards,

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


Re: [PATCH v4 66/80] drm/omap: dsi: set LP/HS before update

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:24PM +0200, Tomi Valkeinen wrote:
> We currently use a single VC for sending commands and pixel data. The
> LP/HS mode for pixel data is correct by accident, as we have set the VC
> to HS already earlier.
> 
> However, if we use a different VC for video data, the VC is in LP mode.
> Fix this by always setting the LP/HS mode before starting a frame
> update.
> 
> Signed-off-by: Tomi Valkeinen 

Reviewed-by: Laurent Pinchart 

> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index c3f13226ac26..41d6231d6e31 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -3918,6 +3918,8 @@ static int dsi_update_channel(struct omap_dss_device 
> *dssdev, int vc)
>  
>   dsi_set_ulps_auto(dsi, false);
>  
> + dsi_vc_enable_hs(dssdev, vc, !(dsi->dsidev->mode_flags & 
> MIPI_DSI_MODE_LPM));
> +
>   r = _dsi_send_nop(dsi, vc, dsi->dsidev->channel);
>   if (r < 0) {
>   DSSWARN("failed to send nop between frames: %d\n", r);

-- 
Regards,

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


Re: [PATCH v4 65/80] drm/omap: dsi: skip dsi_vc_enable_hs when already in correct mode

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:23PM +0200, Tomi Valkeinen wrote:
> Simplify and optimize dsi_vc_enable_hs() so that it can be called
> without checking the current HS/LP mode. Make dsi_vc_enable_hs() return
> if the VC is already in the correct mode.
> 
> Signed-off-by: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 4ac82166edc3..c3f13226ac26 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -341,7 +341,6 @@ struct dsi_data {
>   int irq;
>  
>   bool is_enabled;
> - bool in_lp_mode;
>  
>   struct clk *dss_clk;
>   struct regmap *syscon;
> @@ -2441,6 +2440,9 @@ static void dsi_vc_enable_hs(struct omap_dss_device 
> *dssdev, int vc,
>  
>   DSSDBG("dsi_vc_enable_hs(%d, %d)\n", vc, enable);
>  
> + if (REG_GET(dsi, DSI_VC_CTRL(vc), 9, 9) == enable)
> + return;
> +

I tend to prefer cached state instead of reading it back from the
hardware, as it's (marginally) more efficient. In either case,

Reviewed-by: Laurent Pinchart 

>   WARN_ON(!dsi_bus_is_locked(dsi));
>  
>   dsi_vc_enable(dsi, vc, 0);
> @@ -2456,8 +2458,6 @@ static void dsi_vc_enable_hs(struct omap_dss_device 
> *dssdev, int vc,
>   /* start the DDR clock by sending a NULL packet */
>   if (dsi->vm_timings.ddr_clk_always_on && enable)
>   dsi_vc_send_null(dsi, vc, dsi->dsidev->channel);
> -
> - dsi->in_lp_mode = !enable;
>  }
>  
>  static void dsi_vc_flush_long_data(struct dsi_data *dsi, int vc)
> @@ -4886,9 +4886,7 @@ static ssize_t _omap_dsi_host_transfer(struct dsi_data 
> *dsi, int vc,
>   struct omap_dss_device *dssdev = >output;
>   int r;
>  
> - if (!!(msg->flags & MIPI_DSI_MSG_USE_LPM) != dsi->in_lp_mode)
> - dsi_vc_enable_hs(dssdev, vc,
> -  !(msg->flags & MIPI_DSI_MSG_USE_LPM));
> + dsi_vc_enable_hs(dssdev, vc, !(msg->flags & MIPI_DSI_MSG_USE_LPM));
>  
>   switch (msg->type) {
>   case MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM:

-- 
Regards,

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


RE: [Intel-gfx] [PATCH 1/2] drm/framebuffer: Format modifier for Intel Gen 12 render compression with Clear Color

2020-11-30 Thread Chery, Nanley G



> -Original Message-
> From: Imre Deak 
> Sent: Friday, November 27, 2020 10:06 AM
> To: Daniel Vetter ; Chery, Nanley G
> 
> Cc: intel-...@lists.freedesktop.org; Nikula, Jani ; 
> Daniel
> Vetter ; Rafael Antognolli
> ; Kondapally, Kalyan
> ; Pandiyan, Dhinakaran
> ; dri-devel@lists.freedesktop.org
> Subject: Re: [Intel-gfx] [PATCH 1/2] drm/framebuffer: Format modifier for 
> Intel
> Gen 12 render compression with Clear Color
> 
> On Fri, Nov 27, 2020 at 04:19:20PM +0100, Daniel Vetter wrote:
> > On Fri, Nov 27, 2020 at 04:31:00PM +0200, Imre Deak wrote:
> > > Hi Daniel, Jani,
> > >
> > > is it ok to merge this patch along with 2/2 via the i915 tree?
> >
> > Ack from mesa (userspace in general, but mesa is kinda mandatory) is
> > missing I think. With that
> > Acked-by: Daniel Vetter 
> 
> Thanks.
> 
> Nanley, could you ACK the patchset if they look ok from Mesa's POV? It
> works as expected at least with the igt/kms_ccs RC-CC subtest.
> 

Hi Imre,
 
I have a question and a couple comments:

Is the map of the clear color address creating a new synchronization point 
between the GPU and CPU? If so, I wonder how this will impact performance. 
There was some talk of asynchronously updating the clear color register a while 
back. 

We probably don't have to update the header, but we noticed in our testing that 
the clear color prefers an alignment greater than 64B. Unfortunately, I can't 
find any bspec note about this. As long as the buffer creators are aware 
though, I think we should be fine. I don't know if this is the best forum to 
bring it up, but I thought I'd share.

Seems like the upper converted clear color is untested due to the lack of 
RGBX16 support. I suppose that if there are any issues there, they can be fixed 
later...

-Nanley

> --Imre
> 
> > > On Mon, Nov 23, 2020 at 08:26:30PM +0200, Imre Deak wrote:
> > > > From: Radhakrishna Sripada 
> > > >
> > > > Gen12 display can decompress surfaces compressed by render engine with
> > > > Clear Color, add a new modifier as the driver needs to know the surface
> > > > was compressed by render engine.
> > > >
> > > > V2: Description changes as suggested by Rafael.
> > > > V3: Mention the Clear Color size of 64 bits in the comments(DK)
> > > > v4: Fix trailing whitespaces
> > > > v5: Explain Clear Color in the documentation.
> > > > v6: Documentation Nitpicks(Nanley)
> > > >
> > > > Cc: Ville Syrjala 
> > > > Cc: Dhinakaran Pandiyan 
> > > > Cc: Kalyan Kondapally 
> > > > Cc: Rafael Antognolli 
> > > > Cc: Nanley Chery 
> > > > Signed-off-by: Radhakrishna Sripada 
> > > > Signed-off-by: Imre Deak 
> > > > ---
> > > >  include/uapi/drm/drm_fourcc.h | 19 +++
> > > >  1 file changed, 19 insertions(+)
> > > >
> > > > diff --git a/include/uapi/drm/drm_fourcc.h
> b/include/uapi/drm/drm_fourcc.h
> > > > index ca48ed0e6bc1..0a1b2c4c4bee 100644
> > > > --- a/include/uapi/drm/drm_fourcc.h
> > > > +++ b/include/uapi/drm/drm_fourcc.h
> > > > @@ -527,6 +527,25 @@ extern "C" {
> > > >   */
> > > >  #define I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS
> fourcc_mod_code(INTEL, 7)
> > > >
> > > > +/*
> > > > + * Intel Color Control Surface with Clear Color (CCS) for Gen-12 render
> > > > + * compression.
> > > > + *
> > > > + * The main surface is Y-tiled and is at plane index 0 whereas CCS is 
> > > > linear
> > > > + * and at index 1. The clear color is stored at index 2, and the pitch 
> > > > should
> > > > + * be ignored. The clear color structure is 256 bits. The first 128 
> > > > bits
> > > > + * represents Raw Clear Color Red, Green, Blue and Alpha color each
> represented
> > > > + * by 32 bits. The raw clear color is consumed by the 3d engine and
> generates
> > > > + * the converted clear color of size 64 bits. The first 32 bits store 
> > > > the
> Lower
> > > > + * Converted Clear Color value and the next 32 bits store the Higher
> Converted
> > > > + * Clear Color value when applicable. The Converted Clear Color values
> are
> > > > + * consumed by the DE. The last 64 bits are used to store Color Discard
> Enable
> > > > + * and Depth Clear Value Valid which are ignored by the DE. A CCS cache
> line
> > > > + * corresponds to an area of 4x1 tiles in the main surface. The main
> surface
> > > > + * pitch is required to be a multiple of 4 tile widths.
> > > > + */
> > > > +#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC
> fourcc_mod_code(INTEL, 8)
> > > > +
> > > >  /*
> > > >   * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized 
> > > > macroblocks
> > > >   *
> > > > --
> > > > 2.25.1
> > > >
> > > > ___
> > > > Intel-gfx mailing list
> > > > intel-...@lists.freedesktop.org
> > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > > ___
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel 

Re: [PATCH v4 64/80] drm/omap: dsi: cleanup channel usages

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:22PM +0200, Tomi Valkeinen wrote:
> The "channel" usage in omap dsi driver is super confusing. We have three
> different "channels":
> 
> 1) DSI virtual channel ID. This is a number from 0 to 3, included in the
> packet payload.
> 
> 2) VC. This is a register block in the DSI IP. There are four of those
> blocks. A VC is a DSI "pipeline", with defined fifo settings, data
> source (cpu or dispc), and some other settings. It has no relation to
> the 1).

Lovely that it's called VC :-)

> 3) dispc channel. It's the "pipeline" number dispc uses to send pixel
> data.
> 
> To clean this up use the following names for each of the above: 1)
> "channel" 2) "vc" 3) "dispc_channel"

1) and 2) will still be prone to confusion :-S Would it help to name 2)
hw_vc or something similar ?

> This patch is mostly about renaming things, but as in some places 1) and
> 2) have gotten mixed up, additional changes were needed to untangle
> them. This is mostly just adding a new parameter to some functions so
> that we pass both the vc and the channel.

It would ease review if this could be split in two patches.

> Signed-off-by: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 315 +++---
>  1 file changed, 158 insertions(+), 157 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index fbf05097612f..4ac82166edc3 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -214,9 +214,9 @@ static void dsi_set_ulps_auto(struct dsi_data *dsi, bool 
> enable);
>  static int dsi_display_init_dispc(struct dsi_data *dsi);
>  static void dsi_display_uninit_dispc(struct dsi_data *dsi);
>  
> -static int dsi_vc_send_null(struct dsi_data *dsi, int channel);
> +static int dsi_vc_send_null(struct dsi_data *dsi, int vc, int channel);
>  
> -static ssize_t _omap_dsi_host_transfer(struct dsi_data *dsi,
> +static ssize_t _omap_dsi_host_transfer(struct dsi_data *dsi, int vc,
>  const struct mipi_dsi_msg *msg);
>  
>  static void dsi_display_disable(struct omap_dss_device *dssdev);
> @@ -376,7 +376,7 @@ struct dsi_data {
>   /* space for a copy used by the interrupt handler */
>   struct dsi_isr_tables isr_tables_copy;
>  
> - int update_channel;
> + int update_vc;
>  #ifdef DSI_PERF_MEASURE
>   unsigned int update_bytes;
>  #endif
> @@ -639,7 +639,7 @@ static void print_irq_status(u32 status)
>  #undef PIS
>  }
>  
> -static void print_irq_status_vc(int channel, u32 status)
> +static void print_irq_status_vc(int vc, u32 status)
>  {
>   if (status == 0)
>   return;
> @@ -650,7 +650,7 @@ static void print_irq_status_vc(int channel, u32 status)
>  #define PIS(x) (status & DSI_VC_IRQ_##x) ? (#x " ") : ""
>  
>   pr_debug("DSI VC(%d) IRQ 0x%x: %s%s%s%s%s%s%s%s%s\n",
> - channel,
> + vc,
>   status,
>   PIS(CS),
>   PIS(ECC_CORR),
> @@ -1031,7 +1031,7 @@ static int dsi_unregister_isr(struct dsi_data *dsi, 
> omap_dsi_isr_t isr,
>   return r;
>  }
>  
> -static int dsi_register_isr_vc(struct dsi_data *dsi, int channel,
> +static int dsi_register_isr_vc(struct dsi_data *dsi, int vc,
>  omap_dsi_isr_t isr, void *arg, u32 mask)
>  {
>   unsigned long flags;
> @@ -1040,18 +1040,18 @@ static int dsi_register_isr_vc(struct dsi_data *dsi, 
> int channel,
>   spin_lock_irqsave(>irq_lock, flags);
>  
>   r = _dsi_register_isr(isr, arg, mask,
> - dsi->isr_tables.isr_table_vc[channel],
> - ARRAY_SIZE(dsi->isr_tables.isr_table_vc[channel]));
> + dsi->isr_tables.isr_table_vc[vc],
> + ARRAY_SIZE(dsi->isr_tables.isr_table_vc[vc]));
>  
>   if (r == 0)
> - _omap_dsi_set_irqs_vc(dsi, channel);
> + _omap_dsi_set_irqs_vc(dsi, vc);
>  
>   spin_unlock_irqrestore(>irq_lock, flags);
>  
>   return r;
>  }
>  
> -static int dsi_unregister_isr_vc(struct dsi_data *dsi, int channel,
> +static int dsi_unregister_isr_vc(struct dsi_data *dsi, int vc,
>omap_dsi_isr_t isr, void *arg, u32 mask)
>  {
>   unsigned long flags;
> @@ -1060,11 +1060,11 @@ static int dsi_unregister_isr_vc(struct dsi_data 
> *dsi, int channel,
>   spin_lock_irqsave(>irq_lock, flags);
>  
>   r = _dsi_unregister_isr(isr, arg, mask,
> - dsi->isr_tables.isr_table_vc[channel],
> - ARRAY_SIZE(dsi->isr_tables.isr_table_vc[channel]));
> + dsi->isr_tables.isr_table_vc[vc],
> + ARRAY_SIZE(dsi->isr_tables.isr_table_vc[vc]));
>  
>   if (r == 0)
> - _omap_dsi_set_irqs_vc(dsi, channel);
> + _omap_dsi_set_irqs_vc(dsi, vc);
>  
>   spin_unlock_irqrestore(>irq_lock, flags);
>  
> @@ -2232,9 

Re: [PATCH v4 63/80] drm/omap: dsi: drop useless channel checks

2020-11-30 Thread Laurent Pinchart
Hi Tomi,

Thank you for the patch.

On Tue, Nov 24, 2020 at 02:45:21PM +0200, Tomi Valkeinen wrote:
> A DSI peripheral can have virtual channel ID of 0-3. This should be
> always the case, and there's no need in the driver to validate the
> channel.
> 
> Signed-off-by: Tomi Valkeinen 

Reviewed-by: Laurent Pinchart 

> ---
>  drivers/gpu/drm/omapdrm/dss/dsi.c | 11 ---
>  1 file changed, 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c 
> b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 63338324c564..fbf05097612f 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -3902,9 +3902,6 @@ static int dsi_update_channel(struct omap_dss_device 
> *dssdev, int channel)
>   struct dsi_data *dsi = to_dsi_data(dssdev);
>   int r;
>  
> - if (channel > 3)
> - return -EINVAL;
> -
>   dsi_bus_lock(dsi);
>  
>   if (!dsi->video_enabled) {
> @@ -5063,12 +5060,8 @@ static int omap_dsi_host_attach(struct mipi_dsi_host 
> *host,
>   struct mipi_dsi_device *client)
>  {
>   struct dsi_data *dsi = host_to_omap(host);
> - unsigned int channel = client->channel;
>   int r;
>  
> - if (channel > 3)
> - return -EINVAL;
> -
>   if (dsi->dsidev) {
>   DSSERR("dsi client already attached\n");
>   return -EBUSY;
> @@ -5118,10 +5111,6 @@ static int omap_dsi_host_detach(struct mipi_dsi_host 
> *host,
>   struct mipi_dsi_device *client)
>  {
>   struct dsi_data *dsi = host_to_omap(host);
> - unsigned int channel = client->channel;
> -
> - if (channel > 3)
> - return -EINVAL;
>  
>   if (WARN_ON(dsi->dsidev != client))
>   return -EINVAL;

-- 
Regards,

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


Re: [PATCH 40/40] drm/amd/display/dc/basics/vector: Make local function 'dal_vector_presized_costruct' static

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:44 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/basics/vector.c:55:6: warning: no 
> previous prototype for ‘dal_vector_presized_costruct’ [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/basics/vector.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/basics/vector.c 
> b/drivers/gpu/drm/amd/display/dc/basics/vector.c
> index 8f93d25f91ee2..706c803c4d3b0 100644
> --- a/drivers/gpu/drm/amd/display/dc/basics/vector.c
> +++ b/drivers/gpu/drm/amd/display/dc/basics/vector.c
> @@ -52,7 +52,7 @@ bool dal_vector_construct(
> return true;
>  }
>
> -bool dal_vector_presized_costruct(
> +static bool dal_vector_presized_costruct(
> struct vector *vector,
> struct dc_context *ctx,
> uint32_t count,
> --
> 2.25.1
>
> ___
> 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 39/40] drm/amd/display/dc/basics/fixpt31_32: Remove unused variable 'dc_fixpt_pi'

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:44 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/basics/fixpt31_32.c:29:32: warning: 
> ‘dc_fixpt_pi’ defined but not used [-Wunused-const-variable=]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Lee Jones 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c 
> b/drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c
> index 59f37563704ad..1726bdf89bae8 100644
> --- a/drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c
> +++ b/drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c
> @@ -26,7 +26,6 @@
>  #include "dm_services.h"
>  #include "include/fixed31_32.h"
>
> -static const struct fixed31_32 dc_fixpt_pi = { 13493037705LL };
>  static const struct fixed31_32 dc_fixpt_two_pi = { 26986075409LL };
>  static const struct fixed31_32 dc_fixpt_ln2 = { 2977044471LL };
>  static const struct fixed31_32 dc_fixpt_ln2_div_2 = { 1488522236LL };
> --
> 2.25.1
>
> ___
> 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 38/40] drm/amd/display/dc/basics/conversion: Include header containing our prototypes

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:44 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/basics/conversion.c:34:10: warning: 
> no previous prototype for ‘fixed_point_to_int_frac’ [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/dc/basics/conversion.c:81:6: warning: 
> no previous prototype for ‘convert_float_matrix’ [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/basics/conversion.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/basics/conversion.c 
> b/drivers/gpu/drm/amd/display/dc/basics/conversion.c
> index 50b47f11875c9..24ed03d8cda74 100644
> --- a/drivers/gpu/drm/amd/display/dc/basics/conversion.c
> +++ b/drivers/gpu/drm/amd/display/dc/basics/conversion.c
> @@ -24,6 +24,7 @@
>   */
>
>  #include "dm_services.h"
> +#include "conversion.h"
>
>  #define DIVIDER 1
>
> --
> 2.25.1
>
> ___
> 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 37/40] drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu: Remove unused function 'pp_nv_set_pme_wa_enable()'

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:44 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:664:20: 
> warning: no previous prototype for ‘pp_nv_set_pme_wa_enable’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c | 16 
>  1 file changed, 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
> index ac0a0539854ef..607ec09994456 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
> @@ -661,22 +661,6 @@ static enum pp_smu_status pp_nv_set_wm_ranges(struct 
> pp_smu *pp,
> return PP_SMU_RESULT_OK;
>  }
>
> -static enum pp_smu_status pp_nv_set_pme_wa_enable(struct pp_smu *pp)
> -{
> -   const struct dc_context *ctx = pp->dm;
> -   struct amdgpu_device *adev = ctx->driver_context;
> -   struct smu_context *smu = >smu;
> -
> -   if (!smu->ppt_funcs)
> -   return PP_SMU_RESULT_UNSUPPORTED;
> -
> -   /* 0: successful or smu.ppt_funcs->set_azalia_d3_pme = NULL;  1: fail 
> */
> -   if (smu_set_azalia_d3_pme(smu))
> -   return PP_SMU_RESULT_FAIL;
> -
> -   return PP_SMU_RESULT_OK;
> -}
> -
>  static enum pp_smu_status pp_nv_set_display_count(struct pp_smu *pp, int 
> count)
>  {
> const struct dc_context *ctx = pp->dm;
> --
> 2.25.1
>
> ___
> 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 36/40] drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu: Mark local functions invoked by reference as static

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:44 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:538:6: 
> warning: no previous prototype for ‘pp_rv_set_wm_ranges’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:590:6: 
> warning: no previous prototype for ‘pp_rv_set_pme_wa_enable’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:601:6: 
> warning: no previous prototype for ‘pp_rv_set_active_display_count’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:614:6: 
> warning: no previous prototype for ‘pp_rv_set_min_deep_sleep_dcfclk’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:627:6: 
> warning: no previous prototype for ‘pp_rv_set_hard_min_dcefclk_by_freq’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:640:6: 
> warning: no previous prototype for ‘pp_rv_set_hard_min_fclk_by_freq’ 
> [-Wmissing-prototypes]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c   | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
> index 84065c12d4b85..ac0a0539854ef 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
> @@ -535,7 +535,7 @@ bool dm_pp_get_static_clocks(
> return true;
>  }
>
> -void pp_rv_set_wm_ranges(struct pp_smu *pp,
> +static void pp_rv_set_wm_ranges(struct pp_smu *pp,
> struct pp_smu_wm_range_sets *ranges)
>  {
> const struct dc_context *ctx = pp->dm;
> @@ -587,7 +587,7 @@ void pp_rv_set_wm_ranges(struct pp_smu *pp,
>
> _with_clock_ranges);
>  }
>
> -void pp_rv_set_pme_wa_enable(struct pp_smu *pp)
> +static void pp_rv_set_pme_wa_enable(struct pp_smu *pp)
>  {
> const struct dc_context *ctx = pp->dm;
> struct amdgpu_device *adev = ctx->driver_context;
> @@ -598,7 +598,7 @@ void pp_rv_set_pme_wa_enable(struct pp_smu *pp)
> pp_funcs->notify_smu_enable_pwe(pp_handle);
>  }
>
> -void pp_rv_set_active_display_count(struct pp_smu *pp, int count)
> +static void pp_rv_set_active_display_count(struct pp_smu *pp, int count)
>  {
> const struct dc_context *ctx = pp->dm;
> struct amdgpu_device *adev = ctx->driver_context;
> @@ -611,7 +611,7 @@ void pp_rv_set_active_display_count(struct pp_smu *pp, 
> int count)
> pp_funcs->set_active_display_count(pp_handle, count);
>  }
>
> -void pp_rv_set_min_deep_sleep_dcfclk(struct pp_smu *pp, int clock)
> +static void pp_rv_set_min_deep_sleep_dcfclk(struct pp_smu *pp, int clock)
>  {
> const struct dc_context *ctx = pp->dm;
> struct amdgpu_device *adev = ctx->driver_context;
> @@ -624,7 +624,7 @@ void pp_rv_set_min_deep_sleep_dcfclk(struct pp_smu *pp, 
> int clock)
> pp_funcs->set_min_deep_sleep_dcefclk(pp_handle, clock);
>  }
>
> -void pp_rv_set_hard_min_dcefclk_by_freq(struct pp_smu *pp, int clock)
> +static void pp_rv_set_hard_min_dcefclk_by_freq(struct pp_smu *pp, int clock)
>  {
> const struct dc_context *ctx = pp->dm;
> struct amdgpu_device *adev = ctx->driver_context;
> @@ -637,7 +637,7 @@ void pp_rv_set_hard_min_dcefclk_by_freq(struct pp_smu 
> *pp, int clock)
> pp_funcs->set_hard_min_dcefclk_by_freq(pp_handle, clock);
>  }
>
> -void pp_rv_set_hard_min_fclk_by_freq(struct pp_smu *pp, int mhz)
> +static void pp_rv_set_hard_min_fclk_by_freq(struct pp_smu *pp, int mhz)
>  {
> const struct dc_context *ctx = pp->dm;
> struct amdgpu_device *adev = ctx->driver_context;
> @@ -661,7 +661,7 @@ static enum pp_smu_status pp_nv_set_wm_ranges(struct 
> pp_smu *pp,
> return PP_SMU_RESULT_OK;
>  }
>
> -enum pp_smu_status pp_nv_set_pme_wa_enable(struct pp_smu *pp)
> +static enum pp_smu_status pp_nv_set_pme_wa_enable(struct pp_smu *pp)
>  {
> const struct dc_context *ctx = pp->dm;
> struct amdgpu_device *adev = ctx->driver_context;
> --
> 2.25.1
>
> ___
> 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 35/40] drm/amd/display/amdgpu_dm/amdgpu_dm_color: Demote a misuse and fix another kernel-doc header

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:44 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_color.c:128: 
> warning: Function parameter or member 'lut' not described in 
> '__drm_lut_to_dc_gamma'
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_color.c:128: 
> warning: Function parameter or member 'gamma' not described in 
> '__drm_lut_to_dc_gamma'
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_color.c:128: 
> warning: Function parameter or member 'is_legacy' not described in 
> '__drm_lut_to_dc_gamma'
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_color.c:426: 
> warning: Function parameter or member 'dc_plane_state' not described in 
> 'amdgpu_dm_update_plane_color_mgmt'
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> index 5df05f0d18bc9..157fe4efbb599 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> @@ -119,7 +119,7 @@ static bool __is_lut_linear(const struct drm_color_lut 
> *lut, uint32_t size)
> return true;
>  }
>
> -/**
> +/*
>   * Convert the drm_color_lut to dc_gamma. The conversion depends on the size
>   * of the lut - whether or not it's legacy.
>   */
> @@ -413,7 +413,7 @@ int amdgpu_dm_update_crtc_color_mgmt(struct dm_crtc_state 
> *crtc)
>  /**
>   * amdgpu_dm_update_plane_color_mgmt: Maps DRM color management to DC plane.
>   * @crtc: amdgpu_dm crtc state
> - * @ dc_plane_state: target DC surface
> + * @dc_plane_state: target DC surface
>   *
>   * Update the underlying dc_stream_state's input transfer function (ITF) in
>   * preparation for hardware commit. The transfer function used depends on
> --
> 2.25.1
>
> ___
> 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 33/40] drm/amd/display/dc/inc/hw/dpp: Mark 'dpp_input_csc_matrix' as __maybe_unused

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> 'dpp_input_csc_matrix' is used by some, but not all source files which
> include dpp.h.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/dc/inc/hw/dpp.h:50:42: warning: 
> ‘dpp_input_csc_matrix’ defined but not used [-Wunused-const-variable=]
>
> NB: Snipped lots of these for brevity
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h 
> b/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h
> index 6751186f6f904..ddbe4bb52724a 100644
> --- a/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h
> +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h
> @@ -47,7 +47,7 @@ struct dpp_input_csc_matrix {
> uint16_t regval[12];
>  };
>
> -static const struct dpp_input_csc_matrix dpp_input_csc_matrix[] = {
> +static const struct dpp_input_csc_matrix __maybe_unused 
> dpp_input_csc_matrix[] = {
> {COLOR_SPACE_SRGB,
> {0x2000, 0, 0, 0, 0, 0x2000, 0, 0, 0, 0, 0x2000, 0} },
> {COLOR_SPACE_SRGB_LIMITED,
> --
> 2.25.1
>
> ___
> 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 32/40] drm/amd/display/amdgpu_dm/amdgpu_dm: Mark 'link_bandwidth_kbps' as __maybe_unused

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> 'link_bandwidth_kbps' is always obtained, but only used if
> CONFIG_DRM_AMD_DC_DCN is defined.

Probably better to just move this under CONFIG_DRM_AMD_DC_DCN.  I'll
send a patch.

Thanks,

Alex


>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 
> ‘create_stream_for_sink’:
>  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5080:11: 
> warning: variable ‘link_bandwidth_kbps’ set but not used 
> [-Wunused-but-set-variable]
>
> Cc: Harry Wentland 
> Cc: Leo Li 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 08539f4315864..ac7643d73bc68 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5077,7 +5077,7 @@ create_stream_for_sink(struct amdgpu_dm_connector 
> *aconnector,
>  #if defined(CONFIG_DRM_AMD_DC_DCN)
> struct dsc_dec_dpcd_caps dsc_caps;
>  #endif
> -   uint32_t link_bandwidth_kbps;
> +   uint32_t __maybe_unused link_bandwidth_kbps;
>
> struct dc_sink *sink = NULL;
> if (aconnector == NULL) {
> --
> 2.25.1
>
> ___
> 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 30/40] drm/amd/pm/powerplay/hwmgr/vega12_thermal: Fix some outdated function documentation

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega12_thermal.c:63: 
> warning: Cannot understand  * @fn vega12_enable_fan_control_feature
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega12_thermal.c:137: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega12_fan_ctrl_reset_fan_speed_to_default'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega12_thermal.c:147: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega12_thermal_get_temperature'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega12_thermal.c:172: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega12_thermal_set_temperature_range'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega12_thermal.c:172: 
> warning: Function parameter or member 'range' not described in 
> 'vega12_thermal_set_temperature_range'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega12_thermal.c:208: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega12_thermal_enable_alert'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega12_thermal.c:226: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega12_thermal_disable_alert'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega12_thermal.c:240: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega12_thermal_stop_thermal_controller'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega12_thermal.c:256: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega12_thermal_setup_fan_table'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega12_thermal.c:279: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega12_thermal_start_smc_fan_control'
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../amd/pm/powerplay/hwmgr/vega12_thermal.c   | 82 ---
>  1 file changed, 36 insertions(+), 46 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_thermal.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_thermal.c
> index 7ace439dcde7a..0dc16f25a463b 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_thermal.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_thermal.c
> @@ -60,11 +60,10 @@ int vega12_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr 
> *hwmgr, uint32_t *speed)
>  }
>
>  /**
> - * @fn vega12_enable_fan_control_feature
> - * @brief Enables the SMC Fan Control Feature.
> + * vega12_enable_fan_control_feature -Enables the SMC Fan Control Feature.
>   *
> - * @paramhwmgr - the address of the powerplay hardware manager.
> - * @return   0 on success. -1 otherwise.
> + * @hwmgr: the address of the powerplay hardware manager.
> + * Return:   0 on success. -1 otherwise.
>   */
>  static int vega12_enable_fan_control_feature(struct pp_hwmgr *hwmgr)
>  {
> @@ -129,20 +128,20 @@ int vega12_fan_ctrl_stop_smc_fan_control(struct 
> pp_hwmgr *hwmgr)
>  }
>
>  /**
> -* Reset Fan Speed to default.
> -* @paramhwmgr  the address of the powerplay hardware manager.
> -* @exception Always succeeds.
> -*/
> + * vega12_fan_ctrl_reset_fan_speed_to_default - Reset Fan Speed to default.
> + * @hwmgr:  the address of the powerplay hardware manager.
> + * Exception Always succeeds.
> + */
>  int vega12_fan_ctrl_reset_fan_speed_to_default(struct pp_hwmgr *hwmgr)
>  {
> return vega12_fan_ctrl_start_smc_fan_control(hwmgr);
>  }
>
>  /**
> -* Reads the remote temperature from the SIslands thermal controller.
> -*
> -* @paramhwmgr The address of the hardware manager.
> -*/
> + * vega12_thermal_get_temperature - Reads the remote temperature from the 
> SIslands thermal controller.
> + *
> + * @hwmgr: The address of the hardware manager.
> + */
>  int vega12_thermal_get_temperature(struct pp_hwmgr *hwmgr)
>  {
> struct amdgpu_device *adev = hwmgr->adev;
> @@ -160,13 +159,13 @@ int vega12_thermal_get_temperature(struct pp_hwmgr 
> *hwmgr)
>  }
>
>  /**
> -* Set the requested temperature range for high and low alert signals
> -*
> -* @paramhwmgr The address of the hardware manager.
> -* @paramrange Temperature range to be programmed for
> -*   high and low alert signals
> -* @exception PP_Result_BadInput if the input data is not valid.
> -*/
> + * Set the requested temperature range for high and low alert signals
> + *
> + * @hwmgr: The address of the hardware manager.
> + * @range: Temperature range to be programmed for
> + *   high and low alert signals
> + * Exception: PP_Result_BadInput if the input data is not valid.
> + */
>  static int vega12_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,
> struct PP_TemperatureRange *range)
>  {

Re: [PATCH v4] dt-bindings: display: panel: one file of all simple LVDS panels with dual ports

2020-11-30 Thread Rob Herring
On Tue, Nov 17, 2020 at 09:47:25AM +0800, Liu Ying wrote:
> To complement panel-simple.yaml, create panel-simple-lvds-dual-ports.yaml.
> panel-simple-lvds-dual-ports.yaml is for all simple LVDS panels that
> have dual LVDS ports and require only a single power-supply.
> The first port receives odd pixels, and the second port receives even pixels.
> Optionally, a backlight and an enable GPIO can be specified as properties.
> 
> Panels with swapped pixel order, if any, need dedicated bindings.
> 
> Migrate 'auo,g133han01', 'auo,g185han01', 'auo,g190ean01',
> 'koe,tx26d202vm0bwa' and 'nlt,nl192108ac18-02d' over to the new file.
> 
> The objectives with one file for all the simple LVDS panels with dual ports 
> are:
> - Make it simpler to add bindings for this kind of LVDS panels
> - Keep the number of bindings file lower
> - Keep the binding documentation for this kind of LVDS panels more consistent
> - Make it possible for drivers to get pixel order via
>   drm_of_lvds_get_dual_link_pixel_order(), as the optional 'ports' property is
>   allowed
> 
> Suggested-by: Sam Ravnborg 
> Cc: Thierry Reding 
> Cc: Sam Ravnborg 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Rob Herring 
> Cc: Lucas Stach 
> Cc: Sebastian Reichel 
> Signed-off-by: Liu Ying 
> ---
> v3->v4:
> * Add type and descriptions for dual-lvds-{odd,even}-pixels properties.
>   Also, update descriptions for port@0 and port@1 properties accordingly. 
> (Rob)
> 
> v2->v3:
> * Do not allow 'port' property. (Rob)
> * Define port number. (Rob)
> * Specify 'dual-lvds-odd-pixels' and 'dual-lvds-even-pixels' properties. (Rob)
> 
> v1->v2:
> * Correct pixel order in example LVDS panel node.
> 
>  .../panel/panel-simple-lvds-dual-ports.yaml| 130 
> +
>  .../bindings/display/panel/panel-simple.yaml   |  10 --
>  2 files changed, 130 insertions(+), 10 deletions(-)
>  create mode 100644 
> Documentation/devicetree/bindings/display/panel/panel-simple-lvds-dual-ports.yaml
> 
> diff --git 
> a/Documentation/devicetree/bindings/display/panel/panel-simple-lvds-dual-ports.yaml
>  
> b/Documentation/devicetree/bindings/display/panel/panel-simple-lvds-dual-ports.yaml
> new file mode 100644
> index ..38a789b
> --- /dev/null
> +++ 
> b/Documentation/devicetree/bindings/display/panel/panel-simple-lvds-dual-ports.yaml
> @@ -0,0 +1,130 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: 
> http://devicetree.org/schemas/display/panel/panel-simple-lvds-dual-ports.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Simple LVDS panels with one power supply and dual LVDS ports
> +
> +maintainers:
> +  - Liu Ying 
> +  - Thierry Reding 
> +  - Sam Ravnborg 
> +
> +description: |
> +  This binding file is a collection of the LVDS panels that
> +  has dual LVDS ports and requires only a single power-supply.
> +  The first port receives odd pixels, and the second port receives even 
> pixels.
> +  There are optionally a backlight and an enable GPIO.
> +  The panel may use an OF graph binding for the association to the display,
> +  or it may be a direct child node of the display.
> +
> +  If the panel is more advanced a dedicated binding file is required.
> +
> +allOf:
> +  - $ref: panel-common.yaml#
> +
> +properties:
> +
> +  compatible:
> +enum:
> +# compatible must be listed in alphabetical order, ordered by compatible.
> +# The description in the comment is mandatory for each compatible.
> +
> +# AU Optronics Corporation 13.3" FHD (1920x1080) TFT LCD panel
> +  - auo,g133han01
> +# AU Optronics Corporation 18.5" FHD (1920x1080) TFT LCD panel
> +  - auo,g185han01
> +# AU Optronics Corporation 19.0" (1280x1024) TFT LCD panel
> +  - auo,g190ean01
> +# Kaohsiung Opto-Electronics Inc. 10.1" WUXGA (1920 x 1200) LVDS TFT 
> LCD panel
> +  - koe,tx26d202vm0bwa
> +# NLT Technologies, Ltd. 15.6" FHD (1920x1080) LVDS TFT LCD panel
> +  - nlt,nl192108ac18-02d
> +
> +  ports:
> +type: object
> +properties:
> +  '#address-cells':
> +const: 1
> +
> +  '#size-cells':
> +const: 0
> +
> +  port@0:
> +type: object
> +description: The first sink port.
> +properties:
> +  reg:
> +const: 0
> +
> +  dual-lvds-odd-pixels:
> +type: boolean
> +description: The first sink port for odd pixels.
> +
> +required:
> +  - reg
> +  - dual-lvds-odd-pixels
> +
> +  port@1:
> +type: object
> +description: The second sink port.
> +properties:
> +  reg:
> +const: 1
> +
> +  dual-lvds-even-pixels:
> +type: boolean
> +description: The second sink port for even pixels.
> +
> +required:
> +  - reg
> +  - dual-lvds-even-pixels
> +
> +required:
> +  - "#address-cells"
> +  - "#size-cells"
> +  

Re: [PATCH 29/40] drm/amd/pm/powerplay/hwmgr/vega20_thermal: Fix some outdated function documentation

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega20_thermal.c:217: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega20_thermal_get_temperature'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega20_thermal.c:242: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega20_thermal_set_temperature_range'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega20_thermal.c:242: 
> warning: Function parameter or member 'range' not described in 
> 'vega20_thermal_set_temperature_range'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega20_thermal.c:278: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega20_thermal_enable_alert'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega20_thermal.c:296: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega20_thermal_disable_alert'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega20_thermal.c:310: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega20_thermal_stop_thermal_controller'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega20_thermal.c:326: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega20_thermal_setup_fan_table'
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../amd/pm/powerplay/hwmgr/vega20_thermal.c   | 54 +--
>  1 file changed, 24 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_thermal.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_thermal.c
> index 364162ddaa9c6..269dd7e95a445 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_thermal.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_thermal.c
> @@ -209,10 +209,10 @@ int vega20_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr 
> *hwmgr, uint32_t speed)
>  }
>
>  /**
> -* Reads the remote temperature from the SIslands thermal controller.
> -*
> -* @paramhwmgr The address of the hardware manager.
> -*/
> + * vega20_thermal_get_temperature - Reads the remote temperature from the 
> SIslands thermal controller.
> + *
> + * @hwmgr: The address of the hardware manager.
> + */
>  int vega20_thermal_get_temperature(struct pp_hwmgr *hwmgr)
>  {
> struct amdgpu_device *adev = hwmgr->adev;
> @@ -230,13 +230,12 @@ int vega20_thermal_get_temperature(struct pp_hwmgr 
> *hwmgr)
>  }
>
>  /**
> -* Set the requested temperature range for high and low alert signals
> -*
> -* @paramhwmgr The address of the hardware manager.
> -* @paramrange Temperature range to be programmed for
> -*   high and low alert signals
> -* @exception PP_Result_BadInput if the input data is not valid.
> -*/
> + * vega20_thermal_set_temperature_range - Set the requested temperature 
> range for high and low alert signals
> + *
> + * @hwmgr: The address of the hardware manager.
> + * @range: Temperature range to be programmed for high and low alert signals
> + * Exception: PP_Result_BadInput if the input data is not valid.
> + */
>  static int vega20_thermal_set_temperature_range(struct pp_hwmgr *hwmgr,
> struct PP_TemperatureRange *range)
>  {
> @@ -270,10 +269,10 @@ static int vega20_thermal_set_temperature_range(struct 
> pp_hwmgr *hwmgr,
>  }
>
>  /**
> -* Enable thermal alerts on the RV770 thermal controller.
> -*
> -* @paramhwmgr The address of the hardware manager.
> -*/
> + * vega20_thermal_enable_alert - Enable thermal alerts on the RV770 thermal 
> controller.
> + *
> + * @hwmgr: The address of the hardware manager.
> + */
>  static int vega20_thermal_enable_alert(struct pp_hwmgr *hwmgr)
>  {
> struct amdgpu_device *adev = hwmgr->adev;
> @@ -289,9 +288,9 @@ static int vega20_thermal_enable_alert(struct pp_hwmgr 
> *hwmgr)
>  }
>
>  /**
> -* Disable thermal alerts on the RV770 thermal controller.
> -* @paramhwmgr The address of the hardware manager.
> -*/
> + * vega20_thermal_disable_alert - Disable thermal alerts on the RV770 
> thermal controller.
> + * @hwmgr: The address of the hardware manager.
> + */
>  int vega20_thermal_disable_alert(struct pp_hwmgr *hwmgr)
>  {
> struct amdgpu_device *adev = hwmgr->adev;
> @@ -302,10 +301,10 @@ int vega20_thermal_disable_alert(struct pp_hwmgr *hwmgr)
>  }
>
>  /**
> -* Uninitialize the thermal controller.
> -* Currently just disables alerts.
> -* @paramhwmgr The address of the hardware manager.
> -*/
> + * vega20_thermal_stop_thermal_controller - Uninitialize the thermal 
> controller.
> + * Currently just disables alerts.
> + * @hwmgr: The address of the hardware manager.
> + */
>  int vega20_thermal_stop_thermal_controller(struct pp_hwmgr *hwmgr)
>  {
> int result = 

Re: [GIT PULL] mediatek drm next for 5.11

2020-11-30 Thread Chun-Kuang Hu
Hi, Dave & Daniel:

I've send another pull request "mediatek drm next for 5.11-2" which
include this and add more patches, so you could directly pull that
request and ignore this.

[1] https://lists.freedesktop.org/archives/dri-devel/2020-November/289686.html

Regards,
Chun-Kuang.

Chun-Kuang Hu  於 2020年11月29日 週日 上午8:44寫道:
>
> Hi, Dave & Daniel:
>
> This includes:
>
> 1. Add MT8167 support
> 2. Cleanup function
> 3. Convert the dpi bindings to yaml
> 4. Drop local dma_parms
> 5. Fix formatting and provide missing member description
> 6. Introduce GEM object functions
> 7. Fix aliases name
>
> Regards,
> Chun-Kuang.
>
> The following changes since commit 3650b228f83adda7e5ee532e2b90429c03f7b9ec:
>
>   Linux 5.10-rc1 (2020-10-25 15:14:11 -0700)
>
> are available in the Git repository at:
>
>   https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git 
> tags/mediatek-drm-next-5.11
>
> for you to fetch changes up to 414562b0ef36ce658f0ffec00e7039c7911e4cdc:
>
>   drm/mediatek: Use correct aliases name for ovl (2020-11-28 16:56:55 +0800)
>
> 
> Mediatek DRM Next for Linux 5.11
>
> 1. Add MT8167 support
> 2. Cleanup function
> 3. Convert the dpi bindings to yaml
> 4. Drop local dma_parms
> 5. Fix formatting and provide missing member description
> 6. Introduce GEM object functions
> 7. Fix aliases name
>
> 
> Bernard Zhao (1):
>   drm/mediatek: Optimize functions which do not need to return
>
> Enric Balletbo i Serra (1):
>   drm/mediatek: Use correct aliases name for ovl
>
> Fabien Parent (3):
>   dt-bindings: display: mediatek: disp: add documentation for MT8167 SoC
>   drm/mediatek: Add disp-color MT8167 support
>   drm/mediatek: Add DDP support for MT8167
>
> Jitao Shi (1):
>   dt-bindings: display: mediatek: convert the dpi bindings to yaml
>
> Lee Jones (4):
>   drm/mediatek/mtk_disp_rdma: Fix formatting and supply missing struct 
> member description
>   drm/mediatek/mtk_drm_drv: Staticise local function invoked by reference
>   drm/mediatek/mtk_disp_color: Fix formatting and provide missing member 
> description
>   drm/mediatek/mtk_disp_ovl: Fix formatting and provide missing member 
> description
>
> Robin Murphy (1):
>   drm/mediatek: Drop local dma_parms
>
> Thomas Zimmermann (1):
>   drm/mediatek: Introduce GEM object functions
>
>  .../bindings/display/mediatek/mediatek,disp.txt|  4 +-
>  .../bindings/display/mediatek/mediatek,dpi.txt | 42 --
>  .../bindings/display/mediatek/mediatek,dpi.yaml| 98 
> ++
>  drivers/gpu/drm/mediatek/mtk_disp_color.c  | 12 ++-
>  drivers/gpu/drm/mediatek/mtk_disp_ovl.c|  5 +-
>  drivers/gpu/drm/mediatek/mtk_disp_rdma.c   |  5 +-
>  drivers/gpu/drm/mediatek/mtk_drm_ddp.c | 47 +++
>  drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c|  2 +-
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c | 36 ++--
>  drivers/gpu/drm/mediatek/mtk_drm_drv.h |  2 -
>  drivers/gpu/drm/mediatek/mtk_drm_gem.c | 11 +++
>  drivers/gpu/drm/mediatek/mtk_hdmi.c| 27 ++
>  12 files changed, 187 insertions(+), 104 deletions(-)
>  delete mode 100644 
> Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt
>  create mode 100644 
> Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
> ___
> 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 28/40] drm/amd/pm/powerplay/hwmgr/smu_helper: Demote or fix kernel-doc headers

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu_helper.c:112: warning: 
> Function parameter or member 'hwmgr' not described in 'phm_wait_on_register'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu_helper.c:112: warning: 
> Function parameter or member 'index' not described in 'phm_wait_on_register'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu_helper.c:112: warning: 
> Function parameter or member 'value' not described in 'phm_wait_on_register'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu_helper.c:112: warning: 
> Function parameter or member 'mask' not described in 'phm_wait_on_register'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu_helper.c:145: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'phm_wait_on_indirect_register'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu_helper.c:145: warning: 
> Function parameter or member 'indirect_port' not described in 
> 'phm_wait_on_indirect_register'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu_helper.c:145: warning: 
> Function parameter or member 'index' not described in 
> 'phm_wait_on_indirect_register'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu_helper.c:145: warning: 
> Function parameter or member 'value' not described in 
> 'phm_wait_on_indirect_register'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu_helper.c:145: warning: 
> Function parameter or member 'mask' not described in 
> 'phm_wait_on_indirect_register'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu_helper.c:494: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'phm_initializa_dynamic_state_adjustment_rule_settings'
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c
> index 2a0ca5194bbe9..bfe80ac0ad8c8 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu_helper.c
> @@ -103,7 +103,7 @@ uint32_t phm_set_field_to_u32(u32 offset, u32 
> original_data, u32 field, u32 size
> return original_data;
>  }
>
> -/**
> +/*
>   * Returns once the part of the register indicated by the mask has
>   * reached the given value.
>   */
> @@ -132,7 +132,7 @@ int phm_wait_on_register(struct pp_hwmgr *hwmgr, uint32_t 
> index,
>  }
>
>
> -/**
> +/*
>   * Returns once the part of the register indicated by the mask has
>   * reached the given value.The indirect space is described by giving
>   * the memory-mapped index of the indirect index register.
> @@ -486,9 +486,9 @@ int phm_get_sclk_for_voltage_evv(struct pp_hwmgr *hwmgr,
>  }
>
>  /**
> - * Initialize Dynamic State Adjustment Rule Settings
> + * phm_initializa_dynamic_state_adjustment_rule_settings - Initialize 
> Dynamic State Adjustment Rule Settings
>   *
> - * @paramhwmgr  the address of the powerplay hardware manager.
> + * @hwmgr:  the address of the powerplay hardware manager.
>   */
>  int phm_initializa_dynamic_state_adjustment_rule_settings(struct pp_hwmgr 
> *hwmgr)
>  {
> --
> 2.25.1
>
> ___
> 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 27/40] drm/amd/pm/powerplay/hwmgr/hwmgr: Move 'vega20_hwmgr_init()'s prototype to shared header

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega20_hwmgr.c:4403:5: 
> warning: no previous prototype for ‘vega20_hwmgr_init’ [-Wmissing-prototypes]
>  4403 | int vega20_hwmgr_init(struct pp_hwmgr *hwmgr)
>  | ^
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/inc/hwmgr.h | 1 +
>  drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c | 1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/inc/hwmgr.h 
> b/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> index 499f2520b1aa3..490371bd25201 100644
> --- a/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> +++ b/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> @@ -831,5 +831,6 @@ int hwmgr_handle_task(struct pp_hwmgr *hwmgr,
>  int smu7_init_function_pointers(struct pp_hwmgr *hwmgr);
>  int smu8_init_function_pointers(struct pp_hwmgr *hwmgr);
>  int vega12_hwmgr_init(struct pp_hwmgr *hwmgr);
> +int vega20_hwmgr_init(struct pp_hwmgr *hwmgr);
>
>  #endif /* _HWMGR_H_ */
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> index 49f8a331eb02e..6a7de8b898faf 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> @@ -47,7 +47,6 @@ extern const struct pp_smumgr_func smu10_smu_funcs;
>  extern const struct pp_smumgr_func vega20_smu_funcs;
>
>  extern int vega10_hwmgr_init(struct pp_hwmgr *hwmgr);
> -extern int vega20_hwmgr_init(struct pp_hwmgr *hwmgr);
>  extern int smu10_init_function_pointers(struct pp_hwmgr *hwmgr);
>
>  static int polaris_set_asic_special_caps(struct pp_hwmgr *hwmgr);
> --
> 2.25.1
>
> ___
> 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 26/40] drm/amd/pm/powerplay/hwmgr/hwmgr: Move 'vega12_hwmgr_init()'s prototype to shared header

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega12_hwmgr.c:2862:5: 
> warning: no previous prototype for ‘vega12_hwmgr_init’ [-Wmissing-prototypes]
>  2862 | int vega12_hwmgr_init(struct pp_hwmgr *hwmgr)
>  | ^
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/inc/hwmgr.h | 1 +
>  drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c | 1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/inc/hwmgr.h 
> b/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> index 393e4e76a8961..499f2520b1aa3 100644
> --- a/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> +++ b/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> @@ -830,5 +830,6 @@ int hwmgr_handle_task(struct pp_hwmgr *hwmgr,
>
>  int smu7_init_function_pointers(struct pp_hwmgr *hwmgr);
>  int smu8_init_function_pointers(struct pp_hwmgr *hwmgr);
> +int vega12_hwmgr_init(struct pp_hwmgr *hwmgr);
>
>  #endif /* _HWMGR_H_ */
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> index 7999091cca16e..49f8a331eb02e 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> @@ -47,7 +47,6 @@ extern const struct pp_smumgr_func smu10_smu_funcs;
>  extern const struct pp_smumgr_func vega20_smu_funcs;
>
>  extern int vega10_hwmgr_init(struct pp_hwmgr *hwmgr);
> -extern int vega12_hwmgr_init(struct pp_hwmgr *hwmgr);
>  extern int vega20_hwmgr_init(struct pp_hwmgr *hwmgr);
>  extern int smu10_init_function_pointers(struct pp_hwmgr *hwmgr);
>
> --
> 2.25.1
>
> ___
> 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 24/40] drm/amd/pm/powerplay/hwmgr/vega10_thermal: Fix a bunch of dated function doc formatting

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:128: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_fan_ctrl_set_static_mode'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:128: 
> warning: Function parameter or member 'mode' not described in 
> 'vega10_fan_ctrl_set_static_mode'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:157: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_fan_ctrl_set_default_mode'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:176: 
> warning: Cannot understand  * @fn vega10_enable_fan_control_feature
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:252: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_fan_ctrl_set_fan_speed_percent'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:252: 
> warning: Function parameter or member 'speed' not described in 
> 'vega10_fan_ctrl_set_fan_speed_percent'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:290: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_fan_ctrl_reset_fan_speed_to_default'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:307: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_fan_ctrl_set_fan_speed_rpm'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:307: 
> warning: Function parameter or member 'speed' not described in 
> 'vega10_fan_ctrl_set_fan_speed_rpm'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:339: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_thermal_get_temperature'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:365: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_thermal_set_temperature_range'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:365: 
> warning: Function parameter or member 'range' not described in 
> 'vega10_thermal_set_temperature_range'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:414: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_thermal_initialize'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:437: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_thermal_enable_alert'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:468: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_thermal_disable_alert'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:496: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_thermal_stop_thermal_controller'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:515: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_thermal_setup_fan_table'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_thermal.c:618: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'vega10_thermal_start_smc_fan_control'
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../amd/pm/powerplay/hwmgr/vega10_thermal.c   | 131 --
>  1 file changed, 61 insertions(+), 70 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c
> index 952cd3d7240e3..9b46b27bd30c4 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c
> @@ -118,12 +118,12 @@ int vega10_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr 
> *hwmgr, uint32_t *speed)
>  }
>
>  /**
> -* Set Fan Speed Control to static mode,
> -* so that the user can decide what speed to use.
> -* @paramhwmgr  the address of the powerplay hardware manager.
> -*   mode the fan control mode, 0 default, 1 by percent, 5, by RPM
> -* @exception Should always succeed.
> -*/
> + * vega10_fan_ctrl_set_static_mode - Set Fan Speed Control to static mode,
> + * so that the user can decide what speed to use.
> + * @hwmgr:  the address of the powerplay hardware manager.
> + * @mode: the fan control mode, 0 default, 1 by percent, 5, by RPM
> + * Exception: Should always succeed.
> + */
>  int vega10_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, uint32_t mode)
>  {
> struct amdgpu_device *adev = hwmgr->adev;
> @@ -149,10 +149,10 @@ int vega10_fan_ctrl_set_static_mode(struct pp_hwmgr 
> *hwmgr, uint32_t mode)
>  }
>
>  /**
> -* Reset Fan Speed Control to default mode.
> -* @paramhwmgr 

Re: [PATCH 23/40] drm/amd/pm/powerplay/hwmgr/smu7_thermal: Repair formatting in a bunch of function docs

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:112: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_fan_ctrl_set_static_mode'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:112: 
> warning: Function parameter or member 'mode' not described in 
> 'smu7_fan_ctrl_set_static_mode'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:137: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_fan_ctrl_set_default_mode'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:209: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_fan_ctrl_set_fan_speed_percent'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:209: 
> warning: Function parameter or member 'speed' not described in 
> 'smu7_fan_ctrl_set_fan_speed_percent'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:245: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_fan_ctrl_reset_fan_speed_to_default'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:268: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_fan_ctrl_set_fan_speed_rpm'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:268: 
> warning: Function parameter or member 'speed' not described in 
> 'smu7_fan_ctrl_set_fan_speed_rpm'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:299: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_thermal_get_temperature'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:325: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_thermal_set_temperature_range'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:325: 
> warning: Function parameter or member 'low_temp' not described in 
> 'smu7_thermal_set_temperature_range'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:325: 
> warning: Function parameter or member 'high_temp' not described in 
> 'smu7_thermal_set_temperature_range'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:358: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_thermal_initialize'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:377: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_thermal_enable_alert'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:395: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_thermal_disable_alert'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:414: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_thermal_stop_thermal_controller'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_thermal.c:433: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'smu7_thermal_start_smc_fan_control'
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../drm/amd/pm/powerplay/hwmgr/smu7_thermal.c | 103 +-
>  1 file changed, 50 insertions(+), 53 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_thermal.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_thermal.c
> index e3d9d969d86ac..0d38d4206848a 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_thermal.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_thermal.c
> @@ -103,11 +103,11 @@ int smu7_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr 
> *hwmgr, uint32_t *speed)
>  }
>
>  /**
> -* Set Fan Speed Control to static mode, so that the user can decide what 
> speed to use.
> -* @paramhwmgr  the address of the powerplay hardware manager.
> -*   modethe fan control mode, 0 default, 1 by percent, 5, by RPM
> -* @exception Should always succeed.
> -*/
> + * smu7_fan_ctrl_set_static_mode - Set Fan Speed Control to static mode, so 
> that the user can decide what speed to use.
> + * @hwmgr:  the address of the powerplay hardware manager.
> + * @mode:   the fan control mode, 0 default, 1 by percent, 5, by RPM
> + * Exception: Should always succeed.
> + */
>  int smu7_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, uint32_t mode)
>  {
> if (hwmgr->fan_ctrl_is_in_default_mode) {
> @@ -130,8 +130,8 @@ int smu7_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, 
> uint32_t mode)
>
>  /**
>  * Reset Fan Speed Control to default mode.
> -* @paramhwmgr  the address of the powerplay hardware manager.
> -* @exception Should always succeed.
> +* @hwmgr:  the address of the powerplay hardware manager.
> +* Exception: Should always succeed.
>  */
>  int 

[GIT PULL] mediatek drm next for 5.11-2

2020-11-30 Thread Chun-Kuang Hu
Hi, Dave & Daniel:

This includes:

1. Add MT8167 support
2. Cleanup function
3. Convert the dpi bindings to yaml
4. Drop local dma_parms
5. Fix formatting and provide missing member description
6. Introduce GEM object functions
7. Fix aliases name
8. Move MIPI DSI phy driver to phy folder

Regards,
Chun-Kuang.

The following changes since commit 3650b228f83adda7e5ee532e2b90429c03f7b9ec:

  Linux 5.10-rc1 (2020-10-25 15:14:11 -0700)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git 
tags/mediatek-drm-next-5.11-2

for you to fetch changes up to a4423bec44744ce556e91fe8efffbd10327f79fd:

  MAINTAINERS: add files for Mediatek DRM drivers (2020-11-30 23:43:03 +0800)


Mediatek DRM Next for Linux 5.11-2

1. Add MT8167 support
2. Cleanup function
3. Convert the dpi bindings to yaml
4. Drop local dma_parms
5. Fix formatting and provide missing member description
6. Introduce GEM object functions
7. Fix aliases name
8. Move MIPI DSI phy driver to phy folder


Bernard Zhao (1):
  drm/mediatek: Optimize functions which do not need to return

Chun-Kuang Hu (3):
  drm/mediatek: Separate mtk_mipi_tx to an independent module
  phy: mediatek: Move mtk_mipi_dsi_phy driver into drivers/phy/mediatek 
folder
  MAINTAINERS: add files for Mediatek DRM drivers

Enric Balletbo i Serra (1):
  drm/mediatek: Use correct aliases name for ovl

Fabien Parent (3):
  dt-bindings: display: mediatek: disp: add documentation for MT8167 SoC
  drm/mediatek: Add disp-color MT8167 support
  drm/mediatek: Add DDP support for MT8167

Jitao Shi (1):
  dt-bindings: display: mediatek: convert the dpi bindings to yaml

Lee Jones (4):
  drm/mediatek/mtk_disp_rdma: Fix formatting and supply missing struct 
member description
  drm/mediatek/mtk_drm_drv: Staticise local function invoked by reference
  drm/mediatek/mtk_disp_color: Fix formatting and provide missing member 
description
  drm/mediatek/mtk_disp_ovl: Fix formatting and provide missing member 
description

Robin Murphy (1):
  drm/mediatek: Drop local dma_parms

Thomas Zimmermann (1):
  drm/mediatek: Introduce GEM object functions

 .../bindings/display/mediatek/mediatek,disp.txt|  4 +-
 .../bindings/display/mediatek/mediatek,dpi.txt | 42 --
 .../bindings/display/mediatek/mediatek,dpi.yaml| 98 ++
 MAINTAINERS|  1 +
 drivers/gpu/drm/mediatek/Kconfig   |  1 +
 drivers/gpu/drm/mediatek/Makefile  |  3 -
 drivers/gpu/drm/mediatek/mtk_disp_color.c  | 12 ++-
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c|  5 +-
 drivers/gpu/drm/mediatek/mtk_disp_rdma.c   |  5 +-
 drivers/gpu/drm/mediatek/mtk_drm_ddp.c | 47 +++
 drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c|  2 +-
 drivers/gpu/drm/mediatek/mtk_drm_drv.c | 37 ++--
 drivers/gpu/drm/mediatek/mtk_drm_drv.h |  3 -
 drivers/gpu/drm/mediatek/mtk_drm_gem.c | 11 +++
 drivers/gpu/drm/mediatek/mtk_hdmi.c| 27 ++
 drivers/phy/mediatek/Kconfig   |  7 ++
 drivers/phy/mediatek/Makefile  |  5 ++
 .../mediatek/phy-mtk-mipi-dsi-mt8173.c}|  2 +-
 .../mediatek/phy-mtk-mipi-dsi-mt8183.c}|  2 +-
 .../mediatek/phy-mtk-mipi-dsi.c}   |  5 +-
 .../mediatek/phy-mtk-mipi-dsi.h}   |  0
 21 files changed, 207 insertions(+), 112 deletions(-)
 delete mode 100644 
Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt
 create mode 100644 
Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
 rename drivers/{gpu/drm/mediatek/mtk_mt8173_mipi_tx.c => 
phy/mediatek/phy-mtk-mipi-dsi-mt8173.c} (99%)
 rename drivers/{gpu/drm/mediatek/mtk_mt8183_mipi_tx.c => 
phy/mediatek/phy-mtk-mipi-dsi-mt8183.c} (99%)
 rename drivers/{gpu/drm/mediatek/mtk_mipi_tx.c => 
phy/mediatek/phy-mtk-mipi-dsi.c} (97%)
 rename drivers/{gpu/drm/mediatek/mtk_mipi_tx.h => 
phy/mediatek/phy-mtk-mipi-dsi.h} (100%)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 21/40] drm/amd/pm/powerplay/hwmgr/smu7_hwmgr: Fix a whole bunch of historical function doc issues

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:202: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_get_mc_microcode_version'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:242: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_enable_smc_voltage_controller'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:263: warning: 
> Function parameter or member 'hwmgr' not described in 'smu7_voltage_control'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:277: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_enable_voltage_control'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:315: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_construct_voltage_tables'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:428: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_program_static_screen_threshold_parameters'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:450: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_enable_display_gap'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:474: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_program_voting_clients'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:570: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_initial_switch_from_arbf0_to_f1'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1926: warning: 
> Function parameter or member 'hwmgr' not described in 'smu7_get_evv_voltages'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:2028: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_patch_ppt_v1_with_vdd_leakage'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:2028: warning: 
> Function parameter or member 'voltage' not described in 
> 'smu7_patch_ppt_v1_with_vdd_leakage'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:2028: warning: 
> Function parameter or member 'leakage_table' not described in 
> 'smu7_patch_ppt_v1_with_vdd_leakage'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:2056: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_patch_lookup_table_with_leakage'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:2056: warning: 
> Function parameter or member 'lookup_table' not described in 
> 'smu7_patch_lookup_table_with_leakage'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:2056: warning: 
> Function parameter or member 'leakage_table' not described in 
> 'smu7_patch_lookup_table_with_leakage'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:2511: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_patch_ppt_v0_with_vdd_leakage'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:2511: warning: 
> Function parameter or member 'voltage' not described in 
> 'smu7_patch_ppt_v0_with_vdd_leakage'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:2511: warning: 
> Function parameter or member 'leakage_table' not described in 
> 'smu7_patch_ppt_v0_with_vdd_leakage'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:4449: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_program_display_gap'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:4508: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_set_max_fan_rpm_output'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:4508: warning: 
> Function parameter or member 'us_max_fan_rpm' not described in 
> 'smu7_set_max_fan_rpm_output'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:4707: warning: 
> Function parameter or member 'hwmgr' not described in 'smu7_get_memory_type'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:4723: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_enable_acpi_power_management'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:4737: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'smu7_init_power_gate_state'
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c   | 166 +-
>  1 file changed, 83 insertions(+), 83 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
> index 53111c6bbcc91..82676c086ce46 

Re: [PATCH 20/40] drm/amd/pm/powerplay/hwmgr/vega10_processpptables: Make function invoked by reference static

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/vega10_processpptables.c:1148:5:
>  warning: no previous prototype for ‘vega10_pp_tables_initialize’ 
> [-Wmissing-prototypes]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: "Gustavo A. R. Silva" 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c
> index 535404de78a20..95b988823f50f 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_processpptables.c
> @@ -1145,7 +1145,7 @@ static int init_dpm_2_parameters(
> return result;
>  }
>
> -int vega10_pp_tables_initialize(struct pp_hwmgr *hwmgr)
> +static int vega10_pp_tables_initialize(struct pp_hwmgr *hwmgr)
>  {
> int result = 0;
> const ATOM_Vega10_POWERPLAYTABLE *powerplay_table;
> --
> 2.25.1
>
> ___
> 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 19/40] drm/amd/pm/powerplay/hwmgr/ppatomctrl: Fix a myriad of kernel-doc issues

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:104: warning: 
> Function parameter or member 'reg_block' not described in 
> 'atomctrl_set_mc_reg_address_table'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:104: warning: 
> Function parameter or member 'table' not described in 
> 'atomctrl_set_mc_reg_address_table'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:213: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'atomctrl_set_engine_dram_timings_rv770'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:213: warning: 
> Function parameter or member 'engine_clock' not described in 
> 'atomctrl_set_engine_dram_timings_rv770'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:213: warning: 
> Function parameter or member 'memory_clock' not described in 
> 'atomctrl_set_engine_dram_timings_rv770'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:239: warning: 
> Function parameter or member 'device' not described in 
> 'get_voltage_info_table'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:519: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'atomctrl_get_reference_clock'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:548: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'atomctrl_is_voltage_controlled_by_gpio_v3'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:548: warning: 
> Function parameter or member 'voltage_type' not described in 
> 'atomctrl_is_voltage_controlled_by_gpio_v3'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:548: warning: 
> Function parameter or member 'voltage_mode' not described in 
> 'atomctrl_is_voltage_controlled_by_gpio_v3'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:640: warning: 
> Function parameter or member 'device' not described in 'get_gpio_lookup_table'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:663: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'atomctrl_get_pp_assign_pin'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:663: warning: 
> Function parameter or member 'pinId' not described in 
> 'atomctrl_get_pp_assign_pin'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:663: warning: 
> Function parameter or member 'gpio_pin_assignment' not described in 
> 'atomctrl_get_pp_assign_pin'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1152: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'atomctrl_get_voltage_evv'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1152: warning: 
> Function parameter or member 'virtual_voltage_id' not described in 
> 'atomctrl_get_voltage_evv'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1152: warning: 
> Function parameter or member 'voltage' not described in 
> 'atomctrl_get_voltage_evv'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1194: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'atomctrl_get_mpll_reference_clock'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1227: warning: 
> Function parameter or member 'device' not described in 
> 'asic_internal_ss_get_ss_table'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1258: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'asic_internal_ss_get_ss_asignment'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1258: warning: 
> Function parameter or member 'clockSource' not described in 
> 'asic_internal_ss_get_ss_asignment'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1258: warning: 
> Function parameter or member 'clockSpeed' not described in 
> 'asic_internal_ss_get_ss_asignment'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1258: warning: 
> Function parameter or member 'ssEntry' not described in 
> 'asic_internal_ss_get_ss_asignment'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1321: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'atomctrl_get_memory_clock_spread_spectrum'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1321: warning: 
> Function parameter or member 'memory_clock' not described in 
> 'atomctrl_get_memory_clock_spread_spectrum'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1321: warning: 
> Function parameter or member 'ssInfo' not described in 
> 'atomctrl_get_memory_clock_spread_spectrum'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1332: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'atomctrl_get_engine_clock_spread_spectrum'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:1332: warning: 
> 

Re: [PATCH 18/40] drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0: Convert to proper kernel-doc format

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:41: 
> warning: Function parameter or member 'hwmgr' not described in 'set_hw_cap'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:41: 
> warning: Function parameter or member 'setIt' not described in 'set_hw_cap'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:41: 
> warning: Function parameter or member 'cap' not described in 'set_hw_cap'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:56: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'set_platform_caps'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:56: 
> warning: Function parameter or member 'powerplay_caps' not described in 
> 'set_platform_caps'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:135: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'get_powerplay_table'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:202: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'get_platform_power_management_table'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:202: 
> warning: Function parameter or member 'atom_ppm_table' not described in 
> 'get_platform_power_management_table'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:246: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'init_dpm_2_parameters'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:246: 
> warning: Function parameter or member 'powerplay_table' not described in 
> 'init_dpm_2_parameters'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:791: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'init_clock_voltage_dependency'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:791: 
> warning: Function parameter or member 'powerplay_table' not described in 
> 'init_clock_voltage_dependency'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:911: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'init_thermal_controller'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:911: 
> warning: Function parameter or member 'powerplay_table' not described in 
> 'init_thermal_controller'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:1121:
>  warning: Function parameter or member 'hwmgr' not described in 
> 'check_powerplay_tables'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:1121:
>  warning: Function parameter or member 'powerplay_table' not described in 
> 'check_powerplay_tables'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:1263:
>  warning: Function parameter or member 'hwmgr' not described in 
> 'make_classification_flags'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:1263:
>  warning: Function parameter or member 'classification' not described in 
> 'make_classification_flags'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:1263:
>  warning: Function parameter or member 'classification2' not described in 
> 'make_classification_flags'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:1370:
>  warning: Function parameter or member 'hwmgr' not described in 
> 'get_powerplay_table_entry_v1_0'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:1370:
>  warning: Function parameter or member 'entry_index' not described in 
> 'get_powerplay_table_entry_v1_0'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:1370:
>  warning: Function parameter or member 'power_state' not described in 
> 'get_powerplay_table_entry_v1_0'
>  
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:1370:
>  warning: Function parameter or member 'call_back_func' not described in 
> 'get_powerplay_table_entry_v1_0'
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../powerplay/hwmgr/process_pptables_v1_0.c   | 81 ++-
>  1 file changed, 41 insertions(+), 40 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c
> index 801a565026703..741e03ad5311f 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c
> +++ 

Re: [PATCH 17/40] drm/amd/pm/powerplay/hwmgr/hardwaremanager: Fix function header related formatting issues

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c:232: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'phm_start_thermal_controller'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c:383: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'phm_get_clock_info'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c:383: 
> warning: Function parameter or member 'state' not described in 
> 'phm_get_clock_info'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c:383: 
> warning: Function parameter or member 'pclock_info' not described in 
> 'phm_get_clock_info'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c:383: 
> warning: Function parameter or member 'designation' not described in 
> 'phm_get_clock_info'
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../amd/pm/powerplay/hwmgr/hardwaremanager.c  | 25 ++-
>  1 file changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c
> index 45dde3e74b578..25b5831a15cd2 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c
> @@ -223,11 +223,11 @@ int phm_register_irq_handlers(struct pp_hwmgr *hwmgr)
>  }
>
>  /**
> -* Initializes the thermal controller subsystem.
> -*
> -* @parampHwMgr  the address of the powerplay hardware manager.
> -* @exception PP_Result_Failed if any of the paramters is NULL, otherwise the 
> return value from the dispatcher.
> -*/
> + * phm_start_thermal_controller - Initializes the thermal controller 
> subsystem.
> + *
> + * @hwmgr:   the address of the powerplay hardware manager.
> + * Exception PP_Result_Failed if any of the paramters is NULL, otherwise the 
> return value from the dispatcher.
> + */
>  int phm_start_thermal_controller(struct pp_hwmgr *hwmgr)
>  {
> int ret = 0;
> @@ -371,13 +371,14 @@ int phm_get_performance_level(struct pp_hwmgr *hwmgr, 
> const struct pp_hw_power_s
>
>
>  /**
> -* Gets Clock Info.
> -*
> -* @parampHwMgr  the address of the powerplay hardware manager.
> -* @parampPowerState the address of the Power State structure.
> -* @parampClockInfo the address of PP_ClockInfo structure where the 
> result will be returned.
> -* @exception PP_Result_Failed if any of the paramters is NULL, otherwise the 
> return value from the back-end.
> -*/
> + * phm_get_clock_info
> + *
> + * @hwmgr:  the address of the powerplay hardware manager.
> + * @state: the address of the Power State structure.
> + * @pclock_info: the address of PP_ClockInfo structure where the result will 
> be returned.
> + * @designation: PHM performance level designation
> + * Exception PP_Result_Failed if any of the paramters is NULL, otherwise the 
> return value from the back-end.
> + */
>  int phm_get_clock_info(struct pp_hwmgr *hwmgr, const struct 
> pp_hw_power_state *state, struct pp_clock_info *pclock_info,
> PHM_PerformanceLevelDesignation designation)
>  {
> --
> 2.25.1
>
> ___
> 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 16/40] drm/amd/pm/powerplay/smumgr/iceland_smumgr: Remove unused variable 'res'

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/iceland_smumgr.c: In 
> function ‘iceland_thermal_setup_fan_table’:
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/iceland_smumgr.c:2093:6: 
> warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Huang Rui 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 
> ---
>  drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
> index 6a0f581de999b..2da5225eafbb8 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
> @@ -2090,7 +2090,6 @@ static int iceland_thermal_setup_fan_table(struct 
> pp_hwmgr *hwmgr)
> uint32_t t_diff1, t_diff2, pwm_diff1, pwm_diff2;
> uint16_t fdo_min, slope1, slope2;
> uint32_t reference_clock;
> -   int res;
> uint64_t tmp64;
>
> if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, 
> PHM_PlatformCaps_MicrocodeFanControl))
> @@ -2154,7 +2153,7 @@ static int iceland_thermal_setup_fan_table(struct 
> pp_hwmgr *hwmgr)
>
> /* fan_table.FanControl_GL_Flag = 1; */
>
> -   res = smu7_copy_bytes_to_smc(hwmgr, smu7_data->fan_table_start, 
> (uint8_t *)_table, (uint32_t)sizeof(fan_table), SMC_RAM_END);
> +   smu7_copy_bytes_to_smc(hwmgr, smu7_data->fan_table_start, (uint8_t 
> *)_table, (uint32_t)sizeof(fan_table), SMC_RAM_END);
>

Should probably just return the error.  I'll fix it up.  Thanks!

Alex

> return 0;
>  }
> --
> 2.25.1
>
> ___
> 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 14/40] drm/amd/pm/powerplay/hwmgr/ppatomfwctrl: Demote kernel-doc formatting abuses

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomfwctrl.c:78: warning: 
> Function parameter or member 'hwmgr' not described in 
> 'pp_atomfwctrl_is_voltage_controlled_by_gpio_v4'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomfwctrl.c:78: warning: 
> Function parameter or member 'voltage_type' not described in 
> 'pp_atomfwctrl_is_voltage_controlled_by_gpio_v4'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomfwctrl.c:78: warning: 
> Function parameter or member 'voltage_mode' not described in 
> 'pp_atomfwctrl_is_voltage_controlled_by_gpio_v4'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomfwctrl.c:211: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'pp_atomfwctrl_get_pp_assign_pin'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomfwctrl.c:211: 
> warning: Function parameter or member 'pin_id' not described in 
> 'pp_atomfwctrl_get_pp_assign_pin'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomfwctrl.c:211: 
> warning: Function parameter or member 'gpio_pin_assignment' not described in 
> 'pp_atomfwctrl_get_pp_assign_pin'
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomfwctrl.c:232: 
> warning: Function parameter or member 'hwmgr' not described in 
> 'pp_atomfwctrl_enter_self_refresh'
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../drm/amd/pm/powerplay/hwmgr/ppatomfwctrl.c | 24 +--
>  1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomfwctrl.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomfwctrl.c
> index 615cf2c09e54e..a47a47238e2b9 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomfwctrl.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomfwctrl.c
> @@ -68,11 +68,11 @@ static struct atom_voltage_objects_info_v4_1 
> *pp_atomfwctrl_get_voltage_info_tab
> return (struct atom_voltage_objects_info_v4_1 *)table_address;
>  }
>
> -/**
> -* Returns TRUE if the given voltage type is controlled by GPIO pins.
> -* voltage_type is one of SET_VOLTAGE_TYPE_ASIC_VDDC, 
> SET_VOLTAGE_TYPE_ASIC_MVDDC, SET_VOLTAGE_TYPE_ASIC_MVDDQ.
> -* voltage_mode is one of ATOM_SET_VOLTAGE, ATOM_SET_VOLTAGE_PHASE
> -*/
> +/*
> + * Returns TRUE if the given voltage type is controlled by GPIO pins.
> + * voltage_type is one of SET_VOLTAGE_TYPE_ASIC_VDDC, 
> SET_VOLTAGE_TYPE_ASIC_MVDDC, SET_VOLTAGE_TYPE_ASIC_MVDDQ.
> + * voltage_mode is one of ATOM_SET_VOLTAGE, ATOM_SET_VOLTAGE_PHASE
> + */
>  bool pp_atomfwctrl_is_voltage_controlled_by_gpio_v4(struct pp_hwmgr *hwmgr,
> uint8_t voltage_type, uint8_t voltage_mode)
>  {
> @@ -202,9 +202,9 @@ static bool pp_atomfwctrl_lookup_gpio_pin(
> return false;
>  }
>
> -/**
> -* Returns TRUE if the given pin id find in lookup table.
> -*/
> +/*
> + * Returns TRUE if the given pin id find in lookup table.
> + */
>  bool pp_atomfwctrl_get_pp_assign_pin(struct pp_hwmgr *hwmgr,
> const uint32_t pin_id,
> struct pp_atomfwctrl_gpio_pin_assignment *gpio_pin_assignment)
> @@ -224,10 +224,10 @@ bool pp_atomfwctrl_get_pp_assign_pin(struct pp_hwmgr 
> *hwmgr,
> return ret;
>  }
>
> -/**
> -* Enter to SelfRefresh mode.
> -* @param hwmgr
> -*/
> +/*
> + * Enter to SelfRefresh mode.
> + * @param hwmgr
> + */
>  int pp_atomfwctrl_enter_self_refresh(struct pp_hwmgr *hwmgr)
>  {
> /* 0 - no action
> --
> 2.25.1
>
> ___
> 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 13/40] drm/amd/pm/powerplay/hwmgr/hwmgr: Move 'smu7_init_function_pointers()'s prototype to header

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:5696:5: 
> warning: no previous prototype for ‘smu7_init_function_pointers’ 
> [-Wmissing-prototypes]
>  5696 | int smu7_init_function_pointers(struct pp_hwmgr *hwmgr)
>  | ^~~
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/inc/hwmgr.h | 1 +
>  drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c | 1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/inc/hwmgr.h 
> b/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> index 0e22cba3ce3a6..393e4e76a8961 100644
> --- a/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> +++ b/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> @@ -828,6 +828,7 @@ int hwmgr_handle_task(struct pp_hwmgr *hwmgr,
>
>  #define PHM_ENTIRE_REGISTER_MASK 0xU
>
> +int smu7_init_function_pointers(struct pp_hwmgr *hwmgr);
>  int smu8_init_function_pointers(struct pp_hwmgr *hwmgr);
>
>  #endif /* _HWMGR_H_ */
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> index ec17a3e63ea02..7999091cca16e 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> @@ -46,7 +46,6 @@ extern const struct pp_smumgr_func vega12_smu_funcs;
>  extern const struct pp_smumgr_func smu10_smu_funcs;
>  extern const struct pp_smumgr_func vega20_smu_funcs;
>
> -extern int smu7_init_function_pointers(struct pp_hwmgr *hwmgr);
>  extern int vega10_hwmgr_init(struct pp_hwmgr *hwmgr);
>  extern int vega12_hwmgr_init(struct pp_hwmgr *hwmgr);
>  extern int vega20_hwmgr_init(struct pp_hwmgr *hwmgr);
> --
> 2.25.1
>
> ___
> 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 12/40] drm/amd/pm/powerplay/hwmgr/ppatomctrl: Remove unused variable 'fPowerDPMx'

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  In file included from 
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:31:
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c: In function 
> ‘atomctrl_calculate_voltage_evv_on_sclk’:
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppatomctrl.c:702:22: 
> warning: variable ‘fPowerDPMx’ set but not used [-Wunused-but-set-variable]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 10 +-
>  1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c
> index c2fee6796bd93..2cb913ab77f26 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c
> @@ -699,7 +699,7 @@ int atomctrl_calculate_voltage_evv_on_sclk(
> fInt fMargin_RO_a, fMargin_RO_b, fMargin_RO_c, fMargin_fixed, 
> fMargin_FMAX_mean, fMargin_Plat_mean, fMargin_FMAX_sigma, fMargin_Plat_sigma, 
> fMargin_DC_sigma;
> fInt fLkg_FT, repeat;
> fInt fMicro_FMAX, fMicro_CR, fSigma_FMAX, fSigma_CR, fSigma_DC, 
> fDC_SCLK, fSquared_Sigma_DC, fSquared_Sigma_CR, fSquared_Sigma_FMAX;
> -   fInt fRLL_LoadLine, fPowerDPMx, fDerateTDP, fVDDC_base, fA_Term, 
> fC_Term, fB_Term, fRO_DC_margin;
> +   fInt fRLL_LoadLine, fDerateTDP, fVDDC_base, fA_Term, fC_Term, 
> fB_Term, fRO_DC_margin;
> fInt fRO_fused, fCACm_fused, fCACb_fused, fKv_m_fused, fKv_b_fused, 
> fKt_Beta_fused, fFT_Lkg_V0NORM;
> fInt fSclk_margin, fSclk, fEVV_V;
> fInt fV_min, fV_max, fT_prod, fLKG_Factor, fT_FT, fV_FT, fV_x, 
> fTDP_Power, fTDP_Power_right, fTDP_Power_left, fTDP_Current, fV_NL;
> @@ -731,36 +731,28 @@ int atomctrl_calculate_voltage_evv_on_sclk(
>
> switch (dpm_level) {
> case 1:
> -   fPowerDPMx = 
> Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm1));
> fDerateTDP = 
> GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM1), 1000);
> break;
> case 2:
> -   fPowerDPMx = 
> Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm2));
> fDerateTDP = 
> GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM2), 1000);
> break;
> case 3:
> -   fPowerDPMx = 
> Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm3));
> fDerateTDP = 
> GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM3), 1000);
> break;
> case 4:
> -   fPowerDPMx = 
> Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm4));
> fDerateTDP = 
> GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM4), 1000);
> break;
> case 5:
> -   fPowerDPMx = 
> Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm5));
> fDerateTDP = 
> GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM5), 1000);
> break;
> case 6:
> -   fPowerDPMx = 
> Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm6));
> fDerateTDP = 
> GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM6), 1000);
> break;
> case 7:
> -   fPowerDPMx = 
> Convert_ULONG_ToFraction(le16_to_cpu(getASICProfilingInfo->usPowerDpm7));
> fDerateTDP = 
> GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM7), 1000);
> break;
> default:
> pr_err("DPM Level not supported\n");
> -   fPowerDPMx = Convert_ULONG_ToFraction(1);
> fDerateTDP = 
> GetScaledFraction(le32_to_cpu(getASICProfilingInfo->ulTdpDerateDPM0), 1000);
> }
>
> --
> 2.25.1
>
> ___
> 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 11/40] drm/amd/pm/powerplay/hwmgr/ppevvmath: Place variable declaration under same clause as its use

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppevvmath.h: In function 
> ‘fMultiply’:
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppevvmath.h:336:22: 
> warning: variable ‘Y_LessThanOne’ set but not used [-Wunused-but-set-variable]
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/ppevvmath.h:336:7: warning: 
> variable ‘X_LessThanOne’ set but not used [-Wunused-but-set-variable]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppevvmath.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppevvmath.h 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppevvmath.h
> index 8f50a038396ce..dac29fe6cfc6f 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppevvmath.h
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppevvmath.h
> @@ -333,14 +333,14 @@ static fInt fMultiply (fInt X, fInt Y) /* Uses 64-bit 
> integers (int64_t) */
>  {
> fInt Product;
> int64_t tempProduct;
> +
> +   /*The following is for a very specific common case: Non-zero number 
> with ONLY fractional portion*/
> +   /* TEMPORARILY DISABLED - CAN BE USED TO IMPROVE PRECISION
> bool X_LessThanOne, Y_LessThanOne;
>
> X_LessThanOne = (X.partial.real == 0 && X.partial.decimal != 0 && 
> X.full >= 0);
> Y_LessThanOne = (Y.partial.real == 0 && Y.partial.decimal != 0 && 
> Y.full >= 0);
>
> -   /*The following is for a very specific common case: Non-zero number 
> with ONLY fractional portion*/
> -   /* TEMPORARILY DISABLED - CAN BE USED TO IMPROVE PRECISION
> -
> if (X_LessThanOne && Y_LessThanOne) {
> Product.full = X.full * Y.full;
> return Product
> --
> 2.25.1
>
> ___
> 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 10/40] drm/amd/pm/inc/pp_thermal: Mark 'SMU7Thermal{WithDelay}Policy' as __maybe_unused

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> They are used by some source files which include pp_thermal.h, but not all.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/inc/pp_thermal.h:28:41: warning: 
> ‘SMU7ThermalWithDelayPolicy’ defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/amd/amdgpu/../pm/inc/pp_thermal.h:28:41: warning: 
> ‘SMU7ThermalWithDelayPolicy’ defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/amd/amdgpu/../pm/inc/pp_thermal.h:34:41: warning: 
> ‘SMU7ThermalPolicy’ defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/amd/amdgpu/../pm/inc/pp_thermal.h:34:41: warning: 
> ‘SMU7ThermalPolicy’ defined but not used [-Wunused-const-variable=]
>  drivers/gpu/drm/amd/amdgpu/../pm/inc/pp_thermal.h:34:41: warning: 
> ‘SMU7ThermalPolicy’ defined but not used [-Wunused-const-variable=]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Evan Quan 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/pm/inc/pp_thermal.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/inc/pp_thermal.h 
> b/drivers/gpu/drm/amd/pm/inc/pp_thermal.h
> index 3e30768f9e1cc..f7c41185097e4 100644
> --- a/drivers/gpu/drm/amd/pm/inc/pp_thermal.h
> +++ b/drivers/gpu/drm/amd/pm/inc/pp_thermal.h
> @@ -25,13 +25,13 @@
>
>  #include "power_state.h"
>
> -static const struct PP_TemperatureRange SMU7ThermalWithDelayPolicy[] =
> +static const struct PP_TemperatureRange __maybe_unused 
> SMU7ThermalWithDelayPolicy[] =
>  {
> {-273150,  99000, 99000, -273150, 99000, 99000, -273150, 99000, 
> 99000},
> { 12, 12, 12, 12, 12, 12, 12, 12, 
> 12},
>  };
>
> -static const struct PP_TemperatureRange SMU7ThermalPolicy[] =
> +static const struct PP_TemperatureRange __maybe_unused SMU7ThermalPolicy[] =
>  {
> {-273150,  99000, 99000, -273150, 99000, 99000, -273150, 99000, 
> 99000},
> { 12, 12, 12, 12, 12, 12, 12, 12, 
> 12},
> --
> 2.25.1
>
> ___
> 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 09/40] drm/amd/pm/powerplay/hwmgr/hwmgr: Move 'smu8_init_function_pointers()' prototype to shared header

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/pm/inc/hwmgr.h | 1 +
>  drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c | 1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/inc/hwmgr.h 
> b/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> index 1bb379498a121..0e22cba3ce3a6 100644
> --- a/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> +++ b/drivers/gpu/drm/amd/pm/inc/hwmgr.h
> @@ -828,5 +828,6 @@ int hwmgr_handle_task(struct pp_hwmgr *hwmgr,
>
>  #define PHM_ENTIRE_REGISTER_MASK 0xU
>
> +int smu8_init_function_pointers(struct pp_hwmgr *hwmgr);
>
>  #endif /* _HWMGR_H_ */
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> index 739e215ec8b7f..ec17a3e63ea02 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hwmgr.c
> @@ -47,7 +47,6 @@ extern const struct pp_smumgr_func smu10_smu_funcs;
>  extern const struct pp_smumgr_func vega20_smu_funcs;
>
>  extern int smu7_init_function_pointers(struct pp_hwmgr *hwmgr);
> -extern int smu8_init_function_pointers(struct pp_hwmgr *hwmgr);
>  extern int vega10_hwmgr_init(struct pp_hwmgr *hwmgr);
>  extern int vega12_hwmgr_init(struct pp_hwmgr *hwmgr);
>  extern int vega20_hwmgr_init(struct pp_hwmgr *hwmgr);
> --
> 2.25.1
>
> ___
> 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 08/40] drm/amd/pm/powerplay/hwmgr/hardwaremanager: Remove unused 'phm_set_*()' functions

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c:518:5: 
> warning: no previous prototype for ‘phm_set_min_deep_sleep_dcefclk’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c:528:5: 
> warning: no previous prototype for ‘phm_set_hard_min_dcefclk_by_freq’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c:538:5: 
> warning: no previous prototype for ‘phm_set_hard_min_fclk_by_freq’ 
> [-Wmissing-prototypes]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../amd/pm/powerplay/hwmgr/hardwaremanager.c  | 31 ---
>  1 file changed, 31 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c 
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c
> index 1f9b9facdf1f4..45dde3e74b578 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c
> @@ -514,34 +514,3 @@ int phm_set_active_display_count(struct pp_hwmgr *hwmgr, 
> uint32_t count)
>
> return hwmgr->hwmgr_func->set_active_display_count(hwmgr, count);
>  }
> -
> -int phm_set_min_deep_sleep_dcefclk(struct pp_hwmgr *hwmgr, uint32_t clock)
> -{
> -   PHM_FUNC_CHECK(hwmgr);
> -
> -   if (!hwmgr->hwmgr_func->set_min_deep_sleep_dcefclk)
> -   return -EINVAL;
> -
> -   return hwmgr->hwmgr_func->set_min_deep_sleep_dcefclk(hwmgr, clock);
> -}
> -
> -int phm_set_hard_min_dcefclk_by_freq(struct pp_hwmgr *hwmgr, uint32_t clock)
> -{
> -   PHM_FUNC_CHECK(hwmgr);
> -
> -   if (!hwmgr->hwmgr_func->set_hard_min_dcefclk_by_freq)
> -   return -EINVAL;
> -
> -   return hwmgr->hwmgr_func->set_hard_min_dcefclk_by_freq(hwmgr, clock);
> -}
> -
> -int phm_set_hard_min_fclk_by_freq(struct pp_hwmgr *hwmgr, uint32_t clock)
> -{
> -   PHM_FUNC_CHECK(hwmgr);
> -
> -   if (!hwmgr->hwmgr_func->set_hard_min_fclk_by_freq)
> -   return -EINVAL;
> -
> -   return hwmgr->hwmgr_func->set_hard_min_fclk_by_freq(hwmgr, clock);
> -}
> -
> --
> 2.25.1
>
> ___
> 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 07/40] drm/amd/pm/powerplay/smumgr/fiji_smumgr: Demote kernel-doc format abuse

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/fiji_smumgr.c:1107: 
> warning: Function parameter or member 'mem_clock' not described in 
> 'fiji_get_mclk_frequency_ratio'
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
> index fea008cc1f254..02c094a06605d 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
> @@ -1090,7 +1090,7 @@ static int fiji_populate_all_graphic_levels(struct 
> pp_hwmgr *hwmgr)
>  }
>
>
> -/**
> +/*
>   * MCLK Frequency Ratio
>   * SEQ_CG_RESP  Bit[31:24] - 0x0
>   * Bit[27:24] \96 DDR3 Frequency ratio
> --
> 2.25.1
>
> ___
> 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: [Intel-gfx] [RFC v2 3/8] drm/i915: Keep track of pwm-related backlight hooks separately

2020-11-30 Thread Lyude Paul
On Thu, 2020-11-26 at 11:03 +1000, Dave Airlie wrote:
> On Thu, 17 Sept 2020 at 03:19, Lyude Paul  wrote:
> > 
> > Currently, every different type of backlight hook that i915 supports is
> > pretty straight forward - you have a backlight, probably through PWM
> > (but maybe DPCD), with a single set of platform-specific hooks that are
> > used for controlling it.
> > 
> > HDR backlights, in particular VESA and Intel's HDR backlight
> > implementations, can end up being more complicated. With Intel's
> > proprietary interface, HDR backlight controls always run through the
> > DPCD. When the backlight is in SDR backlight mode however, the driver
> > may need to bypass the TCON and control the backlight directly through
> > PWM.
> > 
> > So, in order to support this we'll need to split our backlight callbacks
> > into two groups: a set of high-level backlight control callbacks in
> > intel_panel, and an additional set of pwm-specific backlight control
> > callbacks. This also implies a functional changes for how these
> > callbacks are used:
> > 
> > * We now keep track of two separate backlight level ranges, one for the
> >   high-level backlight, and one for the pwm backlight range
> > * We also keep track of backlight enablement and PWM backlight
> >   enablement separately
> > * Since the currently set backlight level might not be the same as the
> >   currently programmed PWM backlight level, we stop setting
> >   panel->backlight.level with the currently programmed PWM backlight
> >   level in panel->backlight.pwm_funcs.setup(). Instead, we rely
> >   on the higher level backlight control functions to retrieve the
> >   current PWM backlight level (in this case, intel_pwm_get_backlight()).
> >   Note that there are still a few PWM backlight setup callbacks that
> >   do actually need to retrieve the current PWM backlight level, although
> >   we no longer save this value in panel->backlight.level like before.
> > * panel->backlight.pwm_funcs.enable()/disable() both accept a PWM
> >   brightness level, unlike their siblings
> >   panel->backlight.enable()/disable(). This is so we can calculate the
> >   actual PWM brightness level we want to set on disable/enable in the
> >   higher level backlight enable()/disable() functions, since this value
> >   might be scaled from a brightness level that doesn't come from PWM.
> 
> Oh this patch is a handful, I can see why people stall out here.
> 
> I'm going to be annoying maintainer and see if you can clean this up a
> bit in advance
> of this patch.
> 

Not annoying at all :), I was hoping there'd be a good bit of criticism on
this patch series since it's been hard to figure out if I'm even implementing
things in the right way or not (especially because I really don't know what
the HDR side of this is going to look like, although I assume it's probably
going to be pretty hands-off in the kernel).

JFYI too for folks on the list, any suggestions about the HDR side of this are
super appreciated. I'm barely familiar with such things.

> 1) move the callbacks out of struct intel_panel.backlight into a separate
> struct
> and use const static object tables, having fn ptrs and data co-located
> in a struct
> isn't great.
> 
> strcut intel_panel_backlight_funcs {
> 
> };
> struct intel_panel {
>     struct {
>     struct intel_panel_backlight_funcs *funcs;
>     };
> };
> 
> type of thing.
> 
> I think you could reuse the backlight funcs struct for the pwm stuff
> as well. (maybe with an assert on hz_to_pwm for the old hooks).
> 
> 2) change the apis to pass 0 down in a separate patch, this modifies a
> bunch of apis to pass in an extra level parameter, do that
> first in a separate patch that doesn't change anything but hands 0
> down the chain. Then switch over in another patch.
> 
> 3) One comment in passing below.
> > 
> > 
> > -   if (cpu_mode)
> > -   val = pch_get_backlight(connector);
> > -   else
> > -   val = lpt_get_backlight(connector);
> > -   val = intel_panel_compute_brightness(connector, val);
> > -   panel->backlight.level = clamp(val, panel->backlight.min,
> > -  panel->backlight.max);
> > 
> >     if (cpu_mode) {
> > +   val = intel_panel_sanitize_pwm_level(connector,
> > pch_get_backlight(connector));
> > +
> >     drm_dbg_kms(_priv->drm,
> >     "CPU backlight register was enabled, switching
> > to PCH override\n");
> > 
> >     /* Write converted CPU PWM value to PCH override register
> > */
> > -   lpt_set_backlight(connector->base.state, panel-
> > >backlight.level);
> > +   lpt_set_backlight(connector->base.state, val);
> >     intel_de_write(dev_priv, BLC_PWM_PCH_CTL1,
> >    pch_ctl1 | BLM_PCH_OVERRIDE_ENABLE);
> > 
> The change here confused me since it no longer calls lpt_get_backlight
> in this path, the commit msg might explain 

Re: [PATCH 06/40] drm/amd/pm/powerplay/smumgr/smu9_smumgr: Include our own header containing our prototypes

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/smu9_smumgr.c:38:6: 
> warning: no previous prototype for ‘smu9_is_smc_ram_running’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/smu9_smumgr.c:112:5: 
> warning: no previous prototype for ‘smu9_send_msg_to_smc’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/smu9_smumgr.c:140:5: 
> warning: no previous prototype for ‘smu9_send_msg_to_smc_with_parameter’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/smu9_smumgr.c:165:10: 
> warning: no previous prototype for ‘smu9_get_argument’ [-Wmissing-prototypes]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/powerplay/smumgr/smu9_smumgr.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu9_smumgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu9_smumgr.c
> index 8a9aee85043ec..23e5de3c4ec16 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu9_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu9_smumgr.c
> @@ -22,6 +22,7 @@
>   */
>
>  #include "smumgr.h"
> +#include "smu9_smumgr.h"
>  #include "vega10_inc.h"
>  #include "soc15_common.h"
>  #include "pp_debug.h"
> --
> 2.25.1
>
> ___
> 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 05/40] drm/amd/pm/powerplay/smumgr/vegam_smumgr: Make function called by reference static

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/vegam_smumgr.c:2249:5: 
> warning: no previous prototype for ‘vegam_thermal_avfs_enable’ 
> [-Wmissing-prototypes]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c
> index 38a5cdcf58967..7d024d3facef0 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vegam_smumgr.c
> @@ -2246,7 +2246,7 @@ static int vegam_update_sclk_threshold(struct pp_hwmgr 
> *hwmgr)
> return result;
>  }
>
> -int vegam_thermal_avfs_enable(struct pp_hwmgr *hwmgr)
> +static int vegam_thermal_avfs_enable(struct pp_hwmgr *hwmgr)
>  {
> struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
> int ret;
> --
> 2.25.1
>
> ___
> 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 04/40] drm/amd/pm/powerplay/smumgr/iceland_smumgr: Make function called by reference static

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:43 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/iceland_smumgr.c:2085:5: 
> warning: no previous prototype for ‘iceland_thermal_setup_fan_table’ 
> [-Wmissing-prototypes]
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/iceland_smumgr.c: In 
> function ‘iceland_thermal_setup_fan_table’:
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/iceland_smumgr.c:2093:6: 
> warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Huang Rui 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
> index 431ad2fd38df1..6a0f581de999b 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
> @@ -2082,7 +2082,7 @@ static int iceland_init_smc_table(struct pp_hwmgr 
> *hwmgr)
> return 0;
>  }
>
> -int iceland_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
> +static int iceland_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
>  {
> struct smu7_smumgr *smu7_data = (struct smu7_smumgr 
> *)(hwmgr->smu_backend);
> SMU71_Discrete_FanTable fan_table = { FDO_MODE_HARDWARE };
> --
> 2.25.1
>
> ___
> 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 03/40] drm/amd/pm/powerplay/smumgr/ci_smumgr: Remove set but unused variable 'res'

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:42 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/ci_smumgr.c: In function 
> ‘ci_thermal_setup_fan_table’:
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/ci_smumgr.c:2132:6: 
> warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 
> ---
>  drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c
> index 329bf4d44bbce..c1d869b4c7a42 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c
> @@ -2129,7 +2129,6 @@ static int ci_thermal_setup_fan_table(struct pp_hwmgr 
> *hwmgr)
> uint32_t t_diff1, t_diff2, pwm_diff1, pwm_diff2;
> uint16_t fdo_min, slope1, slope2;
> uint32_t reference_clock;
> -   int res;
> uint64_t tmp64;
>
> if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, 
> PHM_PlatformCaps_MicrocodeFanControl))
> @@ -2191,7 +2190,7 @@ static int ci_thermal_setup_fan_table(struct pp_hwmgr 
> *hwmgr)
>
> fan_table.TempSrc = 
> (uint8_t)PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, 
> CG_MULT_THERMAL_CTRL, TEMP_SEL);
>
> -   res = ci_copy_bytes_to_smc(hwmgr, ci_data->fan_table_start, (uint8_t 
> *)_table, (uint32_t)sizeof(fan_table), SMC_RAM_END);
> +   ci_copy_bytes_to_smc(hwmgr, ci_data->fan_table_start, (uint8_t 
> *)_table, (uint32_t)sizeof(fan_table), SMC_RAM_END);
>

Should probably just return the error here.  I'll fix it up.  Thanks!

Alex

> return 0;
>  }
> --
> 2.25.1
>
> ___
> 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 02/40] drm/amd/pm/powerplay/smumgr/polaris10_smumgr: Make function called by reference static

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:42 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/polaris10_smumgr.c:2145:5: 
> warning: no previous prototype for ‘polaris10_thermal_avfs_enable’ 
> [-Wmissing-prototypes]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c
> index 052bc88cf33c9..45214a364baa9 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c
> @@ -2142,7 +2142,7 @@ static int 
> polaris10_program_mem_timing_parameters(struct pp_hwmgr *hwmgr)
> return 0;
>  }
>
> -int polaris10_thermal_avfs_enable(struct pp_hwmgr *hwmgr)
> +static int polaris10_thermal_avfs_enable(struct pp_hwmgr *hwmgr)
>  {
> struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
>
> --
> 2.25.1
>
> ___
> 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 01/40] drm/amd/pm/powerplay/smumgr/tonga_smumgr: Remove set but unused variable 'res'

2020-11-30 Thread Alex Deucher
On Thu, Nov 26, 2020 at 8:42 AM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/tonga_smumgr.c: In 
> function ‘tonga_thermal_setup_fan_table’:
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/tonga_smumgr.c:2469:6: 
> warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 
> ---
>  drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c | 9 +++--
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c
> index 4bfadb49521bc..c28f3e1299701 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c
> @@ -2466,7 +2466,6 @@ static int tonga_thermal_setup_fan_table(struct 
> pp_hwmgr *hwmgr)
> uint32_t t_diff1, t_diff2, pwm_diff1, pwm_diff2;
> uint16_t fdo_min, slope1, slope2;
> uint32_t reference_clock;
> -   int res;
> uint64_t tmp64;
>
> if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
> @@ -2539,11 +2538,9 @@ static int tonga_thermal_setup_fan_table(struct 
> pp_hwmgr *hwmgr)
>
> fan_table.FanControl_GL_Flag = 1;
>
> -   res = smu7_copy_bytes_to_smc(hwmgr,
> -   smu_data->smu7_data.fan_table_start,
> -   (uint8_t *)_table,
> -   (uint32_t)sizeof(fan_table),
> -   SMC_RAM_END);
> +   smu7_copy_bytes_to_smc(hwmgr, smu_data->smu7_data.fan_table_start,
> +  (uint8_t *)_table,
> +  (uint32_t)sizeof(fan_table), SMC_RAM_END);
>

We should probably return the error here rather than dropping it.
I'll send out a patch.

Thanks,

Alex


> return 0;
>  }
> --
> 2.25.1
>
> ___
> 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: [RFC v2 1/8] drm/i915/dp: Program source OUI on eDP panels

2020-11-30 Thread Lyude Paul
On Thu, 2020-11-26 at 12:51 +0200, Jani Nikula wrote:
> On Wed, 16 Sep 2020, Lyude Paul  wrote:
> > Since we're about to start adding support for Intel's magic HDR
> > backlight interface over DPCD, we need to ensure we're properly
> > programming this field so that Intel specific sink services are exposed.
> > Otherwise, 0x300-0x3ff will just read zeroes.
> > 
> > We also take care not to reprogram the source OUI if it already matches
> > what we expect. This is just to be careful so that we don't accidentally
> > take the panel out of any backlight control modes we found it in.
> > 
> > v2:
> > * Add careful parameter to intel_edp_init_source_oui() to avoid
> >   re-writing the source OUI if it's already been set during driver
> >   initialization
> > 
> > Signed-off-by: Lyude Paul 
> > Cc: thay...@noraisin.net
> > Cc: Vasily Khoruzhick 
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp.c | 33 +
> >  1 file changed, 33 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> > b/drivers/gpu/drm/i915/display/intel_dp.c
> > index 4bd10456ad188..7db2b6a3cd52e 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > @@ -3424,6 +3424,29 @@ void intel_dp_sink_set_decompression_state(struct
> > intel_dp *intel_dp,
> >     enable ? "enable" : "disable");
> >  }
> >  
> > +static void
> > +intel_edp_init_source_oui(struct intel_dp *intel_dp, bool careful)
> > +{
> > +   struct drm_i915_private *i915 = dp_to_i915(intel_dp);
> > +   u8 oui[] = { 0x00, 0xaa, 0x01 };
> 
> Nitpick, could be static const.
> 
> > +   u8 buf[3] = { 0 };
> > +
> > +   /*
> > +    * During driver init, we want to be careful and avoid changing
> > the source OUI if it's
> > +    * already set to what we want, so as to avoid clearing any state
> > by accident
> > +    */
> 
> Did you actually observe any ill behaviour with unconditionally writing
> the source OUI?
> 
> I mean it's easy to add the "careful" mode afterwards if there are
> concrete issues, but it'll be hard to remove because it'll be a
> functional change potentially causing regressions.

I haven't yet, although I'll give a test on some of the other machines I've
got lying around.

FWIW, relevant spec info:

   A Sink device that does not support the Source-device specified behavior
   specified by the owner of the IEEE OUI written to in DPCD Addresses 00300h
   through 00302h as being associated with the Source Identification shall
   AUX_ACK all writes, but take no other action, and shall respond to reads
   with an AUX_ACK and the value 00h.

> 
> > +   if (careful) {
> > +   if (drm_dp_dpcd_read(_dp->aux, DP_SOURCE_OUI, buf,
> > sizeof(buf)) < 0)
> > +   drm_err(>drm, "Failed to read source
> > OUI\n");
> > +
> > +   if (memcmp(oui, buf, sizeof(oui)) == 0)
> > +   return;
> > +   }
> > +
> > +   if (drm_dp_dpcd_write(_dp->aux, DP_SOURCE_OUI, oui,
> > sizeof(oui)) < 0)
> > +   drm_err(>drm, "Failed to write source OUI\n");
> > +}
> > +
> >  /* If the sink supports it, try to set the power state appropriately */
> >  void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode)
> >  {
> > @@ -3443,6 +3466,10 @@ void intel_dp_sink_dpms(struct intel_dp *intel_dp,
> > int mode)
> > } else {
> > struct intel_lspcon *lspcon = dp_to_lspcon(intel_dp);
> >  
> > +   /* Write the source OUI as early as possible */
> > +   if (intel_dp_is_edp(intel_dp))
> > +   intel_edp_init_source_oui(intel_dp, false);
> > +
> 
> This hunk conflicts, will need a rebase.
> 
> BR,
> Jani.
> 
> 
> > /*
> >  * When turning on, we need to retry for 1ms to give the
> > sink
> >  * time to wake up.
> > @@ -4607,6 +4634,12 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp)
> > if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
> > intel_dp_get_dsc_sink_cap(intel_dp);
> >  
> > +   /*
> > +    * If needed, program our source OUI so we can make various Intel-
> > specific AUX services
> > +    * available (such as HDR backlight controls)
> > +    */
> > +   intel_edp_init_source_oui(intel_dp, true);
> > +
> > return true;
> >  }
> 

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat

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


Re: [PATCH 40/40] drm/amd/amdgpu/amdgpu_uvd: Add description for amdgpu_uvd_cs_msg_decode()'s 'buf_sizes' param

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:555: warning: Function parameter or 
> member 'buf_sizes' not described in 'amdgpu_uvd_cs_msg_decode'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> index f8f0384a8d9ad..7c5b60e534822 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> @@ -547,6 +547,7 @@ static int amdgpu_uvd_cs_pass1(struct amdgpu_uvd_cs_ctx 
> *ctx)
>   *
>   * @adev: amdgpu_device pointer
>   * @msg: pointer to message structure
> + * @buf_sizes: placeholder to put the different buffer lengths
>   *
>   * Peek into the decode message and calculate the necessary buffer sizes.
>   */
> --
> 2.25.1
>
> ___
> 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 39/40] drm/amd/pm/powerplay/smumgr/fiji_smumgr: Remove unused variable 'result'

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/fiji_smumgr.c: In function 
> ‘fiji_populate_smc_boot_level’:
>  drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/fiji_smumgr.c:1603:6: 
> warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
>
> Cc: Evan Quan 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c   | 13 ++---
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c 
> b/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
> index fef9d3906fccd..fea008cc1f254 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
> @@ -1600,20 +1600,19 @@ static int fiji_populate_smc_uvd_level(struct 
> pp_hwmgr *hwmgr,
>  static int fiji_populate_smc_boot_level(struct pp_hwmgr *hwmgr,
> struct SMU73_Discrete_DpmTable *table)
>  {
> -   int result = 0;
> struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
>
> table->GraphicsBootLevel = 0;
> table->MemoryBootLevel = 0;
>
> /* find boot level from dpm table */
> -   result = phm_find_boot_level(&(data->dpm_table.sclk_table),
> -   data->vbios_boot_state.sclk_bootup_value,
> -   (uint32_t *)&(table->GraphicsBootLevel));
> +   phm_find_boot_level(&(data->dpm_table.sclk_table),
> +   data->vbios_boot_state.sclk_bootup_value,
> +   (uint32_t *)&(table->GraphicsBootLevel));
>
> -   result = phm_find_boot_level(&(data->dpm_table.mclk_table),
> -   data->vbios_boot_state.mclk_bootup_value,
> -   (uint32_t *)&(table->MemoryBootLevel));
> +   phm_find_boot_level(&(data->dpm_table.mclk_table),
> +   data->vbios_boot_state.mclk_bootup_value,
> +   (uint32_t *)&(table->MemoryBootLevel));
>
> table->BootVddc  = data->vbios_boot_state.vddc_bootup_value *
> VOLTAGE_SCALE;
> --
> 2.25.1
>
> ___
> 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 38/40] drm/amd/pm/swsmu/smu11/navi10_ppt: Remove unused 'struct i2c_algorithm navi10_i2c_algo'

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Evan Quan 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c   | 204 --
>  1 file changed, 204 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c 
> b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> index ef1a62e86a0ee..59bd7cd3ca8df 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> @@ -2325,210 +2325,6 @@ static int navi10_run_umc_cdr_workaround(struct 
> smu_context *smu)
> return 0;
>  }
>
> -static void navi10_fill_i2c_req(SwI2cRequest_t  *req, bool write,
> - uint8_t address, uint32_t numbytes,
> - uint8_t *data)
> -{
> -   int i;
> -
> -   req->I2CcontrollerPort = 0;
> -   req->I2CSpeed = 2;
> -   req->SlaveAddress = address;
> -   req->NumCmds = numbytes;
> -
> -   for (i = 0; i < numbytes; i++) {
> -   SwI2cCmd_t *cmd =  >SwI2cCmds[i];
> -
> -   /* First 2 bytes are always write for lower 2b EEPROM address 
> */
> -   if (i < 2)
> -   cmd->Cmd = 1;
> -   else
> -   cmd->Cmd = write;
> -
> -
> -   /* Add RESTART for read  after address filled */
> -   cmd->CmdConfig |= (i == 2 && !write) ? CMDCONFIG_RESTART_MASK 
> : 0;
> -
> -   /* Add STOP in the end */
> -   cmd->CmdConfig |= (i == (numbytes - 1)) ? CMDCONFIG_STOP_MASK 
> : 0;
> -
> -   /* Fill with data regardless if read or write to simplify 
> code */
> -   cmd->RegisterAddr = data[i];
> -   }
> -}
> -
> -static int navi10_i2c_read_data(struct i2c_adapter *control,
> -  uint8_t address,
> -  uint8_t *data,
> -  uint32_t numbytes)
> -{
> -   uint32_t  i, ret = 0;
> -   SwI2cRequest_t req;
> -   struct amdgpu_device *adev = to_amdgpu_device(control);
> -   struct smu_table_context *smu_table = >smu.smu_table;
> -   struct smu_table *table = _table->driver_table;
> -
> -   if (numbytes > MAX_SW_I2C_COMMANDS) {
> -   dev_err(adev->dev, "numbytes requested %d is over max allowed 
> %d\n",
> -   numbytes, MAX_SW_I2C_COMMANDS);
> -   return -EINVAL;
> -   }
> -
> -   memset(, 0, sizeof(req));
> -   navi10_fill_i2c_req(, false, address, numbytes, data);
> -
> -   mutex_lock(>smu.mutex);
> -   /* Now read data starting with that address */
> -   ret = smu_cmn_update_table(>smu, SMU_TABLE_I2C_COMMANDS, 0, 
> ,
> -  true);
> -   mutex_unlock(>smu.mutex);
> -
> -   if (!ret) {
> -   SwI2cRequest_t *res = (SwI2cRequest_t *)table->cpu_addr;
> -
> -   /* Assume SMU  fills res.SwI2cCmds[i].Data with read bytes */
> -   for (i = 0; i < numbytes; i++)
> -   data[i] = res->SwI2cCmds[i].Data;
> -
> -   dev_dbg(adev->dev, "navi10_i2c_read_data, address = %x, bytes 
> = %d, data :",
> - (uint16_t)address, numbytes);
> -
> -   print_hex_dump(KERN_DEBUG, "data: ", DUMP_PREFIX_NONE,
> -  8, 1, data, numbytes, false);
> -   } else
> -   dev_err(adev->dev, "navi10_i2c_read_data - error occurred 
> :%x", ret);
> -
> -   return ret;
> -}
> -
> -static int navi10_i2c_write_data(struct i2c_adapter *control,
> -   uint8_t address,
> -   uint8_t *data,
> -   uint32_t numbytes)
> -{
> -   uint32_t ret;
> -   SwI2cRequest_t req;
> -   struct amdgpu_device *adev = to_amdgpu_device(control);
> -
> -   if (numbytes > MAX_SW_I2C_COMMANDS) {
> -   dev_err(adev->dev, "numbytes requested %d is over max allowed 
> %d\n",
> -   numbytes, MAX_SW_I2C_COMMANDS);
> -   return -EINVAL;
> -   }
> -
> -   memset(, 0, sizeof(req));
> -   navi10_fill_i2c_req(, true, address, numbytes, data);
> -
> -   mutex_lock(>smu.mutex);
> -   ret = smu_cmn_update_table(>smu, SMU_TABLE_I2C_COMMANDS, 0, 
> , true);
> -   mutex_unlock(>smu.mutex);
> -
> -   if (!ret) {
> -   dev_dbg(adev->dev, "navi10_i2c_write(), address = %x, bytes = 
> %d , data: ",
> -(uint16_t)address, numbytes);
> -
> -   print_hex_dump(KERN_DEBUG, 

Re: [PATCH 37/40] drm/amd/pm/swsmu/smu12/renoir_ppt: Demote kernel-doc formatting abuse

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c 
> b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
> index 46c44f0abdfb8..d3641a8ed99c0 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
> @@ -170,7 +170,7 @@ static int renoir_init_smc_tables(struct smu_context *smu)
> return -ENOMEM;
>  }
>
> -/**
> +/*
>   * This interface just for getting uclk ultimate freq and should't introduce
>   * other likewise function result in overmuch callback.
>   */
> @@ -656,7 +656,7 @@ static int renoir_get_power(struct smu_context *smu, 
> uint32_t *value)
> return 0;
>  }
>
> -/**
> +/*
>   * This interface get dpm clock table for dc
>   */
>  static int renoir_get_dpm_clock_table(struct smu_context *smu, struct 
> dpm_clocks *clock_table)
> --
> 2.25.1
>
> ___
> 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 36/40] drm/amd/pm/inc/smu_v11_0: Mark 'smu11_thermal_policy' as __maybe_unused

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> It's used in some, but not all source files which include 'smu_v11_0.h'.
>
> Fixes the following W=1 kernel build warning(s):
>
>  In file included from 
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c:36:
>  drivers/gpu/drm/amd/amdgpu/../pm/inc/smu_v11_0.h:61:43: warning: 
> ‘smu11_thermal_policy’ defined but not used [-Wunused-const-variable=]
>  61 | static const struct smu_temperature_range smu11_thermal_policy[] =
>  | ^~~~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/pm/inc/smu_v11_0.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h 
> b/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
> index eff396c7a281f..9742a02e7b16b 100644
> --- a/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
> +++ b/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
> @@ -58,7 +58,8 @@
>  #define CTF_OFFSET_HOTSPOT 5
>  #define CTF_OFFSET_MEM 5
>
> -static const struct smu_temperature_range smu11_thermal_policy[] =
> +static const
> +struct smu_temperature_range __maybe_unused smu11_thermal_policy[] =
>  {
> {-273150,  99000, 99000, -273150, 99000, 99000, -273150, 99000, 
> 99000},
> { 12, 12, 12, 12, 12, 12, 12, 12, 
> 12},
> --
> 2.25.1
>
> ___
> 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 35/40] drm/amd/pm/swsmu/smu11/vangogh_ppt: Make local function 'vangogh_set_default_dpm_tables()' static

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c: At top level:
>  drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:764:5: warning: 
> no previous prototype for ‘vangogh_set_default_dpm_tables’ 
> [-Wmissing-prototypes]
>  764 | int vangogh_set_default_dpm_tables(struct smu_context *smu)
>  | ^~
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Xiaojian Du 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

This code has changed a bit and I've just sent out a patch to handle
this slightly differently.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 9 +++--
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c 
> b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> index 9a2f72f21ed86..05c32be3a7496 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
> @@ -400,16 +400,13 @@ static int vangogh_get_current_activity_percent(struct 
> smu_context *smu,
>enum amd_pp_sensors sensor,
>uint32_t *value)
>  {
> -   int ret = 0;
> -
> if (!value)
> return -EINVAL;
>
> switch (sensor) {
> case AMDGPU_PP_SENSOR_GPU_LOAD:
> -   ret = vangogh_get_smu_metrics_data(smu,
> - METRICS_AVERAGE_GFXACTIVITY,
> - value);
> +   vangogh_get_smu_metrics_data(smu, METRICS_AVERAGE_GFXACTIVITY,
> +value);
> break;
> default:
> dev_err(smu->adev->dev, "Invalid sensor for retrieving clock 
> activity\n");
> @@ -761,7 +758,7 @@ static int vangogh_od_edit_dpm_table(struct smu_context 
> *smu, enum PP_OD_DPM_TAB
> return ret;
>  }
>
> -int vangogh_set_default_dpm_tables(struct smu_context *smu)
> +static int vangogh_set_default_dpm_tables(struct smu_context *smu)
>  {
> struct smu_table_context *smu_table = >smu_table;
>
> --
> 2.25.1
>
> ___
> 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 34/40] drm/amd/amdgpu/amdgpu_acp: Fix doc-rot issues pertaining to a couple of 'handle' params

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:183: warning: Function parameter or 
> member 'handle' not described in 'acp_hw_init'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:183: warning: Excess function 
> parameter 'adev' description in 'acp_hw_init'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:412: warning: Function parameter or 
> member 'handle' not described in 'acp_hw_fini'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:412: warning: Excess function 
> parameter 'adev' description in 'acp_hw_fini'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> index 1400957034a12..b8655ff73a658 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> @@ -176,7 +176,7 @@ static struct device *get_mfd_cell_dev(const char 
> *device_name, int r)
>  /**
>   * acp_hw_init - start and test ACP block
>   *
> - * @adev: amdgpu_device pointer
> + * @handle: handle used to pass amdgpu_device pointer
>   *
>   */
>  static int acp_hw_init(void *handle)
> @@ -405,7 +405,7 @@ static int acp_hw_init(void *handle)
>  /**
>   * acp_hw_fini - stop the hardware block
>   *
> - * @adev: amdgpu_device pointer
> + * @handle: handle used to pass amdgpu_device pointer
>   *
>   */
>  static int acp_hw_fini(void *handle)
> --
> 2.25.1
>
> ___
> 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 33/40] drm/amd/amdgpu/vcn_v3_0: Remove unused variable 'direct_poll' from 'vcn_v3_0_start_sriov()'

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c: In function ‘vcn_v3_0_start_sriov’:
>  drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:1242:3: warning: variable 
> ‘direct_poll’ set but not used [-Wunused-but-set-variable]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 4 
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c 
> b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> index c5e0a531cabaf..e05af69651723 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> @@ -1238,8 +1238,6 @@ static int vcn_v3_0_start_sriov(struct amdgpu_device 
> *adev)
> direct_wt = { {0} };
> struct mmsch_v3_0_cmd_direct_read_modify_write
> direct_rd_mod_wt = { {0} };
> -   struct mmsch_v3_0_cmd_direct_polling
> -   direct_poll = { {0} };
> struct mmsch_v3_0_cmd_end end = { {0} };
> struct mmsch_v3_0_init_header header;
>
> @@ -1247,8 +1245,6 @@ static int vcn_v3_0_start_sriov(struct amdgpu_device 
> *adev)
> MMSCH_COMMAND__DIRECT_REG_WRITE;
> direct_rd_mod_wt.cmd_header.command_type =
> MMSCH_COMMAND__DIRECT_REG_READ_MODIFY_WRITE;
> -   direct_poll.cmd_header.command_type =
> -   MMSCH_COMMAND__DIRECT_REG_POLLING;
> end.cmd_header.command_type =
> MMSCH_COMMAND__END;
>
> --
> 2.25.1
>
> ___
> 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 23/40] drm/amd/amdgpu/sdma_v5_0: Provide some missing and repair other function params

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:403: warning: Function parameter or 
> member 'job' not described in 'sdma_v5_0_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:403: warning: Function parameter or 
> member 'flags' not described in 'sdma_v5_0_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:480: warning: Function parameter or 
> member 'addr' not described in 'sdma_v5_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:480: warning: Function parameter or 
> member 'seq' not described in 'sdma_v5_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:480: warning: Function parameter or 
> member 'flags' not described in 'sdma_v5_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:480: warning: Excess function 
> parameter 'fence' description in 'sdma_v5_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:967: warning: Function parameter or 
> member 'timeout' not described in 'sdma_v5_0_ring_test_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1074: warning: Function parameter or 
> member 'value' not described in 'sdma_v5_0_vm_write_pte'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1074: warning: Excess function 
> parameter 'addr' description in 'sdma_v5_0_vm_write_pte'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1074: warning: Excess function 
> parameter 'flags' description in 'sdma_v5_0_vm_write_pte'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1126: warning: Function parameter or 
> member 'ring' not described in 'sdma_v5_0_ring_pad_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1180: warning: Function parameter or 
> member 'vmid' not described in 'sdma_v5_0_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1180: warning: Function parameter or 
> member 'pd_addr' not described in 'sdma_v5_0_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1180: warning: Excess function 
> parameter 'vm' description in 'sdma_v5_0_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1703: warning: Function parameter or 
> member 'ib' not described in 'sdma_v5_0_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1703: warning: Function parameter or 
> member 'tmz' not described in 'sdma_v5_0_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1703: warning: Excess function 
> parameter 'ring' description in 'sdma_v5_0_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1729: warning: Function parameter or 
> member 'ib' not described in 'sdma_v5_0_emit_fill_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:1729: warning: Excess function 
> parameter 'ring' description in 'sdma_v5_0_emit_fill_buffer'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 19 +--
>  1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c 
> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> index 9c72b95b74639..5180a52a79a54 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> @@ -392,7 +392,9 @@ static void sdma_v5_0_ring_insert_nop(struct amdgpu_ring 
> *ring, uint32_t count)
>   * sdma_v5_0_ring_emit_ib - Schedule an IB on the DMA engine
>   *
>   * @ring: amdgpu ring pointer
> + * @job: job to retrive vmid from
>   * @ib: IB object to schedule
> + * @flags: unused
>   *
>   * Schedule an IB in the DMA ring (NAVI10).
>   */
> @@ -469,7 +471,9 @@ static void sdma_v5_0_ring_emit_hdp_flush(struct 
> amdgpu_ring *ring)
>   * sdma_v5_0_ring_emit_fence - emit a fence on the DMA ring
>   *
>   * @ring: amdgpu ring pointer
> - * @fence: amdgpu fence object
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Add a DMA fence packet to the ring to write
>   * the fence seq number and DMA trap packet to generate
> @@ -959,6 +963,7 @@ static int sdma_v5_0_ring_test_ring(struct amdgpu_ring 
> *ring)
>   * sdma_v5_0_ring_test_ib - test an IB on the DMA engine
>   *
>   * @ring: amdgpu_ring structure holding ring information
> + * @timeout: timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT
>   *
>   * Test a simple IB in the DMA ring (NAVI10).
>   * Returns 0 on success, error on failure.
> @@ -1061,10 +1066,9 @@ static void sdma_v5_0_vm_copy_pte(struct amdgpu_ib *ib,
>   *
>   * @ib: indirect buffer to fill with commands
>   * @pe: addr of the page entry
> - * @addr: dst addr to write into pe
> + * @value: dst addr to write into pe
>   * @count: number of page entries to update
>   * @incr: increase next addr by incr bytes
> - * @flags: access flags
>   *
>   * Update PTEs by writing 

Re: [PATCH 32/40] drm/amd/amdgpu/vcn_v2_0: Fix a few kernel-doc misdemeanours

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:483: warning: Excess function 
> parameter 'sw' description in 'vcn_v2_0_disable_clock_gating'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:644: warning: Excess function 
> parameter 'sw' description in 'vcn_v2_0_enable_clock_gating'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1404: warning: Function parameter or 
> member 'count' not described in 'vcn_v2_0_dec_ring_insert_nop'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1426: warning: Function parameter or 
> member 'addr' not described in 'vcn_v2_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1426: warning: Function parameter or 
> member 'seq' not described in 'vcn_v2_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1426: warning: Function parameter or 
> member 'flags' not described in 'vcn_v2_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1426: warning: Excess function 
> parameter 'fence' description in 'vcn_v2_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1465: warning: Function parameter or 
> member 'job' not described in 'vcn_v2_0_dec_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1465: warning: Function parameter or 
> member 'flags' not described in 'vcn_v2_0_dec_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1609: warning: Function parameter or 
> member 'addr' not described in 'vcn_v2_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1609: warning: Function parameter or 
> member 'seq' not described in 'vcn_v2_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1609: warning: Function parameter or 
> member 'flags' not described in 'vcn_v2_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1609: warning: Excess function 
> parameter 'fence' description in 'vcn_v2_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1636: warning: Function parameter or 
> member 'job' not described in 'vcn_v2_0_enc_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1636: warning: Function parameter or 
> member 'flags' not described in 'vcn_v2_0_enc_ring_emit_ib'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 15 +++
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c 
> b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
> index e285f9c9d460e..5687c5ed0fb99 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
> @@ -475,7 +475,6 @@ static void vcn_v2_0_mc_resume_dpg_mode(struct 
> amdgpu_device *adev, bool indirec
>   * vcn_v2_0_disable_clock_gating - disable VCN clock gating
>   *
>   * @adev: amdgpu_device pointer
> - * @sw: enable SW clock gating
>   *
>   * Disable clock gating for VCN block
>   */
> @@ -636,7 +635,6 @@ static void vcn_v2_0_clock_gating_dpg_mode(struct 
> amdgpu_device *adev,
>   * vcn_v2_0_enable_clock_gating - enable VCN clock gating
>   *
>   * @adev: amdgpu_device pointer
> - * @sw: enable SW clock gating
>   *
>   * Enable clock gating for VCN block
>   */
> @@ -1397,6 +1395,7 @@ void vcn_v2_0_dec_ring_insert_end(struct amdgpu_ring 
> *ring)
>   * vcn_v2_0_dec_ring_insert_nop - insert a nop command
>   *
>   * @ring: amdgpu_ring pointer
> + * @count: the number of NOP packets to insert
>   *
>   * Write a nop command to the ring.
>   */
> @@ -1417,7 +1416,9 @@ void vcn_v2_0_dec_ring_insert_nop(struct amdgpu_ring 
> *ring, uint32_t count)
>   * vcn_v2_0_dec_ring_emit_fence - emit an fence & trap command
>   *
>   * @ring: amdgpu_ring pointer
> - * @fence: fence to emit
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Write a fence and a trap command to the ring.
>   */
> @@ -1454,7 +1455,9 @@ void vcn_v2_0_dec_ring_emit_fence(struct amdgpu_ring 
> *ring, u64 addr, u64 seq,
>   * vcn_v2_0_dec_ring_emit_ib - execute indirect buffer
>   *
>   * @ring: amdgpu_ring pointer
> + * @job: job to retrive vmid from
>   * @ib: indirect buffer to execute
> + * @flags: unused
>   *
>   * Write ring commands to execute the indirect buffer
>   */
> @@ -1600,7 +1603,9 @@ static void vcn_v2_0_enc_ring_set_wptr(struct 
> amdgpu_ring *ring)
>   * vcn_v2_0_enc_ring_emit_fence - emit an enc fence & trap command
>   *
>   * @ring: amdgpu_ring pointer
> - * @fence: fence to emit
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Write enc a fence and a trap command to the ring.
>   */
> @@ -1625,7 +1630,9 @@ void vcn_v2_0_enc_ring_insert_end(struct amdgpu_ring 
> *ring)
>   * vcn_v2_0_enc_ring_emit_ib - enc execute indirect buffer
>   *
>   * @ring: amdgpu_ring pointer
> + 

Re: [PATCH 31/40] drm/amd/amdgpu/jpeg_v2_0: Add some missing kernel-doc descriptions

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c:498: warning: Function parameter or 
> member 'addr' not described in 'jpeg_v2_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c:498: warning: Function parameter or 
> member 'seq' not described in 'jpeg_v2_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c:498: warning: Function parameter or 
> member 'flags' not described in 'jpeg_v2_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c:498: warning: Excess function 
> parameter 'fence' description in 'jpeg_v2_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c:549: warning: Function parameter or 
> member 'job' not described in 'jpeg_v2_0_dec_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c:549: warning: Function parameter or 
> member 'flags' not described in 'jpeg_v2_0_dec_ring_emit_ib'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c 
> b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
> index 6b80dcea80ec8..15c0224d48b06 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
> @@ -489,7 +489,9 @@ void jpeg_v2_0_dec_ring_insert_end(struct amdgpu_ring 
> *ring)
>   * jpeg_v2_0_dec_ring_emit_fence - emit an fence & trap command
>   *
>   * @ring: amdgpu_ring pointer
> - * @fence: fence to emit
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Write a fence and a trap command to the ring.
>   */
> @@ -538,7 +540,9 @@ void jpeg_v2_0_dec_ring_emit_fence(struct amdgpu_ring 
> *ring, u64 addr, u64 seq,
>   * jpeg_v2_0_dec_ring_emit_ib - execute indirect buffer
>   *
>   * @ring: amdgpu_ring pointer
> + * @job: job to retrive vmid from
>   * @ib: indirect buffer to execute
> + * @flags: unused
>   *
>   * Write ring commands to execute the indirect buffer.
>   */
> --
> 2.25.1
>
> ___
> 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 30/40] drm/amd/amdgpu/jpeg_v1_0: Add some missing function param descriptions

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c:219: warning: Function parameter or 
> member 'addr' not described in 'jpeg_v1_0_decode_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c:219: warning: Function parameter or 
> member 'seq' not described in 'jpeg_v1_0_decode_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c:219: warning: Function parameter or 
> member 'flags' not described in 'jpeg_v1_0_decode_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c:219: warning: Excess function 
> parameter 'fence' description in 'jpeg_v1_0_decode_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c:293: warning: Function parameter or 
> member 'job' not described in 'jpeg_v1_0_decode_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c:293: warning: Function parameter or 
> member 'flags' not described in 'jpeg_v1_0_decode_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c:518: warning: Function parameter or 
> member 'mode' not described in 'jpeg_v1_0_start'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Veerabadhran G 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c 
> b/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c
> index c600b61b5f45d..c87102b238e48 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c
> @@ -210,7 +210,9 @@ static void jpeg_v1_0_decode_ring_insert_end(struct 
> amdgpu_ring *ring)
>   * jpeg_v1_0_decode_ring_emit_fence - emit an fence & trap command
>   *
>   * @ring: amdgpu_ring pointer
> - * @fence: fence to emit
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Write a fence and a trap command to the ring.
>   */
> @@ -282,7 +284,9 @@ static void jpeg_v1_0_decode_ring_emit_fence(struct 
> amdgpu_ring *ring, u64 addr,
>   * jpeg_v1_0_decode_ring_emit_ib - execute indirect buffer
>   *
>   * @ring: amdgpu_ring pointer
> + * @job: job to retrive vmid from
>   * @ib: indirect buffer to execute
> + * @flags: unused
>   *
>   * Write ring commands to execute the indirect buffer.
>   */
> @@ -511,6 +515,7 @@ void jpeg_v1_0_sw_fini(void *handle)
>   * jpeg_v1_0_start - start JPEG block
>   *
>   * @adev: amdgpu_device pointer
> + * @mode: SPG or DPG mode
>   *
>   * Setup and start the JPEG block
>   */
> --
> 2.25.1
>
> ___
> 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 29/40] drm/amd/amdgpu/vcn_v1_0: Fix a few kernel-doc misdemeanours

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:439: warning: Excess function 
> parameter 'sw' description in 'vcn_v1_0_disable_clock_gating'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:566: warning: Excess function 
> parameter 'sw' description in 'vcn_v1_0_enable_clock_gating'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1454: warning: Function parameter or 
> member 'addr' not described in 'vcn_v1_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1454: warning: Function parameter or 
> member 'seq' not described in 'vcn_v1_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1454: warning: Function parameter or 
> member 'flags' not described in 'vcn_v1_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1454: warning: Excess function 
> parameter 'fence' description in 'vcn_v1_0_dec_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1495: warning: Function parameter or 
> member 'job' not described in 'vcn_v1_0_dec_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1495: warning: Function parameter or 
> member 'flags' not described in 'vcn_v1_0_dec_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1628: warning: Function parameter or 
> member 'addr' not described in 'vcn_v1_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1628: warning: Function parameter or 
> member 'seq' not described in 'vcn_v1_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1628: warning: Function parameter or 
> member 'flags' not described in 'vcn_v1_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1628: warning: Excess function 
> parameter 'fence' description in 'vcn_v1_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1655: warning: Function parameter or 
> member 'job' not described in 'vcn_v1_0_enc_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1655: warning: Function parameter or 
> member 'flags' not described in 'vcn_v1_0_enc_ring_emit_ib'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 14 ++
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c 
> b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> index 86e1ef732ebec..72148f3b27d04 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> @@ -431,7 +431,6 @@ static void vcn_v1_0_mc_resume_dpg_mode(struct 
> amdgpu_device *adev)
>   * vcn_v1_0_disable_clock_gating - disable VCN clock gating
>   *
>   * @adev: amdgpu_device pointer
> - * @sw: enable SW clock gating
>   *
>   * Disable clock gating for VCN block
>   */
> @@ -558,7 +557,6 @@ static void vcn_v1_0_disable_clock_gating(struct 
> amdgpu_device *adev)
>   * vcn_v1_0_enable_clock_gating - enable VCN clock gating
>   *
>   * @adev: amdgpu_device pointer
> - * @sw: enable SW clock gating
>   *
>   * Enable clock gating for VCN block
>   */
> @@ -1445,7 +1443,9 @@ static void vcn_v1_0_dec_ring_insert_end(struct 
> amdgpu_ring *ring)
>   * vcn_v1_0_dec_ring_emit_fence - emit an fence & trap command
>   *
>   * @ring: amdgpu_ring pointer
> - * @fence: fence to emit
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Write a fence and a trap command to the ring.
>   */
> @@ -1484,7 +1484,9 @@ static void vcn_v1_0_dec_ring_emit_fence(struct 
> amdgpu_ring *ring, u64 addr, u64
>   * vcn_v1_0_dec_ring_emit_ib - execute indirect buffer
>   *
>   * @ring: amdgpu_ring pointer
> + * @job: job to retrive vmid from
>   * @ib: indirect buffer to execute
> + * @flags: unused
>   *
>   * Write ring commands to execute the indirect buffer
>   */
> @@ -1619,7 +1621,9 @@ static void vcn_v1_0_enc_ring_set_wptr(struct 
> amdgpu_ring *ring)
>   * vcn_v1_0_enc_ring_emit_fence - emit an enc fence & trap command
>   *
>   * @ring: amdgpu_ring pointer
> - * @fence: fence to emit
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Write enc a fence and a trap command to the ring.
>   */
> @@ -1644,7 +1648,9 @@ static void vcn_v1_0_enc_ring_insert_end(struct 
> amdgpu_ring *ring)
>   * vcn_v1_0_enc_ring_emit_ib - enc execute indirect buffer
>   *
>   * @ring: amdgpu_ring pointer
> + * @job: job to retrive vmid from
>   * @ib: indirect buffer to execute
> + * @flags: unused
>   *
>   * Write enc ring commands to execute the indirect buffer
>   */
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list

Re: [PATCH 28/40] drm/amd/amdgpu/gfx_v10_0: Make local function 'gfx_v10_0_rlc_stop()' static

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:5008:6: warning: no previous 
> prototype for ‘gfx_v10_0_rlc_stop’ [-Wmissing-prototypes]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> index d4760f4e269a1..9eb886ae5a35e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> @@ -5005,7 +5005,7 @@ static int gfx_v10_0_init_csb(struct amdgpu_device 
> *adev)
> return 0;
>  }
>
> -void gfx_v10_0_rlc_stop(struct amdgpu_device *adev)
> +static void gfx_v10_0_rlc_stop(struct amdgpu_device *adev)
>  {
> u32 tmp = RREG32_SOC15(GC, 0, mmRLC_CNTL);
>
> --
> 2.25.1
>
> ___
> 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 27/40] drm/amd/amdgpu/uvd_v7_0: Fix a bunch of kernel-doc function documentation issues

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:219: warning: Function parameter or 
> member 'bo' not described in 'uvd_v7_0_enc_get_create_msg'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:219: warning: Excess function 
> parameter 'adev' description in 'uvd_v7_0_enc_get_create_msg'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:282: warning: Function parameter or 
> member 'bo' not described in 'uvd_v7_0_enc_get_destroy_msg'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:282: warning: Excess function 
> parameter 'adev' description in 'uvd_v7_0_enc_get_destroy_msg'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:339: warning: Function parameter or 
> member 'timeout' not described in 'uvd_v7_0_enc_ring_test_ib'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:527: warning: Function parameter or 
> member 'handle' not described in 'uvd_v7_0_hw_init'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:527: warning: Excess function 
> parameter 'adev' description in 'uvd_v7_0_hw_init'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:605: warning: Function parameter or 
> member 'handle' not described in 'uvd_v7_0_hw_fini'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:605: warning: Excess function 
> parameter 'adev' description in 'uvd_v7_0_hw_fini'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1156: warning: Function parameter or 
> member 'addr' not described in 'uvd_v7_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1156: warning: Function parameter or 
> member 'seq' not described in 'uvd_v7_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1156: warning: Function parameter or 
> member 'flags' not described in 'uvd_v7_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1156: warning: Excess function 
> parameter 'fence' description in 'uvd_v7_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1195: warning: Function parameter or 
> member 'addr' not described in 'uvd_v7_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1195: warning: Function parameter or 
> member 'seq' not described in 'uvd_v7_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1195: warning: Function parameter or 
> member 'flags' not described in 'uvd_v7_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1195: warning: Excess function 
> parameter 'fence' description in 'uvd_v7_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1293: warning: Function parameter or 
> member 'job' not described in 'uvd_v7_0_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1293: warning: Function parameter or 
> member 'flags' not described in 'uvd_v7_0_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1324: warning: Function parameter or 
> member 'job' not described in 'uvd_v7_0_enc_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c:1324: warning: Function parameter or 
> member 'flags' not described in 'uvd_v7_0_enc_ring_emit_ib'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 21 +++--
>  1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c 
> b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
> index b44c8677ce8d5..9911ff80a6776 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
> @@ -206,9 +206,9 @@ static int uvd_v7_0_enc_ring_test_ring(struct amdgpu_ring 
> *ring)
>  /**
>   * uvd_v7_0_enc_get_create_msg - generate a UVD ENC create msg
>   *
> - * @adev: amdgpu_device pointer
>   * @ring: ring we should submit the msg to
>   * @handle: session handle to use
> + * @bo: amdgpu object for which we query the offset
>   * @fence: optional fence to return
>   *
>   * Open up a stream for HW test
> @@ -269,9 +269,9 @@ static int uvd_v7_0_enc_get_create_msg(struct amdgpu_ring 
> *ring, uint32_t handle
>  /**
>   * uvd_v7_0_enc_get_destroy_msg - generate a UVD ENC destroy msg
>   *
> - * @adev: amdgpu_device pointer
>   * @ring: ring we should submit the msg to
>   * @handle: session handle to use
> + * @bo: amdgpu object for which we query the offset
>   * @fence: optional fence to return
>   *
>   * Close up a stream for HW test or if userspace failed to do so
> @@ -333,6 +333,7 @@ static int uvd_v7_0_enc_get_destroy_msg(struct 
> amdgpu_ring *ring, uint32_t handl
>   * uvd_v7_0_enc_ring_test_ib - test if UVD ENC IBs are working
>   *
>   * @ring: the engine to test on
> + * @timeout: timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT
>   *
>   */
>  static int uvd_v7_0_enc_ring_test_ib(struct amdgpu_ring *ring, long timeout)
> @@ -519,7 +520,7 @@ static int uvd_v7_0_sw_fini(void 

Re: [PATCH 26/40] drm/amd/amdgpu/uvd_v6_0: Fix a bunch of kernel-doc function documentation issues

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:44 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:211: warning: Function parameter or 
> member 'bo' not described in 'uvd_v6_0_enc_get_create_msg'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:211: warning: Excess function 
> parameter 'adev' description in 'uvd_v6_0_enc_get_create_msg'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:275: warning: Function parameter or 
> member 'bo' not described in 'uvd_v6_0_enc_get_destroy_msg'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:275: warning: Excess function 
> parameter 'adev' description in 'uvd_v6_0_enc_get_destroy_msg'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:332: warning: Function parameter or 
> member 'timeout' not described in 'uvd_v6_0_enc_ring_test_ib'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:472: warning: Function parameter or 
> member 'handle' not described in 'uvd_v6_0_hw_init'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:472: warning: Excess function 
> parameter 'adev' description in 'uvd_v6_0_hw_init'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:541: warning: Function parameter or 
> member 'handle' not described in 'uvd_v6_0_hw_fini'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:541: warning: Excess function 
> parameter 'adev' description in 'uvd_v6_0_hw_fini'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:900: warning: Function parameter or 
> member 'addr' not described in 'uvd_v6_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:900: warning: Function parameter or 
> member 'seq' not described in 'uvd_v6_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:900: warning: Function parameter or 
> member 'flags' not described in 'uvd_v6_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:900: warning: Excess function 
> parameter 'fence' description in 'uvd_v6_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:930: warning: Function parameter or 
> member 'addr' not described in 'uvd_v6_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:930: warning: Function parameter or 
> member 'seq' not described in 'uvd_v6_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:930: warning: Function parameter or 
> member 'flags' not described in 'uvd_v6_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:930: warning: Excess function 
> parameter 'fence' description in 'uvd_v6_0_enc_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:997: warning: Function parameter or 
> member 'job' not described in 'uvd_v6_0_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:997: warning: Function parameter or 
> member 'flags' not described in 'uvd_v6_0_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:1023: warning: Function parameter or 
> member 'job' not described in 'uvd_v6_0_enc_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:1023: warning: Function parameter or 
> member 'flags' not described in 'uvd_v6_0_enc_ring_emit_ib'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 21 +++--
>  1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c 
> b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> index 666bfa4a0b8ea..69cf7edf4cc61 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> @@ -198,9 +198,9 @@ static int uvd_v6_0_enc_ring_test_ring(struct amdgpu_ring 
> *ring)
>  /**
>   * uvd_v6_0_enc_get_create_msg - generate a UVD ENC create msg
>   *
> - * @adev: amdgpu_device pointer
>   * @ring: ring we should submit the msg to
>   * @handle: session handle to use
> + * @bo: amdgpu object for which we query the offset
>   * @fence: optional fence to return
>   *
>   * Open up a stream for HW test
> @@ -261,9 +261,9 @@ static int uvd_v6_0_enc_get_create_msg(struct amdgpu_ring 
> *ring, uint32_t handle
>  /**
>   * uvd_v6_0_enc_get_destroy_msg - generate a UVD ENC destroy msg
>   *
> - * @adev: amdgpu_device pointer
>   * @ring: ring we should submit the msg to
>   * @handle: session handle to use
> + * @bo: amdgpu object for which we query the offset
>   * @fence: optional fence to return
>   *
>   * Close up a stream for HW test or if userspace failed to do so
> @@ -326,6 +326,7 @@ static int uvd_v6_0_enc_get_destroy_msg(struct 
> amdgpu_ring *ring,
>   * uvd_v6_0_enc_ring_test_ib - test if UVD ENC IBs are working
>   *
>   * @ring: the engine to test on
> + * @timeout: timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT
>   *
>   */
>  static int uvd_v6_0_enc_ring_test_ib(struct amdgpu_ring *ring, long timeout)
> @@ -464,7 +465,7 @@ static int uvd_v6_0_sw_fini(void *handle)
>  /**
>   * 

Re: [PATCH 25/40] drm/amd/amdgpu/amdgpu_vce: Provide some missing and repair other function params

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:97: warning: Function parameter or 
> member 'size' not described in 'amdgpu_vce_sw_init'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:441: warning: Function parameter or 
> member 'bo' not described in 'amdgpu_vce_get_create_msg'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:441: warning: Excess function 
> parameter 'adev' description in 'amdgpu_vce_get_create_msg'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:521: warning: Function parameter or 
> member 'direct' not described in 'amdgpu_vce_get_destroy_msg'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:521: warning: Excess function 
> parameter 'adev' description in 'amdgpu_vce_get_destroy_msg'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:588: warning: Function parameter or 
> member 'ib_idx' not described in 'amdgpu_vce_validate_bo'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:636: warning: Function parameter or 
> member 'ib_idx' not described in 'amdgpu_vce_cs_reloc'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:636: warning: Function parameter or 
> member 'index' not described in 'amdgpu_vce_cs_reloc'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:720: warning: Function parameter or 
> member 'ib_idx' not described in 'amdgpu_vce_ring_parse_cs'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:956: warning: Function parameter or 
> member 'ib_idx' not described in 'amdgpu_vce_ring_parse_cs_vm'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:1050: warning: Function parameter or 
> member 'job' not described in 'amdgpu_vce_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:1050: warning: Function parameter or 
> member 'flags' not described in 'amdgpu_vce_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:1066: warning: Function parameter or 
> member 'addr' not described in 'amdgpu_vce_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:1066: warning: Function parameter or 
> member 'seq' not described in 'amdgpu_vce_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:1066: warning: Function parameter or 
> member 'flags' not described in 'amdgpu_vce_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:1066: warning: Excess function 
> parameter 'fence' description in 'amdgpu_vce_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:1122: warning: Function parameter or 
> member 'timeout' not described in 'amdgpu_vce_ring_test_ib'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 19 ++-
>  1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> index ecaa2d7483b20..1d8db318b0758 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> @@ -90,6 +90,7 @@ static int amdgpu_vce_get_destroy_msg(struct amdgpu_ring 
> *ring, uint32_t handle,
>   * amdgpu_vce_init - allocate memory, load vce firmware
>   *
>   * @adev: amdgpu_device pointer
> + * @size: size for the new BO
>   *
>   * First step to get VCE online, allocate memory and load the firmware
>   */
> @@ -428,9 +429,9 @@ void amdgpu_vce_free_handles(struct amdgpu_device *adev, 
> struct drm_file *filp)
>  /**
>   * amdgpu_vce_get_create_msg - generate a VCE create msg
>   *
> - * @adev: amdgpu_device pointer
>   * @ring: ring we should submit the msg to
>   * @handle: VCE session handle to use
> + * @bo: amdgpu object for which we query the offset
>   * @fence: optional fence to return
>   *
>   * Open up a stream for HW test
> @@ -509,9 +510,9 @@ static int amdgpu_vce_get_create_msg(struct amdgpu_ring 
> *ring, uint32_t handle,
>  /**
>   * amdgpu_vce_get_destroy_msg - generate a VCE destroy msg
>   *
> - * @adev: amdgpu_device pointer
>   * @ring: ring we should submit the msg to
>   * @handle: VCE session handle to use
> + * @direct: direct or delayed pool
>   * @fence: optional fence to return
>   *
>   * Close up a stream for HW test or if userspace failed to do so
> @@ -576,6 +577,7 @@ static int amdgpu_vce_get_destroy_msg(struct amdgpu_ring 
> *ring, uint32_t handle,
>   * amdgpu_vce_cs_validate_bo - make sure not to cross 4GB boundary
>   *
>   * @p: parser context
> + * @ib_idx: indirect buffer to use
>   * @lo: address of lower dword
>   * @hi: address of higher dword
>   * @size: minimum size
> @@ -625,9 +627,11 @@ static int amdgpu_vce_validate_bo(struct 
> amdgpu_cs_parser *p, uint32_t ib_idx,
>   * amdgpu_vce_cs_reloc - command submission relocation
>   *
>   * @p: parser context
> + * @ib_idx: indirect buffer to use
>   * @lo: address of lower dword
>   

Re: [PATCH 24/40] drm/amd/amdgpu/sdma_v5_2: Provide some missing and repair other function params

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:44 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:367: warning: Function parameter or 
> member 'job' not described in 'sdma_v5_2_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:367: warning: Function parameter or 
> member 'flags' not described in 'sdma_v5_2_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:429: warning: Function parameter or 
> member 'addr' not described in 'sdma_v5_2_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:429: warning: Function parameter or 
> member 'seq' not described in 'sdma_v5_2_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:429: warning: Function parameter or 
> member 'flags' not described in 'sdma_v5_2_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:429: warning: Excess function 
> parameter 'fence' description in 'sdma_v5_2_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:924: warning: Function parameter or 
> member 'timeout' not described in 'sdma_v5_2_ring_test_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1030: warning: Function parameter or 
> member 'value' not described in 'sdma_v5_2_vm_write_pte'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1030: warning: Excess function 
> parameter 'addr' description in 'sdma_v5_2_vm_write_pte'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1030: warning: Excess function 
> parameter 'flags' description in 'sdma_v5_2_vm_write_pte'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1083: warning: Function parameter or 
> member 'ring' not described in 'sdma_v5_2_ring_pad_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1137: warning: Function parameter or 
> member 'vmid' not described in 'sdma_v5_2_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1137: warning: Function parameter or 
> member 'pd_addr' not described in 'sdma_v5_2_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1137: warning: Excess function 
> parameter 'vm' description in 'sdma_v5_2_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1717: warning: Function parameter or 
> member 'ib' not described in 'sdma_v5_2_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1717: warning: Function parameter or 
> member 'tmz' not described in 'sdma_v5_2_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1717: warning: Excess function 
> parameter 'ring' description in 'sdma_v5_2_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1743: warning: Function parameter or 
> member 'ib' not described in 'sdma_v5_2_emit_fill_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1743: warning: Excess function 
> parameter 'ring' description in 'sdma_v5_2_emit_fill_buffer'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 19 +--
>  1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c 
> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> index cb5a6f1437f81..e8736360d1a9f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> @@ -356,7 +356,9 @@ static void sdma_v5_2_ring_insert_nop(struct amdgpu_ring 
> *ring, uint32_t count)
>   * sdma_v5_2_ring_emit_ib - Schedule an IB on the DMA engine
>   *
>   * @ring: amdgpu ring pointer
> + * @job: job to retrive vmid from
>   * @ib: IB object to schedule
> + * @flags: unused
>   *
>   * Schedule an IB in the DMA ring.
>   */
> @@ -418,7 +420,9 @@ static void sdma_v5_2_ring_emit_hdp_flush(struct 
> amdgpu_ring *ring)
>   * sdma_v5_2_ring_emit_fence - emit a fence on the DMA ring
>   *
>   * @ring: amdgpu ring pointer
> - * @fence: amdgpu fence object
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Add a DMA fence packet to the ring to write
>   * the fence seq number and DMA trap packet to generate
> @@ -916,6 +920,7 @@ static int sdma_v5_2_ring_test_ring(struct amdgpu_ring 
> *ring)
>   * sdma_v5_2_ring_test_ib - test an IB on the DMA engine
>   *
>   * @ring: amdgpu_ring structure holding ring information
> + * @timeout: timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT
>   *
>   * Test a simple IB in the DMA ring.
>   * Returns 0 on success, error on failure.
> @@ -1017,10 +1022,9 @@ static void sdma_v5_2_vm_copy_pte(struct amdgpu_ib *ib,
>   *
>   * @ib: indirect buffer to fill with commands
>   * @pe: addr of the page entry
> - * @addr: dst addr to write into pe
> + * @value: dst addr to write into pe
>   * @count: number of page entries to update
>   * @incr: increase next addr by incr bytes
> - * @flags: access flags
>   *
>   * Update PTEs by writing them manually 

Re: [PATCH 22/40] drm/amd/amdgpu/amdgpu_uvd: Fix some function documentation headers

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:44 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:95: warning: cannot understand 
> function prototype: 'struct amdgpu_uvd_cs_ctx '
>  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:555: warning: Function parameter or 
> member 'adev' not described in 'amdgpu_uvd_cs_msg_decode'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1012: warning: Function parameter or 
> member 'ib_idx' not described in 'amdgpu_uvd_ring_parse_cs'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1286: warning: Function parameter or 
> member 'timeout' not described in 'amdgpu_uvd_ring_test_ib'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> index f8bebf18ee362..f8f0384a8d9ad 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> @@ -87,7 +87,7 @@
>  #define UVD_NO_OP  0x03ff
>  #define UVD_BASE_SI0x3800
>
> -/**
> +/*
>   * amdgpu_uvd_cs_ctx - Command submission parser context
>   *
>   * Used for emulating virtual memory support on UVD 4.2.
> @@ -545,8 +545,8 @@ static int amdgpu_uvd_cs_pass1(struct amdgpu_uvd_cs_ctx 
> *ctx)
>  /**
>   * amdgpu_uvd_cs_msg_decode - handle UVD decode message
>   *
> + * @adev: amdgpu_device pointer
>   * @msg: pointer to message structure
> - * @buf_sizes: returned buffer sizes
>   *
>   * Peek into the decode message and calculate the necessary buffer sizes.
>   */
> @@ -1005,6 +1005,7 @@ static int amdgpu_uvd_cs_packets(struct 
> amdgpu_uvd_cs_ctx *ctx,
>   * amdgpu_uvd_ring_parse_cs - UVD command submission parser
>   *
>   * @parser: Command submission parser context
> + * @ib_idx: Which indirect buffer to use
>   *
>   * Parse the command stream, patch in addresses as necessary.
>   */
> @@ -1279,6 +1280,7 @@ void amdgpu_uvd_ring_end_use(struct amdgpu_ring *ring)
>   * amdgpu_uvd_ring_test_ib - test ib execution
>   *
>   * @ring: amdgpu_ring pointer
> + * @timeout: timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT
>   *
>   * Test if we can successfully execute an IB
>   */
> --
> 2.25.1
>
> ___
> 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 21/40] drm/amd/amdgpu/sdma_v4_0: Repair a bunch of kernel-doc problems

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:848: warning: Function parameter or 
> member 'job' not described in 'sdma_v4_0_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:848: warning: Function parameter or 
> member 'flags' not described in 'sdma_v4_0_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:923: warning: Function parameter or 
> member 'addr' not described in 'sdma_v4_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:923: warning: Function parameter or 
> member 'seq' not described in 'sdma_v4_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:923: warning: Function parameter or 
> member 'flags' not described in 'sdma_v4_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:923: warning: Excess function 
> parameter 'fence' description in 'sdma_v4_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1117: warning: Function parameter or 
> member 'ring' not described in 'sdma_v4_0_rb_cntl'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1117: warning: Function parameter or 
> member 'rb_cntl' not described in 'sdma_v4_0_rb_cntl'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1581: warning: Function parameter or 
> member 'timeout' not described in 'sdma_v4_0_ring_test_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1682: warning: Function parameter or 
> member 'value' not described in 'sdma_v4_0_vm_write_pte'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1682: warning: Excess function 
> parameter 'addr' description in 'sdma_v4_0_vm_write_pte'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1682: warning: Excess function 
> parameter 'flags' description in 'sdma_v4_0_vm_write_pte'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1734: warning: Function parameter or 
> member 'ring' not described in 'sdma_v4_0_ring_pad_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1782: warning: Function parameter or 
> member 'vmid' not described in 'sdma_v4_0_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1782: warning: Function parameter or 
> member 'pd_addr' not described in 'sdma_v4_0_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1782: warning: Excess function 
> parameter 'vm' description in 'sdma_v4_0_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:2508: warning: Function parameter or 
> member 'ib' not described in 'sdma_v4_0_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:2508: warning: Function parameter or 
> member 'tmz' not described in 'sdma_v4_0_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:2508: warning: Excess function 
> parameter 'ring' description in 'sdma_v4_0_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:2534: warning: Function parameter or 
> member 'ib' not described in 'sdma_v4_0_emit_fill_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:2534: warning: Excess function 
> parameter 'ring' description in 'sdma_v4_0_emit_fill_buffer'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 22 ++
>  1 file changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c 
> b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index dc74ca2aa8926..512efb31cc9fe 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -837,7 +837,9 @@ static void sdma_v4_0_ring_insert_nop(struct amdgpu_ring 
> *ring, uint32_t count)
>   * sdma_v4_0_ring_emit_ib - Schedule an IB on the DMA engine
>   *
>   * @ring: amdgpu ring pointer
> + * @job: job to retrive vmid from
>   * @ib: IB object to schedule
> + * @flags: unused
>   *
>   * Schedule an IB in the DMA ring (VEGA10).
>   */
> @@ -912,7 +914,9 @@ static void sdma_v4_0_ring_emit_hdp_flush(struct 
> amdgpu_ring *ring)
>   * sdma_v4_0_ring_emit_fence - emit a fence on the DMA ring
>   *
>   * @ring: amdgpu ring pointer
> - * @fence: amdgpu fence object
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Add a DMA fence packet to the ring to write
>   * the fence seq number and DMA trap packet to generate
> @@ -1110,7 +1114,7 @@ static void sdma_v4_0_enable(struct amdgpu_device 
> *adev, bool enable)
> }
>  }
>
> -/**
> +/*
>   * sdma_v4_0_rb_cntl - get parameters for rb_cntl
>   */
>  static uint32_t sdma_v4_0_rb_cntl(struct amdgpu_ring *ring, uint32_t rb_cntl)
> @@ -1573,6 +1577,7 @@ static int sdma_v4_0_ring_test_ring(struct amdgpu_ring 
> *ring)
>   * sdma_v4_0_ring_test_ib - test an IB on the DMA engine
>   *
>   * @ring: amdgpu_ring structure holding ring information
> + * @timeout: timeout 

Re: [PATCH 20/40] drm/amd/amdgpu/uvd_v5_0: Fix a bunch of kernel-doc function documentation issues

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:44 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c:153: warning: Function parameter or 
> member 'handle' not described in 'uvd_v5_0_hw_init'
>  drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c:153: warning: Excess function 
> parameter 'adev' description in 'uvd_v5_0_hw_init'
>  drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c:210: warning: Function parameter or 
> member 'handle' not described in 'uvd_v5_0_hw_fini'
>  drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c:210: warning: Excess function 
> parameter 'adev' description in 'uvd_v5_0_hw_fini'
>  drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c:463: warning: Function parameter or 
> member 'addr' not described in 'uvd_v5_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c:463: warning: Function parameter or 
> member 'seq' not described in 'uvd_v5_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c:463: warning: Function parameter or 
> member 'flags' not described in 'uvd_v5_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c:463: warning: Excess function 
> parameter 'fence' description in 'uvd_v5_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c:529: warning: Function parameter or 
> member 'job' not described in 'uvd_v5_0_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c:529: warning: Function parameter or 
> member 'flags' not described in 'uvd_v5_0_ring_emit_ib'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Nirmoy Das 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 10 +++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c 
> b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
> index 6e57001f6d0ac..3a748ec58bec5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
> @@ -145,7 +145,7 @@ static int uvd_v5_0_sw_fini(void *handle)
>  /**
>   * uvd_v5_0_hw_init - start and test UVD block
>   *
> - * @adev: amdgpu_device pointer
> + * @handle: handle used to pass amdgpu_device pointer
>   *
>   * Initialize the hardware, boot up the VCPU and do some testing
>   */
> @@ -202,7 +202,7 @@ static int uvd_v5_0_hw_init(void *handle)
>  /**
>   * uvd_v5_0_hw_fini - stop the hardware block
>   *
> - * @adev: amdgpu_device pointer
> + * @handle: handle used to pass amdgpu_device pointer
>   *
>   * Stop the UVD block, mark ring as not ready any more
>   */
> @@ -454,7 +454,9 @@ static void uvd_v5_0_stop(struct amdgpu_device *adev)
>   * uvd_v5_0_ring_emit_fence - emit an fence & trap command
>   *
>   * @ring: amdgpu_ring pointer
> - * @fence: fence to emit
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Write a fence and a trap command to the ring.
>   */
> @@ -518,7 +520,9 @@ static int uvd_v5_0_ring_test_ring(struct amdgpu_ring 
> *ring)
>   * uvd_v5_0_ring_emit_ib - execute indirect buffer
>   *
>   * @ring: amdgpu_ring pointer
> + * @job: job to retrive vmid from
>   * @ib: indirect buffer to execute
> + * @flags: unused
>   *
>   * Write ring commands to execute the indirect buffer
>   */
> --
> 2.25.1
>
> ___
> 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 19/40] drm/amd/amdgpu/sdma_v3_0: Fix incorrect param doc-rot issue

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:1651: warning: Function parameter or 
> member 'ib' not described in 'sdma_v3_0_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:1651: warning: Excess function 
> parameter 'ring' description in 'sdma_v3_0_emit_copy_buffer'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c 
> b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> index 43410a7bccc25..8ca7fba9c035f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> @@ -1633,7 +1633,7 @@ static void sdma_v3_0_set_irq_funcs(struct 
> amdgpu_device *adev)
>  /**
>   * sdma_v3_0_emit_copy_buffer - copy buffer using the sDMA engine
>   *
> - * @ring: amdgpu_ring structure holding ring information
> + * @ib: indirect buffer to copy to
>   * @src_offset: src GPU address
>   * @dst_offset: dst GPU address
>   * @byte_count: number of bytes to xfer
> --
> 2.25.1
>
> ___
> 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 18/40] drm/amd/amdgpu/sdma_v3_0: Fix a bunch of kernel-doc function documentation issues

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:44 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:428: warning: Function parameter or 
> member 'job' not described in 'sdma_v3_0_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:428: warning: Function parameter or 
> member 'flags' not described in 'sdma_v3_0_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:484: warning: Function parameter or 
> member 'addr' not described in 'sdma_v3_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:484: warning: Function parameter or 
> member 'seq' not described in 'sdma_v3_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:484: warning: Function parameter or 
> member 'flags' not described in 'sdma_v3_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:484: warning: Excess function 
> parameter 'fence' description in 'sdma_v3_0_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:870: warning: Function parameter or 
> member 'timeout' not described in 'sdma_v3_0_ring_test_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:1018: warning: Function parameter or 
> member 'ring' not described in 'sdma_v3_0_ring_pad_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:1070: warning: Function parameter or 
> member 'vmid' not described in 'sdma_v3_0_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:1070: warning: Function parameter or 
> member 'pd_addr' not described in 'sdma_v3_0_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:1070: warning: Excess function 
> parameter 'vm' description in 'sdma_v3_0_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:1643: warning: Function parameter or 
> member 'ib' not described in 'sdma_v3_0_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:1643: warning: Function parameter or 
> member 'tmz' not described in 'sdma_v3_0_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:1643: warning: Excess function 
> parameter 'ring' description in 'sdma_v3_0_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:1668: warning: Function parameter or 
> member 'ib' not described in 'sdma_v3_0_emit_fill_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c:1668: warning: Excess function 
> parameter 'ring' description in 'sdma_v3_0_emit_fill_buffer'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied with minor fixes.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 14 +++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c 
> b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> index c59f6f6f4c091..43410a7bccc25 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> @@ -417,7 +417,9 @@ static void sdma_v3_0_ring_insert_nop(struct amdgpu_ring 
> *ring, uint32_t count)
>   * sdma_v3_0_ring_emit_ib - Schedule an IB on the DMA engine
>   *
>   * @ring: amdgpu ring pointer
> + * @job: job to retrive vmid from
>   * @ib: IB object to schedule
> + * @flags: unused
>   *
>   * Schedule an IB in the DMA ring (VI).
>   */
> @@ -473,7 +475,9 @@ static void sdma_v3_0_ring_emit_hdp_flush(struct 
> amdgpu_ring *ring)
>   * sdma_v3_0_ring_emit_fence - emit a fence on the DMA ring
>   *
>   * @ring: amdgpu ring pointer
> - * @fence: amdgpu fence object
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Add a DMA fence packet to the ring to write
>   * the fence seq number and DMA trap packet to generate
> @@ -862,6 +866,7 @@ static int sdma_v3_0_ring_test_ring(struct amdgpu_ring 
> *ring)
>   * sdma_v3_0_ring_test_ib - test an IB on the DMA engine
>   *
>   * @ring: amdgpu_ring structure holding ring information
> + * @timeout: timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT
>   *
>   * Test a simple IB in the DMA ring (VI).
>   * Returns 0 on success, error on failure.
> @@ -1011,6 +1016,7 @@ static void sdma_v3_0_vm_set_pte_pde(struct amdgpu_ib 
> *ib, uint64_t pe,
>  /**
>   * sdma_v3_0_ring_pad_ib - pad the IB to the required number of dw
>   *
> + * @ring: amdgpu_ring structure holding ring information
>   * @ib: indirect buffer to fill with padding
>   *
>   */
> @@ -1060,7 +1066,8 @@ static void sdma_v3_0_ring_emit_pipeline_sync(struct 
> amdgpu_ring *ring)
>   * sdma_v3_0_ring_emit_vm_flush - cik vm flush using sDMA
>   *
>   * @ring: amdgpu_ring pointer
> - * @vm: amdgpu_vm pointer
> + * @vmid: vmid number to use
> + * @pd_addr: address
>   *
>   * Update the page table base and flush the VM TLB
>   * using sDMA (VI).
> @@ -1630,6 +1637,7 @@ static void sdma_v3_0_set_irq_funcs(struct 
> amdgpu_device *adev)
>   * @src_offset: src GPU address
>   * @dst_offset: dst GPU 

Re: [PATCH 17/40] drm/amd/amdgpu/sdma_v2_4: Fix a bunch of kernel-doc function documentation issues

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:254: warning: Function parameter or 
> member 'job' not described in 'sdma_v2_4_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:254: warning: Function parameter or 
> member 'flags' not described in 'sdma_v2_4_ring_emit_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:310: warning: Function parameter or 
> member 'addr' not described in 'sdma_v2_4_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:310: warning: Function parameter or 
> member 'seq' not described in 'sdma_v2_4_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:310: warning: Function parameter or 
> member 'flags' not described in 'sdma_v2_4_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:310: warning: Excess function 
> parameter 'fence' description in 'sdma_v2_4_ring_emit_fence'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:598: warning: Function parameter or 
> member 'timeout' not described in 'sdma_v2_4_ring_test_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:747: warning: Function parameter or 
> member 'ring' not described in 'sdma_v2_4_ring_pad_ib'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:799: warning: Function parameter or 
> member 'vmid' not described in 'sdma_v2_4_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:799: warning: Function parameter or 
> member 'pd_addr' not described in 'sdma_v2_4_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:799: warning: Excess function 
> parameter 'vm' description in 'sdma_v2_4_ring_emit_vm_flush'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:1205: warning: Function parameter or 
> member 'ib' not described in 'sdma_v2_4_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:1205: warning: Function parameter or 
> member 'tmz' not described in 'sdma_v2_4_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:1205: warning: Excess function 
> parameter 'ring' description in 'sdma_v2_4_emit_copy_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:1230: warning: Function parameter or 
> member 'ib' not described in 'sdma_v2_4_emit_fill_buffer'
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c:1230: warning: Excess function 
> parameter 'ring' description in 'sdma_v2_4_emit_fill_buffer'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied with minor changes.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 16 
>  1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c 
> b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> index 5f304d61999eb..22e9e4fe561d9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> @@ -243,7 +243,9 @@ static void sdma_v2_4_ring_insert_nop(struct amdgpu_ring 
> *ring, uint32_t count)
>   * sdma_v2_4_ring_emit_ib - Schedule an IB on the DMA engine
>   *
>   * @ring: amdgpu ring pointer
> + * @job: job to retrive vmid from
>   * @ib: IB object to schedule
> + * @flags: unused
>   *
>   * Schedule an IB in the DMA ring (VI).
>   */
> @@ -299,7 +301,9 @@ static void sdma_v2_4_ring_emit_hdp_flush(struct 
> amdgpu_ring *ring)
>   * sdma_v2_4_ring_emit_fence - emit a fence on the DMA ring
>   *
>   * @ring: amdgpu ring pointer
> - * @fence: amdgpu fence object
> + * @addr: address
> + * @seq: sequence number
> + * @flags: fence related flags
>   *
>   * Add a DMA fence packet to the ring to write
>   * the fence seq number and DMA trap packet to generate
> @@ -590,6 +594,7 @@ static int sdma_v2_4_ring_test_ring(struct amdgpu_ring 
> *ring)
>   * sdma_v2_4_ring_test_ib - test an IB on the DMA engine
>   *
>   * @ring: amdgpu_ring structure holding ring information
> + * @timeout: timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT
>   *
>   * Test a simple IB in the DMA ring (VI).
>   * Returns 0 on success, error on failure.
> @@ -740,6 +745,7 @@ static void sdma_v2_4_vm_set_pte_pde(struct amdgpu_ib 
> *ib, uint64_t pe,
>  /**
>   * sdma_v2_4_ring_pad_ib - pad the IB to the required number of dw
>   *
> + * @ring: amdgpu_ring structure holding ring information
>   * @ib: indirect buffer to fill with padding
>   *
>   */
> @@ -789,7 +795,8 @@ static void sdma_v2_4_ring_emit_pipeline_sync(struct 
> amdgpu_ring *ring)
>   * sdma_v2_4_ring_emit_vm_flush - cik vm flush using sDMA
>   *
>   * @ring: amdgpu_ring pointer
> - * @vm: amdgpu_vm pointer
> + * @vmid: vmid number to use
> + * @pd_addr: address
>   *
>   * Update the page table base and flush the VM TLB
>   * using sDMA (VI).
> @@ -1188,10 +1195,11 @@ static void sdma_v2_4_set_irq_funcs(struct 
> amdgpu_device *adev)
>  /**
>   * sdma_v2_4_emit_copy_buffer - copy buffer using the 

Re: [PATCH 16/40] drm/amd/amdgpu/gfx_v10_0: Remove a bunch of set but unused variables

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:44 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c: In function ‘gfx_v10_rlcg_wreg’:
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:1416:18: warning: variable ‘grbm_idx’ 
> set but not used [-Wunused-but-set-variable]
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:1415:18: warning: variable 
> ‘grbm_cntl’ set but not used [-Wunused-but-set-variable]
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:1413:15: warning: variable 
> ‘scratch_reg3’ set but not used [-Wunused-but-set-variable]
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:1412:15: warning: variable 
> ‘scratch_reg2’ set but not used [-Wunused-but-set-variable]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 9 -
>  1 file changed, 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> index a6d03931f7fa4..d4760f4e269a1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> @@ -1409,23 +1409,14 @@ static void gfx_v10_rlcg_wreg(struct amdgpu_device 
> *adev, u32 offset, u32 v)
>  {
> static void *scratch_reg0;
> static void *scratch_reg1;
> -   static void *scratch_reg2;
> -   static void *scratch_reg3;
> static void *spare_int;
> -   static uint32_t grbm_cntl;
> -   static uint32_t grbm_idx;
> uint32_t i = 0;
> uint32_t retries = 5;
>
> scratch_reg0 = adev->rmmio + 
> (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG0_BASE_IDX] + mmSCRATCH_REG0)*4;
> scratch_reg1 = adev->rmmio + 
> (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG1_BASE_IDX] + mmSCRATCH_REG1)*4;
> -   scratch_reg2 = adev->rmmio + 
> (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG1_BASE_IDX] + mmSCRATCH_REG2)*4;
> -   scratch_reg3 = adev->rmmio + 
> (adev->reg_offset[GC_HWIP][0][mmSCRATCH_REG1_BASE_IDX] + mmSCRATCH_REG3)*4;
> spare_int = adev->rmmio + 
> (adev->reg_offset[GC_HWIP][0][mmRLC_SPARE_INT_BASE_IDX] + mmRLC_SPARE_INT)*4;
>
> -   grbm_cntl = adev->reg_offset[GC_HWIP][0][mmGRBM_GFX_CNTL_BASE_IDX] + 
> mmGRBM_GFX_CNTL;
> -   grbm_idx = adev->reg_offset[GC_HWIP][0][mmGRBM_GFX_INDEX_BASE_IDX] + 
> mmGRBM_GFX_INDEX;
> -
> if (amdgpu_sriov_runtime(adev)) {
> pr_err("shouldn't call rlcg write register during runtime\n");
> return;
> --
> 2.25.1
>
> ___
> 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] drm/kmb: fix array bounds warning

2020-11-30 Thread Chrisanthus, Anitha
Hi Arnd,
Thanks for your patch.

> -Original Message-
> From: Arnd Bergmann 
> Sent: Sunday, November 29, 2020 12:09 PM
> To: Chrisanthus, Anitha ; Dea, Edmund J
> ; David Airlie ; Daniel Vetter
> ; Sam Ravnborg 
> Cc: Arnd Bergmann ; lkp ; dri-
> de...@lists.freedesktop.org; linux-ker...@vger.kernel.org
> Subject: [PATCH] drm/kmb: fix array bounds warning
> 
> From: Arnd Bergmann 
> 
> gcc warns about an out-of-bounds access when the using nonzero
> values for 'plane_id' on kmb->plane_status:
> 
> drivers/gpu/drm/kmb/kmb_plane.c: In function 'kmb_plane_atomic_disable':
> drivers/gpu/drm/kmb/kmb_plane.c:128:20: warning: array subscript 3 is
> above array bounds of 'struct layer_status[1]' [-Warray-bounds]
>   128 |   kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL2_ENABLE;
>   |   ~^~
> drivers/gpu/drm/kmb/kmb_plane.c:125:20: warning: array subscript 2 is
> above array bounds of 'struct layer_status[1]' [-Warray-bounds]
>   125 |   kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL1_ENABLE;
>   |   ~^~
> drivers/gpu/drm/kmb/kmb_plane.c:122:20: warning: array subscript 1 is
> above array bounds of 'struct layer_status[1]' [-Warray-bounds]
>   122 |   kmb->plane_status[plane_id].ctrl = LCD_CTRL_VL2_ENABLE;
> 
> Having the array truncated to one entry seems intentional, so add
> a range check before indexing it to make it clearer what is going
> on and shut up the warning.
> 
> I received the warning from the kernel test robot after a private
> patch that turns on Warray-bounds unconditionally.
> 
> Fixes: 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display")
> Reported-by: kernel test robot 
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/gpu/drm/kmb/kmb_plane.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/kmb/kmb_plane.c
> b/drivers/gpu/drm/kmb/kmb_plane.c
> index 8448d1edb553..be8eea3830c1 100644
> --- a/drivers/gpu/drm/kmb/kmb_plane.c
> +++ b/drivers/gpu/drm/kmb/kmb_plane.c
> @@ -114,6 +114,9 @@ static void kmb_plane_atomic_disable(struct
> drm_plane *plane,
> 
>   kmb = to_kmb(plane->dev);
> 
> + if (WARN_ON(plane_id >= KMB_MAX_PLANES))
> + return;
> +
Looks good.

Reviewed-by: Anitha Chrisanthus 
>   switch (plane_id) {
>   case LAYER_0:
>   kmb->plane_status[plane_id].ctrl = LCD_CTRL_VL1_ENABLE;
> --
> 2.27.0

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


Re: [PATCH 15/40] drm/amd/amdgpu/gfx_v8_0: Functions must follow directly after their headers

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:44 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3698: warning: Excess function 
> parameter 'adev' description in 'DEFAULT_SH_MEM_BASES'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index 5e6d15f44560a..9a905531f8377 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -3687,6 +3687,7 @@ static void gfx_v8_0_setup_rb(struct amdgpu_device 
> *adev)
> mutex_unlock(>grbm_idx_mutex);
>  }
>
> +#define DEFAULT_SH_MEM_BASES   (0x6000)
>  /**
>   * gfx_v8_0_init_compute_vmid - gart enable
>   *
> @@ -3695,7 +3696,6 @@ static void gfx_v8_0_setup_rb(struct amdgpu_device 
> *adev)
>   * Initialize compute vmid sh_mem registers
>   *
>   */
> -#define DEFAULT_SH_MEM_BASES   (0x6000)
>  static void gfx_v8_0_init_compute_vmid(struct amdgpu_device *adev)
>  {
> int i;
> --
> 2.25.1
>
> ___
> 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 14/40] drm/amd/amdgpu/gfx_v9_0: Make called-by-reference only function static

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:2998:6: warning: no previous prototype 
> for ‘gfx_v9_0_rlc_stop’ [-Wmissing-prototypes]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index 8a6c050cb6caf..eae81fc412556 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -2995,7 +2995,7 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev)
> }
>  }
>
> -void gfx_v9_0_rlc_stop(struct amdgpu_device *adev)
> +static void gfx_v9_0_rlc_stop(struct amdgpu_device *adev)
>  {
> WREG32_FIELD15(GC, 0, RLC_CNTL, RLC_ENABLE_F32, 0);
> gfx_v9_0_enable_gui_idle_interrupt(adev, false);
> --
> 2.25.1
>
> ___
> 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 13/40] drm/amd/amdgpu/dce_v11_0: Supply description for function param 'async'

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:44 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/dce_v11_0.c:255: warning: Function parameter or 
> member 'async' not described in 'dce_v11_0_page_flip'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Luben Tuikov 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c 
> b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> index c62c56a69fda6..1b6ff04700118 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> @@ -246,6 +246,7 @@ static void dce_v11_0_pageflip_interrupt_fini(struct 
> amdgpu_device *adev)
>   * @adev: amdgpu_device pointer
>   * @crtc_id: crtc to cleanup pageflip on
>   * @crtc_base: new address of the crtc (GPU MC address)
> + * @async: asynchronous flip
>   *
>   * Triggers the actual pageflip by updating the primary
>   * surface base address.
> --
> 2.25.1
>
> ___
> 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 12/40] drm/amd/amdgpu/dce_v10_0: Supply description for function param 'async'

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/dce_v10_0.c:237: warning: Function parameter or 
> member 'async' not described in 'dce_v10_0_page_flip'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Luben Tuikov 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c 
> b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> index da240f8fafcf8..7944781e1086b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> @@ -228,6 +228,7 @@ static void dce_v10_0_pageflip_interrupt_fini(struct 
> amdgpu_device *adev)
>   * @adev: amdgpu_device pointer
>   * @crtc_id: crtc to cleanup pageflip on
>   * @crtc_base: new address of the crtc (GPU MC address)
> + * @async: asynchronous flip
>   *
>   * Triggers the actual pageflip by updating the primary
>   * surface base address.
> --
> 2.25.1
>
> ___
> 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 11/40] drm/amd/amdgpu/psp_v11_0: Make local function 'psp_v11_0_wait_for_bootloader()' static

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:45 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/psp_v11_0.c:223:5: warning: no previous prototype 
> for ‘psp_v11_0_wait_for_bootloader’ [-Wmissing-prototypes]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Hawking Zhang 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c 
> b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> index edd2d6bd1d86a..bd4248c93c49f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> @@ -220,7 +220,7 @@ static int psp_v11_0_init_microcode(struct psp_context 
> *psp)
> return err;
>  }
>
> -int psp_v11_0_wait_for_bootloader(struct psp_context *psp)
> +static int psp_v11_0_wait_for_bootloader(struct psp_context *psp)
>  {
> struct amdgpu_device *adev = psp->adev;
>
> --
> 2.25.1
>
> ___
> 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 10/40] drm/amd/amdgpu/navi10_ih: Add descriptions for 'ih' and 'entry'

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:44 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/navi10_ih.c:453: warning: Function parameter or 
> member 'ih' not described in 'navi10_ih_get_wptr'
>  drivers/gpu/drm/amd/amdgpu/navi10_ih.c:512: warning: Function parameter or 
> member 'ih' not described in 'navi10_ih_decode_iv'
>  drivers/gpu/drm/amd/amdgpu/navi10_ih.c:512: warning: Function parameter or 
> member 'entry' not described in 'navi10_ih_decode_iv'
>  drivers/gpu/drm/amd/amdgpu/navi10_ih.c:552: warning: Function parameter or 
> member 'ih' not described in 'navi10_ih_irq_rearm'
>  drivers/gpu/drm/amd/amdgpu/navi10_ih.c:585: warning: Function parameter or 
> member 'ih' not described in 'navi10_ih_set_rptr'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Alex Sierra 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c 
> b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> index 837769fcb35b7..3338052b080b6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> @@ -442,6 +442,7 @@ static void navi10_ih_irq_disable(struct amdgpu_device 
> *adev)
>   * navi10_ih_get_wptr - get the IH ring buffer wptr
>   *
>   * @adev: amdgpu_device pointer
> + * @ih: IH ring buffer to fetch wptr
>   *
>   * Get the IH ring buffer wptr from either the register
>   * or the writeback memory buffer (NAVI10).  Also check for
> @@ -502,6 +503,8 @@ static u32 navi10_ih_get_wptr(struct amdgpu_device *adev,
>   * navi10_ih_decode_iv - decode an interrupt vector
>   *
>   * @adev: amdgpu_device pointer
> + * @ih: IH ring buffer to decode
> + * @entry: IV entry to place decoded information into
>   *
>   * Decodes the interrupt vector at the current rptr
>   * position and also advance the position.
> @@ -545,6 +548,7 @@ static void navi10_ih_decode_iv(struct amdgpu_device 
> *adev,
>   * navi10_ih_irq_rearm - rearm IRQ if lost
>   *
>   * @adev: amdgpu_device pointer
> + * @ih: IH ring to match
>   *
>   */
>  static void navi10_ih_irq_rearm(struct amdgpu_device *adev,
> @@ -578,6 +582,7 @@ static void navi10_ih_irq_rearm(struct amdgpu_device 
> *adev,
>   *
>   * @adev: amdgpu_device pointer
>   *
> + * @ih: IH ring buffer to set rptr
>   * Set the IH ring buffer rptr.
>   */
>  static void navi10_ih_set_rptr(struct amdgpu_device *adev,
> --
> 2.25.1
>
> ___
> 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 09/40] drm/amd/amdgpu/vega10_ih: Add descriptions for 'ih' and 'entry'

2020-11-30 Thread Alex Deucher
On Tue, Nov 24, 2020 at 2:44 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/vega10_ih.c:377: warning: Function parameter or 
> member 'ih' not described in 'vega10_ih_get_wptr'
>  drivers/gpu/drm/amd/amdgpu/vega10_ih.c:440: warning: Function parameter or 
> member 'ih' not described in 'vega10_ih_decode_iv'
>  drivers/gpu/drm/amd/amdgpu/vega10_ih.c:440: warning: Function parameter or 
> member 'entry' not described in 'vega10_ih_decode_iv'
>  drivers/gpu/drm/amd/amdgpu/vega10_ih.c:480: warning: Function parameter or 
> member 'ih' not described in 'vega10_ih_irq_rearm'
>  drivers/gpu/drm/amd/amdgpu/vega10_ih.c:513: warning: Function parameter or 
> member 'ih' not described in 'vega10_ih_set_rptr'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Zhigang Luo 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c 
> b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> index 407c6093c2ec0..578fdee5b9758 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> @@ -366,6 +366,7 @@ static void vega10_ih_irq_disable(struct amdgpu_device 
> *adev)
>   * vega10_ih_get_wptr - get the IH ring buffer wptr
>   *
>   * @adev: amdgpu_device pointer
> + * @ih: IH ring buffer to fetch wptr
>   *
>   * Get the IH ring buffer wptr from either the register
>   * or the writeback memory buffer (VEGA10).  Also check for
> @@ -430,6 +431,8 @@ static u32 vega10_ih_get_wptr(struct amdgpu_device *adev,
>   * vega10_ih_decode_iv - decode an interrupt vector
>   *
>   * @adev: amdgpu_device pointer
> + * @ih: IH ring buffer to decode
> + * @entry: IV entry to place decoded information into
>   *
>   * Decodes the interrupt vector at the current rptr
>   * position and also advance the position.
> @@ -473,6 +476,7 @@ static void vega10_ih_decode_iv(struct amdgpu_device 
> *adev,
>   * vega10_ih_irq_rearm - rearm IRQ if lost
>   *
>   * @adev: amdgpu_device pointer
> + * @ih: IH ring to match
>   *
>   */
>  static void vega10_ih_irq_rearm(struct amdgpu_device *adev,
> @@ -505,6 +509,7 @@ static void vega10_ih_irq_rearm(struct amdgpu_device 
> *adev,
>   * vega10_ih_set_rptr - set the IH ring buffer rptr
>   *
>   * @adev: amdgpu_device pointer
> + * @ih: IH ring buffer to set rptr
>   *
>   * Set the IH ring buffer rptr.
>   */
> --
> 2.25.1
>
> ___
> 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


  1   2   3   >