Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 04/10] drm: Add drm_connector_mask()
Date: Tue, 26 Jun 2018 13:12:22 -0700	[thread overview]
Message-ID: <20180626201222.GK9765@intel.com> (raw)
In-Reply-To: <20180626194716.12522-4-ville.syrjala@linux.intel.com>

On Tue, Jun 26, 2018 at 10:47:10PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Add drm_connector_mask() which returns the 1<<index for the connector.
> We already have an identical drm_crtc_mask() for crtcs.
> 
> Mostly performed with coccinelle:
> @@
> @@
> - (1<<drm_connector_index(
> + drm_connector_mask(
>   ...)
> -  )
> 
> @@
> @@
> - 1<<drm_connector_index(
> + drm_connector_mask(
>   ...)
> 
> @@
> @@
> - BIT(drm_connector_index(
> + drm_connector_mask(
>   ...)
> - )
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/drm_atomic.c | 6 +++---
>  include/drm/drm_connector.h  | 8 +++++++-
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 684c9d3a1d6c..d5cefb1cb2a2 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1700,7 +1700,7 @@ drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_state,
>  							   conn_state->crtc);
>  
>  		crtc_state->connector_mask &=
> -			~(1 << drm_connector_index(conn_state->connector));
> +			~drm_connector_mask(conn_state->connector);
>  
>  		drm_connector_put(conn_state->connector);
>  		conn_state->crtc = NULL;
> @@ -1712,7 +1712,7 @@ drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_state,
>  			return PTR_ERR(crtc_state);
>  
>  		crtc_state->connector_mask |=
> -			1 << drm_connector_index(conn_state->connector);
> +			drm_connector_mask(conn_state->connector);
>  
>  		drm_connector_get(conn_state->connector);
>  		conn_state->crtc = crtc;
> @@ -1839,7 +1839,7 @@ drm_atomic_add_affected_connectors(struct drm_atomic_state *state,
>  	 */
>  	drm_connector_list_iter_begin(state->dev, &conn_iter);
>  	drm_for_each_connector_iter(connector, &conn_iter) {
> -		if (!(crtc_state->connector_mask & (1 << drm_connector_index(connector))))
> +		if (!(crtc_state->connector_mask & drm_connector_mask(connector)))
>  			continue;
>  
>  		conn_state = drm_atomic_get_connector_state(state, connector);
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 14ab58ade87f..bf0f0f0786d3 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1030,11 +1030,17 @@ int drm_mode_connector_attach_encoder(struct drm_connector *connector,
>  				      struct drm_encoder *encoder);
>  
>  void drm_connector_cleanup(struct drm_connector *connector);
> -static inline unsigned drm_connector_index(struct drm_connector *connector)
> +
> +static inline unsigned int drm_connector_index(const struct drm_connector *connector)
>  {
>  	return connector->index;
>  }
>  
> +static inline u32 drm_connector_mask(const struct drm_connector *connector)
> +{
> +	return 1 << connector->index;
> +}
> +
>  /**
>   * drm_connector_lookup - lookup connector object
>   * @dev: DRM device
> -- 
> 2.16.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-06-26 20:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26 19:47 [PATCH 01/10] drm: Add drm_plane_mask() Ville Syrjala
2018-06-26 19:47 ` [PATCH 02/10] drm: Use drm_crtc_mask() Ville Syrjala
2018-06-26 20:11   ` Rodrigo Vivi
2018-06-26 19:47 ` [PATCH 03/10] drm: Add drm_encoder_mask() Ville Syrjala
2018-06-26 20:11   ` Rodrigo Vivi
2018-06-26 19:47 ` [PATCH 04/10] drm: Add drm_connector_mask() Ville Syrjala
2018-06-26 20:12   ` Rodrigo Vivi [this message]
2018-06-26 19:47 ` [PATCH 05/10] drm/i915: Use drm_plane_mask() & co Ville Syrjala
2018-06-26 20:16   ` Rodrigo Vivi
2018-06-26 19:47 ` [PATCH 06/10] drm/imx: Use drm_plane_mask() Ville Syrjala
2018-06-26 20:16   ` Rodrigo Vivi
2018-06-27  8:01   ` Philipp Zabel
2018-06-26 19:47 ` [PATCH 07/10] drm/rockchip: Use drm_crtc_mask() Ville Syrjala
2018-06-26 20:16   ` [Intel-gfx] " Rodrigo Vivi
2018-06-27 13:09   ` Heiko Stuebner
2018-06-26 19:47 ` [PATCH 08/10] drm/sun4i: " Ville Syrjala
2018-06-26 20:17   ` Rodrigo Vivi
2018-06-27  7:34   ` Maxime Ripard
2018-06-26 19:47 ` [PATCH 09/10] drm/vc4: " Ville Syrjala
2018-06-26 20:17   ` Rodrigo Vivi
2018-06-26 23:08   ` Eric Anholt
2018-06-26 19:47 ` [PATCH 10/10] drm/vmwgfx: Use drm_plane_mask() & co Ville Syrjala
2018-06-26 20:17   ` Rodrigo Vivi
2018-07-02 17:00   ` Sinclair Yeh
2018-07-03 12:34     ` Ville Syrjälä
2018-06-26 20:09 ` [PATCH 01/10] drm: Add drm_plane_mask() Rodrigo Vivi
2018-07-02 15:55   ` Ville Syrjälä
2018-06-26 20:13 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/10] " Patchwork
2018-06-26 20:30 ` ✓ Fi.CI.BAT: success " Patchwork
2018-06-26 23:04 ` ✓ Fi.CI.IGT: " 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=20180626201222.GK9765@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@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