[Mesa-dev] [PATCH 5/6] radv: drop local MIN/MAX macros.

Dave Airlie airlied at gmail.com
Fri Oct 14 03:16:42 UTC 2016


From: Dave Airlie <airlied at redhat.com>

Use the ones in macros.h instead.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/vulkan/radv_private.h | 5 +----
 src/amd/vulkan/radv_wsi_x11.c | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 1f5af62..8dddf70 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -85,9 +85,6 @@ typedef uint32_t xcb_window_t;
 #define radv_noreturn __attribute__((__noreturn__))
 #define radv_printflike(a, b) __attribute__((__format__(__printf__, a, b)))
 
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-
 static inline uint32_t
 align_u32(uint32_t v, uint32_t a)
 {
@@ -141,7 +138,7 @@ radv_minify(uint32_t n, uint32_t levels)
 	if (unlikely(n == 0))
 		return 0;
 	else
-		return MAX(n >> levels, 1);
+		return MAX2(n >> levels, 1);
 }
 static inline float
 radv_clamp_f(float f, float min, float max)
diff --git a/src/amd/vulkan/radv_wsi_x11.c b/src/amd/vulkan/radv_wsi_x11.c
index 9cd0db0..8e0040f 100644
--- a/src/amd/vulkan/radv_wsi_x11.c
+++ b/src/amd/vulkan/radv_wsi_x11.c
@@ -823,7 +823,7 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
 	 *  4) One to render to
 	 */
 	if (pCreateInfo->presentMode == VK_PRESENT_MODE_MAILBOX_KHR)
-		num_images = MAX(num_images, 4);
+		num_images = MAX2(num_images, 4);
 
 	size_t size = sizeof(*chain) + num_images * sizeof(chain->images[0]);
 	chain = radv_alloc2(&device->alloc, pAllocator, size, 8,
-- 
2.5.5



More information about the mesa-dev mailing list