From patchwork Sun May 26 21:19:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 10961893 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2F5076 for ; Sun, 26 May 2019 21:19:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D13DF28A61 for ; Sun, 26 May 2019 21:19:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C38B228A99; Sun, 26 May 2019 21:19:52 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham 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 CA8E728A61 for ; Sun, 26 May 2019 21:19:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 781B7896B5; Sun, 26 May 2019 21:19:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-oln040092072077.outbound.protection.outlook.com [40.92.72.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A359896B5 for ; Sun, 26 May 2019 21:19:49 +0000 (UTC) Received: from VE1EUR03FT043.eop-EUR03.prod.protection.outlook.com (10.152.18.52) by VE1EUR03HT184.eop-EUR03.prod.protection.outlook.com (10.152.18.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.16; Sun, 26 May 2019 21:19:46 +0000 Received: from VI1PR03MB4206.eurprd03.prod.outlook.com (10.152.18.55) by VE1EUR03FT043.mail.protection.outlook.com (10.152.19.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.16 via Frontend Transport; Sun, 26 May 2019 21:19:46 +0000 Received: from VI1PR03MB4206.eurprd03.prod.outlook.com ([fe80::883e:1bd6:cd36:5fb0]) by VI1PR03MB4206.eurprd03.prod.outlook.com ([fe80::883e:1bd6:cd36:5fb0%4]) with mapi id 15.20.1922.021; Sun, 26 May 2019 21:19:46 +0000 From: Jonas Karlman To: "a.hajda@samsung.com" , "Laurent.pinchart@ideasonboard.com" Subject: [PATCH 1/4] drm/bridge: dw-hdmi: Add Dynamic Range and Mastering InfoFrame support Thread-Topic: [PATCH 1/4] drm/bridge: dw-hdmi: Add Dynamic Range and Mastering InfoFrame support Thread-Index: AQHVFAi+bMX8KDMhsEODZVlwe6TWsA== Date: Sun, 26 May 2019 21:19:46 +0000 Message-ID: References: In-Reply-To: Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM7PR02CA0014.eurprd02.prod.outlook.com (2603:10a6:20b:100::24) To VI1PR03MB4206.eurprd03.prod.outlook.com (2603:10a6:803:51::23) x-incomingtopheadermarker: OriginalChecksum:F4673428B8702CD5B4FDC18166DD8CDBBBE57718B6F22C4E8172C6FFB5C87EDF; UpperCasedChecksum:71A224F684E2C6D9C95EE98B45D33838F4F4AABD22974E42763CE92EC01DCD8C; SizeAsReceived:8145; Count:50 x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-tmn: [1+3nGgHdzByApBwwlfaHnJID84R4u+12] x-microsoft-original-message-id: <20190526211934.31882-1-jonas@kwiboo.se> x-ms-publictraffictype: Email x-incomingheadercount: 50 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322404)(2017031323274)(2017031324274)(1601125500)(1603101475)(1701031045); SRVR:VE1EUR03HT184; x-ms-traffictypediagnostic: VE1EUR03HT184: x-ms-exchange-purlcount: 2 x-microsoft-antispam-message-info: RZ/FvVXUTJunCZmB0UzlvuuAgQwZjTkfOFpGVOPIKUoOanmx6QovKzIpoXZVh9m8xcdz9wpSKBaUxcNP2ztuq5PHKHD6ixzsoOTTmGIK0h6ZS3N9F49mW0e+sdWV2f8ypBZqigcp3h0SyHGmM7/h/hriEohWVvFIJE1Z7u4iSE8+kW9UQMJ0E33XITg9Yt0i MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 66a06096-0908-4890-4db7-08d6e21fe0d3 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2019 21:19:46.7859 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR03HT184 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "jernej.skrabec@siol.net" , "narmstrong@baylibre.com" , "maxime.ripard@bootlin.com" , "khilman@baylibre.com" , Jonas Karlman , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "wens@csie.org" , "zhengyang@rock-chips.com" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add support for configuring Dynamic Range and Mastering InfoFrame from the hdr_output_metadata connector property. This patch adds a drm_infoframe flag to dw_hdmi_plat_data that platform drivers use to signal when Dynamic Range and Mastering infoframes is supported. This flag is needed because Amlogic GXBB and GXL report same DW-HDMI version, and only GXL support DRM InfoFrame. These changes were based on work done by Zheng Yang to support DRM InfoFrame on the Rockchip 4.4 BSP kernel at [1] and [2] [1] https://github.com/rockchip-linux/kernel/tree/develop-4.4 [2] https://github.com/rockchip-linux/kernel/commit/d1943fde81ff41d7cca87f4a42f03992e90bddd5 Cc: Zheng Yang Signed-off-by: Jonas Karlman Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 109 ++++++++++++++++++++++ drivers/gpu/drm/bridge/synopsys/dw-hdmi.h | 37 ++++++++ include/drm/bridge/dw_hdmi.h | 1 + 3 files changed, 147 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 284ce59be8f8..801bbbd732fd 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -1592,6 +1593,78 @@ static void hdmi_config_vendor_specific_infoframe(struct dw_hdmi *hdmi, HDMI_FC_DATAUTO0_VSD_MASK); } +#define HDR_LSB(n) ((n) & 0xff) +#define HDR_MSB(n) (((n) & 0xff00) >> 8) + +static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi) +{ + const struct drm_connector_state *conn_state = hdmi->connector.state; + struct hdmi_drm_infoframe frame; + int ret; + + if (hdmi->version < 0x200a || !hdmi->plat_data->drm_infoframe) + return; + + hdmi_modb(hdmi, HDMI_FC_PACKET_TX_EN_DRM_DISABLE, + HDMI_FC_PACKET_TX_EN_DRM_MASK, HDMI_FC_PACKET_TX_EN); + + ret = drm_hdmi_infoframe_set_hdr_metadata(&frame, conn_state); + if (ret < 0) + return; + + ret = hdmi_drm_infoframe_check(&frame); + if (WARN_ON(ret)) + return; + + hdmi_writeb(hdmi, frame.version, HDMI_FC_DRM_HB0); + hdmi_writeb(hdmi, frame.length, HDMI_FC_DRM_HB1); + hdmi_writeb(hdmi, frame.eotf, HDMI_FC_DRM_PB0); + hdmi_writeb(hdmi, frame.metadata_type, HDMI_FC_DRM_PB1); + hdmi_writeb(hdmi, HDR_LSB(frame.display_primaries[0].x), + HDMI_FC_DRM_PB2); + hdmi_writeb(hdmi, HDR_MSB(frame.display_primaries[0].x), + HDMI_FC_DRM_PB3); + hdmi_writeb(hdmi, HDR_LSB(frame.display_primaries[0].y), + HDMI_FC_DRM_PB4); + hdmi_writeb(hdmi, HDR_MSB(frame.display_primaries[0].y), + HDMI_FC_DRM_PB5); + hdmi_writeb(hdmi, HDR_LSB(frame.display_primaries[1].x), + HDMI_FC_DRM_PB6); + hdmi_writeb(hdmi, HDR_MSB(frame.display_primaries[1].x), + HDMI_FC_DRM_PB7); + hdmi_writeb(hdmi, HDR_LSB(frame.display_primaries[1].y), + HDMI_FC_DRM_PB8); + hdmi_writeb(hdmi, HDR_MSB(frame.display_primaries[1].y), + HDMI_FC_DRM_PB9); + hdmi_writeb(hdmi, HDR_LSB(frame.display_primaries[2].x), + HDMI_FC_DRM_PB10); + hdmi_writeb(hdmi, HDR_MSB(frame.display_primaries[2].x), + HDMI_FC_DRM_PB11); + hdmi_writeb(hdmi, HDR_LSB(frame.display_primaries[2].y), + HDMI_FC_DRM_PB12); + hdmi_writeb(hdmi, HDR_MSB(frame.display_primaries[2].y), + HDMI_FC_DRM_PB13); + hdmi_writeb(hdmi, HDR_LSB(frame.white_point.x), HDMI_FC_DRM_PB14); + hdmi_writeb(hdmi, HDR_MSB(frame.white_point.x), HDMI_FC_DRM_PB15); + hdmi_writeb(hdmi, HDR_LSB(frame.white_point.y), HDMI_FC_DRM_PB16); + hdmi_writeb(hdmi, HDR_MSB(frame.white_point.y), HDMI_FC_DRM_PB17); + hdmi_writeb(hdmi, HDR_LSB(frame.max_display_mastering_luminance), + HDMI_FC_DRM_PB18); + hdmi_writeb(hdmi, HDR_MSB(frame.max_display_mastering_luminance), + HDMI_FC_DRM_PB19); + hdmi_writeb(hdmi, HDR_LSB(frame.min_display_mastering_luminance), + HDMI_FC_DRM_PB20); + hdmi_writeb(hdmi, HDR_MSB(frame.min_display_mastering_luminance), + HDMI_FC_DRM_PB21); + hdmi_writeb(hdmi, HDR_LSB(frame.max_cll), HDMI_FC_DRM_PB22); + hdmi_writeb(hdmi, HDR_MSB(frame.max_cll), HDMI_FC_DRM_PB23); + hdmi_writeb(hdmi, HDR_LSB(frame.max_fall), HDMI_FC_DRM_PB24); + hdmi_writeb(hdmi, HDR_MSB(frame.max_fall), HDMI_FC_DRM_PB25); + hdmi_writeb(hdmi, 1, HDMI_FC_DRM_UP); + hdmi_modb(hdmi, HDMI_FC_PACKET_TX_EN_DRM_ENABLE, + HDMI_FC_PACKET_TX_EN_DRM_MASK, HDMI_FC_PACKET_TX_EN); +} + static void hdmi_av_composer(struct dw_hdmi *hdmi, const struct drm_display_mode *mode) { @@ -1963,6 +2036,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode) /* HDMI Initialization Step F - Configure AVI InfoFrame */ hdmi_config_AVI(hdmi, mode); hdmi_config_vendor_specific_infoframe(hdmi, mode); + hdmi_config_drm_infoframe(hdmi); } else { dev_dbg(hdmi->dev, "%s DVI mode\n", __func__); } @@ -2139,6 +2213,36 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector) return ret; } +static bool blob_equal(const struct drm_property_blob *a, + const struct drm_property_blob *b) +{ + if (a && b) + return a->length == b->length && + !memcmp(a->data, b->data, a->length); + + return !a == !b; +} + +static int dw_hdmi_connector_atomic_check(struct drm_connector *conn, + struct drm_connector_state *new_state) +{ + struct drm_connector_state *old_state = + drm_atomic_get_old_connector_state(new_state->state, conn); + struct drm_crtc_state *crtc_state; + + if (!new_state->crtc) + return 0; + + crtc_state = drm_atomic_get_new_crtc_state(new_state->state, + new_state->crtc); + + if (!blob_equal(new_state->hdr_output_metadata, + old_state->hdr_output_metadata)) + crtc_state->mode_changed = true; + + return 0; +} + static void dw_hdmi_connector_force(struct drm_connector *connector) { struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, @@ -2163,6 +2267,7 @@ static const struct drm_connector_funcs dw_hdmi_connector_funcs = { static const struct drm_connector_helper_funcs dw_hdmi_connector_helper_funcs = { .get_modes = dw_hdmi_connector_get_modes, + .atomic_check = dw_hdmi_connector_atomic_check, }; static int dw_hdmi_bridge_attach(struct drm_bridge *bridge) @@ -2179,6 +2284,10 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge) drm_connector_init(bridge->dev, connector, &dw_hdmi_connector_funcs, DRM_MODE_CONNECTOR_HDMIA); + if (hdmi->version >= 0x200a && hdmi->plat_data->drm_infoframe) + drm_object_attach_property(&connector->base, + connector->dev->mode_config.hdr_output_metadata_property, 0); + drm_connector_attach_encoder(connector, encoder); return 0; diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h index 3f3c616eba97..d4efbec14f68 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.h @@ -256,6 +256,7 @@ #define HDMI_FC_POL2 0x10DB #define HDMI_FC_PRCONF 0x10E0 #define HDMI_FC_SCRAMBLER_CTRL 0x10E1 +#define HDMI_FC_PACKET_TX_EN 0x10E3 #define HDMI_FC_GMD_STAT 0x1100 #define HDMI_FC_GMD_EN 0x1101 @@ -291,6 +292,37 @@ #define HDMI_FC_GMD_PB26 0x111F #define HDMI_FC_GMD_PB27 0x1120 +#define HDMI_FC_DRM_UP 0x1167 +#define HDMI_FC_DRM_HB0 0x1168 +#define HDMI_FC_DRM_HB1 0x1169 +#define HDMI_FC_DRM_PB0 0x116A +#define HDMI_FC_DRM_PB1 0x116B +#define HDMI_FC_DRM_PB2 0x116C +#define HDMI_FC_DRM_PB3 0x116D +#define HDMI_FC_DRM_PB4 0x116E +#define HDMI_FC_DRM_PB5 0x116F +#define HDMI_FC_DRM_PB6 0x1170 +#define HDMI_FC_DRM_PB7 0x1171 +#define HDMI_FC_DRM_PB8 0x1172 +#define HDMI_FC_DRM_PB9 0x1173 +#define HDMI_FC_DRM_PB10 0x1174 +#define HDMI_FC_DRM_PB11 0x1175 +#define HDMI_FC_DRM_PB12 0x1176 +#define HDMI_FC_DRM_PB13 0x1177 +#define HDMI_FC_DRM_PB14 0x1178 +#define HDMI_FC_DRM_PB15 0x1179 +#define HDMI_FC_DRM_PB16 0x117A +#define HDMI_FC_DRM_PB17 0x117B +#define HDMI_FC_DRM_PB18 0x117C +#define HDMI_FC_DRM_PB19 0x117D +#define HDMI_FC_DRM_PB20 0x117E +#define HDMI_FC_DRM_PB21 0x117F +#define HDMI_FC_DRM_PB22 0x1180 +#define HDMI_FC_DRM_PB23 0x1181 +#define HDMI_FC_DRM_PB24 0x1182 +#define HDMI_FC_DRM_PB25 0x1183 +#define HDMI_FC_DRM_PB26 0x1184 + #define HDMI_FC_DBGFORCE 0x1200 #define HDMI_FC_DBGAUD0CH0 0x1201 #define HDMI_FC_DBGAUD1CH0 0x1202 @@ -746,6 +778,11 @@ enum { HDMI_FC_PRCONF_OUTPUT_PR_FACTOR_MASK = 0x0F, HDMI_FC_PRCONF_OUTPUT_PR_FACTOR_OFFSET = 0, +/* FC_PACKET_TX_EN field values */ + HDMI_FC_PACKET_TX_EN_DRM_MASK = 0x80, + HDMI_FC_PACKET_TX_EN_DRM_ENABLE = 0x80, + HDMI_FC_PACKET_TX_EN_DRM_DISABLE = 0x00, + /* FC_AVICONF0-FC_AVICONF3 field values */ HDMI_FC_AVICONF0_PIX_FMT_MASK = 0x03, HDMI_FC_AVICONF0_PIX_FMT_RGB = 0x00, diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index 0f0e82638fbe..04d1ec60f218 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -131,6 +131,7 @@ struct dw_hdmi_plat_data { unsigned long input_bus_format; unsigned long input_bus_encoding; bool ycbcr_420_allowed; + bool drm_infoframe; /* Vendor PHY support */ const struct dw_hdmi_phy_ops *phy_ops; From patchwork Sun May 26 21:20:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 10961895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A44F6912 for ; Sun, 26 May 2019 21:20:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FC3126E78 for ; Sun, 26 May 2019 21:20:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D3B2287CB; Sun, 26 May 2019 21:20:13 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham 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 1E40526E78 for ; Sun, 26 May 2019 21:20:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3EEE1897F0; Sun, 26 May 2019 21:20:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-oln040092070048.outbound.protection.outlook.com [40.92.70.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 92789897F0 for ; Sun, 26 May 2019 21:20:07 +0000 (UTC) Received: from VE1EUR03FT043.eop-EUR03.prod.protection.outlook.com (10.152.18.59) by VE1EUR03HT097.eop-EUR03.prod.protection.outlook.com (10.152.19.239) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.16; Sun, 26 May 2019 21:20:05 +0000 Received: from VI1PR03MB4206.eurprd03.prod.outlook.com (10.152.18.55) by VE1EUR03FT043.mail.protection.outlook.com (10.152.19.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.16 via Frontend Transport; Sun, 26 May 2019 21:20:05 +0000 Received: from VI1PR03MB4206.eurprd03.prod.outlook.com ([fe80::883e:1bd6:cd36:5fb0]) by VI1PR03MB4206.eurprd03.prod.outlook.com ([fe80::883e:1bd6:cd36:5fb0%4]) with mapi id 15.20.1922.021; Sun, 26 May 2019 21:20:05 +0000 From: Jonas Karlman To: "a.hajda@samsung.com" , "Laurent.pinchart@ideasonboard.com" Subject: [PATCH 2/4] drm/rockchip: Enable DRM InfoFrame support on RK3328 and RK3399 Thread-Topic: [PATCH 2/4] drm/rockchip: Enable DRM InfoFrame support on RK3328 and RK3399 Thread-Index: AQHVFAjJPuRdg1EVp0Kx4o5U/y99+A== Date: Sun, 26 May 2019 21:20:05 +0000 Message-ID: References: In-Reply-To: Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0019.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::29) To VI1PR03MB4206.eurprd03.prod.outlook.com (2603:10a6:803:51::23) x-incomingtopheadermarker: OriginalChecksum:2F9F864FFCCD18FEB82CD8CE03ED9C81B70E449B994933EE67F2C1E3545D9379; UpperCasedChecksum:B7EF89375F1E3B7E4FC9FFC33B9C9C28F0E10F88B54E27966938B966C93A7B84; SizeAsReceived:8123; Count:50 x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-tmn: [AWzaq9EL1xXMxZ6bhr9jhEiwqzG1hkEr] x-microsoft-original-message-id: <20190526211954.31938-1-jonas@kwiboo.se> x-ms-publictraffictype: Email x-incomingheadercount: 50 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045); SRVR:VE1EUR03HT097; x-ms-traffictypediagnostic: VE1EUR03HT097: x-microsoft-antispam-message-info: MMDAyrF7XEnELdmqEZ7is35MB6Ef37uM4MABUUhEdqSY23p7lrqr8HNNHLa0N/ghA59EYLVKKhotYcJPU+8Rz2/ITpbCv+KY0B3kJsXJiP1OcPdyoRQqyssFAZBDiOobXswfjEmbNOspqZ7VJbWqbB73DCtkzniD1V79mIJ4ShSzXvw2AwjDpz5kjaE1l3tB MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 739633f3-2928-4fc0-32c8-08d6e21febc2 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2019 21:20:05.1227 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR03HT097 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "jernej.skrabec@siol.net" , "narmstrong@baylibre.com" , "maxime.ripard@bootlin.com" , "khilman@baylibre.com" , Jonas Karlman , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "wens@csie.org" , "zhengyang@rock-chips.com" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch enables Dynamic Range and Mastering InfoFrame on RK3328 and RK3399. Cc: Sandy Huang Cc: Heiko Stuebner Signed-off-by: Jonas Karlman Reviewed-by: Heiko Stuebner Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 4cdc9f86c2e5..1f31f3726f04 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -405,6 +405,7 @@ static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = { .phy_ops = &rk3328_hdmi_phy_ops, .phy_name = "inno_dw_hdmi_phy2", .phy_force_vendor = true, + .drm_infoframe = true, }; static struct rockchip_hdmi_chip_data rk3399_chip_data = { @@ -419,6 +420,7 @@ static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data = { .cur_ctr = rockchip_cur_ctr, .phy_config = rockchip_phy_config, .phy_data = &rk3399_chip_data, + .drm_infoframe = true, }; static const struct of_device_id dw_hdmi_rockchip_dt_ids[] = { From patchwork Sun May 26 21:20:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 10961897 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3EEEE76 for ; Sun, 26 May 2019 21:20:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F696288EE for ; Sun, 26 May 2019 21:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20F312892A; Sun, 26 May 2019 21:20:26 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham 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 C839D288EE for ; Sun, 26 May 2019 21:20:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 14F96897FB; Sun, 26 May 2019 21:20:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03olkn082b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe09::82b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D450897FB for ; Sun, 26 May 2019 21:20:23 +0000 (UTC) Received: from VE1EUR03FT043.eop-EUR03.prod.protection.outlook.com (10.152.18.53) by VE1EUR03HT092.eop-EUR03.prod.protection.outlook.com (10.152.19.175) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.16; Sun, 26 May 2019 21:20:21 +0000 Received: from VI1PR03MB4206.eurprd03.prod.outlook.com (10.152.18.55) by VE1EUR03FT043.mail.protection.outlook.com (10.152.19.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.16 via Frontend Transport; Sun, 26 May 2019 21:20:21 +0000 Received: from VI1PR03MB4206.eurprd03.prod.outlook.com ([fe80::883e:1bd6:cd36:5fb0]) by VI1PR03MB4206.eurprd03.prod.outlook.com ([fe80::883e:1bd6:cd36:5fb0%4]) with mapi id 15.20.1922.021; Sun, 26 May 2019 21:20:21 +0000 From: Jonas Karlman To: "a.hajda@samsung.com" , "Laurent.pinchart@ideasonboard.com" Subject: [PATCH 3/4] drm/meson: Enable DRM InfoFrame support on GXL, GXM and G12A Thread-Topic: [PATCH 3/4] drm/meson: Enable DRM InfoFrame support on GXL, GXM and G12A Thread-Index: AQHVFAjTiBUVlVzg0Ey27UDn0LdoFg== Date: Sun, 26 May 2019 21:20:21 +0000 Message-ID: References: In-Reply-To: Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P194CA0016.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::26) To VI1PR03MB4206.eurprd03.prod.outlook.com (2603:10a6:803:51::23) x-incomingtopheadermarker: OriginalChecksum:B4F359A41AA2A6E855DFAB7927CCB6099252EB3CFAD3B62BAA21F8BAB040625C; UpperCasedChecksum:2FD75F5FEF2A62BCE2C7C2D69009653194286B004FD6F074AB58A1761D1CA78F; SizeAsReceived:8121; Count:50 x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-tmn: [khpGtoKFcGyh6rGSRWTft7uY3QUY3+Ok] x-microsoft-original-message-id: <20190526212012.31994-1-jonas@kwiboo.se> x-ms-publictraffictype: Email x-incomingheadercount: 50 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045); SRVR:VE1EUR03HT092; x-ms-traffictypediagnostic: VE1EUR03HT092: x-microsoft-antispam-message-info: 5chgj3XDhLQKiSPmioevvDxbwXfCvotxovdABLndbYScaY/rb9Hw4XXO56c4OfAMipNAXom1gfoWJ8m9Mect00n4P98vYl7ZyaSJlbAudsm3CiHtlHydQUWN+9y9Iv+2rM4gM5X3Axf2ECb7iNhD2LtRtzW2/WbsvVGKsy1tr2mKAYlDlWZLSccWVV2i7PLI MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 155994aa-743c-4a9a-9b32-08d6e21ff54d X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2019 21:20:21.0459 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR03HT092 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "jernej.skrabec@siol.net" , "narmstrong@baylibre.com" , "maxime.ripard@bootlin.com" , "khilman@baylibre.com" , Jonas Karlman , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "wens@csie.org" , "zhengyang@rock-chips.com" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch enables Dynamic Range and Mastering InfoFrame on GXL, GXM and G12A. Cc: Neil Armstrong Signed-off-by: Jonas Karlman Reviewed-by: Neil Armstrong --- drivers/gpu/drm/meson/meson_dw_hdmi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c index df3f9ddd2234..f7761e698c03 100644 --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c @@ -966,6 +966,11 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master, dw_plat_data->input_bus_format = MEDIA_BUS_FMT_YUV8_1X24; dw_plat_data->input_bus_encoding = V4L2_YCBCR_ENC_709; + if (dw_hdmi_is_compatible(meson_dw_hdmi, "amlogic,meson-gxl-dw-hdmi") || + dw_hdmi_is_compatible(meson_dw_hdmi, "amlogic,meson-gxm-dw-hdmi") || + dw_hdmi_is_compatible(meson_dw_hdmi, "amlogic,meson-g12a-dw-hdmi")) + dw_plat_data->drm_infoframe = true; + platform_set_drvdata(pdev, meson_dw_hdmi); meson_dw_hdmi->hdmi = dw_hdmi_bind(pdev, encoder, From patchwork Sun May 26 21:20:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 10961899 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84A80912 for ; Sun, 26 May 2019 21:20:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CA8528924 for ; Sun, 26 May 2019 21:20:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C8EA28A22; Sun, 26 May 2019 21:20:44 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham 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 D6AC828924 for ; Sun, 26 May 2019 21:20:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0EC2789733; Sun, 26 May 2019 21:20:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067051.outbound.protection.outlook.com [40.92.67.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3FC2389733 for ; Sun, 26 May 2019 21:20:41 +0000 (UTC) Received: from VE1EUR02FT016.eop-EUR02.prod.protection.outlook.com (10.152.12.57) by VE1EUR02HT120.eop-EUR02.prod.protection.outlook.com (10.152.13.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.16; Sun, 26 May 2019 21:20:39 +0000 Received: from VI1PR03MB4206.eurprd03.prod.outlook.com (10.152.12.55) by VE1EUR02FT016.mail.protection.outlook.com (10.152.12.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.16 via Frontend Transport; Sun, 26 May 2019 21:20:39 +0000 Received: from VI1PR03MB4206.eurprd03.prod.outlook.com ([fe80::883e:1bd6:cd36:5fb0]) by VI1PR03MB4206.eurprd03.prod.outlook.com ([fe80::883e:1bd6:cd36:5fb0%4]) with mapi id 15.20.1922.021; Sun, 26 May 2019 21:20:39 +0000 From: Jonas Karlman To: "a.hajda@samsung.com" , "Laurent.pinchart@ideasonboard.com" Subject: [PATCH 4/4] drm/sun4i: Enable DRM InfoFrame support on H6 Thread-Topic: [PATCH 4/4] drm/sun4i: Enable DRM InfoFrame support on H6 Thread-Index: AQHVFAjd+8FRSaD9s06/eG9Vpeitjg== Date: Sun, 26 May 2019 21:20:38 +0000 Message-ID: References: In-Reply-To: Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR0202CA0018.eurprd02.prod.outlook.com (2603:10a6:209:15::31) To VI1PR03MB4206.eurprd03.prod.outlook.com (2603:10a6:803:51::23) x-incomingtopheadermarker: OriginalChecksum:39FDC37F0D6079638BEBDC4B6495A92E1FFE3068C06548128ADA719A139E386A; UpperCasedChecksum:4E0C77E1B0E4F7AB2251787617D700249A49BF8898BC910E9254900F4B98C5D3; SizeAsReceived:8091; Count:50 x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-tmn: [vP+N9OTlA2i0XOtrhUj0j49BqiSlFZhC] x-microsoft-original-message-id: <20190526212029.32049-1-jonas@kwiboo.se> x-ms-publictraffictype: Email x-incomingheadercount: 50 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322404)(2017031323274)(2017031324274)(1601125500)(1603101475)(1701031045); SRVR:VE1EUR02HT120; x-ms-traffictypediagnostic: VE1EUR02HT120: x-microsoft-antispam-message-info: DwfEtM1U/LPIbKulFrNml/1YpEh91v8Yy9Ye7COkwcN+pVsIcdgZhftt/zFcdBRoTmkPvZUz28+oGrRZbewv6NAxrRlEO1AaVpF4WxCNEfGOQuyHqFCLFSeDGNFjZ2zwnzirnuG96JrSR6WEQhjyhQKID4stVttn6wzzxQFdf2voWHovyFvgLrstyz4P8otF MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: e1f35009-a6f0-4b72-2d11-08d6e21ffff8 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2019 21:20:38.9439 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT120 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "jernej.skrabec@siol.net" , "narmstrong@baylibre.com" , "maxime.ripard@bootlin.com" , "khilman@baylibre.com" , Jonas Karlman , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "wens@csie.org" , "zhengyang@rock-chips.com" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch enables Dynamic Range and Mastering InfoFrame on H6. Cc: Maxime Ripard Cc: Jernej Skrabec Signed-off-by: Jonas Karlman Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 2 ++ drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c index 39d8509d96a0..b80164dd8ad8 100644 --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c @@ -189,6 +189,7 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master, sun8i_hdmi_phy_init(hdmi->phy); plat_data->mode_valid = hdmi->quirks->mode_valid; + plat_data->drm_infoframe = hdmi->quirks->drm_infoframe; sun8i_hdmi_phy_set_ops(hdmi->phy, plat_data); platform_set_drvdata(pdev, hdmi); @@ -255,6 +256,7 @@ static const struct sun8i_dw_hdmi_quirks sun8i_a83t_quirks = { static const struct sun8i_dw_hdmi_quirks sun50i_h6_quirks = { .mode_valid = sun8i_dw_hdmi_mode_valid_h6, + .drm_infoframe = true, }; static const struct of_device_id sun8i_dw_hdmi_dt_ids[] = { diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h index 720c5aa8adc1..2a0ec08ee236 100644 --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h @@ -178,6 +178,7 @@ struct sun8i_dw_hdmi_quirks { enum drm_mode_status (*mode_valid)(struct drm_connector *connector, const struct drm_display_mode *mode); unsigned int set_rate : 1; + unsigned int drm_infoframe : 1; }; struct sun8i_dw_hdmi {