From: Mika Kahola <mika.kahola@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v4 2/7] lib/igt_kms: Change output->pending_crtc_idx_mask to output->pending_pipe
Date: Mon, 02 Oct 2017 13:19:46 +0300 [thread overview]
Message-ID: <1506939586.3274.22.camel@intel.com> (raw)
In-Reply-To: <20170929095937.15702-3-maarten.lankhorst@linux.intel.com>
On Fri, 2017-09-29 at 11:59 +0200, Maarten Lankhorst wrote:
> igt_output_set_pipe with PIPE_ANY used to mean that we bind the
> output
> to any pipe, but this is now a deprecated alias for PIPE_NONE, and
> means the output will be unbound.
>
> Because of this it's better to change output->pending_crtc_idx_mask
> to
> an enum pipe, because only a single choice may be given for a pipe.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
> ---
> lib/igt_kms.c | 46 ++++++++++++++++++++-------------
> ----------
> lib/igt_kms.h | 2 +-
> tests/kms_atomic_transition.c | 4 ++--
> tests/kms_busy.c | 2 +-
> tests/kms_cursor_legacy.c | 2 +-
> 5 files changed, 26 insertions(+), 30 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 7bcafc072f70..a5db6bc493c2 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1561,9 +1561,10 @@ static void
> igt_display_log_shift(igt_display_t *display, int shift)
> static void igt_output_refresh(igt_output_t *output)
> {
> igt_display_t *display = output->display;
> - unsigned long crtc_idx_mask;
> + unsigned long crtc_idx_mask = 0;
>
> - crtc_idx_mask = output->pending_crtc_idx_mask;
> + if (output->pending_pipe != PIPE_NONE)
> + crtc_idx_mask = 1 << output->pending_pipe;
>
> kmstest_free_connector_config(&output->config);
>
> @@ -1587,11 +1588,8 @@ static void igt_output_refresh(igt_output_t
> *output)
> BROADCAST_RGB_FU
> LL);
> }
>
> - if (output->config.pipe == PIPE_NONE)
> - return;
> -
> LOG(display, "%s: Selecting pipe %s\n", output->name,
> - kmstest_pipe_name(output->config.pipe));
> + kmstest_pipe_name(output->pending_pipe));
> }
>
> static bool
> @@ -1830,7 +1828,7 @@ void igt_display_init(igt_display_t *display,
> int drm_fd)
> * a pipe is set with igt_output_set_pipe().
> */
> output->force_reprobe = true;
> - output->pending_crtc_idx_mask = 0;
> + output->pending_pipe = PIPE_NONE;
> output->id = resources->connectors[i];
> output->display = display;
>
> @@ -1960,10 +1958,12 @@ static void igt_display_refresh(igt_display_t
> *display)
> for (i = 0; i < display->n_outputs; i++) {
> output = &display->outputs[i];
>
> - if (pipes_in_use & output->pending_crtc_idx_mask)
> - goto report_dup;
> + if (output->pending_pipe != PIPE_NONE) {
> + if (pipes_in_use & (1 << output-
> >pending_pipe))
> + goto report_dup;
>
> - pipes_in_use |= output->pending_crtc_idx_mask;
> + pipes_in_use |= 1 << output->pending_pipe;
> + }
>
> if (output->force_reprobe)
> igt_output_refresh(output);
> @@ -1975,11 +1975,11 @@ report_dup:
> for (; i > 0; i--) {
> igt_output_t *b = &display->outputs[i - 1];
>
> - igt_assert_f(output->pending_crtc_idx_mask !=
> - b->pending_crtc_idx_mask,
> + igt_assert_f(output->pending_pipe !=
> + b->pending_pipe,
> "%s and %s are both trying to use pipe
> %s\n",
> igt_output_name(output),
> igt_output_name(b),
> - kmstest_pipe_name(ffs(b-
> >pending_crtc_idx_mask) - 1));
> + kmstest_pipe_name(output-
> >pending_pipe));
> }
> }
>
> @@ -1988,7 +1988,7 @@ static igt_pipe_t
> *igt_output_get_driving_pipe(igt_output_t *output)
> igt_display_t *display = output->display;
> enum pipe pipe;
>
> - if (!output->pending_crtc_idx_mask) {
> + if (output->pending_pipe == PIPE_NONE) {
> /*
> * The user hasn't specified a pipe to use, return
> none.
> */
> @@ -1998,7 +1998,7 @@ static igt_pipe_t
> *igt_output_get_driving_pipe(igt_output_t *output)
> * Otherwise, return the pending pipe (ie the pipe
> that should
> * drive this output after the commit()
> */
> - pipe = ffs(output->pending_crtc_idx_mask) - 1;
> + pipe = output->pending_pipe;
> }
>
> igt_assert(pipe >= 0 && pipe < display->n_pipes);
> @@ -2051,7 +2051,7 @@ static igt_output_t
> *igt_pipe_get_output(igt_pipe_t *pipe)
> for (i = 0; i < display->n_outputs; i++) {
> igt_output_t *output = &display->outputs[i];
>
> - if (output->pending_crtc_idx_mask == (1 << pipe-
> >pipe))
> + if (output->pending_pipe == pipe->pipe)
> return output;
> }
>
> @@ -2860,22 +2860,18 @@ void igt_output_set_pipe(igt_output_t
> *output, enum pipe pipe)
>
> igt_assert(output->name);
>
> - if (output->pending_crtc_idx_mask) {
> + if (output->pending_pipe != PIPE_NONE) {
> old_pipe = igt_output_get_driving_pipe(output);
>
> old_pipe->mode_changed = true;
> }
>
> - if (pipe == PIPE_NONE) {
> - LOG(display, "%s: set_pipe(any)\n",
> igt_output_name(output));
> - output->pending_crtc_idx_mask = 0;
> - } else {
> - LOG(display, "%s: set_pipe(%s)\n",
> igt_output_name(output),
> - kmstest_pipe_name(pipe));
> - output->pending_crtc_idx_mask = 1 << pipe;
> + LOG(display, "%s: set_pipe(%s)\n", igt_output_name(output),
> + kmstest_pipe_name(pipe));
> + output->pending_pipe = pipe;
>
> + if (pipe != PIPE_NONE)
> display->pipes[pipe].mode_changed = true;
> - }
>
> output->config.pipe_changed = true;
>
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 62197dcfea7b..8dc118c961b7 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -361,7 +361,7 @@ typedef struct {
> struct kmstest_connector_config config;
> char *name;
> bool force_reprobe;
> - unsigned long pending_crtc_idx_mask;
> + enum pipe pending_pipe;
> bool use_override_mode;
> drmModeModeInfo override_mode;
> } igt_output_t;
> diff --git a/tests/kms_atomic_transition.c
> b/tests/kms_atomic_transition.c
> index 48823a09aed2..2ae75f2d6630 100644
> --- a/tests/kms_atomic_transition.c
> +++ b/tests/kms_atomic_transition.c
> @@ -644,7 +644,7 @@ static unsigned set_combinations(igt_display_t
> *display, unsigned mask, struct i
> event_mask |= 1 << pipe;
>
> for_each_valid_output_on_pipe(display, pipe, output)
> {
> - if (output->pending_crtc_idx_mask)
> + if (output->pending_pipe != PIPE_NONE)
> continue;
>
> mode = igt_output_get_mode(output);
> @@ -726,7 +726,7 @@ static void run_modeset_tests(igt_display_t
> *display, int howmany, bool nonblock
> pipe_crcs[i] = igt_pipe_crc_new(display-
> >drm_fd, i, INTEL_PIPE_CRC_SOURCE_AUTO);
>
> for_each_valid_output_on_pipe(display, i, output) {
> - if (output->pending_crtc_idx_mask)
> + if (output->pending_pipe != PIPE_NONE)
> continue;
>
> igt_output_set_pipe(output, i);
> diff --git a/tests/kms_busy.c b/tests/kms_busy.c
> index f430beaf7373..0828a8b38a06 100644
> --- a/tests/kms_busy.c
> +++ b/tests/kms_busy.c
> @@ -41,7 +41,7 @@ set_fb_on_crtc(igt_display_t *dpy, int pipe, struct
> igt_fb *fb)
> drmModeModeInfoPtr mode;
> igt_plane_t *primary;
>
> - if (output->pending_crtc_idx_mask)
> + if (output->pending_pipe != PIPE_NONE)
> continue;
>
> igt_output_set_pipe(output, pipe);
> diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
> index 65a001a9dec0..fc7526833673 100644
> --- a/tests/kms_cursor_legacy.c
> +++ b/tests/kms_cursor_legacy.c
> @@ -155,7 +155,7 @@ static igt_output_t *set_fb_on_crtc(igt_display_t
> *display, enum pipe pipe, stru
> drmModeModeInfoPtr mode;
> igt_plane_t *primary;
>
> - if (output->pending_crtc_idx_mask)
> + if (output->pending_pipe != PIPE_NONE)
> continue;
>
> igt_output_set_pipe(output, pipe);
--
Mika Kahola - Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-10-02 10:17 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-29 9:59 [PATCH i-g-t v4 0/7] lib/igt_kms: Convert properties to be more atomic-like Maarten Lankhorst
2017-09-29 9:59 ` [PATCH i-g-t v4 1/7] tests: Stop looking at plane private members Maarten Lankhorst
2017-09-29 13:13 ` Mika Kahola
2017-10-02 9:31 ` Maarten Lankhorst
2017-09-29 9:59 ` [PATCH i-g-t v4 2/7] lib/igt_kms: Change output->pending_crtc_idx_mask to output->pending_pipe Maarten Lankhorst
2017-10-02 10:19 ` Mika Kahola [this message]
2017-09-29 9:59 ` [PATCH i-g-t v4 3/7] lib/igt_kms: Commit primary plane when a modeset is forced on a pipe Maarten Lankhorst
2017-10-02 11:02 ` Mika Kahola
2017-09-29 9:59 ` [PATCH i-g-t v4 4/7] lib/igt_kms: Rework connector properties to be more atomic, v2 Maarten Lankhorst
2017-10-02 12:22 ` Mika Kahola
2017-09-29 9:59 ` [PATCH i-g-t v4 5/7] lib/igt_kms: Rework plane properties to be more atomic, v4 Maarten Lankhorst
2017-10-03 12:05 ` Mika Kahola
2017-10-04 7:26 ` Maarten Lankhorst
2017-10-04 13:54 ` [PATCH i-g-t] lib/igt_kms: Rework plane properties to be more atomic, v5 Maarten Lankhorst
2017-09-29 9:59 ` [PATCH i-g-t v4 6/7] lib/igt_kms: Rework pipe properties to be more atomic, v4.1 Maarten Lankhorst
2017-10-03 7:45 ` [PATCH i-g-t] lib/igt_kms: Rework pipe properties to be more atomic, v5 Maarten Lankhorst
2017-10-04 13:55 ` [PATCH i-g-t] lib/igt_kms: Rework pipe properties to be more atomic, v6 Maarten Lankhorst
2017-09-29 9:59 ` [PATCH i-g-t v4 7/7] igt/kms_rotation_crc : Fix flip tests for sprite plane Maarten Lankhorst
2017-09-29 10:58 ` Mika Kahola
2017-09-29 11:03 ` ✓ Fi.CI.BAT: success for lib/igt_kms: Convert properties to be more atomic-like. (rev8) Patchwork
2017-09-29 12:13 ` ✗ Fi.CI.IGT: failure " Patchwork
2017-10-03 9:08 ` ✗ Fi.CI.BAT: failure for lib/igt_kms: Convert properties to be more atomic-like. (rev9) Patchwork
2017-10-03 10:22 ` Petri Latvala
2017-10-04 18:00 ` ✓ Fi.CI.BAT: success for lib/igt_kms: Convert properties to be more atomic-like. (rev11) Patchwork
2017-10-04 22:08 ` ✗ Fi.CI.IGT: warning " Patchwork
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=1506939586.3274.22.camel@intel.com \
--to=mika.kahola@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.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