From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36242C433EF for ; Wed, 23 Feb 2022 15:02:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Y0V3bIb+8IT2SgMHP+lHC7YG+xS3fYoTnTq2RkBlDAM=; b=oAOJey100Om20l 5bx6F31bxg3zlBfPgkWaKPDVeJ2SbReKaBlXRC5KvU9KDl9+m1Hhv/cOLrDZRnUBinvA1NGzWhUrh PLNyrzIYdfsJQR4Dl+DTIwLVcLsAw/B9o5g24a0RiM4BpVfR/U0YusOrQWzpYurp4tkPPOleGapoY Cog8pMmOwg2ugtnjnvUvWuUVRJ4JQqYQmxnRKGuKYi11hE/lepSSMQwaq2TiHd8kmK6l8j7gP0NMA h1kZ0SriUAEtgD4TknDg9fKB06iooXb2AHjUgfBV/h4JOHjoILrO9e8QifE1kk2DSC/ZkP7aYgCh3 fMLt/PwPiRQREvxjwZig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMt88-00EtCw-Ts; Wed, 23 Feb 2022 15:00:37 +0000 Received: from phobos.denx.de ([2a01:238:438b:c500:173d:9f52:ddab:ee01]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMsmd-00EmJr-Md for linux-arm-kernel@lists.infradead.org; Wed, 23 Feb 2022 14:38:26 +0000 Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 58B2781109; Wed, 23 Feb 2022 15:38:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1645627102; bh=hIFXz5v2y46Ri1OO3QKmfqtZSuVyllWu5uYkTc/fKB0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=OsnxWgAXWOxc4vaYA0N5CwYNxJWHXG+iRJ4F81rLpuQ99GNfsszc2VL65/ne1Ojvy yDgjedmjGgmZO+RpC8FAybnE519Fz6Sfo0VS2HsW9l8GSOf54lbN716wqIyzn86455 b1cx5briJ1fYFuVuHVpuwcaj8g5BQigcfKAniPyczfPEBLg1eTIUbe5oWR5MXWqpLF VlCftfkHHKYimHKtweNGods6Q+cOsg2Lii384STv7CNRvCViRIj4/np/t1w4UTX6IG JxelFkYM+PBM51ciav3GMhhwgrri/lff+dCzpI3QMEA+vm5czE+tMIgKzNf3UONEYh kT+cdAmdNhrvg== Message-ID: Date: Wed, 23 Feb 2022 15:38:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [RFC PATCH] drm/panel: simple: panel-dpi: use bus-format to set bpc and bus_format Content-Language: en-US To: Maxime Ripard Cc: Max Krummenacher , dri-devel@lists.freedesktop.org, Sascha Hauer , Philipp Zabel , Laurent Pinchart , Fabio Estevam , linux-arm-kernel@lists.infradead.org, DenysDrozdov , David Airlie , Christoph Niedermaier , Pengutronix Kernel Team , Sam Ravnborg , Shawn Guo , Daniel Vetter , NXP Linux Team , Max Krummenacher References: <20220222084723.14310-1-max.krummenacher@toradex.com> <20220223134154.oo7xhf37bgtvm3ai@houat> <20220223134757.f5upi2iun27op5w5@houat> <20220223143703.xi7vpamjg4ytmvqs@houat> From: Marek Vasut In-Reply-To: <20220223143703.xi7vpamjg4ytmvqs@houat> X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220223_063824_150043_BC123676 X-CRM114-Status: GOOD ( 20.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/23/22 15:37, Maxime Ripard wrote: > On Wed, Feb 23, 2022 at 03:09:08PM +0100, Marek Vasut wrote: >> On 2/23/22 14:47, Maxime Ripard wrote: >>> On Wed, Feb 23, 2022 at 02:45:30PM +0100, Marek Vasut wrote: >>>> On 2/23/22 14:41, Maxime Ripard wrote: >>>>> Hi, >>>>> >>>>> On Tue, Feb 22, 2022 at 09:47:23AM +0100, Max Krummenacher wrote: >>>>>> Use the new property bus-format to set the enum bus_format and bpc. >>>>>> Completes: commit 4a1d0dbc8332 ("drm/panel: simple: add panel-dpi support") >>>>>> >>>>>> Signed-off-by: Max Krummenacher >>>>>> >>>>>> --- >>>>>> >>>>>> drivers/gpu/drm/panel/panel-simple.c | 32 ++++++++++++++++++++++++++++ >>>>>> 1 file changed, 32 insertions(+) >>>>>> >>>>>> Relates to the discussion: https://lore.kernel.org/all/20220201110717.3585-1-cniedermaier@dh-electronics.com/ >>>>>> >>>>>> Max >>>>>> >>>>>> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c >>>>>> index c5f133667a2d..5c07260de71c 100644 >>>>>> --- a/drivers/gpu/drm/panel/panel-simple.c >>>>>> +++ b/drivers/gpu/drm/panel/panel-simple.c >>>>>> @@ -453,6 +453,7 @@ static int panel_dpi_probe(struct device *dev, >>>>>> struct panel_desc *desc; >>>>>> unsigned int bus_flags; >>>>>> struct videomode vm; >>>>>> + const char *format = ""; >>>>>> int ret; >>>>>> np = dev->of_node; >>>>>> @@ -477,6 +478,37 @@ static int panel_dpi_probe(struct device *dev, >>>>>> of_property_read_u32(np, "width-mm", &desc->size.width); >>>>>> of_property_read_u32(np, "height-mm", &desc->size.height); >>>>>> + of_property_read_string(np, "bus-format", &format); >>>>>> + if (!strcmp(format, "BGR888_1X24")) { >>>>>> + desc->bpc = 8; >>>>>> + desc->bus_format = MEDIA_BUS_FMT_BGR888_1X24; >>>>>> + } else if (!strcmp(format, "GBR888_1X24")) { >>>>>> + desc->bpc = 8; >>>>>> + desc->bus_format = MEDIA_BUS_FMT_GBR888_1X24; >>>>>> + } else if (!strcmp(format, "RBG888_1X24")) { >>>>>> + desc->bpc = 8; >>>>>> + desc->bus_format = MEDIA_BUS_FMT_RBG888_1X24; >>>>>> + } else if (!strcmp(format, "RGB444_1X12")) { >>>>>> + desc->bpc = 6; >>>>>> + desc->bus_format = MEDIA_BUS_FMT_RGB444_1X12; >>>>>> + } else if (!strcmp(format, "RGB565_1X16")) { >>>>>> + desc->bpc = 6; >>>>>> + desc->bus_format = MEDIA_BUS_FMT_RGB565_1X16; >>>>>> + } else if (!strcmp(format, "RGB666_1X18")) { >>>>>> + desc->bpc = 6; >>>>>> + desc->bus_format = MEDIA_BUS_FMT_RGB666_1X18; >>>>>> + } else if (!strcmp(format, "RGB666_1X24_CPADHI")) { >>>>>> + desc->bpc = 6; >>>>>> + desc->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI; >>>>>> + } else if (!strcmp(format, "RGB888_1X24")) { >>>>>> + desc->bpc = 8; >>>>>> + desc->bus_format = MEDIA_BUS_FMT_RGB888_1X24; >>>>>> + } else { >>>>>> + dev_err(dev, "%pOF: missing or unknown bus-format property\n", >>>>>> + np); >>>>>> + return -EINVAL; >>>>>> + } >>>>>> + >>>>> >>>>> It doesn't seem right, really. We can't the bus format / bpc be inferred >>>>> from the compatible? I'd expect two panels that don't have the same bus >>>>> format to not be claimed as compatible. >>>> >>>> Which compatible ? >>>> >>>> Note that this is for panel-dpi compatible, i.e. the panel which has timings >>>> specified in DT (and needs bus format specified there too). >>> >>> panel-dpi is supposed to have two compatibles, the panel-specific one >>> and panel-dpi. This would obviously be tied to the panel-specific one. >> >> This whole discussion is about the one which only has 'panel-dpi' compatible >> and describes the panel in DT completely. The specific compatible is not >> present in DT when this patch is needed. > > From the panel-dpi DT binding: > > properties: > compatible: > description: > Shall contain a panel specific compatible and "panel-dpi" > in that order. > items: > - {} > - const: panel-dpi > > The panel-specific compatible is mandatory, whether you like it or not. It doesn't seem to me that's the intended use per panel-simple.c , so maybe the bindings need to be fixed too ? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel