All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v3 06/11] drm/i915/display: Share intel_connector_needs_modeset()
Date: Wed, 18 Dec 2019 12:48:13 +0200	[thread overview]
Message-ID: <20191218104813.GH1208@intel.com> (raw)
In-Reply-To: <20191217173703.egjq4an4ljzg4fai@ldmartin-desk1>

On Tue, Dec 17, 2019 at 09:37:03AM -0800, Lucas De Marchi wrote:
> On Tue, Dec 17, 2019 at 08:39:15AM -0800, Jose Souza wrote:
> >On Mon, 2019-12-16 at 15:52 -0800, Lucas De Marchi wrote:
> >> On Mon, Dec 16, 2019 at 02:07:37PM -0800, Jose Souza wrote:
> >> > intel_connector_needs_modeset() will be used outside of
> >> > intel_display.c in a future patch so it would only be necessary to
> >> > remove the state and add the prototype to the header file.
> >> >
> >> > But while at it, I simplified the arguments and moved it to a
> >> > better
> >> > place intel_atomic.c.
> >> >
> >> > That allowed us to convert the whole
> >> > intel_encoders_update_prepare/complete to intel types too.
> >> >
> >> > No behavior changes intended here.
> >> >
> >> > v3:
> >> > - removed digital from exported version of
> >> > intel_connector_needs_modeset
> >> > - rollback connector to drm type
> >> >
> >> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> >> > ---
> >> > drivers/gpu/drm/i915/display/intel_atomic.c  | 18 +++++++
> >> > drivers/gpu/drm/i915/display/intel_atomic.h  |  2 +
> >> > drivers/gpu/drm/i915/display/intel_display.c | 53 ++++++-----------
> >> > ---
> >> > 3 files changed, 36 insertions(+), 37 deletions(-)
> >> >
> >> > diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c
> >> > b/drivers/gpu/drm/i915/display/intel_atomic.c
> >> > index fd0026fc3618..b7dda18b6f29 100644
> >> > --- a/drivers/gpu/drm/i915/display/intel_atomic.c
> >> > +++ b/drivers/gpu/drm/i915/display/intel_atomic.c
> >> > @@ -174,6 +174,24 @@ intel_digital_connector_duplicate_state(struct
> >> > drm_connector *connector)
> >> > 	return &state->base;
> >> > }
> >> >
> >> > +/**
> >> > + * intel_connector_needs_modeset - check if connector needs a
> >> > modeset
> >> > + */
> >> > +bool
> >> > +intel_connector_needs_modeset(struct intel_atomic_state *state,
> >> > +			      struct drm_connector *connector)
> >> > +{
> >> > +	const struct drm_connector_state *old_conn_state,
> >> > *new_conn_state;
> >> > +
> >> > +	old_conn_state = drm_atomic_get_old_connector_state(&state-
> >> > >base, connector);
> >> > +	new_conn_state = drm_atomic_get_new_connector_state(&state-
> >> > >base, connector);
> >> > +
> >> > +	return old_conn_state->crtc != new_conn_state->crtc ||
> >> > +	       (new_conn_state->crtc &&
> >> > +		drm_atomic_crtc_needs_modeset(drm_atomic_get_new_crtc_s
> >> > tate(&state->base,
> >> > +									
> >> >     new_conn_state->crtc)));
> >> > +}
> >> > +
> >> > /**
> >> >  * intel_crtc_duplicate_state - duplicate crtc state
> >> >  * @crtc: drm crtc
> >> > diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h
> >> > b/drivers/gpu/drm/i915/display/intel_atomic.h
> >> > index 7b49623419ba..a7d1a8576c48 100644
> >> > --- a/drivers/gpu/drm/i915/display/intel_atomic.h
> >> > +++ b/drivers/gpu/drm/i915/display/intel_atomic.h
> >> > @@ -32,6 +32,8 @@ int intel_digital_connector_atomic_check(struct
> >> > drm_connector *conn,
> >> > 					 struct drm_atomic_state
> >> > *state);
> >> > struct drm_connector_state *
> >> > intel_digital_connector_duplicate_state(struct drm_connector
> >> > *connector);
> >> > +bool intel_connector_needs_modeset(struct intel_atomic_state
> >> > *state,
> >> > +				   struct drm_connector *connector);
> >> >
> >> > struct drm_crtc_state *intel_crtc_duplicate_state(struct drm_crtc
> >> > *crtc);
> >> > void intel_crtc_destroy_state(struct drm_crtc *crtc,
> >> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> >> > b/drivers/gpu/drm/i915/display/intel_display.c
> >> > index 8e3e05cfcb27..0ee2e86a8826 100644
> >> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> >> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> >> > @@ -6185,71 +6185,50 @@ intel_connector_primary_encoder(struct
> >> > intel_connector *connector)
> >> > 	return encoder;
> >> > }
> >> >
> >> > -static bool
> >> > -intel_connector_needs_modeset(struct intel_atomic_state *state,
> >> > -			      const struct drm_connector_state
> >> > *old_conn_state,
> >> > -			      const struct drm_connector_state
> >> > *new_conn_state)
> >> > -{
> >> > -	struct intel_crtc *old_crtc = old_conn_state->crtc ?
> >> > -				      to_intel_crtc(old_conn_state-
> >> > >crtc) : NULL;
> >> > -	struct intel_crtc *new_crtc = new_conn_state->crtc ?
> >> > -				      to_intel_crtc(new_conn_state-
> >> > >crtc) : NULL;
> >> > -
> >> > -	return new_crtc != old_crtc ||
> >> > -	       (new_crtc &&
> >> > -		needs_modeset(intel_atomic_get_new_crtc_state(state,
> >> > new_crtc)));
> >> > -}
> >> > -
> >> > static void intel_encoders_update_prepare(struct intel_atomic_state
> >> > *state)
> >> > {
> >> > -	struct drm_connector_state *old_conn_state;
> >> > -	struct drm_connector_state *new_conn_state;
> >> > -	struct drm_connector *conn;
> >> > +	struct intel_digital_connector_state *new_connector_state;
> >>
> >> what's up with this fight new_conn_state vs new_connector_state? It'
> >> s
> >> the first time in the driver we would actually drive such conversion.
> >> I'd say to just keep the old name.
> >
> >Ville asked me to rename conn to connector in the new functions that
> >I'm adding as this function was heavily modified I did the same here.
> >I will rollback if agreed by you and Ville(the ones helping with TGL
> >MST)
> 
> I think that was about conn -> connector, not *conn_state ->
> *connector_state, wasn't it?

I think we generally have full 'connector' and abbreviated
'conn_state'. A bit inconsistent in itself but IMO still better
to stick to common naming conventions so the poor brain has an
easier job when reading code. We could perhaps do a
s/connector/conn/ over the whole codebase to make things a bit
shorter in a bunch of places.

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-12-18 10:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 22:07 [Intel-gfx] [PATCH v3 01/11] drm: Add __drm_atomic_helper_crtc_state_reset() & co José Roberto de Souza
2019-12-16 22:07 ` [Intel-gfx] [PATCH v3 02/11] drm/i915: s/intel_crtc/crtc/ in intel_crtc_init() José Roberto de Souza
2019-12-16 22:07 ` [Intel-gfx] [PATCH v3 03/11] drm/i915: Introduce intel_crtc_{alloc, free}() José Roberto de Souza
2019-12-16 22:07 ` [Intel-gfx] [PATCH v3 04/11] drm/i915: Introduce intel_crtc_state_reset() José Roberto de Souza
2019-12-16 22:07 ` [Intel-gfx] [PATCH v3 05/11] drm/i915: Introduce intel_plane_state_reset() José Roberto de Souza
2019-12-16 22:07 ` [Intel-gfx] [PATCH v3 06/11] drm/i915/display: Share intel_connector_needs_modeset() José Roberto de Souza
2019-12-16 23:52   ` Lucas De Marchi
2019-12-17 16:39     ` Souza, Jose
2019-12-17 17:37       ` Lucas De Marchi
2019-12-18 10:48         ` Ville Syrjälä [this message]
2019-12-18 16:38   ` Ville Syrjälä
2019-12-18 17:13     ` Souza, Jose
2019-12-16 22:07 ` [Intel-gfx] [PATCH v3 07/11] drm/i915/tgl: Select master transcoder for MST stream José Roberto de Souza
2019-12-16 22:07 ` [Intel-gfx] [PATCH v3 08/11] drm/i915/display: Always enables MST master pipe first José Roberto de Souza
2019-12-18 16:43   ` Ville Syrjälä
2019-12-18 17:27     ` Souza, Jose
2019-12-18 18:24       ` Ville Syrjälä
2019-12-16 22:07 ` [Intel-gfx] [PATCH v3 09/11] drm/i915/dp: Fix MST disable sequences José Roberto de Souza
2019-12-16 22:07 ` [Intel-gfx] [PATCH v3 10/11] drm/i915/display: Check if pipe fastset is allowed by external dependencies José Roberto de Souza
2019-12-18 17:00   ` Ville Syrjälä
2019-12-18 17:10     ` Ville Syrjälä
2019-12-18 17:38       ` Souza, Jose
2019-12-16 22:07 ` [Intel-gfx] [PATCH v3 11/11] drm/i915/display: Add comment to a function that probably can be removed José Roberto de Souza
2019-12-16 23:35 ` [Intel-gfx] [PATCH v3 01/11] drm: Add __drm_atomic_helper_crtc_state_reset() & co Lucas De Marchi
2019-12-17  5:13 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [v3,01/11] " Patchwork
2019-12-17 14:44 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [v3,01/11] drm: Add __drm_atomic_helper_crtc_state_reset() & co. (rev2) 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=20191218104813.GH1208@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@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 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.