From patchwork Sat Nov 30 22:25:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 11268629 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B49CE109A for ; Sun, 1 Dec 2019 21:16:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 93FE120665 for ; Sun, 1 Dec 2019 21:16:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93FE120665 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 578E889CD9; Sun, 1 Dec 2019 21:16:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id DE5B46E9AF for ; Sat, 30 Nov 2019 22:26:03 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id q10so3140569wrm.11 for ; Sat, 30 Nov 2019 14:26:03 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=bupTiDGvcydZYN2Rnj/bXhOvQ014P8Ct3uBt5NbJKS8=; b=hJUO3ZRfAtVvBqUVK5Vcs9eprj0vX5VhjqITS8tVjh6Lnk8UPSZGul0/WU5467i/Rl mu5DFjLoJ3w7RoIu8IVJfDpyvWbXQSZ3lQaOFWyQvnSnu7a6VUvuYtS4TrgCcroTLtn6 Xcchw90oKSA7f8qNaobgoLubiXAUfDL2TL2DRwUX3s91f3YNhgG1RGFhkpNjhBkNsMpL 0nhaULKJyH0OlzR9IMGTBqZLGCGVdfORGE0d0xHaIbyEWQo6xxuR88x1JjRvPmC31UjT k2hjMZinHQQ9lJsoKR5lawu11Dzsr8aAF1Y2BIAZXVJhw6repL5FxQ18qdkLuHSnrrt+ PHug== X-Gm-Message-State: APjAAAVcP5H6B8XfQ2OoiQPv/bQyiNPTJsUzN4tagJfZCFmhQ/6LwYas 2DraHhbNE2LvHDViS9BSFeE= X-Google-Smtp-Source: APXvYqwjN3lyPniHb9sLZ4uyBqG1FGZjCFKXKddgkyxV/pen1ugXXLKQtr2k6+big4hC461LRG5JBw== X-Received: by 2002:adf:f5c2:: with SMTP id k2mr60867770wrp.118.1575152762350; Sat, 30 Nov 2019 14:26:02 -0800 (PST) Received: from localhost.localdomain (p200300F1371CB100428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:371c:b100:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id i71sm36265650wri.68.2019.11.30.14.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Nov 2019 14:26:01 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, narmstrong@baylibre.com Subject: [PATCH] drm: meson: venc: cvbs: fix CVBS mode matching Date: Sat, 30 Nov 2019 23:25:55 +0100 Message-Id: <20191130222555.2005375-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 01 Dec 2019 21:16:14 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bupTiDGvcydZYN2Rnj/bXhOvQ014P8Ct3uBt5NbJKS8=; b=fi6nj6EVbWIV/2fhXGOQgkkRptg3mNzbFfVm4h7Lx3k31Gd/rdMvatqedH2AHz+fTI JA/tugb+Ci5XR+WmopY5bNT3Kyc/wh4bp+rlLoxlfqmtdV7Pnnj5aaoixosAp7mmvaqy jippza5lpblGhOfDmzNUK+vsBOeBoY0cQoW5dTGXBO4cOrf5mlZ3yiMxbScXD0aLIWt5 Aes9ebuA77Em4dDWQ+DshvhfptHrVRohoWlsTXL6zRv+W32H2/MH5XIFvTcKQeXuUTR2 Aij4/EWbitIheNds46i9dsiG36YypcQcwmsV80mFsBv7rxHKQsOZ2ptDJ247SzPm9uYC WDwA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Martin Blumenstingl , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Drop the picture_aspect_ratio from the drm_display_modes which are valid for the Amlogic Meson CVBS encoder. meson_venc_cvbs_encoder_atomic_check and meson_venc_cvbs_encoder_mode_set only support two very specific drm_display_modes. 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. This patch fixes "kmscube" and X.org output using the CVBS connector with the Amlogic Meson VPU driver. Prior to this patch kmscube reported: failed to set mode: Invalid argument Additionally it makes the CVBS mode checking behave identical to 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}) which are both not setting "picture_aspect_ratio" either. 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 | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_venc_cvbs.c b/drivers/gpu/drm/meson/meson_venc_cvbs.c index 9ab27aecfcf3..2ddcda8fa5b0 100644 --- a/drivers/gpu/drm/meson/meson_venc_cvbs.c +++ b/drivers/gpu/drm/meson/meson_venc_cvbs.c @@ -49,7 +49,6 @@ struct meson_cvbs_mode meson_cvbs_modes[MESON_CVBS_MODES_COUNT] = { 720, 732, 795, 864, 0, 576, 580, 586, 625, 0, DRM_MODE_FLAG_INTERLACE), .vrefresh = 50, - .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, }, }, { /* NTSC */ @@ -59,7 +58,6 @@ struct meson_cvbs_mode meson_cvbs_modes[MESON_CVBS_MODES_COUNT] = { 720, 739, 801, 858, 0, 480, 488, 494, 525, 0, DRM_MODE_FLAG_INTERLACE), .vrefresh = 60, - .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, }, }, };