Hi Daniel, On 22/05/15 12:36, Daniel Stone wrote:
Signed-off-by: Daniel Stone daniels@collabora.com
There is a trivial suggestion inline, although I must say thank you ! Thank you for keeping the impl. details of struct _drmModeAtomicReqItem/_drmModeAtomicReq out of the public headers.
--- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -1333,3 +1333,34 @@ out:
return ret; }
+int +drmModeCreatePropertyBlob(int fd, const void *data, size_t length, uint32_t *id) +{
- struct drm_mode_create_blob create;
Please explicitly zero the struct - most places use memclear()
- int ret;
- if (length >= 0xffffffff)
return -ERANGE;
- create.length = length;
- create.data = (uintptr_t) data;
- create.blob_id = 0;
- *id = 0;
- ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_CREATEPROPBLOB, &create);
- if (ret != 0)
return ret;
- *id = create.blob_id;
- return 0;
+}
+int +drmModeDestroyPropertyBlob(int fd, uint32_t id) +{
- struct drm_mode_destroy_blob destroy;
Ditto.
Thanks Emil