* [PATCH 14/17] drm/tegra: Convert to using __drm_atomic_helper_crtc_reset() for reset. [not found] <20190301125627.7285-1-maarten.lankhorst@linux.intel.com> @ 2019-03-01 12:56 ` Maarten Lankhorst 2019-03-04 13:02 ` Thierry Reding 0 siblings, 1 reply; 2+ messages in thread From: Maarten Lankhorst @ 2019-03-01 12:56 UTC (permalink / raw) To: dri-devel; +Cc: linux-tegra, intel-gfx, Thierry Reding, Jonathan Hunter Convert tegra to using __drm_atomic_helper_crtc_reset(), instead of writing its own version. Instead of open coding destroy_state(), call it directly for freeing the old state. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: linux-tegra@vger.kernel.org --- drivers/gpu/drm/tegra/dc.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 607a6ea17ecc..57c88d78cdaa 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -1153,25 +1153,6 @@ static void tegra_dc_destroy(struct drm_crtc *crtc) drm_crtc_cleanup(crtc); } -static void tegra_crtc_reset(struct drm_crtc *crtc) -{ - struct tegra_dc_state *state; - - if (crtc->state) - __drm_atomic_helper_crtc_destroy_state(crtc->state); - - kfree(crtc->state); - crtc->state = NULL; - - state = kzalloc(sizeof(*state), GFP_KERNEL); - if (state) { - crtc->state = &state->base; - crtc->state->crtc = crtc; - } - - drm_crtc_vblank_reset(crtc); -} - static struct drm_crtc_state * tegra_crtc_atomic_duplicate_state(struct drm_crtc *crtc) { @@ -1198,6 +1179,17 @@ static void tegra_crtc_atomic_destroy_state(struct drm_crtc *crtc, kfree(state); } +static void tegra_crtc_reset(struct drm_crtc *crtc) +{ + struct tegra_dc_state *state = kzalloc(sizeof(*state), GFP_KERNEL); + + if (crtc->state) + tegra_crtc_atomic_destroy_state(crtc, crtc->state); + + __drm_atomic_helper_crtc_reset(crtc, &state->base); + drm_crtc_vblank_reset(crtc); +} + #define DEBUGFS_REG32(_name) { .name = #_name, .offset = _name } static const struct debugfs_reg32 tegra_dc_regs[] = { -- 2.20.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 14/17] drm/tegra: Convert to using __drm_atomic_helper_crtc_reset() for reset. 2019-03-01 12:56 ` [PATCH 14/17] drm/tegra: Convert to using __drm_atomic_helper_crtc_reset() for reset Maarten Lankhorst @ 2019-03-04 13:02 ` Thierry Reding 0 siblings, 0 replies; 2+ messages in thread From: Thierry Reding @ 2019-03-04 13:02 UTC (permalink / raw) To: Maarten Lankhorst; +Cc: linux-tegra, intel-gfx, dri-devel, Jonathan Hunter [-- Attachment #1.1: Type: text/plain, Size: 2153 bytes --] On Fri, Mar 01, 2019 at 01:56:24PM +0100, Maarten Lankhorst wrote: > Convert tegra to using __drm_atomic_helper_crtc_reset(), instead of > writing its own version. Instead of open coding destroy_state(), > call it directly for freeing the old state. > > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > Cc: Thierry Reding <thierry.reding@gmail.com> > Cc: Jonathan Hunter <jonathanh@nvidia.com> > Cc: linux-tegra@vger.kernel.org > --- > drivers/gpu/drm/tegra/dc.c | 30 +++++++++++------------------- > 1 file changed, 11 insertions(+), 19 deletions(-) > > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c > index 607a6ea17ecc..57c88d78cdaa 100644 > --- a/drivers/gpu/drm/tegra/dc.c > +++ b/drivers/gpu/drm/tegra/dc.c > @@ -1153,25 +1153,6 @@ static void tegra_dc_destroy(struct drm_crtc *crtc) > drm_crtc_cleanup(crtc); > } > > -static void tegra_crtc_reset(struct drm_crtc *crtc) > -{ > - struct tegra_dc_state *state; > - > - if (crtc->state) > - __drm_atomic_helper_crtc_destroy_state(crtc->state); > - > - kfree(crtc->state); > - crtc->state = NULL; > - > - state = kzalloc(sizeof(*state), GFP_KERNEL); > - if (state) { > - crtc->state = &state->base; > - crtc->state->crtc = crtc; > - } > - > - drm_crtc_vblank_reset(crtc); > -} > - > static struct drm_crtc_state * > tegra_crtc_atomic_duplicate_state(struct drm_crtc *crtc) > { > @@ -1198,6 +1179,17 @@ static void tegra_crtc_atomic_destroy_state(struct drm_crtc *crtc, > kfree(state); > } > > +static void tegra_crtc_reset(struct drm_crtc *crtc) > +{ > + struct tegra_dc_state *state = kzalloc(sizeof(*state), GFP_KERNEL); > + > + if (crtc->state) > + tegra_crtc_atomic_destroy_state(crtc, crtc->state); > + > + __drm_atomic_helper_crtc_reset(crtc, &state->base); > + drm_crtc_vblank_reset(crtc); > +} > + I would preferred a predeclaration of tegra_crtc_atomic_destroy_state() in this case because the implementations are in the same order as their use in tegra_crtc_funcs, but I think I can live with it, so either way: Acked-by: Thierry Reding <treding@nvidia.com> [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 159 bytes --] _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-04 13:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20190301125627.7285-1-maarten.lankhorst@linux.intel.com>
2019-03-01 12:56 ` [PATCH 14/17] drm/tegra: Convert to using __drm_atomic_helper_crtc_reset() for reset Maarten Lankhorst
2019-03-04 13:02 ` Thierry Reding
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).