linux/drivers/gpu/drm/omapdrm
Nathan Chancellor c58c39163a drm/omap: Restrict compile testing to PAGE_SIZE less than 64KB
Prior to commit dc6fcaaba5 ("drm/omap: Allow build with
COMPILE_TEST=y"), it was only possible to build the omapdrm driver with
a 4KB page size. After that change, when the PAGE_SIZE is 64KB or
larger, clang points out that the driver has some assumptions around the
page size implicitly by passing PAGE_SIZE to a parameter with a type of
u16:

  drivers/gpu/drm/omapdrm/omap_gem.c:758:7: error: implicit conversion from 'unsigned long' to 'u16' (aka 'unsigned short') changes value from 65536 to 0 [-Werror,-Wconstant-conversion]
    757 |                 block = tiler_reserve_2d(fmt, omap_obj->width, omap_obj->height,
        |                         ~~~~~~~~~~~~~~~~
    758 |                                          PAGE_SIZE);
        |                                          ^~~~~~~~~
  arch/powerpc/include/asm/page.h:25:34: note: expanded from macro 'PAGE_SIZE'
     25 | #define PAGE_SIZE               (ASM_CONST(1) << PAGE_SHIFT)
        |                                  ~~~~~~~~~~~~~^~~~~~~~~~~~~
  drivers/gpu/drm/omapdrm/omap_gem.c:1504:44: error: implicit conversion from 'unsigned long' to 'u16' (aka 'unsigned short') changes value from 65536 to 0 [-Werror,-Wconstant-conversion]
   1504 |                         block = tiler_reserve_2d(fmts[i], w, h, PAGE_SIZE);
        |                                 ~~~~~~~~~~~~~~~~                ^~~~~~~~~
  arch/powerpc/include/asm/page.h:25:34: note: expanded from macro 'PAGE_SIZE'
     25 | #define PAGE_SIZE               (ASM_CONST(1) << PAGE_SHIFT)
        |                                  ~~~~~~~~~~~~~^~~~~~~~~~~~~
  2 errors generated.

As there is a lot of use of a u16 type throughout this driver and it
will only ever be run on hardware that has a 4KB page size, just
restrict compile testing to when the page size is less than 64KB (as no
other issues have been discussed and it keeps compile testing relatively
more available).

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240620-omapdrm-restrict-compile-test-to-sub-64kb-page-size-v1-1-5e56de71ffca@kernel.org
2024-07-12 13:13:15 +10:00
..
dss drm/omap/hdmi5: switch to ->edid_read callback 2024-02-09 10:16:01 +02:00
Kconfig drm/omap: Restrict compile testing to PAGE_SIZE less than 64KB 2024-07-12 13:13:15 +10:00
Makefile
TODO
omap_crtc.c
omap_crtc.h
omap_debugfs.c
omap_dmm_priv.h
omap_dmm_tiler.c drm/omap: dmm_tiler: drop driver owner assignment 2024-04-10 14:14:58 +03:00
omap_dmm_tiler.h
omap_drv.c Revert "drm/omapdrm: Annotate dma-fence critical section in commit path" 2023-10-31 15:32:20 +02:00
omap_drv.h
omap_encoder.c
omap_encoder.h
omap_fb.c drm/omap: add missing seq_file include 2024-04-26 14:17:44 +10:00
omap_fb.h
omap_fbdev.c drm/omapdrm: Fix console with deferred ops 2024-03-18 13:43:39 +02:00
omap_fbdev.h
omap_gem.c Merge drm/drm-next into drm-misc-next 2024-05-27 11:08:31 +02:00
omap_gem.h drm/omapdrm: Set VM flags in GEM-object mmap function 2023-07-24 20:14:43 +02:00
omap_gem_dmabuf.c drm/omapdrm: Set VM flags in GEM-object mmap function 2023-07-24 20:14:43 +02:00
omap_irq.c
omap_irq.h
omap_overlay.c
omap_overlay.h
omap_plane.c
omap_plane.h
tcm-sita.c
tcm.h