Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp642501rwa; Sat, 20 Aug 2022 10:42:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR5hmFE/Il/Ri6hpupn3IxHvpFkBw+WXoyOSgfMyeF4EP00EhL5hW1FMrFDla9pIMm+vwzag X-Received: by 2002:a17:906:84ef:b0:731:82a8:ea03 with SMTP id zp15-20020a17090684ef00b0073182a8ea03mr8361874ejb.462.1661017376709; Sat, 20 Aug 2022 10:42:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661017376; cv=none; d=google.com; s=arc-20160816; b=oYsnydGO9nc6y0ndY4EAsE+cOrCdvfHpj5NJ7I3wwgis4AeMwGU35QRAp+4l24tiPr MHhJCkJnNPYKgkXjUUJ/Ko2o9ZeaXo86iFrp7StViQntiw/gn/hUdWJAV5u168MnyN9l A9l25v3qFeYN0vSZnppW8R2/VPm648ncZ+KR0zH+a/gsYlZLCEcMLM0o2A2a6GDVUfVY TKenqLrzOriJD+dYn8OUAcjruvm1lycNwaG/dCM5qLL0rYbMBeRYNXFH1EFXIs3hxkjI HrM/WJQFEiYBiwZw5SEiN/7+H08v2OFfL/KCbyr1wGDHnI7hGWvGE0+KF1AkFJMJbDAv M6zg== 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:from :references:cc:to:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=8BklGePlOGzlIbyB2AgDUWEPfUhqmEkqZKMYHVCAb3o=; b=tdkJ5kSyRmL9u+99VcdPVDY/eD0bzdJQk/70tPkTRcO6KEsC7CS4g4lO7ULXlg/PkA W/tHlHTW2DWsOSvz++69smUBDddY/0wkK/AFmtt11Ocwep7otRcjfqust1aDxfcijd9g oDqDZ61h7zuY14duOC/XXQEq+SZD/JSIhb1d+pBat7gtDq6cu5FOq0lcut5JkBd3TVZC 5Mxu2YJ3szImlvm5YE7qAE3+HLDKNpOmB6wXpI6Z6DgPW6b2lus33LG+mVMf3N/MFhvn zLSfZLgbfDyfRptoe6LVmrs+qq/EnHAc3rvuaheeVHMsdoNbxUL/t3z7CPWP3lJ0PpMs 1iXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@tronnes.org header.s=ds202112 header.b="N/8vyFTC"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=tronnes.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga28-20020a1709070c1c00b00726347cbb61si6148367ejc.981.2022.08.20.10.42.31; Sat, 20 Aug 2022 10:42:56 -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=fail header.i=@tronnes.org header.s=ds202112 header.b="N/8vyFTC"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=tronnes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346130AbiHTRXE (ORCPT + 99 others); Sat, 20 Aug 2022 13:23:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229605AbiHTRXB (ORCPT ); Sat, 20 Aug 2022 13:23:01 -0400 Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D316440E3C for ; Sat, 20 Aug 2022 10:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org ; s=ds202112; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8BklGePlOGzlIbyB2AgDUWEPfUhqmEkqZKMYHVCAb3o=; b=N/8vyFTCNC0NQfLmopwfofzrMI cxEchZwTKKEv3rOttPBJkoH3/az9oOr+CeJG2ofTnEKJBK4cTDNGj+5xWzB2Sp2I8HmKkoHZhMe6M sbw5MdTw7QL2H6KTDimKuwPJsfTQM4vgCYA6U0HJdmnjP5gno5KQdcwR+uCvarfxd1kBAI1ydLdn6 O+uKEhq+KmwB0qKN+WjHHZxzCS4Gnp4j4HuHKP4AO4y/cZUwXAqi8Y4LjrpE8fmjtNRfZxAsoKwOF L6c/nh1rdlDkw/ecDnLLBpRKG29oFbgNu/ilORvV+04iF7sdVDASM0SPQo9bW+jHsIKt1nvxVJuKp KjU9Fxqg==; Received: from [2a01:799:961:d200:cca0:57ac:c55d:a485] (port=55975) by smtp.domeneshop.no with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oPSBU-0001ci-DT; Sat, 20 Aug 2022 19:22:56 +0200 Message-ID: <0255f7c6-0484-6456-350d-cf24f3fee5d6@tronnes.org> Date: Sat, 20 Aug 2022 19:22:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v1 23/35] drm/vc4: vec: Convert to the new TV mode property To: Maxime Ripard , Jernej Skrabec , Martin Blumenstingl , Chen-Yu Tsai , Philipp Zabel , Jerome Brunet , Samuel Holland , Thomas Zimmermann , Daniel Vetter , Emma Anholt , David Airlie , Maarten Lankhorst , Kevin Hilman , Neil Armstrong , Maxime Ripard Cc: linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Phil Elwell , Mateusz Kwiatkowski , linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven , Dave Stevenson , linux-amlogic@lists.infradead.org, dri-devel@lists.freedesktop.org, Dom Cobley , =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= References: <20220728-rpi-analog-tv-properties-v1-0-3d53ae722097@cerno.tech> <20220728-rpi-analog-tv-properties-v1-23-3d53ae722097@cerno.tech> From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= In-Reply-To: <20220728-rpi-analog-tv-properties-v1-23-3d53ae722097@cerno.tech> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, 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 Den 29.07.2022 18.35, skrev Maxime Ripard: > Now that the core can deal fine with analog TV modes, let's convert the vc4 > VEC driver to leverage those new features. > > We've added some backward compatibility to support the old TV mode property > and translate it into the new TV norm property. > > Signed-off-by: Maxime Ripard > > diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c > static int vc4_vec_connector_get_modes(struct drm_connector *connector) > { > - struct drm_connector_state *state = connector->state; > struct drm_display_mode *mode; > > - mode = drm_mode_duplicate(connector->dev, > - vc4_vec_tv_modes[state->tv.mode].mode); > + mode = drm_mode_duplicate(connector->dev, &drm_mode_480i); > + if (!mode) { > + DRM_ERROR("Failed to create a new display mode\n"); > + return -ENOMEM; > + } > + > + drm_mode_probed_add(connector, mode); > + > + mode = drm_mode_duplicate(connector->dev, &drm_mode_576i); Maybe the mode that matches tv.norm should be marked as preferred so userspace knows which one to pick? Noralf. > if (!mode) { > DRM_ERROR("Failed to create a new display mode\n"); > return -ENOMEM; > @@ -277,21 +313,95 @@ static int vc4_vec_connector_get_modes(struct drm_connector *connector) > return 1; > }