Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1372787rwi; Wed, 26 Oct 2022 14:35:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4j20tJ0bY33nrgqF1PIocYTlDVaBjonz0w2hO5H/kNwiDVnDZtd3r0O/FlUcOKlLONxIcB X-Received: by 2002:a17:907:1dde:b0:78d:9725:cc69 with SMTP id og30-20020a1709071dde00b0078d9725cc69mr40138343ejc.305.1666820134628; Wed, 26 Oct 2022 14:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666820134; cv=none; d=google.com; s=arc-20160816; b=fWkLgfj3W3e86ViSpgjuOgFPtOzvhcGRIJPYSNs3MzX5zJ/JVv27yvVE/uUSBBkLTv mp3IyYeJZ/74VIHRZgdgNpwmMEKMqCkD79nBbnbc//x9Y6zA6zd98NiXKPv2i7OJGX1W yWlKLDCF8sSTpxXAzNwHAo9RHTEWH7lEZrgV1CpXAA7FsdVlgPgP4juEZ9hEXwa2qVOx 0t3+lDdQEsRz1O0V3KAqvKbl1RthsS873tOcEH3SEWQkS+02gA5YdYJHvQW4mU7YbEiP 2EcnzIOb30GdXfqEwDwnsOnaik2iBln6/7xRSxj1yXGFcyBAeLlq+l1enBUatUGf5sd3 IhiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:dkim-signature; bh=xwQzSxEYATvXw39X4hIfByL5axaSJ+hp0GX3dcFg9xE=; b=cAcxKq3ZeqwclRt0fZ+047r58L1DFD3dRIu7Jst73wKXUXBjsNgSAuUCWIjPI86Pov 7J+KWUIIWN2LZh4ui0GPnw/DLLGpO6394ORtDZlJsT2m0SPB44DU4qPsRiem/eSa2roj 2Dc9yiGV4x8+1buGr5NDrrHqEJCQ/XA3/WXQSH00JSKdGkwmJElymdng9SPnEkSVeKwr 8gBfY4tlkBTM9A5igmPY8L+2GOp+ju2SrWijat39UFvOYVZ/yY+5krPKZUTzl5+DG0d8 +lZL9efj2DAm9T6ygYk4uT/LI+07YzAAZxaxZJ2l3k7Gt3hh/bAMXkEPDYlAX9mJbwrO q8DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="RpM/5T09"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd15-20020a170907968f00b00792e39c31dcsi1913279ejc.988.2022.10.26.14.34.46; Wed, 26 Oct 2022 14:35:34 -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=@gmail.com header.s=20210112 header.b="RpM/5T09"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233403AbiJZVZc (ORCPT + 99 others); Wed, 26 Oct 2022 17:25:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233395AbiJZVZZ (ORCPT ); Wed, 26 Oct 2022 17:25:25 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E9DF22B29 for ; Wed, 26 Oct 2022 14:25:25 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id b2so31502500lfp.6 for ; Wed, 26 Oct 2022 14:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:from:to :cc:subject:date:message-id:reply-to; bh=xwQzSxEYATvXw39X4hIfByL5axaSJ+hp0GX3dcFg9xE=; b=RpM/5T09Rkd7whH1lYSUsRaIYsLxkJ0RHNwjJCSxMK6DXCHNXTKvm/1fd6/rqZteFR Rx0Dd96ySW4Ipv/w5BooL5M2xPSrcjrb8u6NBcWH5FYSfZQAuMc7l+4tKtdhQ+GupunV QxDrwD5p/mLnrG+XlPTaY3Bs1cduAAinJEmPjaKEHtI6PU/jlh7sqgyaCKUUx4NHkvwe gQ7yfcspKa3yD8qwC59MMnhKCEbG5hH4oqDos1yN52iQjO8nTh3HigOQyXj7O5Dbi9ZV h8NZhnbLYWMt7sRrzSiuElVjYuCoOb7cJR9nec0Geq3YRRQA9H69XcMHraBJpty9UP+5 LQ0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xwQzSxEYATvXw39X4hIfByL5axaSJ+hp0GX3dcFg9xE=; b=hMo4QQq4pyQigw5fxrHKPoyYWVlgpYk4g72wRiebz8QYdUb3ifVKshdxt4XnQxR+Dk jzpQZY7w7AchyUhpPGDZwbLsbK4exi0o3iXgPB7nipKVED7Yr0N+D4rks1Gkz+bOzW2Y Y/ZMBgT5uSo8oqsKHNs9Er0OqhfjW7tFkcLvkNLPauJyslDqfnA9MvwN5mBDDMBwxvpt iO7l6ZXZ3MlLoB1wvYX1gC8jJ+6d2KaQBC5Kj+pa/xjzYylnSyeNmE2OR6mbKdehO/LO VCOipRNoC6l8B5jDAQ95wcyA1klqCLvgN2aex5dCuPFgFS9/PLWfhIkHAqTuPAOH624g kgWw== X-Gm-Message-State: ACrzQf0JREMpVqNSwpMl9HyPDyTSl1rfPUsCLpVQLcfH43AZH63J6F4l MoeLTaiDV1G+wSMKm2/jddo= X-Received: by 2002:ac2:5b50:0:b0:4af:d01:63d0 with SMTP id i16-20020ac25b50000000b004af0d0163d0mr2786228lfp.596.1666819523402; Wed, 26 Oct 2022 14:25:23 -0700 (PDT) Received: from ?IPV6:2a02:a31a:a240:1700:c898:de98:30b3:a07? ([2a02:a31a:a240:1700:c898:de98:30b3:a07]) by smtp.googlemail.com with ESMTPSA id p8-20020a2eba08000000b00277041268absm1070023lja.78.2022.10.26.14.25.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Oct 2022 14:25:22 -0700 (PDT) From: Mateusz Kwiatkowski X-Google-Original-From: Mateusz Kwiatkowski Message-ID: <1adf0b0b-3743-4b5a-9416-823b8bf903fa@gmail.com> Date: Wed, 26 Oct 2022 23:25:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v6 14/23] drm/modes: Properly generate a drm_display_mode from a named mode To: maxime@cerno.tech, Karol Herbst , Emma Anholt , Ben Skeggs , Chen-Yu Tsai , Rodrigo Vivi , Maarten Lankhorst , Jani Nikula , Daniel Vetter , Thomas Zimmermann , Tvrtko Ursulin , Samuel Holland , Jernej Skrabec , David Airlie , Maxime Ripard , Joonas Lahtinen , Lyude Paul Cc: linux-sunxi@lists.linux.dev, intel-gfx@lists.freedesktop.org, Phil Elwell , linux-arm-kernel@lists.infradead.org, nouveau@lists.freedesktop.org, Hans de Goede , Dom Cobley , dri-devel@lists.freedesktop.org, Dave Stevenson , linux-kernel@vger.kernel.org, =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= , Geert Uytterhoeven References: <20220728-rpi-analog-tv-properties-v6-0-e7792734108f@cerno.tech> <20220728-rpi-analog-tv-properties-v6-14-e7792734108f@cerno.tech> Content-Language: pl In-Reply-To: <20220728-rpi-analog-tv-properties-v6-14-e7792734108f@cerno.tech> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Hi Maxime, > +static struct drm_display_mode *drm_named_mode(struct drm_device *dev, > + struct drm_cmdline_mode *cmd) > +{ > + struct drm_display_mode *mode; > + unsigned int i; > + > + for (i = 0; i < ARRAY_SIZE(drm_named_modes); i++) { > + const struct drm_named_mode *named_mode = &drm_named_modes[i]; > + > + if (strcmp(cmd->name, named_mode->name)) > + continue; > + > + if (!named_mode->tv_mode) > + continue; > + > + mode = drm_analog_tv_mode(dev, > + named_mode->tv_mode, > + named_mode->pixel_clock_khz * 1000, > + named_mode->xres, > + named_mode->yres, > + named_mode->flags & DRM_MODE_FLAG_INTERLACE); > + if (!mode) > + return NULL; > + > + return mode; > + } > + > + return NULL; > +} > + You didn't add tv_mode_specified to struct drm_named_mode, and left the if (!named_mode->tv_mode) condition here. This will break on NTSC. Best regards, Mateusz Kwiatkowski