Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1329368pxb; Tue, 8 Feb 2022 14:51:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7c//6gymCzfffKhAdzXdPUD/rs5uq6sUmVSFlCGARNzvpHQBIxWTEXn3lDS13oS4mUBGu X-Received: by 2002:a17:90a:d58b:: with SMTP id v11mr232483pju.100.1644360695533; Tue, 08 Feb 2022 14:51:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644360695; cv=none; d=google.com; s=arc-20160816; b=fYoDOKK95P2MYBwHFBnjSjXVz07sQ4mWrIIaJkbSoiBOA9tfX/ZiX5EJAMu4CyN5w4 Ui64cCljlwfveP35nIk8/FpFoCq92J5X3QG5dt7dM17Fcsa00Os3vYvgdTxY7WgUV2Sa 4XPUiTdSXjP0ZrulzR1nWXJhbeyYSQk938OXBrsc0TAUqB9cNFCy+7umr4H+UYv0gyHp yQ2cZ/QCPDjdxxVxPIhEhV4APTkbtfVoDP9SH3oF3h7AV+NYWknRD12LCFIiFjEY+r9/ FF5zbsdVG1HJxrmflFfk12ShW7y/2T/8Y6ChAbI6F9bQ5pzk0+aFWW3hcERskUOO46KW +1tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=2nn1yw6s4IptKKkqexjsVuYGnZXdnpYECt5wmy4nCLI=; b=s/N5GgqG99XpkkWSN2Ienati0sbMI3Ab0Z5hGlyTwCNNXoDLar7q1nWDDCdT4isgQd 7OLm68jZjUa7r7yPQMV+C+bsnfZZoLtGHOzZJnpD5mUd/cDgMmt9R49fLqLUgZ8WTscC R3sbjIjaX2neNnVwUZGHWiYQqKhUUGroujRzI3lshvJJ1+datdwlSYN/mTwLxFcF/ehB X5LBXLG36LvpjgFrLCB/a0yMGFUxZilS8Te7/J/ZpOX0lULVMZIZM0Uc4VzFDmI+DwX+ Rj+rQCzjOvDUBv6rN4s7i/+J5fZHCXnj9pc7rjq7RKc5BjN6X1SG4vQvn32rdxeBCt2W UYqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RbemnSrh; 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 s197si4906549pgs.198.2022.02.08.14.51.20; Tue, 08 Feb 2022 14:51:35 -0800 (PST) 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=RbemnSrh; 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 S1348823AbiBHIH3 (ORCPT + 99 others); Tue, 8 Feb 2022 03:07:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348858AbiBHIH0 (ORCPT ); Tue, 8 Feb 2022 03:07:26 -0500 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC539C03FEC1 for ; Tue, 8 Feb 2022 00:07:25 -0800 (PST) Received: by mail-il1-x133.google.com with SMTP id o10so13317408ilh.0 for ; Tue, 08 Feb 2022 00:07:25 -0800 (PST) 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:content-transfer-encoding; bh=2nn1yw6s4IptKKkqexjsVuYGnZXdnpYECt5wmy4nCLI=; b=RbemnSrhXrKKcmiNAQChCDTCfg6l6ls5LgDIaRQkZLTLaWYDjG6MM8osL8JkLF3bCp /Kq4sd9uU0NEZm+Wz8RgynFJAbap5ItA1CILACu+hFiwrULXgQ7eCzkQ14TNBanKSWIw TjONrz2gQtSvRje+DKUublwrHeFhbhnyVgZ3k= 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:content-transfer-encoding; bh=2nn1yw6s4IptKKkqexjsVuYGnZXdnpYECt5wmy4nCLI=; b=v1E/qBxVFI3XWHWZNXlcPLD1FqqzgXmSgyz5FdQDbhX8yOZbr6SrB1EBz5LqFDdoaK cskxaUAIZ4L73jL+kCcCldo09baSdev/gETAgTuXjsmElfdiAz6WEA8cmvSHRmnwL/AF pYBdTdArzLKVJ/u2Ij0/YmNwQ8hz9BRgaeIu5c8EtfmnhLXUFY5tevgVj5YoL7mIDb7x /jLW/oytxbZGTgsWHe+YvLdeDKd2htEN1AI/XfZdOeiBFAQGrR/qW2dTviLI+rGNnnYL lAB5uUl/170OuHZyc08tBmThFmiewnvZwu5XqslvGdJSNGd2EBou7pAUP8O52/EFK13F p3dw== X-Gm-Message-State: AOAM530M5Lb60PLSlgXMesyPODeSWqXYYDXFxnC4tcAFHskVFxEsoj7x 6AmV3GiQyavidTb7XmbrT3yrmLsMKLqIVPIogGZgTA== X-Received: by 2002:a05:6e02:18c6:: with SMTP id s6mr1637885ilu.230.1644307645048; Tue, 08 Feb 2022 00:07:25 -0800 (PST) MIME-Version: 1.0 References: <20220208073714.1540390-1-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Tue, 8 Feb 2022 16:06:59 +0800 Message-ID: Subject: Re: [Intel-gfx] [PATCH v7 1/3] gpu: drm: separate panel orientation property creating and value setting To: =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= Cc: dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Chun-Kuang Hu , devicetree@vger.kernel.org, Simon Ser , linux-kernel@vger.kernel.org, Maxime Ripard , Alex Deucher , Rob Herring , linux-mediatek@lists.infradead.org, Thomas Zimmermann , Harry Wentland , Matthias Brugger , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 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 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 Tue, Feb 8, 2022 at 3:52 PM Ville Syrj=C3=A4l=C3=A4 wrote: > > On Tue, Feb 08, 2022 at 03:37:12PM +0800, Hsin-Yi Wang wrote: > > +int drm_connector_init_panel_orientation_property( > > + struct drm_connector *connector) > > +{ > > + struct drm_device *dev =3D connector->dev; > > + struct drm_property *prop; > > + > > + prop =3D drm_property_create_enum(dev, DRM_MODE_PROP_IMMUTABLE, > > + "panel orientation", > > + drm_panel_orientation_enum_list, > > + ARRAY_SIZE(drm_panel_orientation_enum_list)); > > + if (!prop) > > + return -ENOMEM; > > + > > + dev->mode_config.panel_orientation_property =3D prop; > > Leak when called multiple times. I guess you could just put > this into drm_connector_create_standard_properties() instead > and avoid that issue entirely. > I'll add a check for dev->mode_config.panel_orientation_property to avoid the leak issue if called multiple times. If we add in drm_connector_create_standard_properties(), we still need another function to attach the property earlier for bridge/connectors that require this property, since not all bridge/connectors need this property. > -- > Ville Syrj=C3=A4l=C3=A4 > Intel