Skip to content

Commit 01963b6

Browse files
armurthysurajk8
authored andcommitted
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: Arun R Murthy <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Suraj Kandpal <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ed1d563 commit 01963b6

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

drivers/gpu/drm/i915/display/i9xx_plane.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ static const struct drm_plane_funcs i965_plane_funcs = {
897897
.atomic_duplicate_state = intel_plane_duplicate_state,
898898
.atomic_destroy_state = intel_plane_destroy_state,
899899
.format_mod_supported = i965_plane_format_mod_supported,
900+
.format_mod_supported_async = intel_plane_format_mod_supported_async,
900901
};
901902

902903
static const struct drm_plane_funcs i8xx_plane_funcs = {
@@ -906,6 +907,7 @@ static const struct drm_plane_funcs i8xx_plane_funcs = {
906907
.atomic_duplicate_state = intel_plane_duplicate_state,
907908
.atomic_destroy_state = intel_plane_destroy_state,
908909
.format_mod_supported = i8xx_plane_format_mod_supported,
910+
.format_mod_supported_async = intel_plane_format_mod_supported_async,
909911
};
910912

911913
struct intel_plane *

drivers/gpu/drm/i915/display/intel_atomic_plane.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,17 @@ bool intel_plane_can_async_flip(struct intel_plane *plane, u32 format,
183183
return plane->can_async_flip && plane->can_async_flip(modifier);
184184
}
185185

186+
bool intel_plane_format_mod_supported_async(struct drm_plane *plane,
187+
u32 format,
188+
u64 modifier)
189+
{
190+
if (!plane->funcs->format_mod_supported(plane, format, modifier))
191+
return false;
192+
193+
return intel_plane_can_async_flip(to_intel_plane(plane),
194+
format, modifier);
195+
}
196+
186197
unsigned int intel_adjusted_rate(const struct drm_rect *src,
187198
const struct drm_rect *dst,
188199
unsigned int rate)

drivers/gpu/drm/i915/display/intel_atomic_plane.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,8 @@ int intel_atomic_add_affected_planes(struct intel_atomic_state *state,
9090
int intel_atomic_check_planes(struct intel_atomic_state *state);
9191

9292
u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state);
93+
bool intel_plane_format_mod_supported_async(struct drm_plane *plane,
94+
u32 format,
95+
u64 modifier);
9396

9497
#endif /* __INTEL_ATOMIC_PLANE_H__ */

drivers/gpu/drm/i915/display/skl_universal_plane.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,6 +2666,7 @@ static const struct drm_plane_funcs skl_plane_funcs = {
26662666
.atomic_duplicate_state = intel_plane_duplicate_state,
26672667
.atomic_destroy_state = intel_plane_destroy_state,
26682668
.format_mod_supported = skl_plane_format_mod_supported,
2669+
.format_mod_supported_async = intel_plane_format_mod_supported_async,
26692670
};
26702671

26712672
static const struct drm_plane_funcs icl_plane_funcs = {
@@ -2675,6 +2676,7 @@ static const struct drm_plane_funcs icl_plane_funcs = {
26752676
.atomic_duplicate_state = intel_plane_duplicate_state,
26762677
.atomic_destroy_state = intel_plane_destroy_state,
26772678
.format_mod_supported = icl_plane_format_mod_supported,
2679+
.format_mod_supported_async = intel_plane_format_mod_supported_async,
26782680
};
26792681

26802682
static const struct drm_plane_funcs tgl_plane_funcs = {
@@ -2684,6 +2686,7 @@ static const struct drm_plane_funcs tgl_plane_funcs = {
26842686
.atomic_duplicate_state = intel_plane_duplicate_state,
26852687
.atomic_destroy_state = intel_plane_destroy_state,
26862688
.format_mod_supported = tgl_plane_format_mod_supported,
2689+
.format_mod_supported_async = intel_plane_format_mod_supported_async,
26872690
};
26882691

26892692
static void

0 commit comments

Comments
 (0)