linux/drivers/gpu/drm
Linus Torvalds 1a251f52cf minmax: make generic MIN() and MAX() macros available everywhere
This just standardizes the use of MIN() and MAX() macros, with the very
traditional semantics.  The goal is to use these for C constant
expressions and for top-level / static initializers, and so be able to
simplify the min()/max() macros.

These macro names were used by various kernel code - they are very
traditional, after all - and all such users have been fixed up, with a
few different approaches:

 - trivial duplicated macro definitions have been removed

   Note that 'trivial' here means that it's obviously kernel code that
   already included all the major kernel headers, and thus gets the new
   generic MIN/MAX macros automatically.

 - non-trivial duplicated macro definitions are guarded with #ifndef

   This is the "yes, they define their own versions, but no, the include
   situation is not entirely obvious, and maybe they don't get the
   generic version automatically" case.

 - strange use case #1

   A couple of drivers decided that the way they want to describe their
   versioning is with

	#define MAJ 1
	#define MIN 2
	#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN)

   which adds zero value and I just did my Alexander the Great
   impersonation, and rewrote that pointless Gordian knot as

	#define DRV_VERSION "1.2"

   instead.

 - strange use case #2

   A couple of drivers thought that it's a good idea to have a random
   'MIN' or 'MAX' define for a value or index into a table, rather than
   the traditional macro that takes arguments.

   These values were re-written as C enum's instead. The new
   function-line macros only expand when followed by an open
   parenthesis, and thus don't clash with enum use.

