Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3192504ybl; Sun, 8 Dec 2019 09:19:59 -0800 (PST) X-Google-Smtp-Source: APXvYqwSAPeHBYdLC7zh+JWucd2WGg5BH+aZGSH2zlcAIb5c2Ciz7ZCSDxoi83jIWSwck8F+S8Bs X-Received: by 2002:aca:aad8:: with SMTP id t207mr20225702oie.138.1575825599193; Sun, 08 Dec 2019 09:19:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575825599; cv=none; d=google.com; s=arc-20160816; b=qcfRu8oUjaaVBqQFmhvWK05QmS9mP8O0lJ59miONyKUPQRSNmbDU+3EBR84XIJq/3n EN0krDmWYczqMzWH5n20ZhUvhomq88BkE2sRBPGUzuUhDuXiGaFnfYHuAbIgVnwQaZFu Kw1Hf7uwaLqrd/+9AyVz18sISs7E/4OXWVrcTUjqBROeoOkxYNQe9yblLfGMSeCpgj5w BgbJq/MysJscLYaSrJYumQDv4clSEJgXJywU6APFYX3QuMTe7UdJMB/dlG5LYm5pmKcz mL/+2KmpgT6os6FaLiUqt97eTvNNlWUvoOlTqUMN84PRqDtnbO4nbnSggstuxv+bDo8o GxBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Af0AIrF2pn2WiljuwZLbgsnTz6mwhPcm7wLICRG7aXU=; b=nzv/966KwKkDXRvrsehI0BJepcdWb3D+8ftdWg3CMTkeJtfMa04lYH1M4lF5ijSCfv TkZ8lLXGGIRl+GB8mrbkW2i1xOP+qadYBshYkjf/kPmKq+9uys3xLR3z1B/aTyLwhX+I M68TjHhZhbzjHEztjn1sPICJbgk9Ua9UZP7/YW0OT9ihPe0rav2t8wt0ApsaC30PSYb/ ECpAu3aTMRzYSMB+2OHiJvwTdft8+Bd818ghAqtJPFgdtIYvKWUUm7BsJau3X9k/prlr MgkgtnLCiDSLwdpIq6O9miF2wTNayay254gHVCJcxcnS53SsZm/b7pIRTm4sLJBohzSd /edQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=HSeJVcOu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p28si10672142oth.296.2019.12.08.09.19.47; Sun, 08 Dec 2019 09:19:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=HSeJVcOu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbfLHRTH (ORCPT + 99 others); Sun, 8 Dec 2019 12:19:07 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:32830 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726472AbfLHRTD (ORCPT ); Sun, 8 Dec 2019 12:19:03 -0500 Received: by mail-wm1-f66.google.com with SMTP id y23so13645501wma.0 for ; Sun, 08 Dec 2019 09:19:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Af0AIrF2pn2WiljuwZLbgsnTz6mwhPcm7wLICRG7aXU=; b=HSeJVcOunCaBhrbYJRxC+JJuLUSzSb8dl6z/zdArFxVXJJsloVOq8463hSurjc+3TP wjIn7/G6dNRHl5p/UKKibhYd1Ua7uLmpkb/c0umZcPjJ9IRBF8eNRlRSByt0FpLCACF3 sCjMP0xkROPJikNqBxmC5M945CXBFcQnF/FJ9N7/Dh3vDXMyYfGLRr9lZ8E1M6zW3aef Ril7fpN8dRm/tVbhlGd5n73y61PGYgG3FWsJ6eqJgCJasaCqv9e6AaTzmsFfBvKUh+vD DF617jh3WLGIzM82GuhNLbFmAtEgEHlXfpkYujDD7aKXPE99Bfbhnd/qvbFikkFPQvDd VjQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Af0AIrF2pn2WiljuwZLbgsnTz6mwhPcm7wLICRG7aXU=; b=EiOxCm83m5uhV1Pw2b8T5pWEreobQBgw/96YvqTSldY8J8YcRWAx9tzs2Pe7KeV9H5 I7XOMr8GOIOvhsY5Dzh6hjZQTfB6y/OuAGKVjIvRbSHWnHb5GVF9yp6e6qXeuHXcImsQ J99u6cp8qBq6J9fKgTnab/fRE9uROk2crwbMdvjFEK72/yh3cty/xRhOyKW9tkg5J06P L3dJPnZRXBLf/eUwL+6sbLlWkHme8iAk17IDnhaR7MULijtpHqapRQ2DwOG9/O7Odr3r m/2rr6l3VS/6ymlpAx6B2XQJOmBWi1m8TWgOxnradvnT7+bXaAfMWI+gsZXpoU1bbKD4 6sGg== X-Gm-Message-State: APjAAAUGmQOtRpT82ezCvgwa+XM/Es7YDg+c3ii52cxiC7Q7MJIJKon2 MgszP2cUPDQU+AWIFZlN2hs= X-Received: by 2002:a7b:c190:: with SMTP id y16mr21086627wmi.107.1575825541855; Sun, 08 Dec 2019 09:19:01 -0800 (PST) Received: from localhost.localdomain (p200300F1371AD700428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:371a:d700:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id g25sm11791383wmh.3.2019.12.08.09.19.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Dec 2019 09:19:01 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, narmstrong@baylibre.com Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, airlied@linux.ie, daniel@ffwll.ch, Martin Blumenstingl Subject: [PATCH v2 2/2] drm: meson: venc: cvbs: fix CVBS mode matching Date: Sun, 8 Dec 2019 18:18:32 +0100 Message-Id: <20191208171832.1064772-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191208171832.1064772-1-martin.blumenstingl@googlemail.com> References: <20191208171832.1064772-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With commit 222ec1618c3ace ("drm: Add aspect ratio parsing in DRM layer") the drm core started honoring the picture_aspect_ratio field when comparing two drm_display_modes. Prior to that it was ignored. When the CVBS encoder driver was initially submitted there was no aspect ratio check. Switch from drm_mode_equal() to drm_mode_match() without DRM_MODE_MATCH_ASPECT_RATIO to fix "kmscube" and X.org output using the CVBS connector. When (for example) kmscube sets the output mode when using the CVBS connector it passes HDMI_PICTURE_ASPECT_NONE, making the drm_mode_equal() fail as it include the aspect ratio. Prior to this patch kmscube reported: failed to set mode: Invalid argument The CVBS mode checking in the sun4i (drivers/gpu/drm/sun4i/sun4i_tv.c sun4i_tv_mode_to_drm_mode) and ZTE (drivers/gpu/drm/zte/zx_tvenc.c tvenc_mode_{pal,ntsc}) drivers don't set the "picture_aspect_ratio" at all. The Meson VPU driver does not rely on the aspect ratio for the CVBS output so we can safely decouple it from the hdmi_picture_aspect setting. Fixes: 222ec1618c3ace ("drm: Add aspect ratio parsing in DRM layer") Fixes: bbbe775ec5b5da ("drm: Add support for Amlogic Meson Graphic Controller") Signed-off-by: Martin Blumenstingl --- drivers/gpu/drm/meson/meson_venc_cvbs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/meson/meson_venc_cvbs.c b/drivers/gpu/drm/meson/meson_venc_cvbs.c index 6b8a074e4ff4..1bd6b6d15ffb 100644 --- a/drivers/gpu/drm/meson/meson_venc_cvbs.c +++ b/drivers/gpu/drm/meson/meson_venc_cvbs.c @@ -72,7 +72,11 @@ meson_cvbs_get_mode(const struct drm_display_mode *req_mode) for (i = 0; i < MESON_CVBS_MODES_COUNT; ++i) { struct meson_cvbs_mode *meson_mode = &meson_cvbs_modes[i]; - if (drm_mode_equal(req_mode, &meson_mode->mode)) + if (drm_mode_match(req_mode, &meson_mode->mode, + DRM_MODE_MATCH_TIMINGS | + DRM_MODE_MATCH_CLOCK | + DRM_MODE_MATCH_FLAGS | + DRM_MODE_MATCH_3D_FLAGS)) return meson_mode; } -- 2.24.0