From patchwork Thu Mar 6 08:02:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 3785371 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 67BB2BF540 for ; Thu, 6 Mar 2014 17:03:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4589F20213 for ; Thu, 6 Mar 2014 17:03:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7C448201F7 for ; Thu, 6 Mar 2014 17:03:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 994B31057D4; Thu, 6 Mar 2014 09:03:03 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id B6872FAB34 for ; Thu, 6 Mar 2014 00:04:11 -0800 (PST) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N200098Z92YLP20@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 06 Mar 2014 17:04:10 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.122]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id CA.D5.10092.AFB28135; Thu, 06 Mar 2014 17:04:10 +0900 (KST) X-AuditID: cbfee68f-b7f156d00000276c-5b-53182bfa60e1 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id E9.FE.28157.AFB28135; Thu, 06 Mar 2014 17:04:10 +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 <0N2000IXZ91O4E30@mmp1.samsung.com>; Thu, 06 Mar 2014 17:04:10 +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 13:32:50 +0530 Message-id: <1394092973-13423-2-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1394092973-13423-1-git-send-email-rahul.sharma@samsung.com> References: <1394092973-13423-1-git-send-email-rahul.sharma@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkkeLIzCtJLcpLzFFi42JZI2JSpftLWyLYYN5tWYsT1xcxWRx4f5DF 4srX92wWk+5PYLH4vusLu8WM8/uYLOYd+s1oserwBnaLhS/iLaYsOsxqcXfDWUYHbo/ZDRdZ PHbOusvucb/7OJNH35ZVjB6fN8kFsEZx2aSk5mSWpRbp2yVwZbx+38RWMIurYtOnfpYGxn0c XYycHBICJhJPVn5lhLDFJC7cW8/WxcjFISSwlFHifd8pVpiijmkvWSASixgl7r/8wgzhtDNJ zJp/EKyKTUBXYvbBZ2CjRASUJf5OXMUIUsQs0Mokcfv9XaAiDg5hATeJ2W8zQGpYBFQl/t9f yg5i8wp4SPz9MJkFpERCQEFiziQbkDCngKfEwUOnmUFsIaCSFxvusYOMlBDYxy7R8KaHHWKO gMS3yYegemUlNh1ghjhaUuLgihssExiFFzAyrGIUTS1ILihOSi8y1itOzC0uzUvXS87P3cQI jIbT/57172C8e8D6EGMy0LiJzFKiyfnAaMoriTc0NjOyMDUxNTYytzQjTVhJnPf+w6QgIYH0 xJLU7NTUgtSi+KLSnNTi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fI2aqpJWvZb1uG7tzvPOO+Ftym8oL Xy5jlrK7psRSnJFoqMVcVJwIAEHeQor5AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 06 Mar 2014 09:03:01 -0800 Cc: linux-samsung-soc@vger.kernel.org, joshi@samsung.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;