[RFC 1/4] drm: allow to create blank writable blob properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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

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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux