Skip to contentSkip to conversation

drm/uapi: Move drm_color_ctm_3x4 out from drm_mode.h

PATCH In review Ville Syrjala 3 participants 4 messages Apr 22, 2024 – May 7, 2024

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

PATCH 1/1 drm/uapi: Move drm_color_ctm_3x4 out from drm_mode.h

From: Ville Syrjälä <[email protected]>

drm_color_ctm_3x4 is some undocumented amgdpu private uapi and thus has no business being in drm_mode.h. At least move it to some amdgpu specific header, albeit with the wrong namespace as maybe something somewhere is using this already?

Cc Harry Wentland <[email protected]>
Cc Joshua Ashton <[email protected]>
Cc Alex Deucher <[email protected]>
Fixes 6872a189be50 ("drm/amd/display: Add 3x4 CTM support for plane CTM")
---
 include/uapi/drm/amdgpu_drm.h | 9 +++++++++
 include/uapi/drm/drm_mode.h   | 8 --------
 2 files changed, 9 insertions(+), 8 deletions(-)
include/uapi/drm/amdgpu_drm.h +9 -0
index 96e32dafd4f0..d5ebafacdd70 100644
@@ -1269,6 +1269,15 @@ struct drm_amdgpu_info_gpuvm_fault {
 #define AMDGPU_FAMILY_GC_10_3_7			151 /* GC 10.3.7 */
 #define AMDGPU_FAMILY_GC_11_5_0			150 /* GC 11.5.0 */
 
+/* FIXME wrong namespace! */
+struct drm_color_ctm_3x4 {
+	/*
+	 * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
+	 * (not two's complement!) format.
+	 */
+	__u64 matrix[12];
+};
+
 #if defined(__cplusplus)
 }
 #endif
include/uapi/drm/drm_mode.h +0 -8
index 1ca5c7e418fd..d390011b89b4 100644
@@ -846,14 +846,6 @@ struct drm_color_ctm {
 	__u64 matrix[9];
 };
 
-struct drm_color_ctm_3x4 {
-	/*
-	 * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
-	 * (not two's complement!) format.
-	 */
-	__u64 matrix[12];
-};
-
 struct drm_color_lut {
 	/*
 	 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
Signature · 1 line
2.43.2
#1 lore raw
Quoted 5 lines · Ville Syrjala

drm_color_ctm_3x4 is some undocumented amgdpu private uapi and thus has no business being in drm_mode.h. At least move it to some amdgpu specific header, albeit with the wrong namespace as maybe something somewhere is using this already?

If something somewhere is using this already, I don't think the name matters? In other words, if there is a user, such user would be broken when moving the declaration anyways, so it shouldn't be more risky to do the rename as well?

I'm holding off the libdrm header update until we find a solution.

#2 lore raw
Quoted 8 lines · Simon Ser
Quoted 5 lines · Ville Syrjala

drm_color_ctm_3x4 is some undocumented amgdpu private uapi and thus has no business being in drm_mode.h. At least move it to some amdgpu specific header, albeit with the wrong namespace as maybe something somewhere is using this already?

Quoted 4 lines

If something somewhere is using this already, I don't think the name matters? In other words, if there is a user, such user would be broken when moving the declaration anyways, so it shouldn't be more risky to do the rename as well?

I suppose. Not something I want to have to think about though.

I've pushed this to drm-misc-next with Harry's rb (thanks).

Quoted 2 lines

I'm holding off the libdrm header update until we find a solution.

Signature · 2 lines
Ville Syrjälä
Intel
Reviewed-by on v1 1/1
#3 lore raw
In reply to Ville Syrjala
Quoted 8 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

drm_color_ctm_3x4 is some undocumented amgdpu private uapi and thus has no business being in drm_mode.h. At least move it to some amdgpu specific header, albeit with the wrong namespace as maybe something somewhere is using this already?

Quoted 5 lines
Cc Harry Wentland <[email protected]>
Cc Joshua Ashton <[email protected]>
Cc Alex Deucher <[email protected]>
Fixes 6872a189be50 ("drm/amd/display: Add 3x4 CTM support for plane CTM")

We'll bring this back with the color pipeline stuff but for now it doesn't need to sit in drm_mode.h and probably shouldn't.

Harry

Quoted 44 lines
---
 include/uapi/drm/amdgpu_drm.h | 9 +++++++++
 include/uapi/drm/drm_mode.h   | 8 --------
 2 files changed, 9 insertions(+), 8 deletions(-)
include/uapi/drm/amdgpu_drm.h +9 -0
index 96e32dafd4f0..d5ebafacdd70 100644
@@ -1269,6 +1269,15 @@ struct drm_amdgpu_info_gpuvm_fault {
 #define AMDGPU_FAMILY_GC_10_3_7			151 /* GC 10.3.7 */
 #define AMDGPU_FAMILY_GC_11_5_0			150 /* GC 11.5.0 */
 
+/* FIXME wrong namespace! */
+struct drm_color_ctm_3x4 {
+	/*
+	 * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
+	 * (not two's complement!) format.
+	 */
+	__u64 matrix[12];
+};
+
 #if defined(__cplusplus)
 }
 #endif
include/uapi/drm/drm_mode.h +0 -8
index 1ca5c7e418fd..d390011b89b4 100644
@@ -846,14 +846,6 @@ struct drm_color_ctm {
 	__u64 matrix[9];
 };
 
-struct drm_color_ctm_3x4 {
-	/*
-	 * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
-	 * (not two's complement!) format.
-	 */
-	__u64 matrix[12];
-};
-
 struct drm_color_lut {
 	/*
 	 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and