From: "Borah, Chaitanya Kumar" <chaitanya.kumar.borah@intel.com>
To: Jani Nikula <jani.nikula@intel.com>,
<intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915/crtc: move crtc initialization loop to intel_crtc.c
Date: Tue, 9 Dec 2025 18:04:10 +0530 [thread overview]
Message-ID: <c60163ac-bd8f-40a9-815c-80730801511d@intel.com> (raw)
In-Reply-To: <20251204143235.3138973-1-jani.nikula@intel.com>
On 12/4/2025 8:02 PM, Jani Nikula wrote:
> intel_display_driver_probe_nogem() is too high of an abstraction level
> to be looping and initializing individual CRTCs. Move this to
> intel_crtc.c and repurpose intel_crtc_init() to initialize all
> CRTCs. Make the original a static __intel_crtc_init() for ininitializing
> a single CRTC.
>
typo: s/ininitializing/initializing
Other than that, LGTM
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> ---
>
> This is prep for doing [1] in a nicer way, without divulging the details
> at the high level.
>
> [1] https://lore.kernel.org/r/20251119153321.2640969-1-jani.nikula@intel.com
> ---
> drivers/gpu/drm/i915/display/intel_crtc.c | 19 ++++++++++++++++++-
> drivers/gpu/drm/i915/display/intel_crtc.h | 2 +-
> .../drm/i915/display/intel_display_driver.c | 13 +++----------
> 3 files changed, 22 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
> index 5e1e02c8d9d4..778ebc5095c3 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.c
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.c
> @@ -308,7 +308,7 @@ static const struct drm_crtc_funcs i8xx_crtc_funcs = {
> .get_vblank_timestamp = intel_crtc_get_vblank_timestamp,
> };
>
> -int intel_crtc_init(struct intel_display *display, enum pipe pipe)
> +static int __intel_crtc_init(struct intel_display *display, enum pipe pipe)
> {
> struct intel_plane *primary, *cursor;
> const struct drm_crtc_funcs *funcs;
> @@ -406,6 +406,23 @@ int intel_crtc_init(struct intel_display *display, enum pipe pipe)
> return ret;
> }
>
> +int intel_crtc_init(struct intel_display *display)
> +{
> + enum pipe pipe;
> + int ret;
> +
> + drm_dbg_kms(display->drm, "%d display pipe%s available.\n",
> + INTEL_NUM_PIPES(display), str_plural(INTEL_NUM_PIPES(display)));
> +
> + for_each_pipe(display, pipe) {
> + ret = __intel_crtc_init(display, pipe);
> + if (ret)
> + return ret;
> + }
> +
> + return 0;
> +}
> +
> int intel_crtc_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
> struct drm_file *file)
> {
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.h b/drivers/gpu/drm/i915/display/intel_crtc.h
> index 07917e8a9ae3..12507b51ee77 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.h
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.h
> @@ -37,7 +37,7 @@ void intel_crtc_arm_vblank_event(struct intel_crtc_state *crtc_state);
> void intel_crtc_prepare_vblank_event(struct intel_crtc_state *crtc_state,
> struct drm_pending_vblank_event **event);
> u32 intel_crtc_max_vblank_count(const struct intel_crtc_state *crtc_state);
> -int intel_crtc_init(struct intel_display *display, enum pipe pipe);
> +int intel_crtc_init(struct intel_display *display);
> int intel_crtc_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
> struct drm_file *file_priv);
> struct intel_crtc_state *intel_crtc_state_alloc(struct intel_crtc *crtc);
> diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c
> index 7e000ba3e08b..e282b533d5b6 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_driver.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
> @@ -452,7 +452,6 @@ bool intel_display_driver_check_access(struct intel_display *display)
> /* part #2: call after irq install, but before gem init */
> int intel_display_driver_probe_nogem(struct intel_display *display)
> {
> - enum pipe pipe;
> int ret;
>
> if (!HAS_DISPLAY(display))
> @@ -466,15 +465,9 @@ int intel_display_driver_probe_nogem(struct intel_display *display)
>
> intel_gmbus_setup(display);
>
> - drm_dbg_kms(display->drm, "%d display pipe%s available.\n",
> - INTEL_NUM_PIPES(display),
> - INTEL_NUM_PIPES(display) > 1 ? "s" : "");
> -
> - for_each_pipe(display, pipe) {
> - ret = intel_crtc_init(display, pipe);
> - if (ret)
> - goto err_mode_config;
> - }
> + ret = intel_crtc_init(display);
> + if (ret)
> + goto err_mode_config;
>
> intel_plane_possible_crtcs_init(display);
> intel_dpll_init(display);
next prev parent reply other threads:[~2025-12-09 12:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-04 14:32 [PATCH] drm/i915/crtc: move crtc initialization loop to intel_crtc.c Jani Nikula
2025-12-05 8:10 ` ✓ i915.CI.BAT: success for " Patchwork
2025-12-06 3:46 ` ✓ i915.CI.Full: " Patchwork
2025-12-09 12:34 ` Borah, Chaitanya Kumar [this message]
2025-12-09 13:16 ` [PATCH] " 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=c60163ac-bd8f-40a9-815c-80730801511d@intel.com \
--to=chaitanya.kumar.borah@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@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