linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Xinhui Pan" <Xinhui.Pan@amd.com>,
	"Patrik Jakobsson" <patrik.r.jakobsson@gmail.com>,
	"Rob Clark" <robdclark@gmail.com>,
	"Abhinav Kumar" <quic_abhinavk@quicinc.com>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Sean Paul" <sean@poorly.run>,
	"Marijn Suijten" <marijn.suijten@somainline.org>,
	"Karol Herbst" <kherbst@redhat.com>,
	"Lyude Paul" <lyude@redhat.com>,
	"Danilo Krummrich" <dakr@redhat.com>,
	"Sandy Huang" <hjc@rock-chips.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Andy Yan" <andy.yan@rock-chips.com>,
	amd-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm: Move plane->{fb,old_fb,crtc} to legacy sub-structure
Date: Fri, 25 Oct 2024 13:15:18 +0300	[thread overview]
Message-ID: <ZxtvtqQzME--oy7-@intel.com> (raw)
In-Reply-To: <875xpgqzc1.fsf@intel.com>

On Fri, Oct 25, 2024 at 12:57:50PM +0300, Jani Nikula wrote:
> On Thu, 03 Oct 2024, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> > On Wed, Oct 02, 2024 at 09:21:59PM +0300, Ville Syrjala wrote:
> >> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> 
> >> Hide the plane->fb/etc. footguns better by stashing them inside
> >> a "legacy" sub struct.
> >> 
> >> Eventually maybe we could turn 'legacy' into a pointer
> >> that only exists on legacy drivers to completely prevent
> >> any abuse by atomic drivers...
> >
> > Hmm. I should probably make it a pointer from the start,
> > to avoid having to go through the same churn yet again.
> 
> [snip]
> 
> >> diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
> >> index dd718c62ac31..a2d91ee4b40c 100644
> >> --- a/include/drm/drm_plane.h
> >> +++ b/include/drm/drm_plane.h
> >> @@ -663,31 +663,33 @@ struct drm_plane {
> >>  	/** @modifier_count: Size of the array pointed at by @modifier_count. */
> >>  	unsigned int modifier_count;
> >>  
> >> -	/**
> >> -	 * @crtc:
> >> -	 *
> >> -	 * Currently bound CRTC, only meaningful for non-atomic drivers. For
> >> -	 * atomic drivers this is forced to be NULL, atomic drivers should
> >> -	 * instead check &drm_plane_state.crtc.
> >> -	 */
> >> -	struct drm_crtc *crtc;
> >> -
> >> -	/**
> >> -	 * @fb:
> >> -	 *
> >> -	 * Currently bound framebuffer, only meaningful for non-atomic drivers.
> >> -	 * For atomic drivers this is forced to be NULL, atomic drivers should
> >> -	 * instead check &drm_plane_state.fb.
> >> -	 */
> >> -	struct drm_framebuffer *fb;
> >> -
> >> -	/**
> >> -	 * @old_fb:
> >> -	 *
> >> -	 * Temporary tracking of the old fb while a modeset is ongoing. Only
> >> -	 * used by non-atomic drivers, forced to be NULL for atomic drivers.
> >> -	 */
> >> -	struct drm_framebuffer *old_fb;
> >> +	struct {
> 
> Do you mean something along the lines of:
> 
> 	struct __plane_legacy_or_something {
> 
> >> +		/**
> >> +		 * @crtc:
> >> +		 *
> >> +		 * Currently bound CRTC, only meaningful for non-atomic drivers. For
> >> +		 * atomic drivers this is forced to be NULL, atomic drivers should
> >> +		 * instead check &drm_plane_state.crtc.
> >> +		 */
> >> +		struct drm_crtc *crtc;
> >> +
> >> +		/**
> >> +		 * @fb:
> >> +		 *
> >> +		 * Currently bound framebuffer, only meaningful for non-atomic drivers.
> >> +		 * For atomic drivers this is forced to be NULL, atomic drivers should
> >> +		 * instead check &drm_plane_state.fb.
> >> +		 */
> >> +		struct drm_framebuffer *fb;
> >> +
> >> +		/**
> >> +		 * @old_fb:
> >> +		 *
> >> +		 * Temporary tracking of the old fb while a modeset is ongoing. Only
> >> +		 * used by non-atomic drivers, forced to be NULL for atomic drivers.
> >> +		 */
> >> +		struct drm_framebuffer *old_fb;
> >> +	} legacy;
> 
> and
> 
> 	} __legacy;
> 
> 	struct __plane_legacy_or_something *legacy;
> 
> and initially unconditionally:
> 
>        	p->legacy = &p->__legacy;
> 
> but later, once atomic drivers have been fixed:
> 
> 	if (!drm_core_check_feature(dev, DRIVER_COMPUTE_ATOMIC))
> 		p->legacy = &p->__legacy;
> 
> It would make the last update really simple.

Yeah, something like that.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2024-10-25 10:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02 18:21 [PATCH 0/2] drm: Treewide plane/crtc legacy state sweeping Ville Syrjala
2024-10-02 18:21 ` [PATCH 1/2] drm: Move plane->{fb,old_fb,crtc} to legacy sub-structure Ville Syrjala
2024-10-03 11:12   ` Ville Syrjälä
2024-10-25  9:57     ` Jani Nikula
2024-10-25 10:15       ` Ville Syrjälä [this message]
     [not found] ` <20241002182200.15363-3-ville.syrjala@linux.intel.com>
2024-10-03 12:38   ` [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} " Louis Chauvet
2024-10-03 13:46     ` Ville Syrjälä
2024-10-03 15:07       ` Louis Chauvet
2024-10-03 15:29         ` Ville Syrjälä
2024-10-03 15:45           ` Louis Chauvet
2024-10-25  7:46 ` [PATCH 0/2] drm: Treewide plane/crtc legacy state sweeping Ville Syrjälä
2024-10-25  9:54   ` Dmitry Baryshkov
2024-10-25  9:59   ` Jani Nikula

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=ZxtvtqQzME--oy7-@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andy.yan@rock-chips.com \
    --cc=christian.koenig@amd.com \
    --cc=dakr@redhat.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=kherbst@redhat.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=marijn.suijten@somainline.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=patrik.r.jakobsson@gmail.com \
    --cc=quic_abhinavk@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    /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;
as well as URLs for NNTP newsgroup(s).