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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A1B5C43217 for ; Mon, 17 Oct 2022 07:51:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230154AbiJQHvh (ORCPT ); Mon, 17 Oct 2022 03:51:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbiJQHvf (ORCPT ); Mon, 17 Oct 2022 03:51:35 -0400 Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F642220ED for ; Mon, 17 Oct 2022 00:51:34 -0700 (PDT) Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-132b8f6f1b2so12378496fac.11 for ; Mon, 17 Oct 2022 00:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XWLP7i62jFW6oRSoyvp2q+yVGfR5Lxj+voPavApZkTk=; b=AFDgqcKxcIKQr1YaXq+rVne8uvFcTZI4m6WkMq5trqjHT0ECPcb1TxC+I1giYXDg/a jadAvelIFRvCneIpXKITT8qpJEROC7Twif9oLRa6hFBOaiLMLjk547h/D0RO9SdugCBF OLdJzS6YbluYIU+FknEhCrL4q1RqAty97TcNM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XWLP7i62jFW6oRSoyvp2q+yVGfR5Lxj+voPavApZkTk=; b=vFCAsbw3l7OJSCZeHSprN++4iS2Ckm9U2i2lPe3Qtq+xyLfVeqwYgFDB6ODVQ/Y7vx 7aNAhHmd+QKXPJsn/j5+7oHiCjtxzGtJa7JZGbJyx1QUvHXDigEAfyPW1r86SHc2ugrl zlcVqDoCmlcN+VxtDnFQtlvWKlk7g2MWvxN9tIUxij6noy2tj/L6FWGSwyMHuGLmV8EW F2rPXQbaUy/2Us/u2+CScBlqnnbOMez+wBFm1dt2qr3vv+rgAmWabEoNVH8tz6JVySBx OkMkraGhWKe/ipTNDLXnPSCCfoTRbcV3ZmY1fSn4kGmldHLD6Pz7TsnW2sHlOkKbyk/D tBVg== X-Gm-Message-State: ACrzQf2jMpAybZxr2HRkcjShld+F7CxLcttuFQOJh8kI2BAKHK5bkEud l2lmb1D9O9YYtX9twpHJ39LCBHaNMZIRjvx4ukCjfQ== X-Google-Smtp-Source: AMsMyM5SoibjyxUNWPddsJQiXBCo6gUiccPmwYk5IFGbnZUgk9qascBl19j/lpgoHfB0B+L4U97W0P8BydAkhiuaRog= X-Received: by 2002:a05:6870:8999:b0:133:15f9:82fd with SMTP id f25-20020a056870899900b0013315f982fdmr4951557oaq.276.1665993093812; Mon, 17 Oct 2022 00:51:33 -0700 (PDT) MIME-Version: 1.0 References: <20221005151309.7278-1-jagan@amarulasolutions.com> <20221005151309.7278-6-jagan@amarulasolutions.com> <80ace77a-49c6-9b22-5c59-d0afa9b32153@denx.de> In-Reply-To: <80ace77a-49c6-9b22-5c59-d0afa9b32153@denx.de> From: Jagan Teki Date: Mon, 17 Oct 2022 13:21:22 +0530 Message-ID: Subject: Re: [PATCH v7 05/10] drm: bridge: samsung-dsim: Add atomic_check To: Marek Vasut Cc: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org On Mon, Oct 17, 2022 at 12:53 PM Marek Vasut wrote: > > On 10/17/22 05:54, Jagan Teki wrote: > > On Sun, Oct 16, 2022 at 2:53 AM Marek Vasut wrote: > >> > >> On 10/5/22 17:13, Jagan Teki wrote: > >>> Look like an explicit fixing up of mode_flags is required for DSIM IP > >>> present in i.MX8M Mini/Nano SoCs. > >>> > >>> At least the LCDIF + DSIM needs active low sync polarities in order > >>> to correlate the correct sync flags of the surrounding components in > >>> the chain to make sure the whole pipeline can work properly. > >>> > >>> On the other hand the i.MX 8M Mini Applications Processor Reference Manual, > >>> Rev. 3, 11/2020 says. > >>> "13.6.3.5.2 RGB interface > >>> Vsync, Hsync, and VDEN are active high signals." > >>> > >>> No clear evidence about whether it can be documentation issues or > >>> something, so added a comment FIXME for this and updated the active low > >>> sync polarities using SAMSUNG_DSIM_TYPE_IMX8MM hw_type. > >> > >> [...] > >> > >>> +static int samsung_dsim_atomic_check(struct drm_bridge *bridge, > >>> + struct drm_bridge_state *bridge_state, > >>> + struct drm_crtc_state *crtc_state, > >>> + struct drm_connector_state *conn_state) > >>> +{ > >>> + struct samsung_dsim *dsi = bridge_to_dsi(bridge); > >>> + struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; > >>> + > >>> + if (dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM) { > >>> + /** > >>> + * FIXME: > >>> + * At least LCDIF + DSIM needs active low sync, > >>> + * but i.MX 8M Mini Applications Processor Reference Manual, > >>> + * Rev. 3, 11/2020 says > >>> + * > >>> + * 13.6.3.5.2 RGB interface > >>> + * Vsync, Hsync, and VDEN are active high signals. > >>> + */ > >>> + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); > >>> + adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); > >>> + } > >> > >> It would be good to explain what exactly is going on here in the > >> comment, the comment says "Vsync, Hsync, and VDEN are active high > >> signals." and the code below does exact opposite and sets NxSYNC flags. > >> > >> Yes, the MX8MM/MN does need HS/VS/DE active LOW, it is a quirk of that > >> MXSFB-DSIM glue logic. The MX8MP needs the exact opposite on all three, > >> active HIGH. > > > > This is what exactly is mentioned in the comments. > > > > 2nd line mentioned the active low of signals. > >>> + * At least LCDIF + DSIM needs active low sync, > > > > from 3rd line onwards it mentioned what reference manual is referring > > > > Not quite understand what is misleading here. > > This part: > " > + * Vsync, Hsync, and VDEN are active high signals. > + */ > + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); > " > > Comment claims the signals are active high by quoting datasheet, and > then sets the exact opposite on next line of code. The comment stated what is done first and then gave the datasheet reference. look this sequence seems confusing, I will recheck and update the best possible comment. > > Have a look at this patch, I updated the comment there for MX8MP too: > [PATCH] drm: bridge: samsung-dsim: Add i.MX8M Plus support I will check. Thanks, Jagan. 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id CD419C433FE for ; Mon, 17 Oct 2022 07:51:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 613A510E38D; Mon, 17 Oct 2022 07:51:39 +0000 (UTC) Received: from mail-oa1-x2f.google.com (mail-oa1-x2f.google.com [IPv6:2001:4860:4864:20::2f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98F5F10E38D for ; Mon, 17 Oct 2022 07:51:34 +0000 (UTC) Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-132fb4fd495so12381469fac.12 for ; Mon, 17 Oct 2022 00:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XWLP7i62jFW6oRSoyvp2q+yVGfR5Lxj+voPavApZkTk=; b=AFDgqcKxcIKQr1YaXq+rVne8uvFcTZI4m6WkMq5trqjHT0ECPcb1TxC+I1giYXDg/a jadAvelIFRvCneIpXKITT8qpJEROC7Twif9oLRa6hFBOaiLMLjk547h/D0RO9SdugCBF OLdJzS6YbluYIU+FknEhCrL4q1RqAty97TcNM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XWLP7i62jFW6oRSoyvp2q+yVGfR5Lxj+voPavApZkTk=; b=LMN2GaXakzr+U1nYfh2yEkfzkYozaD4QQ1abMaJwfPjWA98t03bC/1iRAaq84W9TXS 0tkgAIUJr4qCraco6NEy1X8kUY00VcAi1NJa/LtHHMjb3kIoTnuvem3PMVryi+E7iFeI ljDbTgPjux094i5jqADuYnv3BUFljrGLAuXjV1MRGVeV/kjd4PKzKUYI2rBnwoh+9dMx 9kWLm2ZQOqQsiqYuWC3qXYhEYMlvPPR0HQo5BEs/Hdx9pQwBX+caAk3xkY3oTAr43Mqb OMq9lr971B5H6ae7XZUpAzWC+gVQIFbOWCLLU9n76F/9Eigv8NAXF0iPd+xUFuC+4idd m03w== X-Gm-Message-State: ACrzQf031eDiikGc6PPXIyxw7kZ/V9AGIf7HYAb6UInLeMqGWEPNMnZp FPr9Hh42bls50N2qXnS/GbzzpjqiYgRRtoJS3p/B7g== X-Google-Smtp-Source: AMsMyM5SoibjyxUNWPddsJQiXBCo6gUiccPmwYk5IFGbnZUgk9qascBl19j/lpgoHfB0B+L4U97W0P8BydAkhiuaRog= X-Received: by 2002:a05:6870:8999:b0:133:15f9:82fd with SMTP id f25-20020a056870899900b0013315f982fdmr4951557oaq.276.1665993093812; Mon, 17 Oct 2022 00:51:33 -0700 (PDT) MIME-Version: 1.0 References: <20221005151309.7278-1-jagan@amarulasolutions.com> <20221005151309.7278-6-jagan@amarulasolutions.com> <80ace77a-49c6-9b22-5c59-d0afa9b32153@denx.de> In-Reply-To: <80ace77a-49c6-9b22-5c59-d0afa9b32153@denx.de> From: Jagan Teki Date: Mon, 17 Oct 2022 13:21:22 +0530 Message-ID: Subject: Re: [PATCH v7 05/10] drm: bridge: samsung-dsim: Add atomic_check To: Marek Vasut Content-Type: text/plain; charset="UTF-8" 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: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Laurent Pinchart , Joonyoung Shim , Tommaso Merciai , linux-amarula , Seung-Woo Kim , Neil Armstrong , Frieder Schrempf , Kyungmin Park , Matteo Lisi , Robert Foss , Andrzej Hajda , NXP Linux Team , Fancy Fang , Michael Nazzareno Trimarchi , Adam Ford , linux-arm-kernel@lists.infradead.org, Marek Szyprowski Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Oct 17, 2022 at 12:53 PM Marek Vasut wrote: > > On 10/17/22 05:54, Jagan Teki wrote: > > On Sun, Oct 16, 2022 at 2:53 AM Marek Vasut wrote: > >> > >> On 10/5/22 17:13, Jagan Teki wrote: > >>> Look like an explicit fixing up of mode_flags is required for DSIM IP > >>> present in i.MX8M Mini/Nano SoCs. > >>> > >>> At least the LCDIF + DSIM needs active low sync polarities in order > >>> to correlate the correct sync flags of the surrounding components in > >>> the chain to make sure the whole pipeline can work properly. > >>> > >>> On the other hand the i.MX 8M Mini Applications Processor Reference Manual, > >>> Rev. 3, 11/2020 says. > >>> "13.6.3.5.2 RGB interface > >>> Vsync, Hsync, and VDEN are active high signals." > >>> > >>> No clear evidence about whether it can be documentation issues or > >>> something, so added a comment FIXME for this and updated the active low > >>> sync polarities using SAMSUNG_DSIM_TYPE_IMX8MM hw_type. > >> > >> [...] > >> > >>> +static int samsung_dsim_atomic_check(struct drm_bridge *bridge, > >>> + struct drm_bridge_state *bridge_state, > >>> + struct drm_crtc_state *crtc_state, > >>> + struct drm_connector_state *conn_state) > >>> +{ > >>> + struct samsung_dsim *dsi = bridge_to_dsi(bridge); > >>> + struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; > >>> + > >>> + if (dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM) { > >>> + /** > >>> + * FIXME: > >>> + * At least LCDIF + DSIM needs active low sync, > >>> + * but i.MX 8M Mini Applications Processor Reference Manual, > >>> + * Rev. 3, 11/2020 says > >>> + * > >>> + * 13.6.3.5.2 RGB interface > >>> + * Vsync, Hsync, and VDEN are active high signals. > >>> + */ > >>> + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); > >>> + adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); > >>> + } > >> > >> It would be good to explain what exactly is going on here in the > >> comment, the comment says "Vsync, Hsync, and VDEN are active high > >> signals." and the code below does exact opposite and sets NxSYNC flags. > >> > >> Yes, the MX8MM/MN does need HS/VS/DE active LOW, it is a quirk of that > >> MXSFB-DSIM glue logic. The MX8MP needs the exact opposite on all three, > >> active HIGH. > > > > This is what exactly is mentioned in the comments. > > > > 2nd line mentioned the active low of signals. > >>> + * At least LCDIF + DSIM needs active low sync, > > > > from 3rd line onwards it mentioned what reference manual is referring > > > > Not quite understand what is misleading here. > > This part: > " > + * Vsync, Hsync, and VDEN are active high signals. > + */ > + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); > " > > Comment claims the signals are active high by quoting datasheet, and > then sets the exact opposite on next line of code. The comment stated what is done first and then gave the datasheet reference. look this sequence seems confusing, I will recheck and update the best possible comment. > > Have a look at this patch, I updated the comment there for MX8MP too: > [PATCH] drm: bridge: samsung-dsim: Add i.MX8M Plus support I will check. Thanks, Jagan. 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 87A51C433FE for ; Mon, 17 Oct 2022 07:52:46 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UCCggJrf20FGwQLRbxOHKagFrudC6SFb9X2PoXaEA/s=; b=o7n6xxU/tBQZUf i9QvK6sGwvwDwh33y8DsHSX4q7UfB/bFqFMVbDE3ZY+PVVjqnu1c9WevLzGZqLuOqeaz3osmjv1s7 m5rSoV9bb+W1JlPuXUnSUCjrZxGkggIjLDeoac3uMciVrYyE7a6DUj53FplR+ncmozh3u/+7NwM15 TESzpuLhog77BqsqoXjWvoIPwX4LH7AfFEX1lqVpntzDFEkH6ZzO2DJgQ6ikj0X/nRn5EuPPT+fPR 8DCsYzKTY9JyK8aE2ceNdrnSDQbhriv5tVl0naK4AvIJPtV9WQ1aksOXe6v4XCEYbCrfJOivHXaPn ssiloyjcCXwuxi0TTaaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okKuP-008eZ9-Dk; Mon, 17 Oct 2022 07:51:37 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okKuM-008eVH-SK for linux-arm-kernel@lists.infradead.org; Mon, 17 Oct 2022 07:51:36 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1370acb6588so12389380fac.9 for ; Mon, 17 Oct 2022 00:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XWLP7i62jFW6oRSoyvp2q+yVGfR5Lxj+voPavApZkTk=; b=AFDgqcKxcIKQr1YaXq+rVne8uvFcTZI4m6WkMq5trqjHT0ECPcb1TxC+I1giYXDg/a jadAvelIFRvCneIpXKITT8qpJEROC7Twif9oLRa6hFBOaiLMLjk547h/D0RO9SdugCBF OLdJzS6YbluYIU+FknEhCrL4q1RqAty97TcNM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XWLP7i62jFW6oRSoyvp2q+yVGfR5Lxj+voPavApZkTk=; b=I5dwp7G5oLCIQlS931xzCicMym7PYm37ho33Cd7Glo/cyd3tlr/vhJ4/Q/yUo4vkFd G+4GIrQaSm4iCQRIrL3oeCjtWWGx8bEHGjxDDsHtwV5IAnilboiJ6IwQcG4nHxEsgdRB scfdXqkqBWdsnZzjGUIOyPRhQ1iG/EH7bZEqRKDhQFNdnn7f4d+JyTiKfhMOY5Ml32XZ A7WI2U6AX8J+VHl7HiBM4aKNAD5yXBi84JJPflULTSduVtltz0UNEekt8xqU5V84c4Kt LOWk/HylHKey1CqxBhTTSJc/1A7b+yDTX5Mb1eE2v8qXcvcyXgtHWdA2h1WOND/XV7D6 gnhw== X-Gm-Message-State: ACrzQf2VwlbpPoyt6wT1Sm45ohbXIJKinPuvGgnNbaF8mVo276NsatPf jmPevaGQTOFtgbtnnMSIwWdVTLzs/Dg7DMCKia0aug== X-Google-Smtp-Source: AMsMyM5SoibjyxUNWPddsJQiXBCo6gUiccPmwYk5IFGbnZUgk9qascBl19j/lpgoHfB0B+L4U97W0P8BydAkhiuaRog= X-Received: by 2002:a05:6870:8999:b0:133:15f9:82fd with SMTP id f25-20020a056870899900b0013315f982fdmr4951557oaq.276.1665993093812; Mon, 17 Oct 2022 00:51:33 -0700 (PDT) MIME-Version: 1.0 References: <20221005151309.7278-1-jagan@amarulasolutions.com> <20221005151309.7278-6-jagan@amarulasolutions.com> <80ace77a-49c6-9b22-5c59-d0afa9b32153@denx.de> In-Reply-To: <80ace77a-49c6-9b22-5c59-d0afa9b32153@denx.de> From: Jagan Teki Date: Mon, 17 Oct 2022 13:21:22 +0530 Message-ID: Subject: Re: [PATCH v7 05/10] drm: bridge: samsung-dsim: Add atomic_check To: Marek Vasut Cc: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221017_005134_937237_0213AE43 X-CRM114-Status: GOOD ( 24.15 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 17, 2022 at 12:53 PM Marek Vasut wrote: > > On 10/17/22 05:54, Jagan Teki wrote: > > On Sun, Oct 16, 2022 at 2:53 AM Marek Vasut wrote: > >> > >> On 10/5/22 17:13, Jagan Teki wrote: > >>> Look like an explicit fixing up of mode_flags is required for DSIM IP > >>> present in i.MX8M Mini/Nano SoCs. > >>> > >>> At least the LCDIF + DSIM needs active low sync polarities in order > >>> to correlate the correct sync flags of the surrounding components in > >>> the chain to make sure the whole pipeline can work properly. > >>> > >>> On the other hand the i.MX 8M Mini Applications Processor Reference Manual, > >>> Rev. 3, 11/2020 says. > >>> "13.6.3.5.2 RGB interface > >>> Vsync, Hsync, and VDEN are active high signals." > >>> > >>> No clear evidence about whether it can be documentation issues or > >>> something, so added a comment FIXME for this and updated the active low > >>> sync polarities using SAMSUNG_DSIM_TYPE_IMX8MM hw_type. > >> > >> [...] > >> > >>> +static int samsung_dsim_atomic_check(struct drm_bridge *bridge, > >>> + struct drm_bridge_state *bridge_state, > >>> + struct drm_crtc_state *crtc_state, > >>> + struct drm_connector_state *conn_state) > >>> +{ > >>> + struct samsung_dsim *dsi = bridge_to_dsi(bridge); > >>> + struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; > >>> + > >>> + if (dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM) { > >>> + /** > >>> + * FIXME: > >>> + * At least LCDIF + DSIM needs active low sync, > >>> + * but i.MX 8M Mini Applications Processor Reference Manual, > >>> + * Rev. 3, 11/2020 says > >>> + * > >>> + * 13.6.3.5.2 RGB interface > >>> + * Vsync, Hsync, and VDEN are active high signals. > >>> + */ > >>> + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); > >>> + adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); > >>> + } > >> > >> It would be good to explain what exactly is going on here in the > >> comment, the comment says "Vsync, Hsync, and VDEN are active high > >> signals." and the code below does exact opposite and sets NxSYNC flags. > >> > >> Yes, the MX8MM/MN does need HS/VS/DE active LOW, it is a quirk of that > >> MXSFB-DSIM glue logic. The MX8MP needs the exact opposite on all three, > >> active HIGH. > > > > This is what exactly is mentioned in the comments. > > > > 2nd line mentioned the active low of signals. > >>> + * At least LCDIF + DSIM needs active low sync, > > > > from 3rd line onwards it mentioned what reference manual is referring > > > > Not quite understand what is misleading here. > > This part: > " > + * Vsync, Hsync, and VDEN are active high signals. > + */ > + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); > " > > Comment claims the signals are active high by quoting datasheet, and > then sets the exact opposite on next line of code. The comment stated what is done first and then gave the datasheet reference. look this sequence seems confusing, I will recheck and update the best possible comment. > > Have a look at this patch, I updated the comment there for MX8MP too: > [PATCH] drm: bridge: samsung-dsim: Add i.MX8M Plus support I will check. Thanks, Jagan. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel