Message ID | 410b116b-cb63-7ba7-3689-4f0832ab5796@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-3985-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1335771dyi; Mon, 18 Dec 2023 07:52:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFVGlCnDMFUMc3NnvdPsMPT4mLfY/uJ6kWQYUJjLRfiO78U0roGArXj6ZyvqJWrLq8OvxR X-Received: by 2002:a05:6102:cd2:b0:45d:9a4d:dc1b with SMTP id g18-20020a0561020cd200b0045d9a4ddc1bmr12383381vst.3.1702914727609; Mon, 18 Dec 2023 07:52:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702914727; cv=none; d=google.com; s=arc-20160816; b=iOffWwv8lW9Vdr6tF40Md02kUSsV1PRuPzins0lj2f6dR4+W/dbSz0UvnU9Q/LWuc6 t0+srAnobeuRVy+nbL5O975HksdCgMc0feB+5iv9r8Go3g2584ZmdYskwy3vxVstIfXl TaPP2UNibnpoOKlaWWOI++q1eR+rqiAIGsC7UbqtGu1c7yDOiFRRJ2cjK5cnAqGBndMF r+44qlXFTYTXXdDBfFYLtEHZMrtQmAmfeNIBHHTYYt2/f0mHLSkziew+gY8PyBkJ9Ltb s9eRlUbjSn9uuuORJjnPnQ2B1aF1qmVzuDq3t22aQ0ioKAHPRD/H1lK5iXiOpS77mYMH Z0nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=DCQzgc7HZIXkjhrSZNLJQoxchuiI/YLWggopgdNCG/w=; fh=usGf5YuzJErDBs3RZupISTmb3HS19kiaPLLfDcr/Qdk=; b=OJQdujqIFIS0SaL6BLhAkf4Lz+hPcZtvMmuf2fbPjvCKd86ofXa30FwcpkS7gJyz1r /r3QtQHMjngtmWfzEK5c+2vxTVVMydYAD5dW+OY1aQKnVULh2tbgca1wSle6+AhCjH3o bCL0cuz0nyNbF/TU5htBHjvFo2JFPUDQa+RHtDndRvT491b3AtZKS6RqcXrs/hVe0AFA CUE9+dePUl65zLUD5a+pgUK9UyOg+ho1mWtBNabVpHfkVNvOSSD7HpGc/0qqX595HhU/ mC5kX+Gl8Lcr0kZdS3hTi/vFEkCCt7mtaYxcZnHxXzMb22hJC71ns6d4eXbD5Oe1UJmo 4o5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=V0ZipNc7; spf=pass (google.com: domain of linux-kernel+bounces-3985-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3985-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h11-20020a67c58b000000b00466a20d83d0si171591vsk.778.2023.12.18.07.52.07 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 07:52:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3985-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=V0ZipNc7; spf=pass (google.com: domain of linux-kernel+bounces-3985-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3985-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 518A91C24576 for <ouuuleilei@gmail.com>; Mon, 18 Dec 2023 15:52:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 024B75A863; Mon, 18 Dec 2023 15:49:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V0ZipNc7" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.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 AB7904FF89 for <linux-kernel@vger.kernel.org>; Mon, 18 Dec 2023 15:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-55372c1338bso886696a12.2 for <linux-kernel@vger.kernel.org>; Mon, 18 Dec 2023 07:49:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702914548; x=1703519348; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=DCQzgc7HZIXkjhrSZNLJQoxchuiI/YLWggopgdNCG/w=; b=V0ZipNc7cYu/D0tASq6sGcfXmUAg1wuUB8WeTm1QuibrxV6JZt0dB6pVGzf2pBiAje CtIqoaXerxLBIFjyv62RAmqLs3sJMGMfhc3Q2d0xnP9Z5UUH+HxxbBr4bROimIhBGV4u y3x7GUWTa9pK3Omsle12Pkyeb9CD+fDNTu0e13Wc1OFMNV/f1S0oBL7r3867waV/1wZz wGHtQkUSwyOe7UYrywlBOyXsD/HflOeSlnDecNTzzS0lbZvRKxFAm3sVc/qLjVTHvwAU bGMZkuqi2SUcrZlUh9tpSY2NqllX2zLqnthhkEFAOXjmSBbxmyVNzBNus52NTvDccDKD jn6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702914548; x=1703519348; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DCQzgc7HZIXkjhrSZNLJQoxchuiI/YLWggopgdNCG/w=; b=s8llZ/G9shUV9VhpQK4W4l96iKLpdy9gJ6A+vnErN9xyL6ixHIYPhwXWdPzcdz/tHo aOKD0RTG52zQVoXPXywKbipybFlpgKN3CyDWBHZpffV5ovSKRIdseFawleK0lzPniUTT hy6oaJwaE4hn6uCyDj8cr1oMvj3JTgawod7XkauDlxKOBcBkKWBN35X5D7t5/MVwGSdt U9lyvEnOjTvRAQRnQRGd09UQpuJATYeckwpu2vxfWxM+u7m9drK+n6KGx9/6KBcOLicI 9hxKAEAj99oYRIm/EDfIUii0V8BEuFohgv2FImg9/WphZz0pWrETe7xoThL/B1p6uzVW O00Q== X-Gm-Message-State: AOJu0Yw0/JN/SMzUlWYaHhUNZVWzgCx0W9gVMzriI4imDp9NYGE5LH2m MsiHTpoCf7DD5wiX9ngo0WI= X-Received: by 2002:a17:906:da08:b0:a19:a19a:eadf with SMTP id fi8-20020a170906da0800b00a19a19aeadfmr7048806ejb.152.1702914547563; Mon, 18 Dec 2023 07:49:07 -0800 (PST) Received: from [192.168.2.1] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id v19-20020a170906489300b00a236378a43fsm654118ejq.62.2023.12.18.07.49.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Dec 2023 07:49:07 -0800 (PST) Message-ID: <410b116b-cb63-7ba7-3689-4f0832ab5796@gmail.com> Date: Mon, 18 Dec 2023 16:49:06 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 From: Johan Jonker <jbx6244@gmail.com> Subject: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook To: hjc@rock-chips.com, heiko@sntech.de, andy.yan@rock-chips.com Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org References: <f86ec29f-194a-800d-0aaf-9e16e551b37d@gmail.com> Content-Language: en-US In-Reply-To: <f86ec29f-194a-800d-0aaf-9e16e551b37d@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785635513444436178 X-GMAIL-MSGID: 1785635513444436178 |
Series |
Rockchip rk3066_hdmi update
|
|
Commit Message
Johan Jonker
Dec. 18, 2023, 3:49 p.m. UTC
CRTC size validation for the display controller has been added with
Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
hardware capabilities"), so we can drop the custom fill_modes hook.
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
drivers/gpu/drm/rockchip/rk3066_hdmi.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
--
2.39.2
Comments
Hi, On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote: > CRTC size validation for the display controller has been added with > Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to > hardware capabilities"), so we can drop the custom fill_modes hook. > > Signed-off-by: Johan Jonker <jbx6244@gmail.com> I'm not sure those two are equivalent. CRTC and connectors usually have different requirements and capabilities, and thus different, supplementary, mode_valid/atomic_check implementations. Maxime
On 12/19/23 13:55, Maxime Ripard wrote: > Hi, > > On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote: >> CRTC size validation for the display controller has been added with >> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to >> hardware capabilities"), so we can drop the custom fill_modes hook. >> >> Signed-off-by: Johan Jonker <jbx6244@gmail.com> > > I'm not sure those two are equivalent. CRTC and connectors usually have > different requirements and capabilities, and thus different, > supplementary, mode_valid/atomic_check implementations. Rockchip RK3066 CRTC and connector resolution max_output are equivalent. From Rockchip PX2 TRM V1.0.pdf page 17: - Video Encoder Maximum frame rate is up to 30fps@1920x1080 - Display Interface Support LCD or TFT interfaces up to 1920x1080 - HDMI TX Interface HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant transmitter Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by LCDC0 or LCDC1 in RK PX2 Compared to the drm_helper_probe_single_connector_modes() this function added an extra max_output Checked in rockchip_drm_vop.c is: https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pengutronix.de/ + if (vop->data->max_output.width && mode->hdisplay > vop->data->max_output.width) + return MODE_BAD_HVALUE; + + if (vop->data->max_output.height && mode->vdisplay > vop->data->max_output.height) + return MODE_BAD_VVALUE; For RK3066 VOP max_output: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506 This patch was made with HDMI in mind. .max_output = { 1920, 1080 }, This first part was added by Heiko, but not was not part my patch that I submitted: - if (maxX > 1920) - maxX = 1920; - if (maxY > 1080) - maxY = 1080; - - return drm_helper_probe_single_connector_modes(connector, maxX, maxY); -} Original patch: https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6244@gmail.com +static int +rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector, + uint32_t maxX, uint32_t maxY) +{ + return drm_helper_probe_single_connector_modes(connector, 1920, 1080); +} Rockchip RK3066 CRTC and connector resolution max_output are equivalent. Johan > > Maxime
On Tue, Dec 19, 2023 at 04:40:12PM +0100, Johan Jonker wrote: > > > On 12/19/23 13:55, Maxime Ripard wrote: > > Hi, > > > > On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote: > >> CRTC size validation for the display controller has been added with > >> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to > >> hardware capabilities"), so we can drop the custom fill_modes hook. > >> > >> Signed-off-by: Johan Jonker <jbx6244@gmail.com> > > > > > I'm not sure those two are equivalent. CRTC and connectors usually have > > different requirements and capabilities, and thus different, > > supplementary, mode_valid/atomic_check implementations. > > Rockchip RK3066 CRTC and connector resolution max_output are equivalent. > > From Rockchip PX2 TRM V1.0.pdf page 17: > - Video Encoder > Maximum frame rate is up to 30fps@1920x1080 > > - Display Interface > Support LCD or TFT interfaces up to 1920x1080 > > - HDMI TX Interface > HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant transmitter > Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by LCDC0 or LCDC1 in RK PX2 My point is that there's two limits: the CRTC and HDMI controller ones. You should put the CRTC ones in the CRTC driver, and the HDMI controller ones in the HDMI controller driver. If they are equivalent, great, it's going to filter out the same things, but... > Compared to the drm_helper_probe_single_connector_modes() this function added an extra max_output > > Checked in rockchip_drm_vop.c is: > https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pengutronix.de/ > > + if (vop->data->max_output.width && mode->hdisplay > vop->data->max_output.width) > + return MODE_BAD_HVALUE; > + > + if (vop->data->max_output.height && mode->vdisplay > vop->data->max_output.height) > + return MODE_BAD_VVALUE; > > For RK3066 VOP max_output: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506 > > This patch was made with HDMI in mind. > > .max_output = { 1920, 1080 }, > > This first part was added by Heiko, but not was not part my patch that I submitted: > - if (maxX > 1920) > - maxX = 1920; > - if (maxY > 1080) > - maxY = 1080; > - > - return drm_helper_probe_single_connector_modes(connector, maxX, maxY); > -} > > Original patch: > https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6244@gmail.com > > +static int > +rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector, > + uint32_t maxX, uint32_t maxY) > +{ > + return drm_helper_probe_single_connector_modes(connector, 1920, 1080); > +} > > Rockchip RK3066 CRTC and connector resolution max_output are equivalent. ... a user / dev unfamiliar with the SoC won't have to go through that to figure out how it's handled, it will be obvious. Maxime
diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index 0dac6d133767..6dadd753985c 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -501,18 +501,6 @@ rk3066_hdmi_connector_best_encoder(struct drm_connector *connector) return &hdmi->encoder.encoder; } -static int -rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector, - uint32_t maxX, uint32_t maxY) -{ - if (maxX > 1920) - maxX = 1920; - if (maxY > 1080) - maxY = 1080; - - return drm_helper_probe_single_connector_modes(connector, maxX, maxY); -} - static void rk3066_hdmi_connector_destroy(struct drm_connector *connector) { drm_connector_unregister(connector); @@ -520,7 +508,7 @@ static void rk3066_hdmi_connector_destroy(struct drm_connector *connector) } static const struct drm_connector_funcs rk3066_hdmi_connector_funcs = { - .fill_modes = rk3066_hdmi_probe_single_connector_modes, + .fill_modes = drm_helper_probe_single_connector_modes, .detect = rk3066_hdmi_connector_detect, .destroy = rk3066_hdmi_connector_destroy, .reset = drm_atomic_helper_connector_reset,