From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751778AbdAXC2C (ORCPT ); Mon, 23 Jan 2017 21:28:02 -0500 Received: from regular1.263xmail.com ([211.150.99.136]:34285 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750873AbdAXC2A (ORCPT ); Mon, 23 Jan 2017 21:28:00 -0500 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-RL-SENDER: zyw@rock-chips.com X-FST-TO: linux-arm-kernel@lists.infradead.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: zyw@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH v3 3/5] drm/rockchip/dsi: remove mode_valid function To: Sean Paul References: <1484907051-7159-1-git-send-email-zyw@rock-chips.com> <1484907051-7159-4-git-send-email-zyw@rock-chips.com> <20170123174841.GB25789@trickycodes.roam.corp.google.com> Cc: dianders@chromium.org, tfiga@chromium.org, heiko@sntech.de, yzq@rock-chips.com, mark.rutland@arm.com, devicetree@vger.kernel.org, robh+dt@kernel.org, galak@codeaurora.org, pawel.moll@arm.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org From: Chris Zhong Message-ID: <5886BB8F.6040707@rock-chips.com> Date: Tue, 24 Jan 2017 10:27:27 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20170123174841.GB25789@trickycodes.roam.corp.google.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sean On 01/24/2017 01:48 AM, Sean Paul wrote: > On Fri, Jan 20, 2017 at 06:10:49PM +0800, Chris Zhong wrote: >> The MIPI DSI do not need check the validity of resolution, the max >> resolution should depend VOP. Hence, remove rk3288_mipi_dsi_mode_valid >> here. > Does vop actually enforce this, though? I see that mode_config.max_width is > 4096, but there is no bounds checking in mode_fixup(). > > The connector is currently rejecting everything greater than 2047. So I think > you're going to regress behavior here. > > Sean The mipi controller has not this width limit, it depend the VOP, such as RK3399, VOP_LIT only support 2560, but VOP_BIG support 4K. So this driver should check the width here. > > >> Signed-off-by: Chris Zhong >> --- >> >> Changes in v3: None >> >> drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 39 ---------------------------------- >> 1 file changed, 39 deletions(-) >> >> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c >> index a93ce97..6f0e252 100644 >> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c >> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c >> @@ -278,8 +278,6 @@ struct dw_mipi_dsi_plat_data { >> u32 grf_dsi0_mode; >> u32 grf_dsi0_mode_reg; >> unsigned int max_data_lanes; >> - enum drm_mode_status (*mode_valid)(struct drm_connector *connector, >> - struct drm_display_mode *mode); >> }; >> >> struct dw_mipi_dsi { >> @@ -1081,23 +1079,8 @@ static int dw_mipi_dsi_connector_get_modes(struct drm_connector *connector) >> return drm_panel_get_modes(dsi->panel); >> } >> >> -static enum drm_mode_status dw_mipi_dsi_mode_valid( >> - struct drm_connector *connector, >> - struct drm_display_mode *mode) >> -{ >> - struct dw_mipi_dsi *dsi = con_to_dsi(connector); >> - >> - enum drm_mode_status mode_status = MODE_OK; >> - >> - if (dsi->pdata->mode_valid) >> - mode_status = dsi->pdata->mode_valid(connector, mode); >> - >> - return mode_status; >> -} >> - >> static struct drm_connector_helper_funcs dw_mipi_dsi_connector_helper_funcs = { >> .get_modes = dw_mipi_dsi_connector_get_modes, >> - .mode_valid = dw_mipi_dsi_mode_valid, >> }; >> >> static void dw_mipi_dsi_drm_connector_destroy(struct drm_connector *connector) >> @@ -1168,33 +1151,11 @@ static int rockchip_mipi_parse_dt(struct dw_mipi_dsi *dsi) >> return 0; >> } >> >> -static enum drm_mode_status rk3288_mipi_dsi_mode_valid( >> - struct drm_connector *connector, >> - struct drm_display_mode *mode) >> -{ >> - /* >> - * The VID_PKT_SIZE field in the DSI_VID_PKT_CFG >> - * register is 11-bit. >> - */ >> - if (mode->hdisplay > 0x7ff) >> - return MODE_BAD_HVALUE; >> - >> - /* >> - * The V_ACTIVE_LINES field in the DSI_VTIMING_CFG >> - * register is 11-bit. >> - */ >> - if (mode->vdisplay > 0x7ff) >> - return MODE_BAD_VVALUE; >> - >> - return MODE_OK; >> -} >> - >> static struct dw_mipi_dsi_plat_data rk3288_mipi_dsi_drv_data = { >> .dsi0_en_bit = RK3288_DSI0_SEL_VOP_LIT, >> .dsi1_en_bit = RK3288_DSI1_SEL_VOP_LIT, >> .grf_switch_reg = RK3288_GRF_SOC_CON6, >> .max_data_lanes = 4, >> - .mode_valid = rk3288_mipi_dsi_mode_valid, >> }; >> >> static struct dw_mipi_dsi_plat_data rk3399_mipi_dsi_drv_data = { >> -- >> 2.6.3 >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel