drmFree(ptr->connectors);
drmFree(ptr->encoders);
drmFree(ptr);
-
}
void drmModeFreeFB(drmModeFBPtr ptr)
return;
drmFree(ptr);
-
}
void drmModeFreeConnector(drmModeConnectorPtr ptr)
drmFree(ptr->props);
drmFree(ptr->modes);
drmFree(ptr);
-
}
void drmModeFreeEncoder(drmModeEncoderPtr ptr)
}
int drmModeAddFB(int fd, uint32_t width, uint32_t height, uint8_t depth,
- uint8_t bpp, uint32_t pitch, uint32_t bo_handle,
+ uint8_t bpp, uint32_t pitch, uint32_t bo_handle,
uint32_t *buf_id)
{
struct drm_mode_fb_cmd f;
return DRM_IOCTL(fd, DRM_IOCTL_MODE_DIRTYFB, &dirty);
}
-
/*
* Crtc functions
*/
return r;
}
-
int drmModeSetCrtc(int fd, uint32_t crtcId, uint32_t bufferId,
- uint32_t x, uint32_t y, uint32_t *connectors, int count,
+ uint32_t x, uint32_t y, uint32_t *connectors, int count,
drmModeModeInfoPtr mode)
{
struct drm_mode_crtc crtc;
return DRM_IOCTL(fd, DRM_IOCTL_MODE_DETACHMODE, &res);
}
-
drmModePropertyPtr drmModeGetProperty(int fd, uint32_t property_id)
{
struct drm_mode_get_property prop;
#elif defined(__DragonFly__)
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,
int len, i;
struct drm_event *e;
struct drm_event_vblank *vblank;
-
+
/* The DRM read semantics guarantees that we always get only
* complete events. */
break;
vblank = (struct drm_event_vblank *) e;
evctx->vblank_handler(fd,
- vblank->sequence,
+ vblank->sequence,
vblank->tv_sec,
vblank->tv_usec,
U642VOID (vblank->user_data));
uint32_t crtc_w, uint32_t crtc_h,
uint32_t src_x, uint32_t src_y,
uint32_t src_w, uint32_t src_h)
-
{
struct drm_mode_set_plane s;
return DRM_IOCTL(fd, DRM_IOCTL_MODE_SETPLANE, &s);
}
-
drmModePlanePtr drmModeGetPlane(int fd, uint32_t plane_id)
{
struct drm_mode_get_plane ovr, counts;