Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp281789pxa; Wed, 12 Aug 2020 01:37:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyogzZo3X0TOUSgn1TvxPwM8wcsEDt7Q9+12DBOwbQYWHDhXVrp0+6C2Mnz4hH9r/ZsVVtd X-Received: by 2002:a17:906:68e:: with SMTP id u14mr31939880ejb.166.1597221464750; Wed, 12 Aug 2020 01:37:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597221464; cv=none; d=google.com; s=arc-20160816; b=EZTDBjDC1+g15wykajqL0JdSkJ/fLSp897FlqQMG2h9JHJmI4szOeRcpKaAHuemZ2W RwvxMjFs61T1XzCFzcC/P/Sh4E9zbsHBykB0hC5Rp4mKOf+fD057RuwwgHogG3ukULCu YkA9dhWj6AxhtkopXnSyXLJ8ysB4jdl7GddDCJsvuRrMDI/YwBPrbgUaPwC+3V9XULwD xBKSg438QoV/Q/SIHnnq9JrmYe6zMFgPrk++6sWnSeSFXKAKgp2yH19WZD5gFGF+WICj xL/P66089cMCPB/Zo/CGtZb10uhgHUHSPyylkLBrAL9kS39MBNt+U9QQK3qGjdqnFlaG vl/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=mHyHByyyCCBW3OhnHmuRKomCjd/sKB5Y/Tz4jwZ3E7c=; b=EHeyzVlaDyVRZAOKmoOVDwALjRcoWyhhi4ldWUPRp5W73ycaiQUos6luWu0ZLbAEVd QRnksfUfrPShEmUPncNqFQHjcAyRw0P4G4uZXk29wgUcmKfLOaDtrZbilmUpzMEVgi9T y8Xhz+DEX55trdbt1t9s/eZqHLBGGoW4xvxfLZLLuBJR4GTJcWgnbZReQh90VkEZ+5yc kIXGeauTCFbcNCRGcKyZUxJRYVzvW89vH/Brcq84pyzwwZCZTlejVfzMNe/8zxpIp5Ri HQmHgKy0eW8ic2SfFQpdIGmogbIzVvq68IZs0mzpKFJtwRZIQ00OdOK9M4lG3BzS/xsM GGKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y24si790213eds.240.2020.08.12.01.37.22; Wed, 12 Aug 2020 01:37:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726965AbgHLIgm (ORCPT + 99 others); Wed, 12 Aug 2020 04:36:42 -0400 Received: from lucky1.263xmail.com ([211.157.147.134]:57902 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbgHLIgm (ORCPT ); Wed, 12 Aug 2020 04:36:42 -0400 Received: from localhost (unknown [192.168.167.16]) by lucky1.263xmail.com (Postfix) with ESMTP id EEF85C0E68; Wed, 12 Aug 2020 16:36:37 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED: 0 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [103.29.142.67]) by smtp.263.net (postfix) whith ESMTP id P18983T140547182274304S1597221393900250_; Wed, 12 Aug 2020 16:36:38 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <4de425ab9edd523934713eb06a4f3632> X-RL-SENDER: algea.cao@rock-chips.com X-SENDER: algea.cao@rock-chips.com X-LOGIN-NAME: algea.cao@rock-chips.com X-FST-TO: a.hajda@samsung.com X-SENDER-IP: 103.29.142.67 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 From: Algea Cao To: a.hajda@samsung.com, kuankuan.y@gmail.com, hjc@rock-chips.com, tzimmermann@suse.de, dri-devel@lists.freedesktop.org, sam@ravnborg.org, airlied@linux.ie, heiko@sntech.de, jernej.skrabec@siol.net, algea.cao@rock-chips.com, Laurent.pinchart@ideasonboard.com, laurent.pinchart+renesas@ideasonboard.com, jonas@kwiboo.se, mripard@kernel.org, darekm@google.com, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, cychiang@chromium.org, linux-kernel@vger.kernel.org, narmstrong@baylibre.com, jbrunet@baylibre.com, maarten.lankhorst@linux.intel.com, daniel@ffwll.ch Subject: [PATCH 6/6] drm: bridge: dw-hdmi: Get output bus format when dw-hdmi is the only bridge Date: Wed, 12 Aug 2020 16:36:31 +0800 Message-Id: <20200812083631.4411-1-algea.cao@rock-chips.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200812083120.743-1-algea.cao@rock-chips.com> References: <20200812083120.743-1-algea.cao@rock-chips.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If plat_data->get_output_bus_format() is exist, we can use it to get hdmi output bus format when dw-hdmi is the only bridge. The hdmi output bus format can be set by vendor properties. Signed-off-by: Algea Cao --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 1eb4736b9b59..878e9e506963 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2644,6 +2644,8 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, unsigned int *num_output_fmts) { struct drm_connector *conn = conn_state->connector; + struct dw_hdmi *hdmi = bridge->driver_private; + void *data = hdmi->plat_data->phy_data; struct drm_display_info *info = &conn->display_info; struct drm_display_mode *mode = &crtc_state->mode; u8 max_bpc = conn_state->max_requested_bpc; @@ -2662,7 +2664,11 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, /* If dw-hdmi is the only bridge, avoid negociating with ourselves */ if (list_is_singular(&bridge->encoder->bridge_chain)) { *num_output_fmts = 1; - output_fmts[0] = MEDIA_BUS_FMT_FIXED; + if (hdmi->plat_data->get_output_bus_format) + output_fmts[0] = + hdmi->plat_data->get_output_bus_format(data); + else + output_fmts[0] = MEDIA_BUS_FMT_FIXED; return output_fmts; } -- 2.25.1