From patchwork Wed May 31 10:10:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Shankar, Uma" X-Patchwork-Id: 9756427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 17F7C602BF for ; Wed, 31 May 2017 09:37:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10D39269E2 for ; Wed, 31 May 2017 09:37:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0613928474; Wed, 31 May 2017 09:37:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 84082269E2 for ; Wed, 31 May 2017 09:37:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3FEBD6E1C6; Wed, 31 May 2017 09:37:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE7066E1BB; Wed, 31 May 2017 09:37:20 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 31 May 2017 02:37:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,422,1491289200"; d="scan'208";a="268419017" Received: from ubuntu-tc11.iind.intel.com ([10.223.26.127]) by fmsmga004.fm.intel.com with ESMTP; 31 May 2017 02:37:18 -0700 From: Uma Shankar To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [RFC 1/9] drm: Add HDR source metadata property Date: Wed, 31 May 2017 15:40:49 +0530 Message-Id: <1496225457-30514-2-git-send-email-uma.shankar@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1496225457-30514-1-git-send-email-uma.shankar@intel.com> References: <1496225457-30514-1-git-send-email-uma.shankar@intel.com> Cc: Uma Shankar X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 5cd61af..1b36fa2 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 d8bb25f..c99d737 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -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) diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 4298171..9ca49ea 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 403339f..920ea2a 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