Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp638490ybl; Fri, 9 Aug 2019 11:17:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYcXeYHp5EECgugIbDJRRnbs8JtqfirSmpDdaeZwnox+4WCZEOijZJsjgl6XNUN7PcnjnB X-Received: by 2002:a63:3009:: with SMTP id w9mr19383235pgw.260.1565374628226; Fri, 09 Aug 2019 11:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565374628; cv=none; d=google.com; s=arc-20160816; b=kxKoJydo+Uk0vv66VhhJBts597XTBM3ZkyY5UBCKGDMKsqGQNtECo5gM0SCh+usHy7 mYWSr1hLSl4FZM9Rh4kZooYirJ/F/GyD/1FBq0347tY2YBcm0HvN5JdE5zAid+VGuFCB GMxYL14TobgtLoDN0c5GIOOaj/0oJWIWhyeelIk5qWyJ8umjj+hjzGa2wl3HkB60egVM ZF+uh61EAwWAnAqHO/q3VT8ZikIvr2mtdTKYKQbbOPMo3oNuy9C3caQwmkg8ximHJI9x xUbKYrrrMWW9sLIBEHv/w4G9p6f8KHo7TAq+G5vDNl638Z/doUrrxX0BrhzhEWNkKjUJ llpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9R2KFAQfCaNYQE1wUgsQWy2+u1GPd5OBsA63DhIEpes=; b=UwEwuU0kQKC89Mo+Za2MOugjzAjrzZhotnmQ9zFsd46ZUyIGS1GrAqT3iVp044/zz1 eYA4Z8SBOq8PmaV5wfZIuPJT3r7AuWxImn3sNKhb9jf5wBG8Gpoumz8EbVvDgSboHovF d3kIsvW6Na+hJmtwRuVxwy98Ve4VUIHLy+SvE8qsUSSMdgOegkWuSKJv/a4WpzHqG9zM ZVwZdjVX7oKR8x/A2EN+ty9kNqpaYWrs0gQpsA8zHlC/PObcErHznQRJolOjj3L3JxTp bWVf8xLc3Nki2mK2i7FkjbVAelgCXg+FAWQvmUIeaIVhgq++1s08KCcrPkBVyX/IE4Gn tnlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x16si58402516pgi.312.2019.08.09.11.16.50; Fri, 09 Aug 2019 11:17:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407091AbfHIQpm (ORCPT + 99 others); Fri, 9 Aug 2019 12:45:42 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:59504 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406412AbfHIQpm (ORCPT ); Fri, 9 Aug 2019 12:45:42 -0400 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 2B1D1FB03; Fri, 9 Aug 2019 18:45:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zG0agjQGW3tZ; Fri, 9 Aug 2019 18:45:38 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id BDFB241D9E; Fri, 9 Aug 2019 18:45:37 +0200 (CEST) Date: Fri, 9 Aug 2019 18:45:37 +0200 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Ville Baillie Cc: marex@denx.de, stefan@agner.ch, airlied@linux.ie, daniel@ffwll.ch, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Robert Chiras Subject: Re: [PATCH] mxsfb: allow attachment of display bridges Message-ID: <20190809164537.GA4212@bogon.m.sigxcpu.org> References: <20190801111853.GA24574@villeb-dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190801111853.GA24574@villeb-dev> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Aug 01, 2019 at 11:18:53AM +0000, Ville Baillie wrote: > --- > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 20 ++++++++++++++++---- > drivers/gpu/drm/mxsfb/mxsfb_drv.h | 1 + > drivers/gpu/drm/mxsfb/mxsfb_out.c | 14 +++++++++++--- > 3 files changed, 28 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c > index 6fafc90da4ec..c19a7b7aa3a6 100644 > --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c > +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c > @@ -229,10 +229,22 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags) > goto err_vblank; > } > > - ret = drm_panel_attach(mxsfb->panel, &mxsfb->connector); > - if (ret) { > - dev_err(drm->dev, "Cannot connect panel\n"); > - goto err_vblank; > + if (mxsfb->panel) { > + ret = drm_panel_attach(mxsfb->panel, &mxsfb->connector); > + if (ret) { > + dev_err(drm->dev, "Cannot connect panel\n"); > + goto err_vblank; > + } > + } else if (mxsfb->bridge) { > + ret = drm_bridge_attach(&mxsfb->pipe.encoder, mxsfb->bridge, > + NULL); > + if (ret) { > + dev_err(drm->dev, "Cannot connect bridge\n"); > + goto err_vblank; > + } > + } else { > + dev_err(drm->dev, "No panel or bridge\n"); > + return -EINVAL; > } > > drm->mode_config.min_width = MXSFB_MIN_XRES; > diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.h b/drivers/gpu/drm/mxsfb/mxsfb_drv.h > index d975300dca05..436fe4bbb47a 100644 > --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.h > +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.h > @@ -29,6 +29,7 @@ struct mxsfb_drm_private { > struct drm_simple_display_pipe pipe; > struct drm_connector connector; > struct drm_panel *panel; > + struct drm_bridge *bridge; > }; > > int mxsfb_setup_crtc(struct drm_device *dev); > diff --git a/drivers/gpu/drm/mxsfb/mxsfb_out.c b/drivers/gpu/drm/mxsfb/mxsfb_out.c > index 91e76f9cead6..77e03eb0fca6 100644 > --- a/drivers/gpu/drm/mxsfb/mxsfb_out.c > +++ b/drivers/gpu/drm/mxsfb/mxsfb_out.c > @@ -78,9 +78,11 @@ int mxsfb_create_output(struct drm_device *drm) > { > struct mxsfb_drm_private *mxsfb = drm->dev_private; > struct drm_panel *panel; > + struct drm_bridge *bridge; > int ret; > > - ret = drm_of_find_panel_or_bridge(drm->dev->of_node, 0, 0, &panel, NULL); > + ret = drm_of_find_panel_or_bridge(drm->dev->of_node, 0, 0, &panel, > + &bridge); > if (ret) > return ret; > > @@ -91,8 +93,14 @@ int mxsfb_create_output(struct drm_device *drm) > ret = drm_connector_init(drm, &mxsfb->connector, > &mxsfb_panel_connector_funcs, > DRM_MODE_CONNECTOR_Unknown); > - if (!ret) > - mxsfb->panel = panel; > + if (!ret) { > + if (panel) > + mxsfb->panel = panel; > + else if (bridge) > + mxsfb->bridge = bridge; > + else > + return -EINVAL; > + } > > return ret; > } > -- > 2.17.1 Robert Chiras posted bridge support for mxsfb back in June: https://patchwork.freedesktop.org/patch/314430/?series=62822&rev=1 Cheers, -- Guido > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel