Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp28638iol; Wed, 8 Jun 2022 20:46:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGVA1qGixw1DFgNpyyCRfavslD01wksPljvGMTNq58L12qwdMfal4EZI4FNXc73Bn0m1uA X-Received: by 2002:a05:6402:2805:b0:42a:ea9b:e6a0 with SMTP id h5-20020a056402280500b0042aea9be6a0mr42133415ede.102.1654746361972; Wed, 08 Jun 2022 20:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654746361; cv=none; d=google.com; s=arc-20160816; b=gaNpvNNhjpXXLYntruJcZCg8CYh2BnG1HVja03xSe6WjFuWZUcqk3kS4VVSJY0FLHI YqLPiE2AwRMKL3fbjy45Vkx7EOBbY5N5GyyshAy5Rx0lMia9BRFTFrOtfnNMJg7+AxMU Xp8Fq5DjXo4qRWz2lUETlZGSZse7mdreps3SlLu6JR8h1+oaGe+P5tSOKQLP+xPLWblP qubaVlKbPVP42lcSVZ3kaYyf6uhkHSF/lHwYBGMesn0m75PEkRWJpJfPDizLtYXavavs dIc8qLTPV2/PDPxbTa06dMjmUOvumN6IXWgFWymLZ2QidFEpwwkCgUerzi9ijYgx0m9c ecuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WAB02C3ZkH9VbHetvGWn5Py2rhK3DERsYsHyjK16wTE=; b=qp/2BqD/DBWqHqwF33czwbqQm/sfy9tJeDvztFsHdlaX1t7g4TK0NS2JRFzP7EjkgT 57wD2wxIWzwqxvF4aNJe5UX4Ce2y/jDYWPqB/ARq7S2ddb8ayR85RsvTOCIqWeWMYVTK wmngn7ZwRyordoT72BiDvLVoJuA6znjnfFvcjAYp9uwiahR4k1jx/9rZVUGBJMiAnPNC CYeDoZ3xa21dlwSM+zY4LuTxc5pTBzWh+Is7WlkzNBcplR8E2xRmIc6VcLvrvvHpKf2G fgT1JSQlIT+G4BvnKk4b5GEQdPs9JM4kycdBvERZ+9w7P1TWaZA9BxLM0+Zi9+mPiATh t05A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XbRWmIGG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c23-20020a1709060fd700b006ff165f19e6si22560650ejk.350.2022.06.08.20.45.35; Wed, 08 Jun 2022 20:46:01 -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 header.i=@chromium.org header.s=google header.b=XbRWmIGG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237507AbiFIDNv (ORCPT + 99 others); Wed, 8 Jun 2022 23:13:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230414AbiFIDNu (ORCPT ); Wed, 8 Jun 2022 23:13:50 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 002CEA1BC for ; Wed, 8 Jun 2022 20:13:46 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id q15so22523790wrc.11 for ; Wed, 08 Jun 2022 20:13:46 -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=WAB02C3ZkH9VbHetvGWn5Py2rhK3DERsYsHyjK16wTE=; b=XbRWmIGGGenwao2Tk7wJ1Mr9i3hHZQHKx9STxE+UuTq7k04t4aXKpWuKhPOVswBUD9 pEO8M6LEtGpJhPGuBYJYojpVZpAFGHKwRBoxKbKnWUiFKJmi1gd9o0k/2AjheVs6HNgB 3035f8G9eiId/7FVig6JqCQvOd+JSX9dxM+eE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WAB02C3ZkH9VbHetvGWn5Py2rhK3DERsYsHyjK16wTE=; b=T7UriT7Tinmk/eX/6uc+BsIFV2m5VJVmBVvrrqY78v+qB3CniaoAXs3RKBBJ74x0BS VeVULKv4XcbiT46VY30g55koEKGe16GAUNRUj9vrNxs+xlBdAJX3tdJTpbDTrzjpFAvb GB1m63SUReWauXmn47b7Yr0aVu7A6fbQaKp7aamhpYkCrvlqc4/YIYV81qom4ObYVLAv 7jkfHpIYDJi1jiTw3YYUzgagpO8ORpO/OY3TaRC+hO9P0IDKoJ4dyXXHpXtJyMFsQH6o DCVAJhKj5QmssxHwMB1b+XPYiITtc8dNiX1uKVQ2jLZ1PcBP3fAFlJvMa4KQRlIZTzAh mJrQ== X-Gm-Message-State: AOAM530ETu6yC+MxUVEI4otTkls23Yh/zpEOBas/VQJzZkRvxZfEJYgt kKiU2nPuP/n+YyARnJ7e/o7ATf8nro+qC+A9vqEc/NMvW3M= X-Received: by 2002:a05:6402:149:b0:431:7dde:9b59 with SMTP id s9-20020a056402014900b004317dde9b59mr15089962edu.339.1654744414987; Wed, 08 Jun 2022 20:13:34 -0700 (PDT) MIME-Version: 1.0 References: <20220608094816.2898692-1-hsinyi@chromium.org> <20220608094816.2898692-9-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Thu, 9 Jun 2022 11:13:09 +0800 Message-ID: Subject: Re: [PATCH v6 8/8] drm: Config orientation property if panel provides it To: Doug Anderson Cc: Hans de Goede , Sam Ravnborg , Stephen Boyd , Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel , Rob Clark , Rob Herring , Linux ARM , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,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 Wed, Jun 8, 2022 at 10:17 PM Doug Anderson wrote: > > Hi, > > On Wed, Jun 8, 2022 at 2:48 AM Hsin-Yi Wang wrote: > > > > @@ -269,6 +280,31 @@ void drm_panel_bridge_remove(struct drm_bridge *bridge) > > } > > EXPORT_SYMBOL(drm_panel_bridge_remove); > > > > +/** > > + * drm_panel_bridge_set_orientation - Set the connector's panel orientation > > + * if the bridge is a panel bridge. > > + * > > + * @connector: The connector to be set panel orientation. > > + * @bridge: The drm_bridge to be transformed to panel bridge. > > Ideally you should have a kernel doc to describe what you're returning. > > > > + */ > > +int drm_panel_bridge_set_orientation(struct drm_connector *connector, > > + struct drm_bridge *bridge) > > +{ > > + struct panel_bridge *panel_bridge; > > + > > + if (!bridge) > > + return 0; > > + > > + if (bridge->funcs != &panel_bridge_bridge_funcs) > > + return 0; > > nit: Why do you need to handle NULL bridge and the case that someone > calls you with something other than a panel-bridge? I'm not convinced > that's useful. In general kernel style doesn't do massive validation > of parameters unless there's a reason for it. ...if we do need to > handle them then it feels like they should be returning -EINVAL or > something, not 0. The only caller had checked it. I can remove the check here. > > > > @@ -917,10 +917,13 @@ void drm_bridge_hpd_notify(struct drm_bridge *bridge, > > enum drm_connector_status status); > > > > #ifdef CONFIG_DRM_PANEL_BRIDGE > > +bool drm_bridge_is_panel(const struct drm_bridge *bridge); > > struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel); > > struct drm_bridge *drm_panel_bridge_add_typed(struct drm_panel *panel, > > u32 connector_type); > > void drm_panel_bridge_remove(struct drm_bridge *bridge); > > +int drm_panel_bridge_set_orientation(struct drm_connector *connector, > > + struct drm_bridge *bridge); > > I suspect that you need some dummy versions of your new functions > defined if "CONFIG_DRM_PANEL_BRIDGE" is not defined. Otherwise we're > going to be yelled at by the kernel robot eventually. > > -Doug