From patchwork Thu Apr 6 09:34:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 9666739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 80E69601EB for ; Thu, 6 Apr 2017 09:34:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DFA9205A8 for ; Thu, 6 Apr 2017 09:34:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8276B22701; Thu, 6 Apr 2017 09:34:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BB226208C2 for ; Thu, 6 Apr 2017 09:34:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F21A56E125; Thu, 6 Apr 2017 09:34:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x22d.google.com (mail-wr0-x22d.google.com [IPv6:2a00:1450:400c:c0c::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D04F6E125 for ; Thu, 6 Apr 2017 09:34:12 +0000 (UTC) Received: by mail-wr0-x22d.google.com with SMTP id g19so8365570wrb.0 for ; Thu, 06 Apr 2017 02:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=Ni/QW8bsJp94v7C6h0HT0qGvLaO7A13wCUzVJ7Sx8jM=; b=uZnTF0Pa2iGZeq/WLmpkOPv3H7p9n9x/Moeuy0ZGhkt/BwCXpRj/rR5gY+15Mr15xH suX+y7f2wMeT1DQkqHXECM53hxrgkK5WZmxMCvtNFmaZf0/baiJbc1OJOF+9yqKk/pvN BfC/ScNmIIbjGjBTrfdwshOTPSstcu0TmXnVeSoJ8u6piwL5xoNZC+8BZ4xsA05X/Lif RYYYP86EMor7RsFj14H2mLe1zZDIQow7aaYD92PlzpQF5VX2diFIvFTMFQLVqxLJS51y 8BbVQ2sZavYPrVfj6dALWsRCb37cGA4Vo8YWFQ9l0zd+5ZXH0wRSBntHZIK/GJ9cQ3pD wLSg== 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; bh=Ni/QW8bsJp94v7C6h0HT0qGvLaO7A13wCUzVJ7Sx8jM=; b=p+R3oqy+7qVUHzA7WDCCSYaGw+KXUiAZLBji/r/XgxKbzzE3jI7Wn16ev5Misi8NoG Prhikv0uK1RFEob8aOnH2AzyMnxKNaHhAKg8wlG5hjwoTDxEJ9C1x69mpxIRZJ/gNhBo 4XfCTBXX8ETW5V5ngTfrBqB7YV1RebS+t/xr2tUAnhlG7YOa5AVr7z4Pccxv0KG+k6b9 ZHUChb444fbcDjezPRp3jM6b83bH0g9YfayTxYytw/FQ0e+BmwMEWGY0KAolfDLnVrQ3 8QvBlRS46+0fUoOoVygcS2t7IkN+NwqGCitzlLyioysftMZeHzcjx9Bd6v82w4KRxEDA hVDg== X-Gm-Message-State: AFeK/H0QcAVGCTGsXm97y9rNXf0jlnbheO0VLqmIyimE5htbKymBSfCVaDolOjOIR2Gd/UiL X-Received: by 10.223.146.164 with SMTP id 33mr29054972wrn.17.1491471251042; Thu, 06 Apr 2017 02:34:11 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id a66sm1393692wrc.58.2017.04.06.02.34.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Apr 2017 02:34:10 -0700 (PDT) From: Neil Armstrong To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data Date: Thu, 6 Apr 2017 11:34:04 +0200 Message-Id: <1491471244-24989-1-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 1.9.1 Cc: Jose.Abreu@synopsys.com, laurent.pinchart+renesas@ideasonboard.com, Neil Armstrong , linux-kernel@vger.kernel.org, Dan Carpenter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Dan Carpenter Signed-off-by: Neil Armstrong Reviewed-by: Archit Taneja --- 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