xf86drm: dedupe `#define`s
Adapted from a local patch carried by DragonFlyBSD:
bc056f88f7/graphics/libdrm/files/patch-xf86drm.h
Patch is sadly uncredited (a bot authored the commit), so I can't credit
the author here either.
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
main
parent
293b95e815
commit
0d5ea07736
10
xf86drm.c
10
xf86drm.c
|
@ -71,16 +71,6 @@
|
||||||
|
|
||||||
#include "util_math.h"
|
#include "util_math.h"
|
||||||
|
|
||||||
#ifdef __OpenBSD__
|
|
||||||
#define DRM_PRIMARY_MINOR_NAME "drm"
|
|
||||||
#define DRM_CONTROL_MINOR_NAME "drmC"
|
|
||||||
#define DRM_RENDER_MINOR_NAME "drmR"
|
|
||||||
#else
|
|
||||||
#define DRM_PRIMARY_MINOR_NAME "card"
|
|
||||||
#define DRM_CONTROL_MINOR_NAME "controlD"
|
|
||||||
#define DRM_RENDER_MINOR_NAME "renderD"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
||||||
#define DRM_MAJOR 145
|
#define DRM_MAJOR 145
|
||||||
#endif
|
#endif
|
||||||
|
|
16
xf86drm.h
16
xf86drm.h
|
@ -78,17 +78,21 @@ extern "C" {
|
||||||
|
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
#define DRM_DIR_NAME "/dev"
|
#define DRM_DIR_NAME "/dev"
|
||||||
#define DRM_DEV_NAME "%s/drm%d"
|
#define DRM_PRIMARY_MINOR_NAME "drm"
|
||||||
#define DRM_CONTROL_DEV_NAME "%s/drmC%d"
|
#define DRM_CONTROL_MINOR_NAME "drmC"
|
||||||
#define DRM_RENDER_DEV_NAME "%s/drmR%d"
|
#define DRM_RENDER_MINOR_NAME "drmR"
|
||||||
#else
|
#else
|
||||||
#define DRM_DIR_NAME "/dev/dri"
|
#define DRM_DIR_NAME "/dev/dri"
|
||||||
#define DRM_DEV_NAME "%s/card%d"
|
#define DRM_PRIMARY_MINOR_NAME "card"
|
||||||
#define DRM_CONTROL_DEV_NAME "%s/controlD%d"
|
#define DRM_CONTROL_MINOR_NAME "controlD"
|
||||||
#define DRM_RENDER_DEV_NAME "%s/renderD%d"
|
#define DRM_RENDER_MINOR_NAME "renderD"
|
||||||
#define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */
|
#define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define DRM_DEV_NAME "%s/" DRM_PRIMARY_MINOR_NAME "%d"
|
||||||
|
#define DRM_CONTROL_DEV_NAME "%s/" DRM_CONTROL_MINOR_NAME "%d"
|
||||||
|
#define DRM_RENDER_DEV_NAME "%s/" DRM_RENDER_MINOR_NAME "%d"
|
||||||
|
|
||||||
#define DRM_ERR_NO_DEVICE (-1001)
|
#define DRM_ERR_NO_DEVICE (-1001)
|
||||||
#define DRM_ERR_NO_ACCESS (-1002)
|
#define DRM_ERR_NO_ACCESS (-1002)
|
||||||
#define DRM_ERR_NOT_ROOT (-1003)
|
#define DRM_ERR_NOT_ROOT (-1003)
|
||||||
|
|
Loading…
Reference in New Issue