From patchwork Mon Feb 27 11:39:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2742 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DC4A03F9C2 for ; Mon, 27 Feb 2023 12:39:54 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id b21-20020a63cf55000000b004393806c06esf1783395pgj.4 for ; Mon, 27 Feb 2023 03:39:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677497993; cv=pass; d=google.com; s=arc-20160816; b=auSbhyf4ZTnpgnakyP6qYNlwhdVlJyFr6B9iSQWPiKDeFT9XeIR0JczNx6r3Ss5+a0 aI9eXA2vNOabDMV4HOBF0LFyEQN5HcAQZFaMFTb+eBc8rJISrCvk76iCTbV133YSN8sp vtmcJRdtgJuMGfJNwDcW8l1DRyv/pOf4UBi72wKUCBV4kuF3JP9W9HjX/JM4HPD3ZKPb WgPpnWEFi8ouvlY4RSoXmONmZPdFkaLr14e2IWCENF38loW/HKYRcLYhlzJ1NE/A3sY+ bYD62SjgHx9fH2rY6DTp7fZxLf7ieHrYWRleAHG32KaFKzILphRlE4Z/m1XXPVkx6hLW byfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PXyMaYakWpzeHxDItJjMLvVDwLUKRthExKSMycQHk94=; b=G6glJLkuNz0t5Q/3Nw0FNWAN3hufvBE3RiOmBqcpRWluALOcYs+jVevEgoS7hyUTF3 J0auHTJRgDQaZHoSmPkv3tbpItPXB2RzzRACcZ4oFxJemEy/PWgDs+uWXQ6jESz592ta +lP6oyJB8caSiJ5yPVrorVDxstQpXi3IrflnN8j/D5jHGYF5fVZFSJFJy0ZtHGl5CPLy 0L8kSv1wHYGMUp1xx/fDWTeZ1S4/+K2X6yxEXKgnrOWkaNwHYZPRUjboSmErJSjXtXNx lIHKiD+RrUc2bl5LTTxnoCwBattc7PKCbCR7jvhRMkZPMJcD4tgwCiwNBrjuZFRvBwMG BmYg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="XO8VVmB/"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=PXyMaYakWpzeHxDItJjMLvVDwLUKRthExKSMycQHk94=; b=ffmLgU62GE0VRaBoD9j3hd0y4oHbNS8bdz8MZDLPFMeudCqrgIO0pKH0zdeQPvETKS +xEkNSqXbh+DZavUoRu3/8Z35F5e4oKPpqEm8cdZUAnqMRHfUryzuXWLJ+vca3MdUM+5 rEBbsiIx3RlwBorK48/03ICp9tPHQcQ/bFTGg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PXyMaYakWpzeHxDItJjMLvVDwLUKRthExKSMycQHk94=; b=aJOeuIvigJsWPpUea/VIPfPUaEhesrkgsz6xLcDpk+ljFtwAreUzeVQi6W0KlNYnQl 6vh6SM+Q7gHBrBbxe201V58R9w8qbzFUIOVbeHxGMO24s+vucViEItGAbUo2X8b4+pST mZLGdy/XryF4FF9Nz+U6nelWTxZrJTkXTcJT2V0CsZCzSDAI2xgQoppUVirJw/6LNN9q /HIsHSCSfxeb8dGgzeP45Ft65+aJ0VPmEWBB/vzu29hBKh9xGGBt5yuN7v35m2STyP/o J7D+grsFkkHt3K09IFqUlJQHQ3lVk6NddQZGeuvpBsB6kJv2ESCr76vKAsXwih2daXUD pOJw== X-Gm-Message-State: AO0yUKU//g9pQuF5ysCul89PbgHLPaA2EATs/DJqTxkfB9JG3Hr/+bEh YJV63jZT85GMhsHXFmK0LTEfxvoT X-Google-Smtp-Source: AK7set+O4XfDZn6I9j8o022UnMQ+r/vihi67/i65ixg5Aw3Xmnk2WoaexejScSiZ6YgaYImrBnzbNg== X-Received: by 2002:a17:903:48e:b0:19a:e617:34ff with SMTP id jj14-20020a170903048e00b0019ae61734ffmr5897362plb.11.1677497993547; Mon, 27 Feb 2023 03:39:53 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:2881:b0:225:cae6:ff24 with SMTP id f1-20020a17090a288100b00225cae6ff24ls4577643pjd.2.-pod-preprod-gmail; Mon, 27 Feb 2023 03:39:52 -0800 (PST) X-Received: by 2002:a17:902:ea07:b0:199:33ff:918a with SMTP id s7-20020a170902ea0700b0019933ff918amr30482450plg.21.1677497992592; Mon, 27 Feb 2023 03:39:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677497992; cv=none; d=google.com; s=arc-20160816; b=Vb3VcNw4sv0mO6Rm55mTiBhirAT974e+gU11AiSlsd5HLHDqxU2kokiihcWILqylAk byP9kDDck21j/qj4bZKDa/S4nYk1TDrBmUF6d8DnfC+viXSeqzH3bKsWuLvua6SBr/5W AHDXnE2g+gWeVE5c+RkigpFw86+R7r1+asI6TpLFJH6NYzhgLVpFkHbhirZ3uVCiRNHr +k8ben0B+qCvLwR1wDbMn/OJbMjapki/jEVsAPrIGVP/MbFkWxhIUEkqNQ9jGarB+8Ty okFNV95vxA8v8uJ4zjtQNaWukT/vt2RX8/robEEqQWp7tRSIJco/ff3APG87+L2hfWeH rnyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=nuq+y+HWw18yw8Sob2qSkhl5lK1AxCLgf7u71EJPHEk=; b=tHkph/G+HoB+qewaJ1mhPQ//e10L+LLJIxysSdu4R6P+AbghYp0OOuD3JfjmHJjlT7 VeWO5IKW6LIUv7Cs1E0CJXQckTY19R5VMXTFMF2js+zRzO9wXaFqViSHleEC/SEmEtJR mpYN+fpBkgBlVxu0gf9dDVWbWGSzkNGSKGhrPKEDrHpXPM0shS9bATL68WK8uH6FlFo6 l3+5j3aUOk6I+mIFjuCRtSTvUW0SRKvISsXUzEgSi/m4DhzAtr50RJCBY+5KvcAqrBDc 5jgxBIexgLw8l3kRwugT+9nam6YSPZYkh7A4DIh5HFqOiFNN9LJyvb0ASJtQXtTS+Luz JkrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="XO8VVmB/"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id d14-20020a170902654e00b00198ec2df868sor2286990pln.121.2023.02.27.03.39.52 for (Google Transport Security); Mon, 27 Feb 2023 03:39:52 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:903:42cd:b0:19c:d5c7:9401 with SMTP id jy13-20020a17090342cd00b0019cd5c79401mr9789215plb.52.1677497992292; Mon, 27 Feb 2023 03:39:52 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:39:51 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki , Maxime Ripard , Linus Walleij , Maarten Lankhorst Subject: [PATCH v13 02/18] drm: bridge: panel: Support nodrm case for drmm_panel_bridge_add Date: Mon, 27 Feb 2023 17:09:09 +0530 Message-Id: <20230227113925.875425-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="XO8VVmB/"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , drmm_panel_bridge_add DRM-managed action helper is useful for the bridge which automatically removes the bridge when drm pointer is cleaned. Supporting the same on non-component bridges like host DSI bridge requires a drm pointer which is indeed available only when a panel-bridge is found. For these use cases, the caller would call the drmm_panel_bridge_add by passing NULL to drm pointer. So, assign the bridge->dev to drm pointer for those cases. Cc: Maxime Ripard Cc: Laurent Pinchart Cc: Linus Walleij Cc: Maarten Lankhorst Signed-off-by: Jagan Teki --- Changes for v13: - new patch Note: use case on "[PATCH v13 04/18] drm: exynos: dsi: Switch to DSI panel or bridge find helper" drivers/gpu/drm/bridge/panel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index d4b112911a99..45a0c6671000 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -402,6 +402,13 @@ struct drm_bridge *drmm_panel_bridge_add(struct drm_device *drm, if (IS_ERR(bridge)) return bridge; + /* + * For non-component bridges, like host DSI bridge the DRM pointer + * can be available only when a panel-bridge is found. + */ + if (!drm) + drm = bridge->dev; + ret = drmm_add_action_or_reset(drm, drmm_drm_panel_bridge_release, bridge); if (ret)