linux/drivers/gpu/drm/radeon
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
..
reg_srcs
.gitignore
Kconfig Revert "drm: Switch DRM_DISPLAY_HELPER to depends on" 2024-05-02 17:58:23 +02:00
Makefile
ObjectID.h
atom-bits.h drm/radeon: Clean up errors in ni_dpm.c 2024-01-18 15:39:02 -05:00
atom-names.h
atom-types.h
atom.c drm/radeon: check PS, WS index 2024-01-15 18:35:37 -05:00
atom.h drm/radeon: check PS, WS index 2024-01-15 18:35:37 -05:00
atombios.h drm/radeon: replace 1-element arrays with flexible-array members 2023-11-03 11:59:51 -04:00
atombios_crtc.c drm/radeon: check PS, WS index 2024-01-15 18:35:37 -05:00
atombios_dp.c drm/radeon: check PS, WS index 2024-01-15 18:35:37 -05:00
atombios_encoders.c drm-misc-next for 6.11: 2024-06-21 10:30:31 +10:00
atombios_i2c.c drm/radeon: check PS, WS index 2024-01-15 18:35:37 -05:00
avivod.h
btc_dpm.c drm/radeon/btc_dpm: Clean up errors in btc_dpm.c 2024-01-18 15:39:11 -05:00
btc_dpm.h
btcd.h
cayman_blit_shaders.h
ci_dpm.c drm/radeon/ci_dpm: Clean up errors in ci_dpm.c 2024-01-18 15:39:42 -05:00
ci_dpm.h drm/radeon: Clean up errors in ci_dpm.h 2024-01-18 15:40:19 -05:00
ci_smc.c
cik.c drm/radeon: Use RMW accessors for changing LNKCTL2 2024-02-22 10:30:50 -05:00
cik.h
cik_blit_shaders.h
cik_reg.h
cik_sdma.c
cikd.h
clearstate_cayman.h drm/radeon: Clean up errors in clearstate_cayman.h 2024-01-18 15:40:15 -05:00
clearstate_ci.h drm/radeon: Clean up errors in clearstate_ci.h 2024-01-18 15:40:13 -05:00
clearstate_defs.h
clearstate_evergreen.h drm/radeon: Fix warning using plain integer as NULL 2023-11-17 09:29:54 -05:00
clearstate_si.h drm/radeon: that open brace { should be on the previous line 2023-07-27 14:47:29 -04:00
cypress_dpm.c drm/radeon: fix possible division-by-zero errors 2023-06-09 10:44:47 -04:00
cypress_dpm.h
dce3_1_afmt.c drm/radeon: include drm/drm_edid.h only where needed 2023-12-13 15:28:31 -05:00
dce6_afmt.c drm/radeon: include drm/drm_edid.h only where needed 2023-12-13 15:28:31 -05:00
dce6_afmt.h
evergreen.c drm/radeon: Clean up errors in evergreen.c 2024-01-18 15:39:47 -05:00
evergreen.h
evergreen_blit_shaders.h
evergreen_cs.c minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
evergreen_dma.c
evergreen_hdmi.c drm/radeon: convert to using is_hdmi and has_audio from display info 2024-05-23 14:37:24 +03:00
evergreen_hdmi.h
evergreen_reg.h drm/radeon: Clean up errors in evergreen_reg.h 2024-01-18 15:39:55 -05:00
evergreen_smc.h drm/radeon/dpm: Clean up errors in evergreen_smc.h 2024-01-18 15:40:17 -05:00
evergreend.h
kv_dpm.c drm/radeon: Clean up errors in trinity_dpm.c 2024-01-18 15:38:42 -05:00
kv_dpm.h
kv_smc.c drm/radeon: Clean up errors in kv_smc.c 2024-01-18 15:39:53 -05:00
mkregtable.c
ni.c drm/radeon/ni: Fix wrong firmware size logging in ni_init_microcode() 2024-02-12 16:13:47 -05:00
ni.h
ni_dma.c
ni_dpm.c drm/radeon/ni_dpm: remove redundant NULL check 2024-01-22 16:56:28 -05:00
ni_dpm.h drm/radeon/ni_dpm: Clean up errors in ni_dpm.c 2024-01-18 15:38:59 -05:00
ni_reg.h
nid.h
nislands_smc.h drm/radeon/ni_dpm: Clean up errors in nislands_smc.h 2024-01-18 15:40:36 -05:00
ppsmc.h
pptable.h drm/radeon: Remove __counted_by from StateArray.states[] 2024-06-05 10:58:19 -04:00
r100.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
r100_track.h
r100d.h
r200.c
r300.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
r300_reg.h gpu/drm/radeon: Clean up errors in evergreen.c 2024-01-18 15:39:50 -05:00
r300d.h
r420.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
r420d.h
r500_reg.h
r520.c
r520d.h
r600.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
r600.h
r600_cs.c drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg() 2023-11-30 18:26:31 -05:00
r600_dma.c
r600_dpm.c drm/radeon: Clean up errors in r600_dpm.c 2024-01-18 15:40:04 -05:00
r600_dpm.h drm/radeon: Clean up errors in r600_dpm.h 2024-01-18 15:38:52 -05:00
r600_hdmi.c
r600_reg.h
r600d.h
radeon.h drm/radeon/radeon_display: Decrease the size of allocated memory 2024-04-09 22:19:39 -04:00
radeon_acpi.c drm/radeon: Use pci_dev_id() to simplify the code 2023-08-15 18:08:29 -04:00
radeon_acpi.h drm/radeon: Fix missing prototypes in radeon_atpx_handler.c 2023-06-15 11:06:58 -04:00
radeon_agp.c drm/radeon: Remove unnecessary NULL values 2023-08-15 18:08:27 -04:00
radeon_asic.c drm/radeon: Clean up errors in radeon_asic.c 2024-01-18 15:39:16 -05:00
radeon_asic.h
radeon_atombios.c drm/radeon: make -fstrict-flex-arrays=3 happy 2024-04-16 22:39:16 -04:00
radeon_atombios.h
radeon_atpx_handler.c drm/radeon: Clean up errors in radeon_atpx_handler.c 2024-01-18 15:38:46 -05:00
radeon_audio.c drm/radeon: remove radeon_connector_edid() and stop using edid_blob_ptr 2024-05-23 14:37:24 +03:00
radeon_audio.h drm/radeon: Clean up errors in radeon_audio.h 2024-01-18 15:39:27 -05:00
radeon_benchmark.c
radeon_bios.c drm/radeon: Use pci_get_base_class() to reduce duplicated code 2023-09-28 16:54:54 -05:00
radeon_clocks.c
radeon_combios.c drm/radeon: include drm/drm_edid.h only where needed 2023-12-13 15:28:31 -05:00
radeon_connectors.c drm-misc-next for 6.11: 2024-06-21 10:30:31 +10:00
radeon_cs.c
radeon_cursor.c
radeon_device.c
radeon_device.h
radeon_display.c drm/radeon: convert to using is_hdmi and has_audio from display info 2024-05-23 14:37:24 +03:00
radeon_dp_auxch.c
radeon_drv.c drm/radeon: Remove the references of radeon_gem_ pread & pwrite ioctls 2023-08-30 15:51:13 -04:00
radeon_drv.h drm/radeon: Do not include <drm/drm_legacy.h> 2023-12-06 10:08:17 +01:00
radeon_encoders.c drm/radeon: convert to using is_hdmi and has_audio from display info 2024-05-23 14:37:24 +03:00
radeon_family.h
radeon_fbdev.c fbdev: Use _IOMEM_ infix for I/O-memory helpers 2023-07-31 20:06:52 +02:00
radeon_fence.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
radeon_gart.c drm/radeon: Fix style issues in radeon _encoders.c & _gart.c 2023-07-25 13:37:05 -04:00
radeon_gem.c drm/radeon: check bo_va->bo is non-NULL before using it 2024-07-01 16:10:47 -04:00
radeon_i2c.c drm: remove I2C_CLASS_DDC support 2024-01-18 21:10:41 +01:00
radeon_ib.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
radeon_irq_kms.c drm/radeon: reintroduce radeon_dp_work_func content 2023-06-09 10:42:07 -04:00
radeon_kms.c drm/radeon: ERROR: "(foo*)" should be "(foo *)" 2023-07-12 11:12:09 -04:00
radeon_kms.h
radeon_legacy_crtc.c
radeon_legacy_encoders.c drm/radeon: Remove unnecessary NULL values 2023-08-15 18:08:27 -04:00
radeon_legacy_encoders.h
radeon_legacy_tv.c drm/radeon: Move assignment outside if condition 2023-07-27 14:47:34 -04:00
radeon_mn.c
radeon_mode.h drm/radeon: remove radeon_connector_edid() and stop using edid_blob_ptr 2024-05-23 14:37:24 +03:00
radeon_object.c drm/ttm: replace busy placement with flags v6 2024-01-25 09:59:44 +01:00
radeon_object.h
radeon_pm.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
radeon_pm.h
radeon_prime.c drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}() 2024-03-11 13:33:50 +01:00
radeon_prime.h
radeon_reg.h
radeon_ring.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
radeon_sa.c drm/radeon: make fence wait in suballocator uninterrruptable 2023-09-07 17:45:34 +02:00
radeon_semaphore.c
radeon_sync.c
radeon_test.c drm/radeon: ERROR: "(foo*)" should be "(foo *)" 2023-07-12 11:12:09 -04:00
radeon_trace.h
radeon_trace_points.c
radeon_ttm.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
radeon_ttm.h
radeon_ucode.c
radeon_ucode.h
radeon_uvd.c drm/ttm: replace busy placement with flags v6 2024-01-25 09:59:44 +01:00
radeon_vce.c drm/radeon: add missing spaces before ';' 2023-07-25 13:47:27 -04:00
radeon_vm.c gpu/drm/radeon: fix two memleaks in radeon_vm_init 2023-12-14 15:28:53 -05:00
rs100d.h
rs400.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
rs400d.h
rs600.c drm/radeon: Clean up errors in rs600.c 2024-01-18 15:39:38 -05:00
rs600d.h
rs690.c
rs690d.h
rs780_dpm.c
rs780_dpm.h
rs780d.h
rv6xx_dpm.c
rv6xx_dpm.h drm/radeon/kms: Clean up errors in rv6xx_dpm.h 2024-01-18 15:39:14 -05:00
rv6xxd.h
rv200d.h
rv250d.h
rv350d.h
rv515.c drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
rv515d.h
rv730_dpm.c
rv730d.h
rv740_dpm.c drm/radeon: fix possible division-by-zero errors 2023-06-09 10:44:47 -04:00
rv740d.h
rv770.c drm/radeon: ERROR: that open brace { should be on the previous line 2023-07-12 11:12:09 -04:00
rv770.h
rv770_dma.c
rv770_dpm.c drm/radeon/rv770: Clean up errors in rv770_dpm.c 2024-01-18 15:39:07 -05:00
rv770_dpm.h
rv770_smc.c drm/radeon: that open brace { should be on the previous line 2023-07-27 14:47:31 -04:00
rv770_smc.h drm/radeon: Clean up errors in rv770_smc.h 2024-01-18 15:39:45 -05:00
rv770d.h
si.c drm/radeon: Use RMW accessors for changing LNKCTL2 2024-02-22 10:30:50 -05:00
si.h
si_blit_shaders.h
si_dma.c
si_dpm.c drm/radeon: Clean up errors in si_dpm.c 2024-01-18 15:38:38 -05:00
si_dpm.h drm/radeon: Clean up errors in si_dpm.h 2024-01-18 15:39:35 -05:00
si_reg.h
si_smc.c
sid.h
sislands_smc.h drm/radeon/si_dpm: open brace '{' following struct go on the same line 2023-07-25 13:47:27 -04:00
smu7.h drm/radeon/kms: Clean up errors in smu7.h 2024-01-18 15:40:08 -05:00
smu7_discrete.h drm/radeon: Clean up errors in smu7_discrete.h 2024-01-18 15:39:04 -05:00
smu7_fusion.h drm/radeon/kms: Clean up errors in smu7_fusion.h 2024-01-18 15:40:06 -05:00
sumo_dpm.c drm/radeon: fix UBSAN warning in kv_dpm.c 2024-06-19 12:48:10 -04:00
sumo_dpm.h
sumo_smc.c
sumod.h
trinity_dpm.c drm/radeon/trinity_dpm: Clean up errors in trinity_dpm.c 2024-01-18 15:38:39 -05:00
trinity_dpm.h drm/radeon/dpm: Clean up errors in trinity_dpm.h 2024-01-18 15:39:09 -05:00
trinity_smc.c
trinityd.h
uvd_v1_0.c drm/radeon: Clean up errors in uvd_v1_0.c 2024-01-18 15:39:18 -05:00
uvd_v2_2.c
uvd_v3_1.c
uvd_v4_2.c
vce.h
vce_v1_0.c
vce_v2_0.c