dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: dri-devel@lists.freedesktop.org
Subject: Re: [RFC 1/6] drm/fence: add FENCE_FD property to planes
Date: Thu, 24 Mar 2016 16:52:59 +0900	[thread overview]
Message-ID: <56F39CDB.7050607@samsung.com> (raw)
In-Reply-To: <1458758847-21170-2-git-send-email-gustavo@padovan.org>

Hi,

2016년 03월 24일 03:47에 Gustavo Padovan 이(가) 쓴 글:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> FENCE_FD can now be set by the user during an atomic IOCTL, it
> will be used by atomic_commit to wait until the sync_file is signalled,
> i.e., the framebuffer is ready for scanout.

It seems that this patch makes Linux DRM to be dependent of Android which uses explicit sync interfaces.
So was there any a consensus that Android sync driver is used for DMA buffer synchronization as a Linux standard?

I see the Android sync driver exists in staging yet. Isn't the implicit sync interface used for DMA device as a Linux standard?
I don't see why Android specific things are spreaded into Linux DRM.

Thanks,
Inki Dae

> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
>  drivers/gpu/drm/drm_atomic.c        | 4 ++++
>  drivers/gpu/drm/drm_atomic_helper.c | 1 +
>  drivers/gpu/drm/drm_crtc.c          | 7 +++++++
>  include/drm/drm_crtc.h              | 3 +++
>  4 files changed, 15 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 8fb469c..8bc364c 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -609,6 +609,8 @@ int drm_atomic_plane_set_property(struct drm_plane *plane,
>  		drm_atomic_set_fb_for_plane(state, fb);
>  		if (fb)
>  			drm_framebuffer_unreference(fb);
> +	} else if (property == config->prop_fence_fd) {
> +		state->fence_fd = val;
>  	} else if (property == config->prop_crtc_id) {
>  		struct drm_crtc *crtc = drm_crtc_find(dev, val);
>  		return drm_atomic_set_crtc_for_plane(state, crtc);
> @@ -666,6 +668,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane,
>  
>  	if (property == config->prop_fb_id) {
>  		*val = (state->fb) ? state->fb->base.id : 0;
> +	} else if (property == config->prop_fence_fd) {
> +		*val = state->fence_fd;
>  	} else if (property == config->prop_crtc_id) {
>  		*val = (state->crtc) ? state->crtc->base.id : 0;
>  	} else if (property == config->prop_crtc_x) {
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 2b430b0..4f91f84 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2594,6 +2594,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane)
>  	if (plane->state) {
>  		plane->state->plane = plane;
>  		plane->state->rotation = BIT(DRM_ROTATE_0);
> +		plane->state->fence_fd = -1;
>  	}
>  }
>  EXPORT_SYMBOL(drm_atomic_helper_plane_reset);
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 65258ac..165f199 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -1291,6 +1291,7 @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane,
>  
>  	if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
>  		drm_object_attach_property(&plane->base, config->prop_fb_id, 0);
> +		drm_object_attach_property(&plane->base, config->prop_fence_fd, -1);
>  		drm_object_attach_property(&plane->base, config->prop_crtc_id, 0);
>  		drm_object_attach_property(&plane->base, config->prop_crtc_x, 0);
>  		drm_object_attach_property(&plane->base, config->prop_crtc_y, 0);
> @@ -1546,6 +1547,12 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)
>  		return -ENOMEM;
>  	dev->mode_config.prop_fb_id = prop;
>  
> +	prop = drm_property_create_signed_range(dev, DRM_MODE_PROP_ATOMIC,
> +			"FENCE_FD", -1, INT_MAX);
> +	if (!prop)
> +		return -ENOMEM;
> +	dev->mode_config.prop_fence_fd = prop;
> +
>  	prop = drm_property_create_object(dev, DRM_MODE_PROP_ATOMIC,
>  			"CRTC_ID", DRM_MODE_OBJECT_CRTC);
>  	if (!prop)
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index 8c7fb3d..a8f6ec0 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -1239,6 +1239,7 @@ struct drm_connector {
>   * @crtc: currently bound CRTC, NULL if disabled
>   * @fb: currently bound framebuffer
>   * @fence: optional fence to wait for before scanning out @fb
> + * @fence_fd: fd representing the sync_fence
>   * @crtc_x: left position of visible portion of plane on crtc
>   * @crtc_y: upper position of visible portion of plane on crtc
>   * @crtc_w: width of visible portion of plane on crtc
> @@ -1257,6 +1258,7 @@ struct drm_plane_state {
>  	struct drm_crtc *crtc;   /* do not write directly, use drm_atomic_set_crtc_for_plane() */
>  	struct drm_framebuffer *fb;  /* do not write directly, use drm_atomic_set_fb_for_plane() */
>  	struct fence *fence;
> +	int fence_fd;
>  
>  	/* Signed dest location allows it to be partially off screen */
>  	int32_t crtc_x, crtc_y;
> @@ -2098,6 +2100,7 @@ struct drm_mode_config {
>  	struct drm_property *prop_crtc_w;
>  	struct drm_property *prop_crtc_h;
>  	struct drm_property *prop_fb_id;
> +	struct drm_property *prop_fence_fd;
>  	struct drm_property *prop_crtc_id;
>  	struct drm_property *prop_active;
>  	struct drm_property *prop_mode_id;
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-03-24  7:53 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 18:47 [RFC 0/6] drm/fences: add in-fences to DRM Gustavo Padovan
2016-03-23 18:47 ` [RFC 1/6] drm/fence: add FENCE_FD property to planes Gustavo Padovan
2016-03-24  7:52   ` Inki Dae [this message]
2016-04-05 12:36   ` Rob Clark
2016-04-05 12:57     ` Daniel Stone
2016-04-05 14:04       ` Rob Clark
2016-04-05 14:19         ` Daniel Stone
2016-04-05 15:23           ` Rob Clark
2016-03-23 18:47 ` [RFC 2/6] dma-buf/fence: add struct fence_collection Gustavo Padovan
2016-03-23 18:47 ` [RFC 3/6] dma-buf/sync_file: add sync_file_fences_get() Gustavo Padovan
2016-03-23 18:47 ` [RFC 4/6] dma-buf/fence: add fence_collection_put() Gustavo Padovan
2016-03-23 18:47 ` [RFC 5/6] dma-buf/fence: add fence_collection_wait() Gustavo Padovan
2016-03-23 18:47 ` [RFC 6/6] drm/fence: support fence_collection on atomic commit Gustavo Padovan
2016-03-24  7:20 ` [RFC 0/6] drm/fences: add in-fences to DRM Maarten Lankhorst
2016-03-24  8:13   ` zhoucm1
2016-03-24 14:31   ` Gustavo Padovan
2016-03-24  8:18 ` Inki Dae
2016-03-24 14:39   ` Gustavo Padovan
2016-03-24 23:03     ` Inki Dae
2016-03-24 15:40   ` Rob Clark
2016-03-24 23:49     ` Inki Dae
2016-03-25 11:58       ` Rob Clark
2016-03-25 12:10         ` Daniel Stone
2016-03-28  1:26           ` Inki Dae
2016-03-28 13:26             ` Daniel Stone
2016-03-29  2:18               ` Inki Dae
2016-03-29 13:23                 ` Rob Clark
2016-03-31  7:45                   ` Inki Dae
2016-03-31  9:35                     ` Daniel Stone
2016-03-31 10:04                       ` Daniel Vetter
2016-03-31 11:40                         ` Inki Dae
2016-03-31 10:05                       ` Inki Dae
2016-03-31 10:56                         ` Daniel Stone
2016-03-31 11:26                           ` Inki Dae
2016-03-31 11:41                             ` Daniel Stone
2016-03-31 14:10                             ` Rob Clark
2016-04-04  0:14                               ` Inki Dae
2016-04-04 15:41                                 ` Rob Clark
2016-04-04 15:46                                   ` Rob Clark

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=56F39CDB.7050607@samsung.com \
    --to=inki.dae@samsung.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