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 initializing a
single CRTC.
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Link: https://patch.msgid.link/20251204143235.3138973-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
.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;
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)
{
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);
/* 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))
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);