From: Daniel Stone <daniels@collabora.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 03/11] drm: Retain reference to blob properties in lookup
Date: Fri, 22 May 2015 13:34:46 +0100 [thread overview]
Message-ID: <1432298094-22239-4-git-send-email-daniels@collabora.com> (raw)
In-Reply-To: <1432298094-22239-1-git-send-email-daniels@collabora.com>
When we look up a blob property, make sure we retain a reference to the
blob for the lifetime.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Sean Paul <seanpaul@chromium.org>
---
drivers/gpu/drm/drm_crtc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 7e5085f..da2b117 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -4661,7 +4661,9 @@ bool drm_property_change_valid_get(struct drm_property *property,
for (i = 0; i < property->num_values; i++)
valid_mask |= (1ULL << property->values[i]);
return !(value & ~valid_mask);
- } else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB)) {
+ } else if (drm_property_type_is(property, DRM_MODE_PROP_BLOB) ||
+ (drm_property_type_is(property, DRM_MODE_PROP_OBJECT) &&
+ property->values[0] == DRM_MODE_OBJECT_BLOB)) {
struct drm_property_blob *blob;
if (value == 0)
@@ -4709,6 +4711,8 @@ void drm_property_change_valid_put(struct drm_property *property,
if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
if (property->values[0] == DRM_MODE_OBJECT_FB)
drm_framebuffer_unreference(obj_to_fb(ref));
+ else if (property->values[0] == DRM_MODE_OBJECT_BLOB)
+ drm_property_unreference_blob(obj_to_blob(ref));
}
}
--
2.4.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-05-22 12:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-22 12:34 [PATCH 00/11] CRTC state mode property Daniel Stone
2015-05-22 12:34 ` [PATCH 01/11] drm: kerneldoc fixes for blob properties Daniel Stone
2015-05-22 12:34 ` [PATCH 02/11] drm/crtc_helper: Replace open-coded CRTC state helpers Daniel Stone
2015-05-22 12:34 ` Daniel Stone [this message]
2015-05-22 14:11 ` [PATCH 03/11] drm: Retain reference to blob properties in lookup Daniel Vetter
2015-05-22 12:34 ` [PATCH 04/11] drm/mode: Validate modes inside drm_crtc_convert_umode Daniel Stone
2015-05-22 12:34 ` [PATCH 05/11] drm/mode: Unstatic kernel-userspace mode conversion Daniel Stone
2015-05-22 12:34 ` [PATCH 06/11] drm: Allow creating blob properties without copy Daniel Stone
2015-05-22 12:34 ` [PATCH 07/11] drm: Return error value from blob creation Daniel Stone
2015-05-22 12:34 ` [PATCH 08/11] drm/mode: Add user blob-creation ioctl Daniel Stone
2015-05-22 12:34 ` [PATCH 09/11] drm: Add drm_atomic_set_mode_for_crtc Daniel Stone
2015-05-22 14:26 ` Daniel Vetter
2015-05-22 12:34 ` [PATCH 10/11] drm/atomic: Add current-mode blob to CRTC state Daniel Stone
2015-05-22 14:30 ` Daniel Vetter
2015-05-22 12:34 ` [PATCH 11/11] drm: atomic: Add MODE_ID property Daniel Stone
2015-05-22 14:34 ` Daniel Vetter
2015-05-25 13:06 ` Daniel Stone
2015-05-26 6:32 ` Daniel Vetter
2015-05-22 14:35 ` [PATCH 00/11] CRTC state mode property Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1432298094-22239-4-git-send-email-daniels@collabora.com \
--to=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).