From patchwork Sun Jul 4 09:02:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12357413 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=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 4FDF7C07E95 for ; Sun, 4 Jul 2021 09:17:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1E819613C8 for ; Sun, 4 Jul 2021 09:17:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E819613C8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f2f8g+DFbP8Yrlxn0FDcAKkandeCPOqgxq5QfY790mk=; b=QvlqSgNNMF2vo7 8pL65xxwRVw3jV2it6/ictID4Nf7+SmUSgL5b8yUvYQKFtQHPRlAqO9zWltmlbYFDEtnY85qxo+Tn jUiQJvQW50CnB03CzGsa38II/5Ix3vW7xO/3ovhQHIAmPt/t7nh+xCMtJfa0ijLkj5sK2GJN/qdxS Sr8h/bKp1WpSULCjZOW0L51OZkEfS3m+S/fWepCEkPLVkLkL3368E/nPemHabMgRugsXFwFPL5E4D 7x/sKbJuev4ymMFFhVc+yd/ioisNA0yCHmAQQPMFCLTtgyWhdEoGywPNF4u8Moj8+xEqUddF/yrtk tkXN0cS+udSt2a6kidUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzyDT-0064s5-Aj; Sun, 04 Jul 2021 09:15:09 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzy4Z-0061EF-95 for linux-arm-kernel@lists.infradead.org; Sun, 04 Jul 2021 09:05:56 +0000 Received: by mail-pg1-x536.google.com with SMTP id m26so15036894pgb.8 for ; Sun, 04 Jul 2021 02:05:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NPJDGg5FUIlGKxFIr3cHBiKXJApkbS5HOtFGL2ZFtnI=; b=Y5vOqA5VOi+FrwY2NKDcz7f743/FfVMilz2a7ydOaqlPDwHXGJjXCnQvNZTUZG/VAJ 0BEywGa25xiOVnSMvFN7wTdpafQeHwxBu142wKYTkUutW6p/tf4wc4vO4Nx3curO3sw1 +8tiTqWBXHMVJq18XEJ+M59Ivjsq64+kwcAeQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NPJDGg5FUIlGKxFIr3cHBiKXJApkbS5HOtFGL2ZFtnI=; b=ixJ7TaQSMT+/rJ3FsXaqVhZqlDtiOKcU5RXTgxvpS+WVHNOpmdqWO+PhaZnL606U1t 4bhou88j4XItSkkVc5DGwvD6skQ1vRcUqAhNMx3FLaVrlIe0GqyY/gf9k35iwKWSlFiM zdxgq5nSu++QsqGXcAvgC4C3eaxF406YM2gQ+2IxxVqDeTX3KtENSh4RDSlplgiU4FCJ g2kjEABTyr2UzzyJJ9WM/f1jzQ5ylb8+8aQFKYQ41FwddiohqynjVmPXAHPX21d/GQdo dXckkmJTCE4ud5LlMWRG/01jhmTjV7X+VUtuJ325n9Qytpzyw1yKyICHbDNB/ld4xRhG Yf5w== X-Gm-Message-State: AOAM532wWz7UZb/zx8X0DqeBCDsdwMQTVemcuLT/56hzLETICsostE1A azO6NXQeYOVou1fmyWuvhnnYUg== X-Google-Smtp-Source: ABdhPJzkHWVdOK7EaakstBIyQU5sd1VI/Q64M2LP26zyXubUC+ZrLsxppnNHkOOSw62DRzm7TEhTUg== X-Received: by 2002:a63:4b23:: with SMTP id y35mr9529467pga.179.1625389554638; Sun, 04 Jul 2021 02:05:54 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a884:1ae9:772f:6f0f:3e24]) by smtp.gmail.com with ESMTPSA id m24sm3360793pgd.60.2021.07.04.02.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 02:05:54 -0700 (PDT) From: Jagan Teki To: Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Frieder Schrempf , Daniel Vetter , Marek Vasut , Krzysztof Kozlowski , Fabio Estevam Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RFC PATCH 17/17] drm: bridge: samsung-dsim: Add bridge mode_fixup Date: Sun, 4 Jul 2021 14:32:30 +0530 Message-Id: <20210704090230.26489-18-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210704090230.26489-1-jagan@amarulasolutions.com> References: <20210704090230.26489-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210704_020555_347378_15FC1584 X-CRM114-Status: GOOD ( 13.23 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fixing up the mode flags are required in order to correlate the correct sync flags in i.MX8MM eLCDIF. So, handle the mode flags via bridge, mode_fixup. Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 0ed218f5eefc..c2a76ee5ac4e 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1474,6 +1474,16 @@ static void samsung_dsim_bridge_disable(struct drm_bridge *bridge) pm_runtime_put_sync(dsi->dev); } +static bool samsung_dsim_bridge_mode_fixup(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode) +{ + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); + adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); + + return true; +} + static void samsung_dsim_bridge_mode_set(struct drm_bridge *bridge, const struct drm_display_mode *mode, const struct drm_display_mode *adjusted_mode) @@ -1542,6 +1552,7 @@ static const struct drm_bridge_funcs samsung_dsim_bridge_funcs = { .enable = samsung_dsim_bridge_enable, .disable = samsung_dsim_bridge_disable, .mode_set = samsung_dsim_bridge_mode_set, + .mode_fixup = samsung_dsim_bridge_mode_fixup, .attach = samsung_dsim_bridge_attach, };