Skip to contentSkip to conversation

uapi/drm/drm_fourcc.h: Note on platform specificity for format modifiers

PATCH Superseded Mika Kahola 2 participants 3 messages May 4, 2020 – May 6, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uapi/drm/drm_fourcc.h: Note on platform specificity for format modifiers

Make an additional note on DRM format modifiers for x and y tiling. These format modifiers are defined for BDW+ platforms and therefore definition is not valid for older gens. This is due to address swizzling for tiled surfaces is no longer used. For newer platforms main memory controller has a more effective address swizzling algorithm.

---
 include/uapi/drm/drm_fourcc.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/uapi/drm/drm_fourcc.h +4 -2
index 8bc0b31597d8..3e56c24cabb6 100644
@@ -356,7 +356,8 @@ extern "C" {
  *
  * This format is highly platforms specific and not useful for cross-driver
  * sharing. It exists since on a given platform it does uniquely identify the
- * layout in a simple way for i915-specific userspace.
+ * layout in a simple way for i915-specific userspace.  The format is
+ * ill-defined for platforms older than BDW.
  */
 #define I915_FORMAT_MOD_X_TILED	fourcc_mod_code(INTEL, 1)
 
@@ -371,7 +372,8 @@ extern "C" {
  *
  * This format is highly platforms specific and not useful for cross-driver
  * sharing. It exists since on a given platform it does uniquely identify the
- * layout in a simple way for i915-specific userspace.
+ * layout in a simple way for i915-specific userspace. The format is
+ * ill-defined for platforms older than BDW.
  */
 #define I915_FORMAT_MOD_Y_TILED	fourcc_mod_code(INTEL, 2)
 
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 17 lines · Mika Kahola

Make an additional note on DRM format modifiers for x and y tiling. These format modifiers are defined for BDW+ platforms and therefore definition is not valid for older gens. This is due to address swizzling for tiled surfaces is no longer used. For newer platforms main memory controller has a more effective address swizzling algorithm.

---
 include/uapi/drm/drm_fourcc.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/uapi/drm/drm_fourcc.h +0 -0
index 8bc0b31597d8..3e56c24cabb6 100644

include/uapi/drm/drm_fourcc.h extern "C" { · line 360

Quoted 6 lines
include/uapi/drm/drm_fourcc.h +2 -1
@@ -356,7 +356,8 @@ extern "C" {
  *
  * This format is highly platforms specific and not useful for cross-driver
  * sharing. It exists since on a given platform it does uniquely identify the
- * layout in a simple way for i915-specific userspace.
+ * layout in a simple way for i915-specific userspace.  The format is
+ * ill-defined for platforms older than BDW.

Hm this is a bit confusing, since you're just adding a new sentences and not really clarifying the paragraph overall. Right above we have the detailed description of the modifier on gen8+, I'd replace the entire paragraph here with something like:

"Note that this layout is only accurate on intel gen 8+ or valleyview chipsets. On earlier platforms the is highly platforms specific and not useful for cross-driver
sharing. It exists since on a given platform it does uniquely identify the layout in a simple way for i915-specific userspace, which facilitated conversion of userspace to modifiers. Additionally the exact format on some really old platforms is not known."

That way it's much clearer that the specification is well-defined and where, with the old stuff as exceptions. Your patch kinda makes bdw+ the exception of the exception, and that's hard to understand.

Cheers, Daniel

Quoted 16 lines
include/uapi/drm/drm_fourcc.h +2 -2
  */
 #define I915_FORMAT_MOD_X_TILED        fourcc_mod_code(INTEL, 1)
 
@@ -371,7 +372,8 @@ extern "C" {
  *
  * This format is highly platforms specific and not useful for cross-driver
  * sharing. It exists since on a given platform it does uniquely identify the
- * layout in a simple way for i915-specific userspace.
+ * layout in a simple way for i915-specific userspace. The format is
+ * ill-defined for platforms older than BDW.
  */
 #define I915_FORMAT_MOD_Y_TILED        fourcc_mod_code(INTEL, 2)
 
--

2.20.1

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 48 lines

-----Original Message-----
From: Daniel Vetter <[email protected]>
Sent: Monday, May 4, 2020 2:17 PM
To: Kahola, Mika <[email protected]>
Cc: dri-devel <[email protected]>
Subject: Re: [PATCH] uapi/drm/drm_fourcc.h: Note on platform specificity for format modifiers

Quoted 21 lines · Mika Kahola

Make an additional note on DRM format modifiers for x and y tiling. These format modifiers are defined for BDW+ platforms and therefore definition is not valid for older gens. This is due to address swizzling for tiled surfaces is no longer used. For newer platforms main memory controller has a more effective address swizzling algorithm.

---
 include/uapi/drm/drm_fourcc.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/include/uapi/drm/drm_fourcc.h index 8bc0b31597d8..3e56c24cabb6 100644

include/uapi/drm/drm_fourcc.h +0 -0
@@ -356,7 +356,8 @@ extern "C" {
  *
  * This format is highly platforms specific and not useful for cross-driver
  * sharing. It exists since on a given platform it does uniquely
Quoted 4 lines

identify the
- * layout in a simple way for i915-specific userspace.
+ * layout in a simple way for i915-specific userspace. The format is
+ * ill-defined for platforms older than BDW.

Hm this is a bit confusing, since you're just adding a new sentences and not really clarifying the paragraph overall. Right above we have the detailed description of the modifier on gen8+, I'd replace the entire paragraph here with something like:

"Note that this layout is only accurate on intel gen 8+ or valleyview chipsets. On earlier platforms the is highly platforms specific and not useful for cross-driver sharing. It exists since on a given platform it does uniquely identify the layout in a simple way for i915-specific userspace, which facilitated conversion of userspace to modifiers. Additionally the exact format on some really old platforms is not known."

Quoted 3 lines

That way it's much clearer that the specification is well-defined and where, with the old stuff as exceptions. Your patch kinda makes bdw+ the exception of the exception, and that's hard to understand.

I admit, that the wording may have been confusing. I'll update the patch with your proposal.

Cheers,
Mika

Quoted 22 lines

Cheers, Daniel

Quoted 17 lines

*/
#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1)

include/uapi/drm/drm_fourcc.h +0 -0
@@ -371,7 +372,8 @@ extern "C" {
  *
  * This format is highly platforms specific and not useful for cross-driver
  * sharing. It exists since on a given platform it does uniquely

identify the
- * layout in a simple way for i915-specific userspace.
+ * layout in a simple way for i915-specific userspace. The format is
+ * ill-defined for platforms older than BDW.
*/
#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2)

--
2.20.1

Quoted 11 lines
Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel