From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v4 3/5] drm/atomic: Add macros to access existing old/new state, v2.
Date: Wed, 01 Mar 2017 02:56:59 +0200 [thread overview]
Message-ID: <2414063.po5sNsMErD@avalon> (raw)
In-Reply-To: <1487256430-7625-4-git-send-email-maarten.lankhorst@linux.intel.com>
Hi Maarten,
Thank you for the patch.
On Thursday 16 Feb 2017 15:47:08 Maarten Lankhorst wrote:
> After atomic commit, these macros should be used in place of
> get_existing_state. Also after commit get_xx_state should no longer
> be used because it may not have the required locks.
>
> The calls to drm_atomic_get_existing_$obj_state should no longer be
> used, and converted over to these new calls.
>
> Changes since v1:
> - Expand commit message.
> - Deprecate get_existing_*_state functions in the documentation.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> include/drm/drm_atomic.h | 108 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 108 insertions(+)
>
> diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
> index c6f355a970d2..0147a047878d 100644
> --- a/include/drm/drm_atomic.h
> +++ b/include/drm/drm_atomic.h
> @@ -277,6 +277,9 @@ int drm_atomic_connector_set_property(struct
> drm_connector *connector, *
> * This function returns the crtc state for the given crtc, or NULL
> * if the crtc is not part of the global atomic state.
> + *
> + * This function is deprecated, @drm_atomic_get_old_crtc_state or
> + * @drm_atomic_get_new_crtc_state should be used instead.
> */
> static inline struct drm_crtc_state *
> drm_atomic_get_existing_crtc_state(struct drm_atomic_state *state,
> @@ -286,12 +289,44 @@ drm_atomic_get_existing_crtc_state(struct
> drm_atomic_state *state, }
>
> /**
> + * drm_atomic_get_old_crtc_state - get old crtc state, if it exists
> + * @state: global atomic state object
> + * @crtc: crtc to grab
> + *
> + * This function returns the old crtc state for the given crtc, or
> + * NULL if the crtc is not part of the global atomic state.
> + */
> +static inline struct drm_crtc_state *
> +drm_atomic_get_old_crtc_state(struct drm_atomic_state *state,
> + struct drm_crtc *crtc)
> +{
> + return state->crtcs[drm_crtc_index(crtc)].old_state;
> +}
> +/**
> + * drm_atomic_get_new_crtc_state - get new crtc state, if it exists
> + * @state: global atomic state object
> + * @crtc: crtc to grab
> + *
> + * This function returns the new crtc state for the given crtc, or
> + * NULL if the crtc is not part of the global atomic state.
> + */
> +static inline struct drm_crtc_state *
> +drm_atomic_get_new_crtc_state(struct drm_atomic_state *state,
> + struct drm_crtc *crtc)
> +{
> + return state->crtcs[drm_crtc_index(crtc)].new_state;
> +}
> +
> +/**
> * drm_atomic_get_existing_plane_state - get plane state, if it exists
> * @state: global atomic state object
> * @plane: plane to grab
> *
> * This function returns the plane state for the given plane, or NULL
> * if the plane is not part of the global atomic state.
> + *
> + * This function is deprecated, @drm_atomic_get_old_plane_state or
> + * @drm_atomic_get_new_plane_state should be used instead.
> */
> static inline struct drm_plane_state *
> drm_atomic_get_existing_plane_state(struct drm_atomic_state *state,
> @@ -301,12 +336,45 @@ drm_atomic_get_existing_plane_state(struct
> drm_atomic_state *state, }
>
> /**
> + * drm_atomic_get_old_plane_state - get plane state, if it exists
> + * @state: global atomic state object
> + * @plane: plane to grab
> + *
> + * This function returns the old plane state for the given plane, or
> + * NULL if the plane is not part of the global atomic state.
> + */
> +static inline struct drm_plane_state *
> +drm_atomic_get_old_plane_state(struct drm_atomic_state *state,
> + struct drm_plane *plane)
> +{
> + return state->planes[drm_plane_index(plane)].old_state;
> +}
> +
> +/**
> + * drm_atomic_get_new_plane_state - get plane state, if it exists
> + * @state: global atomic state object
> + * @plane: plane to grab
> + *
> + * This function returns the new plane state for the given plane, or
> + * NULL if the plane is not part of the global atomic state.
> + */
> +static inline struct drm_plane_state *
> +drm_atomic_get_new_plane_state(struct drm_atomic_state *state,
> + struct drm_plane *plane)
> +{
> + return state->planes[drm_plane_index(plane)].new_state;
> +}
> +
> +/**
> * drm_atomic_get_existing_connector_state - get connector state, if it
> exists * @state: global atomic state object
> * @connector: connector to grab
> *
> * This function returns the connector state for the given connector,
> * or NULL if the connector is not part of the global atomic state.
> + *
> + * This function is deprecated, @drm_atomic_get_old_connector_state or
> + * @drm_atomic_get_new_connector_state should be used instead.
> */
> static inline struct drm_connector_state *
> drm_atomic_get_existing_connector_state(struct drm_atomic_state *state,
> @@ -321,6 +389,46 @@ drm_atomic_get_existing_connector_state(struct
> drm_atomic_state *state, }
>
> /**
> + * drm_atomic_get_old_connector_state - get connector state, if it exists
> + * @state: global atomic state object
> + * @connector: connector to grab
> + *
> + * This function returns the old connector state for the given connector,
> + * or NULL if the connector is not part of the global atomic state.
> + */
> +static inline struct drm_connector_state *
> +drm_atomic_get_old_connector_state(struct drm_atomic_state *state,
> + struct drm_connector *connector)
> +{
> + int index = drm_connector_index(connector);
> +
> + if (index >= state->num_connector)
> + return NULL;
> +
> + return state->connectors[index].old_state;
> +}
> +
> +/**
> + * drm_atomic_get_new_connector_state - get connector state, if it exists
> + * @state: global atomic state object
> + * @connector: connector to grab
> + *
> + * This function returns the new connector state for the given connector,
> + * or NULL if the connector is not part of the global atomic state.
> + */
> +static inline struct drm_connector_state *
> +drm_atomic_get_new_connector_state(struct drm_atomic_state *state,
> + struct drm_connector *connector)
> +{
> + int index = drm_connector_index(connector);
> +
> + if (index >= state->num_connector)
> + return NULL;
> +
> + return state->connectors[index].new_state;
> +}
> +
> +/**
> * __drm_atomic_get_current_plane_state - get current plane state
> * @state: global atomic state object
> * @plane: plane to grab
--
Regards,
Laurent Pinchart
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-03-01 0:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-16 14:47 [PATCH v4 0/5] drm/atomic: Add accessor macros for all atomic state Maarten Lankhorst
2017-02-16 14:47 ` [PATCH v4 1/5] drm/atomic: Fix atomic helpers to use the new iterator macros, v2 Maarten Lankhorst
2017-03-01 0:49 ` Laurent Pinchart
2017-03-01 9:09 ` Maarten Lankhorst
2017-03-01 9:21 ` [PATCH v4.1 1/5] drm/atomic: Fix atomic helpers to use the new iterator macros, v3 Maarten Lankhorst
2017-03-01 10:06 ` Laurent Pinchart
2017-02-16 14:47 ` [PATCH v4 2/5] drm/atomic: Make drm_atomic_plane_disabling easier to understand Maarten Lankhorst
2017-03-01 0:53 ` Laurent Pinchart
2017-02-16 14:47 ` [PATCH v4 3/5] drm/atomic: Add macros to access existing old/new state, v2 Maarten Lankhorst
2017-03-01 0:56 ` Laurent Pinchart [this message]
2017-02-16 14:47 ` [PATCH v4 4/5] drm/atomic: Convert get_existing_state callers to get_old/new_state, v3 Maarten Lankhorst
2017-03-01 1:04 ` Laurent Pinchart
2017-03-01 9:22 ` [PATCH v4.1 4/5] drm/atomic: Convert get_existing_state callers to get_old/new_state, v4 Maarten Lankhorst
2017-02-16 14:47 ` [PATCH v4 5/5] drm/blend: Use new atomic iterator macros Maarten Lankhorst
2017-03-01 0:58 ` Laurent Pinchart
2017-02-16 19:22 ` ✓ Fi.CI.BAT: success for drm/atomic: Add accessor macros for all atomic state. (rev5) 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=2414063.po5sNsMErD@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--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