From patchwork Mon Oct 16 16:53:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 735823 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 F36DECDB465 for ; Mon, 16 Oct 2023 16:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234424AbjJPQ4t (ORCPT ); Mon, 16 Oct 2023 12:56:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234343AbjJPQ4g (ORCPT ); Mon, 16 Oct 2023 12:56:36 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDC291118 for ; Mon, 16 Oct 2023 09:53:59 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-405524e6769so29583135e9.1 for ; Mon, 16 Oct 2023 09:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697475238; x=1698080038; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vIIdmNh1k8eBG9uBUahNJ3kj0YyYALSyO9RgB2j97yc=; b=cteGmrEu6H+z8BZKwXN9UyqYzyNf55jHNpfI17PhSUJTZgWnKI58onbeP6HHzSLEho ++0VpyV86HovZfoyxiExnFUUwqc4kbsjmtdD6uXUQU1E0EZGE6WHeJCBejwbmU07/2qP hxDDwc8oH1o1b6d2xRBMOYTKHZdgVzYEwALphk33lorBPLojTTHHfRbPwGUrfKoBxwe9 C/4hhKadBJm/ZbT1JTipZGyerYgHT5oZFpsjAyh/VjUTTgucsfqZlzsVG3vEsCPjgkz1 ojfxGkpfjZ7M4hRvHupF8gxhH5kI8bhqnws4hGflScTvzkKuzX5V/x9vsoexOi3E3uFg bfxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697475238; x=1698080038; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vIIdmNh1k8eBG9uBUahNJ3kj0YyYALSyO9RgB2j97yc=; b=lZoN4lqeeXrtnW4ar9SNdcwW4fHNVjcSaBsEV/eq5Bot/WnTS4QNrqsrR7/hTf/lxS Yu4ksnZBSxg+2KjZXmbgYSCSTHZZ41m+79WXAmXfxRx8AGBk6q5U+r84Z+Vv0hns0cZN 1MJ+3nDslopF6EHMpUNgIgpKa79Kine1cOdHtI6hiKCjG12wPC5TvsOfqEaTzR+IR30+ JyZ1eeUVSYNcmAiJrksEkMU7N/i8m1ObqGGfAnqKwnr7ayHgIzD9broEEAreyefV7Fld bP2vuocm3hrPZ3hwTp5APn9WHDwvQ1V1RTJJ9vGjlYX/0T/Mg/CopLkfKrPJdkIoQjbj YQTQ== X-Gm-Message-State: AOJu0YxsOrSp9oh5xKRA6O7QB9IbIjXbQGiNBfsSvKuqcs7lkesUGr79 uf9DxvYJ9vmZ3sPXwc4HkYI/qA== X-Google-Smtp-Source: AGHT+IGNQrJKWVZTwl1M8CB81+la/NYfwFevzUPH8Cxa+b0iPaxGyHdMaaObw+TNq7n1VkEeyw/20g== X-Received: by 2002:a05:600c:4fd4:b0:405:3622:382c with SMTP id o20-20020a05600c4fd400b004053622382cmr6366074wmq.17.1697475238254; Mon, 16 Oct 2023 09:53:58 -0700 (PDT) Received: from eriador.lumag.spb.ru ([45.84.211.189]) by smtp.gmail.com with ESMTPSA id s19-20020a05600c45d300b0040648217f4fsm7638996wmo.39.2023.10.16.09.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 09:53:57 -0700 (PDT) From: Dmitry Baryshkov To: Dave Stevenson , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Douglas Anderson , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , Konrad Dybcio , Jessica Zhang Cc: Marek Vasut , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [RFC PATCH 00/10] drm/mipi-dsi: another attempt at sorting out DSI link powerup Date: Mon, 16 Oct 2023 19:53:45 +0300 Message-ID: <20231016165355.1327217-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org It is well known that DSI dosn't fully fit into the DRM enable/disable model thanks to the intermediate LP-11 state: (roughly) the link is already up, but the video stream is not yet enabled. Previously we have handled this by forcing DSI link powerup in the mode_set callback. This worked, but it was not an ideal solution. For example, it didn't play well with the atomicity part. Then Dave attempted to solve the issue by adding pre_enable_prev_first. It also seemed to work fine, until we stumbled at the issue of the driver being unable to negotiate whether the bridge/panel didn't enable pre_enable_prev_first because it is not updated yet or because it doesn't need the callbacks to be inverted. This series is yet another attempt at solving the DSI link powerup story. It adds two flags for the DSI evice. One of them should trigger implicit link powerup at the atomic_pre_enable / atomic_post_disable callbacks. Another one requests excplicit DSI link power control. Dmitry Baryshkov (10): Revert "drm/bridge: tc358762: Split register programming from pre-enable to enable" drm/mipi-dsi: document DSI hosts limitations drm/mipi-dsi: add API for manual control over the DSI link power state drm/msm/dsi: use dsi_mgr_bridge_power_off in dsi_mgr_bridge_post_disable drm/msm/dsi: implement manual power control drm/bridge: tc358762: add support for manual DSI power control drm/bridge: ps8640: require manual DSI power control drm/bridge: lt9611: mark for automatic DSI power control drm/bridge: lt9611uxc: implement automatic DSI power control drm/msm/dsi: drop (again) the ps8640 workaround drivers/gpu/drm/bridge/lontium-lt9611.c | 2 +- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 2 +- drivers/gpu/drm/bridge/parade-ps8640.c | 14 ++++- drivers/gpu/drm/bridge/tc358762.c | 24 +++++--- drivers/gpu/drm/drm_mipi_dsi.c | 31 ++++++++++ drivers/gpu/drm/msm/dsi/dsi.h | 4 ++ drivers/gpu/drm/msm/dsi/dsi_host.c | 44 ++++++++++++++ drivers/gpu/drm/msm/dsi/dsi_manager.c | 70 +++++++++++++--------- include/drm/drm_mipi_dsi.h | 33 ++++++++-- 9 files changed, 180 insertions(+), 44 deletions(-)