From patchwork Tue Aug 20 01:16:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 11102519 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 232A214DE for ; Tue, 20 Aug 2019 01:18:56 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0D12322DA7 for ; Tue, 20 Aug 2019 01:18:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D12322DA7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 28DAC6E588; Tue, 20 Aug 2019 01:18:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 049AB6E504 for ; Tue, 20 Aug 2019 01:17:45 +0000 (UTC) Received: from pendragon.bb.dnainternet.fi (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 90EEEB83; Tue, 20 Aug 2019 03:17:40 +0200 (CEST) From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 13/50] drm/bridge: panel: Implement bridge connector operations Date: Tue, 20 Aug 2019 04:16:44 +0300 Message-Id: <20190820011721.30136-14-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190820011721.30136-1-laurent.pinchart@ideasonboard.com> References: <20190820011721.30136-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1566263861; bh=VMP2jEkOkMHifcAl25Ak8CCeOn7WuLioVawJs+uQqWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=inTjo2cUhrhOg82LSAuG5JSxtBS109bUNNEVVxtwXYkHM1uAUUNYWsBCsNT5tRDHb XQz24JnD7ZLh2/QrMxBaP5F1VnzyNl9rs+8P8ZzgbCT7yqR+WggZtZevL8F6x2VFjy ZHCrnbm8aUFTpCKhbvjjUSY3/Os1CezCbKwet5WA= 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: Maxime Ripard , Tomi Valkeinen , Sean Paul , Sebastian Reichel Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Implement the newly added bridge connector operations, allowing the usage of drm_bridge_panel with drm_bridge_connector. Signed-off-by: Laurent Pinchart --- drivers/gpu/drm/bridge/panel.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index f5b8e55301ac..1c7f5b648f05 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -60,7 +60,7 @@ static int panel_bridge_attach(struct drm_bridge *bridge, int ret; if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) - return -EINVAL; + return 0; if (!bridge->encoder) { DRM_ERROR("Missing encoder\n"); @@ -123,6 +123,18 @@ static void panel_bridge_post_disable(struct drm_bridge *bridge) drm_panel_unprepare(panel_bridge->panel); } +static int panel_bridge_get_modes(struct drm_bridge *bridge, + struct drm_connector *connector) +{ + struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); + + /* + * FIXME: drm_panel_get_modes() should take the connector as an + * argument. + */ + return drm_panel_get_modes(panel_bridge->panel); +} + static const struct drm_bridge_funcs panel_bridge_bridge_funcs = { .attach = panel_bridge_attach, .detach = panel_bridge_detach, @@ -130,6 +142,7 @@ static const struct drm_bridge_funcs panel_bridge_bridge_funcs = { .enable = panel_bridge_enable, .disable = panel_bridge_disable, .post_disable = panel_bridge_post_disable, + .get_modes = panel_bridge_get_modes, }; /** @@ -175,6 +188,9 @@ struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel, #ifdef CONFIG_OF panel_bridge->bridge.of_node = panel->dev->of_node; #endif + panel_bridge->bridge.ops = DRM_BRIDGE_OP_MODES; + /* FIXME: The panel should report its type. */ + panel_bridge->bridge.type = DRM_MODE_CONNECTOR_DPI; drm_bridge_add(&panel_bridge->bridge);