History

drm: introduce pipe color correction properties

Patch based on a previous series by Shashank Sharma. This introduces optional properties to enable color correction at the pipe level. It relies on 3 transformations applied to every pixels displayed. First a lookup into a degamma table, then a multiplication of the rgb components by a 3x3 matrix and finally another lookup into a gamma table. The following properties can be added to a pipe : - DEGAMMA_LUT : blob containing degamma LUT - DEGAMMA_LUT_SIZE : number of elements in DEGAMMA_LUT - CTM : transformation matrix applied after the degamma LUT - GAMMA_LUT : blob containing gamma LUT - GAMMA_LUT_SIZE : number of elements in GAMMA_LUT DEGAMMA_LUT_SIZE and GAMMA_LUT_SIZE are read only properties, set by the driver to tell userspace applications what sizes should be the lookup tables in DEGAMMA_LUT and GAMMA_LUT. A helper is also provided so legacy gamma correction is redirected through these new properties. v2: Register LUT size properties as range v3: Fix round in drm_color_lut_get_value() helper More docs on how degamma/gamma properties are used v4: Update contributors v5: Rename CTM_MATRIX property to CTM (Doh!) Add legacy gamma_set atomic helper Describe CTM/LUT acronyms in the kernel doc v6: Fix missing blob unref in drm_atomic_helper_crtc_reset

Lionel Landwerlin committed 10 years ago

Commit 5488dc11 parent 9b8d1e59 files · +386 −6Browse files

Showing the changes to include/uapi (1 of 9 files). Show all

Unified · Split

include/uapi/drm/drm_mode.h+15−0
@@ -487,6 +487,21 @@ struct drm_mode_crtc_lut { · 486 unmodified lines
487487 __u64 blue;
488488 };
489489
490+struct drm_color_ctm {
491+ /* Conversion matrix in S31.32 format. */
492+ __s64 matrix[9];
493+};
494+
495+struct drm_color_lut {
496+ /*
497+ * Data is U0.16 fixed point format.
498+ */
499+ __u16 red;
500+ __u16 green;
501+ __u16 blue;
502+ __u16 reserved;
503+};
504+
490505 #define DRM_MODE_PAGE_FLIP_EVENT 0x01
491506 #define DRM_MODE_PAGE_FLIP_ASYNC 0x02
492507 #define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_PAGE_FLIP_ASYNC)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t