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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6AAF3C43334 for ; Thu, 9 Jun 2022 03:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc: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=A2G2QokvmnHUISVAw7BMN3LK4JlEiej0HSpYNwpdA0c=; b=f35QK4xf+72Tkb TiR0c4fG5CKbOo/tB9MAByz6WukoJNb5401m8bAawoY+uGxO+22bFcaWScnUjrjOGYYI039ehvG1O LL1GSxxs624LmMXAYRA4teLRM9m8S4ASaGvXPsxYXOR56gaLGtLmbMcXOPpBx5n48pnGLuUEMhhN2 5PPujwjfwQ0egMhjRDOUZdWPrjoxxCudjgw0Blwdb/eU1PHTboVsSe1/4oBtrJiGT+l5Sb6MwsEK6 N7KXf2zBzufont4utSuZAFuKJju941cgV6yOUPy8KEUWOHhjoASwO+bhGDxIf7YsgsrFzn1ME8iis xx9fWq54Z3IdX/8Yq2Vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz8cK-00FqP0-KP; Thu, 09 Jun 2022 03:13:52 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz8cH-00FqNk-KE for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2022 03:13:51 +0000 Received: by mail-lj1-x229.google.com with SMTP id d19so12240878lji.10 for ; Wed, 08 Jun 2022 20:13:47 -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=Cg9sE+vuZjEX9YCaL7REEngq1wqGuq9F/xFxllWMAB5cHQWx26cQWTIih8hP39X+ja r50bpgt6taCsqPhegTMKW6KyDorM892Tlin0XQy6nT0YlDtT/6inPaVEaNdh1ziYvWo8 hPJz+KJfCOuTX57no+X3SWIloWYDJMC6HtvSDnLucFHPzrtKTBKcATLhBYUWm81odjKr 5qhxU1+B7JPE+MELm6UUn1riP3P/aGtrnf36vULVz95yColxm6nBcxrqP/ucxHpq2V6A oxBZzGZjSTP8zBYV88QG63+jpsToBrPRb50DeLYjM4Q/BC4pmqNDoEUNWAbwTYNXKYyi yRZg== X-Gm-Message-State: AOAM531g3rusGyYndWQ64wbe+0jez3gJQQUbGatJ0PwmMo0lkzkvof66 cVI7ahOzmU8iI995QkgKuBNQAatxVXwyQRBs4OWS2VlC/2g= X-Google-Smtp-Source: ABdhPJyVjcaUH2c41gSc30QMinoAfJYAtQr3o/n0OUHhR0BwgrviMwb7SQgNmDG5Qp0lzNm1q2HT77RONbvJMun3cA4= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_201350_187408_DFA8B7B1 X-CRM114-Status: GOOD ( 23.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel