@@ -789,6 +789,13 @@ int drm_connector_create_standard_properties(struct drm_device *dev)
return -ENOMEM;
dev->mode_config.link_status_property = prop;
+ prop = drm_property_create(dev, DRM_MODE_PROP_BLOB,
+ "HDR_SOURCE_METADATA", 0);
+
+ if (!prop)
+ return -ENOMEM;
+ dev->mode_config.hdr_source_metadata_property = prop;
+
return 0;
}
@@ -342,6 +342,13 @@ struct drm_connector_state {
* upscaling, mostly used for built-in panels.
*/
unsigned int scaling_mode;
+
+ /**
+ * @metadata_blob_ptr:
+ * DRM blob property for HDR metadata
+ */
+ struct drm_property_blob *hdr_source_metadata_blob_ptr;
+ bool hdr_metadata_changed : 1;
};
/**
@@ -877,6 +884,10 @@ struct drm_connector {
uint8_t num_h_tile, num_v_tile;
uint8_t tile_h_loc, tile_v_loc;
uint16_t tile_h_size, tile_v_size;
+
+ /* HDR metdata */
+ struct hdr_static_metadata *hdr_panel_metadata;
+ struct hdr_static_metadata *hdr_source_metadata;
};
#define obj_to_connector(x) container_of(x, struct drm_connector, base)
@@ -741,6 +741,12 @@ struct drm_mode_config {
*/
struct drm_property *suggested_y_property;
+ /**
+ * hdr_metadata_property: Connector property containing hdr metatda
+ * This will be provided by userspace compositors based on HDR content
+ */
+ struct drm_property *hdr_source_metadata_property;
+
/* dumb ioctl parameters */
uint32_t preferred_depth, prefer_shadow;
@@ -590,6 +590,28 @@ struct drm_color_lut {
__u16 reserved;
};
+enum supported_eotf_type {
+ TRADITIONAL_GAMMA_SDR = 0,
+ TRADITIONA_GAMMA_HDR,
+ SMPTE_ST2084,
+ FUTURE_EOTF
+};
+
+/* HDR Metadata */
+struct hdr_static_metadata {
+ uint16_t eotf;
+ uint16_t type;
+ uint16_t display_primaries_x[3];
+ uint16_t display_primaries_y[3];
+ uint16_t white_point_x;
+ uint16_t white_point_y;
+ uint16_t max_mastering_display_luminance;
+ uint16_t min_mastering_display_luminance;
+ uint16_t max_fall;
+ uint16_t max_cll;
+ uint16_t min_cll;
+};
+
#define DRM_MODE_PAGE_FLIP_EVENT 0x01
#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
This patch adds a blob property to get HDR metadata information from userspace. This will be send as part of AVI Infoframe to panel. Signed-off-by: Uma Shankar <uma.shankar@intel.com> --- drivers/gpu/drm/drm_connector.c | 7 +++++++ include/drm/drm_connector.h | 11 +++++++++++ include/drm/drm_mode_config.h | 6 ++++++ include/uapi/drm/drm_mode.h | 22 ++++++++++++++++++++++ 4 files changed, 46 insertions(+)