Commit 01963b62 authored by Arun R Murthy's avatar Arun R Murthy Committed by Suraj Kandpal
Browse files

drm/i915/display: Add i915 hook for format_mod_supported_async



Hook up the newly added plane function pointer
format_mod_supported_async to populate the modifiers/formats supported
by asynchronous flips.

v5: Correct the if condition for modifier support check (Chaitanya)
v6: Replace uint32_t/uint64_t with u32/u64 (Jani)
v7: Move plannar check from intel_async_flip_check_hw() to
intel_plane_format_mod_supported_async() (Ville)
v8: In case of error print format/modifier (Chaitanya)
v9: Exclude C8 format as its not supported by hardware
v10: filter only planar formats
     move changes in can_async_flip to new patch (Ville)

Signed-off-by: default avatarArun R Murthy <arun.r.murthy@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarSuraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20250407-asyn-v13-4-b93ef83076c5@intel.com
parent ed1d563c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -897,6 +897,7 @@ static const struct drm_plane_funcs i965_plane_funcs = {
	.atomic_duplicate_state = intel_plane_duplicate_state,
	.atomic_destroy_state = intel_plane_destroy_state,
	.format_mod_supported = i965_plane_format_mod_supported,
	.format_mod_supported_async = intel_plane_format_mod_supported_async,
};

static const struct drm_plane_funcs i8xx_plane_funcs = {
@@ -906,6 +907,7 @@ static const struct drm_plane_funcs i8xx_plane_funcs = {
	.atomic_duplicate_state = intel_plane_duplicate_state,
	.atomic_destroy_state = intel_plane_destroy_state,
	.format_mod_supported = i8xx_plane_format_mod_supported,
	.format_mod_supported_async = intel_plane_format_mod_supported_async,
};

struct intel_plane *
+11 −0
Original line number Diff line number Diff line
@@ -183,6 +183,17 @@ bool intel_plane_can_async_flip(struct intel_plane *plane, u32 format,
	return plane->can_async_flip && plane->can_async_flip(modifier);
}

bool intel_plane_format_mod_supported_async(struct drm_plane *plane,
					    u32 format,
					    u64 modifier)
{
	if (!plane->funcs->format_mod_supported(plane, format, modifier))
		return false;

	return intel_plane_can_async_flip(to_intel_plane(plane),
					format, modifier);
}

unsigned int intel_adjusted_rate(const struct drm_rect *src,
				 const struct drm_rect *dst,
				 unsigned int rate)
+3 −0
Original line number Diff line number Diff line
@@ -90,5 +90,8 @@ int intel_atomic_add_affected_planes(struct intel_atomic_state *state,
int intel_atomic_check_planes(struct intel_atomic_state *state);

u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state);
bool intel_plane_format_mod_supported_async(struct drm_plane *plane,
					    u32 format,
					    u64 modifier);

#endif /* __INTEL_ATOMIC_PLANE_H__ */
+3 −0
Original line number Diff line number Diff line
@@ -2666,6 +2666,7 @@ static const struct drm_plane_funcs skl_plane_funcs = {
	.atomic_duplicate_state = intel_plane_duplicate_state,
	.atomic_destroy_state = intel_plane_destroy_state,
	.format_mod_supported = skl_plane_format_mod_supported,
	.format_mod_supported_async = intel_plane_format_mod_supported_async,
};

static const struct drm_plane_funcs icl_plane_funcs = {
@@ -2675,6 +2676,7 @@ static const struct drm_plane_funcs icl_plane_funcs = {
	.atomic_duplicate_state = intel_plane_duplicate_state,
	.atomic_destroy_state = intel_plane_destroy_state,
	.format_mod_supported = icl_plane_format_mod_supported,
	.format_mod_supported_async = intel_plane_format_mod_supported_async,
};

static const struct drm_plane_funcs tgl_plane_funcs = {
@@ -2684,6 +2686,7 @@ static const struct drm_plane_funcs tgl_plane_funcs = {
	.atomic_duplicate_state = intel_plane_duplicate_state,
	.atomic_destroy_state = intel_plane_destroy_state,
	.format_mod_supported = tgl_plane_format_mod_supported,
	.format_mod_supported_async = intel_plane_format_mod_supported_async,
};

static void