Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/3] Expose modifiers/formats supported by async flips
@ 2025-03-12 13:09 Arun R Murthy
  2025-03-12 13:09 ` [PATCH v8 1/3] drm/plane: Add new plane property IN_FORMATS_ASYNC Arun R Murthy
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Arun R Murthy @ 2025-03-12 13:09 UTC (permalink / raw)
  To: dri-devel, intel-gfx, intel-xe
  Cc: chaitanya.kumar.borah, 20250219093211.4059187-1-arun.r.murthy,
	20250311085422.2573860-1-santhosh.reddy.guddati, Arun R Murthy,
	Naveen Kumar

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().

Test-with: 20250219093211.4059187-1-arun.r.murthy@intel.com
Test-with: 20250311085422.2573860-1-santhosh.reddy.guddati@intel.com

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 <arun.r.murthy@intel.com>

---
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/20250218-asyn-v5-0-7ac5ac4abd4a@intel.com

---
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 <arun.r.murthy@intel.com>

---
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 <arun.r.murthy@intel.com>

---
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                        | 54 ++++++++++++++++------
 drivers/gpu/drm/i915/display/i9xx_plane.c          |  6 ++-
 drivers/gpu/drm/i915/display/intel_atomic_plane.c  | 31 ++++++++++++-
 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(+), 29 deletions(-)
---
base-commit: aba848f9b752cf51474c0c3b1abcf0f572f774dc
change-id: 20250102-asyn-bf76730501cc

Best regards,
-- 
Arun R Murthy <arun.r.murthy@intel.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v8 1/3] drm/plane: Add new plane property IN_FORMATS_ASYNC
  2025-03-12 13:09 [PATCH v8 0/3] Expose modifiers/formats supported by async flips Arun R Murthy
@ 2025-03-12 13:09 ` Arun R Murthy
  2025-03-17 12:16   ` Borah, Chaitanya Kumar
  2025-03-12 13:09 ` [PATCH v8 2/3] drm/plane: modify create_in_formats to accommodate async Arun R Murthy
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Arun R Murthy @ 2025-03-12 13:09 UTC (permalink / raw)
  To: dri-devel, intel-gfx, intel-xe
  Cc: chaitanya.kumar.borah, 20250219093211.4059187-1-arun.r.murthy,
	20250311085422.2573860-1-santhosh.reddy.guddati, Arun R Murthy,
	Naveen Kumar

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)

Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
Tested-by: Naveen Kumar <naveen1.kumar@intel.com>
---
 drivers/gpu/drm/drm_mode_config.c |  7 +++++++
 drivers/gpu/drm/drm_plane.c       | 12 ++++++++++--
 include/drm/drm_mode_config.h     |  6 ++++++
 include/drm/drm_plane.h           | 17 +++++++++++++++++
 4 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
index 8642a2fb25a90116dab975aa0ab6b51deafb4b96..b4239fd04e9da4d4b5cfccdef1d3dde9556f322d 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -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);
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index a28b22fdd7a41aca82d097d42237851da9a0a79b..110838c3e5920835e0875e57e6e479bcab7c8733 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -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).
@@ -197,7 +205,7 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane
 	formats_size = sizeof(__u32) * plane->format_count;
 	if (WARN_ON(!formats_size)) {
 		/* 0 formats are never expected */
-		return 0;
+		return ERR_PTR(0);
 	}
 
 	modifiers_size =
@@ -213,7 +221,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 ERR_PTR(-1);
 
 	blob_data = blob->data;
 	blob_data->version = FORMAT_BLOB_CURRENT;
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index 271765e2e9f2da62aaf0d258828ef4196e14822e..0c116d6dfd277262b1a4c0f097fce2d719f43844 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -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.
 	 */
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
index dd718c62ac31bf16606f3ee9f025a5b171cd1e67..01479dd94e76a8389a0c9e9d6744400aa2291064 100644
--- a/include/drm/drm_plane.h
+++ b/include/drm/drm_plane.h
@@ -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);
+
 };
 
 /**

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v8 2/3] drm/plane: modify create_in_formats to accommodate async
  2025-03-12 13:09 [PATCH v8 0/3] Expose modifiers/formats supported by async flips Arun R Murthy
  2025-03-12 13:09 ` [PATCH v8 1/3] drm/plane: Add new plane property IN_FORMATS_ASYNC Arun R Murthy
@ 2025-03-12 13:09 ` Arun R Murthy
  2025-03-12 13:09 ` [PATCH v8 3/3] drm/i915/display: Add i915 hook for format_mod_supported_async Arun R Murthy
  2025-03-12 16:10 ` ✗ Fi.CI.SPARSE: warning for Expose modifiers/formats supported by async flips (rev8) Patchwork
  3 siblings, 0 replies; 9+ messages in thread
From: Arun R Murthy @ 2025-03-12 13:09 UTC (permalink / raw)
  To: dri-devel, intel-gfx, intel-xe
  Cc: chaitanya.kumar.borah, 20250219093211.4059187-1-arun.r.murthy,
	20250311085422.2573860-1-santhosh.reddy.guddati, Arun R Murthy,
	Naveen Kumar

create_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)

Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Tested-by: Naveen Kumar <naveen1.kumar@intel.com>
---
 drivers/gpu/drm/drm_plane.c | 42 ++++++++++++++++++++++++++++++------------
 1 file changed, 30 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 110838c3e5920835e0875e57e6e479bcab7c8733..fd7c30622909075cf015d4e5167801d49b8c73b4 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -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;
@@ -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;
 }

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v8 3/3] drm/i915/display: Add i915 hook for format_mod_supported_async
  2025-03-12 13:09 [PATCH v8 0/3] Expose modifiers/formats supported by async flips Arun R Murthy
  2025-03-12 13:09 ` [PATCH v8 1/3] drm/plane: Add new plane property IN_FORMATS_ASYNC Arun R Murthy
  2025-03-12 13:09 ` [PATCH v8 2/3] drm/plane: modify create_in_formats to accommodate async Arun R Murthy
@ 2025-03-12 13:09 ` Arun R Murthy
  2025-03-17 12:22   ` Borah, Chaitanya Kumar
  2025-03-12 16:10 ` ✗ Fi.CI.SPARSE: warning for Expose modifiers/formats supported by async flips (rev8) Patchwork
  3 siblings, 1 reply; 9+ messages in thread
From: Arun R Murthy @ 2025-03-12 13:09 UTC (permalink / raw)
  To: dri-devel, intel-gfx, intel-xe
  Cc: chaitanya.kumar.borah, 20250219093211.4059187-1-arun.r.murthy,
	20250311085422.2573860-1-santhosh.reddy.guddati, Arun R Murthy

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

Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
---
 drivers/gpu/drm/i915/display/i9xx_plane.c          |  6 +++--
 drivers/gpu/drm/i915/display/intel_atomic_plane.c  | 31 +++++++++++++++++++++-
 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 +++-
 5 files changed, 47 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/i9xx_plane.c b/drivers/gpu/drm/i915/display/i9xx_plane.c
index 013295f66d56ec5e919b3a0c904034bf7985986a..6bd09adb8a30ba002ef334261d7638f398587a3e 100644
--- a/drivers/gpu/drm/i915/display/i9xx_plane.c
+++ b/drivers/gpu/drm/i915/display/i9xx_plane.c
@@ -820,7 +820,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 */
@@ -844,7 +844,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))
@@ -889,6 +889,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 = {
@@ -898,6 +899,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 *
diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
index 7276179df878658b7053fe6d8dc37b69f19625e3..a2424f6215fe51ed3238cf2b51f11e14e8b4d211 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
@@ -174,11 +174,40 @@ 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)
 {
+	struct intel_display *display = to_intel_display(plane);
+
+	if (DISPLAY_VER(display) <= 14 ?
+	    drm_format_info(format)->is_yuv :
+	    intel_format_info_is_yuv_semiplanar(drm_format_info(format),
+						modifier)) {
+		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);
 }
 
+bool intel_plane_format_mod_supported_async(struct drm_plane *plane,
+					    u32 format,
+					    u64 modifier)
+{
+	if (plane->funcs->format_mod_supported &&
+	    !plane->funcs->format_mod_supported(plane, format, modifier)) {
+		drm_dbg_kms(plane->dev,
+			    "[PLANE:%d:%s](format %p4cc) modifier 0x%llx not in universal list\n",
+			    plane->base.id, plane->name, &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)
diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
index 6efac923dcbc757e6f68564cbef2919c920f13cb..512c251cc153753a4808cf177c8bcce2178bb862 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h
+++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
@@ -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);
@@ -87,6 +88,9 @@ void intel_plane_init_cursor_vblank_work(struct intel_plane_state *old_plane_sta
 int intel_atomic_add_affected_planes(struct intel_atomic_state *state,
 				     struct intel_crtc *crtc);
 int intel_atomic_check_planes(struct intel_atomic_state *state);
+bool intel_plane_format_mod_supported_async(struct drm_plane *plane,
+					    u32 format,
+					    u64 modifier);
 
 u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state);
 
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 3afb85fe8536dfffd55dbaa07f6727112cc876b7..5d0bab1f8ff8294716ca5843c856032d2b9ccd5b 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -6005,22 +6005,16 @@ static int intel_async_flip_check_hw(struct intel_atomic_state *state, struct in
 		if (!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).
diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index 70e550539bb21393c7173c7b3904e7790eab25f4..f61e1eff30bb4820ccb17daa5d4b2b073a5d4078 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -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) {
@@ -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

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* ✗ Fi.CI.SPARSE: warning for Expose modifiers/formats supported by async flips (rev8)
  2025-03-12 13:09 [PATCH v8 0/3] Expose modifiers/formats supported by async flips Arun R Murthy
                   ` (2 preceding siblings ...)
  2025-03-12 13:09 ` [PATCH v8 3/3] drm/i915/display: Add i915 hook for format_mod_supported_async Arun R Murthy
@ 2025-03-12 16:10 ` Patchwork
  3 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2025-03-12 16:10 UTC (permalink / raw)
  To: Arun R Murthy; +Cc: intel-gfx

== Series Details ==

Series: Expose modifiers/formats supported by async flips (rev8)
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.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v8 1/3] drm/plane: Add new plane property IN_FORMATS_ASYNC
  2025-03-12 13:09 ` [PATCH v8 1/3] drm/plane: Add new plane property IN_FORMATS_ASYNC Arun R Murthy
@ 2025-03-17 12:16   ` Borah, Chaitanya Kumar
  2025-03-18  7:39     ` Murthy, Arun R
  0 siblings, 1 reply; 9+ messages in thread
From: Borah, Chaitanya Kumar @ 2025-03-17 12:16 UTC (permalink / raw)
  To: Murthy, Arun R, dri-devel@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
  Cc: 20250219093211.4059187-1-arun.r.murthy@intel.com,
	20250311085422.2573860-1-santhosh.reddy.guddati@intel.com,
	Kumar, Naveen1



> -----Original Message-----
> From: Murthy, Arun R <arun.r.murthy@intel.com>
> Sent: Wednesday, March 12, 2025 6:39 PM
> To: dri-devel@lists.freedesktop.org; intel-gfx@lists.freedesktop.org; intel-
> xe@lists.freedesktop.org
> Cc: Borah, Chaitanya Kumar <chaitanya.kumar.borah@intel.com>;
> 20250219093211.4059187-1-arun.r.murthy@intel.com;
> 20250311085422.2573860-1-santhosh.reddy.guddati@intel.com; Murthy,
> Arun R <arun.r.murthy@intel.com>; Kumar, Naveen1
> <naveen1.kumar@intel.com>
> Subject: [PATCH v8 1/3] 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)
> 
> Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
> Tested-by: Naveen Kumar <naveen1.kumar@intel.com>
> ---
>  drivers/gpu/drm/drm_mode_config.c |  7 +++++++
>  drivers/gpu/drm/drm_plane.c       | 12 ++++++++++--
>  include/drm/drm_mode_config.h     |  6 ++++++
>  include/drm/drm_plane.h           | 17 +++++++++++++++++
>  4 files changed, 40 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_mode_config.c
> b/drivers/gpu/drm/drm_mode_config.c
> index
> 8642a2fb25a90116dab975aa0ab6b51deafb4b96..b4239fd04e9da4d4b5cfc
> cdef1d3dde9556f322d 100644
> --- a/drivers/gpu/drm/drm_mode_config.c
> +++ b/drivers/gpu/drm/drm_mode_config.c
> @@ -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);
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index
> a28b22fdd7a41aca82d097d42237851da9a0a79b..110838c3e5920835e08
> 75e57e6e479bcab7c8733 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -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).
> @@ -197,7 +205,7 @@ static int create_in_format_blob(struct drm_device
> *dev, struct drm_plane *plane
>  	formats_size = sizeof(__u32) * plane->format_count;
>  	if (WARN_ON(!formats_size)) {
>  		/* 0 formats are never expected */
> -		return 0;
> +		return ERR_PTR(0);

...

>  	}
> 
>  	modifiers_size =
> @@ -213,7 +221,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 ERR_PTR(-1);

Were we seeing any warnings because of this?
If at all needed, it should be part of the second patch [1]

Regards

Chaitanya

[1] https://patchwork.freedesktop.org/patch/642713/?series=140935&rev=8


> 
>  	blob_data = blob->data;
>  	blob_data->version = FORMAT_BLOB_CURRENT; diff --git
> a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
> index
> 271765e2e9f2da62aaf0d258828ef4196e14822e..0c116d6dfd277262b1a4c
> 0f097fce2d719f43844 100644
> --- a/include/drm/drm_mode_config.h
> +++ b/include/drm/drm_mode_config.h
> @@ -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.
>  	 */
> diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index
> dd718c62ac31bf16606f3ee9f025a5b171cd1e67..01479dd94e76a8389a0c
> 9e9d6744400aa2291064 100644
> --- a/include/drm/drm_plane.h
> +++ b/include/drm/drm_plane.h
> @@ -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);
> +
>  };
> 
>  /**
> 
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v8 3/3] drm/i915/display: Add i915 hook for format_mod_supported_async
  2025-03-12 13:09 ` [PATCH v8 3/3] drm/i915/display: Add i915 hook for format_mod_supported_async Arun R Murthy
@ 2025-03-17 12:22   ` Borah, Chaitanya Kumar
  0 siblings, 0 replies; 9+ messages in thread
From: Borah, Chaitanya Kumar @ 2025-03-17 12:22 UTC (permalink / raw)
  To: Murthy, Arun R, dri-devel@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
  Cc: 20250219093211.4059187-1-arun.r.murthy@intel.com,
	20250311085422.2573860-1-santhosh.reddy.guddati@intel.com



> -----Original Message-----
> From: Murthy, Arun R <arun.r.murthy@intel.com>
> Sent: Wednesday, March 12, 2025 6:39 PM
> To: dri-devel@lists.freedesktop.org; intel-gfx@lists.freedesktop.org; intel-
> xe@lists.freedesktop.org
> Cc: Borah, Chaitanya Kumar <chaitanya.kumar.borah@intel.com>;
> 20250219093211.4059187-1-arun.r.murthy@intel.com;
> 20250311085422.2573860-1-santhosh.reddy.guddati@intel.com; Murthy,
> Arun R <arun.r.murthy@intel.com>
> Subject: [PATCH v8 3/3] 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

Nit: Closing brackets and also the null check for the hook.

Otherwise, LGTM

Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>

> 
> Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
> ---
>  drivers/gpu/drm/i915/display/i9xx_plane.c          |  6 +++--
>  drivers/gpu/drm/i915/display/intel_atomic_plane.c  | 31
> +++++++++++++++++++++-
> 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 +++-
>  5 files changed, 47 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/i9xx_plane.c
> b/drivers/gpu/drm/i915/display/i9xx_plane.c
> index
> 013295f66d56ec5e919b3a0c904034bf7985986a..6bd09adb8a30ba002ef3
> 34261d7638f398587a3e 100644
> --- a/drivers/gpu/drm/i915/display/i9xx_plane.c
> +++ b/drivers/gpu/drm/i915/display/i9xx_plane.c
> @@ -820,7 +820,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 */ @@ -
> 844,7 +844,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))
> @@ -889,6 +889,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 = { @@ -898,6 +899,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 *
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> index
> 7276179df878658b7053fe6d8dc37b69f19625e3..a2424f6215fe51ed3238c
> f2b51f11e14e8b4d211 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> @@ -174,11 +174,40 @@ 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)
>  {
> +	struct intel_display *display = to_intel_display(plane);
> +
> +	if (DISPLAY_VER(display) <= 14 ?
> +	    drm_format_info(format)->is_yuv :
> +	    intel_format_info_is_yuv_semiplanar(drm_format_info(format),
> +						modifier)) {
> +		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);  }
> 
> +bool intel_plane_format_mod_supported_async(struct drm_plane *plane,
> +					    u32 format,
> +					    u64 modifier)
> +{
> +	if (plane->funcs->format_mod_supported &&
> +	    !plane->funcs->format_mod_supported(plane, format, modifier)) {
> +		drm_dbg_kms(plane->dev,
> +			    "[PLANE:%d:%s](format %p4cc) modifier 0x%llx not
> in universal list\n",
> +			    plane->base.id, plane->name, &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)
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> index
> 6efac923dcbc757e6f68564cbef2919c920f13cb..512c251cc153753a4808cf
> 177c8bcce2178bb862 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> @@ -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);
> @@ -87,6 +88,9 @@ void intel_plane_init_cursor_vblank_work(struct
> intel_plane_state *old_plane_sta  int intel_atomic_add_affected_planes(struct
> intel_atomic_state *state,
>  				     struct intel_crtc *crtc);
>  int intel_atomic_check_planes(struct intel_atomic_state *state);
> +bool intel_plane_format_mod_supported_async(struct drm_plane *plane,
> +					    u32 format,
> +					    u64 modifier);
> 
>  u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state);
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> b/drivers/gpu/drm/i915/display/intel_display.c
> index
> 3afb85fe8536dfffd55dbaa07f6727112cc876b7..5d0bab1f8ff8294716ca584
> 3c856032d2b9ccd5b 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -6005,22 +6005,16 @@ static int intel_async_flip_check_hw(struct
> intel_atomic_state *state, struct in
>  		if (!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).
> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> index
> 70e550539bb21393c7173c7b3904e7790eab25f4..f61e1eff30bb4820ccb17
> daa5d4b2b073a5d4078 100644
> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> @@ -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) {
> @@ -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
> 
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v8 1/3] drm/plane: Add new plane property IN_FORMATS_ASYNC
  2025-03-17 12:16   ` Borah, Chaitanya Kumar
@ 2025-03-18  7:39     ` Murthy, Arun R
  2025-03-18  8:05       ` Borah, Chaitanya Kumar
  0 siblings, 1 reply; 9+ messages in thread
From: Murthy, Arun R @ 2025-03-18  7:39 UTC (permalink / raw)
  To: Borah, Chaitanya Kumar, dri-devel@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
  Cc: Kumar, Naveen1

> >  	blob = drm_property_create_blob(dev, blob_size, NULL);
> >  	if (IS_ERR(blob))
> > -		return -1;
> > +		return ERR_PTR(-1);
> 
> Were we seeing any warnings because of this?
> If at all needed, it should be part of the second patch [1]
> 
> Regards
> 
> Chaitanya
> 
> [1] https://patchwork.freedesktop.org/patch/642713/?series=140935&rev=8
> 
No warning as such, as part of review found this.
Sure will move it to second patch.

Thanks and Regards,
Arun R Murthy
-------------------

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v8 1/3] drm/plane: Add new plane property IN_FORMATS_ASYNC
  2025-03-18  7:39     ` Murthy, Arun R
@ 2025-03-18  8:05       ` Borah, Chaitanya Kumar
  0 siblings, 0 replies; 9+ messages in thread
From: Borah, Chaitanya Kumar @ 2025-03-18  8:05 UTC (permalink / raw)
  To: Murthy, Arun R, dri-devel@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
  Cc: Kumar, Naveen1



> -----Original Message-----
> From: Murthy, Arun R <arun.r.murthy@intel.com>
> Sent: Tuesday, March 18, 2025 1:09 PM
> To: Borah, Chaitanya Kumar <chaitanya.kumar.borah@intel.com>; dri-
> devel@lists.freedesktop.org; intel-gfx@lists.freedesktop.org; intel-
> xe@lists.freedesktop.org
> Cc: Kumar, Naveen1 <naveen1.kumar@intel.com>
> Subject: RE: [PATCH v8 1/3] drm/plane: Add new plane property
> IN_FORMATS_ASYNC
> 
> > >  	blob = drm_property_create_blob(dev, blob_size, NULL);
> > >  	if (IS_ERR(blob))
> > > -		return -1;
> > > +		return ERR_PTR(-1);
> >
> > Were we seeing any warnings because of this?
> > If at all needed, it should be part of the second patch [1]
> >
> > Regards
> >
> > Chaitanya
> >
> > [1]
> https://patchwork.freedesktop.org/patch/642713/?series=140935&rev=8
> >
> No warning as such, as part of review found this.
> Sure will move it to second patch.
> 

With this moved to the second patch.

Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>

> Thanks and Regards,
> Arun R Murthy
> -------------------

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-03-18  8:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-12 13:09 [PATCH v8 0/3] Expose modifiers/formats supported by async flips Arun R Murthy
2025-03-12 13:09 ` [PATCH v8 1/3] drm/plane: Add new plane property IN_FORMATS_ASYNC Arun R Murthy
2025-03-17 12:16   ` Borah, Chaitanya Kumar
2025-03-18  7:39     ` Murthy, Arun R
2025-03-18  8:05       ` Borah, Chaitanya Kumar
2025-03-12 13:09 ` [PATCH v8 2/3] drm/plane: modify create_in_formats to accommodate async Arun R Murthy
2025-03-12 13:09 ` [PATCH v8 3/3] drm/i915/display: Add i915 hook for format_mod_supported_async Arun R Murthy
2025-03-17 12:22   ` Borah, Chaitanya Kumar
2025-03-12 16:10 ` ✗ Fi.CI.SPARSE: warning for Expose modifiers/formats supported by async flips (rev8) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox