Message ID | 20181123092515.2511-21-paul.kocialkowski@bootlin.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C2DA5175A for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 23 Nov 2018 09:43:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B142A2C298 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 23 Nov 2018 09:43:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4AC72C2AE; Fri, 23 Nov 2018 09:43:31 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4ED762C298 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 23 Nov 2018 09:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5UA2SnwjLExzvfBnZdJbos1Kt8phiqTiisXcJwsNZr0=; b=PIEd/RkEi2J0tX th+I1u/21I2Bflrr3BnhwjSFaOtc6QbWytpiOPfGqCPIwvPj7CK9cHPB+D0tqzrFVhSOIwgc0lDhE 2EaB2pJSjx0YcgfB4QMIwP54M0u2MreLh4phCiRkBn0Tk9EtnFWi1M8x+Fy77LtfGbR4augQfxGC7 w6RfRMHUds41vkkMiDhybqCQOenlIB9002qy4Bi+wqUgd2Ra8fN/TLReLOomf9YHdiHmKWeU0+V1g PcpS6+vqh0TEC21+XBASUWd8muUf/x6XjK/4QxSCHuVt72QK3D00xVFq7eUY2t/d9/ePziB2gATxj ZOZwDcWk24sszNHiWAmw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gQ7zk-0007u0-Mr; Fri, 23 Nov 2018 09:43:28 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gQ7ys-0006Xf-1Y for linux-arm-kernel@bombadil.infradead.org; Fri, 23 Nov 2018 09:42:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QJSuzhnfg8k9oynXdbgpTf2Z7q/l61cQ8aTZkKk9m34=; b=pVjeFfeFDiEfZ785nsi+8gs0pY suVK+JZu90xHYA3nxKE7jS3/WqBqVG4JTQnqbf97N9qqMcPTBkjC5gRFubLS7L00asoqcSO6AyOfP LNCwDKlScj6s5fghyCF/kC3YGPZrqxkZdgt7fol/2lTjIKq/9t6bKMq+325RLPILmg1R1VNX2gxYU 5s7E1VMC1p7rUR4K/kXFtc46PBk5f4kYAvycUhIQeKouNqjk1/BTvho1+6DGUPwXof7W29dF0zhcD anZfKKAQkSwo1Zg2R3GXgILj/pM7TStgbzAJULm0JSLTN6oMYjbmiLWqCm1Ki9rN3gD/4n9epWs1l zQPE6nkg==; Received: from mail.bootlin.com ([62.4.15.54]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gQ7k6-0006AS-9l for linux-arm-kernel@lists.infradead.org; Fri, 23 Nov 2018 09:27:23 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 23D3F20DE5; Fri, 23 Nov 2018 10:26:58 +0100 (CET) Received: from localhost.localdomain (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id A8AD320DED; Fri, 23 Nov 2018 10:26:32 +0100 (CET) From: Paul Kocialkowski <paul.kocialkowski@bootlin.com> To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 20/43] drm/sun4i: frontend: Determine input format based on colorspace Date: Fri, 23 Nov 2018 10:24:52 +0100 Message-Id: <20181123092515.2511-21-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181123092515.2511-1-paul.kocialkowski@bootlin.com> References: <20181123092515.2511-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181123_092718_441458_7455B99E X-CRM114-Status: GOOD ( 14.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Daniel Vetter <daniel@ffwll.ch>, Maxime Ripard <maxime.ripard@bootlin.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, linux-sunxi@googlegroups.com, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, David Airlie <airlied@linux.ie>, Chen-Yu Tsai <wens@csie.org>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Sean Paul <sean@poorly.run> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
drm/sun4i: Support for linear and tiled YUV formats with the frontend
|
expand
|
diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c index a16697b0eac5..7a8efbd516ac 100644 --- a/drivers/gpu/drm/sun4i/sun4i_frontend.c +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c @@ -106,14 +106,12 @@ EXPORT_SYMBOL(sun4i_frontend_update_buffer); static int sun4i_frontend_drm_format_to_input_fmt(uint32_t fmt, u32 *val) { - switch (fmt) { - case DRM_FORMAT_XRGB8888: + if (!drm_format_is_yuv(fmt)) *val = SUN4I_FRONTEND_INPUT_FMT_DATA_FMT_RGB; - return 0; - - default: + else return -EINVAL; - } + + return 0; } static int sun4i_frontend_drm_format_to_input_mode(uint32_t fmt, u32 *val)
Since all the RGB input formats have the same value for the DATA_FMT field of the INPUT_FMT register, we can group them when the format is known to be RGB. Here, we assume that a non-YUV format is RGB, because the hardware does not support any other colorspace than RGB and YUV. Thus, we can use the associated common DRM helper. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> --- drivers/gpu/drm/sun4i/sun4i_frontend.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)