All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emil Velikov <emil.l.velikov@gmail.com>
To: Daniel Stone <daniels@collabora.com>, dri-devel@lists.freedesktop.org
Cc: emil.l.velikov@gmail.com
Subject: Re: [PATCH libdrm 2/2] Add blob property create/destroy ioctl wrappers
Date: Thu, 04 Jun 2015 15:14:21 +0000	[thread overview]
Message-ID: <55706B4D.3010308@gmail.com> (raw)
In-Reply-To: <1432298216-22460-3-git-send-email-daniels@collabora.com>

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2015-06-04 14:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 12:36 [PATCH libdrm 0/2] Blob and atomic wrappers Daniel Stone
2015-05-22 12:36 ` [PATCH libdrm 1/2] Support atomic modesetting ioctl Daniel Stone
2015-05-22 12:36 ` [PATCH libdrm 2/2] Add blob property create/destroy ioctl wrappers Daniel Stone
2015-06-04 15:14   ` Emil Velikov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55706B4D.3010308@gmail.com \
    --to=emil.l.velikov@gmail.com \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.