From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F9273E3D89; Mon, 4 May 2026 16:53:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777913617; cv=none; b=b17sZ+9XXJcnH4SqzHsNN/2yXzeC3vqmPtcMzBMBESQ66kpjunwxaGdu1/FLGjkceAp2LC6txDGCEuKNMJryGcQFqopBzrT0aZnws9VVAK00mWLC20VGU9/oYMASrNrUrg0Ptj3v6zUwMIWz7VizUWwn1jZbbOJi5mN9XoQ9+0U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777913617; c=relaxed/simple; bh=+EZl9qZ81AdPzkkEwOpCoiOGzDn6NE5XspISBAQ0FQQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Y9r5OJNnhhFhVAq4kQ6TocTkxpfhkd65WmGHJ6r2fKWwrerUxk1zW6QKecD7zNVHi7prPeT+Nr9I/iRObBE8RLZ1DrZ7ezLfgInABo46FTUhWVDrsWXXhI4SqQGQ7MiE7t9GzfKFphyCtiKcJ43wC+SfEyLsMP646whj5BcY8No= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=CvpwrU2Z; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="CvpwrU2Z" Received: from killaraus.ideasonboard.com (2001-14ba-703d-e500--2a1.rev.dnainternet.fi [IPv6:2001:14ba:703d:e500::2a1]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4904D9C; Mon, 4 May 2026 18:53:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1777913611; bh=+EZl9qZ81AdPzkkEwOpCoiOGzDn6NE5XspISBAQ0FQQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CvpwrU2ZVuvJEMaGn/PmoNDMHJ4B3SbUdj8uAZYFJFB4/dGDtzcjF75/LvVQ5YzAC RIfuJ0A5tkqa40FdmOa+pVb3ieNpgSDKRNch8yvbU7lZ/WZeC7JAT/BYdlOHosaoI3 2uLpdybBMGCQTjbhn81cN5aCxRU9TN2Zq1AFa1Oo= Date: Mon, 4 May 2026 19:53:32 +0300 From: Laurent Pinchart To: Maxime Ripard Cc: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Jonathan Corbet , Shuah Khan , Dmitry Baryshkov , Jyri Sarha , Tomi Valkeinen , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Simon Ser , Harry Wentland , Melissa Wen , Sebastian Wick , Alex Hung , Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , Chen-Yu Tsai , Samuel Holland , Dave Stevenson , =?utf-8?B?TWHDrXJh?= Canal , Raspberry Pi Kernel Maintenance , dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Stone , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH v3 11/20] drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset() Message-ID: <20260504165332.GN1344263@killaraus.ideasonboard.com> References: <20260424-drm-mode-config-init-v3-0-8b68d9db0d8b@kernel.org> <20260424-drm-mode-config-init-v3-11-8b68d9db0d8b@kernel.org> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260424-drm-mode-config-init-v3-11-8b68d9db0d8b@kernel.org> On Fri, Apr 24, 2026 at 12:18:51PM +0200, Maxime Ripard wrote: > __drm_atomic_helper_crtc_state_reset() is used to initialize a newly > allocated drm_crtc_state, and is being typically called by the > drm_crtc_funcs.reset implementation. > > Since we want to consolidate DRM objects state allocation around the > atomic_create_state callback that will only allocate and initialize a > new drm_crtc_state instance, we will need to call > __drm_atomic_helper_crtc_state_reset() from both the reset and > atomic_create hooks. > > To avoid any confusion, we can thus rename > __drm_atomic_helper_crtc_state_reset() to > __drm_atomic_helper_crtc_state_init(). > > Suggested-by: Laurent Pinchart > Reviewed-by: Thomas Zimmermann > Signed-off-by: Maxime Ripard > --- > drivers/gpu/drm/drm_atomic_state_helper.c | 10 +++++----- > drivers/gpu/drm/i915/display/intel_crtc.c | 2 +- > include/drm/drm_atomic_state_helper.h | 2 +- > 3 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c > index 50fe4eec41a8..9cd8550cabb7 100644 > --- a/drivers/gpu/drm/drm_atomic_state_helper.c > +++ b/drivers/gpu/drm/drm_atomic_state_helper.c > @@ -61,25 +61,25 @@ > * For other drivers the building blocks are split out, see the documentation > * for these functions. > */ > > /** > - * __drm_atomic_helper_crtc_state_reset - reset the CRTC state > + * __drm_atomic_helper_crtc_state_init - Initializes the CRTC state "Initialize" Reviewed-by: Laurent Pinchart > * @crtc_state: atomic CRTC state, must not be NULL > * @crtc: CRTC object, must not be NULL > * > * Initializes the newly allocated @crtc_state with default > * values. This is useful for drivers that subclass the CRTC state. > */ > void > -__drm_atomic_helper_crtc_state_reset(struct drm_crtc_state *crtc_state, > - struct drm_crtc *crtc) > +__drm_atomic_helper_crtc_state_init(struct drm_crtc_state *crtc_state, > + struct drm_crtc *crtc) > { > crtc_state->crtc = crtc; > crtc_state->background_color = DRM_ARGB64_PREP(0xffff, 0, 0, 0); > } > -EXPORT_SYMBOL(__drm_atomic_helper_crtc_state_reset); > +EXPORT_SYMBOL(__drm_atomic_helper_crtc_state_init); > > /** > * __drm_atomic_helper_crtc_reset - reset state on CRTC > * @crtc: drm CRTC > * @crtc_state: CRTC state to assign > @@ -94,11 +94,11 @@ EXPORT_SYMBOL(__drm_atomic_helper_crtc_state_reset); > void > __drm_atomic_helper_crtc_reset(struct drm_crtc *crtc, > struct drm_crtc_state *crtc_state) > { > if (crtc_state) > - __drm_atomic_helper_crtc_state_reset(crtc_state, crtc); > + __drm_atomic_helper_crtc_state_init(crtc_state, crtc); > > if (drm_dev_has_vblank(crtc->dev)) > drm_crtc_vblank_reset(crtc); > > crtc->state = crtc_state; > diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c > index b8189cd5d864..a2ed4a76e061 100644 > --- a/drivers/gpu/drm/i915/display/intel_crtc.c > +++ b/drivers/gpu/drm/i915/display/intel_crtc.c > @@ -179,11 +179,11 @@ struct intel_crtc_state *intel_crtc_state_alloc(struct intel_crtc *crtc) > void intel_crtc_state_reset(struct intel_crtc_state *crtc_state, > struct intel_crtc *crtc) > { > memset(crtc_state, 0, sizeof(*crtc_state)); > > - __drm_atomic_helper_crtc_state_reset(&crtc_state->uapi, &crtc->base); > + __drm_atomic_helper_crtc_state_init(&crtc_state->uapi, &crtc->base); > > crtc_state->cpu_transcoder = INVALID_TRANSCODER; > crtc_state->master_transcoder = INVALID_TRANSCODER; > crtc_state->hsw_workaround_pipe = INVALID_PIPE; > crtc_state->scaler_state.scaler_id = -1; > diff --git a/include/drm/drm_atomic_state_helper.h b/include/drm/drm_atomic_state_helper.h > index df371b2eef3e..e7fbbfdc5d69 100644 > --- a/include/drm/drm_atomic_state_helper.h > +++ b/include/drm/drm_atomic_state_helper.h > @@ -38,11 +38,11 @@ struct drm_connector_state; > struct drm_private_obj; > struct drm_private_state; > struct drm_modeset_acquire_ctx; > struct drm_device; > > -void __drm_atomic_helper_crtc_state_reset(struct drm_crtc_state *state, > +void __drm_atomic_helper_crtc_state_init(struct drm_crtc_state *state, > struct drm_crtc *crtc); > void __drm_atomic_helper_crtc_reset(struct drm_crtc *crtc, > struct drm_crtc_state *state); > void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc); > void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc, -- Regards, Laurent Pinchart