From patchwork Tue Jul 19 18:58:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 9238149 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7537A600CB for ; Tue, 19 Jul 2016 18:59:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6400626A4D for ; Tue, 19 Jul 2016 18:59:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58D6226E81; Tue, 19 Jul 2016 18:59:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2771F26A4D for ; Tue, 19 Jul 2016 18:59:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED7B46E114; Tue, 19 Jul 2016 18:59:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id E894F6E024 for ; Tue, 19 Jul 2016 18:59:33 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id x83so3792410wma.3 for ; Tue, 19 Jul 2016 11:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oHYaqmp0KrMaxbUZkBx2UeqPk9R02MiJwMK/wMhlsUA=; b=m12QclzUiw5T20oJcoPL0L7pc53pPnfHIa7ise7NTJmp02x62/GoYqAci0+Kf9+KQr 0p/GeZaJdVIshtFZDWvuaueLv5JTZQUT0J+0740//ibGTsVq7/VMT/VzWi10mqZf7MuF uqKYHi5shqXgRq7NSSgeSS5AJ47R+CW69fFNbreRaS7lLOBBTHXzYIRN8Pj9xclopouZ Nm6ZS4xmihIU7SKf9Cx8EKveRDEzyrw/TwPd62CcDuCrDVMy3fTNzEfyX5oVnbdugQyc qXD2qzHLhgZmAAl6IexxqeUCnFlGLoMeJpiUQIWB30Zh1NmPJVs/sXVX9dn3ot9wV4E+ SJgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oHYaqmp0KrMaxbUZkBx2UeqPk9R02MiJwMK/wMhlsUA=; b=GxYzhpj00n4zJ1lS/2OQYTQvSCmkjsTlgMh8rZNczzE3tx5ousOg6CqOt5rYClequl n5W7qzSEIxuxAiKwomCQifZf0Ug9Xyju/i+y4r/HC85jEH+Stld97x+nPBsa2TTIXzKu 5NmSwm5uS0oco81UUybPV+PgTTkPwNfoNiOQZasXgBjaDBPqNm2yS9zR9Q2if3aZCasU gYsiEtwhQfFHNYPYE48GjdfJk4vkpMfHGhlwDA+VEfhBIu3PJbyfXBriurRKVbQwq+qq lSqvA1JuR4V9fjFZTfnCLkhy4PD6UaE8WnE5HHdv9f73cZHuLmyKy4bpqW/soYH92Fmk K9pA== X-Gm-Message-State: ALyK8tLT8TjMVbHtHvn0K3mMEcAI5rzReLPQiZURc5lux9qVmZyBxmE1kpfMQoRPkvnNOQ== X-Received: by 10.28.86.214 with SMTP id k205mr5923895wmb.17.1468954771400; Tue, 19 Jul 2016 11:59:31 -0700 (PDT) Received: from twisty.fritz.box (x4d02e19a.dyn.telefonica.de. [77.2.225.154]) by smtp.gmail.com with ESMTPSA id i8sm7755380wmg.21.2016.07.19.11.59.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 11:59:30 -0700 (PDT) From: Mario Kleiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/5] drm/vc4: Disallow interlaced modes on DPI. Date: Tue, 19 Jul 2016 20:58:57 +0200 Message-Id: <1468954741-30993-2-git-send-email-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1468954741-30993-1-git-send-email-mario.kleiner.de@gmail.com> References: <1468954741-30993-1-git-send-email-mario.kleiner.de@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP We already don't expose such modes to userspace, but make sure userspace can't sneak some interlaced mode in. Signed-off-by: Mario Kleiner Cc: Eric Anholt --- drivers/gpu/drm/vc4/vc4_dpi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c index 275fedb..1e1f6b8 100644 --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c @@ -340,9 +340,20 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) } } +static bool vc4_dpi_encoder_mode_fixup(struct drm_encoder *encoder, + const struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode) +{ + if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) + return false; + + return true; +} + static const struct drm_encoder_helper_funcs vc4_dpi_encoder_helper_funcs = { .disable = vc4_dpi_encoder_disable, .enable = vc4_dpi_encoder_enable, + .mode_fixup = vc4_dpi_encoder_mode_fixup, }; static const struct of_device_id vc4_dpi_dt_match[] = {