Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp178033img; Wed, 20 Mar 2019 17:16:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxD0c6P9PDzT0EENZfJDD+rzeIqd8HUFwM1UuDEVFfMOkRGuVaRSA7cwMEadg0a2iQFIttG X-Received: by 2002:a65:60c1:: with SMTP id r1mr691457pgv.137.1553127363823; Wed, 20 Mar 2019 17:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553127363; cv=none; d=google.com; s=arc-20160816; b=CamZp65qSqozDO/c9/krdjMLHrpQWanF5eglg5EkfrssEK3uS3eZuTrkIF/N/bAgkM Oj9qkHkurQWQkUQSaHLwFObYDRemXTNiSw0mSXlKzBRoCaZg1UliFy6jPCNR7B9bGTLw /JCcg713BOMUo85uJGLaw/cZosCYQLxYDIo5URM+YSHxpVGqD3BrAxInyA/glncwo+4y LZkrbGJbaRWNQRXG5uXb2wE14kwA2X+uMjEMte0gn75OpY5ZRiBzUuLdvWl+MIoIM7kR pTcHMYLEceMwOkTGDa3Exc5cOpZpE5/2gXvXQqTP5zTVaUj3stR7ZqHa9YgLz9h7wJB0 A4qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=2gmLGJ4vQN/k7ohWxy1pugeNlW0+fmahjpUGJcf7onA=; b=u1GhD93i2ZRgZ+XBw156V7tIdOW3FexpPC0IdZGVT04NhQhk2VrvA+PI9/n/XZYkru 5eJUC/O3ZtNYghpE2HiCtxnHo/HlpKUYLVyDj8JvKboyJc2xIe1jGnQ5fZPNVO5o93vY J3JEsuj3T2Vn1XlIdNvXjU3dcn28LeAPCflFPcw4YwOGRjhK+Ob29aH0T3E0I5nbwvQ+ jkMLZA37t93Bp8+2M+ydg32CMttPOipdZK3y7XxH5ONTLI98iwMcxEqqCA1OmdOSMEeS sViK+7VlTG0niHURwg+g+vT/BrxUmw1YYslvHX6qcUbGkoGP+uL53OddY5nYLLM7G08d UL/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Stgr0XbK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i72si2873789pgd.466.2019.03.20.17.15.48; Wed, 20 Mar 2019 17:16:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Stgr0XbK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727780AbfCUAPG (ORCPT + 99 others); Wed, 20 Mar 2019 20:15:06 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:39655 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727734AbfCUAPA (ORCPT ); Wed, 20 Mar 2019 20:15:00 -0400 Received: by mail-ed1-f65.google.com with SMTP id p27so3551560edc.6; Wed, 20 Mar 2019 17:14:59 -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=oPK3qcnDcPjJguWFo9u+jZaAjCKZ+XcvGXl86/RClH16DonaerKeb6NkKJa/TjHsi6 KFu2U7p6iEB/AlNHEEuTY+HB7DHo+9r/Ou9ic7HswyDp1Kddv0TD3yzOFMlxGN2gEs8M qE2MuEGNfWZDJHDbRcrDJ9dXdQ+XOOwUUg3GpUBtQS8MYgNpFLw34SSwW6tWGlrlY+PS DlCsAOIhiEZtOBNlukOMox9MT5xdopNZSs9iD4flx7aB8bBdHruZOPsaAR9hvJ0aveOk wPZEuJ4WKNz/X8Py/PqV5mRCtdLUCiCO/fb0+3lBcqA/QcfWUGD2bVAI4s3Sy1Ws9sJs 74Xg== X-Gm-Message-State: APjAAAVdA5f8jXr/EdBkQO1JRKEbsHuciI/UnTlW/WrAd4+p2u9gu5SC qCA7INK49CRTzAgBLds1BlM= 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 Cc: hjc@rock-chips.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, mark.rutland@arm.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.11.0