drm/uapi: The ctm matrix uses sign-magnitude representation
authorVille Syrjälä <[email protected]>
Thu, 22 Feb 2018 21:42:29 +0000 (23:42 +0200)
committerVille Syrjälä <[email protected]>
Wed, 28 Feb 2018 11:27:37 +0000 (13:27 +0200)
The documentation for the ctm matrix suggests a two's complement
format, but at least the i915 implementation is using sign-magnitude
instead. And looks like malidp is doing the same. Change the docs
to match the current implementation, and change the type from __s64
to __u64 to drive the point home.

Cc: [email protected]
Cc: Mihail Atanassov <[email protected]>
Cc: Liviu Dudau <[email protected]>
Cc: Brian Starkey <[email protected]>
Cc: Mali DP Maintainers <[email protected]>
Cc: Johnson Lin <[email protected]>
Cc: Uma Shankar <[email protected]>
Cc: Shashank Sharma <[email protected]>
Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Harry Wentland <[email protected]>
include/uapi/drm/drm_mode.h

index 2c575794fb5275fc294fa05aacd6fc7c32a5ccac..b5d7d9e0eff59a7b418cdb485349ddd9e0fce9a5 100644 (file)
@@ -598,8 +598,11 @@ struct drm_mode_crtc_lut {
 };
 
 struct drm_color_ctm {
-       /* Conversion matrix in S31.32 format. */
-       __s64 matrix[9];
+       /*
+        * Conversion matrix in S31.32 sign-magnitude
+        * (not two's complement!) format.
+        */
+       __u64 matrix[9];
 };
 
 struct drm_color_lut {