From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Ander Conselvan De Oliveira <conselvan2@gmail.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v2 09/15] igt_kms: Clear all _changed members centrally
Date: Thu, 21 Jul 2016 14:43:09 +0200 [thread overview]
Message-ID: <ec29dc37-ca6b-adf2-be6d-05aa5edc7269@linux.intel.com> (raw)
In-Reply-To: <1469103220.2625.16.camel@gmail.com>
Op 21-07-16 om 14:13 schreef Ander Conselvan De Oliveira:
> On Wed, 2016-07-06 at 11:55 +0200, Maarten Lankhorst wrote:
>> This will make it easier to support TEST_ONLY commits.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>> lib/igt_kms.c | 84 ++++++++++++++++++++++++++++++++++----------------------
>> ---
>> 1 file changed, 48 insertions(+), 36 deletions(-)
>>
>> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
>> index 9fc5559a5df4..d0d0dcff8193 100644
>> --- a/lib/igt_kms.c
>> +++ b/lib/igt_kms.c
>> @@ -1727,11 +1727,6 @@ igt_atomic_prepare_plane_commit(igt_plane_t *plane,
>> igt_pipe_t *pipe,
>> if (plane->rotation_changed)
>> igt_atomic_populate_plane_req(req, plane,
>> IGT_PLANE_ROTATION, plane->rotation);
>> -
>> - plane->fb_changed = false;
>> - plane->position_changed = false;
>> - plane->size_changed = false;
>> - plane->rotation_changed = false;
>> }
>>
>>
>> @@ -1819,15 +1814,10 @@ static int igt_drm_plane_commit(igt_plane_t *plane,
>> CHECK_RETURN(ret, fail_on_error);
>> }
>>
>> - plane->fb_changed = false;
>> - plane->position_changed = false;
>> - plane->size_changed = false;
>> -
>> if (plane->rotation_changed) {
>> ret = igt_plane_set_property(plane, plane->rotation_property,
>> plane->rotation);
>>
>> - plane->rotation_changed = false;
>> CHECK_RETURN(ret, fail_on_error);
>> }
>>
>> @@ -1872,8 +1862,6 @@ static int igt_cursor_commit_legacy(igt_plane_t *cursor,
>> }
>>
>> CHECK_RETURN(ret, fail_on_error);
>> -
>> - cursor->fb_changed = false;
>> }
>>
>> if (cursor->position_changed) {
>> @@ -1887,8 +1875,6 @@ static int igt_cursor_commit_legacy(igt_plane_t *cursor,
>>
>> ret = drmModeMoveCursor(display->drm_fd, crtc_id, x, y);
>> CHECK_RETURN(ret, fail_on_error);
>> -
>> - cursor->position_changed = false;
>> }
>>
>> return 0;
>> @@ -1915,7 +1901,7 @@ static int igt_primary_plane_commit_legacy(igt_plane_t
>> *primary,
>> igt_assert(!primary->rotation_changed);
>>
>> if (!primary->fb_changed && !primary->position_changed &&
>> - !primary->size_changed)
>> + !primary->size_changed)
>> return 0;
>>
>> crtc_id = pipe->crtc_id;
>> @@ -1959,9 +1945,6 @@ static int igt_primary_plane_commit_legacy(igt_plane_t
>> *primary,
>> CHECK_RETURN(ret, fail_on_error);
>>
>> primary->pipe->enabled = (fb_id != 0);
>> - primary->fb_changed = false;
>> - primary->position_changed = false;
>> - primary->size_changed = false;
>>
>> return 0;
>> }
>> @@ -1982,7 +1965,7 @@ static int igt_plane_commit(igt_plane_t *plane,
>> return igt_primary_plane_commit_legacy(plane, pipe,
>> fail_on_error);
>> } else {
>> - return igt_drm_plane_commit(plane, pipe,
>> fail_on_error);
>> + return igt_drm_plane_commit(plane, pipe, fail_on_error);
>> }
>> }
>>
>> @@ -2008,8 +1991,6 @@ static int igt_pipe_commit(igt_pipe_t *pipe,
>> if (pipe->background_changed) {
>> igt_crtc_set_property(pipe, pipe->background_property,
>> pipe->background);
>> -
>> - pipe->background_changed = false;
>> }
>>
>> if (pipe->color_mgmt_changed) {
>> @@ -2019,8 +2000,6 @@ static int igt_pipe_commit(igt_pipe_t *pipe,
>> pipe->ctm_blob);
>> igt_crtc_set_property(pipe, pipe->gamma_property,
>> pipe->gamma_blob);
>> -
>> - pipe->color_mgmt_changed = false;
>> }
>>
>> for (i = 0; i < pipe->n_planes; i++) {
>> @@ -2140,35 +2119,68 @@ static int do_display_commit(igt_display_t *display,
>> bool fail_on_error)
>> {
>> int i, ret;
>> - int valid_outs = 0;
>> -
>> + enum pipe pipe;
>> LOG_INDENT(display, "commit");
>>
>> igt_display_refresh(display);
>>
>> if (s == COMMIT_ATOMIC) {
>> -
>> ret = igt_atomic_commit(display);
>> +
>> CHECK_RETURN(ret, fail_on_error);
>> - return 0;
>> + } else {
>> + int valid_outs = 0;
>>
>> - }
>> + for_each_pipe(display, pipe) {
>> + igt_pipe_t *pipe_obj = &display->pipes[pipe];
>> + igt_output_t *output = igt_pipe_get_output(pipe_obj);
>>
>> - for_each_pipe(display, i) {
>> - igt_pipe_t *pipe_obj = &display->pipes[i];
>> - igt_output_t *output = igt_pipe_get_output(pipe_obj);
>> + if (output && output->valid)
>> + valid_outs++;
>>
>> - if (output && output->valid)
>> - valid_outs++;
>> + ret = igt_pipe_commit(pipe_obj, s, fail_on_error);
>> + CHECK_RETURN(ret, fail_on_error);
>> + }
>>
>> - ret = igt_pipe_commit(pipe_obj, s, fail_on_error);
>> CHECK_RETURN(ret, fail_on_error);
>> +
>> + if (valid_outs == 0) {
>> + LOG_UNINDENT(display);
>> +
>> + return -1;
>> + }
>> }
>>
>> LOG_UNINDENT(display);
>>
>> - if (valid_outs == 0)
>> - return -1;
>> + if (ret)
>> + return ret;
>> +
>> + for_each_pipe(display, pipe) {
>> + igt_pipe_t *pipe_obj = &display->pipes[pipe];
>> + igt_plane_t *plane;
>> +
>> + if (s == COMMIT_ATOMIC) {
>> + pipe_obj->color_mgmt_changed = false;
>> + pipe_obj->background_changed = false;
>> + }
> If this is supposed to match the previous behavior, shouldn't the condition be
> "!= COMMIT_ATOMIC". Both flags are set from igt_pipe_commit() which is not
> called in the atomic case. However, the flags aren't set to false in
> igt_atomic_prepare_crtc_commit(). That actually sounds like a bug?
I think you're right, real fix is to just update those atomically too. :)
>> +
>> + for_each_plane_on_pipe(display, pipe, plane) {
>> + plane->fb_changed = false;
>> + plane->position_changed = false;
>> + plane->size_changed = false;
>> +
>> + if (s != COMMIT_LEGACY || !(plane->is_primary ||
>> plane->is_cursor))
>> + plane->rotation_changed = false;
> Can't plane->rotation_changed be set unconditionally here? The legacy primary
> plane commit has an assert for rotation_changed == false and perhaps the cursor
> version should have the same.
This is specifically to exclude s == COMMIT_LEGACY && (plane->is_primary || plane->is_cursor),
we don't update rotation_changed in this case.
Maybe I should just add an assert to the legacy update functions instead.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-07-21 12:43 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-06 9:55 [PATCH i-g-t v2 00/15] Add support for atomic modeset to IGT Maarten Lankhorst
2016-07-06 9:55 ` [PATCH i-g-t v2 01/15] igt_kms: Remove kmstest_connector_config.crtc_idx Maarten Lankhorst
2016-07-13 12:13 ` Daniel Vetter
2016-07-19 12:52 ` Maarten Lankhorst
2016-07-06 9:55 ` [PATCH i-g-t v2 02/15] igt_kms: Find optimal encoder only after selecting pipe Maarten Lankhorst
2016-07-15 11:14 ` Ander Conselvan De Oliveira
2016-07-06 9:55 ` [PATCH i-g-t v2 03/15] kms_psr_sink_crc: Use for_each_pipe_with_valid_output to find a valid config Maarten Lankhorst
2016-07-15 11:15 ` Ander Conselvan De Oliveira
2016-07-19 13:58 ` Ander Conselvan De Oliveira
2016-07-20 7:53 ` Maarten Lankhorst
2016-07-20 12:17 ` Ander Conselvan De Oliveira
2016-07-06 9:55 ` [PATCH i-g-t v2 04/15] igt_kms: Make PIPE_ANY a alias for PIPE_NONE Maarten Lankhorst
2016-07-06 9:55 ` [PATCH i-g-t v2 05/15] tests/kms: Clean up more users of unassigned pipes Maarten Lankhorst
2016-07-20 12:56 ` Ander Conselvan De Oliveira
2016-07-21 9:21 ` Maarten Lankhorst
2016-07-25 13:04 ` Maarten Lankhorst
2016-07-06 9:55 ` [PATCH i-g-t v2 06/15] igt_kms: Change PIPE_ANY behavior to mean unassigned Maarten Lankhorst
2016-07-21 9:23 ` Ander Conselvan De Oliveira
2016-07-06 9:55 ` [PATCH i-g-t v2 07/15] igt_kms: Handle atomic pipe properties better Maarten Lankhorst
2016-07-21 10:07 ` Ander Conselvan De Oliveira
2016-07-06 9:55 ` [PATCH i-g-t v2 08/15] igt_kms: Remove pan members from igt_plane, v2 Maarten Lankhorst
2016-07-21 11:42 ` Ander Conselvan De Oliveira
2016-07-21 12:37 ` Maarten Lankhorst
2016-07-06 9:55 ` [PATCH i-g-t v2 09/15] igt_kms: Clear all _changed members centrally Maarten Lankhorst
2016-07-21 12:13 ` Ander Conselvan De Oliveira
2016-07-21 12:43 ` Maarten Lankhorst [this message]
2016-07-06 9:55 ` [PATCH i-g-t v2 10/15] igt_kms: Add modeset support to atomic commits Maarten Lankhorst
2016-07-06 9:55 ` [PATCH i-g-t v2 11/15] tests: Add kms_rmfb test Maarten Lankhorst
2016-07-06 9:55 ` [PATCH i-g-t v2 12/15] tests: Add kms_atomic_transition Maarten Lankhorst
2016-07-06 9:55 ` [PATCH i-g-t v2 13/15] igt_kms: Add more apis for panel fitting test Maarten Lankhorst
2016-07-06 9:55 ` [PATCH i-g-t v2 14/15] igt_kms: Allow disabling previous override mode Maarten Lankhorst
2016-07-06 9:55 ` [PATCH i-g-t v2 15/15] kms_panel_fitting: Add tests for fastboot 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=ec29dc37-ca6b-adf2-be6d-05aa5edc7269@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=conselvan2@gmail.com \
--cc=intel-gfx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.