From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: "Cc : Daniel Stone" <daniels@collabora.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/core: Reuse the reserved member in drm_event_vblank for crtc_id.
Date: Wed, 19 Oct 2016 11:41:30 +0200 [thread overview]
Message-ID: <acd0e4b7-5535-38c1-c31b-4116c5cd783e@linux.intel.com> (raw)
In-Reply-To: <20160810141404.GG6232@phenom.ffwll.local>
Op 10-08-16 om 16:14 schreef Daniel Vetter:
> On Wed, Aug 10, 2016 at 12:46:23PM +0200, Maarten Lankhorst wrote:
>> When doing a atomic commit affecting multiple crtc's, multiple events
>> are generated. The user_data member does not allow you to distinguish,
>> because they all have the same pointer.
>>
>> I've chosen to use crtc_id, because using pipe would create ambiguity
>> when pipe = 0. A test for != 0 is easier to implement, and crtc_id
>> will never be 0.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Cc: David Airlie <airlied@linux.ie>
>> Cc: Daniel Stone <daniels@collabora.com>
>> ---
>> drivers/gpu/drm/drm_irq.c | 2 ++
>> include/uapi/drm/drm.h | 2 +-
>> 2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
>> index 97c70642dbe1..f01bb0eea31c 100644
>> --- a/drivers/gpu/drm/drm_irq.c
>> +++ b/drivers/gpu/drm/drm_irq.c
>> @@ -1021,6 +1021,7 @@ void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
>>
>> e->pipe = pipe;
>> e->event.sequence = drm_vblank_count(dev, pipe);
>> + e->event.crtc_id = crtc->base.id;
>> list_add_tail(&e->base.link, &dev->vblank_event_list);
>> }
>> EXPORT_SYMBOL(drm_crtc_arm_vblank_event);
>> @@ -1048,6 +1049,7 @@ void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
>> now = get_drm_timestamp();
>> }
>> e->pipe = pipe;
>> + e->event.crtc_id = crtc->base.id;
>> send_vblank_event(dev, e, seq, &now);
>> }
>> EXPORT_SYMBOL(drm_crtc_send_vblank_event);
>> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
>> index 452675fb55d9..dced4d4517d6 100644
>> --- a/include/uapi/drm/drm.h
>> +++ b/include/uapi/drm/drm.h
>> @@ -850,7 +850,7 @@ struct drm_event_vblank {
>> __u32 tv_sec;
>> __u32 tv_usec;
>> __u32 sequence;
>> - __u32 reserved;
>> + __u32 crtc_id; /* 0 on older kernels that do not support this */
> Same comment as in reply to Michel's patch: Is there really no existing
> userspace which would fail to compile now because we renamed this? Simply
> creating a new drm_event_vblank2 struct would fix that.
Hey,
This comment must have fallen through, I haven't found any case in which this happened. All of them use a memset or allocate it zero'd.
~Maarten
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-10-19 9:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-10 10:46 [PATCH 0/2] Add support for passing crtc_id to page flip events Maarten Lankhorst
2016-08-10 10:46 ` [PATCH 1/2] drm/core: Reuse the reserved member in drm_event_vblank for crtc_id Maarten Lankhorst
2016-08-10 14:14 ` Daniel Vetter
2016-10-19 9:41 ` Maarten Lankhorst [this message]
2016-08-10 10:46 ` [LIBDRM PATCH 2/2] Add support for crtc_id in page flip events Maarten Lankhorst
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=acd0e4b7-5535-38c1-c31b-4116c5cd783e@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=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