From: Arun R Murthy <arun.r.murthy@intel.com>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
intel-xe@lists.freedesktop.org
Cc: "Jani Nikula" <jani.nikula@linux.intel.com>,
chaitanya.kumar.borah@intel.com, ville.syrjala@intel.com,
"Arun R Murthy" <arun.r.murthy@intel.com>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
"Naveen Kumar" <naveen1.kumar@intel.com>
Subject: [PATCH v11 1/5] drm/plane: Add new plane property IN_FORMATS_ASYNC
Date: Fri, 28 Mar 2025 18:15:35 +0530 [thread overview]
Message-ID: <20250328-asyn-v11-1-ecc2d33aac69@intel.com> (raw)
In-Reply-To: <20250328-asyn-v11-0-ecc2d33aac69@intel.com>
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>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Naveen Kumar <naveen1.kumar@intel.com>
---
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(+)
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..fe181c1002171acc68d3054c2d178f9b9f501fe2 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).
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
next prev parent reply other threads:[~2025-03-28 13:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-28 12:45 [PATCH v11 0/5] Expose modifiers/formats supported by async flips Arun R Murthy
2025-03-28 12:45 ` Arun R Murthy [this message]
2025-03-28 12:45 ` [PATCH v11 2/5] drm/plane: modify create_in_formats to acommodate async Arun R Murthy
2025-03-28 12:45 ` [PATCH v11 3/5] drm/i915/display: Acomodate format check in can_async_flip() Arun R Murthy
2025-03-28 13:36 ` Ville Syrjälä
2025-03-28 16:08 ` Murthy, Arun R
2025-03-28 12:45 ` [PATCH v11 4/5] drm/i915/display: Add i915 hook for format_mod_supported_async Arun R Murthy
2025-03-28 12:45 ` [PATCH v11 5/5] drm/i915/display: Indexed 8bit format does not support async flip Arun R Murthy
2025-03-28 13:37 ` Ville Syrjälä
2025-03-28 13:23 ` ✗ Fi.CI.SPARSE: warning for Expose modifiers/formats supported by async flips (rev11) Patchwork
2025-03-28 13:41 ` ✓ i915.CI.BAT: success " Patchwork
2025-03-28 15:50 ` ✗ i915.CI.Full: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2025-03-28 15:56 [PATCH v11 0/5] Expose modifiers/formats supported by async flips Arun R Murthy
2025-03-28 15:56 ` [PATCH v11 1/5] drm/plane: Add new plane property IN_FORMATS_ASYNC Arun R Murthy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250328-asyn-v11-1-ecc2d33aac69@intel.com \
--to=arun.r.murthy@intel.com \
--cc=chaitanya.kumar.borah@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=naveen1.kumar@intel.com \
--cc=ville.syrjala@intel.com \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox