dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Daniel Stone <daniels@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 03/11] drm: Retain reference to blob properties in lookup
Date: Fri, 22 May 2015 16:11:47 +0200	[thread overview]
Message-ID: <20150522141147.GT15256@phenom.ffwll.local> (raw)
In-Reply-To: <1432298094-22239-4-git-send-email-daniels@collabora.com>

On Fri, May 22, 2015 at 01:34:46PM +0100, Daniel Stone wrote:
> 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));

Hm why this? I know it's a bit inconsistent that for all the other atomic
obj props we use DRM_MODE_PROP_OBJ, but for blobs we have a special one. I
guess I'll see the reason later on, but without more details I'd vote to
not subsume props under the generic PROP_OBJECT.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-05-22 14:09 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 ` [PATCH 03/11] drm: Retain reference to blob properties in lookup Daniel Stone
2015-05-22 14:11   ` Daniel Vetter [this message]
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=20150522141147.GT15256@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=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).