From patchwork Tue Aug 23 14:08:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 9295919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 88173607F0 for ; Tue, 23 Aug 2016 16:09:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7848328C92 for ; Tue, 23 Aug 2016 16:09:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B2CB28C9A; Tue, 23 Aug 2016 16:09:00 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 E9A7A28C92 for ; Tue, 23 Aug 2016 16:08:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2260F6E6B6; Tue, 23 Aug 2016 16:08:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2691B6E66D for ; Tue, 23 Aug 2016 14:08:16 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id o80so18345093wme.0 for ; Tue, 23 Aug 2016 07:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=I7xY38rxfgyWmAeU+9JU0kxAwQkVRg3rLFPkYU9CKNI=; b=nLW4Aq+fMrHLOGeb1SfUDrY9ts9bZAbBkJX0VHf4vviuQAt6DBsnV1EUeeZ0Ri6IoX zhiu9rJqKRIy3tJvzsasn87GDx2nK1sO612qOchFQ1hq1AljDfVExipY/10EA1VHVotP Dxzq1Fse/UlYN0rq9lEcwlQCaKpgruTtGhY4FSqzSk+Yl+6UqowdNOJRD3pXafhgkbZV f9BkJVssG+TXbpdke27jLfOwBBMP0QQ1VHRvOolW83endTLYObvA4lZ5ZsXrpNYtJADP BK0IsiMUYYNu5l48HygwjpLUZ/ZPbyHbcqOPsbtYKUKcgiKkQ6I6+18nT94iAm5phnLo h9xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=I7xY38rxfgyWmAeU+9JU0kxAwQkVRg3rLFPkYU9CKNI=; b=VLQKVgiXiw0ZXZfq8eFED2naX/F/6iht6B7UAQWj22CdbXB27IOSWPztmMpEFfgI2M b/G6FmT+etp6cERJ6R13c4IESHaFMPB4kkBJpRVr9mtfv3fP1MLW9ZefewQrXqZXb/qn 6DvlhROFqv49RD6dydSuVBzx/ITVqQjBAthinCYn+rYRyBMIrcC632VRjC6svQV0Wtx8 GUesgvB30/BNwANbKjcQba0ZpgNtc3ixPKFixlcGnGzwwu+IQz7gN338bysnt0szAsBa s0a05HUjsiObprOb9j0+q/2WBgBfAOWQSHrLxgVZfg4QuuOK0VGG+gGX0lSvQPZCcjFY +sOw== X-Gm-Message-State: AEkoousMgOqC1zy85SH8kANFLu+PpkIbr8CMLAZMKmJPO+jCkS8d8UwC5ZccDepQFHNntQ== X-Received: by 10.28.29.215 with SMTP id d206mr19358811wmd.75.1471961294773; Tue, 23 Aug 2016 07:08:14 -0700 (PDT) Received: from NewMoon.iit.local ([90.147.180.254]) by smtp.gmail.com with ESMTPSA id lv9sm4051338wjb.22.2016.08.23.07.08.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Aug 2016 07:08:13 -0700 (PDT) From: Andrea Merello To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm: simple_kms_helper: add support for bridges Date: Tue, 23 Aug 2016 16:08:04 +0200 Message-Id: <1471961284-12439-1-git-send-email-andrea.merello@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 23 Aug 2016 16:08:54 +0000 Cc: Andrea Merello X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Introduce drm_simple_display_pipe_attach_bridge() in order to make it possible to use drm encoders with the simple display pipes managed by simple_kms_helpers Suggested-by: Daniel Vetter Signed-off-by: Andrea Merello Cc: Noralf Trønnes Cc: Daniel Vetter Cc: David Airlie --- 2.7.4 diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c index 3a48c7c..05ee61d 100644 --- a/drivers/gpu/drm/drm_simple_kms_helper.c +++ b/drivers/gpu/drm/drm_simple_kms_helper.c @@ -133,6 +133,28 @@ static const struct drm_plane_funcs drm_simple_kms_plane_funcs = { }; /** + * drm_simple_display_pipe_attach_bridge - Attach a bridge to the display pipe + * @pipe: simple display pipe object + * @bridge: bridge to attach + * + * Makes it possible to still use the drm_simple_display_pipe helpers when + * a DRM bridge has to be used. + * Note that you probably want to initialize the pipe by passing a NULL + * connector to drm_simple_display_pipe_init() + * + * Returns: + * Zero on success, negative error code on failure. + */ +int drm_simple_display_pipe_attach_bridge(struct drm_simple_display_pipe *pipe, + struct drm_bridge *bridge) +{ + bridge->encoder = &pipe->encoder; + pipe->encoder.bridge = bridge; + return drm_bridge_attach(pipe->encoder.dev, bridge); +} +EXPORT_SYMBOL(drm_simple_display_pipe_attach_bridge); + +/** * drm_simple_display_pipe_init - Initialize a simple display pipeline * @dev: DRM device * @pipe: simple display pipe object to initialize diff --git a/include/drm/drm_simple_kms_helper.h b/include/drm/drm_simple_kms_helper.h index 2690397..1d73bcf 100644 --- a/include/drm/drm_simple_kms_helper.h +++ b/include/drm/drm_simple_kms_helper.h @@ -85,6 +85,9 @@ struct drm_simple_display_pipe { const struct drm_simple_display_pipe_funcs *funcs; }; +int drm_simple_display_pipe_attach_bridge(struct drm_simple_display_pipe *pipe, + struct drm_bridge *bridge); + int drm_simple_display_pipe_init(struct drm_device *dev, struct drm_simple_display_pipe *pipe, const struct drm_simple_display_pipe_funcs *funcs,