Skip to contentSkip to conversation

drm: Increase COMPILE_TEST=y coverage

PATCH New Ville Syrjala 2 participants 8 messages Apr 10, 2025 – Apr 11, 2025

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v3 cover drm: Increase COMPILE_TEST=y coverage

From: Ville Syrjälä <[email protected]>

Another repost of some COMPILE_TEST=y stragglers.

Cc Tomi Valkeinen <[email protected]>
Cc Jyri Sarha <[email protected]>
Cc Russell King <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Alison Wang <[email protected]>

Ville Syrjälä (6):
drm/tilcdc: Allow build without __iowmb() drm/tilcdc: Allow build with COMPILE_TEST=y drm/armada: Fix printk arguments
drm/armada: Fix armada_debugfs_crtc_reg_write() return type drm/armada: Allow build with COMPILE_TEST=y drm/fsl-dcu: Allow build with COMPILE_TEST=y

 drivers/gpu/drm/armada/Kconfig          | 2 +-
 drivers/gpu/drm/armada/armada_debugfs.c | 2 +-
 drivers/gpu/drm/armada/armada_gem.c     | 2 +-
 drivers/gpu/drm/fsl-dcu/Kconfig         | 2 +-
 drivers/gpu/drm/tilcdc/Kconfig          | 2 +-
 drivers/gpu/drm/tilcdc/tilcdc_regs.h    | 3 +++
 6 files changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
2.49.0
#1 lore raw

PATCH v3 1/6 drm/tilcdc: Allow build without __iowmb()

From: Ville Syrjälä <[email protected]>

__iowmb() isn't available on most architectures. Make its use optional so that the driver can be built on other architectures with COMPILE_TEST=y.

v2: Add a comment stating this is for COMPILE_TEST (Tomi)

---
 drivers/gpu/drm/tilcdc/tilcdc_regs.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/tilcdc/tilcdc_regs.h +3 -0
index f90e2dc3457c..332b24327386 100644
@@ -125,7 +125,10 @@ static inline void tilcdc_write64(struct drm_device *dev, u32 reg, u64 data)
 #if defined(iowrite64) && !defined(iowrite64_is_nonatomic)
 	iowrite64(data, addr);
 #else
+	/* allow compilation without __iowmb() for COMPILE_TEST */
+#ifdef __iowmb
 	__iowmb();
+#endif
 	/* This compiles to strd (=64-bit write) on ARM7 */
 	*(volatile u64 __force *)addr = __cpu_to_le64(data);
 #endif
Signature · 1 line
2.49.0
#2 lore raw

PATCH v3 2/6 drm/tilcdc: Allow build with COMPILE_TEST=y

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Allow tilcdc to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least.

---
 drivers/gpu/drm/tilcdc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tilcdc/Kconfig +1 -1
index 24f9a245ba59..c430914b1db7 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config DRM_TILCDC
 	tristate "DRM Support for TI LCDC Display Controller"
-	depends on DRM && OF && ARM
+	depends on DRM && OF && (ARM || COMPILE_TEST)
 	select DRM_CLIENT_SELECTION
 	select DRM_KMS_HELPER
 	select DRM_GEM_DMA_HELPER
Signature · 1 line
2.49.0
#3 lore raw

Re: [PATCH v3 2/6] drm/tilcdc: Allow build with COMPILE_TEST=y

kernel test robot noticed the following build warnings:

Hi Ville,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-exynos/exynos-drm-next] [also build test WARNING on linus/master v6.15-rc1 next-20250411] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ville-Syrjala/drm-tilcdc-Allow-build-without-__iowmb/20250410-230042
base:   https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git exynos-drm-next
patch link:    https://lore.kernel.org/r/20250410145904.25550-3-ville.syrjala%40linux.intel.com
patch subject: [PATCH v3 2/6] drm/tilcdc: Allow build with COMPILE_TEST=y
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20250411/[email protected]/config)
compiler: alpha-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250411/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from drivers/gpu/drm/tilcdc/tilcdc_crtc.c:24:
drivers/gpu/drm/tilcdc/tilcdc_regs.h: In function 'tilcdc_write64':

>> drivers/gpu/drm/tilcdc/tilcdc_regs.h:126:25: warning: passing argument 2 of 'iowrite64' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
     126 |         iowrite64(data, addr);
         |                         ^~~~
   In file included from arch/alpha/include/asm/io.h:15,
                    from include/linux/scatterlist.h:9,
                    from include/linux/dma-mapping.h:8,
                    from drivers/gpu/drm/tilcdc/tilcdc_crtc.c:8:
   include/asm-generic/iomap.h:56:28: note: expected 'void *' but argument is of type 'volatile void *'
      56 | extern void iowrite64(u64, void __iomem *);
         |                            ^~~~~~~~~~~~~~

