From patchwork Tue May 24 05:02:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yakir Yang X-Patchwork-Id: 9132763 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 0C2686075E for ; Tue, 24 May 2016 05:03:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0415A281E3 for ; Tue, 24 May 2016 05:03:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC9E528282; Tue, 24 May 2016 05:03:14 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0B1D2281E3 for ; Tue, 24 May 2016 05:03:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b54Ur-0006dM-Ni; Tue, 24 May 2016 05:03:13 +0000 Received: from lucky1.263xmail.com ([211.157.147.131]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b54Up-0006KY-32 for linux-rockchip@lists.infradead.org; Tue, 24 May 2016 05:03:12 +0000 Received: from ykk?rock-chips.com (unknown [192.168.167.230]) by lucky1.263xmail.com (Postfix) with SMTP id 33FBC8E97C; Tue, 24 May 2016 13:02:47 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 20AB16688D; Tue, 24 May 2016 13:02:46 +0800 (CST) X-RL-SENDER: ykk@rock-chips.com X-FST-TO: airlied@linux.ie X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: ykk@rock-chips.com X-UNIQUE-TAG: <3eea97a9c885c55f11e62917a5a5ec5e> X-ATTACHMENT-NUM: 0 X-SENDER: ykk@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 248411TPX8M; Tue, 24 May 2016 13:02:48 +0800 (CST) From: Yakir Yang To: David Airlie , Inki Dae , Mark Yao , Thierry Reding , Jingoo Han , Rob Herring Subject: [PATCH v2 08/10] drm/rockchip: analogix_dp: correct the connector display color format and bpc Date: Tue, 24 May 2016 13:02:44 +0800 Message-Id: <1464066164-22863-1-git-send-email-ykk@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464066086-21967-1-git-send-email-ykk@rock-chips.com> References: <1464066086-21967-1-git-send-email-ykk@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160523_220311_701017_F04AF75D X-CRM114-Status: UNSURE ( 7.18 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, Heiko Stuebner , linux-rockchip@lists.infradead.org, Daniel Vetter , emil.l.velikov@gmail.com, Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Javier Martinez Canillas , Yakir Yang , Dan Carpenter MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Rockchip VOP couldn't output YUV video format for eDP controller, so when driver detect connector support YUV video format, we need to hack it down to RGB888. Signed-off-by: Yakir Yang Acked-by: Mark Yao --- Changes in v2: None drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c index f29ca3d..910cceb 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -97,6 +97,24 @@ static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data) return 0; } +static enum drm_mode_status +rockchip_dp_mode_valid(struct analogix_dp_plat_data *plat_data, + struct drm_connector *connector, + struct drm_display_mode *mode) +{ + struct drm_display_info *di = &connector->display_info; + + if (di->color_formats & DRM_COLOR_FORMAT_YCRCB444 || + di->color_formats & DRM_COLOR_FORMAT_YCRCB422) { + di->color_formats &= ~(DRM_COLOR_FORMAT_YCRCB422 | + DRM_COLOR_FORMAT_YCRCB444); + di->color_formats |= DRM_COLOR_FORMAT_RGB444; + di->bpc = 8; + } + + return MODE_OK; +} + static bool rockchip_dp_drm_encoder_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, @@ -306,6 +324,7 @@ static int rockchip_dp_bind(struct device *dev, struct device *master, dp->plat_data.subdev_type = dp_data->chip_type; dp->plat_data.power_on = rockchip_dp_poweron; dp->plat_data.power_off = rockchip_dp_powerdown; + dp->plat_data.mode_valid = rockchip_dp_mode_valid; return analogix_dp_bind(dev, dp->drm_dev, &dp->plat_data); }