Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp287720rdb; Wed, 17 Jan 2024 01:47:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHP4w6bLpn90u0a8oZ9DjoIz/bcnt+npAcoju1we4Cr3QKdn92fz4j1P0cpoJ9motfjAiim X-Received: by 2002:a05:6808:1451:b0:3bd:3b9d:1479 with SMTP id x17-20020a056808145100b003bd3b9d1479mr9045268oiv.94.1705484829734; Wed, 17 Jan 2024 01:47:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705484829; cv=pass; d=google.com; s=arc-20160816; b=VJTn0oJhqT/u8O8hXXb0V1g0nr6ZfsaPqKmFiBkiTAERoZ1hM0s2FUYyYLzojiBuNl GpLZ+QRo+V3o20oKxxRAJQT78e1EAyeD06N1UExhbIVPfwUYLrsBzU2S1fNc16WZ6/TR ubPvPQfn8coG0oh1uErRIzSdBqEQsR85xdT7OdiQ03n9IS+gy9gpacpXFZCxcRhhvQvh 57i8nhYfgjAs9s+ZkcGutmlttV2CvD9eeOzbX0Nax9+bPFymqMrdfz3xJCQZfAdJR9U9 p/x4NoLuRT85XcpDl51jZIt2gPHnUbCgzONYhBzoeww1k9vZ9IE+SkMLFYIMn8HOybP6 MBIg== 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 :organization:message-id:date:subject:cc:to:from:dkim-signature; bh=H93YTinsBD2X1eXiG2s9oou2D6Ybv6y0IABMI5784rg=; fh=g7RE+2tJx5RB8rPouveAsrARnWdx79pNbnXx9JPp91s=; b=EabIXW/24VlEzNmirvkNMjasFCY8x4DqNpiUl/rbEkwbPiqNFmpz4sNyDOZPH8+O12 IyP/MrnGFHr6yoX9z+dtDelsWmEjNvQqWnvlCajydk0fTF6247IMhjE8+WcCMMqWt8C6 7L4Oa4KL/qwsA2BP8NSK2cIb4V6x0BPQH1iyyVsbG5weNhu0nIC8zYN1DqE3GmcrWpDO mnEHxW5rHjSm/RECWP66Azszom00Fm+0t+vV1n4cn+nu1l40xQ/HJsZ4ZJHb+9cU6Awy UHAN6bgJB71ZXQRav1avT0wdbWeyAwrLWkFFPIyvdYukhoYgwaiQke/xmeWsvviO1Gn3 ZbIA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=kmwcf+9Z; arc=pass (i=1 spf=pass spfdomain=ew.tq-group.com dkim=pass dkdomain=tq-group.com dmarc=pass fromdomain=ew.tq-group.com); spf=pass (google.com: domain of linux-kernel+bounces-28755-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y65-20020a636444000000b005cdfd749abesi364940pgb.300.2024.01.17.01.47.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 01:47:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28755-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=kmwcf+9Z; arc=pass (i=1 spf=pass spfdomain=ew.tq-group.com dkim=pass dkdomain=tq-group.com dmarc=pass fromdomain=ew.tq-group.com); spf=pass (google.com: domain of linux-kernel+bounces-28755-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 59B0D28691F for ; Wed, 17 Jan 2024 09:47:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6702C14277; Wed, 17 Jan 2024 09:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="kmwcf+9Z" Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F7C91429C; Wed, 17 Jan 2024 09:46:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705484818; cv=none; b=lZJ0WBUVXitL96MP2lCnkHlFljTeeAh9IVXzF/vVNGxCAneYsubBS1+CsMGkfK5KtAoZ/rwH31kBX8LCfdGN9OtY0UNOelPNhtJW37AwGF0I8EIplrCGrqpWGVnAUaUvjEduGSxZNdWdV6MpTXtMlhWoNlOK4UJ7a/5L3JsTF1w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705484818; c=relaxed/simple; bh=Epw87qXz9x7uWjCfv0FlgVFAXJj56MhgmkUvJWW56dM=; h=DKIM-Signature:X-IronPort-AV:Received:Received:From:To:Cc:Subject: Date:Message-ID:Organization:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Content-Type; b=sEWY9uH8I0AjlBMhmN53BWhgzOsWO4qbZy+Vtm4nf+T+LUan2caBpp0uxrCCROTp/iRbNe72DmItRX+XAO5Ux2Ya4SB3MmmK03H2Cjq+lbxwNB5FKXfE466kbAJTLV8Yc709bVf2mNHaW/odMDjBDnCwR0AECkNofgKIEgll0Sg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=kmwcf+9Z; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1705484814; x=1737020814; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=H93YTinsBD2X1eXiG2s9oou2D6Ybv6y0IABMI5784rg=; b=kmwcf+9ZUiLqEwnWofqZ2OSLoRg6eUdUytSnmHJjJ07ObUgt3VJBlJ7L niWgAfpGjHzgqheFaZI7R+aJtxq1nzc3cZ/bsmnbfbfQjlijpTqLb9qoG 7hINawWVeN2pEyhm1gWA/HFjPOnc2oJipfyJMSppx6cVQc2ZjoNTMDHAK RR5Uz68wZlMFvSusxOWG1aaH/TSisbwVugMAjMERz4ToinQ9QKaaOxykB c8s0HH7mdrEEyehMAPPi3OCfs3bxj9HMAt7EodclbzNzp9WbA6D7QCHo2 MaIKD0HdLMD9ZH6rzc3D08BznJnYUSSBBK8iPS4NVX7xCw2awfjFAmU9a Q==; X-IronPort-AV: E=Sophos;i="6.05,200,1701126000"; d="scan'208";a="34935822" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 17 Jan 2024 10:46:50 +0100 Received: from steina-w.localnet (steina-w.tq-net.de [10.123.53.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 4FDB1280075; Wed, 17 Jan 2024 10:46:50 +0100 (CET) From: Alexander Stein To: dmitry.baryshkov@linaro.org, andrzej.hajda@intel.com, neil.armstrong@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@gmail.com, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, vkoul@kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Sandor Yu Cc: kernel@pengutronix.de, linux-imx@nxp.com, Sandor.yu@nxp.com, oliver.brown@nxp.com, sam@ravnborg.org Subject: Re: [PATCH v12 4/7] drm: bridge: Cadence: Add MHDP8501 DP/HDMI driver Date: Wed, 17 Jan 2024 10:46:49 +0100 Message-ID: <9223210.CDJkKcVGEf@steina-w> Organization: TQ-Systems GmbH In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Hi Sandor, thanks for the update. Am Mittwoch, 10. Januar 2024, 02:08:45 CET schrieb Sandor Yu: > Add a new DRM DisplayPort and HDMI bridge driver for Candence MHDP8501 > used in i.MX8MQ SOC. MHDP8501 could support HDMI or DisplayPort > standards according embedded Firmware running in the uCPU. >=20 > For iMX8MQ SOC, the DisplayPort/HDMI FW was loaded and activated by > SOC's ROM code. Bootload binary included respective specific firmware > is required. >=20 > Driver will check display connector type and > then load the corresponding driver. >=20 > Signed-off-by: Sandor Yu > Tested-by: Alexander Stein > --- > v11->v12: > - Replace DRM_INFO with dev_info or dev_warn. > - Replace DRM_ERROR with dev_err. > - Return ret when cdns_mhdp_dpcd_read failed in function > cdns_dp_aux_transferi(). - Remove unused parmeter in function > cdns_dp_get_msa_misc > and use two separate variables for color space and bpc. > - Add year 2024 to copyright. >=20 > drivers/gpu/drm/bridge/cadence/Kconfig | 16 + > drivers/gpu/drm/bridge/cadence/Makefile | 2 + > .../drm/bridge/cadence/cdns-mhdp8501-core.c | 315 ++++++++ > .../drm/bridge/cadence/cdns-mhdp8501-core.h | 365 +++++++++ > .../gpu/drm/bridge/cadence/cdns-mhdp8501-dp.c | 699 ++++++++++++++++++ > .../drm/bridge/cadence/cdns-mhdp8501-hdmi.c | 678 +++++++++++++++++ > 6 files changed, 2075 insertions(+) > create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-core.c > create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-core.h > create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-dp.c > create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-hdmi.c >=20 > diff --git a/drivers/gpu/drm/bridge/cadence/Kconfig > b/drivers/gpu/drm/bridge/cadence/Kconfig index e0973339e9e33..45848e741f5= f4 > 100644 > --- a/drivers/gpu/drm/bridge/cadence/Kconfig > +++ b/drivers/gpu/drm/bridge/cadence/Kconfig > @@ -51,3 +51,19 @@ config DRM_CDNS_MHDP8546_J721E > initializes the J721E Display Port and sets up the > clock and data muxes. > endif > + > +config DRM_CDNS_MHDP8501 > + tristate "Cadence MHDP8501 DP/HDMI bridge" > + select DRM_KMS_HELPER > + select DRM_PANEL_BRIDGE > + select DRM_DISPLAY_DP_HELPER > + select DRM_DISPLAY_HELPER > + select CDNS_MHDP_HELPER > + select DRM_CDNS_AUDIO > + depends on OF > + help > + Support Cadence MHDP8501 DisplayPort/HDMI bridge. > + Cadence MHDP8501 support one or more protocols, > + including DisplayPort and HDMI. > + To use the DP and HDMI drivers, their respective > + specific firmware is required. > diff --git a/drivers/gpu/drm/bridge/cadence/Makefile > b/drivers/gpu/drm/bridge/cadence/Makefile index > 087dc074820d7..02c1a9f3cf6fc 100644 > --- a/drivers/gpu/drm/bridge/cadence/Makefile > +++ b/drivers/gpu/drm/bridge/cadence/Makefile > @@ -6,3 +6,5 @@ obj-$(CONFIG_CDNS_MHDP_HELPER) +=3D cdns-mhdp-helper.o > obj-$(CONFIG_DRM_CDNS_MHDP8546) +=3D cdns-mhdp8546.o > cdns-mhdp8546-y :=3D cdns-mhdp8546-core.o cdns-mhdp8546-hdcp.o > cdns-mhdp8546-$(CONFIG_DRM_CDNS_MHDP8546_J721E) +=3D cdns-mhdp8546-j721e= =2Eo > +obj-$(CONFIG_DRM_CDNS_MHDP8501) +=3D cdns-mhdp8501.o > +cdns-mhdp8501-y :=3D cdns-mhdp8501-core.o cdns-mhdp8501-dp.o > cdns-mhdp8501-hdmi.o diff --git > a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-core.c > b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-core.c new file mode 100644 > index 0000000000000..3080c7507a012 > --- /dev/null > +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-core.c > @@ -0,0 +1,315 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Cadence Display Port Interface (DP) driver > + * > + * Copyright (C) 2023, 2024 NXP Semiconductor, Inc. > + * > + */ > +#include > +#include > +#include > +#include > +#include > +#include Since commit d57d584ef69de ("of: Stop circularly including of_device.h and= =20 of_platform.h") you to explicitly include linux/platform_device.h here. Ple= ase=20 compile against next tree. > +#include > + > +#include "cdns-mhdp8501-core.h" > + > [snip] > diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-dp.c > b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-dp.c new file mode 100644 > index 0000000000000..6963c7143a3b0 > --- /dev/null > +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-dp.c > @@ -0,0 +1,699 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Cadence MHDP8501 DisplayPort(DP) bridge driver > + * > + * Copyright (C) 2019-2024 NXP Semiconductor, Inc. > + * > + */ > +#include > +#include > +#include > +#include > +#include > + > +#include "cdns-mhdp8501-core.h" > + > +#define LINK_TRAINING_TIMEOUT_MS 500 > +#define LINK_TRAINING_RETRY_MS 20 > + > +ssize_t cdns_dp_aux_transfer(struct drm_dp_aux *aux, > + struct drm_dp_aux_msg *msg) > +{ > + struct cdns_mhdp8501_device *mhdp =3D dev_get_drvdata(aux->dev); > + bool native =3D msg->request & (DP_AUX_NATIVE_WRITE &=20 DP_AUX_NATIVE_READ); > + int ret; > + > + /* Ignore address only message */ > + if (!msg->size || !msg->buffer) { > + msg->reply =3D native ? > + DP_AUX_NATIVE_REPLY_ACK : DP_AUX_I2C_REPLY_ACK; > + return msg->size; > + } > + > + if (!native) { > + dev_err(mhdp->dev, "%s: only native messages supported\n",=20 __func__); > + return -EINVAL; > + } > + > + /* msg sanity check */ > + if (msg->size > DP_AUX_MAX_PAYLOAD_BYTES) { > + dev_err(mhdp->dev, "%s: invalid msg: size(%zu),=20 request(%x)\n", > + __func__, msg->size, (unsigned int)msg- >request); > + return -EINVAL; > + } > + > + if (msg->request =3D=3D DP_AUX_NATIVE_WRITE) { > + const u8 *buf =3D msg->buffer; > + int i; > + > + for (i =3D 0; i < msg->size; ++i) { > + ret =3D cdns_mhdp_dpcd_write(&mhdp->base, > + msg->address +=20 i, buf[i]); > + if (ret < 0) { > + dev_err(mhdp->dev, "Failed to write=20 DPCD\n"); > + return ret; > + } > + } > + msg->reply =3D DP_AUX_NATIVE_REPLY_ACK; > + return msg->size; > + } > + > + if (msg->request =3D=3D DP_AUX_NATIVE_READ) { > + ret =3D cdns_mhdp_dpcd_read(&mhdp->base, msg->address, > + msg->buffer, msg->size); > + if (ret < 0) > + return ret; > + msg->reply =3D DP_AUX_NATIVE_REPLY_ACK; > + return msg->size; > + } > + return 0; > +} > + > +int cdns_dp_aux_destroy(struct cdns_mhdp8501_device *mhdp) > +{ > + drm_dp_aux_unregister(&mhdp->dp.aux); > + > + return 0; > +} > + > +static int cdns_dp_get_msa_misc(struct video_info *video) > +{ > + u32 msa_misc; > + u8 color_space =3D 0; > + u8 bpc =3D 0; > + > + switch (video->color_fmt) { > + /* set YUV default color space conversion to BT601 */ > + case DRM_COLOR_FORMAT_YCBCR444: > + color_space =3D 6 + BT_601 * 8; > + break; > + case DRM_COLOR_FORMAT_YCBCR422: > + color_space =3D 5 + BT_601 * 8; > + break; > + case DRM_COLOR_FORMAT_YCBCR420: > + color_space =3D 5; > + break; > + case DRM_COLOR_FORMAT_RGB444: > + default: > + color_space =3D 0; > + break; > + }; > + > + switch (video->bpc) { > + case 6: > + bpc =3D 0; > + break; > + case 10: > + bpc =3D 2; > + break; > + case 12: > + bpc =3D 3; > + break; > + case 16: > + bpc =3D 4; > + break; > + case 8: > + default: > + bpc =3D 1; > + break; > + }; > + > + msa_misc =3D (color_space << 1) | (bpc << 5); This looks much nicer, thanks. But please order them in descending shift=20 width: bpc first then color_space. > + > + return msa_misc; > +} > + > [snip] > +int cdns_dp_set_host_cap(struct cdns_mhdp8501_device *mhdp) This can be made static. > +{ > + u8 msg[8]; > + int ret; > + > + msg[0] =3D drm_dp_link_rate_to_bw_code(mhdp->dp.rate); > + msg[1] =3D mhdp->dp.num_lanes | SCRAMBLER_EN; > + msg[2] =3D VOLTAGE_LEVEL_2; > + msg[3] =3D PRE_EMPHASIS_LEVEL_3; > + msg[4] =3D PTS1 | PTS2 | PTS3 | PTS4; > + msg[5] =3D FAST_LT_NOT_SUPPORT; > + msg[6] =3D mhdp->lane_mapping; > + msg[7] =3D ENHANCED; > + > + mutex_lock(&mhdp->mbox_mutex); > + > + ret =3D cdns_mhdp_mailbox_send(&mhdp->base, MB_MODULE_ID_DP_TX, > + DPTX_SET_HOST_CAPABILITIES, > + sizeof(msg), msg); > + > + mutex_unlock(&mhdp->mbox_mutex); > + > + if (ret) > + dev_err(mhdp->dev, "set host cap failed: %d\n", ret); > + > + return ret; > +} > [snip] > diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-hdmi.c > b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-hdmi.c new file mode 100644 > index 0000000000000..ae21f7dfe5e94 > --- /dev/null > +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8501-hdmi.c > @@ -0,0 +1,678 @@ > [snip] > +bool cdns_hdmi_bridge_mode_fixup(struct drm_bridge *bridge, > + const struct drm_display_mode *mode, > + struct drm_display_mode=20 *adjusted_mode) This can be made static. Thanks and best regards, Alexander > +{ > + struct cdns_mhdp8501_device *mhdp =3D bridge->driver_private; > + struct video_info *video =3D &mhdp->video_info; > + > + /* The only currently supported format */ > + video->bpc =3D 8; > + video->color_fmt =3D DRM_COLOR_FORMAT_RGB444; > + > + return true; > +} > + > +static enum drm_connector_status > +cdns_hdmi_bridge_detect(struct drm_bridge *bridge) > +{ > + struct cdns_mhdp8501_device *mhdp =3D bridge->driver_private; > + > + return cdns_mhdp8501_detect(mhdp); > +} > + > +static struct edid *cdns_hdmi_bridge_get_edid(struct drm_bridge *bridge, > + struct drm_connector=20 *connector) > +{ > + struct cdns_mhdp8501_device *mhdp =3D bridge->driver_private; > + > + return drm_do_get_edid(connector, cdns_hdmi_get_edid_block, mhdp); > +} > + > +static void cdns_hdmi_bridge_atomic_disable(struct drm_bridge *bridge, > + struct drm_bridge_state=20 *old_state) > +{ > + struct cdns_mhdp8501_device *mhdp =3D bridge->driver_private; > + > + mhdp->curr_conn =3D NULL; > + > + /* Mailbox protect for HDMI PHY access */ > + mutex_lock(&mhdp->mbox_mutex); > + phy_power_off(mhdp->phy); > + mutex_unlock(&mhdp->mbox_mutex); > +} > + > +static void cdns_hdmi_bridge_atomic_enable(struct drm_bridge *bridge, > + struct drm_bridge_state=20 *old_state) > +{ > + struct cdns_mhdp8501_device *mhdp =3D bridge->driver_private; > + struct drm_atomic_state *state =3D old_state->base.state; > + struct drm_connector *connector; > + struct drm_crtc_state *crtc_state; > + struct drm_connector_state *conn_state; > + const struct drm_display_mode *mode; > + > + connector =3D drm_atomic_get_new_connector_for_encoder(state, > + =20 bridge->encoder); > + if (WARN_ON(!connector)) > + return; > + > + mhdp->curr_conn =3D connector; > + > + conn_state =3D drm_atomic_get_new_connector_state(state, connector); > + if (WARN_ON(!conn_state)) > + return; > + > + crtc_state =3D drm_atomic_get_new_crtc_state(state, conn_state->crtc); > + if (WARN_ON(!crtc_state)) > + return; > + > + mode =3D &crtc_state->adjusted_mode; > + dev_dbg(mhdp->dev, "Mode: %dx%dp%d\n", > + mode->hdisplay, mode->vdisplay, mode->clock); > + memcpy(&mhdp->mode, mode, sizeof(struct drm_display_mode)); > + > + cdns_hdmi_mode_set(mhdp); > +} > + > +const struct drm_bridge_funcs cdns_hdmi_bridge_funcs =3D { > + .attach =3D cdns_hdmi_bridge_attach, > + .detect =3D cdns_hdmi_bridge_detect, > + .get_edid =3D cdns_hdmi_bridge_get_edid, > + .mode_valid =3D cdns_hdmi_bridge_mode_valid, > + .mode_fixup =3D cdns_hdmi_bridge_mode_fixup, > + .atomic_enable =3D cdns_hdmi_bridge_atomic_enable, > + .atomic_disable =3D cdns_hdmi_bridge_atomic_disable, > + .atomic_duplicate_state =3D drm_atomic_helper_bridge_duplicate_state, > + .atomic_destroy_state =3D drm_atomic_helper_bridge_destroy_state, > + .atomic_reset =3D drm_atomic_helper_bridge_reset, > +}; =2D-=20 TQ-Systems GmbH | M=FChlstra=DFe 2, Gut Delling | 82229 Seefeld, Germany Amtsgericht M=FCnchen, HRB 105018 Gesch=E4ftsf=FChrer: Detlef Schneider, R=FCdiger Stahl, Stefan Schneider http://www.tq-group.com/