From: Daniel Vetter <daniel@ffwll.ch>
To: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/6] drm/i915: Don't use staged config in check_digital_port_conflicts()
Date: Tue, 7 Apr 2015 11:25:12 +0200 [thread overview]
Message-ID: <20150407092512.GD6354@phenom.ffwll.local> (raw)
In-Reply-To: <1427975281-7688-5-git-send-email-ander.conselvan.de.oliveira@intel.com>
On Thu, Apr 02, 2015 at 02:47:59PM +0300, Ander Conselvan de Oliveira wrote:
> Reduce dependency on the staged config by using the atomic state
> instead.
>
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 22 ++++++++++++++--------
> 1 file changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 207c713..b1fbe9d 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -10658,23 +10658,30 @@ static bool check_encoder_cloning(struct intel_crtc *crtc)
> return true;
> }
>
> -static bool check_digital_port_conflicts(struct drm_device *dev)
> +static bool check_digital_port_conflicts(struct drm_atomic_state *state)
> {
> - struct intel_connector *connector;
> + struct drm_device *dev = state->dev;
> + struct intel_encoder *encoder;
> + struct drm_connector_state *connector_state;
> unsigned int used_ports = 0;
> + int i;
>
> /*
> * Walk the connector list instead of the encoder
> * list to detect the problem on ddi platforms
> * where there's just one encoder per digital port.
> */
> - for_each_intel_connector(dev, connector) {
> - struct intel_encoder *encoder = connector->new_encoder;
> + for (i = 0; i < state->num_connector; i++) {
> + if (!state->connectors[i])
> + continue;
More users for for_each_connector_in_state!
-Daniel
>
> - if (!encoder)
> + connector_state = state->connector_states[i];
> + if (!connector_state->best_encoder)
> continue;
>
> - WARN_ON(!encoder->new_crtc);
> + encoder = to_intel_encoder(connector_state->best_encoder);
> +
> + WARN_ON(!connector_state->crtc);
>
> switch (encoder->type) {
> unsigned int port_mask;
> @@ -10716,7 +10723,6 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
> struct drm_display_mode *mode,
> struct drm_atomic_state *state)
> {
> - struct drm_device *dev = crtc->dev;
> struct intel_encoder *encoder;
> struct intel_connector *connector;
> struct drm_connector_state *connector_state;
> @@ -10730,7 +10736,7 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
> return ERR_PTR(-EINVAL);
> }
>
> - if (!check_digital_port_conflicts(dev)) {
> + if (!check_digital_port_conflicts(state)) {
> DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
> return ERR_PTR(-EINVAL);
> }
> --
> 2.1.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-04-07 9:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-02 11:47 [PATCH 0/6] Remove more staged config usage Ander Conselvan de Oliveira
2015-04-02 11:47 ` [PATCH 1/6] drm/i915: Don't use staged config for VLV cdclk calculations Ander Conselvan de Oliveira
2015-04-07 9:16 ` Daniel Vetter
2015-04-02 11:47 ` [PATCH 2/6] drm/i915: Don't use intel_crtc->new_config in pll calculation code Ander Conselvan de Oliveira
2015-04-07 9:22 ` Daniel Vetter
2015-04-02 11:47 ` [PATCH 3/6] drm/i915: Remove intel_crtc->new_config Ander Conselvan de Oliveira
2015-04-02 11:47 ` [PATCH 4/6] drm/i915: Don't use staged config in check_digital_port_conflicts() Ander Conselvan de Oliveira
2015-04-07 9:25 ` Daniel Vetter [this message]
2015-04-02 11:48 ` [PATCH 5/6] drm/i915: Don't use staged config in check_encoder_cloning() Ander Conselvan de Oliveira
2015-04-02 11:48 ` [PATCH 6/6] drm/i915: Don't use staged config in intel_mst_pre_enable_dp() Ander Conselvan de Oliveira
2015-04-07 9:26 ` [PATCH 0/6] Remove more staged config usage Daniel Vetter
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=20150407092512.GD6354@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=ander.conselvan.de.oliveira@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox