Browse Source

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>
tags/11.0-branchpoint
Emil Velikov 10 years ago
parent
commit
1c328b8aa7

+ 2
- 4
src/loader/Android.mk View File

LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
$(LOADER_C_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 LOCAL_SHARED_LIBRARIES := libdrm
endif endif



+ 1
- 4
src/loader/Makefile.am View File



endif endif


if !HAVE_LIBDRM
libloader_la_CPPFLAGS += \
-D__NOT_HAVE_DRM_H
else
if HAVE_LIBDRM
libloader_la_CPPFLAGS += \ libloader_la_CPPFLAGS += \
$(LIBDRM_CFLAGS) $(LIBDRM_CFLAGS)



+ 0
- 2
src/loader/SConscript View File

'#include' '#include'
]) ])


env.Append(CPPDEFINES = ['__NOT_HAVE_DRM_H'])

if env['udev']: if env['udev']:
env.PkgUseModules('UDEV') env.PkgUseModules('UDEV')
env.Append(CPPDEFINES = ['HAVE_LIBUDEV']) env.Append(CPPDEFINES = ['HAVE_LIBUDEV'])

+ 4
- 4
src/loader/loader.c View File

#endif #endif
#include "loader.h" #include "loader.h"


#ifndef __NOT_HAVE_DRM_H
#ifdef HAVE_LIBDRM
#include <xf86drm.h> #include <xf86drm.h>
#endif #endif


} }
#endif #endif


#if !defined(__NOT_HAVE_DRM_H)
#if defined(HAVE_LIBDRM)
/* for i915 */ /* for i915 */
#include <i915_drm.h> #include <i915_drm.h>
/* for radeon */ /* for radeon */
if (sysfs_get_pci_id_for_fd(fd, vendor_id, chip_id)) if (sysfs_get_pci_id_for_fd(fd, vendor_id, chip_id))
return 1; return 1;
#endif #endif
#if !defined(__NOT_HAVE_DRM_H)
#if HAVE_LIBDRM
if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id)) if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id))
return 1; return 1;
#endif #endif


if (!loader_get_pci_id_for_fd(fd, &vendor_id, &chip_id)) { if (!loader_get_pci_id_for_fd(fd, &vendor_id, &chip_id)) {


#ifndef __NOT_HAVE_DRM_H
#if HAVE_LIBDRM
/* fallback to drmGetVersion(): */ /* fallback to drmGetVersion(): */
drmVersionPtr version = drmGetVersion(fd); drmVersionPtr version = drmGetVersion(fd);



+ 1
- 1
src/loader/pci_id_driver_map.c View File



int is_nouveau_vieux(int fd); int is_nouveau_vieux(int fd);


#ifndef __NOT_HAVE_DRM_H
#ifdef HAVE_LIBDRM


#include <xf86drm.h> #include <xf86drm.h>
#include <nouveau_drm.h> #include <nouveau_drm.h>

Loading…
Cancel
Save