diff --git a/lib/libdrm/intel/intel_bufmgr_gem.c b/lib/libdrm/intel/intel_bufmgr_gem.c index 6f2ea53bd..7cc34e7e8 100644 --- a/lib/libdrm/intel/intel_bufmgr_gem.c +++ b/lib/libdrm/intel/intel_bufmgr_gem.c @@ -1328,7 +1328,6 @@ drm_intel_gem_bo_subdata(drm_intel_bo *bo, unsigned long offset, static int drm_intel_gem_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, int crtc_id) { -#ifndef __OpenBSD__ drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr; struct drm_i915_get_pipe_from_crtc_id get_pipe_from_crtc_id; int ret; @@ -1348,9 +1347,6 @@ drm_intel_gem_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, int crtc_id) } return get_pipe_from_crtc_id.pipe; -#endif - /* only needed for KMS */ - return -1; } static int diff --git a/lib/libdrm/shlib_version b/lib/libdrm/shlib_version index 012c14171..3f0196ebf 100644 --- a/lib/libdrm/shlib_version +++ b/lib/libdrm/shlib_version @@ -1,2 +1,2 @@ major=3 -minor=0 +minor=1 diff --git a/lib/libdrm/xf86drm.c b/lib/libdrm/xf86drm.c index 038b28c8c..7a3992f11 100644 --- a/lib/libdrm/xf86drm.c +++ b/lib/libdrm/xf86drm.c @@ -819,7 +819,6 @@ drmVersionPtr drmGetLibVersion(int fd) int drmGetCap(int fd, uint64_t capability, uint64_t *value) { -#ifndef __OpenBSD__ struct drm_get_cap cap = { capability, 0 }; int ret; @@ -828,7 +827,6 @@ int drmGetCap(int fd, uint64_t capability, uint64_t *value) return ret; *value = cap.value; -#endif return 0; } diff --git a/lib/libdrm/xf86drmMode.c b/lib/libdrm/xf86drmMode.c index a2603a806..e13dd3fbe 100644 --- a/lib/libdrm/xf86drmMode.c +++ b/lib/libdrm/xf86drmMode.c @@ -259,7 +259,6 @@ int drmModeAddFB(int fd, uint32_t width, uint32_t height, uint8_t depth, return 0; } -#ifndef __OpenBSD__ int drmModeAddFB2(int fd, uint32_t width, uint32_t height, uint32_t pixel_format, uint32_t bo_handles[4], uint32_t pitches[4], uint32_t offsets[4], @@ -282,7 +281,6 @@ int drmModeAddFB2(int fd, uint32_t width, uint32_t height, *buf_id = f.fb_id; return 0; } -#endif int drmModeRmFB(int fd, uint32_t bufferId) { @@ -315,7 +313,6 @@ drmModeFBPtr drmModeGetFB(int fd, uint32_t buf) return r; } -#ifndef __OpenBSD__ int drmModeDirtyFB(int fd, uint32_t bufferId, drmModeClipPtr clips, uint32_t num_clips) { @@ -327,7 +324,6 @@ int drmModeDirtyFB(int fd, uint32_t bufferId, return DRM_IOCTL(fd, DRM_IOCTL_MODE_DIRTYFB, &dirty); } -#endif /* @@ -741,8 +737,25 @@ int drmCheckModesettingSupported(const char *busid) if (found) return 0; #endif - return -ENOSYS; +#ifdef __OpenBSD__ + int fd; + struct drm_mode_card_res res; + drmModeResPtr r = 0; + if ((fd = drmOpen(NULL, busid)) < 0) + return -EINVAL; + + memset(&res, 0, sizeof(struct drm_mode_card_res)); + + if (drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res)) { + drmClose(fd); + return -errno; + } + + drmClose(fd); + return 0; +#endif + return -ENOSYS; } int drmModeCrtcGetGamma(int fd, uint32_t crtc_id, uint32_t size, @@ -824,7 +837,6 @@ int drmHandleEvent(int fd, drmEventContextPtr evctx) return 0; } -#ifndef __OpenBSD__ int drmModePageFlip(int fd, uint32_t crtc_id, uint32_t fb_id, uint32_t flags, void *user_data) { @@ -979,4 +991,3 @@ void drmModeFreePlaneResources(drmModePlaneResPtr ptr) drmFree(ptr->planes); drmFree(ptr); } -#endif