From patchwork Mon May 4 08:07:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 6323671 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 16CD6BEEE1 for ; Mon, 4 May 2015 08:08:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3374B202A1 for ; Mon, 4 May 2015 08:08:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4178A202D1 for ; Mon, 4 May 2015 08:08:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752116AbbEDIIM (ORCPT ); Mon, 4 May 2015 04:08:12 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:36501 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751964AbbEDIHn (ORCPT ); Mon, 4 May 2015 04:07:43 -0400 Received: by lagv1 with SMTP id v1so98791926lag.3; Mon, 04 May 2015 01:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GGdz8KKoKRzlY5vEHZMw368Y5xVXL8G0Org+IJwhM5w=; b=T8dzAleUGs24QfISarN89P6oHgfRP4MLWH7jxXN1ST0MyQSkSfyzY00EnR4SqljPvs AHpUUpUzTr4iFX6FZUiO6vkuapso4c+ccBVTuXTqLcgxnCDblBSYro4PxGZc0tzwIW9v NfpSDYMxGDiBOZSXlIZO0ekowLDkUVXAjJ1x/yRmNGaCQSb5UsWIjcUUhxedBeziAjPi gYJASOeFF/f06vf7kzoK+v+IGYIl51UiPJMPTF3EgSZDxQME58PFSOHEuLOd4thtNIBO /tdrECwjTbsXsv5x/R9DEiOyxCHLvGFIXjnSovpPJYCrB/mfOhUNwR5IvUWC6nH3m2xe jE5w== X-Received: by 10.112.157.164 with SMTP id wn4mr18857104lbb.100.1430726861273; Mon, 04 May 2015 01:07:41 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by mx.google.com with ESMTPSA id og9sm239159lbb.22.2015.05.04.01.07.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 May 2015 01:07:40 -0700 (PDT) From: Ricardo Ribalda Delgado To: Hans Verkuil , Mauro Carvalho Chehab , Laurent Pinchart , Sakari Ailus , Ramakrishnan Muthukrishnan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH 3/4] media/vivid: Add support for Y16_BE format Date: Mon, 4 May 2015 10:07:31 +0200 Message-Id: <1430726852-11715-4-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1430726852-11715-1-git-send-email-ricardo.ribalda@gmail.com> References: <1430726852-11715-1-git-send-email-ricardo.ribalda@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 Support for V4L2_PIX_FMT_Y16_BE, a 16 bit big endian greyscale format. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/platform/vivid/vivid-tpg.c | 9 ++++++++- drivers/media/platform/vivid/vivid-vid-common.c | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index 9e50303a19c5..2e5129a6bc2f 100644 --- a/drivers/media/platform/vivid/vivid-tpg.c +++ b/drivers/media/platform/vivid/vivid-tpg.c @@ -221,6 +221,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) case V4L2_PIX_FMT_ABGR32: case V4L2_PIX_FMT_GREY: case V4L2_PIX_FMT_Y16: + case V4L2_PIX_FMT_Y16_BE: tpg->is_yuv = false; break; case V4L2_PIX_FMT_YUV444: @@ -315,6 +316,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) case V4L2_PIX_FMT_YUV555: case V4L2_PIX_FMT_YUV565: case V4L2_PIX_FMT_Y16: + case V4L2_PIX_FMT_Y16_BE: tpg->twopixelsize[0] = 2 * 2; break; case V4L2_PIX_FMT_RGB24: @@ -715,7 +717,8 @@ static void precalculate_color(struct tpg_data *tpg, int k) b <<= 4; } if (tpg->qual == TPG_QUAL_GRAY || tpg->fourcc == V4L2_PIX_FMT_GREY || - tpg->fourcc == V4L2_PIX_FMT_Y16) { + tpg->fourcc == V4L2_PIX_FMT_Y16 || + tpg->fourcc == V4L2_PIX_FMT_Y16_BE) { /* Rec. 709 Luma function */ /* (0.2126, 0.7152, 0.0722) * (255 * 256) */ r = g = b = (13879 * r + 46688 * g + 4713 * b) >> 16; @@ -902,6 +905,10 @@ static void gen_twopix(struct tpg_data *tpg, buf[0][offset] = 0; buf[0][offset+1] = r_y; break; + case V4L2_PIX_FMT_Y16_BE: + buf[0][offset] = r_y; + buf[0][offset+1] = 0; + break; case V4L2_PIX_FMT_YUV422P: case V4L2_PIX_FMT_YUV420: case V4L2_PIX_FMT_YUV420M: diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c index 96ccd3c38dd2..45f10a7f9b46 100644 --- a/drivers/media/platform/vivid/vivid-vid-common.c +++ b/drivers/media/platform/vivid/vivid-vid-common.c @@ -197,6 +197,14 @@ struct vivid_fmt vivid_formats[] = { .buffers = 1, }, { + .fourcc = V4L2_PIX_FMT_Y16_BE, + .vdownsampling = { 1 }, + .bit_depth = { 16 }, + .is_yuv = true, + .planes = 1, + .buffers = 1, + }, + { .fourcc = V4L2_PIX_FMT_RGB332, /* rrrgggbb */ .vdownsampling = { 1 }, .bit_depth = { 8 },