Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753007AbdDJKyS (ORCPT ); Mon, 10 Apr 2017 06:54:18 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:39836 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752144AbdDJKyQ (ORCPT ); Mon, 10 Apr 2017 06:54:16 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7807860910 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=architt@codeaurora.org Subject: Re: [PATCH] drm: dw-hdmi: Implement the mode_fixup drm helper To: Romain Perier , David Airlie , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20170407121743.4142-1-romain.perier@collabora.com> <20170407183307.etouyzkwr6yzchan@phenom.ffwll.local> From: Archit Taneja Message-ID: <24a858d4-fba4-3218-dffd-8185a070fd9d@codeaurora.org> Date: Mon, 10 Apr 2017 16:24:10 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170407183307.etouyzkwr6yzchan@phenom.ffwll.local> 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 Content-Length: 2785 Lines: 80 On 04/08/2017 12:03 AM, Daniel Vetter wrote: > On Fri, Apr 07, 2017 at 02:17:43PM +0200, Romain Perier wrote: >> This helper is supposed to validate or reject the modeline before it >> applied by the mode setting. Currently this function has been dropped, >> it was previously set to a dummy function that always returned true. For >> both cases, this means that userspace can ask for a bad modeline that >> will be always accepted. >> >> On some platforms, like Rockchip, the drm dw_hdmi-rockchip variant driver >> already implements the atomic_check drm helper, so mode_fixup cannot be >> handled and implemented there (as drm_atomic_helper relies on either >> atomic_check or mode_fixup). >> >> This commit implements this helper. It only checks that this mode is >> correct from the connector point of view >> >> Signed-off-by: Romain Perier > > Yup this is how it's supposed to be done, check bridge limits in the > bridge's mode_fixup hook. > > Acked-by: Daniel Vetter queued to drm-misc-next-fixes (so that it makes it into 4.12). Thanks, Archit >> --- >> drivers/gpu/drm/bridge/dw-hdmi.c | 16 ++++++++++++++++ >> 1 file changed, 16 insertions(+) >> >> diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c >> index 22211ff..3bd0807 100644 >> --- a/drivers/gpu/drm/bridge/dw-hdmi.c >> +++ b/drivers/gpu/drm/bridge/dw-hdmi.c >> @@ -1740,6 +1740,21 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge) >> return 0; >> } >> >> + >> +static bool dw_hdmi_bridge_mode_fixup(struct drm_bridge *bridge, >> + const struct drm_display_mode *orig_mode, >> + struct drm_display_mode *mode) >> +{ >> + struct dw_hdmi *hdmi = bridge->driver_private; >> + struct drm_connector *connector = &hdmi->connector; >> + enum drm_mode_status status; >> + >> + status = dw_hdmi_connector_mode_valid(connector, mode); >> + if (status != MODE_OK) >> + return false; >> + return true; >> +} >> + >> static void dw_hdmi_bridge_mode_set(struct drm_bridge *bridge, >> struct drm_display_mode *orig_mode, >> struct drm_display_mode *mode) >> @@ -1781,6 +1796,7 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = { >> .enable = dw_hdmi_bridge_enable, >> .disable = dw_hdmi_bridge_disable, >> .mode_set = dw_hdmi_bridge_mode_set, >> + .mode_fixup = dw_hdmi_bridge_mode_fixup, >> }; >> >> static irqreturn_t dw_hdmi_i2c_irq(struct dw_hdmi *hdmi) >> -- >> 2.9.3 >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel > -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project