Commit 6cc3776b authored by Vinod Govindapillai's avatar Vinod Govindapillai
Browse files

drm/i915/display: Use a sub-struct for fbc operations in intel_display



As FBC can utilize the system cache in xe3p_lpd onwards, we need
a provision to track which fbc instance is utilizing this cache.
A sub-struct at intel_display level to group all the fbc ops will
make fbc handling much easier. Introduce a fbc sub-struct and move
the fbc instance array into that.

v2: changes in commit message

Suggested-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarVinod Govindapillai <vinod.govindapillai@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20251127115349.249120-2-vinod.govindapillai@intel.com
parent 1552691f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ static struct intel_fbc *i9xx_plane_fbc(struct intel_display *display,
					enum i9xx_plane_id i9xx_plane)
{
	if (i9xx_plane_has_fbc(display, i9xx_plane))
		return display->fbc[INTEL_FBC_A];
		return display->fbc.instances[INTEL_FBC_A];
	else
		return NULL;
}
+4 −1
Original line number Diff line number Diff line
@@ -398,6 +398,10 @@ struct intel_display {
		const struct dram_info *info;
	} dram;

	struct {
		struct intel_fbc *instances[I915_MAX_FBCS];
	} fbc;

	struct {
		/* list of fbdev register on this device */
		struct intel_fbdev *fbdev;
@@ -615,7 +619,6 @@ struct intel_display {
	struct drm_dp_tunnel_mgr *dp_tunnel_mgr;
	struct intel_audio audio;
	struct intel_dpll_global dpll;
	struct intel_fbc *fbc[I915_MAX_FBCS];
	struct intel_frontbuffer_tracking fb_tracking;
	struct intel_hotplug hotplug;
	struct intel_opregion *opregion;
+3 −3
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@

#define for_each_intel_fbc(__display, __fbc, __fbc_id) \
	for_each_fbc_id((__display), (__fbc_id)) \
		for_each_if((__fbc) = (__display)->fbc[(__fbc_id)])
		for_each_if((__fbc) = (__display)->fbc.instances[(__fbc_id)])

struct intel_fbc_funcs {
	void (*activate)(struct intel_fbc *fbc);
@@ -2255,7 +2255,7 @@ void intel_fbc_init(struct intel_display *display)
		    display->params.enable_fbc);

	for_each_fbc_id(display, fbc_id)
		display->fbc[fbc_id] = intel_fbc_create(display, fbc_id);
		display->fbc.instances[fbc_id] = intel_fbc_create(display, fbc_id);
}

/**
@@ -2374,7 +2374,7 @@ void intel_fbc_debugfs_register(struct intel_display *display)
{
	struct intel_fbc *fbc;

	fbc = display->fbc[INTEL_FBC_A];
	fbc = display->fbc.instances[INTEL_FBC_A];
	if (fbc)
		intel_fbc_debugfs_add(fbc, display->drm->debugfs_root);
}
+1 −1
Original line number Diff line number Diff line
@@ -2443,7 +2443,7 @@ static struct intel_fbc *skl_plane_fbc(struct intel_display *display,
	enum intel_fbc_id fbc_id = skl_fbc_id_for_pipe(pipe);

	if (skl_plane_has_fbc(display, fbc_id, plane_id))
		return display->fbc[fbc_id];
		return display->fbc.instances[fbc_id];
	else
		return NULL;
}