dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 18/22] drm: Return the connector from drm_connector_get()
Date: Mon, 10 Jul 2017 11:21:22 +0200	[thread overview]
Message-ID: <d2ec42c7-c72c-76f4-7848-6f9d7803170a@linux.intel.com> (raw)
In-Reply-To: <20170706202442.5394-19-ville.syrjala@linux.intel.com>

Op 06-07-17 om 22:24 schreef ville.syrjala@linux.intel.com:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Make drm_connector_get() return the connector. This allows the nice
> pattern of 'foo->connector = drm_connector_get(connector)'
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/drm_atomic.c    | 3 +--
>  drivers/gpu/drm/drm_fb_helper.c | 7 +++----
>  include/drm/drm_connector.h     | 7 ++++++-
>  3 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index b1983e7b65d2..56925b93f598 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1139,11 +1139,10 @@ drm_atomic_get_connector_state(struct drm_atomic_state *state,
>  	if (!connector_state)
>  		return ERR_PTR(-ENOMEM);
>  
> -	drm_connector_get(connector);
>  	c->state = connector_state;
>  	c->old_state = connector->state;
>  	c->new_state = connector_state;
> -	c->ptr = connector;
> +	c->ptr = drm_connector_get(connector);
>  	connector_state->state = state;
>  
>  	state->num_connector = state->connectors.num_elems;
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 721511da4de6..f520c235a6fb 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -138,8 +138,7 @@ static int __drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper,
>  	if (!fb_conn)
>  		return -ENOMEM;
>  
> -	drm_connector_get(connector);
> -	fb_conn->connector = connector;
> +	fb_conn->connector = drm_connector_get(connector);
>  	fb_helper->connector_info[fb_helper->connector_count++] = fb_conn;
>  
>  	return 0;
> @@ -2338,8 +2337,8 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper,
>  			fb_crtc->y = offset->y;
>  			modeset->mode = drm_mode_duplicate(dev,
>  							   fb_crtc->desired_mode);
> -			drm_connector_get(connector);
> -			modeset->connectors[modeset->num_connectors++] = connector;
> +			modeset->connectors[modeset->num_connectors++] =
> +				drm_connector_get(connector);
>  			modeset->fb = fb_helper->fb;
>  			modeset->x = offset->x;
>  			modeset->y = offset->y;
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index a0d862d23082..8f26166f78b4 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -916,10 +916,15 @@ static inline struct drm_connector *drm_connector_lookup(struct drm_device *dev,
>   * @connector: DRM connector
>   *
>   * This function increments the connector's refcount.
> +
> + * Returns:
> + *
> + * The connector.
>   */
> -static inline void drm_connector_get(struct drm_connector *connector)
> +static inline struct drm_connector *drm_connector_get(struct drm_connector *connector)
>  {
>  	drm_mode_object_get(&connector->base);
> +	return connector;
>  }
>  
>  /**


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-07-10  9:21 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 20:24 [PATCH v2 00/22] drm/i915: Fix pre-g4x GPU reset, again (v2) ville.syrjala
2017-07-06 20:24 ` [PATCH 01/22] drm/i915: Pass the new crtc state to color management code ville.syrjala
2017-07-06 20:24 ` [PATCH 02/22] drm/i915: Pass the crtc state explicitly to intel_pipe_update_start/end() ville.syrjala
2017-07-06 20:24 ` [PATCH 03/22] drm/i915: Eliminate obj->state usage in g4x/vlv/chv wm computation ville.syrjala
2017-07-06 20:24 ` [PATCH 04/22] drm/i915: Pass proper old/new states to intel_plane_atomic_check_with_state() ville.syrjala
2017-07-10  9:04   ` Maarten Lankhorst
2017-07-10 13:30     ` Ville Syrjälä
2017-07-10 14:59   ` [PATCH v2 " ville.syrjala
2017-07-06 20:24 ` [PATCH 05/22] drm/i915: Eliminate obj->state usage from pre/post plane update ville.syrjala
2017-07-06 20:24 ` [PATCH 06/22] drm/i915: Eliminate crtc->state usage from intel_update_pipe_config() ville.syrjala
2017-07-06 20:24 ` [PATCH 07/22] drm/i915: Eliminate crtc->state usage from intel_atomic_commit_tail and .crtc_update() ville.syrjala
2017-07-10  9:20   ` [Intel-gfx] " Maarten Lankhorst
2017-07-06 20:24 ` [PATCH 08/22] drm: Add drm_dynarray ville.syrjala
2017-07-06 20:24 ` [PATCH 09/22] drm/atomic: Convert state->connectors to drm_dynarray ville.syrjala
2017-07-06 20:24 ` [PATCH 10/22] drm/atomic: Remove pointless private object NULL state check ville.syrjala
2017-07-06 20:24 ` [PATCH 11/22] drm/atomic: Convert private_objs to drm_dynarray ville.syrjala
2017-07-06 20:24 ` [PATCH 12/22] drm/atomic: Make private objs proper objects ville.syrjala
2017-07-06 20:24 ` [PATCH 13/22] drm/atomic: Pass old state to __drm_atomic_helper_crtc_duplicate_state() & co. explicitly ville.syrjala
2017-07-06 20:24 ` [PATCH 14/22] drm/arm: s/old_state/old_mali_state/ ville.syrjala
2017-07-06 20:24 ` [PATCH 15/22] drm/mediatek: s/old_state/old_mtk_state/ ville.syrjala
2017-07-06 20:24 ` [PATCH 16/22] drm/atomic: Pass old state explicitly to .atomic_duplicate_state() ville.syrjala
2017-07-06 20:24 ` [PATCH 17/22] drm/atomic: Fix up the kernel docs for the state duplication functions ville.syrjala
2017-07-06 20:24 ` [PATCH 18/22] drm: Return the connector from drm_connector_get() ville.syrjala
2017-07-10  9:21   ` Maarten Lankhorst [this message]
2017-07-06 20:24 ` [PATCH 19/22] drm/i915% Store vma gtt offset in plane state ville.syrjala
2017-07-06 20:24 ` [PATCH 20/22] drm/i915: Refactor __intel_atomic_commit_tail() ville.syrjala
2017-07-06 20:24 ` [PATCH v3 21/22] drm/atomic: Introduce drm_atomic_helper_duplicate_commited_state() ville.syrjala
2017-07-07 12:03   ` [Intel-gfx] " Daniel Vetter
2017-07-07 13:21     ` Ville Syrjälä
2017-07-07 14:05       ` Daniel Vetter
2017-07-07 15:18         ` Ville Syrjälä
2017-07-10  6:43           ` Daniel Vetter
2017-07-10  9:31             ` Maarten Lankhorst
2017-07-10 12:18               ` Ville Syrjälä
2017-07-10 13:26                 ` [Intel-gfx] " Maarten Lankhorst
2017-07-10 13:56                   ` Ville Syrjälä
2017-07-10 14:47                   ` Daniel Vetter
2017-07-06 20:24 ` [PATCH v5 22/22] drm/i915: Solve the GPU reset vs. modeset deadlocks with an rw_semaphore ville.syrjala
2017-07-10  6:48   ` 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=d2ec42c7-c72c-76f4-7848-6f9d7803170a@linux.intel.com \
    --to=maarten.lankhorst@linux.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