Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>
Acked-by: Xaver Hugl <xaver.hugl@kde.org>
Acked-by: Harry Wentland <harry.wentland@amd.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>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://lore.kernel.org/r/20250407-asyn-v13-1-b93ef83076c5@intel.com

authored by

Arun R Murthy and committed by
Suraj Kandpal
9cd5cc9d 91bdccf5

+38
+7
drivers/gpu/drm/drm_mode_config.c
··· 383 383 384 384 prop = drm_property_create(dev, 385 385 DRM_MODE_PROP_IMMUTABLE | DRM_MODE_PROP_BLOB, 386 + "IN_FORMATS_ASYNC", 0); 387 + if (!prop) 388 + return -ENOMEM; 389 + dev->mode_config.async_modifiers_property = prop; 390 + 391 + prop = drm_property_create(dev, 392 + DRM_MODE_PROP_IMMUTABLE | DRM_MODE_PROP_BLOB, 386 393 "SIZE_HINTS", 0); 387 394 if (!prop) 388 395 return -ENOMEM;
+8
drivers/gpu/drm/drm_plane.c
··· 141 141 * various bugs in this area with inconsistencies between the capability 142 142 * flag and per-plane properties. 143 143 * 144 + * IN_FORMATS_ASYNC: 145 + * Blob property which contains the set of buffer format and modifier 146 + * pairs supported by this plane for asynchronous flips. The blob is a struct 147 + * drm_format_modifier_blob. Userspace cannot change this property. This is an 148 + * optional property and if not present then user should expect a failure in 149 + * atomic ioctl when the modifier/format is not supported by that plane under 150 + * asynchronous flip. 151 + * 144 152 * SIZE_HINTS: 145 153 * Blob property which contains the set of recommended plane size 146 154 * which can used for simple "cursor like" use cases (eg. no scaling).
+6
include/drm/drm_mode_config.h
··· 937 937 struct drm_property *modifiers_property; 938 938 939 939 /** 940 + * @async_modifiers_property: Plane property to list support modifier/format 941 + * combination for asynchronous flips. 942 + */ 943 + struct drm_property *async_modifiers_property; 944 + 945 + /** 940 946 * @size_hints_property: Plane SIZE_HINTS property. 941 947 */ 942 948 struct drm_property *size_hints_property;
+17
include/drm/drm_plane.h
··· 549 549 */ 550 550 bool (*format_mod_supported)(struct drm_plane *plane, uint32_t format, 551 551 uint64_t modifier); 552 + /** 553 + * @format_mod_supported_async: 554 + * 555 + * This optional hook is used for the DRM to determine if for 556 + * asynchronous flip the given format/modifier combination is valid for 557 + * the plane. This allows the DRM to generate the correct format 558 + * bitmask (which formats apply to which modifier), and to validate 559 + * modifiers at atomic_check time. 560 + * 561 + * Returns: 562 + * 563 + * True if the given modifier is valid for that format on the plane. 564 + * False otherwise. 565 + */ 566 + bool (*format_mod_supported_async)(struct drm_plane *plane, 567 + u32 format, u64 modifier); 568 + 552 569 }; 553 570 554 571 /**