From patchwork Thu Mar 19 04:33:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stone X-Patchwork-Id: 6046011 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7161FBF910 for ; Thu, 19 Mar 2015 04:34:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B2D8C204AF for ; Thu, 19 Mar 2015 04:34:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A3A1E204D5 for ; Thu, 19 Mar 2015 04:34:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F9A96E970; Wed, 18 Mar 2015 21:34:13 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [93.93.135.160]) by gabe.freedesktop.org (Postfix) with ESMTP id 86E376E96C for ; Wed, 18 Mar 2015 21:34:11 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: daniels) with ESMTPSA id 83CF9600621 From: Daniel Stone To: dri-devel@lists.freedesktop.org Subject: [RFC PATCH 35/37] drm: property: Allow non-global blob properties Date: Thu, 19 Mar 2015 04:33:34 +0000 Message-Id: <1426739616-10635-35-git-send-email-daniels@collabora.com> X-Mailer: git-send-email 2.3.2 In-Reply-To: <1426739616-10635-1-git-send-email-daniels@collabora.com> References: <1426739556-10429-1-git-send-email-daniels@collabora.com> <1426739616-10635-1-git-send-email-daniels@collabora.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 All blob properties currently go on the device-global property list, which is reaped at device exit. Make the addition to the list optional, to allow for user properties whose lifetime will be tied to their drm_file. Signed-off-by: Daniel Stone --- drivers/gpu/drm/drm_crtc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index c1b3801..21e2052 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -4118,7 +4118,7 @@ done: static struct drm_property_blob * drm_property_create_blob(struct drm_device *dev, size_t length, - const void *data) + const void *data, bool global) { struct drm_property_blob *blob; int ret; @@ -4140,7 +4140,10 @@ drm_property_create_blob(struct drm_device *dev, size_t length, memcpy(blob->data, data, length); - list_add_tail(&blob->head, &dev->mode_config.property_blob_list); + if (global) + list_add_tail(&blob->head, + &dev->mode_config.property_blob_list); + return blob; } @@ -4233,7 +4236,7 @@ int drm_mode_connector_set_path_property(struct drm_connector *connector, int ret; connector->path_blob_ptr = drm_property_create_blob(connector->dev, - size, path); + size, path, true); if (!connector->path_blob_ptr) return -EINVAL; @@ -4279,7 +4282,7 @@ int drm_mode_connector_set_tile_property(struct drm_connector *connector) size = strlen(tile) + 1; connector->tile_blob_ptr = drm_property_create_blob(connector->dev, - size, tile); + size, tile, true); if (!connector->tile_blob_ptr) return -EINVAL; @@ -4324,7 +4327,7 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector, size = EDID_LENGTH * (1 + edid->extensions); connector->edid_blob_ptr = drm_property_create_blob(connector->dev, - size, edid); + size, edid, true); if (!connector->edid_blob_ptr) return -EINVAL;