vim +126 drivers/gpu/drm/tilcdc/tilcdc_regs.h

16ea975eac671f Rob Clark       2013-01-08  119  
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  120  static inline void tilcdc_write64(struct drm_device *dev, u32 reg, u64 data)
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  121  {
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  122  	struct tilcdc_drm_private *priv = dev->dev_private;
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  123  	volatile void __iomem *addr = priv->mmio + reg;
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  124  
4e5ca2d930aa87 Logan Gunthorpe 2017-12-05  125  #if defined(iowrite64) && !defined(iowrite64_is_nonatomic)
7eb9f069ff5dd3 Jyri Sarha      2016-08-26 @126  	iowrite64(data, addr);
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  127  #else
752db4ea4759e8 Ville Syrjälä   2025-04-10  128  	/* allow compilation without __iowmb() for COMPILE_TEST */
752db4ea4759e8 Ville Syrjälä   2025-04-10  129  #ifdef __iowmb
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  130  	__iowmb();
752db4ea4759e8 Ville Syrjälä   2025-04-10  131  #endif
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  132  	/* This compiles to strd (=64-bit write) on ARM7 */
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  133  	*(volatile u64 __force *)addr = __cpu_to_le64(data);
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  134  #endif
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  135  }
7eb9f069ff5dd3 Jyri Sarha      2016-08-26  136  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#4 lore raw

PATCH v3 3/6 drm/armada: Fix printk arguments

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

../drivers/gpu/drm/armada/armada_gem.c: In function ‘armada_gem_pwrite_ioctl’:
../drivers/gpu/drm/armada/armada_gem.c:367:27: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]

  367 |                 DRM_ERROR("invalid size: object size %u\n", dobj->obj.size);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~
      |                                                                      |
      |                                                                      size_t {aka long unsigned int}
---
 drivers/gpu/drm/armada/armada_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/armada/armada_gem.c +1 -1
index 1a1680d71486..aca601fb1307 100644
@@ -364,7 +364,7 @@ int armada_gem_pwrite_ioctl(struct drm_device *dev, void *data,
 
 	if (args->offset > dobj->obj.size ||
 	    args->size > dobj->obj.size - args->offset) {
-		DRM_ERROR("invalid size: object size %u\n", dobj->obj.size);
+		DRM_ERROR("invalid size: object size %zu\n", dobj->obj.size);
 		ret = -EINVAL;
 		goto unref;
 	}
Signature · 1 line
2.49.0
#5 lore raw

PATCH v3 4/6 drm/armada: Fix armada_debugfs_crtc_reg_write() return type

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Change the armada_debugfs_crtc_reg_write() return type to the correct ssize_t. This makes the code actually build on certain architectures.

---
 drivers/gpu/drm/armada/armada_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/armada/armada_debugfs.c +1 -1
index a763349dd89f..96aebd56272f 100644
@@ -49,7 +49,7 @@ static int armada_debugfs_crtc_reg_open(struct inode *inode, struct file *file)
 			   inode->i_private);
 }
 
-static int armada_debugfs_crtc_reg_write(struct file *file,
+static ssize_t armada_debugfs_crtc_reg_write(struct file *file,
 	const char __user *ptr, size_t len, loff_t *off)
 {
 	struct armada_crtc *dcrtc;
Signature · 1 line
2.49.0
#6 lore raw

PATCH v3 5/6 drm/armada: Allow build with COMPILE_TEST=y

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Allow armada to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least.

---
 drivers/gpu/drm/armada/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/armada/Kconfig +1 -1
index b22c891a670b..1376337548da 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config DRM_ARMADA
 	tristate "DRM support for Marvell Armada SoCs"
-	depends on DRM && HAVE_CLK && ARM && MMU
+	depends on DRM && HAVE_CLK && MMU && (ARM || COMPILE_TEST)
 	select DRM_CLIENT_SELECTION
 	select DRM_KMS_HELPER
 	select FB_IOMEM_HELPERS if DRM_FBDEV_EMULATION
Signature · 1 line
2.49.0
#7 lore raw

PATCH v3 6/6 drm/fsl-dcu: Allow build with COMPILE_TEST=y

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Allow fsl-dcu to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least.

Cc Stefan Agner <[email protected]>
Cc Alison Wang <[email protected]>
---
 drivers/gpu/drm/fsl-dcu/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/Kconfig +1 -1
index 0e0f910ceb9f..ef7fd7fc9fd6 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config DRM_FSL_DCU
 	tristate "DRM Support for Freescale DCU"
-	depends on DRM && OF && ARM && COMMON_CLK
+	depends on DRM && OF && COMMON_CLK && (ARM || COMPILE_TEST)
 	select BACKLIGHT_CLASS_DEVICE
 	select DRM_CLIENT_SELECTION
 	select DRM_GEM_DMA_HELPER
Signature · 1 line
2.49.0