From patchwork Thu Mar 21 00:14:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 10862715 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 5138717E9 for ; Thu, 21 Mar 2019 00:16:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E92E29D54 for ; Thu, 21 Mar 2019 00:16:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2332F29F8D; Thu, 21 Mar 2019 00:16:00 +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,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C2FA929D54 for ; Thu, 21 Mar 2019 00:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=QqfbVjzvmVMOsWk4qo2DFXvFXaUZIgYcAr0N/D8MCjk=; b=AfdUn3CRdHwygmerL+pHw6xcwR 3xq+onl/JWrRVRvkN09B/N508rDsXtnFoIv6fQpiYJcpSVA5hDszPKblOQgGRePR8jacrihU8Vtn2 dNs1p9h9ug7czL0sRBNQYIVOjYMQeukxwN73hNoT7/j7ggBVmiYWl2u8ZYCgkwgouXwDHJiZ3PRyL qamkmL7qlGQ6Q217B9PVoUCgUw5t+jbAaJYG05ofQ3SjdGvFZE8vPizcMKPJbmtmg//lRfhxbTEyO qeQGqQLvB+peptdWX4UiKEV6ypUAS5BJEqCnbPTvh6HOqXALl+mb0HjK05mJQqIapvo1MJD+qHoUZ 1xXVdPLQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6lNE-0002w4-SO; Thu, 21 Mar 2019 00:15:56 +0000 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6lMK-0000hb-ET; Thu, 21 Mar 2019 00:15:02 +0000 Received: by mail-ed1-x543.google.com with SMTP id d1so3532535edd.13; Wed, 20 Mar 2019 17:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2gmLGJ4vQN/k7ohWxy1pugeNlW0+fmahjpUGJcf7onA=; b=Stgr0XbKKLDoruo+DsABjsnuLf6ain1AvNNo6ODIY4C03zYFN5XypwKhg2G+ICLVl8 MdpnRpqzuCkHPZEDEjaQKRjzw9YPYAdfDasd214Kbwek9zDenV+THZL4GND2jjuNR9I4 BrkuUcjtc3WRRIYxhg39JJ8NgwjmR8rMyElUjIDTTvuX0yfHHWFmVfrRBba1MAKd8pN1 XT5SvirvjGyIX9vJOe+SoSihcEs3Td5yZl4ALtc6hnrouwqSGFYrGM/i56cgXtWeOIII Pc/TQ10D+8KtxdOdqVnZBnrX155oETtuzq6GsiGfjCoLil13w4K3mCzF8INhnGpYT2FG amCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2gmLGJ4vQN/k7ohWxy1pugeNlW0+fmahjpUGJcf7onA=; b=TDqPrdG5IKiS70y0SN/cRXTkQ/kt/bCyEI/AdSIz6/Bnt6OQl9xizhTmiu7ZLPwz7G U1n3W00/imCf5ZDauljsROO3ky8b5pTtxGvDpXx0if52CK0jEV2kBhfGnIxe7ygtoDlK tHpHi2PbUYJspK+/V3M3oszV6evcqFuG/ylQPVSnFWTHa7BJNfkAj2jajHXe5DgUq5+G gF12HQv5yRaqTH1FOpgbVxZRfxKwk/XyRGaH893BEdf/oI6liyLL6LORDRkEEF4dqa6T SL6N0MXkcttfybVg/K8t7nNIMnZ8Wduvce6EzeHoXxAMkjaUTwHJXU7oOeGBTaqpYaP5 IpRg== X-Gm-Message-State: APjAAAWzt+Dl4zHSePcxToWsORzmHbX1HXBe0CSsmTVHt4LyGc0BIoFi TAx1mVdIsMfy6vpgUKPXsbk= X-Google-Smtp-Source: APXvYqx1ASfFSYpHyfhpgM6DZrA2N9rMOFFJG7tJYsGIRPGNIvUm29wNJZaBL3/HM/RKn14POok8IA== X-Received: by 2002:a17:906:4e58:: with SMTP id g24mr529326ejw.190.1553127299210; Wed, 20 Mar 2019 17:14:59 -0700 (PDT) Received: from debian.home (ip51ccf9cd.speed.planet.nl. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id j34sm1107660edb.30.2019.03.20.17.14.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Mar 2019 17:14:58 -0700 (PDT) From: Johan Jonker To: heiko@sntech.de Subject: [PATCH v5 5/5] drm: rockchip: add fixed screen size DVI-D support for rk3066 hdmi Date: Thu, 21 Mar 2019 01:14:40 +0100 Message-Id: <20190321001440.31057-6-jbx6244@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190321001440.31057-1-jbx6244@gmail.com> References: <20190321001440.31057-1-jbx6244@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190320_171500_487405_6FC9C8A8 X-CRM114-Status: GOOD ( 15.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, airlied@linux.ie, hjc@rock-chips.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, robh+dt@kernel.org, daniel@ffwll.ch, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add fixed screen size DVI-D support for rk3066 hdmi with an extra patch. Signed-off-by: Johan Jonker --- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index ff8f86152..f656da769 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -349,11 +349,12 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi, if (hdmi->hdmi_data.sink_is_hdmi) { hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK, HDMI_VIDEO_MODE_HDMI); - rk3066_hdmi_config_avi(hdmi, mode); } else { hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK, 0); } + rk3066_hdmi_config_avi(hdmi, mode); + rk3066_hdmi_config_phy(hdmi); rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_E); @@ -462,15 +463,26 @@ rk3066_hdmi_connector_detect(struct drm_connector *connector, bool force) connector_status_connected : connector_status_disconnected; } +static const struct drm_display_mode edid_cea_modes[] = { + /* 4 - 1280x720@60Hz 16:9 */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390, + 1430, 1650, 0, 720, 725, 730, 750, 0, + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, }, +}; + static int rk3066_hdmi_connector_get_modes(struct drm_connector *connector) { struct rk3066_hdmi *hdmi = to_rk3066_hdmi(connector); + struct drm_display_mode *mode = NULL; struct edid *edid; int ret = 0; if (!hdmi->ddc) return 0; + hdmi->hdmi_data.sink_is_hdmi = false; + edid = drm_get_edid(connector, hdmi->ddc); if (edid) { hdmi->hdmi_data.sink_is_hdmi = drm_detect_hdmi_monitor(edid); @@ -479,6 +491,17 @@ static int rk3066_hdmi_connector_get_modes(struct drm_connector *connector) kfree(edid); } + if ((ret == 0) || (hdmi->hdmi_data.sink_is_hdmi == false)) { + hdmi->hdmi_data.sink_is_hdmi = false; + + mode = drm_mode_duplicate(hdmi->drm_dev, &edid_cea_modes[0]); + if (!mode) + return ret; + mode->type |= DRM_MODE_TYPE_PREFERRED; + drm_mode_probed_add(connector, mode); + ret++; + } + return ret; }