From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_setmode: Handle eDP with fixed mode better.
Date: Thu, 9 May 2019 17:47:11 +0300 [thread overview]
Message-ID: <20190509144711.GD24299@intel.com> (raw)
In-Reply-To: <20190425085428.9654-1-maarten.lankhorst@linux.intel.com>
On Thu, Apr 25, 2019 at 10:54:28AM +0200, Maarten Lankhorst wrote:
> When running the stealing tests, we set the same mode on the eDP and
> the other connector. If the eDP is 4k, we may try to set a mode that
> is not supported on the other connector, which might be 1080p.
>
> Fix this by selecting the smallest default mode, based on clock.
> Hopefully this is more likely to be supported on all connectors,
> instead always using the first connector's mode.
A hardcoded small mode might work too, but this seem like a sane
apporach as well.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110391
> ---
> tests/kms_setmode.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
> index c40c723d4c74..447da2beb5f6 100644
> --- a/tests/kms_setmode.c
> +++ b/tests/kms_setmode.c
> @@ -210,11 +210,14 @@ static void get_mode_for_crtc(struct crtc_config *crtc,
> }
>
> /*
> - * If none is found then just pick the default mode of the first
> - * connector and hope the other connectors can support it by scaling
> - * etc.
> + * If none is found then just pick the default mode from all connectors
> + * with the smallest clock, hope the other connectors can support it by
> + * scaling etc.
> */
> mode = crtc->cconfs[0].default_mode;
> + for (i = 1; i < crtc->connector_count; i++)
> + if (crtc->cconfs[i].default_mode.clock < mode.clock)
> + mode = crtc->cconfs[i].default_mode;
I do wonder why we're making a copy of the mode here, and then another
one when assigning mode_ret. Could change 'mode' to be a pointer
perhaps.
> found:
> *mode_ret = mode;
> }
> --
> 2.20.1
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-05-09 14:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-25 8:54 [igt-dev] [PATCH i-g-t] tests/kms_setmode: Handle eDP with fixed mode better Maarten Lankhorst
2019-04-25 10:02 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-25 16:52 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-05-09 14:47 ` Ville Syrjälä [this message]
2019-06-03 16:05 ` [igt-dev] [PATCH i-g-t] " 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=20190509144711.GD24299@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=igt-dev@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