aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Gray2015-07-18 16:20:37 -0500
committerEmil Velikov2015-07-29 12:04:15 -0500
commit1d3b823650bf980a48df00b748fef7cfc7c19b14 (patch)
tree4f64f274effa2267078cfb0b6a5dbeb081674436 /xf86drmMode.c
parentd1f321fdf9367d3a488f81c8c3c8b8aa5b8d69bb (diff)
downloadexternal-libdrm-1d3b823650bf980a48df00b748fef7cfc7c19b14.tar.gz
external-libdrm-1d3b823650bf980a48df00b748fef7cfc7c19b14.tar.xz
external-libdrm-1d3b823650bf980a48df00b748fef7cfc7c19b14.zip
xf86drmMode: Implement drmCheckModesettingSupported() for OpenBSD
This is implemented with kms ioctls so it could also be used as a generic fallback. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'xf86drmMode.c')
-rw-r--r--xf86drmMode.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/xf86drmMode.c b/xf86drmMode.c
index fa219861..fc19504d 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -822,8 +822,25 @@ int drmCheckModesettingSupported(const char *busid)
822#elif defined(__DragonFly__) 822#elif defined(__DragonFly__)
823 return 0; 823 return 0;
824#endif 824#endif
825 return -ENOSYS; 825#ifdef __OpenBSD__
826 int fd;
827 struct drm_mode_card_res res;
828 drmModeResPtr r = 0;
829
830 if ((fd = drmOpen(NULL, busid)) < 0)
831 return -EINVAL;
832
833 memset(&res, 0, sizeof(struct drm_mode_card_res));
826 834
835 if (drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res)) {
836 drmClose(fd);
837 return -errno;
838 }
839
840 drmClose(fd);
841 return 0;
842#endif
843 return -ENOSYS;
827} 844}
828 845
829int drmModeCrtcGetGamma(int fd, uint32_t crtc_id, uint32_t size, 846int drmModeCrtcGetGamma(int fd, uint32_t crtc_id, uint32_t size,