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: 4107631 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3EEFABFF02 for ; Sun, 4 May 2014 15:26:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DB6820148 for ; Sun, 4 May 2014 15:26:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 99CCF2011B for ; Sun, 4 May 2014 15:26:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E9A6A6E5FB; Sun, 4 May 2014 08:26:49 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F26B6E5FB for ; Sun, 4 May 2014 08:26:49 -0700 (PDT) Received: by mail-pa0-f51.google.com with SMTP id kq14so1171342pab.10 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=RlqImwzYL8Em0erKCnSSDEjHB3IgZbxNTIatyzOHRUqJt/GynGwVRB5XoraKm+7Vt4 DtStKs/Nr7K6JORKVwYbsEizoihJoHogmgV5cs/ta0xgfwYjUIHMNFOD8AR23ZtKCE+e k11FxEyEkXmpe82Ca4AlkKJUT3TP22D1IBPTh+aoNbzfd8w3qDN9I7t1TD0EGMLyDgU8 hdz5TKUNssq6Qd9aeLd6T4I3jk/YqOoMd4QwBXoxlC5dHsLmwDsIOKpSJE9h6dNCFbdb IdxSKexZLcs+KofipT6Eejd1GohzCJ6MBhF4HRJUyPPYiLN21YFK12/9gN3vjO6zp9Yi r5Pg== X-Gm-Message-State: ALoCoQlU053Ogh/0xH6rQPQu5cgCGxGPVVvqtY4b7pkWq7RNBtDfmadbukBa5b51rosOkAenF9w0 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> Cc: linux-samsung-soc@vger.kernel.org, Seung-Woo Kim , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kyungmin Park , marcheu@chromium.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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",