Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12852042rwd; Fri, 23 Jun 2023 11:34:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5nHS9+nszBHCWHx6/4EMLh+CKx0eTUXsD/dBKCtGiC0dMY5eYAH0yIHqgio1hJL8SRNxOQ X-Received: by 2002:a17:90a:d70e:b0:25e:490b:6991 with SMTP id y14-20020a17090ad70e00b0025e490b6991mr13904503pju.42.1687545242614; Fri, 23 Jun 2023 11:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687545242; cv=none; d=google.com; s=arc-20160816; b=LRSAwvJezrMDqrLtsij7s4a8Vg9/2Wxj+1pb+uRWSYNUQiA2lbzCYBM7b8Q5L4cMj1 CD9JKcFGAT1IJT4zBSr1xaPW1zZDhH905/xHjCwtRxu7PXW3y8f0lfvenTCLAIkAPt++ MvNffprQb3HK/0atIbNryk9OZVZkzXE4gW1NoGty7tmacJkTcvGg0JEhzMLl5j86UHP1 msD3kSBiJFVjOp09zuk3ugTtkon11or/nBGB7gjysLRaspPTM+vyatRbXAx4+uIt6PJL Gfdk/PxM0O6dGmYR2R0RX8bKD6C+6kQyc4Gs2pXGlJGAXI4l9IY6SDGTw1A0yYcYHt/r SRJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wi0VjgwRqqJCZKwHOEVZBLTxawBpTy5voN78kbN3taY=; fh=AWoMoh5idy/FHgeAz7YSte/xnllPGJfrwmSwrK5ttFc=; b=oh9n12tt0/tUSR4JiU8AHq9JtpZXsOsxP2gtNdZZHkJ88S7PiCQf5gWL1EM31bsxlC mDWTWcIterhf49UThNuvsVjxbSvqnAPHxcPcObqtSFjqMi/RO0Wid84gzt3pVQMoOPXF 00PHGyK10I5MXsBeHIMQS8rSlZfZWkTVP1IIGbQ32wYH2K6T8jcQfuVHqdcgRPq1bw4a nonmUnYF2SJ53BUajsXLYqCPvOCPRcZQSkRfgYsa0bB+iTG1Q4RDlLO7Objz6eWDUugp E2WRpsBcEcBqy62SKADboAop2fbSCN7LFjt8M5Q45a4i4U6e3cyPxdYCoqlhkd+8rnrr zn4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gpnPOGGn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q31-20020a17090a1b2200b0024f338cd9f6si64248pjq.130.2023.06.23.11.33.45; Fri, 23 Jun 2023 11:34:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gpnPOGGn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232196AbjFWRxy (ORCPT + 99 others); Fri, 23 Jun 2023 13:53:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232063AbjFWRxv (ORCPT ); Fri, 23 Jun 2023 13:53:51 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26E3F26AF; Fri, 23 Jun 2023 10:53:49 -0700 (PDT) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2B478838; Fri, 23 Jun 2023 19:53:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1687542791; bh=RvSeLhGa/5gGKnl6MJifYRRStnLqOA15rBU2GyZaIAA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gpnPOGGnWbbNI6mgE/vyt+WOZ1wWZzWwHWSoazzgcDny10E8pmnqPdNpGZbl43Okx dXpw1JyL4BKYs4zYs2rLqk0GM7lN4RiA1F2VVWslyPLMJqenM0x9fndnOTJyCUDCKB BvbX9hAxZ1iKm6DxHoEvS7JKjxMjGLu58PSVk8kk= Date: Fri, 23 Jun 2023 20:53:46 +0300 From: Laurent Pinchart To: Geert Uytterhoeven Cc: Kieran Bingham , David Airlie , Daniel Vetter , Thomas Zimmermann , Magnus Damm , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 23/39] drm: renesas: shmobile: Move interface handling to connector setup Message-ID: <20230623175346.GQ2112@pendragon.ideasonboard.com> References: <0032f38b474a8ff63a7cdfdbc8b73766c3561729.1687423204.git.geert+renesas@glider.be> <20230623163950.GA2112@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 23, 2023 at 07:51:07PM +0200, Geert Uytterhoeven wrote: > Hi Laurent, > > On Fri, Jun 23, 2023 at 6:39 PM Laurent Pinchart > wrote: > > On Thu, Jun 22, 2023 at 11:21:35AM +0200, Geert Uytterhoeven wrote: > > > Move legacy interface handling to the connector setup code. > > > Set up bus_flags and bus_formats in display_info according to the > > > bus format and panel information from platform data, to make it more > > > similar with DT-based connector/bridge/panel setup. > > > This will allows us to use the same LCD interface setup code for both > > > > s/allows/allow/ > > > > > legacy and DT-based systems. > > > > > > Signed-off-by: Geert Uytterhoeven > > > > --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c > > > +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c > > > @@ -8,6 +8,7 @@ > > > */ > > > > > > #include > > > +#include > > > #include > > > > > > #include > > > @@ -66,15 +67,65 @@ static void shmob_drm_crtc_setup_geometry(struct shmob_drm_crtc *scrtc) > > > { > > > struct drm_crtc *crtc = &scrtc->crtc; > > > struct shmob_drm_device *sdev = to_shmob_device(crtc->dev); > > > - enum display_flags dpy_flags = sdev->connector.mode->flags; > > > + const struct drm_display_info *info = &sdev->connector->display_info; > > > const struct drm_display_mode *mode = &crtc->mode; > > > u32 value; > > > > > > - value = sdev->ldmt1r > > > - | ((mode->flags & DRM_MODE_FLAG_PVSYNC) ? 0 : LDMT1R_VPOL) > > > - | ((mode->flags & DRM_MODE_FLAG_PHSYNC) ? 0 : LDMT1R_HPOL) > > > - | ((dpy_flags & DISPLAY_FLAGS_PIXDATA_POSEDGE) ? LDMT1R_DWPOL : 0) > > > - | ((dpy_flags & DISPLAY_FLAGS_DE_LOW) ? LDMT1R_DIPOL : 0); > > > + if (!info->num_bus_formats || !info->bus_formats) { > > > + dev_warn(sdev->dev, "No bus format reported, using RGB888\n"); > > > + value = LDMT1R_MIFTYP_RGB24; > > > + } else { > > > + switch (info->bus_formats[0]) { > > > + case MEDIA_BUS_FMT_RGB888_3X8: > > > + value = LDMT1R_MIFTYP_RGB8; > > > + break; > > > + > > > + case MEDIA_BUS_FMT_RGB666_2X9_BE: > > > + value = LDMT1R_MIFTYP_RGB9; > > > + break; > > > + > > > + case MEDIA_BUS_FMT_RGB888_2X12_BE: > > > + value = LDMT1R_MIFTYP_RGB12A; > > > + break; > > > + > > > + case MEDIA_BUS_FMT_RGB444_1X12: > > > + value = LDMT1R_MIFTYP_RGB12B; > > > + break; > > > + > > > + case MEDIA_BUS_FMT_RGB565_1X16: > > > + value = LDMT1R_MIFTYP_RGB16; > > > + break; > > > + > > > + case MEDIA_BUS_FMT_RGB666_1X18: > > > + value = LDMT1R_MIFTYP_RGB18; > > > + break; > > > + > > > + case MEDIA_BUS_FMT_RGB888_1X24: > > > + value = LDMT1R_MIFTYP_RGB24; > > > + break; > > > + > > > + case MEDIA_BUS_FMT_UYVY8_1X16: > > > + value = LDMT1R_MIFTYP_YCBCR; > > > + break; > > > + > > > + default: > > > + dev_warn(sdev->dev, > > > + "unsupported bus format 0x%x, using RGB888\n", > > > + info->bus_formats[0]); > > > + value = LDMT1R_MIFTYP_RGB24; > > > + break; > > > + } > > > > It's a bit annoying to lose the ability to validate the bus format at > > probe time. Can it be kept. I'm also OK with restoring it later in the > > series if it gets in the way of the conversion, in which case a mention > > in the commit message would be nice. > > I guess I can keep it, somewhere. > Probably it should be validated for the DT case later, too. > BTW, drivers/gpu/drm/renesas/rcar-du/rcar_lvds.s doesn't check this > either, so I copied the bad example from the expert ;-) There's an endless amount of issues to fix. Patches are of course welcome :-) -- Regards, Laurent Pinchart