All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rahul Sharma <rahul.sharma@samsung.com>
To: dri-devel@lists.freedesktop.org
Cc: airlied@gmail.com, inki.dae@samsung.com, prashanth.g@samsung.com,
	seanpaul@chromium.org, marcheu@chromium.org, joshi@samsung.com,
	linux-samsung-soc@vger.kernel.org, r.sh.open@gmail.com,
	ajaykumar.rs@samsung.com, Rahul Sharma <rahul.sharma@samsung.com>
Subject: [RFC 1/4] drm: allow to create blank writable blob properties
Date: Thu, 06 Mar 2014 13:32:50 +0530	[thread overview]
Message-ID: <1394092973-13423-2-git-send-email-rahul.sharma@samsung.com> (raw)
In-Reply-To: <1394092973-13423-1-git-send-email-rahul.sharma@samsung.com>

There is no provision to create a blob property without
providing binary data. This data is needed to fill inside
the blob.

With subsequent patches, blob properties are modified to
receive well defined structures by the user application.
DRM creates a blank blob (initialized with all zeros) which
can be filled by user application through set_blob ioctl.

Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
---
 drivers/gpu/drm/drm_crtc.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 35ea15d..9a2215c 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -3190,7 +3190,7 @@ static struct drm_property_blob *drm_property_create_blob(struct drm_device *dev
 	struct drm_property_blob *blob;
 	int ret;
 
-	if (!length || !data)
+	if (!length)
 		return NULL;
 
 	blob = kzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL);
@@ -3205,7 +3205,8 @@ static struct drm_property_blob *drm_property_create_blob(struct drm_device *dev
 
 	blob->length = length;
 
-	memcpy(blob->data, data, length);
+	if (data)
+		memcpy(blob->data, data, length);
 
 	list_add_tail(&blob->head, &dev->mode_config.property_blob_list);
 	return blob;
-- 
1.7.9.5

  reply	other threads:[~2014-03-06  8:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06  8:02 [RFC 0/4] drm: add generic KMS blob properties for image enhancement Rahul Sharma
2014-03-06  8:02 ` Rahul Sharma [this message]
2014-03-06  8:02 ` [RFC 2/4] drm: add ioctl to write into binary blob KMS properties Rahul Sharma
2014-03-06  8:02 ` [RFC 3/4] drm: add generic blob properties for image enhancement Rahul Sharma
2014-03-06  8:02 ` [RFC 4/4] drm: export create and destroy function for blob properties Rahul Sharma
  -- strict thread matches above, loose matches on Subject: below --
2014-03-06  6:12 [RFC 0/4] drm: add generic KMS blob properties for image enhancement Rahul Sharma
2014-03-06  6:12 ` [RFC 1/4] drm: allow to create blank writable blob properties Rahul Sharma

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=1394092973-13423-2-git-send-email-rahul.sharma@samsung.com \
    --to=rahul.sharma@samsung.com \
    --cc=airlied@gmail.com \
    --cc=ajaykumar.rs@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=joshi@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=marcheu@chromium.org \
    --cc=prashanth.g@samsung.com \
    --cc=r.sh.open@gmail.com \
    --cc=seanpaul@chromium.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.