Happily, there weren't really all that many of these cases, and a lot of
users already had the pattern of using '#ifndef' guarding (or in one
case just using '#undef MIN') before defining their own private version
that does the same thing. I left such cases alone.

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 15:49:18 -07:00
..
amd minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
arm Linux 6.10-rc6 2024-07-05 10:47:28 +02:00
armada drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
aspeed
ast drm/ast: Use drm_atomic_helper_commit_tail() helper 2024-07-03 09:38:23 +02:00
atmel-hlcdc drm: atmel-hlcdc: add LCD controller layer definition for sam9x75 2024-05-30 15:47:55 +02:00
bridge drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
ci drm/ci: add tests on vkms 2024-06-17 08:02:48 -03:00
display Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
etnaviv drm/etnaviv: don't block scheduler when GPU is still active 2024-06-26 15:33:25 +02:00
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 drm: add missing MODULE_DESCRIPTION() macros 2024-06-10 12:44:39 +02:00
hisilicon drm/hisilicon/hibmc: convert to struct drm_edid 2024-05-27 15:31:18 +03:00
hyperv drm/hyperv: Use fbdev-shmem 2024-05-02 11:33:17 +02:00
i2c drm/i2c: tda998x: switch to struct drm_edid 2024-05-13 19:10:57 +02:00
i915 drm fixes for 6.11-rc1 2024-07-26 10:57:07 -07:00
imagination drm/imagination: Convert to platform remove callback returning void 2024-05-27 10:13:55 +02:00
imx drm/imx/ldb: convert to struct drm_edid 2024-05-27 17:25:49 +03:00
ingenic Merge drm/drm-next into drm-misc-next 2024-05-27 11:08:31 +02:00
kmb
lib
lima drm-misc-next for $kernel-version: 2024-07-05 12:37:22 +02:00
logicvc
loongson drm/loongson/7a2000: convert to struct drm_edid 2024-05-27 15:31:36 +03:00
mcde drm: Clean-up superfluously selecting VT_HW_CONSOLE_BINDING 2024-01-12 13:58:20 +01:00
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 drm/lcdif: Do not disable clocks on already suspended hardware 2024-03-20 04:32:55 +01:00
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 drm: Clean-up superfluously selecting VT_HW_CONSOLE_BINDING 2024-01-12 13:58:20 +01:00
qxl drm/qxl: Pin buffer objects for internal mappings 2024-07-10 09:12:42 +02:00
radeon minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
renesas Linux 6.10-rc6 2024-07-05 10:47:28 +02:00
rockchip drm/bridge: analogix_dp: remove unused analogix_dp_remove 2024-06-27 11:52:04 +02:00
scheduler tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
solomon drm/solomon: Use fbdev-shmem 2024-05-02 11:33:18 +02:00
sprd
sti drm/sti: Allow build with COMPILE_TEST=y 2024-05-28 21:43:46 +03:00
stm Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
sun4i drm/sun4i: Fix layer zpos change/atomic modesetting 2024-06-10 12:44:41 +02:00
tegra Revert "drm: Switch DRM_DISPLAY_HELPER to depends on" 2024-05-02 17:58:23 +02:00
tests drm-misc-next for $kernel-version: 2024-07-05 12:37:22 +02:00
tidss drm/tidss: Add drm_panic support 2024-06-18 10:06:35 +02:00
tilcdc drm: tilcdc: don't use devm_pinctrl_get_select_default() in probe 2024-04-10 14:27:00 +03:00
tiny drm/tiny: add missing MODULE_DESCRIPTION() macros 2024-06-10 12:44:32 +02:00
ttm drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
tve200 drm: Clean-up superfluously selecting VT_HW_CONSOLE_BINDING 2024-01-12 13:58:20 +01:00
udl drm: add missing MODULE_DESCRIPTION() macros 2024-06-10 12:44:39 +02:00
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 drm/vc4: vec: Add the margin properties to the connector 2024-06-20 10:02:41 +02:00
vgem
virtio virtio: features, fixes, cleanups 2024-07-19 11:57:55 -07:00
vkms drm/vkms: Use fbdev-shmem 2024-05-02 11:33:22 +02:00
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 fix missing vmalloc.h includes 2024-04-25 20:55:49 -07:00
xlnx drm: zynqmp_dp: Don't delay work 2024-06-17 10:38:18 +03:00
Kconfig Linux 6.10-rc6 2024-07-05 10:47:28 +02:00
Makefile drm/fbdev-generic: Convert to fbdev-ttm 2024-05-02 11:33:32 +02:00
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/panic: Add drm panic locking 2024-04-15 16:11:26 +02:00
drm_atomic_state_helper.c
drm_atomic_uapi.c drm/connector: hdmi: Add Broadcast RGB property 2024-05-28 10:24:37 +02:00
drm_auth.c drm-next for 6.8: 2024-01-12 11:32:19 -08:00
drm_blend.c
drm_bridge.c drm/bridge: Drop drm_bridge_chain_mode_fixup 2024-06-10 14:09:42 +02:00
drm_bridge_connector.c drm/bridge-connector: implement glue code for HDMI connector 2024-06-12 10:56:57 +03:00
drm_buddy.c Short summary of fixes pull: 2024-05-27 13:47:14 +10:00
drm_cache.c
drm_client.c Core DRM: 2024-05-02 14:30:31 +10:00
drm_client_modeset.c Linux 6.9-rc5 2024-04-22 14:35:52 +10:00
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: Add DRM_MODE_TV_MODE_MONOCHROME 2024-06-18 11:13:30 +02:00
drm_crtc.c drm: Rename drm_plane_check_pixel_format() to drm_plane_has_format() 2024-06-24 17:08:33 +03:00
drm_crtc_helper.c drm: prefer DRM_MODE_FMT/ARG over drm_mode_debug_printmodeline() 2024-04-15 16:22:50 +03:00
drm_crtc_helper_internal.h drm: avoid includes in drm_crtc_helper_internal.h 2024-03-11 11:47:07 +02:00
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/bridge-connector: implement glue code for HDMI connector 2024-06-12 10:56:57 +03:00
drm_debugfs_crc.c
drm_displayid.c drm/edid: rename drm_find_edid_extension() to drm_edid_find_extension() 2024-04-17 16:11:28 +03:00
drm_displayid_internal.h drm/edid: Parse topology block for all DispID structure v1.x 2024-04-22 11:38:11 +03:00
drm_drv.c drm: deprecate driver date 2024-05-08 15:31:58 +03:00
drm_dumb_buffers.c
drm_edid.c drm/edid: add a helper for EDID sysfs property show 2024-05-23 14:37:24 +03:00
drm_edid_load.c drm/edid/firmware: Remove built-in EDIDs 2024-02-26 14:05:18 +01:00
drm_eld.c drm/edid: move all internal declarations to drm_crtc_internal.h 2024-04-17 16:11:17 +03:00
drm_encoder.c
drm_encoder_slave.c
drm_exec.c Merge drm/drm-next into drm-misc-next 2024-01-29 14:20:23 +01:00
drm_fb_dma_helper.c drm/fb_dma: Add checks in drm_fb_dma_get_scanout_buffer() 2024-05-02 23:39:21 +02:00
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-shmem: Clean up deferred I/O 2024-05-15 14:50:46 +02:00
drm_fbdev_ttm.c drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
drm_file.c drm/drm_file: Fix pid refcounting race 2024-06-28 08:56:26 +10:00
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c drm: Warn when freeing a framebuffer that's still on a list 2023-12-23 07:31:29 +02:00
drm_gem.c drm/fbdev-generic: Fix locking with drm_client_buffer_vmap_local() 2024-03-11 13:33:50 +01:00
drm_gem_atomic_helper.c drm/atomic-helper: fix parameter order in drm_format_conv_state_copy() call 2024-04-19 17:36:49 +02:00
drm_gem_dma_helper.c
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c drm/gem-shmem: Add import attachment warning to locked pin function 2024-05-29 09:30:44 +02:00
drm_gem_ttm_helper.c
drm_gem_vram_helper.c Merge drm/drm-next into drm-misc-next 2024-04-02 09:51:30 +02:00
drm_gpuvm.c
drm_internal.h drm/edid: move all internal declarations to drm_crtc_internal.h 2024-04-17 16:11:17 +03:00
drm_ioc32.c
drm_ioctl.c drm: use "0" instead of "" for deprecated driver date 2024-05-10 20:56:12 +03:00
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: add missing MODULE_DESCRIPTION() macros 2024-06-10 12:44:39 +02:00
drm_mipi_dsi.c Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
drm_mm.c drm/mm: Remove unused drm_mm_replace_node 2024-06-06 10:24:13 -04:00
drm_mode_config.c drm: Introduce plane SIZE_HINTS property 2024-04-11 18:28:58 +03:00
drm_mode_object.c drm/mode_object: Export drm_mode_obj_find_prop_id for tests 2024-05-28 09:57:28 +02:00
drm_modes.c drm: Add DRM_MODE_TV_MODE_MONOCHROME 2024-06-18 11:13:30 +02:00
drm_modeset_helper.c drm: Check output polling initialized before disabling 2024-02-28 15:07:15 +01:00
drm_modeset_lock.c drm: remove drm_debug_printer in favor of drm_dbg_printer 2024-02-09 11:52:43 +02:00
drm_of.c
drm_panel.c drm/panel: do not return negative error codes from drm_panel_get_modes() 2024-03-13 10:44:14 +02:00
drm_panel_orientation_quirks.c drm next for 6.11-rc1: 2024-07-18 09:34:02 -07:00
drm_panic.c drm/panic: Restrict graphical logo handling to built-in 2024-06-27 11:41:58 +02:00
drm_pci.c
drm_plane.c drm: Export drm_plane_has_format() 2024-06-24 17:08:53 +03:00
drm_plane_helper.c
drm_prime.c drm/prime: Unbreak virtgpu dma-buf export 2024-03-28 19:52:22 +01:00
drm_print.c drm/print: Improve drm_dbg_printer 2024-06-06 14:46:15 -04:00
drm_privacy_screen.c
drm_privacy_screen_x86.c
drm_probe_helper.c drm: Add DRM_MODE_TV_MODE_MONOCHROME 2024-06-18 11:13:30 +02:00
drm_property.c
drm_rect.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c drm: add missing MODULE_DESCRIPTION() macros 2024-06-10 12:44:39 +02:00
drm_suballoc.c
drm_syncobj.c Linux 6.8-rc6 2024-02-26 11:41:07 +01:00
drm_sysfs.c drm/edid: add a helper for EDID sysfs property show 2024-05-23 14:37:24 +03:00
drm_trace.h
drm_trace_points.c
drm_vblank.c drm/vblank: Introduce drm_crtc_vblank_crtc() 2024-04-18 13:27:56 +03:00
drm_vblank_work.c drm: Add drm_vblank_work_flush_all(). 2024-06-24 18:03:18 +02:00
drm_vma_manager.c
drm_writeback.c