History

drm/colorop: Add 3x4 CTM type

This type is used to support a 3x4 matrix in colorops. A 3x4 matrix uses the last column as a "bias" column. Some HW exposes support for 3x4. The calculation looks like: out matrix in |R| |0 1 2 3 | | R | |G| = |4 5 6 7 | x | G | |B| |8 9 10 11| | B | |1.0| This is also the first colorop where we need a blob property to program the property. For that we'll introduce a new DATA property that can be used by all colorop TYPEs requiring a blob. The way a DATA blob is read depends on the TYPE of the colorop. We only create the DATA property for property types that need it.

Harry Wentland committed 12 months ago

Commit e5719e71 parent cb500b46 files · +136 −10Browse files

Showing the changes to include/uapi (2 of 6 files). Show all

Unified · Split

2 files
  1. include/uapi/drm/amdgpu_drm.h +0 −9
  2. include/uapi/drm/drm_mode.h +31 −1
include/uapi/drm/amdgpu_drm.h+0−9
@@ -1656,15 +1656,6 @@ struct drm_amdgpu_info_uq_metadata { · 1655 unmodified lines
16561656 #define AMDGPU_FAMILY_GC_11_5_0 150 /* GC 11.5.0 */
16571657 #define AMDGPU_FAMILY_GC_12_0_0 152 /* GC 12.0.0 */
16581658
1659−/* FIXME wrong namespace! */
1660−struct drm_color_ctm_3x4 {
1661− /*
1662− * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
1663− * (not two's complement!) format.
1664− */
1665− __u64 matrix[12];
1666−};
1667−
16681659 #if defined(__cplusplus)
16691660 }
16701661 #endif
include/uapi/drm/drm_mode.h+31−1
@@ -847,6 +847,20 @@ struct drm_color_ctm { · 846 unmodified lines
847847 __u64 matrix[9];
848848 };
849849
850+struct drm_color_ctm_3x4 {
851+ /*
852+ * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
853+ * (not two's complement!) format.
854+ *
855+ * out matrix in
856+ * |R| |0 1 2 3 | | R |
857+ * |G| = |4 5 6 7 | x | G |
858+ * |B| |8 9 10 11| | B |
859+ * |1.0|
860+ */
861+ __u64 matrix[12];
862+};
863+
850864 struct drm_color_lut {
851865 /*
852866 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
@@ -874,7 +888,23 @@ enum drm_colorop_type { · 21 unmodified lines
874888 * A 1D curve that is being applied to all color channels. The
875889 * curve is specified via the CURVE_1D_TYPE colorop property.
876890 */
877− DRM_COLOROP_1D_CURVE
891+ DRM_COLOROP_1D_CURVE,
892+
893+ /**
894+ * @DRM_COLOROP_CTM_3X4:
895+ *
896+ * enum string "3x4 Matrix"
897+ *
898+ * A 3x4 matrix. Its values are specified via the
899+ * &drm_color_ctm_3x4 struct provided via the DATA property.
900+ *
901+ * The DATA blob is a float[12]:
902+ * out matrix in
903+ * | R | | 0 1 2 3 | | R |
904+ * | G | = | 4 5 6 7 | x | G |
905+ * | B | | 8 9 10 12 | | B |
906+ */
907+ DRM_COLOROP_CTM_3X4,
878908 };
879909
880910 /**