Expose modifiers/formats supported by async flips
v10 cover Expose modifiers/formats supported by async flips
All of the formats/modifiers supported by the plane during synchronous flips are nor supported by asynchronous flips. The formats/modifiers exposed to user by IN_FORMATS exposes all formats/modifiers supported by plane and this list varies for async flips. If the async flip supported formats/modifiers are exposed to the user, user based on this list can take decision to proceed or not and avoid flip failures during async flips.
Discussion around this can be located @
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29618#note_2487123
Mutter implementation for IN_FORMARTS_ASYNC under review @
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4063
Xorg/modesetting patch
https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1816
TODO: Upon merge of the patch related to async flip
https://patchwork.freedesktop.org/patch/626849/?series=139807&rev=6
the patch 5 in this series will have to make use of the new function pointer can_async_flip().
v3: Add new plane->funcs format_mod_supported_async (Ville)
Arun R Murthy (3):
drm/plane: Add new plane property IN_FORMATS_ASYNC drm/plane: Expose function to create format/modifier blob drm/i915/display: Populate list of async supported formats/modifiers
drivers/gpu/drm/drm_mode_config.c | 7 +++ drivers/gpu/drm/drm_plane.c | 50 ++++++++++++------ .../drm/i915/display/skl_universal_plane.c | 51 +++++++++++++++++++ include/drm/drm_mode_config.h | 6 +++ include/drm/drm_plane.h | 4 ++ 5 files changed, 103 insertions(+), 15 deletions(-)
--
2.25.1
---
Arun R Murthy (5):
drm/plane: Add new plane property IN_FORMATS_ASYNC drm/plane: Expose function to create format/modifier blob drm/plane: Function to check async supported modifier/format drm/i915/display: Populate list of async supported formats/modifiers drm/i915/display: Add function for format_mod_supported_async
drivers/gpu/drm/drm_mode_config.c | 7 ++ drivers/gpu/drm/drm_plane.c | 72 +++++++++---- drivers/gpu/drm/i915/display/skl_universal_plane.c | 113 ++++++++++++++++++--- include/drm/drm_mode_config.h | 6 ++ include/drm/drm_plane.h | 24 +++++ 5 files changed, 188 insertions(+), 34 deletions(-)
---
base-commit: 08bd590935a5258ffd79355c59adffd72fb2c642
change-id: 20250102-asyn-bf76730501cc
Best regards,
--
Arun R Murthy <[email protected]>
---
Changes in v9:
- EDITME: describe what is new in this series revision.
- EDITME: use bulletpoints and terse descriptions.
- Link to v8: https://lore.kernel.org/r/[email protected]
Changes in v6:
- EDITME: describe what is new in this series revision.
- EDITME: use bulletpoints and terse descriptions.
- Link to v5: https://lore.kernel.org/r/[email protected]
---
Arun R Murthy (3):
drm/plane: Add new plane property IN_FORMATS_ASYNC drm/plane: modify create_in_formats to accommodate async drm/i915/display: Add i915 hook for format_mod_supported_async
drivers/gpu/drm/drm_mode_config.c | 7 +++ drivers/gpu/drm/drm_plane.c | 53 +++++++++++++++----- drivers/gpu/drm/i915/display/skl_universal_plane.c | 56 ++++++++++++++++------ include/drm/drm_mode_config.h | 6 +++ include/drm/drm_plane.h | 17 +++++++ 5 files changed, 112 insertions(+), 27 deletions(-)
---
base-commit: bc7a84cbc968ce97e581e9e3c2d26fb0ac106482
change-id: 20250102-asyn-bf76730501cc
Best regards,
--
Arun R Murthy <[email protected]>
---
Arun R Murthy (3):
drm/plane: Add new plane property IN_FORMATS_ASYNC drm/plane: modify create_in_formats to accommodate async drm/i915/display: Add i915 hook for format_mod_supported_async
drivers/gpu/drm/drm_mode_config.c | 7 ++++ drivers/gpu/drm/drm_plane.c | 49 ++++++++++++++++------ drivers/gpu/drm/i915/display/i9xx_plane.c | 6 ++- drivers/gpu/drm/i915/display/intel_atomic_plane.c | 30 ++++++++++++- drivers/gpu/drm/i915/display/intel_atomic_plane.h | 6 ++- drivers/gpu/drm/i915/display/intel_display.c | 11 +---- drivers/gpu/drm/i915/display/skl_universal_plane.c | 5 ++- include/drm/drm_mode_config.h | 6 +++ include/drm/drm_plane.h | 17 ++++++++ 9 files changed, 111 insertions(+), 26 deletions(-)
---
base-commit: be5a404c3344b7d794766f045b8f94aa93c42069
change-id: 20250102-asyn-bf76730501cc
Best regards,
--
Arun R Murthy <[email protected]>
---
Arun R Murthy (3):
drm/plane: Add new plane property IN_FORMATS_ASYNC drm/plane: modify create_in_formats to accommodate async drm/i915/display: Add i915 hook for format_mod_supported_async
drivers/gpu/drm/drm_mode_config.c | 7 +++ drivers/gpu/drm/drm_plane.c | 52 ++++++++++++++++------ drivers/gpu/drm/i915/display/i9xx_plane.c | 6 ++- drivers/gpu/drm/i915/display/intel_atomic_plane.c | 32 ++++++++++++- drivers/gpu/drm/i915/display/intel_atomic_plane.h | 6 ++- drivers/gpu/drm/i915/display/intel_display.c | 14 ++---- drivers/gpu/drm/i915/display/skl_universal_plane.c | 5 ++- include/drm/drm_mode_config.h | 6 +++ include/drm/drm_plane.h | 17 +++++++ 9 files changed, 117 insertions(+), 28 deletions(-)
---
base-commit: aba848f9b752cf51474c0c3b1abcf0f572f774dc
change-id: 20250102-asyn-bf76730501cc
Best regards,
--
Arun R Murthy <[email protected]>
---
Arun R Murthy (4):
drm/plane: Add new plane property IN_FORMATS_ASYNC drm/plane: modify create_in_formats to acommodate async drm/i915/display: Acomodate format check in can_async_flip() drm/i915/display: Add i915 hook for format_mod_supported_async
drivers/gpu/drm/drm_mode_config.c | 7 +++ drivers/gpu/drm/drm_plane.c | 52 ++++++++++++++++------ drivers/gpu/drm/i915/display/i9xx_plane.c | 6 ++- drivers/gpu/drm/i915/display/intel_atomic_plane.c | 22 ++++++++- drivers/gpu/drm/i915/display/intel_atomic_plane.h | 6 ++- drivers/gpu/drm/i915/display/intel_display.c | 14 ++---- drivers/gpu/drm/i915/display/skl_universal_plane.c | 5 ++- include/drm/drm_mode_config.h | 6 +++ include/drm/drm_plane.h | 17 +++++++ 9 files changed, 107 insertions(+), 28 deletions(-)
---
base-commit: c1893793c7d3868fe083bdab33999178337b5561
change-id: 20250102-asyn-bf76730501cc
Best regards,
Signature · 1 line
Arun R Murthy <[email protected]>
PATCH v10 1/4 drm/plane: Add new plane property IN_FORMATS_ASYNC
There exists a property IN_FORMATS which exposes the plane supported modifiers/formats to the user. In some platforms when asynchronous flip are used all of modifiers/formats mentioned in IN_FORMATS are not supported. This patch adds a new plane property IN_FORMATS_ASYNC to expose the async flip supported modifiers/formats so that user can use this information ahead and do flip with unsupported formats/modifiers. This will save flip failures.
Add a new function pointer similar to format_mod_supported specifically for asynchronous flip.
v2: Remove async variable from drm_plane (Ville)
v3: Add new function pointer for async (Ville)
v5: Typo corrected in commit message & some correction in the kernel documentation. (Chaitanya)
v7: Place IN_FORMATS_ASYNC next to IN_FORMATS (Ville)
v8: replace uint32_t with u32 and uint64_t with u64 (Chaitanya)
--- drivers/gpu/drm/drm_mode_config.c | 7 +++++++ drivers/gpu/drm/drm_plane.c | 8 ++++++++ include/drm/drm_mode_config.h | 6 ++++++ include/drm/drm_plane.h | 17 +++++++++++++++++ 4 files changed, 38 insertions(+)
drivers/gpu/drm/drm_mode_config.c +7 -0
@@ -381,6 +381,13 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.modifiers_property = prop; + prop =drm_property_create (dev, +DRM_MODE_PROP_IMMUTABLE |DRM_MODE_PROP_BLOB , +"IN_FORMATS_ASYNC" ,0 ); +if (!prop) +return -ENOMEM ; + dev->mode_config.async_modifiers_property = prop; + prop =drm_property_create (dev,DRM_MODE_PROP_IMMUTABLE |DRM_MODE_PROP_BLOB ,"SIZE_HINTS" ,0 );
drivers/gpu/drm/drm_plane.c +8 -0
@@ -141,6 +141,14 @@* various bugs in this area with inconsistencies between the capability * flag and per-plane properties. * +* IN_FORMATS_ASYNC: +* Blob property which contains the set of buffer format and modifier +* pairs supported by this plane for asynchronous flips. The blob is a struct +* drm_format_modifier_blob. Userspace cannot change this property. This is an +* optional property and if not present then user should expect a failure in +* atomic ioctl when the modifier/format is not supported by that plane under +* asynchronous flip. +* * SIZE_HINTS: * Blob property which contains the set of recommended plane size * which can used for simple "cursor like" use cases (eg. no scaling).
include/drm/drm_mode_config.h +6 -0
@@ -936,6 +936,12 @@ struct drm_mode_config {*/ struct drm_property *modifiers_property; +/** +* @async_modifiers_property: Plane property to list support modifier/format +* combination for asynchronous flips. +*/ +struct drm_property *async_modifiers_property; +/** * @size_hints_property: Plane SIZE_HINTS property. */
include/drm/drm_plane.h +17 -0
@@ -549,6 +549,23 @@ struct drm_plane_funcs {*/ bool (*format_mod_supported)(struct drm_plane *plane,uint32_t format,uint64_t modifier); +/** +* @format_mod_supported_async: +* +* This optional hook is used for the DRM to determine if for +* asynchronous flip the given format/modifier combination is valid for +* the plane. This allows the DRM to generate the correct format +* bitmask (which formats apply to which modifier), and to validate +* modifiers at atomic_check time. +* +* Returns: +* +* True if the given modifier is valid for that format on the plane. +* False otherwise. +*/ +bool (*format_mod_supported_async)(struct drm_plane *plane, +u32 format,u64 modifier); + };/**
Signature · 1 line
2.25.1
PATCH v10 2/4 drm/plane: modify create_in_formats to acommodate async
In reply to Arun R Murthycreate_in_formats creates the list of supported format/modifiers for synchronous flips, modify the same function so as to take the format_mod_supported as argument and create list of format/modifier for async as well.
v5: create_in_formats can return -ve value in failure case, correct the if condition to check the creation of blob <Chaitanya>
Dont add the modifier for which none of the formats is not supported.
v6: Remove the code for masking the unsupported modifiers as UMD can leave with it. (Naveen/Chaitanya)
v7: Retain the unsupported modifiers, userspace should have no impact, return pointer to blob instead of blob_id(Ville)
--- drivers/gpu/drm/drm_plane.c | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_plane.c +31 -13
@@ -193,9 +193,13 @@ modifiers_ptr(struct drm_format_modifier_blob *blob)return (struct drm_format_modifier *)(((char *)blob) + blob->modifiers_offset); } -static int create_in_format_blob (struct drm_device *dev,struct drm_plane *plane) +static struct drm_property_blob *create_in_format_blob (struct drm_device *dev, +struct drm_plane *plane, +bool (*format_mod_supported) + (struct drm_plane *plane, +u32 format, +u64 modifier)) { -const struct drm_mode_config *config = &dev->mode_config;struct drm_property_blob *blob;struct drm_format_modifier *mod;size_t blob_size, formats_size, modifiers_size;
@@ -221,7 +225,7 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane blob =drm_property_create_blob (dev, blob_size,NULL );if (IS_ERR (blob)) -return -1 ; +return NULL ; blob_data = blob->data; blob_data->version =FORMAT_BLOB_CURRENT ;
@@ -237,10 +241,10 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane mod =modifiers_ptr (blob_data);for (i =0 ; i < plane->modifier_count; i++) {for (j =0 ; j < plane->format_count; j++) { -if (!plane->funcs->format_mod_supported || - plane->funcs->format_mod_supported (plane, - plane->format_types[j], - plane->modifiers[i])) { +if (!format_mod_supported || +format_mod_supported (plane, + plane->format_types[j], + plane->modifiers[i])) { mod->formats |=1ULL << j; } }
@@ -251,10 +255,7 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane mod++; } -drm_object_attach_property (&plane->base, config->modifiers_property, - blob->base.id); - -return 0 ; +return blob; }/**
@@ -366,6 +367,7 @@ static int __drm_universal_plane_init(struct drm_device *dev, const char *name, va_list ap) {struct drm_mode_config *config = &dev->mode_config; +struct drm_property_blob *blob;static const uint64_t default_modifiers[] = {DRM_FORMAT_MOD_LINEAR , };
@@ -477,8 +479,24 @@ static int __drm_universal_plane_init(struct drm_device *dev,drm_plane_create_hotspot_properties (plane); } -if (format_modifier_count) -create_in_format_blob (dev, plane); +if (format_modifier_count) { + blob =create_in_format_blob (dev, plane, + plane->funcs->format_mod_supported); +if (!IS_ERR (blob)) +drm_object_attach_property (&plane->base, + config->modifiers_property, + blob->base.id); + } + +if (plane->funcs->format_mod_supported_async) { + blob =create_in_format_blob (dev, plane, + plane->funcs->format_mod_supported_async); +if (!IS_ERR (blob)) +drm_object_attach_property (&plane->base, + config->async_modifiers_property, + blob->base.id); + } +return 0 ; }
Signature · 1 line
2.25.1
PATCH v10 3/4 drm/i915/display: Acomodate format check in can_async_flip()
In reply to Arun R MurthyThe function pointer can_async_flip() checks for async supported modifier, add format support check also in the same function.
--- drivers/gpu/drm/i915/display/i9xx_plane.c | 4 ++-- drivers/gpu/drm/i915/display/intel_atomic_plane.c | 11 ++++++++++- drivers/gpu/drm/i915/display/intel_atomic_plane.h | 3 ++- drivers/gpu/drm/i915/display/intel_display.c | 14 ++++---------- drivers/gpu/drm/i915/display/skl_universal_plane.c | 2 +- 5 files changed, 19 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/display/i9xx_plane.c +2 -2
@@ -828,7 +828,7 @@ unsigned int vlv_plane_min_alignment(struct intel_plane *plane, {struct intel_display *display =to_intel_display (plane); -if (intel_plane_can_async_flip (plane, fb->modifier)) +if (intel_plane_can_async_flip (plane, fb->format->format, fb->modifier))return 256 *1024 ;/* FIXME undocumented so not sure what's actually needed */
@@ -852,7 +852,7 @@ static unsigned int g4x_primary_min_alignment(struct intel_plane *plane, {struct intel_display *display =to_intel_display (plane); -if (intel_plane_can_async_flip (plane, fb->modifier)) +if (intel_plane_can_async_flip (plane, fb->format->format, fb->modifier))return 256 *1024 ;if (intel_scanout_needs_vtd_wa (display))
drivers/gpu/drm/i915/display/intel_atomic_plane.c +10 -1
@@ -174,8 +174,17 @@ bool intel_plane_needs_physical(struct intel_plane *plane)DISPLAY_INFO (display)->cursor_needs_physical; } -bool intel_plane_can_async_flip (struct intel_plane *plane,u64 modifier) +bool intel_plane_can_async_flip (struct intel_plane *plane,u32 format, +u64 modifier) { +if (intel_format_info_is_yuv_semiplanar (drm_format_info (format), modifier) + || format ==DRM_FORMAT_C8 ) { +drm_dbg_kms (plane->base.dev, +"[PLANE:%d:%s] Planar formats do not support async flips\n" , + plane->base.base.id, plane->base.name); +return false; + } +return plane->can_async_flip && plane->can_async_flip (modifier); }
drivers/gpu/drm/i915/display/intel_atomic_plane.h +2 -1
@@ -21,7 +21,8 @@ enum plane_id;struct intel_plane *intel_crtc_get_plane (struct intel_crtc *crtc,enum plane_id plane_id); -bool intel_plane_can_async_flip (struct intel_plane *plane,u64 modifier); +bool intel_plane_can_async_flip (struct intel_plane *plane,u32 format, +u64 modifier);unsigned int intel_adjusted_rate (const struct drm_rect *src,const struct drm_rect *dst,unsigned int rate);
drivers/gpu/drm/i915/display/intel_display.c +4 -10
@@ -5998,22 +5998,16 @@ static int intel_async_flip_check_hw(struct intel_atomic_state *state, struct inif (!plane->async_flip)continue ; -if (!intel_plane_can_async_flip (plane, new_plane_state->hw.fb->modifier)) { +if (!intel_plane_can_async_flip (plane, new_plane_state->hw.fb->format->format, + new_plane_state->hw.fb->modifier)) {drm_dbg_kms (display->drm, -"[PLANE:%d:%s] Modifier 0x%llx does not support async flip\n" , +"[PLANE:%d:%s] Format %p4cc Modifier 0x%llx does not support async flip\n" , plane->base.base.id, plane->base.name, + &new_plane_state->hw.fb->format->format, new_plane_state->hw.fb->modifier);return -EINVAL ; } -if (intel_format_info_is_yuv_semiplanar (new_plane_state->hw.fb->format, - new_plane_state->hw.fb->modifier)) { -drm_dbg_kms (display->drm, -"[PLANE:%d:%s] Planar formats do not support async flips\n" , - plane->base.base.id, plane->base.name); -return -EINVAL ; - } -/* * We turn the first async flip request into a sync flip * so that we can reconfigure the plane (eg. change modifier).
drivers/gpu/drm/i915/display/skl_universal_plane.c +1 -1
@@ -601,7 +601,7 @@ static u32 tgl_plane_min_alignment(struct intel_plane *plane,* Figure out what's going on here... */ if (display->platform.alderlake_p && -intel_plane_can_async_flip (plane, fb->modifier)) +intel_plane_can_async_flip (plane, fb->format->format, fb->modifier))return mult *16 *1024 ;switch (fb->modifier) {
Signature · 1 line
2.25.1
Re: [PATCH v10 3/4] drm/i915/display: Acomodate format check in can_async_flip()
Quoted 39 lines · Arun R Murthy
The function pointer
can_async_flip()checks for async supported modifier, add format support check also in the same function.Signed-off-by Arun R Murthy <[email protected]>--- drivers/gpu/drm/i915/display/i9xx_plane.c | 4 ++-- drivers/gpu/drm/i915/display/intel_atomic_plane.c | 11 ++++++++++- drivers/gpu/drm/i915/display/intel_atomic_plane.h | 3 ++- drivers/gpu/drm/i915/display/intel_display.c | 14 ++++---------- drivers/gpu/drm/i915/display/skl_universal_plane.c | 2 +- 5 files changed, 19 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/display/i9xx_plane.c +2
-2@@ -828,7 +828,7 @@ unsigned int vlv_plane_min_alignment(struct intel_plane *plane, {struct intel_display *display =to_intel_display (plane); -if (intel_plane_can_async_flip (plane, fb->modifier)) +if (intel_plane_can_async_flip (plane, fb->format->format, fb->modifier))return 256 *1024 ;/* FIXME undocumented so not sure what's actually needed */ @@ -852,7 +852,7 @@ static unsigned int g4x_primary_min_alignment(struct intel_plane *plane, {struct intel_display *display =to_intel_display (plane); -if (intel_plane_can_async_flip (plane, fb->modifier)) +if (intel_plane_can_async_flip (plane, fb->format->format, fb->modifier))return 256 *1024 ;if (intel_scanout_needs_vtd_wa (display))drivers/gpu/drm/i915/display/intel_atomic_plane.c +0
-0
drivers/gpu/drm/i915/display/intel_atomic_plane.c bool intel_plane_needs_physical(struct intel_plane *plane) · line 181
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_atomic_plane.c +4
-1@@ -174,8 +174,17 @@ bool intel_plane_needs_physical(struct intel_plane *plane)DISPLAY_INFO (display)->cursor_needs_physical; } -bool intel_plane_can_async_flip (struct intel_plane *plane,u64 modifier) +bool intel_plane_can_async_flip (struct intel_plane *plane,u32 format, +u64 modifier) { +if (intel_format_info_is_yuv_semiplanar (drm_format_info (format), modifier) + || format ==DRM_FORMAT_C8 ) {
You're still mixing refactoring and functional changes in one patch. The C8 check needs to be a separate patch.
Also the || goes to the end of the line.
Quoted 70 lines
drivers/gpu/drm/i915/display/intel_atomic_plane.c +6
-0+drm_dbg_kms (plane->base.dev, +"[PLANE:%d:%s] Planar formats do not support async flips\n" , + plane->base.base.id, plane->base.name); +return false; + } +return plane->can_async_flip && plane->can_async_flip (modifier); }drivers/gpu/drm/i915/display/intel_atomic_plane.h +2
-1@@ -21,7 +21,8 @@ enum plane_id;struct intel_plane *intel_crtc_get_plane (struct intel_crtc *crtc,enum plane_id plane_id); -bool intel_plane_can_async_flip (struct intel_plane *plane,u64 modifier); +bool intel_plane_can_async_flip (struct intel_plane *plane,u32 format, +u64 modifier);unsigned int intel_adjusted_rate (const struct drm_rect *src,const struct drm_rect *dst,unsigned int rate);drivers/gpu/drm/i915/display/intel_display.c +4
-10@@ -5998,22 +5998,16 @@ static int intel_async_flip_check_hw(struct intel_atomic_state *state, struct inif (!plane->async_flip)continue ; -if (!intel_plane_can_async_flip (plane, new_plane_state->hw.fb->modifier)) { +if (!intel_plane_can_async_flip (plane, new_plane_state->hw.fb->format->format, + new_plane_state->hw.fb->modifier)) {drm_dbg_kms (display->drm, -"[PLANE:%d:%s] Modifier 0x%llx does not support async flip\n" , +"[PLANE:%d:%s] Format %p4cc Modifier 0x%llx does not support async flip\n" , plane->base.base.id, plane->base.name, + &new_plane_state->hw.fb->format->format, new_plane_state->hw.fb->modifier);return -EINVAL ; } -if (intel_format_info_is_yuv_semiplanar (new_plane_state->hw.fb->format, - new_plane_state->hw.fb->modifier)) { -drm_dbg_kms (display->drm, -"[PLANE:%d:%s] Planar formats do not support async flips\n" , - plane->base.base.id, plane->base.name); -return -EINVAL ; - } -/* * We turn the first async flip request into a sync flip * so that we can reconfigure the plane (eg. change modifier). drivers/gpu/drm/i915/display/skl_universal_plane.c +1
-1@@ -601,7 +601,7 @@ static u32 tgl_plane_min_alignment(struct intel_plane *plane,* Figure out what's going on here... */ if (display->platform.alderlake_p && -intel_plane_can_async_flip (plane, fb->modifier)) +intel_plane_can_async_flip (plane, fb->format->format, fb->modifier))return mult *16 *1024 ;switch (fb->modifier) {Signature · 2 lines
-- 2.25.1
Signature · 2 lines
Ville Syrjälä Intel
RE: [PATCH v10 3/4] drm/i915/display: Acomodate format check in can_async_flip()
Quoted 63 lines · Arun R Murthy
Quoted 14 lines
The function pointer
can_async_flip()checks for async supported modifier, add format support check also in the same function.Signed-off-by Arun R Murthy <[email protected]>--- drivers/gpu/drm/i915/display/i9xx_plane.c | 4 ++-- drivers/gpu/drm/i915/display/intel_atomic_plane.c | 11 ++++++++++- drivers/gpu/drm/i915/display/intel_atomic_plane.h | 3 ++- drivers/gpu/drm/i915/display/intel_display.c | 14 ++++---------- drivers/gpu/drm/i915/display/skl_universal_plane.c | 2 +- 5 files changed, 19 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/display/i9xx_plane.c +0
-0Quoted 2 lines
index
5e8344fdfc28a311dc0632bb848a0e08f9e6c6d2..20c47de6d8bfd1d8ddafae02ed68Quoted 25 lines
370df799e22b100644drivers/gpu/drm/i915/display/i9xx_plane.c +2
-2@@ -828,7 +828,7 @@ unsigned int vlv_plane_min_alignment(struct intel_plane *plane, {struct intel_display *display =to_intel_display (plane); -if (intel_plane_can_async_flip (plane, fb->modifier)) +if (intel_plane_can_async_flip (plane, fb->format->format, +fb->modifier))return 256 *1024 ; /* FIXME undocumented so not sure what's actually needed */ @@ -852,7 +852,7 @@ static unsigned int g4x_primary_min_alignment(struct
intel_plane*plane, {drivers/gpu/drm/i915/display/i9xx_plane.c +2
-1struct intel_display *display =to_intel_display (plane); -if (intel_plane_can_async_flip (plane, fb->modifier)) +if (intel_plane_can_async_flip (plane, fb->format->format, +fb->modifier))return 256 *1024 ;if (intel_scanout_needs_vtd_wa (display))drivers/gpu/drm/i915/display/intel_atomic_plane.c +0
-0Quoted 2 lines
index
7276179df878658b7053fe6d8dc37b69f19625e3..5260b9e723af3f654cb36512fe0bdrivers/gpu/drm/i915/display/intel_atomic_plane.c bool intel_plane_needs_physical(struct intel_plane
Quoted 4 lines
5368523082e6100644drivers/gpu/drm/i915/display/intel_atomic_plane.c +0
-0@@ -174,8 +174,17 @@ bool intel_plane_needs_physical(struct intel_plane*plane)
drivers/gpu/drm/i915/display/intel_atomic_plane.c bool intel_plane_needs_physical(struct intel_plane *plane)
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_atomic_plane.c +3
-1DISPLAY_INFO (display)->cursor_needs_physical; } -bool intel_plane_can_async_flip (struct intel_plane *plane,u64 modifier) +bool intel_plane_can_async_flip (struct intel_plane *plane,u32 format, +u64 modifier) { + if (intel_format_info_is_yuv_semiplanar(drm_format_info(format),modifier)
Quoted 7 lines
drivers/gpu/drm/i915/display/intel_atomic_plane.c bool intel_plane_needs_physical(struct intel_plane *plane) · line 181
Quoted 1 line
drivers/gpu/drm/i915/display/intel_atomic_plane.c +1
-0+ || format == DRM_FORMAT_C8) {You're still mixing refactoring and functional changes in one patch. The C8 check needs to be a separate patch.
Also the || goes to the end of the line.
Will change it.
Thanks and Regards,
Arun R Murthy
--------------------
Quoted 102 lines
drivers/gpu/drm/i915/display/intel_atomic_plane.c bool intel_plane_needs_physical(struct intel_plane · line 184
Quoted 2 lines
drivers/gpu/drm/i915/display/intel_atomic_plane.c +2
-0+ drm_dbg_kms(plane->base.dev, + "[PLANE:%d:%s] Planar formats do not supportasync flips\n",
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_atomic_plane.c +4
-0+ plane->base.base.id, plane->base.name); +return false; + } +return plane->can_async_flip && plane->can_async_flip (modifier); }drivers/gpu/drm/i915/display/intel_atomic_plane.h +0
-0index
6efac923dcbc757e6f68564cbef2919c920f13cb..772a12aa9c6997d77b9393f964e9Quoted 16 lines
1f3e8747d149100644drivers/gpu/drm/i915/display/intel_atomic_plane.h +2
-0@@ -21,7 +21,8 @@ enum plane_id;struct intel_plane *intel_crtc_get_plane (struct intel_crtc *crtc,enum plane_id plane_id); -bool intel_plane_can_async_flip(struct intel_plane *plane, u64 modifier); +bool intel_plane_can_async_flip (struct intel_plane *plane,u32 format, +u64 modifier);unsigned int intel_adjusted_rate (const struct drm_rect *src,const struct drm_rect *dst,unsigned int rate);drivers/gpu/drm/i915/display/intel_display.c +0
-0Quoted 2 lines
index
ee7812126129227971be89d3a79f944155620b03..ff349355ac95a039272f2fe17403drivers/gpu/drm/i915/display/intel_display.c static int intel_async_flip_check_hw(struct
Quoted 4 lines
4ca06a555249100644drivers/gpu/drm/i915/display/intel_display.c +0
-0@@ -5998,22 +5998,16 @@ static int intel_async_flip_check_hw(struct
intel_atomic_state*state, struct indrivers/gpu/drm/i915/display/intel_display.c static int intel_async_flip_check_hw(struct · line 6006
Quoted 11 lines
drivers/gpu/drm/i915/display/intel_display.c +2
-2if (!plane->async_flip)continue ; -if (!intel_plane_can_async_flip (plane, new_plane_state->hw.fb- modifier)) { +if (!intel_plane_can_async_flip (plane, new_plane_state->hw.fb- format->format, + new_plane_state->hw.fb- modifier)) { drm_dbg_kms(display->drm, - "[PLANE:%d:%s] Modifier 0x%llx does notsupport async flip\n",
drivers/gpu/drm/i915/display/intel_display.c static int intel_async_flip_check_hw(struct · line 6007
Quoted 1 line
drivers/gpu/drm/i915/display/intel_display.c +1
-0+ "[PLANE:%d:%s] Format %p4cc Modifier0x%llx does not support
drivers/gpu/drm/i915/display/intel_display.c
Quoted 13 lines
drivers/gpu/drm/i915/display/intel_display.c +2
-1+async flip\n", plane->base.base.id, plane->base.name, + &new_plane_state->hw.fb->format->format, new_plane_state->hw.fb->modifier);return -EINVAL ; } - if (intel_format_info_is_yuv_semiplanar(new_plane_state-
hw.fb->format,drivers/gpu/drm/i915/display/intel_display.c +0
-1- new_plane_state-
hw.fb->modifier)) {drivers/gpu/drm/i915/display/intel_display.c +0
-2- drm_dbg_kms(display->drm, - "[PLANE:%d:%s] Planar formats do notsupport async flips\n",
Quoted 11 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-4- plane->base.base.id, plane->base.name); -return -EINVAL ; - } -/* * We turn the first async flip request into a sync flip * so that we can reconfigure the plane (eg. change modifier). drivers/gpu/drm/i915/display/skl_universal_plane.c +0
-0index
8739195aba696d13b30e1b978c8b2bb5e188119b..8f6170a5c108a000582f3415f78bdrivers/gpu/drm/i915/display/skl_universal_plane.c static u32 tgl_plane_min_alignment(struct
Quoted 4 lines
ad279254d8cf100644drivers/gpu/drm/i915/display/skl_universal_plane.c +0
-0@@ -601,7 +601,7 @@ static u32 tgl_plane_min_alignment(struct
intel_plane*plane,Quoted 11 lines
drivers/gpu/drm/i915/display/skl_universal_plane.c +2
-2* Figure out what's going on here... */ if (display->platform.alderlake_p && -intel_plane_can_async_flip (plane, fb->modifier)) +intel_plane_can_async_flip (plane, fb->format->format, +fb->modifier))return mult *16 *1024 ;switch (fb->modifier) { --Quoted 1 line
2.25.1
--
Ville Syrjälä
Intel
PATCH v10 4/4 drm/i915/display: Add i915 hook for format_mod_supported_async
In reply to Arun R MurthyHook 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)
--- drivers/gpu/drm/i915/display/i9xx_plane.c | 2 ++ drivers/gpu/drm/i915/display/intel_atomic_plane.c | 11 +++++++++++ drivers/gpu/drm/i915/display/intel_atomic_plane.h | 3 +++ drivers/gpu/drm/i915/display/skl_universal_plane.c | 3 +++ 4 files changed, 19 insertions(+)
drivers/gpu/drm/i915/display/i9xx_plane.c +2 -0
@@ -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 *
drivers/gpu/drm/i915/display/intel_atomic_plane.c +11 -0
@@ -188,6 +188,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)
drivers/gpu/drm/i915/display/intel_atomic_plane.h +3 -0
@@ -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__ */
drivers/gpu/drm/i915/display/skl_universal_plane.c +3 -0
@@ -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
Signature · 1 line
2.25.1
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for Expose modifiers/formats supported by async flips (rev10)
In reply to Arun R Murthy== Series Details ==
== Series Details ==
Series: Expose modifiers/formats supported by async flips (rev10)
URL : https://patchwork.freedesktop.org/series/140935/
State : warning
== Summary ==
Error: dim checkpatch failedf7133a7c112e drm/plane: Add new plane property IN_FORMATS_ASYNC 1778d0106429 drm/plane: modify create_in_formats to acommodate async 9b50d6a1736a drm/i915/display: Acomodate format check in can_async_flip() -:46: CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line #46: FILE: drivers/gpu/drm/i915/display/intel_atomic_plane.c:181:
+ if (intel_format_info_is_yuv_semiplanar(drm_format_info(format), modifier)
+ || format == DRM_FORMAT_C8) {
total: 0 errors, 0 warnings, 1 checks, 77 lines checked a11dd36d47e0 drm/i915/display: Add i915 hook for format_mod_supported_async
Patchwork
CI✗ Fi.CI.SPARSE: warning for Expose modifiers/formats supported by async flips (rev10)
In reply to Arun R Murthy== Series Details ==
== Series Details ==
Series: Expose modifiers/formats supported by async flips (rev10)
URL : https://patchwork.freedesktop.org/series/140935/
State : warning
== Summary ==
Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
Patchwork
CI✓ i915.CI.BAT: success for Expose modifiers/formats supported by async flips (rev10)
In reply to Arun R Murthy== Series Details ==
== Series Details ==
Series: Expose modifiers/formats supported by async flips (rev10)
URL : https://patchwork.freedesktop.org/series/140935/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_16334 -> Patchwork_140935v10
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/index.html
Participating hosts (40 -> 40)
------------------------------
Additional (1): fi-glk-j4005
Missing (1): fi-snb-2520m
Known issues
------------
Here are the changes found in Patchwork_140935v10 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_fence@basic-busy@vecs0:
- bat-rpls-4: [PASS][1] -> [DMESG-WARN][2] ([i915#13400]) +1 other test dmesg-warn
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16334/bat-rpls-4/igt@gem_exec_fence@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/bat-rpls-4/igt@gem_exec_fence@[email protected]
* igt@gem_huc_copy@huc-copy:
- fi-glk-j4005: NOTRUN -> [SKIP][3] ([i915#2190])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/fi-glk-j4005/igt@[email protected]
* igt@gem_lmem_swapping@parallel-random-engines:
- fi-glk-j4005: NOTRUN -> [SKIP][4] ([i915#4613]) +3 other tests skip
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/fi-glk-j4005/igt@[email protected]
* igt@i915_selftest@live:
- bat-mtlp-8: [PASS][5] -> [DMESG-FAIL][6] ([i915#12061]) +1 other test dmesg-fail
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16334/bat-mtlp-8/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/bat-mtlp-8/igt@[email protected]
* igt@i915_selftest@live@workarounds:
- bat-dg2-14: [PASS][7] -> [DMESG-FAIL][8] ([i915#12061]) +1 other test dmesg-fail
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16334/bat-dg2-14/igt@i915_selftest@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/bat-dg2-14/igt@i915_selftest@[email protected]
- bat-mtlp-9: [PASS][9] -> [DMESG-FAIL][10] ([i915#12061]) +1 other test dmesg-fail
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16334/bat-mtlp-9/igt@i915_selftest@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/bat-mtlp-9/igt@i915_selftest@[email protected]
* igt@kms_psr@psr-primary-page-flip:
- fi-glk-j4005: NOTRUN -> [SKIP][11] +10 other tests skip
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/fi-glk-j4005/igt@[email protected]
#### Possible fixes ####
* igt@i915_pm_rpm@module-reload:
- bat-adlp-6: [DMESG-WARN][12] ([i915#13890]) -> [PASS][13] +78 other tests pass
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16334/bat-adlp-6/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/bat-adlp-6/igt@[email protected]
* igt@i915_selftest@live@late_gt_pm:
- fi-cfl-8109u: [DMESG-WARN][14] ([i915#13735]) -> [PASS][15] +31 other tests pass
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16334/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html
* igt@i915_selftest@live@workarounds:
- bat-arlh-3: [DMESG-FAIL][16] ([i915#12061]) -> [PASS][17] +1 other test pass
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16334/bat-arlh-3/igt@i915_selftest@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/bat-arlh-3/igt@i915_selftest@[email protected]
- bat-arls-5: [DMESG-FAIL][18] ([i915#12061]) -> [PASS][19] +1 other test pass
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16334/bat-arls-5/igt@i915_selftest@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/bat-arls-5/igt@i915_selftest@[email protected]
- bat-dg2-9: [DMESG-FAIL][20] ([i915#12061]) -> [PASS][21] +1 other test pass
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16334/bat-dg2-9/igt@i915_selftest@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/bat-dg2-9/igt@i915_selftest@[email protected]
* igt@kms_pipe_crc_basic@read-crc:
- fi-cfl-8109u: [DMESG-WARN][22] ([i915#13890]) -> [PASS][23] +48 other tests pass
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16334/fi-cfl-8109u/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/fi-cfl-8109u/igt@[email protected]
[i915#12061]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12061
[i915#13400]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13400
[i915#13735]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13735
[i915#13890]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13890
[i915#2190]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/2190
[i915#4613]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4613
Build changes
-------------
* Linux: CI_DRM_16334 -> Patchwork_140935v10
CI-20190529: 20190529
CI_DRM_16334: f823caa91ed490160b8e87792d3bb26ae3e87de0 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_8291: a1809bc9d786d9b37a22e3e5e4810c6a0c84480b @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_140935v10: f823caa91ed490160b8e87792d3bb26ae3e87de0 @ git://anongit.freedesktop.org/gfx-ci/linux
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_140935v10/index.html