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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83DE6C7618D for ; Tue, 14 Mar 2023 23:55:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbjCNXzs (ORCPT ); Tue, 14 Mar 2023 19:55:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231189AbjCNXzm (ORCPT ); Tue, 14 Mar 2023 19:55:42 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B28330B2E for ; Tue, 14 Mar 2023 16:55:42 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id iw3so1467176plb.6 for ; Tue, 14 Mar 2023 16:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678838142; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=WizLnkQzu/0Y1Lv+vmWA4A6vgwmutnCW/cgvOhxwUTw=; b=UAGxVbFv0cQvP6ngXKOLsXbFWg6L6YKGo31pKfx4gjVa6KNN/EzIS19kGnfsw3nKRi LIV2OziXg8cHxR+3KHoMjx+WYppl35RN0DdSLxEP1dZO5luQjK0ZwCIXQforu7NtB33H hfC7Fl77A8pG78umAMLy21DiR7htKoHYtsWC9toCkNsmCQvLpt9P6PpP3arKBBevH7Ra oiFSCXIj3HHBLNU8aDP3Gykm3o2s3JuOkVJDinWxVUTfDaoKsTM8gTwaiC4pbRGs0+fU r/HQuuaQES11oueU5j3KsYz3DbtO3yTDWYWhof0dtbWAalFM3+R/R7Hv2Rt9/5BSzoRd O4SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678838142; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WizLnkQzu/0Y1Lv+vmWA4A6vgwmutnCW/cgvOhxwUTw=; b=tf4MeaRqCiK5WC2PAzq6NtVpEcWJBZJbXjnbmf4jB83HGAsq6U+OP0BXwuLMAbNEgH hIiim6cgFcOW27MlJSQk9StJ9p8Mfhe2EsdZlRxxx+w7GZXfbkf8ZAnmw6akeKjUM7wV /KnnJRkA1jpdRKIEX5MUofxUkQbaSQORu0SlKrKNpcaOHtjhBecPEMNW5DTSg0L0WxMy uyACPNciBVX5RIVe/nOttfhzyvLgt4qZXW0eB8KGm/QFcifV2RQ7RpaLfEh70sThCwP0 QSX0924djHtUDVqS/aTAf4zwlA9rdp6ZK8ze+2KwF6YxLPQ5VVtGjbK02VsIgRdpMhGK RstQ== X-Gm-Message-State: AO0yUKWSQWQUcKDYNhQALKVrWZITlxDDMPH3NeTugOu0V4qbP0K64i5V +ZaaxfaOGXRYTmd/0a0PPBw= X-Google-Smtp-Source: AK7set8wnh5F6ybtoXpVjlSt1QRsAACmpE0qxf013sV4LMlYya6a5g+OVOCTpPVe8B5Ky0s2zJza/A== X-Received: by 2002:a17:90a:f0c4:b0:23d:3383:1d68 with SMTP id fa4-20020a17090af0c400b0023d33831d68mr4397542pjb.35.1678838141694; Tue, 14 Mar 2023 16:55:41 -0700 (PDT) Received: from Gentoo (n220246252084.netvigator.com. [220.246.252.84]) by smtp.gmail.com with ESMTPSA id d4-20020a17090ad3c400b00233d6547000sm12764pjw.54.2023.03.14.16.55.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 16:55:41 -0700 (PDT) Date: Wed, 15 Mar 2023 07:55:33 +0800 From: Jianhua Lu To: Doug Anderson Cc: Neil Armstrong , Sam Ravnborg , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/panel: Fix panel mode type setting logic Message-ID: References: <20230314114451.8872-1-lujianhua000@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 14, 2023 at 10:12:02AM -0700, Doug Anderson wrote: > Hi, > > On Tue, Mar 14, 2023 at 4:45 AM Jianhua Lu wrote: > > > > Some panels set mode type to DRM_MODE_TYPE_PREFERRED by the number > > of modes. It isn't reasonable, so set the first mode type to > > DRM_MODE_TYPE_PREFERRED. This should be more reasonable. > > > > Signed-off-by: Jianhua Lu > > --- > > drivers/gpu/drm/panel/panel-abt-y030xx067a.c | 2 +- > > drivers/gpu/drm/panel/panel-auo-a030jtn01.c | 2 +- > > drivers/gpu/drm/panel/panel-edp.c | 4 ++-- > > drivers/gpu/drm/panel/panel-innolux-ej030na.c | 2 +- > > drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 2 +- > > drivers/gpu/drm/panel/panel-newvision-nv3052c.c | 2 +- > > drivers/gpu/drm/panel/panel-novatek-nt35950.c | 2 +- > > drivers/gpu/drm/panel/panel-novatek-nt39016.c | 2 +- > > drivers/gpu/drm/panel/panel-orisetech-ota5601a.c | 2 +- > > drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 4 ++-- > > drivers/gpu/drm/panel/panel-simple.c | 4 ++-- > > 11 files changed, 14 insertions(+), 14 deletions(-) > > Can you explain more about your motivation here? At least for This demonstrates a bad way to set DRM_MODE_TYPE_PREFERRED for panels with more than one mode. It mislead the future contributors to send a patch with this piece of code. There is also a discussion for it. https://lore.kernel.org/lkml/904bc493-7160-32fd-9709-1dcb978ddbab@linaro.org/ > panel-edp and panel-simple it seems like it would be better to leave > the logic alone and manually add DRM_MODE_TYPE_PREFERRED to the right > mode for the rare panel that actually has more than one mode listed. I think we can order it to the first mode if the mode type should be DRM_MODE_TYPE_PREFERRED, It's also same. > That feels more explicit to me. > > -Doug