Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755180AbdDFJlb (ORCPT ); Thu, 6 Apr 2017 05:41:31 -0400 Received: from mail-wr0-f174.google.com ([209.85.128.174]:36028 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754291AbdDFJl0 (ORCPT ); Thu, 6 Apr 2017 05:41:26 -0400 Subject: Re: [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data To: dri-devel@lists.freedesktop.org References: <1491471244-24989-1-git-send-email-narmstrong@baylibre.com> Cc: laurent.pinchart+renesas@ideasonboard.com, architt@codeaurora.org, Jose.Abreu@synopsys.com, linux-kernel@vger.kernel.org, Dan Carpenter From: Neil Armstrong Organization: Baylibre Message-ID: <2b33c0f3-0752-b390-cc13-8aa9ec8f7451@baylibre.com> Date: Thu, 6 Apr 2017 11:41:21 +0200 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: <1491471244-24989-1-git-send-email-narmstrong@baylibre.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1848 Lines: 47 On 04/06/2017 11:34 AM, Neil Armstrong wrote: > The plat_data->input_bus_format and plat_data->input_bus_encoding > are unsigned long and are alsways >=0, but the value 0 was still > considered as RGB888 like the default behaviour. > > This patch changes the if test to > 0. > > Thanks to Dan Carpenter for his bug report at [1]. > > Tested on Amlogic P230 (with CSC enabled for YUV444 to RGB) and Rockchip > RK3288 ACT8846 EVB Board (no CSC involved, direct RGB passthrough). > > [1] http://lkml.kernel.org/r/20170406052120.GA26578@mwanda Forgot... Fixes: def23aa7e982 ("drm: bridge: dw-hdmi: Switch to V4L bus format and encodings") > > Cc: Dan Carpenter > Signed-off-by: Neil Armstrong > --- > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index 8b60503..100e1ee 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -1668,14 +1668,14 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode) > hdmi->hdmi_data.video_mode.mpixelrepetitioninput = 0; > > /* TOFIX: Get input format from plat data or fallback to RGB888 */ > - if (hdmi->plat_data->input_bus_format >= 0) > + if (hdmi->plat_data->input_bus_format) > hdmi->hdmi_data.enc_in_bus_format = > hdmi->plat_data->input_bus_format; > else > hdmi->hdmi_data.enc_in_bus_format = MEDIA_BUS_FMT_RGB888_1X24; > > /* TOFIX: Get input encoding from plat data or fallback to none */ > - if (hdmi->plat_data->input_bus_encoding >= 0) > + if (hdmi->plat_data->input_bus_encoding) > hdmi->hdmi_data.enc_in_encoding = > hdmi->plat_data->input_bus_encoding; > else >