[PATCH] drm/nouveau/mc/ga100: make ga100_mc_device static

2022-12-31 Thread Ben Dooks
Make ga100_mc_device static as it isn't exported, to
fix the following sparse warning:

drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c:51:1: warning: symbol 
'ga100_mc_device' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c
index 1e2eabec1a76..5d28d30d09d5 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c
@@ -47,7 +47,7 @@ ga100_mc_device_enabled(struct nvkm_mc *mc, u32 mask)
return (nvkm_rd32(mc->subdev.device, 0x000600) & mask) == mask;
 }
 
-const struct nvkm_mc_device_func
+static const struct nvkm_mc_device_func
 ga100_mc_device = {
.enabled = ga100_mc_device_enabled,
.enable = ga100_mc_device_enable,
-- 
2.39.0



[PATCH] drm/nouveau/acr: make wpr_generic_header_dump static

2022-12-31 Thread Ben Dooks
Make wpr_generic_header_dump static to avoid the
following sparse warning:

drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c:49:1: warning: symbol 
'wpr_generic_header_dump' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c 
b/drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c
index 83a9c48bc58c..7ac90c495737 100644
--- a/drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c
+++ b/drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c
@@ -45,7 +45,7 @@ wpr_header_v1_dump(struct nvkm_subdev *subdev, const struct 
wpr_header_v1 *hdr)
nvkm_debug(subdev, "\tstatus: %d\n", hdr->status);
 }
 
-void
+static void
 wpr_generic_header_dump(struct nvkm_subdev *subdev, const struct 
wpr_generic_header *hdr)
 {
nvkm_debug(subdev, "wprGenericHeader\n");
-- 
2.39.0



[PATCH] drm/nouveau/fifo: make gf100_fifo_nonstall_block static

2022-12-31 Thread Ben Dooks
Make gf100_fifo_nonstall_block as it isn't exported, to
silence the following sparse warning:

drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c:451:1: warning: symbol 
'gf100_fifo_nonstall_block' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
index 5bb65258c36d..6c94451d0faa 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
@@ -447,7 +447,7 @@ gf100_fifo_nonstall_allow(struct nvkm_event *event, int 
type, int index)
spin_unlock_irqrestore(>lock, flags);
 }
 
-void
+static void
 gf100_fifo_nonstall_block(struct nvkm_event *event, int type, int index)
 {
struct nvkm_fifo *fifo = container_of(event, typeof(*fifo), 
nonstall.event);
-- 
2.39.0



[PATCH] drm/nouveau/acr/ga102: make ga102_gsps static (not exported)

2022-12-31 Thread Ben Dooks
The ga102_gsps is not exported, so make it static to avoid the
following sparse warning:

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c:49:1: warning: symbol 
'ga102_gsps' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c
index 525267412c3e..a3996ceca995 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c
@@ -45,7 +45,7 @@ ga102_gsp_nofw(struct nvkm_gsp *gsp, int ver, const struct 
nvkm_gsp_fwif *fwif)
return 0;
 }
 
-struct nvkm_gsp_fwif
+static struct nvkm_gsp_fwif
 ga102_gsps[] = {
{ -1, ga102_gsp_nofw, _gsp },
{}
-- 
2.39.0



Re: [PATCH v5 03/13] dt-bindings: dma: dw-axi-dmac: extend the number of interrupts

2022-07-19 Thread Ben Dooks

On 05/07/2022 22:52, Conor Dooley wrote:

From: Conor Dooley 

The Canaan k210 apparently has a Sysnopsys Designware AXI DMA
controller, but according to the documentation & devicetree it has 6
interrupts rather than the standard one. Support the 6 interrupt
configuration by unconditionally extending the binding to a maximum of
8 per-channel interrupts thereby matching the number of possible
channels.


I think you can still configure it to produce a single interrupt
even if there are per-channel interrupts available. This is from
my reading of the driver a little while ago so may not be totally
correct now.

Having per-channel irqs might be useful in the future, but as above
I think it'll require the driver to be updated to do it (and possibly
some sort of detection)



Link: 
https://canaan-creative.com/wp-content/uploads/2020/03/kendryte_standalone_programming_guide_20190311144158_en.pdf
 #Page 51
Reviewed-by: Serge Semin 
Reviewed-by: Rob Herring 
Signed-off-by: Conor Dooley 
---
  .../devicetree/bindings/dma/snps,dw-axi-dmac.yaml  | 7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml 
b/Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml
index 4324a94b26b2..67aa7bb6d36a 100644
--- a/Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml
+++ b/Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml
@@ -34,7 +34,12 @@ properties:
- const: axidma_apb_regs
  
interrupts:

-maxItems: 1
+description:
+  If the IP-core synthesis parameter DMAX_INTR_IO_TYPE is set to 1, this
+  will be per-channel interrupts. Otherwise, this is a single combined IRQ
+  for all channels.
+minItems: 1
+maxItems: 8
  
clocks:

  items:



--
Ben Dooks   http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html


[PATCH] drm/arm/mali: make malidp_mw_connector_helper_funcs static

2019-12-18 Thread Ben Dooks (Codethink)
The malidp_mw_connector_helper_funcs is not referenced by name
outside of the file it is in, so make it static to avoid the
following warning:

drivers/gpu/drm/arm/malidp_mw.c:59:41: warning: symbol 
'malidp_mw_connector_helper_funcs' was not declared. Should it be static?

Signed-off-by: Ben Dooks (Codethink) 
---
Cc: Liviu Dudau 
Cc: Brian Starkey 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/arm/malidp_mw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/arm/malidp_mw.c
index 875a3a9eabfa..7d0e7b031e44 100644
--- a/drivers/gpu/drm/arm/malidp_mw.c
+++ b/drivers/gpu/drm/arm/malidp_mw.c
@@ -56,7 +56,7 @@ malidp_mw_connector_mode_valid(struct drm_connector 
*connector,
return MODE_OK;
 }
 
