From patchwork Thu Mar 6 06:12:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 3785401 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8EC0DBF540 for ; Thu, 6 Mar 2014 17:03:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C511620160 for ; Thu, 6 Mar 2014 17:03:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E94FE201F7 for ; Thu, 6 Mar 2014 17:03:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A1FB31057D8; Thu, 6 Mar 2014 09:03:09 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 3DC2EFAB4C for ; Wed, 5 Mar 2014 22:13:01 -0800 (PST) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N20006II3XORA60@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 06 Mar 2014 15:13:00 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 47.9B.09028.CE118135; Thu, 06 Mar 2014 15:13:00 +0900 (KST) X-AuditID: cbfee68e-b7f566d000002344-cf-531811ec4efb Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id EA.3E.28157.CE118135; Thu, 06 Mar 2014 15:13:00 +0900 (KST) Received: from localhost.localdomain ([107.108.83.245]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2000AL63X9JW40@mmp1.samsung.com>; Thu, 06 Mar 2014 15:12:59 +0900 (KST) From: Rahul Sharma To: dri-devel@lists.freedesktop.org Subject: [RFC 1/4] drm: allow to create blank writable blob properties Date: Thu, 06 Mar 2014 11:42:11 +0530 Message-id: <1394086334-20967-2-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1394086334-20967-1-git-send-email-rahul.sharma@samsung.com> References: <1394086334-20967-1-git-send-email-rahul.sharma@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42JZI2JSq/tGUCLYYPVySYsT1xcxWRx4f5DF 4srX92wWk+5PYLH4vusLu8WM8/uYLOYd+s1oserwBnaLjRO2MlpMWXSY1eLuhrOMDtwesxsu snjsnHWX3WPBplKP+93HmTz6tqxi9Pi8SS6ALYrLJiU1J7MstUjfLoEr4/X7JraCWVwVmz71 szQw7uPoYuTkkBAwkeib94wRwhaTuHBvPVsXIxeHkMBSRokXza/YYIo+Xf/LCpFYxChxcudT dginnUnizsV/7CBVbAK6ErMPQowSEVCW+DtxFSNIEbNAG5PE7t5epi5GDg5hATeJ2W8zQGpY BFQlvh3dzwpi8wp4SHxf1skOUiIhoCAxZ5INSJhTwFOi+89EJhBbCKhkbv96JpCREgKn2CUO 9L5hhZgjIPFt8iEWiF5ZiU0HmCGOlpQ4uOIGywRG4QWMDKsYRVMLkguKk9KLjPSKE3OLS/PS 9ZLzczcxAuPi9L9nfTsYbx6wPsSYDDRuIrOUaHI+MK7ySuINjc2MLExNTI2NzC3NSBNWEudd 9DApSEggPbEkNTs1tSC1KL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6Ezlq+bl2/ru/rnXvMbO42nRQe8q1kYlmF0 rId941t7dqv3i848dVViKc5INNRiLipOBAD77Vjx/gIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 06 Mar 2014 09:03:00 -0800 Cc: linux-samsung-soc@vger.kernel.org, joshi@samsung.com, r.sh.open@google.com, marcheu@chromium.org, prashanth.g@samsung.com, ajaykumar.rs@samsung.com, Rahul Sharma X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;