Received: by 10.213.65.68 with SMTP id h4csp439616imn; Tue, 20 Mar 2018 07:00:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELs4ZOuirF3u1sGaNddo3MNxUzbjQSqX1bn1KfmNfKMXRFvf1p8igzSKx1S1jXWyTqVtjZ8d X-Received: by 10.98.247.9 with SMTP id h9mr13750365pfi.212.1521554426628; Tue, 20 Mar 2018 07:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521554426; cv=none; d=google.com; s=arc-20160816; b=GkLt7NAf963eEVEmEhBhPNdSQ5hUPH6NtWh9lmvvPFSjQGpOi7nD3XEWskAZiDUB9p ZB9ChQwBUvjzrft4uhummgkRjAEX1GE7pKY00GI3ujubFhJEaXKm5p6hquu1gezpKWvc Z8XI0W0pkBAXq09z9sxSGT44w/BT234IKKVoHH46CkUTKdpQRhGCGrdpqljgUAyO83L/ UB9oU9gnqdRrOL31+oYAWAAnyDQq6qTRxloqUz+tS4VsL/7O7y8yQRRcL/ujNOA9gzOK ECo2nKZZujv6fli3vQ+s6G/830BAmOMlqi78iXbeOk+RVDt5rJpicz/Cqm/ac0nViXFV TLjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=MWVgfruZLLShy56tVU7EQNnX8Kdv6UdZzFvMy32qOjY=; b=yGVTWvDJ1458cU0gfpUWyVsW0kAM8CWvgxS10A8Wf/rPchyusd+K95tzHnInQnOgth vmPO8tupzHnT18KsKJ+FhsSeHFYwjhdQJkVN8TXYluCWnnlFjznLyaa2qwdIEbAY/kuo Fmgky5rTuiBErkpa3VMtcyGRh8NsZmDwugGld15OFmTH8P3TcR0MKAyXHpx0c6rEwvTq CPyipYpwLt/BKRFvllo7yEma+uAuaCnD1cPaz6ut6FPtLoChTq4tvY1/lu8cJzTQn+LV VWo3Ffhj/RcIYuby4m0wVEDJxOFlmUwdeHmCx/LDpFjB9r1JAbdlpMJp09glG6PwE5e6 I+ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=OzW8vpsB; 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 e33-v6si1657953pld.493.2018.03.20.07.00.09; Tue, 20 Mar 2018 07:00:26 -0700 (PDT) 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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=OzW8vpsB; 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 S1753538AbeCTN7Q (ORCPT + 99 others); Tue, 20 Mar 2018 09:59:16 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:34106 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753098AbeCTN7O (ORCPT ); Tue, 20 Mar 2018 09:59:14 -0400 Received: from avalon.localnet (unknown [IPv6:2a02:2788:664:35f:7f37:41ef:e87f:aea9]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 169B6202DC; Tue, 20 Mar 2018 14:56:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1521554212; bh=nvlnc/VQmip97tj16yXysBjZC/eRYxgT/wpilE10f8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OzW8vpsBq4u9rKuQdkVvb6rTaV96R/0W09HwlTrqTTN7passjTrCxoVtCtWAv9CYh 5MeM5uqNzV4rzvUY3EOZZxHlWA0EPm1ipusVKPusitX13wwlxOzaAADvONYE10HfyX AOa5X08epUoA8mRt6TZAPGTnNCQL5Yri7FeWRLoE= From: Laurent Pinchart To: Peter Rosin Cc: linux-kernel@vger.kernel.org, David Airlie , Rob Herring , Mark Rutland , Archit Taneja , Andrzej Hajda , Daniel Vetter , Gustavo Padovan , Sean Paul , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: Re: [RFC PATCH 3/3] drm: bridge: lvds-encoder: on request, override the bus format Date: Tue, 20 Mar 2018 16:00:19 +0200 Message-ID: <11191357.lM4H1k0N3I@avalon> Organization: Ideas on Board Oy In-Reply-To: <20180317221525.18534-4-peda@axentia.se> References: <20180317221525.18534-1-peda@axentia.se> <20180317221525.18534-4-peda@axentia.se> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, Thank you for the patch. On Sunday, 18 March 2018 00:15:25 EET Peter Rosin wrote: > If the bridge changes the bus format, allow this to be described in > the bridge, instead of providing false information about the bus > format of the panel itself. > > Signed-off-by: Peter Rosin > --- > .../bindings/display/bridge/lvds-transmitter.txt | 8 ++++++++ > drivers/gpu/drm/bridge/lvds-encoder.c | 18 +++++++++++++++ > 2 files changed, 26 insertions(+) > > diff --git > a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.txt > b/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.txt > index 9d09190d9210..c0fbe74272e7 100644 > --- a/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.txt > +++ b/Documentation/devicetree/bindings/display/bridge/lvds-transmitter.txt > @@ -29,6 +29,14 @@ Required properties: > > "ti,ds90c185" > > +Optional properties: > + > +- interface-pix-fmt: > + Override the bus format of the panel, in case the bridge > + converts the signals. Recognized formats include: > + > + "rgb565" Please describe the format in more details, with an explicit mapping of bits to signals, otherwise we'll end up again with multiple different interpretations (at least when it comes to endianness). > + > Required nodes: > > This device has two video ports. Their connections are modeled using the OF > diff --git a/drivers/gpu/drm/bridge/lvds-encoder.c > b/drivers/gpu/drm/bridge/lvds-encoder.c index 75b0d3f6e4de..acff3a5b0562 > 100644 > --- a/drivers/gpu/drm/bridge/lvds-encoder.c > +++ b/drivers/gpu/drm/bridge/lvds-encoder.c > @@ -39,6 +39,9 @@ static int lvds_encoder_probe(struct platform_device > *pdev) struct device_node *panel_node; > struct drm_panel *panel; > struct lvds_encoder *lvds_encoder; > + u32 bus_format = 0; > + const char *fmt; > + int ret; > > lvds_encoder = devm_kzalloc(&pdev->dev, sizeof(*lvds_encoder), > GFP_KERNEL); > @@ -79,6 +82,21 @@ static int lvds_encoder_probe(struct platform_device > *pdev) if (IS_ERR(lvds_encoder->panel_bridge)) > return PTR_ERR(lvds_encoder->panel_bridge); > > + ret = of_property_read_string(pdev->dev.of_node, > + "interface-pix-fmt", &fmt); > + if (!ret) { > + if (!strcmp(fmt, "rgb565")) { > + bus_format = MEDIA_BUS_FMT_RGB565_1X16; I think the string to fourcc conversion should take place in the DRM core, not in the LVDS encoder driver. This would avoid ending up with multiple incompatible conversions. It might even be better to move the DT parsing to the core as well, not just the conversion. > + } else { > + dev_dbg(&pdev->dev, > + "requested interface-pix-fmt not recognized\n"); > + return -EINVAL; > + } > + } > + if (bus_format) > + drm_panel_bridge_set_bus_format(lvds_encoder->panel_bridge, > + bus_format); > + > /* The panel_bridge bridge is attached to the panel's of_node, > * but we need a bridge attached to our of_node for our user > * to look up. -- Regards, Laurent Pinchart