-const struct drm_connector_helper_funcs malidp_mw_connector_helper_funcs = {
+static const struct drm_connector_helper_funcs 
malidp_mw_connector_helper_funcs = {
.get_modes = malidp_mw_connector_get_modes,
.mode_valid = malidp_mw_connector_mode_valid,
 };
-- 
2.24.0

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


[PATCH] drm/armada: make armada_overlay_duplicate_state static

2019-10-18 Thread Ben Dooks (Codethink)
The armada_overlay_duplicate_state is not declared outside
the unit, so make it static to avoid the following sparse
warning:

drivers/gpu/drm/armada/armada_overlay.c:328:24: warning: symbol 
'armada_overlay_duplicate_state' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Russell King 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/armada/armada_overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/armada/armada_overlay.c 
b/drivers/gpu/drm/armada/armada_overlay.c
index 07f0da4d9ba1..b3e942121fd7 100644
--- a/drivers/gpu/drm/armada/armada_overlay.c
+++ b/drivers/gpu/drm/armada/armada_overlay.c
@@ -325,7 +325,7 @@ static void armada_overlay_reset(struct drm_plane *plane)
}
 }
 
-struct drm_plane_state *
+static struct drm_plane_state *
 armada_overlay_duplicate_state(struct drm_plane *plane)
 {
struct armada_overlay_state *state;
-- 
2.23.0

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

[PATCH] gpu: host1x: make 'host1x_cdma_wait_pushbuffer_space' static

2019-10-18 Thread Ben Dooks (Codethink)
The host1x_cdma_wait_pushbuffer_space function is not declared
or directly called from outside the file it is in, so make it
static.

Fixes the following sparse warnign:
drivers/gpu/host1x/cdma.c:235:5: warning: symbol 
'host1x_cdma_wait_pushbuffer_space' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Thierry Reding 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-te...@vger.kernel.org
---
 drivers/gpu/host1x/cdma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c
index 48c84c48299c..e8d3fda91d8a 100644
--- a/drivers/gpu/host1x/cdma.c
+++ b/drivers/gpu/host1x/cdma.c
@@ -232,9 +232,9 @@ unsigned int host1x_cdma_wait_locked(struct host1x_cdma 
*cdma,
  *
  * Must be called with the cdma lock held.
  */
-int host1x_cdma_wait_pushbuffer_space(struct host1x *host1x,
- struct host1x_cdma *cdma,
- unsigned int needed)
+static int host1x_cdma_wait_pushbuffer_space(struct host1x *host1x,
+struct host1x_cdma *cdma,
+unsigned int needed)
 {
while (true) {
struct push_buffer *pb = >push_buffer;
-- 
2.23.0

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

[PATCH] drm: include for 'drm_need_swiotlb'

2019-10-18 Thread Ben Dooks (Codethink)
The drm_need_swiotlb is declared in 
which should be included in drivers/gpu/drm/drm_memory.c
to silence the following warning:

drivers/gpu/drm/drm_memory.c:159:6: warning: symbol 'drm_need_swiotlb' was not 
declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/drm_memory.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
index 0bec6dbb0142..2d8615baeadc 100644
--- a/drivers/gpu/drm/drm_memory.c
+++ b/drivers/gpu/drm/drm_memory.c
@@ -41,6 +41,7 @@
 
 #include 
 #include 
+#include 
 
 #include "drm_legacy.h"
 
-- 
2.23.0

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

[PATCH] drm/arm: make undeclared items static

2019-10-17 Thread Ben Dooks (Codethink)
Make the following items static to avoid clashes with
other parts of the kernel (dev_attr_core_id) or just
silence the following sparse warning:

drivers/gpu/drm/arm/malidp_drv.c:371:24: warning: symbol 'malidp_fb_create' was 
not declared. Should it be static?
drivers/gpu/drm/arm/malidp_drv.c:494:6: warning: symbol 
'malidp_error_stats_dump' was not declared. Should it be static?
drivers/gpu/drm/arm/malidp_drv.c:668:1: warning: symbol 'dev_attr_core_id' was 
not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Liviu Dudau 
Cc: Brian Starkey 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: mal...@foss.arm.com
Cc: dri-devel@lists.freedesktop.org
Cc: linux-ker...@vger.kernel.org
.. (open list)
---
 drivers/gpu/drm/arm/malidp_drv.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index 333b88a5efb0..18ca43c9cef4 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -368,7 +368,7 @@ malidp_verify_afbc_framebuffer(struct drm_device *dev, 
struct drm_file *file,
return false;
 }
 
-struct drm_framebuffer *
+static struct drm_framebuffer *
 malidp_fb_create(struct drm_device *dev, struct drm_file *file,
 const struct drm_mode_fb_cmd2 *mode_cmd)
 {
@@ -491,9 +491,9 @@ void malidp_error(struct malidp_drm *malidp,
spin_unlock_irqrestore(>errors_lock, irqflags);
 }
 
-void malidp_error_stats_dump(const char *prefix,
-struct malidp_error_stats error_stats,
-struct seq_file *m)
+static void malidp_error_stats_dump(const char *prefix,
+   struct malidp_error_stats error_stats,
+   struct seq_file *m)
 {
seq_printf(m, "[%s] num_errors : %d\n", prefix,
   error_stats.num_errors);
@@ -665,7 +665,7 @@ static ssize_t core_id_show(struct device *dev, struct 
device_attribute *attr,
return snprintf(buf, PAGE_SIZE, "%08x\n", malidp->core_id);
 }
 
-DEVICE_ATTR_RO(core_id);
+static DEVICE_ATTR_RO(core_id);
 
 static int malidp_init_sysfs(struct device *dev)
 {
-- 
2.23.0



[PATCH] drm: include for missing declarations

2019-10-15 Thread Ben Dooks
Include  to get the definitions of
drm_fb_cma_get_gem_{addr,obj} functions to fix the following
sparse warnings:

drivers/gpu/drm/drm_fb_cma_helper.c:38:27: warning: symbol 
'drm_fb_cma_get_gem_obj' was not declared. Should it be static?
drivers/gpu/drm/drm_fb_cma_helper.c:62:12: warning: symbol 
'drm_fb_cma_get_gem_addr' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/gpu/drm/drm_fb_cma_helper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c 
b/drivers/gpu/drm/drm_fb_cma_helper.c
index c0b0f603af63..f4967cf14f99 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.23.0

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

[PATCH] drm/syncobj: include for drm_timeout_abs_to_jiffies

2019-10-15 Thread Ben Dooks (Codethink)
Include  for drm_timeout_abs_to_jiffies
definiton to fix the following sparse warning:

drivers/gpu/drm/drm_syncobj.c:1019:13: warning: symbol 
'drm_timeout_abs_to_jiffies' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/gpu/drm/drm_syncobj.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index 4b5c7b0ed714..9ec334663c2d 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -135,6 +135,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "drm_internal.h"
 
-- 
2.23.0



[PATCH] drm/nouveau/hwmon: fix use of integer as a pointer

2019-10-15 Thread Ben Dooks
The special_groups[] in nouveau_hwmon_init() is an
array of pointers, so use NULL instead of '0' as
the initialiser.

Fixes the following sparse warning:

drivers/gpu/drm/nouveau/nouveau_hwmon.c:744:29: warning: Using plain integer as 
NULL pointer

Signed-off-by: Ben Dooks 
---
Cc: Ben Skeggs 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Cc: nouv...@lists.freedesktop.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/gpu/drm/nouveau/nouveau_hwmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c 
b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
index d445c6f3fece..1c3104d20571 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
@@ -741,7 +741,7 @@ nouveau_hwmon_init(struct drm_device *dev)
special_groups[i++] = _fan_sensor_group;
}
 
-   special_groups[i] = 0;
+   special_groups[i] = NULL;
hwmon_dev = hwmon_device_register_with_info(dev->dev, "nouveau", dev,
_chip_info,
special_groups);
-- 
2.23.0



[PATCH] drm/nouveau/disp/gv100: make gv100_disp_core_mthd_{base,sor} static

2019-10-15 Thread Ben Dooks
The gv100_disp_core_mthd_{base,sor} are not used outside
of the file they are defined in, so make them static to
avoid the following sparse warning:

drivers/gpu/drm/nouveau/nvkm/engine/disp/coregv100.c:27:1: warning: symbol 
'gv100_disp_core_mthd_base' was not declared. Should it be static?
drivers/gpu/drm/nouveau/nvkm/engine/disp/coregv100.c:43:1: warning: symbol 
'gv100_disp_core_mthd_sor' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Bad divisor in main::vcs_assign: 0
Cc: Ben Skeggs 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Cc: nouv...@lists.freedesktop.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/gpu/drm/nouveau/nvkm/engine/disp/coregv100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregv100.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregv100.c
index 4592d0e69fec..9594ba732113 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregv100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregv100.c
@@ -23,7 +23,7 @@
 
 #include 
 
-const struct nv50_disp_mthd_list
+static const struct nv50_disp_mthd_list
 gv100_disp_core_mthd_base = {
.mthd = 0x,
.addr = 0x00,
@@ -39,7 +39,7 @@ gv100_disp_core_mthd_base = {
}
 };
 
-const struct nv50_disp_mthd_list
+static const struct nv50_disp_mthd_list
 gv100_disp_core_mthd_sor = {
.mthd = 0x0020,
.addr = 0x20,
-- 
2.23.0



Re: [PATCH] drm/scheduler: make unexported items static

2019-10-11 Thread Ben Dooks

On 09/10/2019 13:14, Ben Dooks wrote:

The drm_sched_fence_ops_{scheduled,finished} are not exported
from the file so make them static to avoid the following
warnings from sparse:

drivers/gpu/drm/scheduler/sched_fence.c:131:28: warning: symbol 
'drm_sched_fence_ops_scheduled' was not declared. Should it be static?
drivers/gpu/drm/scheduler/sched_fence.c:137:28: warning: symbol 
'drm_sched_fence_ops_finished' was not declared. Should it be static?

Signed-off-by: Ben Dooks 


If it is useful I can get these into a public git repo and send
a pull request.

--
Ben Dooks   http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/msm: make a5xx_show and a5xx_gpu_state_put static

2019-10-10 Thread Ben Dooks
The a5xx_show and a5xx_gpu_state_put objects are not exported
outside of the file, so make them static to avoid the following
warnings from sparse:

drivers/gpu/drm/msm/adreno/a5xx_gpu.c:1292:5: warning: symbol 
'a5xx_gpu_state_put' was not declared. Should it be static?
drivers/gpu/drm/msm/adreno/a5xx_gpu.c:1302:6: warning: symbol 'a5xx_show' was 
not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Rob Clark 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: linux-arm-...@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: freedr...@lists.freedesktop.org
---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c 
b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index e9c55d1d6c04..7fdc9e2bcaac 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -1289,7 +1289,7 @@ static void a5xx_gpu_state_destroy(struct kref *kref)
kfree(a5xx_state);
 }
 
-int a5xx_gpu_state_put(struct msm_gpu_state *state)
+static int a5xx_gpu_state_put(struct msm_gpu_state *state)
 {
if (IS_ERR_OR_NULL(state))
return 1;
@@ -1299,8 +1299,8 @@ int a5xx_gpu_state_put(struct msm_gpu_state *state)
 
 
 #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
-void a5xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
-   struct drm_printer *p)
+static void a5xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
+ struct drm_printer *p)
 {
int i, j;
u32 pos = 0;
-- 
2.23.0

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

[PATCH] drm/rockchip: make rockchip_gem_alloc_object static

2019-10-10 Thread Ben Dooks
The rockchip_gem_alloc_object function is not exported so
make it static to avoid the following sparse warning:

drivers/gpu/drm/rockchip/rockchip_drm_gem.c:297:28: warning: symbol 
'rockchip_gem_alloc_object' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Sandy Huang 
Cc: "Heiko Stübner" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-rockc...@lists.infradead.org
---
 drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
index 291e89b4045f..7582d0e6a60a 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
@@ -294,7 +294,7 @@ static void rockchip_gem_release_object(struct 
rockchip_gem_object *rk_obj)
kfree(rk_obj);
 }
 
-struct rockchip_gem_object *
+static struct rockchip_gem_object *
rockchip_gem_alloc_object(struct drm_device *drm, unsigned int size)
 {
struct rockchip_gem_object *rk_obj;
-- 
2.23.0

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

[PATCH] drm/nouveau/core/client: make nvkm_uclient_sclass static

2019-10-10 Thread Ben Dooks
The nvkm_uclient_sclass object is not used outside the file
it is defined in, so make it static to avoid the following
sparse warning:

drivers/gpu/drm/nouveau/nvkm/core/client.c:64:1: warning: symbol 
'nvkm_uclient_sclass' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Ben Skeggs 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Cc: nouv...@lists.freedesktop.org
---
 drivers/gpu/drm/nouveau/nvkm/core/client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/core/client.c 
b/drivers/gpu/drm/nouveau/nvkm/core/client.c
index ac671202919e..0c8c55c73b12 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/client.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/client.c
@@ -60,7 +60,7 @@ nvkm_uclient_new(const struct nvkm_oclass *oclass, void 
*argv, u32 argc,
return 0;
 }
 
-const struct nvkm_sclass
+static const struct nvkm_sclass
 nvkm_uclient_sclass = {
.oclass = NVIF_CLASS_CLIENT,
.minver = 0,
-- 
2.23.0

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

[PATCH 1/2] drm/fb-helper: include drm/drm_fb_cma_helper.h for missing declarations

2019-10-10 Thread Ben Dooks
Include  to fix the following warnings
from missing declarations:

drivers/gpu/drm/drm_fb_cma_helper.c:38:27: warning: symbol 
'drm_fb_cma_get_gem_obj' was not declared. Should it be static?
drivers/gpu/drm/drm_fb_cma_helper.c:62:12: warning: symbol 
'drm_fb_cma_get_gem_addr' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/drm_fb_helper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index a7ba5b4902d6..23e10075619f 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "drm_internal.h"
 
-- 
2.23.0

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

[PATCH] drm/msm/mdp5: make config variables static

2019-10-10 Thread Ben Dooks
A number of the config structs are not exported so make
them static to avoid the following sparse warnings:

drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:17:26: warning: symbol 
'msm8x74v1_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:101:26: warning: symbol 
'msm8x74v2_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:183:26: warning: symbol 
'apq8084_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:278:26: warning: symbol 
'msm8x16_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:345:26: warning: symbol 
'msm8x94_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:440:26: warning: symbol 
'msm8x96_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:548:26: warning: symbol 
'msm8917_config' was not declared. Should it be static?
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:633:26: warning: symbol 
'msm8998_config' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Rob Clark 
Cc: Sean Paul 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: linux-arm-...@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: freedr...@lists.freedesktop.org
---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c 
b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
index f6e71ff539ca..7c9c1ddae821 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
@@ -14,7 +14,7 @@ struct mdp5_cfg_handler {
 /* mdp5_cfg must be exposed (used in mdp5.xml.h) */
 const struct mdp5_cfg_hw *mdp5_cfg = NULL;
 
-const struct mdp5_cfg_hw msm8x74v1_config = {
+static const struct mdp5_cfg_hw msm8x74v1_config = {
.name = "msm8x74v1",
.mdp = {
.count = 1,
@@ -98,7 +98,7 @@ const struct mdp5_cfg_hw msm8x74v1_config = {
.max_clk = 2,
 };
 
-const struct mdp5_cfg_hw msm8x74v2_config = {
+static const struct mdp5_cfg_hw msm8x74v2_config = {
.name = "msm8x74",
.mdp = {
.count = 1,
@@ -180,7 +180,7 @@ const struct mdp5_cfg_hw msm8x74v2_config = {
.max_clk = 2,
 };
 
-const struct mdp5_cfg_hw apq8084_config = {
+static const struct mdp5_cfg_hw apq8084_config = {
.name = "apq8084",
.mdp = {
.count = 1,
@@ -275,7 +275,7 @@ const struct mdp5_cfg_hw apq8084_config = {
.max_clk = 32000,
 };
 
-const struct mdp5_cfg_hw msm8x16_config = {
+static const struct mdp5_cfg_hw msm8x16_config = {
.name = "msm8x16",
.mdp = {
.count = 1,
@@ -342,7 +342,7 @@ const struct mdp5_cfg_hw msm8x16_config = {
.max_clk = 32000,
 };
 
-const struct mdp5_cfg_hw msm8x94_config = {
+static const struct mdp5_cfg_hw msm8x94_config = {
.name = "msm8x94",
.mdp = {
.count = 1,
@@ -437,7 +437,7 @@ const struct mdp5_cfg_hw msm8x94_config = {
.max_clk = 4,
 };
 
-const struct mdp5_cfg_hw msm8x96_config = {
+static const struct mdp5_cfg_hw msm8x96_config = {
.name = "msm8x96",
.mdp = {
.count = 1,
@@ -545,7 +545,7 @@ const struct mdp5_cfg_hw msm8x96_config = {
.max_clk = 41250,
 };
 
-const struct mdp5_cfg_hw msm8917_config = {
+static const struct mdp5_cfg_hw msm8917_config = {
.name = "msm8917",
.mdp = {
.count = 1,
@@ -630,7 +630,7 @@ const struct mdp5_cfg_hw msm8917_config = {
.max_clk = 32000,
 };
 
-const struct mdp5_cfg_hw msm8998_config = {
+static const struct mdp5_cfg_hw msm8998_config = {
.name = "msm8998",
.mdp = {
.count = 1,
-- 
2.23.0

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

[PATCH] drm/scheduler: make unexported items static

2019-10-10 Thread Ben Dooks
The drm_sched_fence_ops_{scheduled,finished} are not exported
from the file so make them static to avoid the following
warnings from sparse:

drivers/gpu/drm/scheduler/sched_fence.c:131:28: warning: symbol 
'drm_sched_fence_ops_scheduled' was not declared. Should it be static?
drivers/gpu/drm/scheduler/sched_fence.c:137:28: warning: symbol 
'drm_sched_fence_ops_finished' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/scheduler/sched_fence.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/scheduler/sched_fence.c 
b/drivers/gpu/drm/scheduler/sched_fence.c
index 54977408f574..8b45c3a1b84e 100644
--- a/drivers/gpu/drm/scheduler/sched_fence.c
+++ b/drivers/gpu/drm/scheduler/sched_fence.c
@@ -128,13 +128,13 @@ static void drm_sched_fence_release_finished(struct 
dma_fence *f)
dma_fence_put(>scheduled);
 }
 
-const struct dma_fence_ops drm_sched_fence_ops_scheduled = {
+static const struct dma_fence_ops drm_sched_fence_ops_scheduled = {
.get_driver_name = drm_sched_fence_get_driver_name,
.get_timeline_name = drm_sched_fence_get_timeline_name,
.release = drm_sched_fence_release_scheduled,
 };
 
-const struct dma_fence_ops drm_sched_fence_ops_finished = {
+static const struct dma_fence_ops drm_sched_fence_ops_finished = {
.get_driver_name = drm_sched_fence_get_driver_name,
.get_timeline_name = drm_sched_fence_get_timeline_name,
.release = drm_sched_fence_release_finished,
-- 
2.23.0

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

[PATCH] drm/rockchip: include rockchip_drm_drv.h

2019-10-09 Thread Ben Dooks
Include rockchip_drm_drv.h for definition of vop_platform_driver
to avoid the following sparse warning:

drivers/gpu/drm/rockchip/rockchip_vop_reg.c:982:24: warning: symbol 
'vop_platform_driver' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Sandy Huang 
Cc: "Heiko Stübner" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-rockc...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c 
b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
index d1494be14471..333d8f2470af 100644
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
@@ -16,6 +16,7 @@
 
 #include "rockchip_drm_vop.h"
 #include "rockchip_vop_reg.h"
+#include "rockchip_drm_drv.h"
 
 #define _VOP_REG(off, _mask, _shift, _write_mask, _relaxed) \
{ \
-- 
2.23.0



[PATCH] drm/nouveau/falcon: make unexported objects static

2019-10-09 Thread Ben Dooks
Make the msgqueue_0148cdec_acr_func and msgqueue_0148cdec_func
static to avoid the following sparse warnings:

drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0148cdec.c:230:1: warning: symbol 
'msgqueue_0148cdec_acr_func' was not declared. Should it be static?
drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0148cdec.c:241:1: warning: symbol 
'msgqueue_0148cdec_func' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Ben Skeggs 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Cc: nouv...@lists.freedesktop.org
Cc: linux-ker...@vger.kernel.org
---
 drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0148cdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0148cdec.c 
b/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0148cdec.c
index 9424803b9ef4..dfc0d50f080b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0148cdec.c
+++ b/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0148cdec.c
@@ -226,7 +226,7 @@ acr_boot_falcon(struct nvkm_msgqueue *priv, enum 
nvkm_secboot_falcon falcon)
return 0;
 }
 
-const struct nvkm_msgqueue_acr_func
+static const struct nvkm_msgqueue_acr_func
 msgqueue_0148cdec_acr_func = {
.boot_falcon = acr_boot_falcon,
 };
@@ -237,7 +237,7 @@ msgqueue_0148cdec_dtor(struct nvkm_msgqueue *queue)
kfree(msgqueue_0148cdec(queue));
 }
 
-const struct nvkm_msgqueue_func
+static const struct nvkm_msgqueue_func
 msgqueue_0148cdec_func = {
.init_func = _0148cdec_init_func,
.acr_func = _0148cdec_acr_func,
-- 
2.23.0



[PATCH 2/2] drm/fb-helper: include drm_crtc_helper_internal.h for drm_fb_helper_modinit

2019-10-09 Thread Ben Dooks
Include drm_crtc_helper_internal.h for drm_fb_helper_modinit
definition to fix the following warning:

drivers/gpu/drm/drm_fb_helper.c:2410:12: warning: symbol 
'drm_fb_helper_modinit' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/drm_fb_helper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 23e10075619f..f1359e3e676c 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -48,6 +48,7 @@
 #include 
 
 #include "drm_internal.h"
+#include "drm_crtc_helper_internal.h"
 
 static bool drm_fbdev_emulation = true;
 module_param_named(fbdev_emulation, drm_fbdev_emulation, bool, 0600);
-- 
2.23.0



[PATCH 1/5] drm/nouveau/gr/gf100-: make undeclared symbols static

2019-10-09 Thread Ben Dooks
The following functions are not declared outside of the
file they are in, so make them static to avoid these
warnings:

drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:745:1: warning: symbol 
'gf100_gr_fecs_start_ctxsw' was not declared. Should it be static?
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:760:1: warning: symbol 
'gf100_gr_fecs_stop_ctxsw' was not declared. Should it be static?
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:2071:1: warning: symbol 
'gf100_gr_ctor_fw_legacy' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
index c578deb5867a..f1d1174ce67a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
@@ -741,7 +741,7 @@ gf100_gr_fecs_ctrl_ctxsw(struct gf100_gr *gr, u32 mthd)
return -ETIMEDOUT;
 }
 
-int
+static int
 gf100_gr_fecs_start_ctxsw(struct nvkm_gr *base)
 {
struct gf100_gr *gr = gf100_gr(base);
@@ -756,7 +756,7 @@ gf100_gr_fecs_start_ctxsw(struct nvkm_gr *base)
return ret;
 }
 
-int
+static int
 gf100_gr_fecs_stop_ctxsw(struct nvkm_gr *base)
 {
struct gf100_gr *gr = gf100_gr(base);
@@ -2067,7 +2067,7 @@ gf100_gr_ = {
.ctxsw.inst = gf100_gr_ctxsw_inst,
 };
 
-int
+static int
 gf100_gr_ctor_fw_legacy(struct gf100_gr *gr, const char *fwname,
struct gf100_gr_fuc *fuc, int ret)
 {
-- 
2.23.0

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

[PATCH 5/5] drm/nouveau/disp/gv100: make gv100_disp_wimm static

2019-10-08 Thread Ben Dooks
The gv100_disp_wimm is not declared, so make it static
to avoid the following warning:

drivers/gpu/drm/nouveau/nvkm/engine/disp/wimmgv100.c:39:1: warning: symbol 
'gv100_disp_wimm' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/nvkm/engine/disp/wimmgv100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/wimmgv100.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/wimmgv100.c
index 89d783368b4f..bb4db6351ddf 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/wimmgv100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/wimmgv100.c
@@ -35,7 +35,7 @@ gv100_disp_wimm_intr(struct nv50_disp_chan *chan, bool en)
nvkm_mask(device, 0x611da8, mask, data);
 }
 
-const struct nv50_disp_chan_func
+static const struct nv50_disp_chan_func
 gv100_disp_wimm = {
.init = gv100_disp_dmac_init,
.fini = gv100_disp_dmac_fini,
-- 
2.23.0



[PATCH 3/5] drm/nouveau/fifo/gv100: make gv100_fifo_runlist static

2019-10-08 Thread Ben Dooks
Do not export gv100_fifo_runlist as it isn't not used
to remove the following morning:

drivers/gpu/drm/nouveau/nvkm/engine/fifo/gv100.c:56:1: warning: symbol 
'gv100_fifo_runlist' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/gv100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gv100.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gv100.c
index 6ee1bb32a071..1f6ddf880179 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gv100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gv100.c
@@ -52,7 +52,7 @@ gv100_fifo_runlist_cgrp(struct nvkm_fifo_cgrp *cgrp,
nvkm_wo32(memory, offset + 0xc, 0x);
 }
 
-const struct gk104_fifo_runlist_func
+static const struct gk104_fifo_runlist_func
 gv100_fifo_runlist = {
.size = 16,
.cgrp = gv100_fifo_runlist_cgrp,
-- 
2.23.0



[PATCH 4/5] drm/nouveau/disp/gv100: make undeclared symbols static

2019-10-08 Thread Ben Dooks
The two objects gv100_disp_wndw and gv100_disp_wndw_mthd are
not declared or used outside the file, so make them static to
avoid the following warnings:

drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c:120:1: warning: symbol 
'gv100_disp_wndw_mthd' was not declared. Should it be static?
drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c:140:1: warning: symbol 
'gv100_disp_wndw' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c
index 5d3b641dbb14..e635247d794f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c
@@ -116,7 +116,7 @@ gv100_disp_wndw_mthd_base = {
}
 };
 
-const struct nv50_disp_chan_mthd
+static const struct nv50_disp_chan_mthd
 gv100_disp_wndw_mthd = {
.name = "Window",
.addr = 0x001000,
@@ -136,7 +136,7 @@ gv100_disp_wndw_intr(struct nv50_disp_chan *chan, bool en)
nvkm_mask(device, 0x611da4, mask, data);
 }
 
-const struct nv50_disp_chan_func
+static const struct nv50_disp_chan_func
 gv100_disp_wndw = {
.init = gv100_disp_dmac_init,
.fini = gv100_disp_dmac_fini,
-- 
2.23.0



[PATCH 2/5] drm/nouveau/fifo/tu102: make tu102_fifo_runlist static

2019-10-08 Thread Ben Dooks
The tu102_fifo_runlist is not exorted, so make it static
to avoid the following warning:

drivers/gpu/drm/nouveau/nvkm/engine/fifo/tu102.c:47:1: warning: symbol 
'tu102_fifo_runlist' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/tu102.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/tu102.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/tu102.c
index 005f3e1729b9..3e78f5b6accb 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/tu102.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/tu102.c
@@ -43,7 +43,7 @@ tu102_fifo_runlist_commit(struct gk104_fifo *fifo, int runl,
/*XXX: how to wait? can you even wait? */
 }
 
-const struct gk104_fifo_runlist_func
+static const struct gk104_fifo_runlist_func
 tu102_fifo_runlist = {
.size = 16,
.cgrp = gv100_fifo_runlist_cgrp,
-- 
2.23.0



[PATCH 2/3] drm/nouveau/kms/nv50-: make unexported items static

2019-10-08 Thread Ben Dooks
Make functions that are not used directly outside the file
they are in static to avoid the following warnings:

drivers/gpu/drm/nouveau/dispnv50/headc57d.c:73:1: warning: symbol 
'headc57d_olut_clr' was not declared. Should it be static?
drivers/gpu/drm/nouveau/dispnv50/headc57d.c:85:1: warning: symbol 
'headc57d_olut_set' was not declared. Should it be static?
drivers/gpu/drm/nouveau/dispnv50/headc57d.c:155:1: warning: symbol 
'headc57d_olut' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/dispnv50/headc57d.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c 
b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c
index 32a7f9e85fb0..f3d46276a7c4 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c
@@ -69,7 +69,7 @@ headc57d_procamp(struct nv50_head *head, struct 
nv50_head_atom *asyh)
}
 }
 
-void
+static void
 headc57d_olut_clr(struct nv50_head *head)
 {
struct nv50_dmac *core = _disp(head->base.base.dev)->core->chan;
@@ -81,7 +81,7 @@ headc57d_olut_clr(struct nv50_head *head)
}
 }
 
-void
+static void
 headc57d_olut_set(struct nv50_head *head, struct nv50_head_atom *asyh)
 {
struct nv50_dmac *core = _disp(head->base.base.dev)->core->chan;
@@ -151,7 +151,7 @@ headc57d_olut_load(struct drm_color_lut *in, int size, void 
__iomem *mem)
writew(readw(mem - 4), mem + 4);
 }
 
-void
+static void
 headc57d_olut(struct nv50_head *head, struct nv50_head_atom *asyh)
 {
asyh->olut.mode = 2; /* DIRECT10 */
-- 
2.23.0



[PATCH 1/3] drm/nouveau/kms/nv50-: make base917c_format static

2019-10-08 Thread Ben Dooks
The base917c_format isn't exported, so make it static to
avoid the following warning:

drivers/gpu/drm/nouveau/dispnv50/base917c.c:26:1: warning: symbol 
'base917c_format' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/dispnv50/base917c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv50/base917c.c 
b/drivers/gpu/drm/nouveau/dispnv50/base917c.c
index a1baed4fe0e9..ca260509a4f1 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/base917c.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/base917c.c
@@ -22,7 +22,7 @@
 #include "base.h"
 #include "atom.h"
 
-const u32
+static const u32
 base917c_format[] = {
DRM_FORMAT_C8,
DRM_FORMAT_XRGB,
-- 
2.23.0



[PATCH 3/3] drm/nouveau/kms/nv50-: include n50_display.h for nv50_display_create

2019-10-08 Thread Ben Dooks
Include n50_display.h for the definition of nv50_display_create to
fix the warning (and remove the now non-exported definitions in the
n50_display.h to allow the code to build):

drivers/gpu/drm/nouveau/dispnv50/disp.c:2297:1: warning: symbol 
'nv50_display_create' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 ++
 drivers/gpu/drm/nouveau/nv50_display.h  | 3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c 
b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index b46be8a091e9..f7774cc927d8 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -53,6 +53,8 @@
 #include "nouveau_fence.h"
 #include "nouveau_fbcon.h"
 
+#include "nv50_display.h"
+
 #include 
 
 /**
diff --git a/drivers/gpu/drm/nouveau/nv50_display.h 
b/drivers/gpu/drm/nouveau/nv50_display.h
index fbd3b15583bc..2421401d1263 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.h
+++ b/drivers/gpu/drm/nouveau/nv50_display.h
@@ -31,7 +31,4 @@
 #include "nouveau_reg.h"
 
 int  nv50_display_create(struct drm_device *);
-void nv50_display_destroy(struct drm_device *);
-int  nv50_display_init(struct drm_device *);
-void nv50_display_fini(struct drm_device *);
 #endif /* __NV50_DISPLAY_H__ */
-- 
2.23.0



Re: [PATCH 04/11] drm/nouveau: gp10b: Add custom L2 cache implementation

2019-09-17 Thread Ben Dooks

On 16/09/2019 16:04, Thierry Reding wrote:

From: Thierry Reding 

There are extra registers that need to be programmed to make the level 2
cache work on GP10B, such as the stream ID register that is used when an
SMMU is used to translate memory addresses.

Signed-off-by: Thierry Reding 
---
  .../gpu/drm/nouveau/include/nvkm/subdev/ltc.h |  1 +
  .../gpu/drm/nouveau/nvkm/engine/device/base.c |  2 +-
  .../gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild|  1 +
  .../gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c   | 69 +++
  .../gpu/drm/nouveau/nvkm/subdev/ltc/priv.h|  2 +
  5 files changed, 74 insertions(+), 1 deletion(-)
  create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c

diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h 
b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h
index 644d527c3b96..d76f60d7d29a 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h
@@ -40,4 +40,5 @@ int gm107_ltc_new(struct nvkm_device *, int, struct nvkm_ltc 
**);
  int gm200_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
  int gp100_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
  int gp102_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
+int gp10b_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
  #endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
index c3c7159f3411..d2d6d5f4028a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
@@ -2380,7 +2380,7 @@ nv13b_chipset = {
.fuse = gm107_fuse_new,
.ibus = gp10b_ibus_new,
.imem = gk20a_instmem_new,
-   .ltc = gp102_ltc_new,
+   .ltc = gp10b_ltc_new,
.mc = gp10b_mc_new,
.mmu = gp10b_mmu_new,
.secboot = gp10b_secboot_new,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild 
b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild
index 2b6d36ea7067..728d75010847 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild
@@ -6,3 +6,4 @@ nvkm-y += nvkm/subdev/ltc/gm107.o
  nvkm-y += nvkm/subdev/ltc/gm200.o
  nvkm-y += nvkm/subdev/ltc/gp100.o
  nvkm-y += nvkm/subdev/ltc/gp102.o
+nvkm-y += nvkm/subdev/ltc/gp10b.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c
new file mode 100644
index ..4d27c6ea1552
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/gp10b.c
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2019 NVIDIA Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Thierry Reding
+ */
+
+#include "priv.h"
+
+static void
+gp10b_ltc_init(struct nvkm_ltc *ltc)
+{
+   struct nvkm_device *device = ltc->subdev.device;
+#ifdef CONFIG_IOMMU_API
+   struct iommu_fwspec *spec;
+#endif
+
+   nvkm_wr32(device, 0x17e27c, ltc->ltc_nr);
+   nvkm_wr32(device, 0x17e000, ltc->ltc_nr);
+   nvkm_wr32(device, 0x100800, ltc->ltc_nr);
+
+#ifdef CONFIG_IOMMU_API
+   spec = dev_iommu_fwspec_get(device->dev);
+   if (spec) {
+   u32 sid = spec->ids[0] & 0x;
+
+   /* stream ID */
+   nvkm_wr32(device, 0x16, sid << 2);
+   }
+#endif


Could we get rid of the #ifdef blocks here if there was a NULL
inline version of dev_iommu_fwspec_get() in the include/linux/iommu.h
header? The compiler should then optimise the lot out if the config
is not set.

--
Ben Dooks   http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/tegra: fix warning PTR_ERR_OR_ZERO can be used

2019-05-26 Thread Ben Dooks

On 25/05/2019 08:03, Hariprasad Kelam wrote:

fix below warnings reported by coccicheck

/drivers/gpu/drm/tegra/drm.c:509:1-3: WARNING: PTR_ERR_OR_ZERO can be
used
./drivers/gpu/drm/tegra/gem.c:419:1-3: WARNING: PTR_ERR_OR_ZERO can be
used


I'd say the coccicheck should say "Improvement:" here, it's not
something wrong, just code that has a better call available.

--
Ben Dooks   http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html


Re: [PATCH] gpu: host1x: fix compile error when IOMMU API is not available

2019-04-12 Thread Ben Dooks



On 2019-04-10 23:47, Stefan Agner wrote:

In case the IOMMU API is not available compiling host1x fails with
the following error:
  In file included from drivers/gpu/host1x/hw/host1x06.c:27:
  drivers/gpu/host1x/hw/channel_hw.c: In function 
‘host1x_channel_set_streamid’:

  drivers/gpu/host1x/hw/channel_hw.c:118:30: error: implicit
declaration of function
‘dev_iommu_fwspec_get’; did you mean ‘iommu_fwspec_free’?
[-Werror=implicit-function-declaration]
  struct iommu_fwspec *spec = 
dev_iommu_fwspec_get(channel->dev->parent);

  ^~~~
  iommu_fwspec_free

Fixes: de5469c21ff9 ("gpu: host1x: Program the channel stream ID")
Signed-off-by: Stefan Agner 


would it be better to provide something like this i nthe header that
defines dev_iommu_fwspec_get() to be:

static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device 
*dev) { return NULL; }


although returning an PTR_ERR would have been better.


---
 drivers/gpu/host1x/hw/channel_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/host1x/hw/channel_hw.c
b/drivers/gpu/host1x/hw/channel_hw.c
index 27101c04a827..4030d64916f0 100644
--- a/drivers/gpu/host1x/hw/channel_hw.c
+++ b/drivers/gpu/host1x/hw/channel_hw.c
@@ -114,7 +114,7 @@ static inline void synchronize_syncpt_base(struct
host1x_job *job)

 static void host1x_channel_set_streamid(struct host1x_channel 
*channel)

 {
-#if HOST1X_HW >= 6
+#if IS_ENABLED(CONFIG_IOMMU_API) &&  HOST1X_HW >= 6
 	struct iommu_fwspec *spec = 
dev_iommu_fwspec_get(channel->dev->parent);

u32 sid = spec ? spec->ids[0] & 0x : 0x7f;

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

[PATCH] drm: add __user attribute to ptr_to_compat()

2019-03-03 Thread Ben Dooks
The ptr_to_compat() call takes a "void __user *", so cast
the compat drm calls that use it to avoid the following
warnings from sparse:

drivers/gpu/drm/drm_ioc32.c:188:39: warning: incorrect type in argument 1 
(different address spaces)
drivers/gpu/drm/drm_ioc32.c:188:39:expected void [noderef] *uptr
drivers/gpu/drm/drm_ioc32.c:188:39:got void *[addressable] [assigned] handle
drivers/gpu/drm/drm_ioc32.c:529:41: warning: incorrect type in argument 1 
(different address spaces)
drivers/gpu/drm/drm_ioc32.c:529:41:expected void [noderef] *uptr
drivers/gpu/drm/drm_ioc32.c:529:41:got void *[addressable] [assigned] handle

Signed-off-by: Ben Dooks 
---
 drivers/gpu/drm/drm_ioc32.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
index 67b1fca39aa6..0e3043e08c69 100644
--- a/drivers/gpu/drm/drm_ioc32.c
+++ b/drivers/gpu/drm/drm_ioc32.c
@@ -185,7 +185,7 @@ static int compat_drm_getmap(struct file *file, unsigned 
int cmd,
m32.size = map.size;
m32.type = map.type;
m32.flags = map.flags;
-   m32.handle = ptr_to_compat(map.handle);
+   m32.handle = ptr_to_compat((void __user *)map.handle);
m32.mtrr = map.mtrr;
if (copy_to_user(argp, , sizeof(m32)))
return -EFAULT;
@@ -216,7 +216,7 @@ static int compat_drm_addmap(struct file *file, unsigned 
int cmd,
 
m32.offset = map.offset;
m32.mtrr = map.mtrr;
-   m32.handle = ptr_to_compat(map.handle);
+   m32.handle = ptr_to_compat((void __user *)map.handle);
if (map.handle != compat_ptr(m32.handle))
pr_err_ratelimited("compat_drm_addmap truncated handle %p for 
type %d offset %x\n",
   map.handle, m32.type, m32.offset);
@@ -526,7 +526,7 @@ static int compat_drm_getsareactx(struct file *file, 
unsigned int cmd,
if (err)
return err;
 
-   req32.handle = ptr_to_compat(req.handle);
+   req32.handle = ptr_to_compat((void __user *)req.handle);
if (copy_to_user(argp, , sizeof(req32)))
return -EFAULT;
 
-- 
2.20.1

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

[alsa-devel] [PATCH 1/8] clk: add helper function clk_is_match()

2015-02-26 Thread Ben Dooks
On Thu, Feb 26, 2015 at 10:56:58AM +0100, Philipp Zabel wrote:
> Am Donnerstag, den 26.02.2015, 09:02 + schrieb Ben Dooks:
> > On Wed, Feb 25, 2015 at 09:27:57AM -0800, Mike Turquette wrote:
> [...]
> > > From: Michael Turquette 
> > > Date: Wed, 25 Feb 2015 09:11:01 -0800
> > > Subject: [PATCH] clk: introduce clk_is_match
> > > 
> > > Some drivers compare struct clk pointers as a means of knowing
> > > if the two pointers reference the same clock hardware. This behavior is
> > > dubious (drivers must not dereference struct clk), but did not cause any
> > > regressions until the per-user struct clk patch was merged. Now the test
> > > for matching clk's will always fail with per-user struct clk's.
> > > 
> > > clk_is_match is introduced to fix the regression and prevent drivers
> > > from comparing the pointers manually.
> > 
> > small observaton, clk_is_same() is linguistically nicer.
> 
> How about clk_equal() ?

That's good, the only issue that's not clear in any of these names is
that does this mean "the same clock", a "clock of the same rate" or a
"clock that is equivalent to in the rate and phase but not subject to
the same gate".


-- 
Ben Dooks, ben at fluff.org, http://www.fluff.org/ben/

Large Hadron Colada: A large Pina Colada that makes the universe disappear.



[alsa-devel] [PATCH 1/8] clk: add helper function clk_is_match()

2015-02-26 Thread Ben Dooks
On Wed, Feb 25, 2015 at 09:27:57AM -0800, Mike Turquette wrote:
> Quoting Shawn Guo (2015-02-25 06:53:31)
> > Since commit 035a61c314eb ("clk: Make clk API return per-user struct clk
> > instances"), clk API users can no longer check if two struct clk
> > pointers are pointing to the same hardware clock, i.e. struct clk_hw, by
> > simply comparing two pointers.  That's because with the per-user clk
> > change, a brand new struct clk is created whenever clients try to look
> > up the clock by calling clk_get() or sister functions like clk_get_sys()
> > and of_clk_get().  This changes the original behavior where the struct
> > clk is only created for once when clock driver registers the clock to
> > CCF in the first place.  The net change here is before commit
> > 035a61c314eb the struct clk pointer is unique for given hardware
> > clock, while after the commit the pointers returned by clk lookup calls
> > become different for the same hardware clock.
> > 
> > A number of client drivers detecting if two struct clk pointers point to
> > the same one hardware clock by comparing the pointers are broken now.
> > As a stop-gap solution, this patch adds a helper function clk_is_match()
> > to test if two struct clk pointers point to the same hardware clock, so
> > that these client drivers can use to fix the regression.
> > 
> > Signed-off-by: Shawn Guo 
> 
> Hi Shawn,
> 
> Thanks for the patch. I wrote a similar one last night but did not
> finish fixing up the drivers (and thus did not post it). I prefer my
> implementation below, and I'm happy to merge your driver fixes with it.
> 
> Regards,
> Mike
> 
> 
> 
> From: Michael Turquette 
> Date: Wed, 25 Feb 2015 09:11:01 -0800
> Subject: [PATCH] clk: introduce clk_is_match
> 
> Some drivers compare struct clk pointers as a means of knowing
> if the two pointers reference the same clock hardware. This behavior is
> dubious (drivers must not dereference struct clk), but did not cause any
> regressions until the per-user struct clk patch was merged. Now the test
> for matching clk's will always fail with per-user struct clk's.
> 
> clk_is_match is introduced to fix the regression and prevent drivers
> from comparing the pointers manually.

small observaton, clk_is_same() is linguistically nicer.

-- 
Ben Dooks, ben at fluff.org, http://www.fluff.org/ben/

Large Hadron Colada: A large Pina Colada that makes the universe disappear.