mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
loader: use HAVE_LIBDRM instead of ! __NOT_HAVE_DRM_H
Double negatives in English language are normally avoided, plus the former seems cleaner and more consistent. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
72c784347b
commit
1c328b8aa7
5 changed files with 8 additions and 15 deletions
|
|
@ -33,10 +33,8 @@ include $(CLEAR_VARS)
|
|||
LOCAL_SRC_FILES := \
|
||||
$(LOADER_C_FILES)
|
||||
|
||||
# swrast only
|
||||
ifeq ($(MESA_GPU_DRIVERS),swrast)
|
||||
LOCAL_CFLAGS += -D__NOT_HAVE_DRM_H
|
||||
else
|
||||
ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
|
||||
LOCAL_CFLAGS += -DHAVE_LIBDRM
|
||||
LOCAL_SHARED_LIBRARIES := libdrm
|
||||
endif
|
||||
|
||||
|
|
|
|||
|
|
@ -48,10 +48,7 @@ libloader_la_CPPFLAGS += \
|
|||
|
||||
endif
|
||||
|
||||
if !HAVE_LIBDRM
|
||||
libloader_la_CPPFLAGS += \
|
||||
-D__NOT_HAVE_DRM_H
|
||||
else
|
||||
if HAVE_LIBDRM
|
||||
libloader_la_CPPFLAGS += \
|
||||
$(LIBDRM_CFLAGS)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ env.Prepend(CPPPATH = [
|
|||
'#include'
|
||||
])
|
||||
|
||||
env.Append(CPPDEFINES = ['__NOT_HAVE_DRM_H'])
|
||||
|
||||
if env['udev']:
|
||||
env.PkgUseModules('UDEV')
|
||||
env.Append(CPPDEFINES = ['HAVE_LIBUDEV'])
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@
|
|||
#endif
|
||||
#include "loader.h"
|
||||
|
||||
#ifndef __NOT_HAVE_DRM_H
|
||||
#ifdef HAVE_LIBDRM
|
||||
#include <xf86drm.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -505,7 +505,7 @@ sysfs_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if !defined(__NOT_HAVE_DRM_H)
|
||||
#if defined(HAVE_LIBDRM)
|
||||
/* for i915 */
|
||||
#include <i915_drm.h>
|
||||
/* for radeon */
|
||||
|
|
@ -588,7 +588,7 @@ loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
|
|||
if (sysfs_get_pci_id_for_fd(fd, vendor_id, chip_id))
|
||||
return 1;
|
||||
#endif
|
||||
#if !defined(__NOT_HAVE_DRM_H)
|
||||
#if HAVE_LIBDRM
|
||||
if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id))
|
||||
return 1;
|
||||
#endif
|
||||
|
|
@ -699,7 +699,7 @@ loader_get_driver_for_fd(int fd, unsigned driver_types)
|
|||
|
||||
if (!loader_get_pci_id_for_fd(fd, &vendor_id, &chip_id)) {
|
||||
|
||||
#ifndef __NOT_HAVE_DRM_H
|
||||
#if HAVE_LIBDRM
|
||||
/* fallback to drmGetVersion(): */
|
||||
drmVersionPtr version = drmGetVersion(fd);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
int is_nouveau_vieux(int fd);
|
||||
|
||||
#ifndef __NOT_HAVE_DRM_H
|
||||
#ifdef HAVE_LIBDRM
|
||||
|
||||
#include <xf86drm.h>
|
||||
#include <nouveau_drm.h>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue