Skip to contentSkip to conversation

drm: drm_fourcc: Add generic alias for 16_16_TILE modifier

PATCH Superseded Brian Starkey 2 participants 10 messages Jun 26, 2020 – Jun 29, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: drm_fourcc: Add generic alias for 16_16_TILE modifier

In cases such as DRM_FORMAT_MOD_SAMSUNG_16_16_TILE, the modifier describes a generic pixel re-ordering which can be applicable to multiple vendors.

Define an alias: DRM_FORMAT_MOD_GENERIC_16_16_TILE, which can be used to describe this layout in a vendor-neutral way, and add a comment about the expected usage of such "generic" modifiers.

---

This is based off a suggestion from Daniel here:
https://lore.kernel.org/dri-devel/[email protected]/

If there are future cases where a "generic" modifier is identified before merging with a specific vendor code, perhaps we could use fourcc_mod_code(NONE, n) or add a DRM_FORMAT_MOD_VENDOR_GENERIC.

However, I also think we shouldn't try and "guess" what might be generic up-front and end up polluting the generic namespace. It seems fine to just alias vendor-specific definitions unless it's very clear-cut.

I typed a version which was s/GENERIC/COMMON/, other suggestions welcome.

Cheers,
-Brian

 include/uapi/drm/drm_fourcc.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
include/uapi/drm/drm_fourcc.h +19 -0
index 299f9ac4840b..ef78dc9c3fb0 100644
@@ -345,8 +345,27 @@ extern "C" {
  * When adding a new token please document the layout with a code comment,
  * similar to the fourcc codes above. drm_fourcc.h is considered the
  * authoritative source for all of these.
+ *
+ * Generic modifier names:
+ *
+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names
+ * for layouts which are common across multiple vendors. To preserve
+ * compatibility, in cases where a vendor-specific definition already exists and
+ * a generic name for it is desired, the common name is a purely symbolic alias
+ * and must use the same numerical value as the original definition.
+ *
+ * Note that generic names should only be used for modifiers which describe
+ * generic layouts (such as pixel re-ordering), which may have
+ * independently-developed support across multiple vendors.
+ *
+ * Generic names should not be used for cases where multiple hardware vendors
+ * have implementations of the same standardised compression scheme (such as
+ * AFBC). In those cases, all implementations should use the same format
+ * modifier(s), reflecting the vendor of the standard.
  */
 
+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
+
 /*
  * Invalid Modifier
  *
Signature · 6 lines
2.17.1

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

In cases such as DRM_FORMAT_MOD_SAMSUNG_16_16_TILE, the modifier describes a generic pixel re-ordering which can be applicable to multiple vendors.

Define an alias: DRM_FORMAT_MOD_GENERIC_16_16_TILE, which can be used to describe this layout in a vendor-neutral way, and add a comment about the expected usage of such "generic" modifiers.

---

This is based off a suggestion from Daniel here:
https://lore.kernel.org/dri-devel/[email protected]/

Quoted 7 lines

If there are future cases where a "generic" modifier is identified before merging with a specific vendor code, perhaps we could use fourcc_mod_code(NONE, n) or add a DRM_FORMAT_MOD_VENDOR_GENERIC.

However, I also think we shouldn't try and "guess" what might be generic up-front and end up polluting the generic namespace. It seems fine to just alias vendor-specific definitions unless it's very clear-cut.

I think the above two things would also be good additions to the comment.

A totally different thing: I just noticed that we don't pull in all the comments for modifiers. I think we could convert them to kerneldoc, and then pull them into a separate section in drm-kms.rst. Maybe even worth to pull out into a new drm-fourcc.rst document, since these are officially shared with gl and vk standard extensions. Then this new modifier's doc could simply point at teh existing one (and the generated kerneldoc would make that a hyperlink for added awesomeness).

Aside from that makes sense to me, maybe just add it to your patch series that will start making use of these.
-Daniel

Quoted 45 lines

I typed a version which was s/GENERIC/COMMON/, other suggestions welcome.

Cheers,

(quoted diff) +0 -1
-Brian
 
 include/uapi/drm/drm_fourcc.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
include/uapi/drm/drm_fourcc.h +19 -1
index 299f9ac4840b..ef78dc9c3fb0 100644
@@ -345,8 +345,27 @@ extern "C" {
  * When adding a new token please document the layout with a code comment,
  * similar to the fourcc codes above. drm_fourcc.h is considered the
  * authoritative source for all of these.
+ *
+ * Generic modifier names:
+ *
+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names
+ * for layouts which are common across multiple vendors. To preserve
+ * compatibility, in cases where a vendor-specific definition already exists and
+ * a generic name for it is desired, the common name is a purely symbolic alias
+ * and must use the same numerical value as the original definition.
+ *
+ * Note that generic names should only be used for modifiers which describe
+ * generic layouts (such as pixel re-ordering), which may have
+ * independently-developed support across multiple vendors.
+ *
+ * Generic names should not be used for cases where multiple hardware vendors
+ * have implementations of the same standardised compression scheme (such as
+ * AFBC). In those cases, all implementations should use the same format
+ * modifier(s), reflecting the vendor of the standard.
  */
 
+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
+
 /*
  * Invalid Modifier
  *
--

2.17.1

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

Hi Daniel,

Quoted 35 lines · Daniel Vetter
Quoted 15 lines · Brian Starkey

In cases such as DRM_FORMAT_MOD_SAMSUNG_16_16_TILE, the modifier describes a generic pixel re-ordering which can be applicable to multiple vendors.

Define an alias: DRM_FORMAT_MOD_GENERIC_16_16_TILE, which can be used to describe this layout in a vendor-neutral way, and add a comment about the expected usage of such "generic" modifiers.

---

This is based off a suggestion from Daniel here:
https://lore.kernel.org/dri-devel/[email protected]/

Quoted 7 lines

If there are future cases where a "generic" modifier is identified before merging with a specific vendor code, perhaps we could use fourcc_mod_code(NONE, n) or add a DRM_FORMAT_MOD_VENDOR_GENERIC.

However, I also think we shouldn't try and "guess" what might be generic up-front and end up polluting the generic namespace. It seems fine to just alias vendor-specific definitions unless it's very clear-cut.

I think the above two things would also be good additions to the comment.

A totally different thing: I just noticed that we don't pull in all the comments for modifiers. I think we could convert them to kerneldoc, and then pull them into a separate section in drm-kms.rst. Maybe even worth to pull out into a new drm-fourcc.rst document, since these are officially shared with gl and vk standard extensions. Then this new modifier's doc could simply point at teh existing one (and the generated kerneldoc would make that a hyperlink for added awesomeness).

Quoted 2 lines

Aside from that makes sense to me, maybe just add it to your patch series that will start making use of these.

This is only supported by the GPU, so we wouldn't be using this on the Display side.

Thanks,
-Brian

Quoted 39 lines

-Daniel

Quoted 37 lines

I typed a version which was s/GENERIC/COMMON/, other suggestions welcome.

Cheers,

(quoted diff) +0 -1
-Brian
 
 include/uapi/drm/drm_fourcc.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
include/uapi/drm/drm_fourcc.h +17 -0
index 299f9ac4840b..ef78dc9c3fb0 100644
@@ -345,8 +345,27 @@ extern "C" {
  * When adding a new token please document the layout with a code comment,
  * similar to the fourcc codes above. drm_fourcc.h is considered the
  * authoritative source for all of these.
+ *
+ * Generic modifier names:
+ *
+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names
+ * for layouts which are common across multiple vendors. To preserve
+ * compatibility, in cases where a vendor-specific definition already exists and
+ * a generic name for it is desired, the common name is a purely symbolic alias
+ * and must use the same numerical value as the original definition.
+ *
+ * Note that generic names should only be used for modifiers which describe
+ * generic layouts (such as pixel re-ordering), which may have
+ * independently-developed support across multiple vendors.
+ *
+ * Generic names should not be used for cases where multiple hardware vendors
+ * have implementations of the same standardised compression scheme (such as
+ * AFBC). In those cases, all implementations should use the same format
+ * modifier(s), reflecting the vendor of the standard.
  */
 
Quoted 14 lines
Quoted 8 lines
include/uapi/drm/drm_fourcc.h +2 -1
+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
+
 /*
  * Invalid Modifier
  *
--

2.17.1

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

#3 lore raw
Quoted 39 lines · Brian Starkey

Hi Daniel,

Quoted 35 lines · Daniel Vetter
Quoted 15 lines · Brian Starkey

In cases such as DRM_FORMAT_MOD_SAMSUNG_16_16_TILE, the modifier describes a generic pixel re-ordering which can be applicable to multiple vendors.

Define an alias: DRM_FORMAT_MOD_GENERIC_16_16_TILE, which can be used to describe this layout in a vendor-neutral way, and add a comment about the expected usage of such "generic" modifiers.

---

This is based off a suggestion from Daniel here:
https://lore.kernel.org/dri-devel/[email protected]/

Quoted 7 lines

If there are future cases where a "generic" modifier is identified before merging with a specific vendor code, perhaps we could use fourcc_mod_code(NONE, n) or add a DRM_FORMAT_MOD_VENDOR_GENERIC.

However, I also think we shouldn't try and "guess" what might be generic up-front and end up polluting the generic namespace. It seems fine to just alias vendor-specific definitions unless it's very clear-cut.

I think the above two things would also be good additions to the comment.

A totally different thing: I just noticed that we don't pull in all the comments for modifiers. I think we could convert them to kerneldoc, and then pull them into a separate section in drm-kms.rst. Maybe even worth to pull out into a new drm-fourcc.rst document, since these are officially shared with gl and vk standard extensions. Then this new modifier's doc could simply point at teh existing one (and the generated kerneldoc would make that a hyperlink for added awesomeness).

Quoted 5 lines
Quoted 2 lines

Aside from that makes sense to me, maybe just add it to your patch series that will start making use of these.

This is only supported by the GPU, so we wouldn't be using this on the Display side.

I mean the patch to add the NV15 fource, it mentions "suitable for 16 by 16 tile layout", would be nice to just put the generic modifier in that comment.
-Daniel

Quoted 57 lines

Thanks,
-Brian

Quoted 53 lines

-Daniel

Quoted 43 lines

I typed a version which was s/GENERIC/COMMON/, other suggestions welcome.

Cheers,

(quoted diff) +0 -1
-Brian
 
 include/uapi/drm/drm_fourcc.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
include/uapi/drm/drm_fourcc.h +19 -1
index 299f9ac4840b..ef78dc9c3fb0 100644
@@ -345,8 +345,27 @@ extern "C" {
  * When adding a new token please document the layout with a code comment,
  * similar to the fourcc codes above. drm_fourcc.h is considered the
  * authoritative source for all of these.
+ *
+ * Generic modifier names:
+ *
+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names
+ * for layouts which are common across multiple vendors. To preserve
+ * compatibility, in cases where a vendor-specific definition already exists and
+ * a generic name for it is desired, the common name is a purely symbolic alias
+ * and must use the same numerical value as the original definition.
+ *
+ * Note that generic names should only be used for modifiers which describe
+ * generic layouts (such as pixel re-ordering), which may have
+ * independently-developed support across multiple vendors.
+ *
+ * Generic names should not be used for cases where multiple hardware vendors
+ * have implementations of the same standardised compression scheme (such as
+ * AFBC). In those cases, all implementations should use the same format
+ * modifier(s), reflecting the vendor of the standard.
  */
 
+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
+
 /*
  * Invalid Modifier
  *
--
Quoted 2 lines

2.17.1

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
Quoted 43 lines · Daniel Vetter
Quoted 42 lines · Brian Starkey

Hi Daniel,

Quoted 37 lines · Daniel Vetter
Quoted 15 lines · Brian Starkey

In cases such as DRM_FORMAT_MOD_SAMSUNG_16_16_TILE, the modifier describes a generic pixel re-ordering which can be applicable to multiple vendors.

Define an alias: DRM_FORMAT_MOD_GENERIC_16_16_TILE, which can be used to describe this layout in a vendor-neutral way, and add a comment about the expected usage of such "generic" modifiers.

---

This is based off a suggestion from Daniel here:
https://lore.kernel.org/dri-devel/[email protected]/

Quoted 7 lines

If there are future cases where a "generic" modifier is identified before merging with a specific vendor code, perhaps we could use fourcc_mod_code(NONE, n) or add a DRM_FORMAT_MOD_VENDOR_GENERIC.

However, I also think we shouldn't try and "guess" what might be generic up-front and end up polluting the generic namespace. It seems fine to just alias vendor-specific definitions unless it's very clear-cut.

I think the above two things would also be good additions to the comment.

A totally different thing: I just noticed that we don't pull in all the comments for modifiers. I think we could convert them to kerneldoc, and then pull them into a separate section in drm-kms.rst. Maybe even worth to pull out into a new drm-fourcc.rst document, since these are officially shared with gl and vk standard extensions. Then this new modifier's doc could simply point at teh existing one (and the generated kerneldoc would make that a hyperlink for added awesomeness).

Aside from that makes sense to me, maybe just add it to your patch series that will start making use of these.

Quoted 7 lines
Quoted 2 lines

This is only supported by the GPU, so we wouldn't be using this on the Display side.

I mean the patch to add the NV15 fource, it mentions "suitable for 16 by 16 tile layout", would be nice to just put the generic modifier in that comment.
-Daniel

Ah right. I saw that one went out in Maarten's pull request this morning.

-Brian

Quoted 61 lines
Quoted 58 lines

Thanks,
-Brian

Quoted 53 lines

-Daniel

Quoted 43 lines

I typed a version which was s/GENERIC/COMMON/, other suggestions welcome.

Cheers,

(quoted diff) +0 -1
-Brian
 
 include/uapi/drm/drm_fourcc.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
include/uapi/drm/drm_fourcc.h +19 -1
index 299f9ac4840b..ef78dc9c3fb0 100644
@@ -345,8 +345,27 @@ extern "C" {
  * When adding a new token please document the layout with a code comment,
  * similar to the fourcc codes above. drm_fourcc.h is considered the
  * authoritative source for all of these.
+ *
+ * Generic modifier names:
+ *
+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names
+ * for layouts which are common across multiple vendors. To preserve
+ * compatibility, in cases where a vendor-specific definition already exists and
+ * a generic name for it is desired, the common name is a purely symbolic alias
+ * and must use the same numerical value as the original definition.
+ *
+ * Note that generic names should only be used for modifiers which describe
+ * generic layouts (such as pixel re-ordering), which may have
+ * independently-developed support across multiple vendors.
+ *
+ * Generic names should not be used for cases where multiple hardware vendors
+ * have implementations of the same standardised compression scheme (such as
+ * AFBC). In those cases, all implementations should use the same format
+ * modifier(s), reflecting the vendor of the standard.
  */
 
+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
+
 /*
  * Invalid Modifier
  *
--
Quoted 2 lines

2.17.1

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Quoted 4 lines

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

#5 lore raw
Quoted 48 lines · Brian Starkey
Quoted 46 lines · Daniel Vetter
Quoted 44 lines · Brian Starkey

Hi Daniel,

Quoted 35 lines · Daniel Vetter
Quoted 15 lines · Brian Starkey

In cases such as DRM_FORMAT_MOD_SAMSUNG_16_16_TILE, the modifier describes a generic pixel re-ordering which can be applicable to multiple vendors.

Define an alias: DRM_FORMAT_MOD_GENERIC_16_16_TILE, which can be used to describe this layout in a vendor-neutral way, and add a comment about the expected usage of such "generic" modifiers.

---

This is based off a suggestion from Daniel here:
https://lore.kernel.org/dri-devel/[email protected]/

Quoted 7 lines

If there are future cases where a "generic" modifier is identified before merging with a specific vendor code, perhaps we could use fourcc_mod_code(NONE, n) or add a DRM_FORMAT_MOD_VENDOR_GENERIC.

However, I also think we shouldn't try and "guess" what might be generic up-front and end up polluting the generic namespace. It seems fine to just alias vendor-specific definitions unless it's very clear-cut.

I think the above two things would also be good additions to the comment.

A totally different thing: I just noticed that we don't pull in all the comments for modifiers. I think we could convert them to kerneldoc, and then pull them into a separate section in drm-kms.rst. Maybe even worth to pull out into a new drm-fourcc.rst document, since these are officially shared with gl and vk standard extensions. Then this new modifier's doc could simply point at teh existing one (and the generated kerneldoc would make that a hyperlink for added awesomeness).

Quoted 2 lines

Aside from that makes sense to me, maybe just add it to your patch series that will start making use of these.

This is only supported by the GPU, so we wouldn't be using this on the Display side.

Quoted 7 lines
Quoted 4 lines

I mean the patch to add the NV15 fource, it mentions "suitable for 16 by 16 tile layout", would be nice to just put the generic modifier in that comment.
-Daniel

Ah right. I saw that one went out in Maarten's pull request this morning.

Oh I missed that, then maybe just amend this patch to update the other comment? -Daniel

Quoted 68 lines

-Brian

Quoted 65 lines
Quoted 58 lines

Thanks,
-Brian

Quoted 53 lines

-Daniel

Quoted 43 lines

I typed a version which was s/GENERIC/COMMON/, other suggestions welcome.

Cheers,

(quoted diff) +0 -1
-Brian
 
 include/uapi/drm/drm_fourcc.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
include/uapi/drm/drm_fourcc.h +19 -1
index 299f9ac4840b..ef78dc9c3fb0 100644
@@ -345,8 +345,27 @@ extern "C" {
  * When adding a new token please document the layout with a code comment,
  * similar to the fourcc codes above. drm_fourcc.h is considered the
  * authoritative source for all of these.
+ *
+ * Generic modifier names:
+ *
+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names
+ * for layouts which are common across multiple vendors. To preserve
+ * compatibility, in cases where a vendor-specific definition already exists and
+ * a generic name for it is desired, the common name is a purely symbolic alias
+ * and must use the same numerical value as the original definition.
+ *
+ * Note that generic names should only be used for modifiers which describe
+ * generic layouts (such as pixel re-ordering), which may have
+ * independently-developed support across multiple vendors.
+ *
+ * Generic names should not be used for cases where multiple hardware vendors
+ * have implementations of the same standardised compression scheme (such as
+ * AFBC). In those cases, all implementations should use the same format
+ * modifier(s), reflecting the vendor of the standard.
  */
 
+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
+
 /*
  * Invalid Modifier
  *
--
Quoted 2 lines

2.17.1

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw
Quoted 54 lines · Daniel Vetter
Quoted 53 lines · Brian Starkey
Quoted 50 lines · Daniel Vetter
Quoted 39 lines · Brian Starkey

Hi Daniel,

Quoted 35 lines · Daniel Vetter
Quoted 15 lines · Brian Starkey

In cases such as DRM_FORMAT_MOD_SAMSUNG_16_16_TILE, the modifier describes a generic pixel re-ordering which can be applicable to multiple vendors.

Define an alias: DRM_FORMAT_MOD_GENERIC_16_16_TILE, which can be used to describe this layout in a vendor-neutral way, and add a comment about the expected usage of such "generic" modifiers.

---

This is based off a suggestion from Daniel here:
https://lore.kernel.org/dri-devel/[email protected]/

Quoted 7 lines

If there are future cases where a "generic" modifier is identified before merging with a specific vendor code, perhaps we could use fourcc_mod_code(NONE, n) or add a DRM_FORMAT_MOD_VENDOR_GENERIC.

However, I also think we shouldn't try and "guess" what might be generic up-front and end up polluting the generic namespace. It seems fine to just alias vendor-specific definitions unless it's very clear-cut.

I think the above two things would also be good additions to the comment.

A totally different thing: I just noticed that we don't pull in all the comments for modifiers. I think we could convert them to kerneldoc, and then pull them into a separate section in drm-kms.rst. Maybe even worth to pull out into a new drm-fourcc.rst document, since these are officially shared with gl and vk standard extensions. Then this new modifier's doc could simply point at teh existing one (and the generated kerneldoc would make that a hyperlink for added awesomeness).

Quoted 5 lines
Quoted 2 lines

Aside from that makes sense to me, maybe just add it to your patch series that will start making use of these.

This is only supported by the GPU, so we wouldn't be using this on the Display side.

I mean the patch to add the NV15 fource, it mentions "suitable for 16 by 16 tile layout", would be nice to just put the generic modifier in that comment.
-Daniel

Quoted 4 lines
Quoted 2 lines

Ah right. I saw that one went out in Maarten's pull request this morning.

Oh I missed that, then maybe just amend this patch to update the other comment?

It was only mentioned in the commit message there, so I guess I can't do anything about it now.

I'll respin to put the extra notes into the comment.

Thanks,
-Brian

Quoted 66 lines

-Daniel

Quoted 64 lines

-Brian

Quoted 61 lines
Quoted 58 lines

Thanks,
-Brian

Quoted 53 lines

-Daniel

Quoted 43 lines

I typed a version which was s/GENERIC/COMMON/, other suggestions welcome.

Cheers,

(quoted diff) +0 -1
-Brian
 
 include/uapi/drm/drm_fourcc.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
include/uapi/drm/drm_fourcc.h +19 -1
index 299f9ac4840b..ef78dc9c3fb0 100644
@@ -345,8 +345,27 @@ extern "C" {
  * When adding a new token please document the layout with a code comment,
  * similar to the fourcc codes above. drm_fourcc.h is considered the
  * authoritative source for all of these.
+ *
+ * Generic modifier names:
+ *
+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names
+ * for layouts which are common across multiple vendors. To preserve
+ * compatibility, in cases where a vendor-specific definition already exists and
+ * a generic name for it is desired, the common name is a purely symbolic alias
+ * and must use the same numerical value as the original definition.
+ *
+ * Note that generic names should only be used for modifiers which describe
+ * generic layouts (such as pixel re-ordering), which may have
+ * independently-developed support across multiple vendors.
+ *
+ * Generic names should not be used for cases where multiple hardware vendors
+ * have implementations of the same standardised compression scheme (such as
+ * AFBC). In those cases, all implementations should use the same format
+ * modifier(s), reflecting the vendor of the standard.
  */
 
+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
+
 /*
  * Invalid Modifier
  *
--
Quoted 2 lines

2.17.1

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Quoted 11 lines
Quoted 4 lines
Quoted 4 lines

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

#7 lore raw

PATCH v2 1/1 drm: drm_fourcc: Add generic alias for 16_16_TILE modifier

In cases such as DRM_FORMAT_MOD_SAMSUNG_16_16_TILE, the modifier describes a generic pixel re-ordering which can be applicable to multiple vendors.

Define an alias: DRM_FORMAT_MOD_GENERIC_16_16_TILE, which can be used to describe this layout in a vendor-neutral way, and add a comment about the expected usage of such "generic" modifiers.

Changes in v2:
- Move note about future cases to comment (Daniel)

---
 include/uapi/drm/drm_fourcc.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
include/uapi/drm/drm_fourcc.h +25 -0
index 299f9ac4840b..cb3db4a21012 100644
@@ -345,8 +345,33 @@ extern "C" {
  * When adding a new token please document the layout with a code comment,
  * similar to the fourcc codes above. drm_fourcc.h is considered the
  * authoritative source for all of these.
+ *
+ * Generic modifier names:
+ *
+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names
+ * for layouts which are common across multiple vendors. To preserve
+ * compatibility, in cases where a vendor-specific definition already exists and
+ * a generic name for it is desired, the common name is a purely symbolic alias
+ * and must use the same numerical value as the original definition.
+ *
+ * Note that generic names should only be used for modifiers which describe
+ * generic layouts (such as pixel re-ordering), which may have
+ * independently-developed support across multiple vendors.
+ *
+ * In future cases where a generic layout is identified before merging with a
+ * vendor-specific modifier, a new 'GENERIC' vendor or modifier using vendor
+ * 'NONE' could be considered. This should only be for obvious, exceptional
+ * cases to avoid polluting the 'GENERIC' namespace with modifiers which only
+ * apply to a single vendor.
+ *
+ * Generic names should not be used for cases where multiple hardware vendors
+ * have implementations of the same standardised compression scheme (such as
+ * AFBC). In those cases, all implementations should use the same format
+ * modifier(s), reflecting the vendor of the standard.
  */
 
+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
+
 /*
  * Invalid Modifier
  *
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v2 1/1
#8 lore raw
Quoted 4 lines · Brian Starkey

In cases such as DRM_FORMAT_MOD_SAMSUNG_16_16_TILE, the modifier describes a generic pixel re-ordering which can be applicable to multiple vendors.

Quoted 8 lines

Define an alias: DRM_FORMAT_MOD_GENERIC_16_16_TILE, which can be used to describe this layout in a vendor-neutral way, and add a comment about the expected usage of such "generic" modifiers.

Changes in v2:
- Move note about future cases to comment (Daniel)

Quoted 45 lines
---
 include/uapi/drm/drm_fourcc.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
include/uapi/drm/drm_fourcc.h +25 -0
index 299f9ac4840b..cb3db4a21012 100644
@@ -345,8 +345,33 @@ extern "C" {
  * When adding a new token please document the layout with a code comment,
  * similar to the fourcc codes above. drm_fourcc.h is considered the
  * authoritative source for all of these.
+ *
+ * Generic modifier names:
+ *
+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names
+ * for layouts which are common across multiple vendors. To preserve
+ * compatibility, in cases where a vendor-specific definition already exists and
+ * a generic name for it is desired, the common name is a purely symbolic alias
+ * and must use the same numerical value as the original definition.
+ *
+ * Note that generic names should only be used for modifiers which describe
+ * generic layouts (such as pixel re-ordering), which may have
+ * independently-developed support across multiple vendors.
+ *
+ * In future cases where a generic layout is identified before merging with a
+ * vendor-specific modifier, a new 'GENERIC' vendor or modifier using vendor
+ * 'NONE' could be considered. This should only be for obvious, exceptional
+ * cases to avoid polluting the 'GENERIC' namespace with modifiers which only
+ * apply to a single vendor.
+ *
+ * Generic names should not be used for cases where multiple hardware vendors
+ * have implementations of the same standardised compression scheme (such as
+ * AFBC). In those cases, all implementations should use the same format
+ * modifier(s), reflecting the vendor of the standard.
  */
 
+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
+
 /*
  * Invalid Modifier
  *
Signature · 1 line
2.17.1
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw
Quoted 9 lines · Daniel Vetter
Quoted 8 lines · Brian Starkey

In cases such as DRM_FORMAT_MOD_SAMSUNG_16_16_TILE, the modifier describes a generic pixel re-ordering which can be applicable to multiple vendors.

Define an alias: DRM_FORMAT_MOD_GENERIC_16_16_TILE, which can be used to describe this layout in a vendor-neutral way, and add a comment about the expected usage of such "generic" modifiers.

Quoted 6 lines
Quoted 4 lines

Changes in v2:
- Move note about future cases to comment (Daniel)

Thanks. I guess this should go into drm-misc-next? @Liviu would you be able to pick it up?

Cheers,
-Brian

Quoted 38 lines
Quoted 38 lines
---
 include/uapi/drm/drm_fourcc.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
include/uapi/drm/drm_fourcc.h +23 -0
index 299f9ac4840b..cb3db4a21012 100644
@@ -345,8 +345,33 @@ extern "C" {
  * When adding a new token please document the layout with a code comment,
  * similar to the fourcc codes above. drm_fourcc.h is considered the
  * authoritative source for all of these.
+ *
+ * Generic modifier names:
+ *
+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names
+ * for layouts which are common across multiple vendors. To preserve
+ * compatibility, in cases where a vendor-specific definition already exists and
+ * a generic name for it is desired, the common name is a purely symbolic alias
+ * and must use the same numerical value as the original definition.
+ *
+ * Note that generic names should only be used for modifiers which describe
+ * generic layouts (such as pixel re-ordering), which may have
+ * independently-developed support across multiple vendors.
+ *
+ * In future cases where a generic layout is identified before merging with a
+ * vendor-specific modifier, a new 'GENERIC' vendor or modifier using vendor
+ * 'NONE' could be considered. This should only be for obvious, exceptional
+ * cases to avoid polluting the 'GENERIC' namespace with modifiers which only
+ * apply to a single vendor.
+ *
+ * Generic names should not be used for cases where multiple hardware vendors
+ * have implementations of the same standardised compression scheme (such as
+ * AFBC). In those cases, all implementations should use the same format
+ * modifier(s), reflecting the vendor of the standard.
  */
 
Quoted 13 lines
Quoted 8 lines
include/uapi/drm/drm_fourcc.h +2 -0
+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE
+
 /*
  * Invalid Modifier
  *
Signature · 1 line
2.17.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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