From: "Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
To: "daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>
Cc: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"bskeggs@redhat.com" <bskeggs@redhat.com>,
"alexander.deucher@amd.com" <alexander.deucher@amd.com>,
"harry.wentland@amd.com" <harry.wentland@amd.com>,
"Lankhorst, Maarten" <maarten.lankhorst@intel.com>
Subject: Re: [PATCH v3 7/8] drm: Connector helper function to release resources
Date: Tue, 14 Feb 2017 22:29:27 +0000 [thread overview]
Message-ID: <1487112475.32142.73.camel@dk-H97M-D3H> (raw)
In-Reply-To: <CAKMK7uH9n8gc75pNFk3RENLhLRUgWh03QHygyvjxJRbhDb=h+A@mail.gmail.com>
On Tue, 2017-02-14 at 20:51 +0100, Daniel Vetter wrote:
> On Mon, Feb 13, 2017 at 10:26 PM, Pandiyan, Dhinakaran
> <dhinakaran.pandiyan@intel.com> wrote:
> > On Mon, 2017-02-13 at 09:05 +0000, Lankhorst, Maarten wrote:
> >> Pandiyan, Dhinakaran schreef op do 09-02-2017 om 18:55 [+0000]:
> >> > On Thu, 2017-02-09 at 09:01 +0000, Lankhorst, Maarten wrote:
> >> > >
> >> > > Dhinakaran Pandiyan schreef op wo 08-02-2017 om 22:38 [-0800]:
> >> > > >
> >> > > > Having a ->atomic_release callback is useful to release shared
> >> > > > resources
> >> > > > that get allocated in compute_config(). This function is expected
> >> > > > to
> >> > > > be
> >> > > > called in the atomic_check() phase before new resources are
> >> > > > acquired.
> >> > > >
> >> > > > v2: Moved the caller hunk to this patch (Daniel)
> >> > > >
> >> > > > Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> > > > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com
> >> > > > >
> >> > > > ---
> >> > > > drivers/gpu/drm/drm_atomic_helper.c | 19
> >> > > > +++++++++++++++++++
> >> > > > include/drm/drm_modeset_helper_vtables.h | 13 +++++++++++++
> >> > > > 2 files changed, 32 insertions(+)
> >> > > >
> >> > > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> >> > > > b/drivers/gpu/drm/drm_atomic_helper.c
> >> > > > index 8795088..92bd741 100644
> >> > > > --- a/drivers/gpu/drm/drm_atomic_helper.c
> >> > > > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> >> > > > @@ -576,6 +576,25 @@ drm_atomic_helper_check_modeset(struct
> >> > > > drm_device *dev,
> >> > > > }
> >> > > > }
> >> > > >
> >> > > > + for_each_connector_in_state(state, connector,
> >> > > > connector_state, i) {
> >> > > > + const struct drm_connector_helper_funcs
> >> > > > *conn_funcs;
> >> > > > + struct drm_crtc_state *crtc_state;
> >> > > > +
> >> > > > + conn_funcs = connector->helper_private;
> >> > > > + if (!conn_funcs->atomic_release)
> >> > > > + continue;
> >> > > > +
> >> > > > + if (!connector->state->crtc)
> >> > > > + continue;
> >> > > > +
> >> > > > + crtc_state =
> >> > > > drm_atomic_get_existing_crtc_state(state, connector->state-
> >> > > > >crtc);
> >> > > > +
> >> > > > + if (crtc_state->connectors_changed ||
> >> > > > + crtc_state->mode_changed ||
> >> > > > + (crtc_state->active_changed && !crtc_state-
> >> > > > >
> >> > > > > active))
> >> > > > + conn_funcs->atomic_release(connector,
> >> > > > connector_state);
> >> > > > + }
> >> > >
> >> > > Could we deal with the VCPI state separately in
> >> > > intel_modeset_checks,
> >> > > like we do with dpll?
> >> >
> >> > We'd want to release the VCPI slots before they are acquired in
> >> > ->compute_config(). intel_modeset_checks() will be too late to
> >> > release
> >> > them. Are you suggesting both acquiring and releasing slots should be
> >> > done in intel_modeset_checks()?
> >>
> >> That makes things a bit more nasty. Maybe add a
> >> conn_funcs->atomic_check that always gets called, something like I did
> >> below?
> >>
> >> I'd love to use it for some atomic connector properties too.
> >
> >
> > Adding and unconditionally calling conn_funcs->atomic_check() should be
> > doable. It also follows the pattern we have for encoders and CRTCs. But
> > I'll have to move the connector->state->crtc state checks inside the
> > function.
>
> Adding ->atomic_check that's unconditionally called sounds troubling,
> because all the other ->atomic_check functions are _only_ called when
> enabling stuff. ->atomic_release sounds much better to me, and from a
> helper pov DK's patch above is the right place.
>
> If that place doesn't work for i915.ko, then we need our own callback
> (like we already have with e.g. ->compute_config, we could do a
> ->release_config). But if it's just cosmetics, then I don't see the
> reason why we need to change this. On that issue: How exactly does our
> compute_config work if we haven't updated the routing (using the above
> helper) yet? That sounds like a pretty big misdesign on our side ...
> -Daniel
>
Are you referring to the drm_atomic_helper_check_modeset() helper? We do
call it to update connector routing before compute_config .
-DK
> >
> > -DK
> >> > >
> >> > >
> >> > > Maybe implementing the relevant VCPI state could be done as an
> >> > > atomic
> >> > > helper function too, so other atomic drivers can just plug it in.
> >> > >
> >> > The idea was to reduce boilerplate in the drivers and use the
> >> > private_obj state for different object types.
> >> >
> >> >
> >> > >
> >> > > Not sure how doable this is, but if it's not too hard, then it's
> >> > > probably cleaner :)
> >> > > _______________________________________________
> >> > > 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
> >
>
>
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-02-14 22:29 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-09 6:38 [PATCH v3 0/8] Adding driver-private objects to atomic state Dhinakaran Pandiyan
2017-02-09 6:38 ` [PATCH v3 1/8] drm/dp: Kill total_pbn and total_slots in struct drm_dp_mst_topology_mgr Dhinakaran Pandiyan
2017-02-09 6:38 ` [PATCH v3 2/8] drm/dp: Kill unused MST vcpi slot availability tracking Dhinakaran Pandiyan
2017-02-09 6:38 ` [PATCH v3 3/8] drm/dp: Split drm_dp_mst_allocate_vcpi Dhinakaran Pandiyan
2017-02-09 6:38 ` [PATCH v3 4/8] drm: Add driver-private objects to atomic state Dhinakaran Pandiyan
2017-02-09 8:08 ` Chris Wilson
2017-02-09 18:57 ` Pandiyan, Dhinakaran
2017-02-15 11:23 ` Archit Taneja
2017-02-16 0:13 ` Pandiyan, Dhinakaran
2017-02-17 10:07 ` Archit Taneja
2017-02-22 0:01 ` Pandiyan, Dhinakaran
2017-02-22 4:29 ` Archit Taneja
2017-02-22 21:10 ` Pandiyan, Dhinakaran
2017-02-26 19:57 ` Daniel Vetter
2017-02-27 18:51 ` Pandiyan, Dhinakaran
2017-03-02 22:31 ` Pandiyan, Dhinakaran
2017-02-09 6:38 ` [PATCH v3 5/8] drm/dp: Introduce MST topology state to track available link bandwidth Dhinakaran Pandiyan
2017-02-09 6:38 ` [PATCH v3 6/8] drm/dp: Add DP MST helpers to atomically find and release vcpi slots Dhinakaran Pandiyan
2017-02-09 6:38 ` [PATCH v3 7/8] drm: Connector helper function to release resources Dhinakaran Pandiyan
2017-02-09 9:01 ` Lankhorst, Maarten
2017-02-09 18:55 ` Pandiyan, Dhinakaran
2017-02-13 9:05 ` Lankhorst, Maarten
2017-02-13 21:26 ` Pandiyan, Dhinakaran
2017-02-13 22:48 ` Pandiyan, Dhinakaran
2017-02-20 9:40 ` Lankhorst, Maarten
2017-02-14 19:51 ` Daniel Vetter
2017-02-14 22:29 ` Pandiyan, Dhinakaran [this message]
2017-02-16 9:09 ` Lankhorst, Maarten
2017-02-24 0:52 ` Pandiyan, Dhinakaran
2017-02-26 20:00 ` [Intel-gfx] " Daniel Vetter
2017-02-27 7:42 ` Lankhorst, Maarten
2017-02-09 6:38 ` [PATCH v3 8/8] drm/dp: Track MST link bandwidth Dhinakaran Pandiyan
2017-02-09 8:03 ` ✓ Fi.CI.BAT: success for Adding driver-private objects to atomic state 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=1487112475.32142.73.camel@dk-H97M-D3H \
--to=dhinakaran.pandiyan@intel.com \
--cc=alexander.deucher@amd.com \
--cc=bskeggs@redhat.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@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