From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E70AC47404 for ; Mon, 7 Oct 2019 22:01:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C697220867 for ; Mon, 7 Oct 2019 22:01:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DUSNB2Mq"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="RljdPAbk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C697220867 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WeVtl7dA1JdE5M3YzMgq3NYW4RJHwFG2Pr/nZVqXdGM=; b=DUSNB2Mqsu5z/j w+p24f3OVb+Ils9+evir5lwT1mp4XxZkJb4dxBul0tKnBXDbmhtf/AjZpPgXNjOU9nW7wiQlVxQF5 aTQdlUp+XLklSJorpOPeD+dOrvP8DloaHK9v6YeGOmNSNS8LTieh0KGu9yC1vyUfyhCqVNGXJLmmB sJ5HbZIUbHuljwhe5APGGC0q8KrS+3AqEZBOTRxfCsrr9dwJsmG12ss+JaSF2G9fECg8OaWbQGPci YWDLjbF6r2oNyQ40w8lWIsfJJtChkB00QsLQPE1NOL9CMon6FdndlPCLPACgK53ILaYwQ2969YD8f XuzKOinrKp/awKt9uz9Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHb4e-0005Y9-Le; Mon, 07 Oct 2019 22:01:48 +0000 Received: from mail-vs1-xe43.google.com ([2607:f8b0:4864:20::e43]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHb4a-0005VS-9B for linux-arm-kernel@lists.infradead.org; Mon, 07 Oct 2019 22:01:46 +0000 Received: by mail-vs1-xe43.google.com with SMTP id d3so10013459vsr.1 for ; Mon, 07 Oct 2019 15:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v7q4a7E/bdzfnNuFtukASfjvtCW3DHRys6DRIedS+0A=; b=RljdPAbkJW3MbYTayN5MGD6cp8EX4dG5a5C6Jn+mUt1MmgZYsKfmiYgiJpNaIv39uL AIao7+d9Jaqe5PCcr2tpzFRZHVZ2UVypS5FQgiZCurdgdnh6SGBAG9S0vzfSHSUIjYDS Nxl9ESSdgWOftZCM9y7ob4eHSujVf11Gye0TA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=v7q4a7E/bdzfnNuFtukASfjvtCW3DHRys6DRIedS+0A=; b=kOCpR6omqlMQzOisvoXhtYzLvpfJYC++L6HdRwBUU7+lbdOBBvi8V4QESMwG3ekUzd 8R9N9E8ytUtMM651z/ut5JnrQ2O7QiMRN4BTM/HPqGG3g5cNZDJfBGRddBclYxGfe38T dUtmIe/WZNqrWxPOK+sLoU+03/ZhTt1tgP3oGqBPahs8cK3uM2Gcv3Ab/l8XfNFPtqDj SZsjW8wsPmNcOawlW+3DXZMJX7lXrH6zodk4RSstoknk+SdmerX/A3geNCzx4/6PTrn8 id5fvlpp10WAZEKqRXfXtDAbEwrUDgLzZarAOkz1pQr82g3yoMkS2m47dG5goWJlGtjb VP+A== X-Gm-Message-State: APjAAAX+vmkJkahR6/w9j7aKPqLMNTuMvxyc6w7pLA7CaNb/60+Q/Vx9 KKptKgiOP0e/seiDbt36f+ntSL953DKvyTgpIjyBgA== X-Google-Smtp-Source: APXvYqzwdHa5sY9iQn67YNrZItWTla9P194bydzs4g44hAbColKb9C8i4kQLgtGVXwIOJdtnP9jcB7U3GD0bMGCInxM= X-Received: by 2002:a67:f0dd:: with SMTP id j29mr9044915vsl.92.1570485697452; Mon, 07 Oct 2019 15:01:37 -0700 (PDT) MIME-Version: 1.0 References: <20190925225833.7310-3-dbasehore@chromium.org> <20190929052307.GA28304@jamwan02-TSP300> <20191007164441.GB126146@art_vandelay> In-Reply-To: <20191007164441.GB126146@art_vandelay> From: "dbasehore ." Date: Mon, 7 Oct 2019 15:01:25 -0700 Message-ID: Subject: Re: [v8,2/4] drm/panel: set display info in panel attach To: Sean Paul X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191007_150144_321269_D56F49CD X-CRM114-Status: GOOD ( 26.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , David Airlie , Thierry Reding , "james qian wang \(Arm Technology China\)" , Rodrigo Vivi , Matthias Brugger , "linux-mediatek@lists.infradead.org" , nd , Sam Ravnborg , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 7, 2019 at 9:44 AM Sean Paul wrote: > > On Mon, Sep 30, 2019 at 04:14:54PM -0700, dbasehore . wrote: > > On Sat, Sep 28, 2019 at 10:23 PM james qian wang (Arm Technology > > China) wrote: > > > > > > On Wed, Sep 25, 2019 at 03:58:31PM -0700, Derek Basehore wrote: > > > > Devicetree systems can set panel orientation via a panel binding, but > > > > there's no way, as is, to propagate this setting to the connector, > > > > where the property need to be added. > > > > To address this, this patch sets orientation, as well as other fixed > > > > values for the panel, in the drm_panel_attach function. These values > > > > are stored from probe in the drm_panel struct. > > > > > > > > Signed-off-by: Derek Basehore > > > > Reviewed-by: Sam Ravnborg > > > > --- > > > > drivers/gpu/drm/drm_panel.c | 28 +++++++++++++++++++++ > > > > include/drm/drm_panel.h | 50 +++++++++++++++++++++++++++++++++++++ > > > > 2 files changed, 78 insertions(+) > > > > > > > > diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c > > > > index 0909b53b74e6..1cd2b56c9fe6 100644 > > > > --- a/drivers/gpu/drm/drm_panel.c > > > > +++ b/drivers/gpu/drm/drm_panel.c > > > > @@ -104,11 +104,23 @@ EXPORT_SYMBOL(drm_panel_remove); > > > > */ > > > > int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector) > > > > { > > > > + struct drm_display_info *info; > > > > + > > > > if (panel->connector) > > > > return -EBUSY; > > > > > > > > panel->connector = connector; > > > > panel->drm = connector->dev; > > > > + info = &connector->display_info; > > > > + info->width_mm = panel->width_mm; > > > > + info->height_mm = panel->height_mm; > > > > + info->bpc = panel->bpc; > > > > + info->panel_orientation = panel->orientation; > > > > + info->bus_flags = panel->bus_flags; > > > > + if (panel->bus_formats) > > > > + drm_display_info_set_bus_formats(&connector->display_info, > > > > + panel->bus_formats, > > > > + panel->num_bus_formats); > > > > > > > > return 0; > > > > } > > > > @@ -126,6 +138,22 @@ EXPORT_SYMBOL(drm_panel_attach); > > > > */ > > > > void drm_panel_detach(struct drm_panel *panel) > > > > { > > > > + struct drm_display_info *info; > > > > + > > > > + if (!panel->connector) > > > > + goto out; > > > > + > > > > + info = &panel->connector->display_info; > > > > + info->width_mm = 0; > > > > + info->height_mm = 0; > > > > + info->bpc = 0; > > > > + info->panel_orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN; > > > > + info->bus_flags = 0; > > > > + kfree(info->bus_formats); > > > > + info->bus_formats = NULL; > > > > + info->num_bus_formats = 0; > > > > + > > > > +out: > > > > panel->connector = NULL; > > > > panel->drm = NULL; > > > > } > > > > diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h > > > > index d16158deacdc..f3587a54b8ac 100644 > > > > --- a/include/drm/drm_panel.h > > > > +++ b/include/drm/drm_panel.h > > > > @@ -141,6 +141,56 @@ struct drm_panel { > > > > */ > > > > const struct drm_panel_funcs *funcs; > > > > > > > > > > All these new added members seems dupliated with drm_display_info, > > > So I think, can we add a new drm_plane_funcs func: > > > > > > int (*set_display_info)(struct drm_panel *panel, > > > struct drm_display_info *info); > > > > I don't disagree personally, since I originally wrote it this way, but > > 2 maintainers, Daniel Vetter and Thierry Reding, requested that it be > > changed. Unless that decision is reversed, I won't be changing this. > > > > Reading back the feedback on v1, I don't think anyone said they were against > storing a drm_display_info struct in drm_panel (no one really weighed in on > it one way or another). IMO duplicating a bunch of fields feels pretty icky. Thanks for the review. Should we duplicate the entire struct, or just create a sub-struct, say, physical_properties that will be part of drm_display_info and drm_panel? > > I think most fields in drm_display_info have pretty reasonable defaults, so I'd > recommend just storing a copy in drm_panel. As Thierry suggests, we can > populate the dt parts in probe (orientation) and then copy over all or a subset > of the struct to connector on attach. > > Sean > > > > > > > Then in drm_panel_attach(), via this interface the specific panel > > > driver can directly set connector->display_info. like > > > > > > ... > > > if (panel->funcs && panel->funcs->set_display_info) > > > panel->funcs->unprepare(panel, connector->display_info); > > > ... > > > > > > Thanks > > > James > > > > > > > + /** > > > > + * @width_mm: > > > > + * > > > > + * Physical width in mm. > > > > + */ > > > > + unsigned int width_mm; > > > > + > > > > + /** > > > > + * @height_mm: > > > > + * > > > > + * Physical height in mm. > > > > + */ > > > > + unsigned int height_mm; > > > > + > > > > + /** > > > > + * @bpc: > > > > + * > > > > + * Maximum bits per color channel. Used by HDMI and DP outputs. > > > > + */ > > > > + unsigned int bpc; > > > > + > > > > + /** > > > > + * @orientation > > > > + * > > > > + * Installation orientation of the panel with respect to the chassis. > > > > + */ > > > > + int orientation; > > > > + > > > > + /** > > > > + * @bus_formats > > > > + * > > > > + * Pixel data format on the wire. > > > > + */ > > > > + const u32 *bus_formats; > > > > + > > > > + /** > > > > + * @num_bus_formats: > > > > + * > > > > + * Number of elements pointed to by @bus_formats > > > > + */ > > > > + unsigned int num_bus_formats; > > > > + > > > > + /** > > > > + * @bus_flags: > > > > + * > > > > + * Additional information (like pixel signal polarity) for the pixel > > > > + * data on the bus. > > > > + */ > > > > + u32 bus_flags; > > > > + > > > > /** > > > > * @list: > > > > * > > > > Thanks for the review > > -- > Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel