vk_image.c: #ifndef _WIN32 --> DETECT_OS_LINUX + DETECT_OS_BSD

DRM modifiers are a BSD/Linux phenomenon.

We can also remove a bunch of these checks too.  No Linux specific
symbol or header is **actually** used, and the DRM modifier is
just represented as uint64_t.  But kept the style of the file
as is.

Reviewed-by: Serdar Kocdemir <kocdemir@google.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27425>
This commit is contained in:
Gurchetan Singh
2024-02-01 18:12:54 -08:00
committed by Marge Bot
parent 1fa171650a
commit 0525dac7f8
2 changed files with 5 additions and 4 deletions

View File

@@ -23,7 +23,7 @@
#include "vk_image.h"
#ifndef _WIN32
#if DETECT_OS_LINUX || DETECT_OS_BSD
#include <drm-uapi/drm_fourcc.h>
#endif
@@ -96,7 +96,7 @@ vk_image_init(struct vk_device *device,
vk_find_struct_const(pCreateInfo->pNext, WSI_IMAGE_CREATE_INFO_MESA);
image->wsi_legacy_scanout = wsi_info && wsi_info->scanout;
#ifndef _WIN32
#if DETECT_OS_LINUX || DETECT_OS_BSD
image->drm_format_mod = ((1ULL << 56) - 1) /* DRM_FORMAT_MOD_INVALID */;
#endif
@@ -145,7 +145,7 @@ vk_image_destroy(struct vk_device *device,
vk_object_free(device, alloc, image);
}
#ifndef _WIN32
#if DETECT_OS_LINUX || DETECT_OS_BSD
VKAPI_ATTR VkResult VKAPI_CALL
vk_common_GetImageDrmFormatModifierPropertiesEXT(UNUSED VkDevice device,
VkImage _image,

View File

@@ -25,6 +25,7 @@
#include "vk_object.h"
#include "util/detect_os.h"
#include "util/u_math.h"
#ifdef __cplusplus
@@ -63,7 +64,7 @@ struct vk_image {
/* wsi_image_create_info::scanout */
bool wsi_legacy_scanout;
#ifndef _WIN32
#if DETECT_OS_LINUX || DETECT_OS_BSD
/* VK_EXT_drm_format_modifier
*
* Initialized by vk_image_create/init() to DRM_FORMAT_MOD_INVALID. It's