diff options
author | Uma Shankar <uma.shankar@intel.com> | 2017-05-31 15:40:49 +0530 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:30:42 +0800 |
commit | af2d22e048549209348986a5430acacb8520a275 (patch) | |
tree | fab44234f3b63c25251b81869f2ea8cd834e8656 | |
parent | c42c06bf1b60a00bc783be24df0f3c3e4f616ff2 (diff) |
drm: Add HDR source metadata property
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>
-rw-r--r-- | drivers/gpu/drm/drm_connector.c | 7 | ||||
-rw-r--r-- | include/drm/drm_connector.h | 11 | ||||
-rw-r--r-- | include/drm/drm_mode_config.h | 6 | ||||
-rw-r--r-- | include/uapi/drm/drm_mode.h | 22 |
4 files changed, 46 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 05a8ff64811b..1859d2a10c1c 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -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; } diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index e6cd11ee971f..851215f4ba3f 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -363,6 +363,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; }; /** @@ -905,6 +912,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) diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 1b37368416c8..0a2dfcf3a3c9 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -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; diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index fca3f6b7d1f3..d373bfb27abb 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -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 |