Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp444193lqp; Tue, 11 Jun 2024 08:53:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWmK9neEagCd6izDwk9jpbKJerR8Udfc59t+AqSJsEYsLcb/i01HUk/G4J3d1R+g2NrCbY1Nsa8D+wup6FV881NHtXS4mF1ZTTM/FbQqg== X-Google-Smtp-Source: AGHT+IGYW2wW/OeeiOGWrVM/+4vfu6+thcjdlBQqRI238/wC6ztE1Kj/VNcDvlGUy4qmljLENh41 X-Received: by 2002:a17:907:2da6:b0:a6e:fc0a:efaf with SMTP id a640c23a62f3a-a6efc0af27emr658605666b.49.1718121189062; Tue, 11 Jun 2024 08:53:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718121189; cv=pass; d=google.com; s=arc-20160816; b=UwUMRDJbOg/lOK7awdIsJ4M9raNMoK+idAdNTJWR/Fw0sPQ3uEvD0yl4qCxLw1M7rb Ubk4QNZBTfLwiqXqlRp4mZyGPTpK6NpC7mVoCDcFArhCnMi2mJ0lNgOuBLIiCaJPluFm tygRQGB5SE+7MS1nfkEbssKRdIDFVff8Otb/JmLdjTt4ck6akuC5YoJ1pEijA4AD6u8u XLPwyVQ+S+gT2njw/uy6vKWqNviY52wi9wK4yGTETuMplAHcIfUhXyE0bJFgABOktA7f XSlVYnYt005A63UvSbz+0ATnbyM1pGCTryJNmMf0kdMoPnsFXFpnJJrQVoEad5iCs204 3rtw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EkSsGxXsV4hgJZkNTSQ1UhXjCwhQtYShQRypQ33Ng4Q=; fh=RlYB0Y2md8rdYnrKVoTlrEmdiF5i9yjfnLS+nw4nIUU=; b=0sFwjz3puUU4hRBNnqQOyIpZnJSzMkKAdSvMbaH3SSVjEK+kVte9qCtMpEyzKCZJ1W 2uJXn+rpRjI584CsEq4FJyzg3+c1w3ft71+d3fuvkj+r1fKX5NQxpivxHLTU6UTVaqtz XPXEdIEhlG5qP6Y4qm6kfym/NvThhDiUfejM7ImQ0lgp6OEvqH2JhHykNBbXDeAmZ1DV nCKKa5xSdlqWQaA1XQ+224wSSm6We4ts9LB3ZlaF/29/JtGQ7SntkfxSLIepdmcRMkme FD4QJNTG1/x+R2ByluppMd1b+yA7LIdlpFSpVVagx6eLRwgeAYVxzZFx9fWoDPKOPhev RkKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kwiboo.se header.s=fe-e1b5cab7be header.b=KMcCShrj; arc=pass (i=1 spf=pass spfdomain=fe-bounces.kwiboo.se dkim=pass dkdomain=kwiboo.se dmarc=pass fromdomain=kwiboo.se); spf=pass (google.com: domain of linux-kernel+bounces-210184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kwiboo.se Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f169bc56dsi264177466b.623.2024.06.11.08.53.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 08:53:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kwiboo.se header.s=fe-e1b5cab7be header.b=KMcCShrj; arc=pass (i=1 spf=pass spfdomain=fe-bounces.kwiboo.se dkim=pass dkdomain=kwiboo.se dmarc=pass fromdomain=kwiboo.se); spf=pass (google.com: domain of linux-kernel+bounces-210184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kwiboo.se Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 610881F21D72 for ; Tue, 11 Jun 2024 15:52:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16B05383BF; Tue, 11 Jun 2024 15:52:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="KMcCShrj" Received: from smtp.forwardemail.net (smtp.forwardemail.net [167.172.40.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E08B03FB83 for ; Tue, 11 Jun 2024 15:52:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=167.172.40.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718121135; cv=none; b=dTsfxtHLq0TLAHEomRgSh/Rsn9s3J0V0MAjYqv31uqTJ9LC/nFYdAVtW9JDXSzkwpr5uUIBwb4aN2H9T4iQU+ojGWnCyMt7C6+Apx4NzJMIFCYUzy5PyttOdzqFcWummulWMOrHmnXezhI6IKEhdu4i2z+ZZTYz2grRBRZTIFsU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718121135; c=relaxed/simple; bh=mTH7O8SoMceV83GJW8Kvwdx4Xu7+K6crQrZP50zx1Wc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XQHb5P4z2ihIJ6xcxtjXRoqbsfdqd/6qxW5EziBfCSzxNIUMd4nNpGYfB1bdPUMhKVf7tbVIHYRgEyLzc1u4sFD/BpAYcHiTZqRkHsId2r5xfq/9fGSHS05RqIPPxuz4Rzum62t3WvHIH/LnhNVSdC+88QW5On18z4raXChJyPM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=KMcCShrj; arc=none smtp.client-ip=167.172.40.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1718121117; bh=EkSsGxXsV4hgJZkNTSQ1UhXjCwhQtYShQRypQ33Ng4Q=; b=KMcCShrjgrH3qHS9P/uAK6eRYbaKJdS18XeGPrOz3XFNtD7wWOfNnhDjnD0XX4Z2OSbbiv/a9 jwZR9HYb38xeW6BPYjuHdHEqOgNNFh8/EZRt8DVarXhH0jfT7fdZKH+8tyu4SfKgURxdJoQDJu+ mo3ZBMOcsb9NJrjB9/bGcXGUTNg+gTp/XqR6reSZAzvPAp8X98jrHUfSBU4vZUit39evXwK1Dm8 fPIiGL0O0AaYXIwbXtSiaOy7z4Og9wCDSts5BI5Qp9ePwjow2vn+pBR2dQHp6wzgIldT4Z+uB7R imR7oMhVg19OW6Hbs2ps/KETi6zhSTw8d2Eyo1sInxng== From: Jonas Karlman To: Andrzej Hajda , Neil Armstrong , Robert Foss , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/8] drm: bridge: dw_hdmi: Use display_info is_hdmi and has_audio Date: Tue, 11 Jun 2024 15:51:00 +0000 Message-ID: <20240611155108.1436502-9-jonas@kwiboo.se> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240611155108.1436502-1-jonas@kwiboo.se> References: <20240611155108.1436502-1-jonas@kwiboo.se> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 167.172.40.54 X-ForwardEmail-ID: 66687298b913b04293b6dcb2 drm_edid_connector_update() is being called from bridge connector ops and from detect and get_modes ops for dw-hdmi connector. Change to use is_hdmi and has_audio from display_info directly instead of keeping our own state in sink_is_hdmi and sink_has_audio. Also remove the old and unused edid struct member and related define. Signed-off-by: Jonas Karlman --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 32 ++++------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index a9c39584d31b..e162c2786178 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -43,8 +43,6 @@ #define DDC_CI_ADDR 0x37 #define DDC_SEGMENT_ADDR 0x30 -#define HDMI_EDID_LEN 512 - /* DW-HDMI Controller >= 0x200a are at least compliant with SCDC version 1 */ #define SCDC_MIN_SOURCE_VERSION 0x1 @@ -148,8 +146,6 @@ struct dw_hdmi { int vic; - u8 edid[HDMI_EDID_LEN]; - struct { const struct dw_hdmi_phy_ops *ops; const char *name; @@ -159,8 +155,6 @@ struct dw_hdmi { struct i2c_adapter *ddc; void __iomem *regs; - bool sink_is_hdmi; - bool sink_has_audio; struct pinctrl *pinctrl; struct pinctrl_state *default_state; @@ -2041,7 +2035,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, HDMI_FC_INVIDCONF_IN_I_P_INTERLACED : HDMI_FC_INVIDCONF_IN_I_P_PROGRESSIVE; - inv_val |= hdmi->sink_is_hdmi ? + inv_val |= display->is_hdmi ? HDMI_FC_INVIDCONF_DVI_MODEZ_HDMI_MODE : HDMI_FC_INVIDCONF_DVI_MODEZ_DVI_MODE; @@ -2275,7 +2269,7 @@ static int dw_hdmi_poweron(struct dw_hdmi *hdmi, if (hdmi->hdmi_data.enc_out_bus_format == MEDIA_BUS_FMT_FIXED) hdmi->hdmi_data.enc_out_bus_format = MEDIA_BUS_FMT_RGB888_1X24; - hdmi->hdmi_data.rgb_limited_range = hdmi->sink_is_hdmi && + hdmi->hdmi_data.rgb_limited_range = display->is_hdmi && drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED; @@ -2295,7 +2289,7 @@ static int dw_hdmi_poweron(struct dw_hdmi *hdmi, /* HDMI Initialization Step B.3 */ dw_hdmi_enable_video_path(hdmi); - if (hdmi->sink_has_audio) { + if (display->has_audio) { dev_dbg(hdmi->dev, "sink has audio support\n"); /* HDMI Initialization Step E - Configure audio */ @@ -2304,7 +2298,7 @@ static int dw_hdmi_poweron(struct dw_hdmi *hdmi, } /* not for DVI mode */ - if (hdmi->sink_is_hdmi) { + if (display->is_hdmi) { dev_dbg(hdmi->dev, "%s HDMI mode\n", __func__); /* HDMI Initialization Step F - Configure AVI InfoFrame */ @@ -2418,29 +2412,13 @@ static const struct drm_edid *dw_hdmi_edid_read(struct dw_hdmi *hdmi, struct drm_connector *connector) { const struct drm_edid *drm_edid; - const struct edid *edid; if (!hdmi->ddc) return NULL; drm_edid = drm_edid_read_ddc(connector, hdmi->ddc); - if (!drm_edid) { + if (!drm_edid) dev_dbg(hdmi->dev, "failed to get edid\n"); - return NULL; - } - - /* - * FIXME: This should use connector->display_info.is_hdmi and - * connector->display_info.has_audio from a path that has read the EDID - * and called drm_edid_connector_update(). - */ - edid = drm_edid_raw(drm_edid); - - dev_dbg(hdmi->dev, "got edid: width[%d] x height[%d]\n", - edid->width_cm, edid->height_cm); - - hdmi->sink_is_hdmi = drm_detect_hdmi_monitor(edid); - hdmi->sink_has_audio = drm_detect_monitor_audio(edid); return drm_edid; } -- 2.45.2