History

drm: Enable HDR infoframe support

Enable Dynamic Range and Mastering Infoframe for HDR content, which is defined in CEA 861.3 spec. The metadata will be computed based on blending policy in userspace compositors and passed as a connector property blob to driver. The same will be sent as infoframe to panel which support HDR. Added the const version of infoframe for DRM metadata for HDR. v2: Rebase and added Ville's POC changes. v3: No Change v4: Addressed Shashank's review comments and merged the patch making drm infoframe function arguments as constant. v5: Rebase v6: Fixed checkpatch warnings with --strict option. Addressed Shashank's review comments and added his RB. v7: Addressed Brian Starkey's review comments. Merged 2 patches into one. v8: Addressed Jonas Karlman review comments. v9: Addressed Jonas Karlman review comments. v10: Addressed Ville's review comments. v11: Added BUILD_BUG_ON and sizeof instead of magic numbers as per Ville's comments.

Uma Shankar committed 7 years ago

Commit 2cdbfd61 parent e85959d4 files · +295 −0Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/hdmi.h+28−0
@@ -47,6 +47,7 @@ enum hdmi_infoframe_type { · 46 unmodified lines
4747 HDMI_INFOFRAME_TYPE_AVI = 0x82,
4848 HDMI_INFOFRAME_TYPE_SPD = 0x83,
4949 HDMI_INFOFRAME_TYPE_AUDIO = 0x84,
50+ HDMI_INFOFRAME_TYPE_DRM = 0x87,
5051 };
5152
5253 #define HDMI_IEEE_OUI 0x000c03
@@ -55,6 +56,7 @@ enum hdmi_infoframe_type { · 2 unmodified lines
5556 #define HDMI_AVI_INFOFRAME_SIZE 13
5657 #define HDMI_SPD_INFOFRAME_SIZE 25
5758 #define HDMI_AUDIO_INFOFRAME_SIZE 10
59+#define HDMI_DRM_INFOFRAME_SIZE 26
5860
5961 #define HDMI_INFOFRAME_SIZE(type) \
6062 (HDMI_INFOFRAME_HEADER_SIZE + HDMI_ ## type ## _INFOFRAME_SIZE)
@@ -185,12 +187,37 @@ struct hdmi_avi_infoframe { · 124 unmodified lines
185187 unsigned short right_bar;
186188 };
187189
190+/* DRM Infoframe as per CTA 861.G spec */
191+struct hdmi_drm_infoframe {
192+ enum hdmi_infoframe_type type;
193+ unsigned char version;
194+ unsigned char length;
195+ enum hdmi_eotf eotf;
196+ enum hdmi_metadata_type metadata_type;
197+ struct {
198+ u16 x, y;
199+ } display_primaries[3];
200+ struct {
201+ u16 x, y;
202+ } white_point;
203+ u16 max_display_mastering_luminance;
204+ u16 min_display_mastering_luminance;
205+ u16 max_cll;
206+ u16 max_fall;
207+};
208+
188209 int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame);
189210 ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer,
190211 size_t size);
191212 ssize_t hdmi_avi_infoframe_pack_only(const struct hdmi_avi_infoframe *frame,
192213 void *buffer, size_t size);
193214 int hdmi_avi_infoframe_check(struct hdmi_avi_infoframe *frame);
215+int hdmi_drm_infoframe_init(struct hdmi_drm_infoframe *frame);
216+ssize_t hdmi_drm_infoframe_pack(struct hdmi_drm_infoframe *frame, void *buffer,
217+ size_t size);
218+ssize_t hdmi_drm_infoframe_pack_only(const struct hdmi_drm_infoframe *frame,
219+ void *buffer, size_t size);
220+int hdmi_drm_infoframe_check(struct hdmi_drm_infoframe *frame);
194221
195222 enum hdmi_spd_sdi {
196223 HDMI_SPD_SDI_UNKNOWN,
@@ -381,6 +408,7 @@ union hdmi_infoframe { · 184 unmodified lines
381408 struct hdmi_spd_infoframe spd;
382409 union hdmi_vendor_any_infoframe vendor;
383410 struct hdmi_audio_infoframe audio;
411+ struct hdmi_drm_infoframe drm;
384412 };
385413
386414 ssize_t hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer,

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