From patchwork Sun May 4 15:26:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 4107731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BBB9D9F271 for ; Sun, 4 May 2014 15:29:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D9C5203F7 for ; Sun, 4 May 2014 15:29:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 665E4203EC for ; Sun, 4 May 2014 15:29:18 +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 1WgyK3-0007Pc-Vk; Sun, 04 May 2014 15:27:23 +0000 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WgyJp-0006Zx-RW for linux-arm-kernel@lists.infradead.org; Sun, 04 May 2014 15:27:10 +0000 Received: by mail-pa0-f53.google.com with SMTP id kp14so3564535pab.12 for ; Sun, 04 May 2014 08:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8s54KASTKMaI+7g69bUkCyIUEjrVMQLbwRUi+wdSQ9w=; b=hQd3clGhgrykKU+V82pHKvqYU+7Ymyu7IiCAntyx+i8xP9qiqM5cvewHXobkH96114 Q2YMm3R4zv6mFpnSWMU13laVMb+pxzSyseRhLeFyH/GiXx3tHP38OL2N7PtCKuFchku4 NivFzMDCgbYaKxCyAYMjSj2hoSvVdlglSLemI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8s54KASTKMaI+7g69bUkCyIUEjrVMQLbwRUi+wdSQ9w=; b=hIiFXbGH1ZDMNUc5iBYkdMgJoZESmWltZB2eoM5kgl7nSxn+n+cEZHueUfRnxrk9kR wAJXAIr+G8eNt5ZSHUF8N3KN/oD3UyYe/SWjvxnTrqrVv/KBXOzNhk8t9FUnzH+88de0 NnGzml4+QFL0gvTPzElOJA8kR1uoqwAOeUcLAUrT+Ha2baQ9jqbRjTrAEhzscrDCKccI 6YSKaaOnwGbH/SvC8DdFDnGmpoQ5DAe782QNV/WL6MKWPDiE8Pqab8gj/VKAF4tv0eUJ dhEgDO8a7BS7HLB+NnaeCEyIynTHxPOg9FvmtHMOk5T/9B1V0gQ8FwvtV1p7cYW7RVF6 tlnw== X-Gm-Message-State: ALoCoQk7jm2HzpzIUKufWV+AfUXH7JmwznVFaWjZd2PIl9rnferz9HQWAbYzzBupnRcsau9xp7uU X-Received: by 10.66.148.70 with SMTP id tq6mr61865660pab.56.1399217208808; Sun, 04 May 2014 08:26:48 -0700 (PDT) Received: from djkurtzt530-glaptop.hitronhub.home (123-193-41-132.dynamic.kbronet.com.tw. [123.193.41.132]) by mx.google.com with ESMTPSA id ry10sm48005129pab.38.2014.05.04.08.26.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 04 May 2014 08:26:48 -0700 (PDT) From: Daniel Kurtz To: Inki Dae , Kukjin Kim Subject: [PATCH 4/4] drm/exynos/mixer: add support for NV21 Date: Sun, 4 May 2014 23:26:21 +0800 Message-Id: <1399217181-26442-5-git-send-email-djkurtz@chromium.org> X-Mailer: git-send-email 1.9.1.423.g4596e3a In-Reply-To: <1399217181-26442-1-git-send-email-djkurtz@chromium.org> References: <1399217181-26442-1-git-send-email-djkurtz@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140504_082709_913515_14A1999A X-CRM114-Status: GOOD ( 12.96 ) X-Spam-Score: -0.1 (/) Cc: linux-samsung-soc@vger.kernel.org, Joonyoung Shim , David Airlie , Seung-Woo Kim , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kyungmin Park , seanpaul@chromium.org, Daniel Kurtz , marcheu@chromium.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP AFAICT, the only difference between NV12 and NV21 is Cr:Cb vs Cb:Cr. Since the video processor can handle either order, it should be able to handle both formats. Signed-off-by: Daniel Kurtz --- drivers/gpu/drm/exynos/exynos_drm_plane.c | 1 + drivers/gpu/drm/exynos/exynos_mixer.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 8371cbd..bf2be7a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -31,6 +31,7 @@ static const uint32_t formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_NV12, DRM_FORMAT_NV12MT, + DRM_FORMAT_NV21, }; /* diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index b252ec7..52a94d9 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -383,8 +383,8 @@ static void vp_video_buffer(struct mixer_context *ctx, int win) struct hdmi_win_data *win_data; unsigned int x_ratio, y_ratio; dma_addr_t luma_addr[2], chroma_addr[2]; - bool tiled_mode = false; - bool crcb_mode = false; + bool tiled_mode; + bool crcb_mode; u32 val; win_data = &ctx->win_data[win]; @@ -392,10 +392,16 @@ static void vp_video_buffer(struct mixer_context *ctx, int win) switch (win_data->pixel_format) { case DRM_FORMAT_NV12MT: tiled_mode = true; - /* fall through */ + crcb_mode = false; + break; case DRM_FORMAT_NV12: + tiled_mode = false; crcb_mode = false; break; + case DRM_FORMAT_NV21: + tiled_mode = false; + crcb_mode = true; + break; /* TODO: single buffer format NV12, NV21 */ default: DRM_ERROR("pixel format for vp is wrong [%d].\n",