From patchwork Wed Dec 19 19:01:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10737973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5130E6C5 for ; Wed, 19 Dec 2018 19:01:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4338A20121 for ; Wed, 19 Dec 2018 19:01:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4130520223; Wed, 19 Dec 2018 19:01:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E403720121 for ; Wed, 19 Dec 2018 19:01:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 769A66F15D; Wed, 19 Dec 2018 19:01:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9AFEA6F15D for ; Wed, 19 Dec 2018 19:01:14 +0000 (UTC) Received: by mail-ed1-x542.google.com with SMTP id b3so17908885ede.1 for ; Wed, 19 Dec 2018 11:01:14 -0800 (PST) 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=wyDsfpos2Yzl8pDmxEtdfZSncMK2k9xE7O6e4XPmvwo=; b=V/X5hy7/txSv6xCyBwjzB3dl8UGNZRfmU1U4u0Qe+RGcMsSvmOxD+Qrpj33makTZrk TJWCIe9fSArtyR+fy8PB1RI2vUgovDDJU1kwkbTktobVuuAngJNV5ESxdyjp6GtL3bBV pCMUlWCHDURdddSYvH0Kh9Lx/iXFWhxQ4cPP+l/sBqxiwyORQFTdjw2lCMNy/FvRn4Mg Ql5sZIv0zVStVyiuY2hj4Amxef4KeNE+ZxuUH23xey46Msxbm8zxKLHIJN88dYRIozwR OgjChN++MEVL9hlzsVbLk3m5w/xX2jA8nJ3+E9Wwr/59hqgCuiq3IXxVDEf3cwELaMTi x4vQ== X-Gm-Message-State: AA+aEWYYUstgjX/qfZYT31avvhGYAIMEEKDqUliwkQzrOXx28AFUbyct Jkirdd66AUgHaY2suWA5yliMb3qazuU= X-Google-Smtp-Source: AFSGD/UmJCx9V82SpAoUQIyOxJJcOLCAzd4kS00sfemjmIXUsPgsmckTjCQWjGfBvTcx6DIznxelKA== X-Received: by 2002:a17:906:359b:: with SMTP id o27-v6mr17324066ejb.14.1545246072989; Wed, 19 Dec 2018 11:01:12 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id e7-v6sm2890933ejt.23.2018.12.19.11.01.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 11:01:12 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 2/2] drm/panel: Small documentation polish Date: Wed, 19 Dec 2018 20:01:02 +0100 Message-Id: <20181219190102.8888-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.20.0.rc1 In-Reply-To: <20181219190102.8888-1-daniel.vetter@ffwll.ch> References: <20181219190102.8888-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Need to make sure people can find the panel-bridge to avoid typing too much. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/bridge/panel.c | 22 ++++++++++++++++++---- drivers/gpu/drm/drm_panel.c | 3 +++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index 7cbaba213ef6..37baa79e95c3 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -134,8 +134,8 @@ static const struct drm_bridge_funcs panel_bridge_bridge_funcs = { }; /** - * drm_panel_bridge_add - Creates a drm_bridge and drm_connector that - * just calls the appropriate functions from drm_panel. + * drm_panel_bridge_add - Creates a &drm_bridge and &drm_connector that + * just calls the appropriate functions from &drm_panel. * * @panel: The drm_panel being wrapped. Must be non-NULL. * @connector_type: The DRM_MODE_CONNECTOR_* for the connector to be @@ -149,9 +149,12 @@ static const struct drm_bridge_funcs panel_bridge_bridge_funcs = { * passed to drm_bridge_attach(). The drm_panel_prepare() and related * functions can be dropped from the encoder driver (they're now * called by the KMS helpers before calling into the encoder), along - * with connector creation. When done with the bridge, - * drm_bridge_detach() should be called as normal, then + * with connector creation. When done with the bridge (after + * drm_mode_config_cleanup() if the bridge has already been attached), then * drm_panel_bridge_remove() to free it. + * + * See devm_drm_panel_bridge_add() for an automatically manged version of this + * function. */ struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel, u32 connector_type) @@ -210,6 +213,17 @@ static void devm_drm_panel_bridge_release(struct device *dev, void *res) drm_panel_bridge_remove(*bridge); } +/** + * devm_drm_panel_bridge_add - Creates a managed &drm_bridge and &drm_connector + * that just calls the appropriate functions from &drm_panel. + * @dev: device to tie the bridge lifetime to + * @panel: The drm_panel being wrapped. Must be non-NULL. + * @connector_type: The DRM_MODE_CONNECTOR_* for the connector to be + * created. + * + * This is the managed version of drm_panel_bridge_add() which automatically + * calls drm_panel_bridge_remove() when @dev is unbound. + */ struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev, struct drm_panel *panel, u32 connector_type) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index c33f95e08e1b..dbd5b873e8f2 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -36,6 +36,9 @@ static LIST_HEAD(panel_list); * The DRM panel helpers allow drivers to register panel objects with a * central registry and provide functions to retrieve those panels in display * drivers. + * + * For easy integration into drivers using the &drm_bridge infrastructure please + * take look at drm_panel_bridge_add() and devm_drm_panel_bridge_add(). */ /**