summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_property.c
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2017-09-21 23:18:46 +0200
committerSean Paul <seanpaul@chromium.org>2017-09-21 23:18:46 +0200
commit1ebfc603d046f1dda6507d11803f9b4046cee712 (patch)
tree3be6790f2ce819929b1ccff7993c636e0944705a /drivers/gpu/drm/drm_property.c
parentqxl: fix primary surface handling (diff)
parentMerge tag 'kbuild-fixes-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff)
downloadlinux-1ebfc603d046f1dda6507d11803f9b4046cee712.tar.xz
linux-1ebfc603d046f1dda6507d11803f9b4046cee712.zip
Merge remote-tracking branch 'origin/master' into drm-misc-fixes
Pick up 4.14-rc1 Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/drm_property.c')
-rw-r--r--drivers/gpu/drm/drm_property.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c
index 3e88fa24eab3..bc5128203056 100644
--- a/drivers/gpu/drm/drm_property.c
+++ b/drivers/gpu/drm/drm_property.c
@@ -709,6 +709,29 @@ err_created:
}
EXPORT_SYMBOL(drm_property_replace_global_blob);
+/**
+ * drm_property_replace_blob - replace a blob property
+ * @blob: a pointer to the member blob to be replaced
+ * @new_blob: the new blob to replace with
+ *
+ * Return: true if the blob was in fact replaced.
+ */
+bool drm_property_replace_blob(struct drm_property_blob **blob,
+ struct drm_property_blob *new_blob)
+{
+ struct drm_property_blob *old_blob = *blob;
+
+ if (old_blob == new_blob)
+ return false;
+
+ drm_property_blob_put(old_blob);
+ if (new_blob)
+ drm_property_blob_get(new_blob);
+ *blob = new_blob;
+ return true;
+}
+EXPORT_SYMBOL(drm_property_replace_blob);
+
int drm_mode_getblob_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{