All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: ville.syrjala@linux.intel.com, dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org,
	Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Subject: Re: [Intel-gfx] [PATCH 3/3] drm/atomic: Make private objs proper objects
Date: Fri, 31 Dec 2021 15:23:31 +0200	[thread overview]
Message-ID: <87tueoj4bw.fsf@intel.com> (raw)
In-Reply-To: <20170712155102.26276-3-ville.syrjala@linux.intel.com>

On Wed, 12 Jul 2017, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Make the atomic private object stuff less special by introducing proper
> base classes for the object and its state. Drivers can embed these in
> their own appropriate objects, after which these things will work
> exactly like the plane/crtc/connector states during atomic operations.
>
> v2: Reorder to not depend on drm_dynarray (Daniel)
>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v1
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Stumbled upon an old commit

commit a4370c777406c2810e37fafd166ccddecdb2a60c
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Wed Jul 12 18:51:02 2017 +0300

    drm/atomic: Make private objs proper objects

which is this patch.

> @@ -3050,8 +3043,7 @@ struct drm_dp_mst_topology_state *drm_atomic_get_mst_topology_state(struct drm_a
>  	struct drm_device *dev = mgr->dev;
>  
>  	WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
> -	return drm_atomic_get_private_obj_state(state, mgr,
> -						&mst_state_funcs);
> +	return to_dp_mst_topology_state(drm_atomic_get_private_obj_state(state, &mgr->base));
>  }
>  EXPORT_SYMBOL(drm_atomic_get_mst_topology_state);

I don't think this combines well with...

> diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h
> index 177ab6f86855..d55abb75f29a 100644
> --- a/include/drm/drm_dp_mst_helper.h
> +++ b/include/drm/drm_dp_mst_helper.h
> @@ -404,12 +404,17 @@ struct drm_dp_payload {
>  	int vcpi;
>  };
>  
> +#define to_dp_mst_topology_state(x) container_of(x, struct drm_dp_mst_topology_state, base)

...this in case of error pointers that
drm_atomic_get_private_obj_state() may return.

Is that right, or am I just ready to 'shutdown -h now' for 2021...?


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: ville.syrjala@linux.intel.com, dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org,
	Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Subject: Re: [PATCH 3/3] drm/atomic: Make private objs proper objects
Date: Fri, 31 Dec 2021 15:23:31 +0200	[thread overview]
Message-ID: <87tueoj4bw.fsf@intel.com> (raw)
In-Reply-To: <20170712155102.26276-3-ville.syrjala@linux.intel.com>

On Wed, 12 Jul 2017, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Make the atomic private object stuff less special by introducing proper
> base classes for the object and its state. Drivers can embed these in
> their own appropriate objects, after which these things will work
> exactly like the plane/crtc/connector states during atomic operations.
>
> v2: Reorder to not depend on drm_dynarray (Daniel)
>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v1
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Stumbled upon an old commit

commit a4370c777406c2810e37fafd166ccddecdb2a60c
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Wed Jul 12 18:51:02 2017 +0300

    drm/atomic: Make private objs proper objects

which is this patch.

> @@ -3050,8 +3043,7 @@ struct drm_dp_mst_topology_state *drm_atomic_get_mst_topology_state(struct drm_a
>  	struct drm_device *dev = mgr->dev;
>  
>  	WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
> -	return drm_atomic_get_private_obj_state(state, mgr,
> -						&mst_state_funcs);
> +	return to_dp_mst_topology_state(drm_atomic_get_private_obj_state(state, &mgr->base));
>  }
>  EXPORT_SYMBOL(drm_atomic_get_mst_topology_state);

I don't think this combines well with...

> diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h
> index 177ab6f86855..d55abb75f29a 100644
> --- a/include/drm/drm_dp_mst_helper.h
> +++ b/include/drm/drm_dp_mst_helper.h
> @@ -404,12 +404,17 @@ struct drm_dp_payload {
>  	int vcpi;
>  };
>  
> +#define to_dp_mst_topology_state(x) container_of(x, struct drm_dp_mst_topology_state, base)

...this in case of error pointers that
drm_atomic_get_private_obj_state() may return.

Is that right, or am I just ready to 'shutdown -h now' for 2021...?


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2021-12-31 13:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12 15:51 [PATCH 1/3] drm/dp/mst: Handle errors from drm_atomic_get_private_obj_state() correctly ville.syrjala
2017-07-12 15:51 ` [PATCH 2/3] drm/atomic: Remove pointless private object NULL state check ville.syrjala
2017-07-12 15:51 ` [PATCH 3/3] drm/atomic: Make private objs proper objects ville.syrjala
2021-12-31 13:23   ` Jani Nikula [this message]
2021-12-31 13:23     ` Jani Nikula
2022-01-10 16:00     ` [Intel-gfx] " Ville Syrjälä
2022-01-10 16:00       ` Ville Syrjälä
2022-01-11  8:34       ` [Intel-gfx] " Jani Nikula
2022-01-11  8:34         ` Jani Nikula
2022-01-12 13:12         ` [Intel-gfx] " Ville Syrjälä
2022-01-12 13:12           ` Ville Syrjälä
2017-07-12 17:28 ` [PATCH 1/3] drm/dp/mst: Handle errors from drm_atomic_get_private_obj_state() correctly Pandiyan, Dhinakaran
2017-07-12 17:28   ` Pandiyan, Dhinakaran

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=87tueoj4bw.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dhinakaran.pandiyan@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 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.