Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752899AbdLNO1E (ORCPT ); Thu, 14 Dec 2017 09:27:04 -0500 Received: from lb1-smtp-cloud9.xs4all.net ([194.109.24.22]:49547 "EHLO lb1-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751480AbdLNO1A (ORCPT ); Thu, 14 Dec 2017 09:27:00 -0500 Subject: Re: [PATCH v4 3/5] media: i2c: Add TDA1997x HDMI receiver driver To: Tim Harvey References: <1511990397-27647-1-git-send-email-tharvey@gateworks.com> <1511990397-27647-4-git-send-email-tharvey@gateworks.com> <1a1be5d7-caed-6cba-c97a-dbb70e119fa3@xs4all.nl> 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 From: Hans Verkuil Message-ID: Date: Thu, 14 Dec 2017 15:26:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfFDMdsFICmX2FtZyZ4QFXzSAtijjOtfNGsPltbKzNmYY9wFbN2XFuTxGDVvbMQxxVapw7GHhqTyu+FsSsebcQ1k+NblwQD0Jo0nzH2HIdaJuEkk8zfk+ tdwihaYr0Cvjv0wab1euEid+zEvZmEdxnTWozQudpU3PWpoBI3Ux+FqEgHWj65hFmB9kfe8vI96onRBTUhJy/xJOMoUYL5UCsZqfYICtuqKBGRg1z3hfR3OD jlLywcllDQfS9Tx/3n/qtYvRO28HlVIuMMR4Z08BIF2/19YnlgJW8XKN8j1E2GvXx5GQPmGfao92WQjjYMZBBcipLmwEWjjDuXDmfhxXPUz5Xd/6gBm6A/bU K+PE352+LlrE2QRQGYLsZlIPllKGflFgMe6YpkJC921kXOHUTRbUQ7i+w4mZL3b1M60Kalf+74xNxB0xl80ETbYFUDMUEPlHQeV1tG0WMo8cSLcYyy3CZ6fk DVEimFk8aouY/38Z Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2009 Lines: 50 On 14/12/17 00:35, Tim Harvey wrote: >>> Close. What is missing is a check of the AVI InfoFrame: if it has an explicit >>> colorimetry then use that. E.g. check for HDMI_COLORIMETRY_ITU_601 or ITU_709 >>> and set the colorspace accordingly. Otherwise fall back to what you have here. >>> >> >> This function currently matches adv7604/adv7842 where they don't look >> at colorimetry (but I do see a TODO in adv748x_hdmi_fill_format to >> look at this) so I don't have an example and may not understand. >> >> Do you mean: >> >> format->colorspace = V4L2_COLORSPACE_SRGB; >> if (bt->flags & V4L2_DV_FL_IS_CE_VIDEO) { >> if ((state->colorimetry == HDMI_COLORIMETRY_ITU_601) || >> (state->colorimetry == HDMI_COLORIMETRY_ITU_709)) >> format->colorspace = state->colorspace; >> else >> format->colorspace = is_sd(bt->height) ? >> V4L2_COLORSPACE_SMPTE170M : >> V4L2_COLORSPACE_REC709; >> } >> >> Also during more testing I've found that I'm not capturing interlaced >> properly and know I at least need: >> >> - format->field = V4L2_FIELD_NONE; >> + format->field = (bt->interlaced) ? >> + V4L2_FIELD_ALTERNATE : V4L2_FIELD_NONE; >> >> I'm still not quite capturing interlaced yet but I think its an issue >> of setting up the media pipeline improperly. >> > > Hans, > > Did you see this question above? I'm not quite understanding what you > want me to do for filling in colorspace and don't see any examples in > the existing drivers that appear to look at colorimetry for this. Yeah, I missed that question. I started answering that yesterday, but then I realized that it would be better if I would make a helper function for v4l2-dv-timings. The rules are complex so coding that in a single place that everyone can use is the smart thing to do. I hope to finish it tomorrow (too many interruptions today). Regards, Hans