From patchwork Sun May 31 13:11:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 6516011 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6ECB79F40A for ; Sun, 31 May 2015 13:12:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E54D20625 for ; Sun, 31 May 2015 13:12:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86E73205C6 for ; Sun, 31 May 2015 13:12:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758222AbbEaNME (ORCPT ); Sun, 31 May 2015 09:12:04 -0400 Received: from lb1-smtp-cloud3.xs4all.net ([194.109.24.22]:48057 "EHLO lb1-smtp-cloud3.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758147AbbEaNMB (ORCPT ); Sun, 31 May 2015 09:12:01 -0400 Received: from tschai.lan ([80.203.20.209]) by smtp-cloud3.xs4all.net with ESMTP id adBo1q00E4Wfp8Y01dC0LA; Sun, 31 May 2015 15:12:00 +0200 Received: from tschai.fritz.box (localhost [127.0.0.1]) by tschai.lan (Postfix) with ESMTPSA id 7C5652A0686; Sun, 31 May 2015 15:11:41 +0200 (CEST) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Hans Verkuil Subject: [PATCH 7/9] cobalt: support transfer function Date: Sun, 31 May 2015 15:11:37 +0200 Message-Id: <1433077899-18516-8-git-send-email-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433077899-18516-1-git-send-email-hverkuil@xs4all.nl> References: <1433077899-18516-1-git-send-email-hverkuil@xs4all.nl> 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Hans Verkuil Add support for the transfer function to the cobalt driver: make sure it is passed on to/retrieved from the sub-device correctly. Signed-off-by: Hans Verkuil --- drivers/media/pci/cobalt/cobalt-driver.h | 1 + drivers/media/pci/cobalt/cobalt-v4l2.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/drivers/media/pci/cobalt/cobalt-driver.h b/drivers/media/pci/cobalt/cobalt-driver.h index f63ce19..c206df9 100644 --- a/drivers/media/pci/cobalt/cobalt-driver.h +++ b/drivers/media/pci/cobalt/cobalt-driver.h @@ -231,6 +231,7 @@ struct cobalt_stream { u32 pixfmt; u32 sequence; u32 colorspace; + u32 xfer_func; u32 ycbcr_enc; u32 quantization; diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c index 8b14bec..72b081f 100644 --- a/drivers/media/pci/cobalt/cobalt-v4l2.c +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c @@ -170,6 +170,7 @@ static void cobalt_enable_output(struct cobalt_stream *s) } sd_fmt.format.colorspace = s->colorspace; + sd_fmt.format.xfer_func = s->xfer_func; sd_fmt.format.ycbcr_enc = s->ycbcr_enc; sd_fmt.format.quantization = s->quantization; sd_fmt.format.width = bt->width; @@ -737,6 +738,7 @@ static int cobalt_g_fmt_vid_cap(struct file *file, void *priv_fh, v4l2_subdev_call(s->sd, pad, get_fmt, NULL, &sd_fmt); v4l2_fill_pix_format(pix, &sd_fmt.format); pix->colorspace = sd_fmt.format.colorspace; + pix->xfer_func = sd_fmt.format.xfer_func; pix->ycbcr_enc = sd_fmt.format.ycbcr_enc; pix->quantization = sd_fmt.format.quantization; } @@ -782,6 +784,7 @@ static int cobalt_try_fmt_vid_cap(struct file *file, void *priv_fh, v4l2_subdev_call(s->sd, pad, get_fmt, NULL, &sd_fmt); v4l2_fill_pix_format(pix, &sd_fmt.format); pix->colorspace = sd_fmt.format.colorspace; + pix->xfer_func = sd_fmt.format.xfer_func; pix->ycbcr_enc = sd_fmt.format.ycbcr_enc; pix->quantization = sd_fmt.format.quantization; } @@ -897,6 +900,7 @@ static int cobalt_g_fmt_vid_out(struct file *file, void *priv_fh, pix->field = V4L2_FIELD_NONE; pix->pixelformat = s->pixfmt; pix->colorspace = s->colorspace; + pix->xfer_func = s->xfer_func; pix->ycbcr_enc = s->ycbcr_enc; pix->quantization = s->quantization; pix->sizeimage = pix->bytesperline * pix->height; @@ -953,11 +957,13 @@ static int cobalt_s_fmt_vid_out(struct file *file, void *priv_fh, s->stride = pix->bytesperline; s->pixfmt = pix->pixelformat; s->colorspace = pix->colorspace; + s->xfer_func = pix->xfer_func; s->ycbcr_enc = pix->ycbcr_enc; s->quantization = pix->quantization; sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; v4l2_subdev_call(s->sd, pad, get_fmt, NULL, &sd_fmt); sd_fmt.format.colorspace = pix->colorspace; + sd_fmt.format.xfer_func = pix->xfer_func; sd_fmt.format.ycbcr_enc = pix->ycbcr_enc; sd_fmt.format.quantization = pix->quantization; v4l2_subdev_call(s->sd, pad, set_fmt, NULL, &sd_fmt);