public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Robert Foss <robert.foss@collabora.com>
To: Brian Starkey <brian.starkey@arm.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>,
	intel-gfx@lists.freedesktop.org,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>
Subject: Re: [PATCH i-g-t v2 06/12] lib/igt_kms: Add support for the IN_FENCE_FD property
Date: Thu, 15 Dec 2016 07:36:52 -0500	[thread overview]
Message-ID: <850cf48c-4699-2fee-bc8a-e92fb2debbf3@collabora.com> (raw)
In-Reply-To: <20161214160429.GA16746@e106950-lin.cambridge.arm.com>



On 2016-12-14 11:04 AM, Brian Starkey wrote:
> Hi,
>
> On Wed, Dec 14, 2016 at 04:05:03AM -0500, Robert Foss wrote:
>> Add support dor the IN_FENCE_FD property to enable setting in fences
>> for atomic
>> commits.
>>
>> Signed-off-by: Robert Foss <robert.foss@collabora.com>
>> ---
>> lib/igt_kms.c | 20 ++++++++++++++++++++
>> lib/igt_kms.h |  5 +++++
>> 2 files changed, 25 insertions(+)
>>
>> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
>> index 8aaff5b8..8ca49d86 100644
>> --- a/lib/igt_kms.c
>> +++ b/lib/igt_kms.c
>> @@ -164,6 +164,7 @@ const char
>> *igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
>>     "CRTC_H",
>>     "FB_ID",
>>     "CRTC_ID",
>> +    "IN_FENCE_FD",
>>     "type",
>>     "rotation"
>> };
>> @@ -1426,6 +1427,7 @@ void igt_display_init(igt_display_t *display,
>> int drm_fd)
>>             n_planes++;
>>             plane->pipe = pipe;
>>             plane->drm_plane = drm_plane;
>> +            plane->fence_fd = -1;
>>
>>             if (is_atomic == 0) {
>>                 display->is_atomic = 1;
>> @@ -1712,6 +1714,11 @@ igt_atomic_prepare_plane_commit(igt_plane_t
>> *plane, igt_pipe_t *pipe,
>>         plane->index,
>>         fb_id);
>>
>> +    if (plane->fence_fd >= 0) {
>> +        uint64_t fence_fd = (int64_t) plane->fence_fd;
>> +        igt_atomic_populate_plane_req(req, plane,
>> IGT_PLANE_IN_FENCE_FD, fence_fd);
>
> Should you reset plane->fence_fd to -1 here? Or tests should
> explicitly clear it for each commit?
>

Resetting it to -1 seems like a good idea to me, if anyone has other 
preferences, just give me a shout.

> Cheers,
> Brian
>> +    }
>> +
>>     if (plane->fb_changed) {
>>         igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_ID,
>> fb_id ? crtc_id : 0);
>>         igt_atomic_populate_plane_req(req, plane, IGT_PLANE_FB_ID,
>> fb_id);
>> @@ -2522,6 +2529,19 @@ void igt_plane_set_fb(igt_plane_t *plane,
>> struct igt_fb *fb)
>>     plane->size_changed = true;
>> }
>>
>> +/**
>> + * igt_plane_set_fence_fd:
>> + * @plane: plane
>> + * @fence_fd: fence fd, disable fence_fd by setting it to -1
>> + *
>> + * This function sets a fence fd to enable a commit to wait for some
>> event to
>> + * occur before completing.
>> + */
>> +void igt_plane_set_fence_fd(igt_plane_t *plane, uint32_t fence_fd)
>> +{
>> +    plane->fence_fd = fence_fd;
>> +}
>> +
>> void igt_plane_set_position(igt_plane_t *plane, int x, int y)
>> {
>>     igt_pipe_t *pipe = plane->pipe;
>> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
>> index dbe81bcb..9766807c 100644
>> --- a/lib/igt_kms.h
>> +++ b/lib/igt_kms.h
>> @@ -225,6 +225,7 @@ enum igt_atomic_plane_properties {
>>
>>        IGT_PLANE_FB_ID,
>>        IGT_PLANE_CRTC_ID,
>> +       IGT_PLANE_IN_FENCE_FD,
>>        IGT_PLANE_TYPE,
>>        IGT_PLANE_ROTATION,
>>        IGT_NUM_PLANE_PROPS
>> @@ -284,6 +285,9 @@ typedef struct {
>>     uint32_t src_h;
>>
>>     igt_rotation_t rotation;
>> +
>> +    /* in fence fd */
>> +    int32_t fence_fd;
>>     uint32_t atomic_props_plane[IGT_NUM_PLANE_PROPS];
>> } igt_plane_t;
>>
>> @@ -367,6 +371,7 @@ void igt_pipe_set_ctm_matrix(igt_pipe_t *pipe,
>> void *ptr, size_t length);
>> void igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length);
>>
>> void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb);
>> +void igt_plane_set_fence_fd(igt_plane_t *plane, uint32_t fence_fd);
>> void igt_plane_set_position(igt_plane_t *plane, int x, int y);
>> void igt_plane_set_size(igt_plane_t *plane, int w, int h);
>> void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation);
>> --
>> 2.11.0
>>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-12-15 12:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14  9:04 [PATCH i-g-t v2 00/12] tests/kms_atomic_transition add fence testing Robert Foss
2016-12-14  9:04 ` [PATCH i-g-t v2 01/12] tests/kms_atomic_transition: use igt timeout instead of blocking Robert Foss
2016-12-14  9:04 ` [PATCH i-g-t v2 02/12] tests/kms_atomic_transition: don't assume max pipes Robert Foss
2016-12-14  9:05 ` [PATCH i-g-t v2 03/12] lib/igt_kms: move igt_kms_get_alt_edid() to the right place Robert Foss
2016-12-14  9:05 ` [PATCH i-g-t v2 04/12] lib/igt_kms: export properties names Robert Foss
2016-12-14  9:05 ` [PATCH i-g-t v2 05/12] tests/kms_atomic: use global atomic properties definitions Robert Foss
2016-12-14  9:05 ` [PATCH i-g-t v2 06/12] lib/igt_kms: Add support for the IN_FENCE_FD property Robert Foss
2016-12-14 16:04   ` Brian Starkey
2016-12-15 12:36     ` Robert Foss [this message]
2016-12-14  9:05 ` [PATCH i-g-t v2 07/12] lib/igt_kms: Add support for the OUT_FENCE_PTR property Robert Foss
2016-12-14 16:13   ` Brian Starkey
2016-12-16  8:21     ` Robert Foss
2016-12-16 18:57       ` Brian Starkey
2016-12-14  9:05 ` [PATCH i-g-t v2 08/12] tests/kms_atomic: stress possible fence settings Robert Foss
2016-12-14 16:39   ` Brian Starkey
2016-12-16  8:35     ` Robert Foss
2016-12-16 19:05       ` Brian Starkey
2016-12-14  9:05 ` [PATCH i-g-t v2 09/12] tests/kms_atomic_transition: add fencing parameter to run_transition_tests Robert Foss
2016-12-14  9:05 ` [PATCH i-g-t v2 10/12] tests/kms_atomic_transition: add out_fences tests Robert Foss
2016-12-14 16:57   ` Brian Starkey
2016-12-16  8:59     ` Robert Foss
2016-12-16 19:06       ` Brian Starkey
2016-12-14  9:05 ` [PATCH i-g-t v2 11/12] tests/kms_atomic_transition: add in_fences tests Robert Foss
2016-12-14  9:05 ` [PATCH i-g-t v2 12/12] tests/kms_atomic_transition: set out_fence for all crtcs Robert Foss

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=850cf48c-4699-2fee-bc8a-e92fb2debbf3@collabora.com \
    --to=robert.foss@collabora.com \
    --cc=brian.starkey@arm.com \
    --cc=gustavo.padovan@collabora.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tomeu.vizoso@collabora.com \
    /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