Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3510900rwi; Sun, 16 Oct 2022 12:21:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OpEGwrjIt7PNAktLhBYPRZhZ7jtwna0QIdZT8T6lxpxseMR/EHvIc1wzFLmH61Gu3Db3L X-Received: by 2002:a63:1849:0:b0:43c:8346:57f7 with SMTP id 9-20020a631849000000b0043c834657f7mr7458725pgy.222.1665948088447; Sun, 16 Oct 2022 12:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665948088; cv=none; d=google.com; s=arc-20160816; b=pe7Jg4uNkfVh32etsSwk0BEuOI0Eh5IC6ZaOr+53JaVnXEsGWdf0f2O9SqLQCrAyyV eHC/rdmyrryDJse06vCMHt4ErPbKOkzvgsngfaBfkWrwSPWbIM6bYOm7SUxWJ1kUIdn5 X/hWBbSjHK99wZ77qAJBg9baQqYHqi0Exj0354GM+sRnnIppFycRK7GFWboT4w21B3cC K/eCV6Dr75Olv6kmS/h2sWwPT+/9WarqOT95P5r+I54MHLuOTWgtnVU9ZQRJFhsVsJt4 OtN/gci3lbdm04t2Rz6AW5450HrrNbeaJS+8n1JRrOoATcrC+JuezNaCF4G92Xe4F/Pc 2GEw== 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:reply-to:subject:user-agent :mime-version:date:message-id:from:dkim-signature; bh=9R5DRkDar97t7RGa7ZkHbwXUyJ5tEv/b58zZkFRpKIU=; b=FD84hLJBZcrPr+GqjhXLJm3APHs6IK0dOnLCIufAL1nadIoRw8SQMeKP96enEfnybU 8C6T+4cWIwMDY1BYzPtwbOSt+83+/ad88XCnjq1xAKgR3NddQX/WX/OAikQzZ7q4WXEa lt09wQufJXnFfcTgAMlmeXbkwlHnurwwEtu6cFCpWSjGwOVC3qSBRgdjJBMkAV9UB9gr MdulpXcYCdcAVSGmAm9AyM68j5/vXxnUnUoYX1u341aSlvOpLvHoiySrBbb5wCMKoxjP jPTCdXNdNujm1POdkdFlkanIllAcd+NzjO1N6aEk+UohphQv7h9mXwtoR6AV2bkRMXVG Lkjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UqSCa35z; 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 m1-20020a170902db0100b00184306292a5si6725852plx.229.2022.10.16.12.20.53; Sun, 16 Oct 2022 12:21:28 -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=UqSCa35z; 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 S229822AbiJPS4a (ORCPT + 99 others); Sun, 16 Oct 2022 14:56:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbiJPS42 (ORCPT ); Sun, 16 Oct 2022 14:56:28 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1620356CB for ; Sun, 16 Oct 2022 11:56:26 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id s20so14446477lfi.11 for ; Sun, 16 Oct 2022 11:56:26 -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:reply-to:subject:user-agent:mime-version:date:message-id:from :from:to:cc:subject:date:message-id:reply-to; bh=9R5DRkDar97t7RGa7ZkHbwXUyJ5tEv/b58zZkFRpKIU=; b=UqSCa35znTFAW2XjpbRvdh7DaqZHpIJN6v4AXacEElZvxQlvD6nM1NZ8Ag4JRpl3yk tQA8VjWsFBR1wJX/Ss+CPqCol92EEvV5Raj+pM0cSuC99zTk0doGl7wmBnhKuxgF1Ygk fg/0fyZAwvrTzcQj7VkncMJ+fonMoDA4arz05pgdToty0rBiXkoKPedTqvwmaoXAbTg+ v3woOrrTfXBCGMASf2KyRUme4mDbwgrtVNogi54B0uEQTGHlblMTfWTbB8IpJkPkXm6d e3JS1uHEJHUVESdK67TNOFvIWA7dgP90CYwGzpBFC03lpCGGnnp4EI/sbS04iqDtsz+L ezsw== 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:reply-to:subject:user-agent:mime-version:date:message-id:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9R5DRkDar97t7RGa7ZkHbwXUyJ5tEv/b58zZkFRpKIU=; b=tiDojKijZMCIo+WuIbc/JJavbHbLkC9jSlEg7oyXaaJQsoxNv3Jr7ga+oNuvUw1QjO vYzFqk1V8ZgQVmON0qtVB/RfoG7eiH0aKp+sNUfGHGhC7mLqjcwQe1fx3HlT29WwKVR0 aQgygbhRD+N6x0Pfr6baAkF3n6nhxqDCmZobJ3s5K1Iqx+nPP7GHx1BGFdv040edCOLO r85FdqqL4/UdGrwhnJGQWeuEgGNd3b3xk+3GTl3u9KGyPsTiR816HazqmApI8ql9tlQc zVp6FoFJynWCE0RhBpQ3kbM2ouWq/UwnNevViy2hmwRGYyONHljF2XVL/oCHLAV31Vgd +iBQ== X-Gm-Message-State: ACrzQf2sPtRO1XO5kB5TmG+AUIR5yDcnhyYWvIX/H+SrFIBziMu9NsZf sKR8yZkPkUw72JMW/3jPSpk= X-Received: by 2002:ac2:46da:0:b0:4a2:2963:71b0 with SMTP id p26-20020ac246da000000b004a2296371b0mr2564386lfo.600.1665946584951; Sun, 16 Oct 2022 11:56:24 -0700 (PDT) Received: from ?IPV6:2a02:a31a:a240:1700:64bb:87df:aad7:a9f0? ([2a02:a31a:a240:1700:64bb:87df:aad7:a9f0]) by smtp.googlemail.com with ESMTPSA id p24-20020a2ea4d8000000b0026de7400f3bsm1237043ljm.5.2022.10.16.11.56.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 Oct 2022 11:56:24 -0700 (PDT) From: Mateusz Kwiatkowski X-Google-Original-From: Mateusz Kwiatkowski Message-ID: <0f2beec2-ae8e-5579-f0b6-a73d9dae1af4@gmail.com> Date: Sun, 16 Oct 2022 20:56:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v5 20/22] drm/vc4: vec: Convert to the new TV mode property Reply-To: kfyatek+publicgit@gmail.com, kfyatek+publicgit@gmail.com To: Maxime Ripard , Karol Herbst , Jani Nikula , Tvrtko Ursulin , Daniel Vetter , Maarten Lankhorst , David Airlie , Joonas Lahtinen , Lyude Paul , Maxime Ripard , Emma Anholt , Chen-Yu Tsai , Samuel Holland , Ben Skeggs , Thomas Zimmermann , Rodrigo Vivi , Jernej Skrabec Cc: Dom Cobley , linux-sunxi@lists.linux.dev, Dave Stevenson , =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Hans de Goede , Phil Elwell References: <20220728-rpi-analog-tv-properties-v5-0-d841cc64fe4b@cerno.tech> <20220728-rpi-analog-tv-properties-v5-20-d841cc64fe4b@cerno.tech> Content-Language: pl In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FREEMAIL_REPLYTO, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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, Urgh. I cannot send e-mails apparently today, as I removed the second half of the previous message. Here goes: > @@ -454,13 +563,6 @@ static int vc4_vec_encoder_atomic_check(struct drm_encoder *encoder, > struct drm_connector_state *conn_state) > { > const struct drm_display_mode *mode = &crtc_state->adjusted_mode; You could add here something like: + const struct vc4_vec_tv_mode *tv_mode = + vc4_vec_tv_mode_lookup(conn_state->tv.mode); + + if (!tv_mode) + return -EINVAL; This should explicitly make it impossible to enter the equivalent condition in vc4_vec_encoder_enable() that causes the problem mentioned in the previous e-mail. This is probably basically impossible already, but I triggered that when testing a follow-up change I'd like to post shortly. > - const struct vc4_vec_tv_mode *vec_mode; > - > - vec_mode = &vc4_vec_tv_modes[conn_state->tv.legacy_mode]; > - > - if (conn_state->crtc && > - !drm_mode_equal(vec_mode->mode, &crtc_state->adjusted_mode)) > - return -EINVAL; If you're removing the reference mode, then I think you should at least add checks that the crtc_clock is set to 13.5 MHz (it's otherwise ignored) and that crtc_htotal is either 858 or 864 (using a switch over reference_mode->htotal as I proposed in my comment to patch 19/22 would double as such check), as all other values causes VEC to output garbage. Best regards, Mateusz Kwiatkowski