linux/drivers/gpu/drm
Linus Torvalds 4477b39c32 minmax: add a few more MIN_T/MAX_T users
Commit 3a7e02c040 ("minmax: avoid overly complicated constant
expressions in VM code") added the simpler MIN_T/MAX_T macros in order
to avoid some excessive expansion from the rather complicated regular
min/max macros.

The complexity of those macros stems from two issues:

 (a) trying to use them in situations that require a C constant
     expression (in static initializers and for array sizes)

 (b) the type sanity checking

and MIN_T/MAX_T avoids both of these issues.

Now, in the whole (long) discussion about all this, it was pointed out
that the whole type sanity checking is entirely unnecessary for
min_t/max_t which get a fixed type that the comparison is done in.

But that still leaves min_t/max_t unnecessarily complicated due to
worries about the C constant expression case.

However, it turns out that there really aren't very many cases that use
min_t/max_t for this, and we can just force-convert those.

This does exactly that.

Which in turn will then allow for much simpler implementations of
min_t()/max_t().  All the usual "macros in all upper case will evaluate
the arguments multiple times" rules apply.

We should do all the same things for the regular min/max() vs MIN/MAX()
cases, but that has the added complexity of various drivers defining
their own local versions of MIN/MAX, so that needs another level of
fixes first.

Link: https://lore.kernel.org/all/b47fad1d0cf8449886ad148f8c013dae@AcuMS.aculab.com/
Cc: David Laight <David.Laight@aculab.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-07-28 13:41:14 -07:00
..
amd drm/amdgpu: reset vm state machine after gpu reset(vram lost) 2024-07-24 17:30:49 -04:00
arm Linux 6.10-rc6 2024-07-05 10:47:28 +02:00
armada
aspeed
ast drm/ast: Use drm_atomic_helper_commit_tail() helper 2024-07-03 09:38:23 +02:00
atmel-hlcdc
bridge drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
ci
display Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
etnaviv
exynos Linux 6.10-rc6 2024-07-05 10:47:28 +02:00
fsl-dcu
gma500 drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
gud
hisilicon
hyperv
i2c
i915 drm fixes for 6.11-rc1 2024-07-26 10:57:07 -07:00
imagination
imx
ingenic
kmb
lib
lima drm-misc-next for $kernel-version: 2024-07-05 12:37:22 +02:00
logicvc
loongson
mcde
mediatek Mediatek DRM Next for Linux 6.11 2024-07-05 11:36:25 +02:00
meson drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
mgag200 drm/mgag200: Rename constant MGAREG_Status to MGAREG_STATUS 2024-07-03 17:55:29 +02:00
msm IOMMU Updates for Linux v6.11 2024-07-19 09:59:58 -07:00
mxsfb
nouveau drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
omapdrm drm/omap: Restrict compile testing to PAGE_SIZE less than 64KB 2024-07-12 13:13:15 +10:00
panel A fix for fbdev on big endian systems, a condition fix for a sharp panel 2024-07-12 12:50:30 +10:00
panfrost drm-misc-next for $kernel-version: 2024-07-05 12:37:22 +02:00
panthor drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
pl111
qxl drm/qxl: Pin buffer objects for internal mappings 2024-07-10 09:12:42 +02:00
radeon
renesas Linux 6.10-rc6 2024-07-05 10:47:28 +02:00
rockchip
scheduler
solomon
sprd
sti
stm Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
sun4i
tegra
tests drm-misc-next for $kernel-version: 2024-07-05 12:37:22 +02:00
tidss
tilcdc
tiny
ttm drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
tve200
udl
v3d drm/v3d: Fix Indirect Dispatch configuration for V3D 7.1.6 and later 2024-07-15 12:49:52 -03:00
vboxvideo pci-v6.11-changes 2024-07-19 19:03:18 -07:00
vc4
vgem
virtio virtio: features, fixes, cleanups 2024-07-19 11:57:55 -07:00
vkms
vmwgfx drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
xe drm fixes for 6.11-rc1 2024-07-26 10:57:07 -07:00
xen
xlnx
Kconfig Linux 6.10-rc6 2024-07-05 10:47:28 +02:00
Makefile
drm_aperture.c
drm_atomic.c Merge tag 'drm-intel-next-2024-06-28' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next 2024-07-10 10:36:47 +02:00
drm_atomic_helper.c
drm_atomic_state_helper.c
drm_atomic_uapi.c
drm_auth.c
drm_blend.c
drm_bridge.c
drm_bridge_connector.c
drm_buddy.c
drm_cache.c
drm_client.c
drm_client_modeset.c
drm_color_mgmt.c minmax: add a few more MIN_T/MAX_T users 2024-07-28 13:41:14 -07:00
drm_connector.c
drm_crtc.c
drm_crtc_helper.c
drm_crtc_helper_internal.h
drm_crtc_internal.h Merge tag 'drm-intel-next-2024-06-28' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next 2024-07-10 10:36:47 +02:00
drm_damage_helper.c
drm_debugfs.c
drm_debugfs_crc.c
drm_displayid.c
drm_displayid_internal.h
drm_drv.c
drm_dumb_buffers.c
drm_edid.c
drm_edid_load.c
drm_eld.c
drm_encoder.c
drm_encoder_slave.c
drm_exec.c
drm_fb_dma_helper.c
drm_fb_helper.c Linux 6.10-rc6 2024-07-05 10:47:28 +02:00
drm_fbdev_dma.c A fix for fbdev on big endian systems, a condition fix for a sharp panel 2024-07-12 12:50:30 +10:00
drm_fbdev_shmem.c
drm_fbdev_ttm.c drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
drm_file.c
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c
drm_gem.c
drm_gem_atomic_helper.c
drm_gem_dma_helper.c
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c
drm_gem_ttm_helper.c
drm_gem_vram_helper.c
drm_gpuvm.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_kms_helper_common.c
drm_lease.c
drm_managed.c drm/managed: Simplify if condition 2024-07-03 10:11:03 +02:00
drm_mipi_dbi.c
drm_mipi_dsi.c Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
drm_mm.c
drm_mode_config.c
drm_mode_object.c
drm_modes.c
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c
drm_panel.c
drm_panel_orientation_quirks.c drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
drm_panic.c
drm_pci.c
drm_plane.c
drm_plane_helper.c
drm_prime.c
drm_print.c
drm_privacy_screen.c
drm_privacy_screen_x86.c
drm_probe_helper.c
drm_property.c
drm_rect.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_suballoc.c
drm_syncobj.c
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vblank.c
drm_vblank_work.c
drm_vma_manager.c
drm_writeback.c