Received: by 10.223.176.5 with SMTP id f5csp876779wra; Tue, 30 Jan 2018 21:18:24 -0800 (PST) X-Google-Smtp-Source: AH8x225/0NjevvxgEqVijxWS6ENIkZlptSXDhUzJBAFZ4rTymnpkogSgcXdf19DJl7WclZdZF1jX X-Received: by 2002:a17:902:a9cb:: with SMTP id b11-v6mr7403438plr.315.1517375903907; Tue, 30 Jan 2018 21:18:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517375903; cv=none; d=google.com; s=arc-20160816; b=TEgHxwli4roD7QuuUGJDcnRDXPMb02yJZIW5dH6n5zJEBtDzp4ZX7RmwzAMVQfh4I1 FUnfqLBB+yNIaXzlbU0fqLO+e/yRiphWjRwTPX1bokvTA24VkLUILTTB6MzrmNrfSZnq e4JlXWdcfsgK/IfM4at2OG3BUT2hqCrzN4cvLcel4ncoG+D4huiI+edWBsVcZswNlKSX Rwi+NdY8+8VyLWqdCrCgmnJgKSu710KgMZIufDYCVhhOUCIKreZopKtaddwdGrG6tE2V lCt5tN8HZAQKeT4l5bU4A2xtAprA+jV38+3V9H1aY4L5V6Ara9AOM66GC3uAxlP+1dny 4KFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=kuNEEovQReoXmr9EycoWvRvUfz+ooA6iHz615bCZ5N8=; b=GL47xqFewLjvOteJTRSAiTDitHP46FzJt4KF1Bnhq31uBDkbnviJQVt2FtHLVTMMcX j/DVp1t2kj0++94ktsrijK0ryLa5lnOhXSVTlGWIx/outoEfybYx/QUW6eK/N0wUi4Lu SmNc7Sz5XXFyE6RcplehykK4/JFiiDk6sOmyiRAoHMP48FxUWFUQAhK7L9gxj8gquZ0a E/5PhK4Fduk3IfuoNZ2qyjEMKtvhdORwMgpaEBkbFuWzKRgDWOixomqFs/JJ7CM4fKsx 7gfCFCfu4ZHD+3/I+UH0QX2DIjKGCOljPQ5DOYXhvc5GEJSiY51DJaDywy7c15pgKJn7 U1gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=XdVs3CK8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3-v6si1217833plb.330.2018.01.30.21.18.09; Tue, 30 Jan 2018 21:18:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=XdVs3CK8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752329AbeAaEvM (ORCPT + 99 others); Tue, 30 Jan 2018 23:51:12 -0500 Received: from mail-wr0-f173.google.com ([209.85.128.173]:40575 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751970AbeAaEvJ (ORCPT ); Tue, 30 Jan 2018 23:51:09 -0500 Received: by mail-wr0-f173.google.com with SMTP id i56so13545061wra.7 for ; Tue, 30 Jan 2018 20:51:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gateworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kuNEEovQReoXmr9EycoWvRvUfz+ooA6iHz615bCZ5N8=; b=XdVs3CK8GcEbJK4VSaEpyvqOQKw5zu1P0MqOQdrAqPwJiLYSU1PMBLiipVXrzg7Ebw cUp2YiyuSgjIfYMtgXgCYPBC7zFgC3yiHej5jreq98g8k+MTnXe50n4WkHSa7Va7uFgo o5Xyxydv8AIJuen0bfqBmldTVGiKwXcdnOZJLmtdoS/aJJlZGiFpEC5sEyRjdEYoSxWW 04p1Vve9ZIQ/P9E50WHmJ5HrB73K61/EPs0BjPQ97C162wUgB3B8DpPzV4pwr+QAGfkP Wsc+gLZ8HT7ciXqs9urRtq8ZOAll9r0VeFrBv9KiaRzpd60yE9GdcMaVa5l8iaiNNveN 2zGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kuNEEovQReoXmr9EycoWvRvUfz+ooA6iHz615bCZ5N8=; b=oEGIqWXUcnH+tyHoRzPlP2E89q9PD0anbB+6r4mz8AFBXNAglU7cWdbj9eUxN2HA7R xlq4fUDt47AAC3ggKgu4J4mWyLkLMw70gvqhHRl+7i43k9Q55esW61aa5Qs7597KNdRS xwvaoycA72fVxlJbNE2ybByehIMuX2SJvYA/6kXTGC0wDflVwcTywlexQTt2CaEBAxc1 tDCXcU7N/cNpTyQSIeJ9slOIKLIgvoe404W40VEBt1QvnqRdF3EkLn4kOFYZ9KPPVgje XuqCz6EE7fFtRb/hCt/zONhrfl6EkHGs+eJHIx8s9EZC0VzkXUkHJT95lcdQpvUiDdXO dEHA== X-Gm-Message-State: AKwxytfodqWig3WAAueOVjwzvIKllP/k/pIhEhwgkE6KabvnoHr0hTWs 1GpRGrpJ5z+8KKgEzkZuVKX/jqOPQKRViyH1C3DwsQ== X-Received: by 10.223.184.200 with SMTP id c8mr18975934wrg.105.1517374268208; Tue, 30 Jan 2018 20:51:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.66.74 with HTTP; Tue, 30 Jan 2018 20:51:07 -0800 (PST) In-Reply-To: <517f8b12-e10e-1e8d-6d98-26f5fefe62b8@xs4all.nl> References: <1514491789-8697-1-git-send-email-tharvey@gateworks.com> <1514491789-8697-5-git-send-email-tharvey@gateworks.com> <1e65ee61-f282-4b53-dd03-68a89a91da8e@xs4all.nl> <517f8b12-e10e-1e8d-6d98-26f5fefe62b8@xs4all.nl> From: Tim Harvey Date: Tue, 30 Jan 2018 20:51:07 -0800 Message-ID: Subject: Re: [PATCH v6 4/6] media: i2c: Add TDA1997x HDMI receiver driver To: Hans Verkuil Cc: linux-media , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo , Steve Longerbeam , Philipp Zabel , Hans Verkuil , Mauro Carvalho Chehab Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 29, 2018 at 4:00 AM, Hans Verkuil wrote: > On 01/25/2018 05:15 PM, Tim Harvey wrote: >>> >>> Hmm. This receiver supports multiple output formats, but you advertise only one. >>> That looks wrong. If nothing else, you should be able to switch between RGB and >>> YUV 4:4:4 since they use the same port config. >>> >>> It's a common use-case that you want to switch between RGB and YUV depending on >>> the source material (i.e. if you receive a desktop/graphics then RGB is best, if >>> you receive video then YUV 4:2:2 or 4:2:0 is best). >>> >>> Hardcoding just one format won't do. >>> >> >> I've been thinking about this a bit. I had hard-coded a single format >> for now because I haven't had any good ideas on how to deal with the >> fact that the port mappings would need to differ if you change from >> the RGB888/YUV444 (I think these are referred to as 'planar' formats?) >> to YUV422 (semi-planar) and BT656 formats. It is true though that the >> 36bit (TDA19973) RGB888/YUV444 and 24bit (TDA19971/2) formats can both >> be supported with the same port mappings / pinout. > > Regarding terminology: > > RGB and YUV are typically interleaved, i.e. the color components are > (for two pixels) either RGBRGB for RGB888, YUVYUV for YUV444 or YUYV > for YUV422. > > Planar formats are in practice only seen for YUV and will first output > all Y samples, and then the UV samples. This requires that the hardware > buffers the frame and that's not normally done by HDMI receivers. > > The DMA engine, however, is often able to split up the interleaved YUV > samples that it receives and DMA them to separate buffers, thus turning > an interleaved media bus format to a planar memory format. > > BT656 doesn't refer to how the samples are transferred, instead it > refers to how the hsync and vsync are reported. The enum v4l2_mbus_type > has various options, one of them being BT656. > > Which mbus type is used is board specific (and should come from the > device tree). Whether to transmit RGB888, YUV444 or YUV422 (or possibly > even YUV420) is dynamic and is up to userspace since it is use-case > dependent. > > So you'll never switch between BT656 and CSI, but you can switch between > BT656+RGB and BT656+YUV, or between CSI+RGB and CSI+YUV. > >> >> For example the GW5400 has a TDA19971 mapped to IMX6 CSI_DATA[19:4] >> (16bit) for YUV422. However if you want to use BT656 you have to shift >> the TDA19971 port mappings to get the YCbCr pins mapped to >> CSI_DATA[19:x] and those pin groups are at the bottom of the bus for >> the RGB888/YUV444 format. > > As mentioned above, you wouldn't switch between mbus types. > >> >> I suppose however that perhaps for the example above if I have a 16bit >> width required to support YUV422 there would never be a useful case >> for supporting 8-bit/10-bit/12-bit BT656 on the same board? > > You wouldn't switch between mbus types, but if the device tree configures > BT.656 with a bus width of 24 bits, then the application might very well > want to dynamically switch between 8, 10 and 12 bits per color component. > Hans, I just submitted a v7 with multiple format support. Your point about bus_type being specified by dt is exactly what I needed to help make sense of the formats. That said, I'm unsure how to properly test the enum_mbus_code() pad op function. How do you obtain a list of valid formats on a subdev? I tried the following: root@ventana:~# media-ctl -e 'tda19971 2-0048' /dev/v4l-subdev1 root@ventana:~# media-ctl --get-v4l2 '"tda19971 2-0048":0' [fmt:UYVY8_2X8/1280x720 field:none colorspace:srgb] ^^^^ calls get_format and returns the 1 and only format available for my tda19971 with 16bit parallel bus root@ventana:~# v4l2-ctl -d /dev/v4l-subdev1 --get-fmt-video-out VIDIOC_G_FMT: failed: Inappropriate ioctl for device root@ventana:~# v4l2-ctl -d /dev/v4l-subdev1 --list-formats-out ioctl: VIDIOC_ENUM_FMT I'm thinking perhaps enumerating the list of possible formats is a missing feature in media-ctl? Regards, Tim