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 X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 243DEC433B4 for ; Wed, 28 Apr 2021 14:16:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 61AF6613FA for ; Wed, 28 Apr 2021 14:16:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61AF6613FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 69E256EB4A; Wed, 28 Apr 2021 14:16:27 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4B9876EB4A for ; Wed, 28 Apr 2021 14:16:25 +0000 (UTC) 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 B330282CAE; Wed, 28 Apr 2021 16:16:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1619619382; bh=+3g3JkWmBA3GIPh/Isd/nbPejEz640mfCrRr6l6osIA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=csQKNoxCjIfBTk9hEx4bN5t5qCaK1ahZ78rEFW3JvhkJBo45wAMZZxSd8XTKrdVEo vuhhaWYZv7qw1RLsiewmBxhVbwUcjDSlQWCKFqK3C54gtNwfv/Io+0zK0PhNQhsaBq VHkXRVkywub0DnWVszPQ/QySC0aWrsksCg0CQRJNo2Sbeh3Ok4KXLbKK8PwWwfAmF8 k9lIk8yKSfIjft7zUhJeYRYyD9YzseMN7oGz+Wx7zzLEj86chlaLl0BCjAqk8s4ouo Tyzn9P2SHcPJwpJVhwZ3Wsxm5Ha44CRqJD/iBNwoUS2PEuGWHSmfTOGSaeGD2lA9O8 THzV0r2/nGz4Q== Subject: Re: [PATCH V2 2/2] drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver To: Neil Armstrong , Loic Poulain , Frieder Schrempf References: <20210421223122.112736-1-marex@denx.de> <20210421223122.112736-2-marex@denx.de> <66386909-5b89-78ab-6fcc-5bef95a66035@kontron.de> From: Marek Vasut Message-ID: Date: Wed, 28 Apr 2021 16:16:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ch@denx.de, Douglas Anderson , dri-devel@lists.freedesktop.org, Stephen Boyd , Philippe Schenker , Jagan Teki , Valentin Raevsky , Sam Ravnborg , Laurent Pinchart Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 4/28/21 11:24 AM, Neil Armstrong wrote: [...] >>>>> +static int sn65dsi83_probe(struct i2c_client *client, >>>>> + const struct i2c_device_id *id) >>>>> +{ >>>>> + struct device *dev = &client->dev; >>>>> + enum sn65dsi83_model model; >>>>> + struct sn65dsi83 *ctx; >>>>> + int ret; >>>>> + >>>>> + ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); >>>>> + if (!ctx) >>>>> + return -ENOMEM; >>>>> + >>>>> + ctx->dev = dev; >>>>> + >>>>> + if (dev->of_node) >>>>> + model = (enum sn65dsi83_model)of_device_get_match_data(dev); >>>>> + else >>>>> + model = id->driver_data; >>>>> + >>>>> + /* Default to dual-link LVDS on all but DSI83. */ >>>>> + if (model != MODEL_SN65DSI83) >>>>> + ctx->lvds_dual_link = true; >>>> >>>> What if I use the DSI84 with a single link LVDS? I can't see any way to >>>> configure that right now. >> >> I assume the simplest way would be to use the "ti,sn65dsi83" >> compatible string in your dts, since the way you wired it is >> 'compatible' with sn65dsi83, right? > > No this isn't the right way to to, if sn65dsi84 is supported and the bindings only support single lvds link, > the driver must only support single link on sn65dsi84, or add the dual link lvds in the bindings only for sn65dsi84. The driver has a comment about what is supported and tested, as Frieder already pointed out: Currently supported: - SN65DSI83 = 1x Single-link DSI ~ 1x Single-link LVDS - Supported - Single-link LVDS mode tested - SN65DSI84 = 1x Single-link DSI ~ 2x Single-link or 1x Dual-link LVDS - Supported - Dual-link LVDS mode tested - 2x Single-link LVDS mode unsupported (should be easy to add by someone who has the HW) - SN65DSI85 = 2x Single-link or 1x Dual-link DSI ~ 2x Single-link or 1x Dual-link LVDS - Unsupported (should be easy to add by someone who has the HW) So, DSI83 is always single-link DSI, single-link LVDS. DSI84 is always single-link DSI, and currently always dual-link LVDS. The DSI83 can do one thing on the LVDS end: - 1x single link lVDS The DSI84 can do two things on the LVDS end: - 1x single link lVDS - 1x dual link LVDS There is also some sort of mention in the DSI84 datasheet about 2x single link LVDS, but I suspect that might be copied from DSI85 datasheet instead, which would make sense. The other option is that it behaves as a mirror (i.e. same pixels are scanned out of LVDS channel A and B). Either option can be added by either adding a DT property which would enable the mirror mode, or new port linking the LVDS endpoint to the same panel twice, and/or two new ports for DSI85, so there is no problem to extend the bindings without breaking them. So for now I would ignore this mode. So ultimately, what we have to sort out is the 1x single / 1x dual link LVDS mode setting on DSI84. Frieder already pointed out how the driver can be tweaked to support the single-link mode on DSI84, so now we need to tie it into DT bindings. Currently, neither the LVDS panels in upstream in panel-simple nor lvds.yaml provide any indication that the panel is single-link or dual-link. Those dual-link LVDS panels seem to always set 2x pixel clock and let the bridge somehow sort it out. Maybe that isn't always the best approach, maybe we should add a new DRM_BUS_FLAG for those panels and handle the flag in the bridge driver ? Such a new flag could be added over time to panels where applicable, so old setups won't be broken by that either, they will just ignore the new flag and work as before. >>> I just saw the note in the header of the driver that says that single >>> link mode is unsupported for the DSI84. >>> >>> I have hardware with a single link display and if I set >>> ctx->lvds_dual_link = false it works just fine. >>> >>> How is this supposed to be selected? Does it need an extra devicetree >>> property? And would you mind adding single-link support in the next >>> version or do you prefer adding it in a follow-up patch? >> >> If this has to be supported I think the proper way would be to support >> two output ports in the dts (e.g. lvds0_out, lvds1_out), in the same >> way as supported by the 'advantech,idk-2121wr' panel. > > Yes, this is why I asked to have the dual-link lvds in the bindings. Maybe it shouldn't really be in the bindings, see above. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel